Category: Software Development

  • Getting notified when a job is done

    I really like the interaction of the command line with more advanced user interfaces. So today I got around to finally writing a little wrapper script for the mac, that notifies me with speech output when a program has finished using the say utility. The problem I was trying to solve was getting feedback when…

  • Exception Handling – The Catch Block should go Last

    I have just stumbled across a piece of code like this: Object getSomeValue() { Object value = null; try { value = errorProneOperation(); } catch (IOException e) { throw new IllegalStateException(e); } return value; } Now I find this really awkward. Why initialise something to null to keep the compiler happy? Surely you want to…

  • JSON Builder – Fun with Generics

    On the train back to Berlin I spiked a little fluent Json Builder in Java. Here is one of my acceptance tests: JsonBuilder builder = new JsonBuilder() .addObject(“name”) .addProperty(“first”, “Holden”) .addProperty(“last”, “Caulfield”) .end() .addArray(“contact”) .addPrimitive(“00447903217666”) .addObject() .addProperty(“street”, “5 Mayton St”) .end() .addPrimitive(“004915151183666”) .end() .addProperty(“date”, “2011-12-12”); JsonObject clientFile =builder.build(); This yields: { “name”: { “first”:”Holden”, “last”:”Caulfield”…

  • Processing large XML files with Shell Scripts

    I recently did some work around analysing xml files for data imports. This kind of task is usually well suited for taco bell programming. Now xml is not easily manipulated with standard unix utilities, so I looked for a way to run xqueries against my files. The first thing I found was the eXist xml…

  • Reading the Classics – The CLU Reference Manual

    Last year I started reading or rereading some of the classical texts in computer science. The first one was the CLU Reference Manual by Prof. Liskov et al. The book and the language were conceived in the seventies. CLU is object based the central concept being the abstract data type essentially encapsulated objects without inheritance.…

  • Java Lib to Launch External Processes

    I recently redesigned some of the code I tend to use to spawn external processes (pdflatex anyone?) in java. The implementation is still a bit buggy, but I am more interested in people’s opinions about the API (non-blocking killable invocations are not yet supported). The project on github is called jproc. Here is the cookbook…

  • Join

    Note to self: join works only on sorted text files.

  • Thoughts on handling Translations and Views on Source Code

    One of my recent java projects was to be used by users with three different languages. We went with the standard java approach of using properties files for messages. In intellij there is decent tool support for that. However it seems a bit odd to have a strongly typed language and then rely on string…

  • Don’t Play with Yourself

    Some two years ago I had the pleasure of working with a code base that relied heavily on the spring SimpleForm framework. The thing I didn’t like about this framework was the whole controller class hierarchy. Essentially there is about ten super classes and calls get delegated up the whole chain. In theory this is…

  • Getting Real with Enumerable.java

    Two weeks back I posted a video explaining how to get started with Enumerable.java. While this might have been enough information to start playing, there is a lot more to consider when going with Enumerable.java for production use. Over the past few weeks I went through that experience on my project and here are some…