Spray JSON

So you’re making yet another Scala app and you need to parse or write some data to file/database/webservice. What do you do? If you’re not already inside an (awesome) framework like Play Framework you will probably search “Scala JSON” and find something like Spray JSON. That’s what I did. So then you write: import scalax.io._ import spray.json._ import DefaultJsonProtocol._ val jsonString = largeMapObject.toJson.compactPrint Resource.fromFile("someFile").write(jsonString)(Codec.UTF8) … and you get an exception upon either writing, or parsing this string after it was only partially written.

NewRelic causing OutOfMemoryError in Play Framework app

Today I disabled the NewRelic JVM agent on one of my projects. While the Play Framework server was outputting a ZipOutputStream to a client, the NewRelic agent would for some reason gather massive amounts of data and cause the JVM to Garbage Collect continuously until the app became unresponsive, and finally crashed: Uncaught error from thread [play-akka.actor.default-dispatcher-33] shutting down JVM since 'akka.jvm-exit-on-fatal-error' is enabled for ActorSystem[play] java.lang.OutOfMemoryError: GC overhead limit exceeded Uncaught error from thread [play-scheduler-1] shutting down JVM since 'akka.

[OS X] Linux Open Directory and Mavericks clients: network accounts need GeneratedUID field

It has been quite some time since the last post on Open Directory on this blog, but I wanted to share something i found out about OS X Mavericks as a OD client. Let’s face it: running a non-Apple server for Apple clients is not your ideal, one-click-solution. It is not officially documented and the blogs are sparse, and more importantly: dated. Most how-to’s date back to 2009 or even older.

HTML5 audio trouble

For a website of a music band that I’m currently developing, I needed a onscreen playlist controlled by javascript. The features are: Save the songs in the same .playlist as the currently playing audio-tag. Save current seek time of the playing audio-tag as it changes. Save current song in the .playlist, so the index. Restore the playing playlist on page load in a .playlist-player element if this exists. This way the audio keeps playing when navigating through the website.