I am trying to split() a very simply .csv file at all commas using the split function. There are some empty fields at the very end of some lines, which Processing is treating as simply not existing, rather than empty fields. Example:
String myString = "i expect, this to be, of length six,,,";
println(myString.split(",").length);
// prints "3", not "6"
Is this behaviour by design, or a bug? I've found inserting a character at the end of the line triggers the expected behaviour. Example:
String myString = "i expect, this to be, of length six,,,!";
println(myString.split(",").length);
// actually prints "6"
So it doesn't seem that Processing is ignoring blank fields altogether... Surely this kind of behaviour isn't by design?
I'm working on a project where I need to be able to show a large number of nodes (on the order of 10000) moving around in 2-dimensional space. I'm running into some problems achieving a decent frame rate though when drawing each node using an ellipse.
As the simplest possible example, consider the following piece of code:
int frameCount = 0;
void setup() {
}
void draw() {
for (int i=0; i <= 14000; i++) {
ellipse(5,5,5,5);
}
frameCount += 1;
println("" + frameCount);
}
On a 2011 Macbook Pro (i5 processor) I can only get on the order of 5 frames per second running this minimal piece of code. Can anyone suggest any ways to speed up the drawing process, or is this a limitation I'm pretty much stuck with?