Swing library looks rubbish

Swing looking crap?

Try this:


Hope it helps!

Windows, why are you locking my files?

IOError: [Errno 13] Permission denied:

Ouch, it happened again and this time I’m going to do something about it!

Python file IO is easy, great, quick, painless, except when the OS locks your file. No real idea why it likes to do this but here’s an interesting solution I am using in a PyUnit test, because I like to see green results when it’s not my fault!


Anonymous Python functions using lambda

I recently had to create a function that calculates the sum of objects for a given property in an object.

Here’s how it works…

This is the arbitrary object we have a list of:

And we have an anonymous sum function (n.b. sum_by is a function)

Next, we need to call it…

St Peter’s

After moving back to the UK in August 2013, I decided to take up a new hobby: Brewing my own real ales!

Gone are the days where you would sanitize the bath tub and begin brewing malted hops while the family wait impatiently outside!

I have sterile fermentation bins for brewing and pressure barrels for dispensing. I still prefer to do unfiltered siphoning and old fashioned priming with sugar (instead of a chemical or CO2).

I’ve had a fun time learning about the fermentation process, how to make different beer styles and most of all – sampling it with friends and family. The fresh beer I’ve brewed has been a welcome change from preserved, bottled beer that can be bought in shops.

Today, I tried the first sample of my latest brew, an extract kit modelled after a microbrewery based in Suffolk: St Peter’s Ruby Red Ale. Tasting notes? A medium-heavy consistency, light and fluffy head. Instant fruity burst and lingering red fruits in the after taste. The beer is distinctly hoppy and delightfully velvety in the mouth.

All bugs catch up with you… Eventually!

I recently had a need to switch on a String value (I’m parsing JSON Strings in a peer to peer application in case you wondered) and decided to check whether it had been implemented yet in Java. During my search, I came across the following bug:


Perhaps the initial reporter’s guess of “Maybe in 2.0?” was closer than she knew.. It appears to have taken Sun (OK, Oracle now I guess) 16 years to fix a bug, which they had originally dismissed as “Don’t hold your breath”.

I’m just thankful that I can (finally) switch on a String from Java 1.7, even if we do refer to 1.7 as just “Java 7″, but I’ll save a numbering rant for another time.

YouTrack on OpenShift

Here’s what to do:

Follow this link: http://toub.es/2013/07/15/youtrack-openshift-quick-and-simple

The tutorial is a little out of date now, there’s an additional step – YouTrack wont let you complete setup without increasing the permanent memory in the server (YouTrack 5 requires more than the default). You’ll get an error about MaxPermSize and it’ll tell you to increase this value to 150M.

To do this, you need to create a new pre start hook in your git repository:

The server should confirm changes, now refresh the webpage but note, it will be slow – if it doesn’t load immediately then just re-try. Proxy errors may occur in browser, this is normal and it just means OpenShift isn’t ready yet.

Keywords: openshift maxpermsize youtrack saas paas

Segmentation faultsts… 0%

Are you seeing this error on your Debian based distro?
Here’s what to do:



You’re seeing this error because there are corrupted cache files in /var/vache/apt and it also requires a reboot afterwards to take full effect.

After your reboot do a full update:

Sometimes the French word is better…

Living in France and working for an international organisation has led to many opportunities, learning some French has been really interesting, almost as much as learning to understand the culture, particularly in my region (Pays de Gex)!

Anyway, “Software Engineer” can sound a bit boring at times, so fluff it up a bit and use the French: Ingénieur logiciel. I am led to understand (by my French teacher) that this is one of many newer phrases to describe careers which previously (read: before I was born) didn’t exist in French but it certainly sounds more glamorous to me.


Leaving a software job: How do you handover your code?

I’m leaving CERN at the end of this month and thankfully I’ve been able to handover a lot of work personally to my successor, which is not common practice in this organisation. Projects are normally maintained by a supervisor who has been involved in starting or steering the project, but may not be familiar enough with the software to comprehend some of the design decisions or the evolution of the software. There’s another category though, which my supervisor fits into, he enjoys loves programming but he’s just too busy with the rest of his many duties to be involved in the everyday activity at a low enough level.

The process of handing over source code got me thinking about how to successfully leave your position, ensuring that you’ve done everything you can to provide a solid foundation for the next maintainer. Is there a right way? Is it all subjective? What’s the worst case scenario?

The situation here is a difficult one, I’m the main contributor to the current project, my supervisor is aware of the high level processes involved – but the software is developing quicker than can be relayed or even remembered at a managerial level. Whilst documentation exists, it’s difficult to update it entirely when deadlines are pushing closer and closer. Yes, I’m breaking the rule of a lifetime by not documenting my work! I am keeping my successor in the loop and ensuring that she is aware of this fact, so it should not come as a surprise that there is a gap in the documentation which can be filled by reading my design documentation and my notes but I simply don’t have enough time to complete the document changes.

To top off this situation I’m fighting a long term bug in a vendor’s software and I’m writing a new bit of software which is quite important to integrate us with a new Hudson service (We’re already using our own, but due to organizational requirements we must put a lot of effort into making it work on a group led service), so I’m squeezing weeks of work in to the 5 days before I leave. Fun!

I don’t think there’s ever a “good time” to leave, and it would always be nice to have more time – even though this isn’t at all practical or possible. As a result of my increasingly high workload, I’ve started handing over my daily tasks to allow me to spend more time working on finishing my implementation stage.

How do you cut emotional ties to software and stop worrying about what happens after you leave? After all, your source code is your creativity and something you worked on for the past 6 months, 12 months or even longer. I think you can only do your best, document your design and reasoning, get things working right or if you can’t, then help the maintainer by explaining the things which aren’t perfect and cleaning up wherever you can.

What do you do? What is your experience of handing over your projects? Could you do more?

Taking some time out

Since coming to live in Geneva I have been fortunate enough to spend a lot of my time travelling central Europe.

This week I returned to Italy via the Grand St Bernard pass, ate pizza in Aosta and enjoyed gelato whilst wandering the beautiful streets before driving back across the mountains, capturing some stunning views and making our way along on the south side of Lac Léman via Evian where we strolled along the boulevards watching the sun drop behind the Jura mountains.

Next week I’ll return to work to begin handing over my projects to my successor as my time in Geneva draws closer to an end.