We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexSuggestions & BugsWebsite,  Documentation,  Book Bugs › Errors running zipdecode program
Page Index Toggle Pages: 1
Errors running zipdecode program (Read 642 times)
Errors running zipdecode program
May 11th, 2008, 3:16pm
 
I have encountered an error running the zipdecode program from the visualizing data book.  I cannot figure out the problem, but suspect is no so much the program, but a video/cpu issue.

I'm running this on a macbook pro 1.8mHz with 2gb ram and the latest processing app.


This is where the program stops:
void readData() {
 String[] lines = loadStrings("zipsall.tsv");
 parseInfo(lines[0]);  //read the header
 
 places = new Place[totalCount];
 for (int i = 5000; i < 14500; i++) {   <---EDITS
   //println(i);
   //println(lines);
   places[placeCount] = parsePlace(lines[i]);   <--ERRORS
   placeCount++;
 }
}

I can change the prarms of the for loop to small number (less than 9400) and the program runs fine, producing a map of the selected data points.  but if I try to run the whole file, it crashes.

Any help...
here is the error message

java.lang.ArrayIndexOutOfBoundsException: 9403

at Temporary_4259_3874.readData(Temporary_4259_3874.java:54)

java.lang.ArrayIndexOutOfBoundsException: 9403

at Temporary_4259_3874.readData(Temporary_4259_3874.java:54)

at Temporary_4259_3874.setup(Temporary_4259_3874.java:27)

at processing.core.PApplet.handleDisplay(PApplet.java:1390)

at processing.core.PGraphics.requestDisplay(PGraphics.java:690)

at processing.core.PApplet.run(PApplet.java:1562)

at java.lang.Thread.run(Thread.java:613)


at Temporary_4259_3874.setup(Temporary_4259_3874.java:27)

at processing.core.PApplet.handleDisplay(PApplet.java:1390)

at processing.core.PGraphics.requestDisplay(PGraphics.java:690)

at processing.core.PApplet.run(PApplet.java:1562)

at java.lang.Thread.run(Thread.java:613)

Re: Errors running zipdecode program
Reply #1 - May 11th, 2008, 5:20pm
 
I figured it out.

I didn't have a space after the # in the first line that indicates the number of records.  When I fixed that, it ran.


Ben, thanks for the detailed examples to allow me to recreate this.
Page Index Toggle Pages: 1