Bash function to switch Java versions

setjava() { if [ “$1” = “-q” ]; then local quiet=true shift fi local jdk=~/Applications/Java/jdk1.$1 if [ ! -d “${jdk}” ]; then echo Jdk not found: ${jdk} return 1 fi export JAVA_HOME=${jdk} export PATH=${JAVA_HOME}/bin:${PATH} if [ -z “${quiet}” ]; then java -version fi } export -f setjava I have symlinks for all major versions of […]

Wat? Scala

As I got quoted recently in “Scala — 1★ Would Not Program Again” I though I finally should write up a little Wat moment we had recently: So does anyone know “wat” the following Scala code returns? (Value and Type) List(1,2,3).toSet() A Set<Int> containing 1,2,3? Nope how about I give you a clue, there are […]