2014 — the year in review

Dec 31, 2014


…let’s get the big news out of the way.

This year I got married. We have a lovely daughter, made a beautiful home together, and a few years of togetherness, and really just wanted to celebrate these blessings with friends and family. Besides, my partner is gorgeous, and I just had to go ball & chain on her :-P

The tech


This year saw me Dockerize all the things. Linux containers is the best thing since diced bacon, and really unleashes servers everywhere.


Loads and loads more Python, especially for APIs. Python is awesome. Especially paired with other awesome tools like PostgresQL, for example: no more “WHERE user = %s” to filter on user data. Let’s just say I devised a clever trick using flask-sqlalchemy, PostgresQL schemas, before_request and search_path to give every user their own database.


Still my tool of choice for interfacing with tried-and-trusted Java libs to build those blazing fast, functional and correct back-end processes.


Can’t get away from this one. But starting to wonder if ClojureScript is the way to go. Besides, I always ALWAYS use lodash (replacing underscore recently).


I’ve been really doubling down on Clojure this year for fun, throw-away side projects. I really want it to replace Scala. And OMG how awesome is it to code a Lisp using Emacs. It reminded me of those early 2000s Scheme days…


So, I’ve always been a Ruby fan, and always wanted to be able to mention Erlang as one of my top few skills, but yuck… Erlang! It’s like trying to do a Shakespeare recital with a mouth full of mud. That didn’t make any sense, but Elixir does. Still a bit fast moving, so I’m not doing anything big in it, but watch this space.

UPDATE 2015-03-13

After working with Erlang a bit more (and reading this), I stand thoroughly corrected, and don’t mind it at all.


My life, that is.


Let’s see… I don’t watch or read any news (be it news news, or tech news). There was one event in the last quarter which my family says changed their perspective on things, which turns out to not affect me. I’m really happy with this arrangement.

I’ll change HNWatcher on occasion to send me alerts for tech I’m following, but I mostly archive those.


7 minute scientific workouts, 3-weekly runs to the local free gym where I break some more sweat, and loads of activities with my daughter.

I had a health check, and all is perfect, and will make it a yearly thing now.

8 hours sleep a day, at least.

Painting and drawing in the evening to clear the mind and splatter watercolours everywhere.


Time is precious and not to be wasted. I’ve little tweaks with which to save a bit of time. E.g. when reading an article, and mind wanders / eyes start blurring, I close the tab or delete the eBook and move on with my life.

My phone now has 2 main apps: Kindle, and Pocket Casts. No more games. In fact, the only games I play are board games with my family.

If I can pay for it to be done, I do just that.

I unsubscribed from everything. E.g., I closed my LinkedIn account, and delete all new messages from them.


It wasn’t a perfect year, after all.

My wife got made redundant.

A client of mine confused the words “contractor” with “employee” and I wrote off a significant amount of money as bad debt in a time when the money would have helped with a problem. I get all my work from my personal network, and agree to things with the shake of the hand, and this particular fella is making me reconsider.

My dad took his own life this year, and I’m especially remembering him tonight.

15 years ago today was the most significant NYE of our generation. I spent it with my dad as my mom had just left us a few days prior. We were sitting on the balcony in total darkness, staring out, with the odd firework illuminating his face. Had my sister been a grownup then, who knows what he would have done, but he chose to be there for us.


Since catching up over eggs and coffee is the new catching up over a beer, let’s have breakfast some time and I’ll tell you my plans.

Meanwhile, live life and don’t take shizzle from see you next Tuesdays.

I made my daughter a book for her first birthday.

Apr 17, 2014

Made? Yes, made – not wrote. See below.

My day is a grab-bag of abstract concepts, data as shapes moving from system to system on pathways built with tools I love dearly. However, every now and then I want to inject some characters and narrative into my life.

A previous, on-ice-yet-ongoing foray into Story Land is when we learnt we were pregnant. My world was shaken, and in a nervous panic I wanted to surround myself with things that will cleanse my mind, prepare my heart, and re-awaken the child in me. All in preparation for the Little Being that was to join us in June 2013.

I was going to write a picture book. The poem it’s based on came to me on a train journey to the Cotswolds. It was going to be perfect. But, I had to practice. Doodle, draw, illustrate. Devour colours. Try and not be precious about my Moleskine notebooks. Scribble, then scribble some more. Rip out pages, and throw stuff away.

I started in earnest, but truth be told that a Picture Book is not an overnight endeavour.

Meanwhile, Little One was born. Slow and considered sketches were soon replaced by frantic nightly dashes finding nappies and milk. My fountain pen dried up and clogged sooner than one can say “priority shift”.

