May 2009
4 posts
1 tag
The Gumball
Here is the test - the one I fail frequently. Given a problem, how do you solve it? Often, too often, I get a solution for one part of the overall problem quickly, and zero in on it. I then create a solution for that part of the problem, but have one, unconnected part. It hangs around - orphaned from the complete solution which is required.
I have failed the gumball test. I tried eating the...
2 tags
Lazy Functions With Scala
This tripped me up recently - I was passing in a function to be executed periodically by a java.util.Timer. The original code looked something like this:
def addTask(seconds: Int)(task: Unit) {
val t = new TimerTask() {
def run = task
}
timer.scheduleAtFixedRate(t, 0, seconds * 1000);
}
...
addTask(5) {
println("Hello!")
}
The issue here is that when I called addTask,...
Is it me, or will Twitter not let me add followers via the website? Tested in both Firefox and Safari. I blame ruby…
moving magpiebrain over to tumblr: http://blog.magpiebrain.com/. Self hosting is too much work…