From 400fda8bb0965fe0e33cdbbd72662eb38681bc79 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Wed, 16 Apr 2014 15:40:33 -0400 Subject: [PATCH 1/2] fix for categorical missing values --- core/src/processing/data/Table.java | 11 ++++++++++- core/todo.txt | 1 + 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/core/src/processing/data/Table.java b/core/src/processing/data/Table.java index 8dd7b73a6..d945f9d2c 100644 --- a/core/src/processing/data/Table.java +++ b/core/src/processing/data/Table.java @@ -2087,7 +2087,12 @@ public class Table { if (piece == null) { indexData[row] = missingCategory; } else { - indexData[row] = columnCategories[col].index(String.valueOf(piece)); + String peace = String.valueOf(piece); + if (peace.equals(missingString)) { // missingString might be null + indexData[row] = missingCategory; + } else { + indexData[row] = columnCategories[col].index(peace); + } } break; default: @@ -2933,6 +2938,9 @@ public class Table { } + /** + * Treat entries with this string as "missing". Also used for categorial. + */ public void setMissingString(String value) { missingString = value; } @@ -3562,6 +3570,7 @@ public class Table { read(input); } + /** gets the index, and creates one if it doesn't already exist. */ int index(String key) { Integer value = dataToIndex.get(key); if (value != null) { diff --git a/core/todo.txt b/core/todo.txt index 3172a887f..83928da74 100644 --- a/core/todo.txt +++ b/core/todo.txt @@ -1,4 +1,5 @@ 0226 core +X fix parsing with missing categorical values _ XML.getChildren() throwing NPE when getInt() called on non-existent var From 511f5a82081578e204386b9a5db0dfd36926d977 Mon Sep 17 00:00:00 2001 From: Ben Fry Date: Wed, 16 Apr 2014 19:09:30 -0400 Subject: [PATCH 2/2] update to u55 for OS X build, and disallow 1.8 --- build/build.xml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/build/build.xml b/build/build.xml index 095542697..2b3d91b8d 100755 --- a/build/build.xml +++ b/build/build.xml @@ -20,13 +20,12 @@ + Java 1.8 caused build problems (with ECJ?) so not supported. --> - @@ -152,7 +151,7 @@ - +