Skip to content

Instantly share code, notes, and snippets.

@jkeam
jkeam / GroovyExcelParser.groovy
Created November 16, 2012 02:57
A groovy script to parse an excel document.
import org.apache.poi.ss.usermodel.*
import org.apache.poi.hssf.usermodel.*
import org.apache.poi.xssf.usermodel.*
import org.apache.poi.ss.util.*
import org.apache.poi.ss.usermodel.*
import java.io.*
class GroovyExcelParser {
//http://poi.apache.org/spreadsheet/quick-guide.html#Iterator
@rschumm
rschumm / machtcher.java
Created April 4, 2012 21:59
JUnit Matcher / Hamcrest
mit dem Matcher können komplexere Vergleiche mit "assertThat" getestet werden, hier ein einfaches Beispiel,
welches testet, dass zwei Daten am gleichen Tag sind.
import org.hamcrest.BaseMatcher;
import org.hamcrest.Description;
import org.hamcrest.Matcher;
...
@jimlindstrom
jimlindstrom / plot-likert.r
Created November 30, 2011 03:36
Plotting Likert-scale data with R
# Inputs
feature_names <- c("Feature 5", "Feature 4", "Feature 3", "Feature 2", "Feature 1")
num_features <- length(feature_names)
y <- array(c(10,4,1,0, 3,4,2,0, 1,2,8,1, 0,0,5,1, 1,2,5,3), dim=c(4,num_features))
# Calculate plot
num_neg_ratings <- 0
num_pos_ratings <- 0
for(i in 1:num_features) {
num_neg_ratings = max(num_neg_ratings, sum(y[1:2,i]), sum(y[3:4,i]))