The unreasoned Javan

Tim Clark wrote “I really hate null! Reflect on that statement. Apparently Tim has a strong dislike for a concept found in lots of programming languages (even brainiac languages like Haskell) and successfully used in millions of programs. He must be crazy I wouldn’t like to have a discussion with him about something contentious like tabs versus spaces.”

Benchmarking simple JSON generation in Java

Tim Clark wrote “What is the fastest way to produce JSON output in Java? Well if you have a complicated object tree to turn into JSON I would guess it is probaby Jackson. However, not all JSON output is complicated so maybe we can find quicker and simpler alternatives. My test class is simple, I call him Thing,…”

King Kong! Misadventures in Ruby meta-programming

Tim Clark wrote “Sometimes after a particularly fraught bug stomping session you make a frivolous offhand remark to a colleague, for example “I will write a macro that converts lisp definitions in prefix form so that arithmetic looks like how it was taught to you in school” or “I won’t let my unit test really be an integration…”

By Heinrich Klaffs [CC-BY-SA-2.0 (], via Wikimedia Commons

Mustache for your mail merge

Tim Clark wrote “At LShift we like to program on blackboards using untyped lambda calculus, and we enter code into a computer only once we have a truly generic solution to a problem. However, most of the time we need to earn money so that we can eat and wear clothes other than LShift t-shirts – this usually…”

Some reflective testing with gocheck

Tim Clark wrote “Last time I wrote about custom gocheck checkers and wrote a checker that checked if a slice of int contained a specific int – it would be nice to have a generic contains checker and using the go reflection we can write one.”

Testing with gocheck – custom checkers

Tim Clark wrote “This post follows on from my previous post about gocheck. gocheck uses a checker abstraction to test arbitrary properties in tests, in the previous post for example we used the Equals and Panic checkers to test our code. It is very simple to write your own checkers and I will walk through some more complicated…”

Testing go programs with gocheck

Tim Clark wrote “The Go programming language comes with a simple built in test framework testing – this is usable and functional but is lacking in features that you might find in other languages test frameworks. A more fully featured testing framework called gocheck has been developed by Gustavo Niemeyer, this blog post walks through developing an extremely…”

Using goinstall for your own local code

Tim Clark wrote “I am working towards finishing a small project in go and my thoughts have turned to how I will package it up and release the code. The latest release of go has made some changes to goinstall so that code installed by you as a user can be kept separate from the base installation of…”

Simple clustering of open source software with Veritas

Tim Clark wrote “Veritas cluster server is often used in corporate environments to provide clustering and high availability. Veritas is a complex, closed source product that provides integration for lots of enterprise software such as SAP or Oracle, but it is very simple to use it to cluster open source software as well. In order for Veritas to…”

Using the syntax tree in Go

Tim Clark wrote “The Go programming language provides an abstract syntax tree, parser and pretty printer as libraries written in Go. This enables you to mangle your Go code by writing code in Go – this isn’t quite lisp macros but it is a nice facility. Here is some example code that I will transform by manipulating the…”

Fantom will eat your nulls!

Tim Clark wrote “As it is a new year it must be time to learn a new language. Having had a singular lack of success running F# under Mono (well when your two line definition of a simple tree data structure produces a stacktrace it doesn’t bode well) I went back to good old Haskell for a while…”

Embedded video and progressive download: A Quiz

Tim Clark wrote “I will provide you with two video files, video1.flv and video2.wmv, you need to embed them on the page and ensure that they use progressive download. Both video files are greater in size than 1GB so it will be obvious whether they are playing before they have completely downloaded. You will need to use the…”

Squeezing the F# zipper into a Monad

Tim Clark wrote “Not being entirely happy with my F# zipper implementation throwing exceptions I decided to investigate whether I could use option types to replace the exceptions thrown when you try to navigate off the tree – for example trying to move up when you are at the top of the tree or move down when you…”

F# zipper with pipe forward

Tim Clark wrote “The zipper is a purely functional data structure which is useful when manipulating immutable data structures (see the original paper here by Gerard Huet). Haskell and Clojure both have implementations of the zipper, but I have been unable to find one for use with F#. The original implementation is written in OCAML so is relatively…”

JNA wrapper for ZMQ

Tim Clark wrote “Zed Shaw’s Mongrel2 uses zeromq as the communication protocol between the web server and any custom handlers that you wish to write in the language of your choosing, including Clojure via a ring adapter. So off my fingers trotted installing all the dependencies for mongrel2, including zeromq, testing my mongrel2 by walking through the examples…”

Enlive snippets for a table of data

Tim Clark wrote “This is a walkthrough of using enlive templates in clojure to populate an html page with a table of data. This is the reference html as supplied by a web designer, the web designer is a very grumpy man and is insisting that you mustn’t change a line of his html or it will break…”