A few months ago it dawned on me that she’ll turn one soon. I started to think of her first ever gift. The picture book was still months away from being completed. All along our Little Beloved pointed at “C for Cat” on her alphabet toy, and a light bulb appeared above my head: a cat book!

The birthday is now imminent, and something needed to be sent to the print shop pronto. Inspired by “famous cats” from a pub quiz, I went on to create this. Heavily cribbed and everything stolen from far flung corners of the Interwebs, but hey – it’s not like I’ll be making money off it!

Fun was had, and Father Time once again looks down favourably on my poem-inspired work of art which will soon sit alongside our Little One’s other precious things.

More jq fun

Jan 29, 2014

I’ve written about jq before, but I mention it again here as a very useful tool for parsing JSON on the command line.

I needed to grab some England Bank holidays for a quick hack the other day, and found that the GOV.UK team made web better by allowing you to append .json to any of their links to get to the data.

Hold onto yer hats:

2103 — the year's code and tooling in review

Dec 31, 2013

I saw the #code2013 hashtag on Twitter last night and joined in. It got me thinking about the stuff around the programming languages I use, and my professional skillset in general.

I’ll briefly touch on how a few major events in my life forced me to cut the fat and become more focused.

A few notes, then.

The programming languages


My new, old favourite. My go-to language since 2009. I can’t add much for 2013 apart from that I’m happy to see the community mature around it. We’ve gone from “How we adopted Scala at company X” to “How to go back in time using Akka, Play! and XYZ”. Oh, and then the reactive course was fun too, and highlighted a few holes in my Akka education.


Java still mostly pays the bills, and I’m writing even better Java thanks to Scala. My editor is told to highlight everything in a shade of gray, apart from re-assignables which are red. It all just flows.


I’m a big fan of Pylons and have used Python since 2006-ish for tiny webapps, but this year sees me going down the finance route with SciPy and Pandas thanks to a handful of courses I did recently.


Strangely addictive. I did a data analysis course with the famed Johns Hopkins university earlier this year, and thought I would be “learning” R along the way. If anything, it felt like I already knew R, and the thing that I learned was making a good analysis, writing it perfectly and succintly, and performing an honest peer review. R is perfect for slicing and dicing your data, and it doesn’t get in the way.


The main attraction to Dart for me was the promise of compiling to a better Javascript which you can ever hope to write by hand. The Dart syntax itself is familiar, and then you have the odd goodies like the cascade operator (borrowed from Smalltalk) which lets you chain methods without having to return the instance in your API, and being a Scala guy, I love having rockets (=>) scattered all over my code (Dart’s syntactic sugar for concise getters).


Being a backend programmer by trade, I usually don’t go for frontend gigs, but a client this year said they don’t mind me learning on the job, and I’ve heard good things about AngularJS, so I dove right in. I’ve touched on Javascript a lot in the past, but this year I spent a significant tenth of my professional time fiddling with it.


Yes, I really did spend the tiniest amount of time with Haskell, but enough to mention it here. I downloaded, chopped and changed the XMonad code and the take-away for me was that 2014 will see more Haskell.

Other languages, not-so-much-languages, and tools

My starter Dart project is a game (where do I find the time?), hence WebGL and subsequently GLSL. I’m particularly excited about getting my hands even dirtier with shaders with Mozilla recently announcing live-editing of shaders using Firefox.

I’ve always used Capistrano and Chef for my provisioning and configuration needs, but this year I gave Ansible a shot. I hope Ansible stays the way it is: small, simple, elegant. No agents; just SSH.


2013 was a bumpy ride. We had a beautiful daughter in June, and I quit my job soon after to freelance from home and be 2 flights of stairs away from her. To be able to learn a few new skills and do 4 courses, I had to make some changes. There are the 5AM starts, the highly-condensed exercise routine in the morning, diligently deleting anything which doesn’t contribute to the plan I have for our life (this includes articles, emails, etc), and just generally getting things done.

The Polar Bear who might have eaten Xmas The game I mentioned seems like a distraction, but I feel it’s important that I do it. I’ve been in love with doodling since I was a kid, and really took it up this year. I’m an able musician, and since I can code I thought I’d bring these ingredients together and make something nice. (Those umpteen characters and storylines in my head will finally be unleashed!).

Thanks for reading this far. May you have a great 2014.

I leave you with a doodle I made a few days ago entitled “The Polar Bear who might have eaten Xmas”. (Don’t worry — this isn’t one of my games ideas ;-)

Using single and double pipes in Scala conditionals

Dec 27, 2013

