Monday, September 29, 2008

Quicksort in Scala


def sort(list: List[Int]): List[Int] = {
list match {
case List() => list
case List(_) => list
case List(_, _*) => {
val pivot = list(list.length/2)
sort(list.filter(x => x < pivot)) ::: list.filter(x => x == pivot) ::: sort(list.filter(x => x > pivot))
}
}
}

Saturday, May 31, 2008

Erlang is Rad

I don't know how many times I've brought it up, but Erlang is still rad. Everyone in technology should watch at least the first 13 minutes of this presentation:

http://www.infoq.com/presentations/erlang-software-for-a-concurrent-world

Tuesday, May 6, 2008

Saturday, May 3, 2008

Marchitecture

This is one of the most insightful interviews I've seen in a long time. I don't know if the term "marchitecture" (guess so) existed before, but whomever coined it was a genius! I have worked for places that were sold TONS of middleware that simply put a halt on productivity, and made life hell. Too bad I'm the only geek I know that watches stuff like this :)

Monday, March 31, 2008

Groovy Threads

I don't know why I think this is so cool, because it's such a no-brainer, but I really like the way Groovy added closures to the Thread class:

tmp.groovy:

def stringOne = 'Hello, ';
def stringTwo = 'World!';
Thread.start{sleep(1000); println stringTwo}
Thread.start{sleep(999); print stringOne}

Tuesday, March 11, 2008

Groovy Classpath

I always forget this, so it's getting added to my blog for further reference:

You can place jars in your ${user.home}/.groovy/lib directory to have them automatically loaded into your classpath.