Articles by CiaranG

You are currently browsing CiaranG’s articles.

Snakes and Ladders

I was amused to hear that even amidst a story about plummeting property prices and a stagnant housing market, the folks on the lunchtime BBC News show still can’t help referring to “getting on the property ladder”.

How does this ladder work again? Borrow more than you can afford in order to pay for something that will immediately be worth less than you now owe? And that’s if something you can’t actually sell has a value.

Don’t they recognise a snake when they see one?

240L

Stand in front of our house on a sunny day and you’ll hear the clip clop of hooves, the sound of a tractor at work, and some very strange excerpts from cyclist’s shouted conversations as they pass by. You might even hear someone say “Can you believe that? He’s out there taking pictures of the bloody wheelie bin again!?”

Luckily whoever would be saying that isn’t in the house, or they’d have something to say about me sitting here writing about it again. So 240L, I assume, is the capacity of the bin and helpfully it’s there in braille too, which is only fair because the blind should obviously have as much access to useless information as anybody else.

However, the only really useful bit of information on a wheelie bin is not the capacity or how loud it is, but the colour. We are lucky enough to only have two – black for stuff that goes to landfill, and green for stuff that they pretend to recycle, but actually goes to landfill. Some places have three or four, along with a strange assortment of bags and boxes that go out on the road on particular days. These are apparently policed by an army of stab-vest wearing hitlers who take great pleasure in issuing crippling fines to the elderly for accidentally putting a normal tea bag in the bin reserved for herbal tea bags. The proceeds of all these fines, after the hitlers’ wages have been paid, are stashed away in Icelandic banks to pay for the local councillors’ next “fact-finding mission” to Barcelona or Florida. Anyway, back to the bins themselves…

You would think then, that they might have put the colour on the bin in braille instead of the capacity, but no. If you’re blind, I guess you must go out to your bins and (by somehow managing to get your finger in the right place) discover that you have three identical bins, all with 240L capacity, but no clue as to which one to put your cardboard in.

APNG is a backwards-compatible extension to the PNG format that handles animation – a modern day, less klunky equivalent of the much abused animated GIF. A pea is a vegetable. Or is it? I am saying no, the pod is a fruit, and the pea itself is a seed. Feel free to argue amongst yourselves.

A short film about peas

The above won’t work if you’re using Internet Explorer (stop doing that), and possibly not if you’re one of those Apple types either, though I’m not sure.

Update: I’m told this actually crashes Aurora, Midori and Kazehakase. I can’t help but wonder if that’s exploitable.

Regular visitors (I’m being a bit optimistic using the plural there) will notice that this site has been smartened up a bit. Here’s what’s changed:

  1. Switched to the Tarski WordPress theme. Very easy to do. A bit of customisation was required, but because of the way the theme has been built with hooks in place, I was able to create a plugin to do the things I needed instead of having to modify anything.
  2. Dropped the ‘blog.’ from the domain, although all old links should redirect nicely.
  3. Integrated a Gallery installation.

The last part was the trickiest, and more importantly the most pointless, so that’s what I’m going to talk about…

Read the rest of this entry »

So you followed all my tips in the first installment, but you’re still worried that your code might be maintainable? Here are some more:

  1. Forced to fix a bug? Don’t worry, you can reintroduce it a couple of releases later, as long as you remembered not to add a regression test for it.
  2. If you must document code, don’t take the opportunity to explain WHY it’s doing what it’s doing. Just describe the obvious. Learn from the masters at Microsoft:
    // Initialize the column to '0'
    ColumnToSort = 0;
    // Initialize the sort order to 'none'
    OrderOfSort = SortOrder.None;

    No, really, that’s not made up – see for yourself.

  3. If you have to generate a lengthy SQL statement, avoid any kind of formatting of the code that might make it readable. Instead, cram it all on one line such that you can only see a small part of it at once.
  4. Avoid unnecessary timezone calculations by living on the Greenwich Meridian and only testing your code when DST is not in effect. Or preferably not at all.
  5. Threading is your friend. Find obscure ways to make sure your functions are not re-entrant. When reports of random failures come in from production environments, simply say you can’t reproduce them.
  6. Carefully read any coding standards that apply to your project and commit them to memory – otherwise there is a risk you might comply with part of them by mistake.
  7. A multidimensional array is a fine construct for storing your tabular data, but only if you refer to all your columns by numbers and don’t document them. Better still though, is a comma-separated list of pipe-delimited strings. For bonus points, use a delimiter that only rarely occurs in the actual data.
  8. Use floating point numbers for your currency calculations.
  9. Although cluttering up the code is normally a worthy cause, don’t waste your time validating user input. Rely on bug reports to find out the interesting effects of the ‘unexpected’ things they entered.
  10. Refactor. Because you feel like it.

This is a quick and dirty utility I put together for my own use, but maybe someone else will find it useful. It can take a project from a local Code Co-op installation and recreate the full history as a Bazaar repository.

Read the rest of this entry »

A quick guide to getting Laconica up and running on Debian Etch using PostgreSQL as the database. The starting point for all this is a clean install of the netinst version, with no additional software selected during the install. Everything here is done as the root user.

If this all seems a bit long-winded, that’s because it is, but I thought it was better to cover everything from a clean install. In theory you should be able to follow this to the letter and end up with a working Laconica. Corrections will be gratefully received.

Read the rest of this entry »

For some reason last weekend seemed to be nicer than any we had over the so-called summer, so it was a perfect opportunity to get started on cutting the hedges. I have a crappy electric hedge trimmer that gets stuck on a hawthorn branch every 30 seconds, and I’ve also sliced through the cable three times previously, so it’s all done by hand these days.

Mia had to help out of course, and yes that’s her pictured right, two years old and up a wobbly stepladder with a pair of scissors. And yes, that’s a plaster on her finger, but she didn’t do it with the scissors – that was the day before with the kitchen knife. I guess that when Mia gets to the age where she can use the internet, she might read this blog and then head on over to Wikipedia to find that most other children have ten whole fingers. If so, Mia, however many fingers you have now, that’s how many you were born with and I can produce photoshopped evidence if necessary.

More seriously, I don’t advocate that anyone lets their toddlers use knives and scissors or climb ladders. On the other hand, I don’t recommend that anyone tries to tell me what my toddler should and shouldn’t do when under my close supervision.

Another weekend task was rot-proofing the chicken house, slightly too late but better that than never. Unfortunately, when I bought the ‘stuff’ I failed to notice something quite important and at no point during the transaction did the shopkeeper helpfully say “you do know that stuff is bright chuffing orange don’t you sir?” Therefore, due to the shopkeeper’s neglect, we have a glow-in-the-dark chicken house that people will probably use as a landmark when giving directions.

Unfortunately there’s still quite a lot of hedge left to cut (I assume that people who call it trimming have a totally different kind of hedge) but in the meantime I can take pictures that only include the bits that are straight-ish and pretend it’s all like that.

Spot The Odd One Out

What’s the difference between these?

Deathstar

A sorry and tedious tale of hardware failures in a world where technology and frozen peas collide.

I got up this morning (or rather I was dragged up by Mia, as usual, at an ungodly hour) and the first thing I noticed as I wandered past my office on the way to the bathroom was a horrible silence where the happy whirring and grinding of a dust-filled fans and creaky old hard drives should have been.

Read the rest of this entry »

« Older entries