In a nutshell, use a single pipe if you want all the expressions in your conditionals to be evaluated, and a double pipe to conk out as soon as you have true.

scala> def a = { println("a") ; true }
a: Boolean

scala> def b = { println("b") ; true }
b: Boolean

scala> def c = { println("c") ; true }
c: Boolean

scala> if (a || b || c) println("true") else println("false")

scala> if (a | b | c) println("true") else println("false")


Dec 13, 2013

I recently saw a talk by Jack Dorsey where he iterates a list of commandments for this life, and number three is “drink only lemon water and red wine”.

I love red wine, and was intrigued by this lemon water idea. I investigated and it led me to an article which asks how much lemon water is needed. They quote a heuristic:

For those who weigh less than 150 pounds, squeeze half a lemon’s worth of juice into a glass of water. If over 150 pounds, use an entire lemon’s juice.

This is a heuristic, and it is beautiful. It saved the author from quoting an entire “weight in pounds to amount of lemon” table.

The heuristic is one of my favourite concepts of all time. During engineering school in the late nineties it became ever more apparent what a powerful concept it is, e.g. using lookup tables when designing flow systems with complex flow dynamics. It makes applied rocket science a bit easier. Or when solving path finding problems where the brute force method is just not a viable option in terms of time complexity.

Anyhoo, I’ve reached my 10 minute limit for writing ★, and since I can’t do this powerful concept any justice with just a few words, I’ll let the editors of Wikipedia englighten you further.

★ this is my own heuristic (aka “rule of thumb”) for not spending too much time on writing.

Project Euler 18 and 67 in Scala using foldRight, zip and sliding

Nov 28, 2013

I’ve recently applied to Toptal and sucked miserably at the entry exam. My algo chops were blunt and I thought I’d rectify it by revisiting Project Euler. With the startup last year and the baby this year I just haven’t been able to find the time for programming challenges, but that has to change.

Looking at my Project Euler source directory, I saw that I left it at problem 17, so next up will be 18. The problem description, however, mentions that the problem repeats itselt as 67, but with a bigger input that will run 20 billion years if you go the brute force route.

I worked a little on this problem last night, and decided to by-pass the brute force solution completely. It was a bit late, though, and I pulled my eyelids open far enough to make it to bed. I then went on to dream about the damn problem all night. I knew there had to be a simple bottom-up fold-based solution, and the voila moment came for me when I realised I had to seed the fold computation with the base layer in the triangle.

Here you go:

A little explanation

The triangle is represented as a nested list, like so: List(List(1), List(2, 3), List(4, 5, 6)) and so forth.

    / \
   2   3
  / \ / \
 4   5   6    <- this is the "base layer" in my explanation.

Since you need to add the maximum of the two immediate children to the layer above, a foldRight wouldn’t give me all the info I need in the curent iteration. Foldright for me means “the data is coming FROM the right”, i.e. List(4, 5, 6) will be processed first, then List(2, 3) but at no point in the iteration will they be available together so I can do the sum. List(4, 5, 6) would need to come into the iteration with List(2, 3) in another way, and I realised I can use the foldRight’s accumulator for that by seeding the foldRight with the base layer in the triangle (aka the last list List(4, 5, 6)).

The easiest way was to just seed the foldRight with a list of zeros one element larger than the base layer. You then break it up into pairs using sliding(2,1), take the max of the pairs, and sum the max with the corresponding (thanks to zip) element in the layer above.

     / \
    2   3
   / \ / \
  4   5   6
 / \ / \ / \
0   0   0   0    <- this becomes the new "base layer", or "seed"

No mutable state; no recursion; simple to understand. As Erik Meijer would say: “baby code”.

A webwords Chef cookbook

Nov 10, 2013

There are a lot of new examples up on the Typesafe website, a few with the word “Reactive” in them to drive home the credo behind the framework. One of my favourite examples, however, seem to have been demoted but still remains one of my favourites: webwords.

The old Heroku link to the live running instance of webwords does not seem to be up anymore, so I whipped up a quick Chef cookbook with which to spin up your own local instance.

You can find the Github repo here. Spin it up and have fun.

BTW, join us in doing the Principles of Reactive Programming course

Pretty-print JSON in vim

Nov 05, 2013

jq to the res-q. TL;DR A quick way to pretty-print JSON in vim with no dependencies (here’s looking at you, Perl). Download jq then :%!jq ‘.’

Computational statisticiansData scientists have some the funnest tools, and I found a good write-up of a few more I didn’t know about called 7 command-line tools for data science. The first thing the article mentions is a gem called jq.

I found jq to be especially useful for formatting JSON in vim. So, before ado can in any way be furthered:

