Skip to content

Instantly share code, notes, and snippets.

Avatar

Sander Mak sandermak

View GitHub Profile
@sandermak
sandermak / in1.txt
Created Oct 12, 2014
Testcases voor JM code challenge 3
View in1.txt
O,X,O,O,O,O,O,O,O,O,O,O,
X,X,O,O,O,X,X,X,O,O,O,O,
X,X,X,O,X,O,X,X,O,O,O,O,
O,O,O,O,O,O,O,O,O,O,O,X,
O,O,O,X,X,O,O,O,O,O,X,O,
O,O,O,O,O,O,O,O,O,O,O,O,
O,O,O,O,O,O,O,O,O,O,O,O,
O,O,X,X,X,X,X,X,O,O,O,O,
O,O,O,O,X,X,O,O,O,O,O,O,
X,O,O,O,O,X,O,O,O,X,X,X,
@sandermak
sandermak / gist:8da8402faec871458536
Created Jul 23, 2014
Voorbeeld input voor JM challenge 'verfspetters'
View gist:8da8402faec871458536
O,X,O,O,O,O,O,O,O,O,O,O,
X,X,O,O,O,X,X,X,O,O,O,O,
X,X,X,O,X,O,X,X,O,O,O,O,
O,O,O,O,O,O,O,O,O,O,O,X,
O,O,O,X,X,O,O,O,O,O,X,O,
O,O,O,O,O,O,O,O,O,O,O,O,
O,O,O,O,O,O,O,O,O,O,O,O,
O,O,X,X,X,X,X,X,O,O,O,O,
O,O,O,O,X,X,O,O,O,O,O,O,
X,O,O,O,O,X,O,O,O,X,X,X,
@sandermak
sandermak / code_titanicdemo.R
Last active Dec 27, 2015
Demo code from the J-Fall presentation 'Data Science with R for Java developers'
View code_titanicdemo.R
# Code to participate in http://www.kaggle.com/c/titanic-gettingStarted
# change path to the directory where train.csv/test.csv are located.
path <- "~/dev/kaggle/titanic/data_raw/"
colTypes <- c("character", "factor", "factor", "character", "factor", "numeric", "factor", "factor", "character", "numeric", "factor", "factor")
load_data <- function(path, colClassTypes = colTypes) {
initial <- read.csv(path, colClasses=colClassTypes)
initial$Age <- as.integer(initial$Age)
@sandermak
sandermak / PizzaOrderNewStyle.java
Created Oct 21, 2013
Second alternative to the standard Builder pattern implementation in Java. Also see blogpost at http://branchandbound.net/blog/java/2013/10/failed-experiment-improving-builder-pattern/
View PizzaOrderNewStyle.java
package net.branchandbound.builder;
public class PizzaOrderNewStyle {
private int size;
private boolean pepperoni;
private boolean chicken;
private boolean mushroom;
private boolean peppers;
private String cheese;
@sandermak
sandermak / PizzaOrder.java
Created Oct 20, 2013
Code showing alternative to the standard Builder pattern implementation in Java. Also see blogpost at http://branchandbound.net/blog/java/2013/10/failed-experiment-improving-builder-pattern/
View PizzaOrder.java
package net.branchandbound.builder;
import java.util.concurrent.atomic.AtomicBoolean;
public class PizzaOrder {
private int size;
private boolean pepperoni;
private boolean chicken;
private boolean mushroom;
View gist:5614864
{
"status_code": 200,
"data": {
"results": [
{
"domain": "missesdressy.com",
"initial_epoch": "1369033342000",
"h3": [
"Similar Items",
"Tell me more about this dress...",
View gist:881776
def loggedIn = ".user" #> User.currentUser.map { user =>
".firstName" #> user.firstName
".lastName" #> user.lastName
}