Wednesday, December 14, 2011

Plot funny conditional stuff in gnuplot

plot "acc_len_acc_old_new11.txt" using 2:4:(+0):(-($4-$5)):((($2<=1)||($4<=1)||($4==$5))?(1/0):(($4 > $5) ? (rgb("0","255","0")): (rgb("255","0","0")))) notitle with vectors lc rgb variable,"acc_len_acc_old_new11.txt" using 2:5:(+0):(-($4-$5)):(($4!=$5)?(1/0):(($4 > $5) ? (rgb("0","255","255")):(rgb("255","0","255")))) notitle with vectors lc rgb variable, "acc_len_acc_old_new11.txt" using 2:(($4==$5 ? 5 : 1/0)) notitle with points pt 13 lc 13

Wednesday, December 7, 2011

PDFs to text to make them searchable on commandline

linse@elektrobier:~/Documents/cloned/diss/paper$ for f in *.pdf; do pdftotext $f; done

Sunday, November 13, 2011

NRG to ISO

Assuming the NRG is just a single session ISO CD image, you can just remove the first few kb with dd from Terminal.app
Code:

dd if=image.nrg of=cdrom.iso bs=512 skip=600

Friday, November 11, 2011

Game states

final int STATE_XBEE_INIT = 0;
final int STATE_PLAYER_LIST = 1;
final int STATE_LEVEL_SELECT = 2;
final int STATE_PLAY = 3;
final int STATE_HIGHSCORE = 4;

Lag test

else if (mode == 2) {
println("We can test the lag now.");
players[0].xpansProx[0].broadcastProxConfig(1500);
mode++;
}
else {// done
initLevel(players, "levels/03-nomoremosquitos.xml");
for (int s=4; s<8; s++) { // Send an arbitrary step to the patches
println("Sending step "+s+" at time "+millis());
for (int i=0; i players[i].sendStep(s);
delay(500);
}
}
}