curl -o ~/bin/jq   chmod +x ~/bin/jq

In vim, open your unformatted JSON file, then: :%!jq ‘.’.

There you go, ladies and gents — a command so short, you don’t even need to put it in your vimrc!

Dell XPS 13 LE

Nov 02, 2013

The portal to my livelihood. TL;DR If you’re a laptop-toting *nix user, then this is the laptop for you. Also, upgrade the kernel before you do anything else, for the best experience.

This advice is highly unqualified, though. The last time I ran *nix on a laptop was when I ran some flavour of Gentoo on an old Centrino-loaded HP in 2005. I’ve been a Mac user ever since those darned iPhones came out.

It’s just that I ran out of space on my 128GB SSD Air for the umpteenth time, and shuddered at the thought of breaking off glued-down components according to some iFixit guide. (Damnit! I just looked again, and there’s no glue involved in upgrading the SSD. Oh, well — the missus needed a new laptop anyway, and this was a welcome hand-me-down. Besides: new toys!)

First thing’s first

When you do get one of these bad boys, the first thing I recommend you do is this:

That will get you the latest kernel without upgrading everything. As any Linux user would know, upgrading to fix one problem introduces a thousand other problems, and this felt like a nice trade-off.

The reason for the above command is that I did have some wifi stability issues to start with, so I hope to save you that initial few dropped connections.

Once again, kudos to popey over on the #ubuntu-uk IRC channel for the advice.

Wifi has been stable and pretty quick. I suppose it’s not all down to the new kernel and drivers: I have Virgin 60Mb fibre optic, and my walls are refreshingly free of tin foil.

The gear

The XPS 13 comes packed with some great specs which you can gloss over here, but I’ll re-iterate the key components: Intel® Core™ i7-3537U CPU @ 2.00GHz × 4, 8GB RAM, 256GB SSD of which 230-odd usable and a mega bright 13.3" screen all on a pretty little laptop that feels like an 11" one. I never put the brightness above a third of the available level, and at 1920 x 1080 it looks great.

The keyboard still sports a Windows button, but it’s the new Windows logo which I’m not familiar with yet, and I pass it off in my mind as a generic “dashboard” type button, so it’s all good. A Tux button would probably be a bit weird. I mean, what would a penguin button do? Summon a troop of penguins? Nah. Besides, penguins — just like seals and dolphins — can be dirty little scumbags.

The ever-so-scientific bench test

I needed GIMP for something last night, and when I installed it and launched it for the first time, the realisation hit me that it all took about 30 seconds.

So, I purged GIMP and re-did it for your viewing pleasure:

Apart from this, I’m running about multiple Java server apps (for this thing I’m working on), plus a couple of VMs, plus some Python scripts that are running some numbers. My software does make efficient use of all the available cores, and CPU hasn’t been a problem for me in a while.

All the Linux games available on Steam runs like a dream. Just the addition of Steam of a *nix system feels like we’ve come full circle.


It’s early days — a lot might still happen. In fact, Murphy’s Law states that I’ll publish this favourable review and it will be shortly followed by the i7 going up in smoke.

Anyway, here are some of my initial qualms:

  • The mouse is triggered sometimes whilst typing. This is configurable, and I have switched it to disable the mouse whilst typing, but to no avail.
  • The password box looses focus more times than not, and you end up typing your password in unfavourable places. This could be related to the previous issue discussed.
  • Keyboard is ever so slightly flimsy, because sometimes letters will double up. Perhaps this is just a keyboard I need to get used to. Besides, I’ve used the Mac chiclet-style keyboards exlusively since 2009.
  • The palm rests — even though they feel great to the touch — seems to get a bit streaky after a while. My fingers are constantly greasy from chowing on ginger biscuits and stuff like that, and it doesn’t wipe down well.
  • The backspace button does make a slight squeaky sound sometimes, but this could be because my pinky finger “pulls” on the button due to the angle I attack it with. Still — I don’t think this should happen.


If anything else pops up, or if the XPS 13 makes my life significantly better in any other way, I’ll come back here to amend. (I won’t do those silly UPDATE things at the bottom — you can look at the Git history of this page for changes.)

This is my first ever piece of Dell equipment, and it doesn’t look nor feel like a grey, impersonal piece of office equipment. Also, Mr. Mark Hails-From-The-Same-Home-Town-As-I Shuttleworth got things very right with Ubuntu. Linux has certainly come a long way since that day in 1995 when my mate dropped off 25-odd floppies of Slackware.

I’m more productive than ever and won’t be going back to Apple. I certainly don’t want to shoehorn OSX into a usable system with macports any time soon.