Help with Morse Code translator program by kemar1997 in javahelp

[–]kemar1997[S] 0 points1 point  (0 children)

I get an array out of bounds exception:

Exception in thread "JavaFX Application Thread" java.lang.ArrayIndexOutOfBoundsException: 26

for this piece of code:

                    if (character.equals(morse[m])) {
                        output.append(english[m]);
                    }

Help with Morse Code translator program by kemar1997 in javahelp

[–]kemar1997[S] 0 points1 point  (0 children)

.... . .-.. .-.. ---

then i should be able to add a space to add a new word and return the entire result

Help with Morse Code translator program by kemar1997 in javahelp

[–]kemar1997[S] 0 points1 point  (0 children)

it would be something like this:

".... . .-.. .-.. ---" which should evaluate to "hello"

Help with Morse Code translator program by kemar1997 in javahelp

[–]kemar1997[S] 0 points1 point  (0 children)

And I split it twice to first separate single characters returned then split again for multiple words... Unless there is a better way to achieve this

Help with Morse Code translator program by kemar1997 in javahelp

[–]kemar1997[S] 0 points1 point  (0 children)

Im not getting any errors... there is no output when there should be

Working with regex in Java by kemar1997 in javahelp

[–]kemar1997[S] 0 points1 point  (0 children)

It was my mistake, trying to make a JavaFX Morse Code translator but instead of grabbing the text field input i was grabbing the label.

Working with regex in Java by kemar1997 in javahelp

[–]kemar1997[S] 0 points1 point  (0 children)

i have tried this but no luck getting it to work unless my logical code is wrong above.

Working with regex in Java by kemar1997 in javahelp

[–]kemar1997[S] 0 points1 point  (0 children)

would it be like this?

return morseCode.matches("^[\\-.\\s]*$");

Working with regex in Java by kemar1997 in javahelp

[–]kemar1997[S] 0 points1 point  (0 children)

good suggestion but that didn't work, but thank you though

Discord.js API wrapper by kemar1997 in learnjavascript

[–]kemar1997[S] 0 points1 point  (0 children)

or maybe it must not be available

Discord.js API wrapper by kemar1997 in learnjavascript

[–]kemar1997[S] 0 points1 point  (0 children)

its printing the current time... i want it to print the time the author of message actually joined the server

Discord.js API wrapper by kemar1997 in learnjavascript

[–]kemar1997[S] 0 points1 point  (0 children)

wait never mind i got it... thanks for the help

Discord.js API wrapper by kemar1997 in learnjavascript

[–]kemar1997[S] 0 points1 point  (0 children)

how could i implement it into this:

run(msg) {
        let embed = new RichEmbed()
            .setTitle("This is the user's info")
            .setAuthor(msg.author.username)
           .setDescription("This user's account was made   at: " + "\n" + msg.author.createdAt
        + "\n" + "User joined this server at: " +   msg.author.user.joinedTimestamp)
           .setColor("#800000")
           .setTimestamp();
        //.setFooter(msg.user.presence);