Hi - new programmer here. I am trying to graph an array of dates onto an axis, but I'm having trouble figuring out the number of days between dates. I tried the function found in
this post, but kept getting an error that said "function getTime() does not exist."
I have an array has a few hundred strings in the format: "Tue, 16 Jun 2009 17:24:09 -0500". How can I find how many days have elapsed since the oldest date for each date in the array?
I am a new processing user trying to figure out how to compare two columns of data from a Google docs spreadsheet. The first column is age, the second is sex. My goal is to grab the ages for all males and females separately. I am able to successfully print the array of ages, and the array of sex, but when I try combining the two, I keep getting various errors (most frequently "null pointer exception"). My ultimate goal is to create 2 rows of circles, the first representing female ages, the second male ages. Here's the code:
int[] numbers = getNumbers(); String[] sex = getSex();
fill(255,40); noStroke(); for (int i = 0; i < numbers.length; i++) { if( sex[i].equals("F") && numbers[i] > 0 ) { ellipse(numbers[i] * 10, width/2, 10,10); }; }; };
And the functions:
int[] getNumbers() { println("Asking Google for numbers..."); sm = new SimpleSpreadsheetManager(); sm.init("RandomNumbers", googleUser, googlePass); sm.fetchSheetByKey(sUrl, 0);
int n = sm.currentListEntries.size(); int[] returnAge = new int[n];
for (int i = 0; i < n; i++) { if( sm.getCellValue(5,i) != null ) { returnAge[i] = int(sm.getCellValue(5, i)); }; }; return(returnAge); };
String[] getSex() { println("Asking Google for sex..."); sm = new SimpleSpreadsheetManager(); sm.init("Sex", googleUser, googlePass); sm.fetchSheetByKey(sUrl, 0);
int m = sm.currentListEntries.size(); String[] returnSex = new String[m];
for (int i = 0; i < m; i++) { if( sm.getCellValue(6,i) != null ) { returnSex[i] = sm.getCellValue(6, i); }; };