We have just had a phonebook delivered to the house. The front cover implores me to use the website to find the phone numbers of people and businesses I’m looking for. I’m so confused.

57 days

Yesterday, with the return of my family from holiday, I forgot to make changes to any of my projects in GitHub, and broke my commit streak at 57 days.

Initially I’d aimed for making changes on 30 consecutive days, just to try and get some momentum up in making progress on a couple of fairly low-key projects that hadn’t been going anywhere, and although I did cheat a few times (GitHub counts things like opening issues on a repo as ‘activity’ and I have plenty of bugs and features!), the vast majority of my activity was real commits, and I found 30 to be quite easy.

I think this is definitely something I’ll try again, but probably in 30-day chunks (each day only tends to give me ~30 minutes free to do any coding at home!), and probably with a more well-defined plan about what I’m actually expecting myself to ship within that time.

Anyway, despite the fact that I’ve finally broken my run, I’m pleased that I managed to get so much higher than I’d originally aimed for. Onwards!

Welcome. I thought mailing lists were dead. Didn’t you?

The title I’ve give this post is the subject line from the mailing list Rands has set up.

Since the death of Google Reader a few months ago, and despite the fact that I set up my own aggregator and native client pair, having a busy work and home life means that aggregators as a separate port of call just don’t get a look in.

I think I’ve probably subscribed to about five mailing lists in the past six months. This is something I never thought would happen, and frankly, I find it reasonably depressing. Not only should most email not exist, I’m now adding to it! The mass-closure and restrictions of open ecosystems and web APIs in the past few years seems to have led to a narrowness of thought, and an approaching peak (nadir?) of the celebration of startup culture, which, whilst terribly exciting in its “let’s solve a problem!” form, is really quite awful in its’ “we’ll only solve problems that make money!” form.

So the question I ask myself now is, would I pay for a decent aggregator service which gets itself back into my day without causing me massive disruption? Well, no, not if it’s yet another data-owning service which just mines me to sell to someone else. What’s the point? I use enough of those already. What I need is something that inveigles itself into my daily flow. Uses the tools I already use. Gives me direction rather than makes me make choices. A…email 🙁

A Ruby interface to the GatherContent API

GatherContent is an awesome tool for planning, structuring and collaborating on web content (they have a short video demo).

They have a read-only API, but only a couple of implementations, so here is mine, in Ruby.

The API is read-only and HTTP POST-based, and so I use HTTParty to manage that side of things, and method_missing to emulate the relevant API calls, and then Hashie to convert the returned Hash into an object. It’s very simple, so give it a try.

Hosting your own calendar and contacts directory

Apparently there is a thing called ownCloud which lets you run, amongst other things, a calendar server and a contact directory, both of which will sync with your android phone and here is a writeup of doing just that. I’ve not tried it yet, but any option to prise the data away from Google and to something I own has to at least an option worth trying.

Configuring get_iplayer

There are lots of ways of setting up get_iplayer. Here’s mine.

It means that filenames work across Windows and Linux, removes underscores from names, never deletes old episodes and downloads episodes into a directory named after the series and names the files with the series’ episode number.

Your own options file is in ~/.get_iplayer or c:usersusername.get_iplayer depending on your operating system.

The merits of a bug database

Ladybug lost in Echinops Ritro

I just realised that we no longer have a functional bug database at work, meaning we have gone down by a point in the Joel Test.

We don’t produce a single product (unless you count “the website and the quarter of a million pages it contains” as a product) and in the past have created standalone Trac installs for the larger pieces of software infrastructure we’ve written, and used the bug tracker in that to manage progress. Typically we then reached either a quality or time threshold and regardless of what bugs were there, and it was time for the next project.

We then never came back to those projects, and the collected bugs and issues would sit there for years, collecting mental dust as we moved onto other projects, or enhancing other bits of the site, all of which had their own bugs too. This is quite a depressing state to be in, and although on rare occassions we bundled up some of this work into “technical debt” projects, the mental weight would carry on, and eventually our rapid pace between projects, and an improved in-project process meant that we were meeting our goals on each project, and moving to the next without tracking known issues in any way at all because, y’know, it served no purpose other than to make us sad.

