Blog

  • Dailies for Monday 12 May 2008

    • My current diary expires at the end of August, but I’m planning on moving over to one of these sooner than that. But which one to choose? Help.
  • Grand Theft Borrow Auto

    This may sound hideously inappropriate, but Bernard loves to watch me play GTA:San Andreas. People who haven’t actually played the game will probably be considering calling social services on me right now, but anyone who has actually played it will appreciate that it’s possible to show your child the delights of the exquisitely-crafted San Andreas archipelago without exposing them to any malign influences. I’ve long since finished the storyline missions, so we just commandeer vehicles and drive them around the place.

    Bernard’s favourite bit is the bridges. He likes it when I jump in a boat 1 and drive it under bridges. “More bridges! More bridges!” he cries. He also likes it when I get in a plane and fly it underneath bridges. “More bridges! More bridges!” I turn around and fly under them again.

    It got me thinking – what would need to go into a GTA:San Andreas mod to turn it into an exploration-centric game, suitable for all ages?

    1. Remove all weapons and combat from the game. Obviously. Gangs and police can stay, but they’d need to be much more amiable.
    2. Make the strip clubs unenterable.
    3. Don’t allow the player to steal an occupied car. They should only be able to enter a parked car. There would need to be a few more parked cars dotted around the map, to compensate. I’d also propose the standard blue arrow above any enterable vehicles, to distinguish them.
    4. When you crash into someone else’s car, they should express their displeasure in a slightly more sophisticated fashion. All NPC dialogue would need to be checked.
    5. Get rid of almost all of the storyline missions. Most of the side-missions can stay (notable exception being “Pimping”, of course). There should be a new storyline, containing missions that involve things like “get the cuddly rabbit to the little boy before his train departs”.
    6. Prostitutes and drug dealers should no longer proposition you.
    7. Pedestrians jump out of the way before you drive into them (a la *Driver*).

    Anything that you think I might have missed?

    1. we usually pick up the Jetmax from just south of Rockshore West in Las Venturas, or west of City Hall in San Fierro[↩]
  • Dailies for Sunday 11 May 2008

    • Only two kittens on one treadmill though. I feel like there should be four kittens and four treadmills.
  • The laws don’t work

    > The home secretary has said cannabis is to be reclassified as a class B drug.

    Obviously this won’t improve anything at all. But what most caught my eye is the handy table at the bottom of the article, reproduced here for your perusal (content unchanged but HTML vastly improved):

    Drug class Type of drug Possession Dealing
    Class A Ecstasy, LSD, heroin, cocaine, crack, magic mushrooms, amphetamines (if prepared for injection). Up to seven years in prison or an unlimited fine or both. Up to life in prison or an unlimited fine or both.
    Class B Amphetamines, Methylphenidate (Ritalin), Pholcodine. Up to five years in prison or an unlimited fine or both. Up to 14 years in prison or an unlimited fine or both.
    Class C Cannabis, tranquilisers, some painkillers, Gamma hydroxybutyrate (GHB), Ketamine. Up to two years in prison or an unlimited fine or both. Up to 14 years in prison or an unlimited fine or both.

    (I wonder why they used words (seven, five, two) in the third column and numerals in the fourth)

    In the interests of making the punishment proportional to the severity of the crime, here’s my proposal for new drug laws. Does anyone have a problem with this? If anything, I think they might still be a little on the harsh side.

    Drug class Possession Dealing
    Class A Confiscation Up to 10 years in prison or an unlimited fine.
    Class B Confiscation Up to 7 years in prison or an unlimited fine.
    Class C Confiscation Up to 5 years in prison or an unlimited fine.

    Disclaimer: I don’t do any of the above drugs.

  • Dailies for Sunday 4 May 2008

  • Lack of alcohol tolerance

    In the years since University, my exposure to alcohol has steadily dropped… and dropped… and dropped. A part of me wishes that I’d logged my units, because it would be interesting to see exactly how much I am drinking compared to back then. Is it half as much? A fifth? A tenth?

    Either way, it shows. On Wednesday night I drank about four pints of Abbot Ale (5%). My wife tells me that I was noticeably drunk from the moment that I staggered through the front door. I had quite a hangover in the morning, and couldn’t stand up for more than a few minute without feeling queasy. Fortunately, once I had done the whole coffee, toast, shower, brush teeth routine, things started picking up quickly.

    If only the younger me could see me now. “What happened to you, old man?” he’d say. “Four pints? You shouldn’t be having a hangover after four pints!”

    The way I see it, I have the following options:

    1. Drink more beer. Get my tolerance back up.
    2. Drink less beer. Limit myself to two or three pints a night, either by alternating with non-alcoholic drinks, or drinking slower.
    3. Keep getting hangovers on those rare occasions (once a month, ish) when I go out.

  • Dailies for Wednesday 30 April 2008

  • Hardy Heron

    I upgraded to the brand new version of Ubuntu, Hardy Heron, on Saturday. I didn’t upgrade in the usual sense – I actually took a backup of my data and did a complete reinstall. This seemed like a sensible decision, as it’s now three years since I installed Ubuntu, and my hard drive probably bore the evidence of my learning curve, much as a learner driver tends to cause a degree of damage to the clutch of the car that they learn to drive in.

    Why I did a full reinstallation

    There were a couple of other advantages to doing a complete reinstallation. Firstly, it allowed me to set up my partition table so that `/home` is stored on a separate partition. You can also do this with an existing installation, but it’s easier when you’re doing a fresh one because resizing partitions is quite slow, whereas deleting and recreating them is very quick. Having `/home` on a separate partition then makes it even easier to do complete reinstallations in the future.

    Secondly, upgrading Ubuntu tends to take quite a few hours. If you have changed any configuration files (eg `smb.conf`) then you will be prompted whether you want to keep your version, discard all changes, or attempt to merge the two. However, these prompts come up while you are performing the upgrade, rather than all in one batch at the start or end, so you have to sit in front of the computer (or, at least, keep checking up on it) during the upgrade process. However, installing Ubuntu from scratch is remarkably fast. You download the ISO image (700MB), burn it to a CD, and then run the installation from that disc. The installation took about 15 minutes on my computer, and after filling in the initial configuration screens, the main portion of the installation program ran without needing my interference.

    The downside

    The downside to performing a complete reinstallation is that you lose all of your customisations. Application-specific settings are stored in your home folder, so those are easy to import. For most applications, I am taking this opportunity to start with a fresh profile – exceptions so far being Mozilla Thunderbird (with its hundreds of megabytes of archived mail) and Deluge, my Bit Torrent client (with all my RSS feeds). However, you will invariably lose system-wide settings.

    But this isn’t necessarily a bad thing. When I first installed Ubuntu, I had to go through a number of hoops to enable the thumb-button on my mouse, and the multimedia keys on my keyboard. It seems that sometime in the last three years, this functionality was neatly integrated into the base distribution, and I discovered to my joy when reinstalling that it was all detected and configured in a totally fuss-free fashion. So instead of having all sorts of redundant hacks and tweaks to make my hardware work, it should now be handled in the simplest and most reliable way possible. It also gives me the opportunity to see how far things have come.

    Configuration files

    The only configuration file that I’ve had to modify has been `xorg.conf` (of course). For some reason, Ubuntu still can’t detect my 19″ Sony SDM-HS95P (I blame it on a poorly-supported video chipset) so it sets me up at 800×600. I expected nothing less, which is why I held onto a backup of my `xorg.conf` so that I could paste in the relevant lines. Maybe `displayconfig-gtk` could have done the job, but I didn’t bother to check. Incidentally, as far as I can see, there’s no way to run `displayconfig-gtk` from the Main Menu (unless you use the Menu Editor to make it visible in the “Other” submenu as “Screen and Graphics”).

    Any trouble?

    When I tried setting a static IP, the network connection disappeared altogether. This was fixed by manually restarting the networking daemon with `sudo /etc/init.d/networking restart` but I felt that this should have been done automatically.

    I also found that trying to set a workgroup caused the `/etc/hosts` file to be broken in such a way that sudo would no longer work (I’d get the error `unable to resolve host`). Here’s a thread on ubuntuforums.org that contains a solution, but for now I have just left the workgroup blank.

    Improvements?

    I have to admit, there aren’t any particular features in the new version of Ubuntu that I’ve been waiting for with baited breath (except perhaps Firefox 3), but I like to be using the latest and most well-supported version (assuming that it’s stable, of course). I also think that the new Wubi program (which allows you to install Ubuntu within your Windows partition) is an incredibly cool concept, though it doesn’t affect me personally.

  • Possible WordPress date formatting bug

    As you have noticed, I do not display the time on my posts – just the date. However, anything published between midnight and 5am gets the words “in the small hours” appended to the datestamp, to indicate that even though it was technically posted on date D according to some atomic clock in a large city in Europe, it was posted on D-1 according to my internal daily rhythms.

    To implement this, I use the function `get_the_time(‘G’)`. This should return a number between 0 and 23 which indicates the hour of the post’s timestamp. However, this stopped working, and it would actually return a very large number (of the order of about 1.1 billion) so the test failed. I don’t know whether this was caused by the upgrade to WordPress 2.5, or my recent move to a different server.

    I managed to “fix” the problem by commenting out the following few lines near the top of `mysql2date` (defined in `wp-includes/functions.php`)

    if( ‘G’ == $dateformatstring ) {
    return gmmktime(
    (int) substr( $m, 11, 2 ), (int) substr( $m, 14, 2 ), (int) substr( $m, 17, 2 ),
    (int) substr( $m, 5, 2 ), (int) substr( $m, 8, 2 ), (int) substr( $m, 0, 4 )
    );
    }

    However, this is not the ideal solution. Firstly, it’s hard to know if this change is causing a breakage elsewhere in the system (where the code relies upon this apparent bug). Secondly, when I upgrade to a new version of WordPress, I have to remember to fix the new `functions.php`

    I discovered a better solution to the problem. I put `functions.php` back to its original state, and then replaced my calls to `get_the_time(‘G’)` with `get_the_time(‘G ‘)` – note the added space. `$dateformatstring != ‘G’` but the function returns the desired result. Get in.

    I would report this on the WordPress support forums but I can’t be bothered to create an account.

    *Update: I’ve discovered that the offending block of code was added for WordPress 2.5 to address this issue.*