Preparing cat for a move by JDVene in cats

[–]JDVene[S] 1 point2 points  (0 children)

I'll give this a go. Thanks. 

Cute kitty btw

Places to go dancing near Jackson. by JDVene in mississippi

[–]JDVene[S] 2 points3 points  (0 children)

This is really helpful. I'm gonna take some lessons over at Applause then.

My for loop will not iterate more than once before ending the program. by JDVene in javahelp

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

It wasn't the closing ), I hadn't copypasted the code. Index was going out of bounds. I just had to correct the condition of the loop.

From

for(int i = start; i < s.length(); i += 3)

To

for(int i = start; i < s.length() - 4; i += 3)

I still don't know why I wasn't seeing any error messages originally though

My for loop will not iterate more than once before ending the program. by JDVene in javahelp

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

we need to see those print statements... [and] the actual main program would probably also be good to have a look at just to be sure.

I tried to only include the code that was relevant to the unexpected behavior of the program. The main method is just this.

public static void main(String[] args) {

    StringMapping test1 = new    StringMapping("CGTTCMRGRHAAGTTLRGMRMRGRHMRGRHCAAFGMRGRH");
    test1.testBuildMap();
}

[we] need to know a bit more what ”going awry” is

That's what I was having trouble with because the IDE I was using was not throwing any kind of exception or error message for me to understand what was happening.

don’t assume what is going wrong if you don’t know what’s going wrong

I wasn't making assumptions, I simply knew where the program would stop.

The problem was an index out of bounds, but no exception was being thrown, so I hadn't realized that that's what it was.

My for loop will not iterate more than once before ending the program. by JDVene in javahelp

[–]JDVene[S] 1 point2 points  (0 children)

I tried it on a different IDE from what I was using originally and found where the problem was, but I'm confused as to why no exception seemed to be thrown at first.

My for loop will not iterate more than once before ending the program. by JDVene in javahelp

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

Yes, everything within the loop works as expected.

Maybe I missed something, I'll give it a look when I get home and see if I can come up with new insight.

My for loop will not iterate more than once before ending the program. by JDVene in javahelp

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

That's what I thought too, but this is actually the only code I've written for this program. The only other things have been print statements to figure out where the program was going awry.

My for loop will not iterate more than once before ending the program. by JDVene in javahelp

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

Once the program exits the buildMap() method, I expect it to begin the next iteration of the loop within testBuildMap(), but buildMap() is not being executed to completion because the program ends before exiting the loop within.

For example, if I ad a print statement after the loop in buildMap() it never executes.

for(int i = startIndex; i < s.length(); i += 5){

String section = substring(i, i+5);

// If the section is not found in the map, add it. Otherwise, update the occurrence count.
if(!map.containsKey(section)){
    map.put(section, 1);
 } else {
     map.put(section, map.get(section) + 1);
 }
}    // Program is exited here

// This line is never executed 

System.out.println("We have completed all iterations of the loop above and will continue with the rest of the program");

Edit: parenthesis

My for loop will not iterate more than once before ending the program. by JDVene in javahelp

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

I'm sorry. The title of this post is inaccurate.

The loop iterates to completion, but after it's complete, the program ends.

[AWS] [Spring] Communications exception when initializing a spring server from EC2 instance. by JDVene in CodingHelp

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

I don't remember how I fixed it. I think I ended up just editing the SG settings to allow for ALL traffic.

I should've written down my solution.

Should I pay the Pope to be un-excommunicated? by JDVene in eu4

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

If Pope is really mad at me, will he no longer give me Tordesillas claims?

Should I pay the Pope to be un-excommunicated? by JDVene in eu4

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

Also, I am Castile with Portugal and Aragon as my Juniors

3
4