Pretty printing Akka config

Akka makes use of HACON (Human-Optimized Config Object Notation) for configuration. Today I needed to check the config that was loaded. When printing the config to the terminal it is displayed in a compact format. I wanted to pretty print it so it was easier to read. I found a briljant blog post by marcinkubala.

I adapted a code snippet as follows: Continue reading

Deleting a remote tag in Git

Today I deleted a tag in Eclipse using EGit that was already pushed to the origin. I then discovered that once the tag is deleted in the local repository there is no way in EGit to delete it from the origin. I am using Github as remote repository. So I checked if the tag could be deleted there. Unfortunately I could not find a delete option there. Bummer what now? Command line git to the rescue. Continue reading

Generating a large test file with Scala like the Linux dd command

I was writing functionality to merge download chunks yesterday. This functionality takes a file that is downloaded in chunks and mergers these chunks back into a single file. Writing the test class I did not want my test to depend on downloading a file in chunks, so I needed a way to quickly generate a number of chunks that could be merged. Under Linux the dd command is available that generates a file of a given size that contains random contents. I wrote a small helper class that does exactly this, with the extra twist that it splits the file into a number of chunks. Continue reading

Composable behavior in Scala

I continue to be amazed by what can be done with Scala. Once you start to understand the simplicity and beauty of coding in Scala it is really easy and fun. As part of my learning exercise I am implementing a multi threaded downloader. One part of the solution is a splitter. It takes a file size and splits it up into a number of chunks that can be downloaded in parallel. I have implemented a Chunk, that holds information about a chunk, as a case class and created a trait ChunkDownload that can be bolted on to this case class at runtime. This is so called composable behavior which adds functionality to the case class. Continue reading

Which open source license to choose?

I am working on a few projects I would like to release as open source. One of the important things to consider when releasing code as open source is the license to release it under. I think the license should not be an after thought, but a careful consideration up front before you commit your first code. What if you release it on Github and someone likes it and decides to contribute. Changing a license after accepting contributions is not trivial. Continue reading