This has to change.

Clearly we’re at the point where a different bugtracker per backend software product won’t cut it. We’ve tried Jira in the past, and although it does a lot, it’s probably too much for us. So what should we do instead? My thinking is to use a tool which is set up to track a single project, and we use categorisation and tagging to differentiate what area of the site, what aspect of the site, and what backend tools are relevant – this should allow us to slice and dice across tens of thousands of lines of JS, Java and PHP and probably millions of lines of HTML, with impunity. Issues can be collated and then bundled into projects which we manage separately. I’m definitely not thinking about todo-list management software like Trello!

My gut call is to go to Lightouse – but I’ve been out of the game for a while, have you got a recommendation, free or not, which might help us out? Let me know!

(I should note that this all occured to me when looking at a job opening at BERG. If it’s not closed by now, go have a look and work for the lovely, lovely people there!)

Raspberry Pi, my media centre at last

my raspberry pi is here

My Raspberry Pi has arrived, and not only is it one of the nice new rev2 hardware revisions, it’s also been manufactured in the UK, which if you’ve followed their trials, you’ll realise is a big deal.

Anyway, mine is here, and one short hunt for a spare SD card later I’d got the installation of RaspBMC, a port of XBMC, started. It took probably about ten minutes to complete, with no intervention from me.

Then I SSHd in (the default username is ‘pi’ and the password ‘raspberry’), and set about installing get_iplayer using these instructions. I had to also install make and gcc before rtmpdump would build but other than that it all worked perfectly. I plugged in my 500GB hard drive and I now have something which:

  • is a BBC PVR
  • is a good household-friendly playback device for recorded tv, films and music
  • can act as an AirPlay server for our iPad, iPhone and iPod touch
  • uses HDMI-CEC and therefore responds to my normal TV remote
  • can join my local network and play back media from other devices
  • probably loads more, I’ve only had a couple of hours!

Next step will be to get a suitable case. Maybe something custom etched?

Logging database content changes in a Play Framework app

To do this we use Hibernate Envers.

There are 3 easy steps to adding change logging to the data in your existing Play Framework app (I am using 1.2.4 – version 2 may well be different):

  1. Add the library
  2. Add the standard configuration
  3. Add an annotation to each class where you want to track data changes

Add the library in conf/dependencies.yml

    - play
    - play -> crud
    - org.hibernate -> hibernate-envers 3.6.1.Final:
            - org.hibernate -> hibernate-tools
            - org.beanshell -> bsh 2.0b4
            - freemarker -> freemarker 2.3.8
            - org.hibernate -> jtidy r8-20060801
            - ant -> ant 1.6.5

Add the Envers configuration to conf/application.conf

# Hibernate Envers Auditing Library conf,org.hibernate.envers.event.AuditEventListener,org.hibernate.envers.event.AuditEventListener,org.hibernate.envers.event.AuditEventListener

Add an annotation to each class you want to audit

import org.hibernate.envers.Audited;

public class Book extends Model {
  public String title;
  public String author;
  public String description;

If you run up your app and make a change to an entity you will see a new table appear in your database. If your entity table is BOOK your new table will be BOOK_AUD. It contains a version reference (a normalised reference to a new revinfo table containing the timestamp of that audit entry) and the values of all the fields on the entity after the changes were saved.

You can go wild on the config by auditing only particular fields on an entity (just add @Audited to those fields), or adding new fields to the audit log (like who made the change or what method was called to do it), and change the name of table suffix.

It’s also quite simple to retrieve the list of versions, and this has been written up quite clearly by Matthieu Guillermin (it’s in French but Google Translate does a good job, and you can read the code anyway).

All of this information had already been written in several places, but hopefully this has brought it together in a useful way.

My config changes are from and by Marc Deschamps.