There is a common programming pattern where you navigate a hierarchy in order to find an element satisfying a certain condition. I have written code like this in Java probably a million times: cla...
Scala tip: getOrElseUpdate
I found myself recently looking at the following code which I wrote when I was getting started with Scala: def getModelState(modelPrefixedId: String) = modelStates.get(modelPrefixedId) match { ...
Scala tip: import renames
In Java, you often write things like this, which are rather verbose: URLEncoder.encode(...) URLDecoder.decode(...) Since Java 1.5 you can use static imports, but then you are stuck with the orig...
Scala partial functions (without a PhD)
If you have done some Scala for a while, you know about pattern matching and match/case. Things like: value match { case Some(value) => … case None => … } But there is another use of t...
Continuations in Scala (without a PhD)
With @avernet we have been thinking lately about continuations, for a few reasons: Continuations pop up on the web as a concept that could help with event-based programming Scala has a contin...
48 hours of Nexus One
I just used a Nexus One for 48 hours (thanks Pierre). Here are a few quick notes/thoughts from the perspective of an iPhone 3G user.Getting started <ul><li>Take the SIM card out of the...
2009: Products I Can’t Live Without
Mike Arrington has just posted his 2009 list of products he can’t live without. After my own 2008 list, here is my update for 2009 as I think it’s fun to observe how our computing environment evolv...
Upgrading Your 17" MacBook Pro Hard Drive
A few days ago I upgraded my MacBook Pro’s hard drive after realizing 320 GB drives sell for USD 110 - which made constantly worrying about disk space ridiculous. This also should extend my old MBP...
iPhone 3G Day: the Good Parts
Like many, I took the plunge on Friday and bought an iPhone 3G (pictures and videos of the saga here). It was clearly not the most reasonable thing to do to stand in line for hours to get an expens...
A case of failed technology: Bluetooth headphones
I’ve had a fair experience with Bluetooth devices, including headsets, mice, and keyboards. At home, I am now using the Apple Bluetooth keyboard and mouse, and I am quite happy with them.Recently, ...