> A mini mocking framework

July 7th, 2014

Ever wondered how a mocking framework like JMock or GoogleMock works?

We’ll look at how to write a very basic example, and find out that Java is more flexible than you may have thought.

Slides: A mini mocking framework.

> Simple template programming

June 30th, 2014

C++ template meta-programming sounds harder than it is.

So long as you can fight through some horrific syntax and understand recursive functions, you can write any algorithm you like and have it run at compile time in your C++ programs.

Slides: Simple Template Programming

Andrei Alexandrescu’s amazing book on using template meta-programming for really useful, cool stuff is: Modern C++ Design.

> Five Quines video

June 25th, 2014

A quine is a program that prints out its own source code. I will describe five examples:

Slides: Five Quines

Arguably the greatest program ever written:


More info on quines:

> OpenID security in a REST API

June 23rd, 2014

Series: What is REST?, A Basic REST API, Paging, Search, Security, Token, OpenID.

We are implementing a REST API. Today, using OpenID to do our authentication, instead of doing it ourselves:

Slides: OpenID security in a REST API.

Code: poemtube on github.

> avconv performance slow in Ubuntu 14.04 trusty

May 15th, 2014

I noticed that my TV conversion scripts were suddenly running very slowly after upgrading to Lubuntu 14.04.

After some investigation it turned out it had started defaulting to using libx264 encoding when the output file was named *.mp4.

When I ask it to use mpeg4 encoding instead, it goes fast again:

avconv -i MyProg.ts -acodec copy -b:v 2500 -c:v mpeg4 MyProg.mp4

I assume in previous releases it was defaulting to mpeg4, unless there’s been some huge performance bug introduced into libx264.

Interestingly, when I built the latest version of avconv from their git repo, it didn’t include libx264 at all, and happily defaulted to mpeg4.