Skip to content

Commit eec2fac

Browse files
committed
table fixes and notes
1 parent eaa1549 commit eec2fac

File tree

3 files changed

+36
-6
lines changed

3 files changed

+36
-6
lines changed

core/src/processing/data/Table.java

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ public Table(Iterable<TableRow> rows) {
159159
for (TableRow row : rows) {
160160
if (!typed) {
161161
setColumnTypes(row.getColumnTypes());
162+
typed = true;
162163
}
163164
addRow(row);
164165
}
@@ -417,6 +418,10 @@ protected void parseAwfulCSV(BufferedReader reader,
417418
char[] c = new char[100];
418419
int count = 0;
419420
boolean insideQuote = false;
421+
422+
int alloc = 100;
423+
setRowCount(100);
424+
420425
int row = 0;
421426
int col = 0;
422427
int ch;
@@ -462,14 +467,23 @@ protected void parseAwfulCSV(BufferedReader reader,
462467
}
463468
setString(row, col, new String(c, 0, count));
464469
count = 0;
465-
if (row == 0 && header) {
470+
row++;
471+
if (row == 1 && header) {
466472
// Use internal row removal (efficient because only one row).
467473
removeTitleRow();
468474
// Un-set the header variable so that next time around, we don't
469475
// just get stuck into a loop, removing the 0th row repeatedly.
470476
header = false;
477+
// Reset the number of rows (removeTitleRow() won't reset our local 'row' counter)
478+
row = 0;
479+
}
480+
// if (row % 1000 == 0) {
481+
// PApplet.println(PApplet.nfc(row));
482+
// }
483+
if (row == alloc) {
484+
alloc *= 2;
485+
setRowCount(alloc);
471486
}
472-
row++;
473487
col = 0;
474488

475489
} else if (ch == ',') {
@@ -491,6 +505,9 @@ protected void parseAwfulCSV(BufferedReader reader,
491505
if (count > 0) {
492506
setString(row, col, new String(c, 0, count));
493507
}
508+
if (alloc != row) {
509+
setRowCount(row); // shrink to the actual size
510+
}
494511
}
495512

496513

core/todo.txt

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,12 @@ X https://github.com/processing/processing/issues/257
66
X PVector discussion with Dan
77
o Jer and Dan will look at their code, plus toxiclibs
88

9+
table
10+
X major performance improvements to 'newlines' parsing
11+
X debugging table parsing with header rows
12+
X bug fix for setting data type
13+
14+
915
applet removal
1016
_ remove Applet as base class
1117
_ performance issues on OS X (might be threading due to Applet)
@@ -73,6 +79,8 @@ _ hint(ENABLE_RETINA_PIXELS) or hint(ENABLE_HIDPI_PIXELS)
7379
_ hint(ENABLE_2X_PIXELS)?
7480
_ hidpi is Apple's name as well
7581
_ no high-res display support for OpenGL
82+
_ https://github.com/processing/processing/issues/2573
83+
_ https://jogamp.org/bugzilla/show_bug.cgi?id=741
7684
_ no high-dpi support for core on Windows
7785
_ https://github.com/processing/processing/issues/2411
7886
_ retina sketches slow to start

todo.txt

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,19 @@ X increase heap size to 256m (-Xmx256) per Manindra request
33
X use a ButtonGroup so that the current Mode cannot be de-selected
44
X https://github.com/processing/processing/issues/2545
55

6-
_ color selector for the pref
7-
_ https://github.com/processing/processing/pull/2568
86

97
pulls
108
X Implementation of a list of open sketches in the Sketch menu
119
X https://github.com/processing/processing/pull/2551
10+
_ color selector for the pref (not reading it properly)
11+
_ https://github.com/processing/processing/pull/2568
12+
13+
_ look at the sound library https://github.com/wirsing/ProcessingSound
14+
15+
_ moving p5 examples to the web repo
16+
all examples are out of "processing/java" and are now in "processing-docs/content/". The Book examples have been removed entirely from our repositories.
17+
_ remove reference.zip from main repo
18+
_ processing-web/java_generate/ReferenceGenerator
1219

1320
_ try new syntax package
1421
_ possibility of libraries folder inside a particular sketch?
@@ -23,8 +30,6 @@ _ move examples into web repo
2330
_ make reference and examples build process part of dist
2431
_ separate ant targets, but only require them for dist
2532
_ as separate targets, folks can build explicitly if they'd like
26-
_ remove reference.zip from main repo
27-
_ processing-web/java_generate/ReferenceGenerator
2833

2934
_ shouldn't write sketch.properties unless it's a non-default mode
3035
_ https://github.com/processing/processing/issues/2531

0 commit comments

Comments
 (0)