Transaction Scope Guards

I've been writing some Perl DBI code which involves some fairly involved error handling; I've been looking for a way to roll back transactions neatly when certain errors happen. I very nearly reinvented the concept of a 'transaction scope guard' which I now find is implemented in DBIx::Class (with Scope::Guard implementing a more general version). A lexical variable can be used to detect in which cases a transaction should be ended, because the object it points to will get DESTROYed when it goes out of scope. Some rough code to illustrate the concept is below. ...

October 25, 2009 · Tim Retout

Postcodes

I just signed up to a petition about postcodes. The context is that Royal Mail asked someone to stop giving not-for-profit websites access to postcode data. From a database copyright perspective, Royal Mail is within its rights to do this; but it seems wrong that socially useful non-commercial sites are unable to make use of postcodes without paying a high license fee. Compare this to the US, where this data is freely available. ...

October 6, 2009 · Tim Retout

Code Reuse

At work, I have been refactoring old Perl code. Part of me feels that this was tangential to the main aims of the project I've been assigned, but another part of me can list all the bugs I've found/fixed and the advantages in terms of maintainability, so on balance I think it was a good idea. Something I like even more than tidying code is reducing the amount of code required. (I've been doing a lot of that as well.) Breaking code into reusable modules is the essence of what I'm trying to achieve - later projects within the company (and perhaps beyond) should not have to reinvent what I'm writing. I'm attempting to replace boilerplate code with existing modules from CPAN where I can - I'm fortunate in that this seems to be possible licensing-wise within our product. ...

October 4, 2009 · Tim Retout

Escape Velocity

I am no longer going to tag my blog posts with Planet {WUGLUG,UWCS}. As I don't even lurk in the IRC channels any more (or read the mailing lists), and as of recently don't even live near enough to campus to visit, I think it's time to stop imposing my ramblings on the respective groups. :) You can still read my blog directly, or on Facebook, if you are so inclined.

September 20, 2009 · Tim Retout

Unit testing

I spent the last day and a half writing a vaguely interesting Perl module for testing some code which gives a subtly different answer each time (i.e. incorporates data from time() and /dev/urandom) and has side effects (i.e. writes to the file system). By overriding Perl's built-in 'open' function, it is possible to prefix each filename with the location of a temporary directory, effectively emulating chroot(). I also replaced Perl's time() with one that always returned the same answer. This meant that the login code I was testing would return a reliable result. ...

September 9, 2009 · Tim Retout

Southampton

I have changed jobs, and now live in Southampton, working for SmoothWall. This week I have got married on Facebook, and went out to an "alternative" club until 1am on a weeknight. (Normally it plays heavy metal, but Wednesday night is cheese night.)

August 27, 2009 · Tim Retout

Conclusions

Well, I'm nearly at the end of DebConf - I'm missing the last day of talks, so travelling home tomorrow. It's been a really good experience - I mean, DebConf is always fun, but this time I feel like I'm getting more involved myself, and a bit closer to the heart of the community than I did before. In practical terms, the two-week holiday has helped me feel more laid-back - I even got complimented on how I always look relaxed, which was amusing. I'm starting to get to know even more people, and that's helped me be more confident with contributing back. And it's given me some time to finish a few outstanding tasks, although my todo list remains perpetually long. ...

July 29, 2009 · Tim Retout

DebCamp

This week, I've more or less finished my NM questions; I looked again at a problem in dak which turns out mainly to be caused by some edge cases in debconf (the package), so filed a bug there. Then looked at conglomerate, and came up with patches for a couple of bugs there as well. I'm quite looking forward to just being able to NMU these kind of things. With all this hacking, I've stayed up until around 4:30 for the past few nights - I really didn't mean to, it just happened. I'm trying to fix that now (so that I can make it to breakfast). ...

July 22, 2009 · Tim Retout

DebConf9 continues

Yesterday I almost updated mdbtools. Then I went to a debian perl team meeting, and promptly spent 24 hours trying to improve the speed of working with 1300+ git repositories. It's a bit tricky. This afternoon, I looked at some pkg-perl RC bugs... but they're tricky as well. I then updated the postgresql-autodoc man page, and sent it back upstream. Hopefully, next release the Debian package will not need any patches. ...

July 19, 2009 · Tim Retout

DebConf9

DebConf is in Spain this year, in Cáceres. Getting here involved a plane to Madrid, navigating the metro system, a 3.5 hour train journey and then a walk to the accommodation at 2am. This year I had actually looked at a map before arriving in the city, although hadn't bothered to bring one with me. Or note the exact address I was heading for... At night, it is still pleasantly warm here. The streets were quiet except for the "pfft, pfft, pfft" of the sprinklers. Any directions I'd read which involved street names were useless - but I remembered enough of the map to get to where the buildings were, and then wandered around until I found the entrance. ...

July 18, 2009 · Tim Retout