Categories
Blogging Computing Guidance Useful Information

My del.icio.us bookmarklets

I used the del.icio.us Complete extension to assist me in posting to del.icio.us. I could right-click a page, choose “Post this to del.icio.us” and a handy dialog came up, prepopulated with the URL, title, and description (populated from whatever text was selected on the page at the time). This was perfect for my needs.

Since upgrading to Firefox 3.0, it seems that the only compatible extensions are the ones that “integrate” your bookmarks in an intrusive fashion. I don’t want integration. I want the exact opposite. I want total disintegration. So I’ve gone back to using bookmarklets.

I basically use del.icio.us for two things. Firstly, I use it as a todo list. I post links with the “do not share this” flag set, and tagged “todo”, so that I can look at them later. This is the bookmarklet that I now use for this task:

Bookmarklet #1

I got it here. It’s not perfect though. It doesn’t seem to work the first time you use it in a session. I guess this is related to the fact that it uses https. It also pops up an alert at the end that says “OK, tagged as todo” whether it actually succeeded or not. I tried removing this alert, and the bookmarklet stopped working. Can’t fathom why.

On to the second bookmarklet:

Bookmarklet #2

This one is much more straightforward. It just opens a window containing a small “post” dialog, prepopulated in the same way as the old del.icio.us Complete extension. It doesn’t use https, so it never asks me for my login details. The window closes when you post it.

I just thought that I’d post these bookmarklets here, partly for my own reference, and maybe because someone else might find them useful at some point.

Categories
Gardening Photos

Rhododendron

rhododendron

In the churchyard near our house.

*Thanks to Graybo for correcting my earlier misidentification of this plant as an azalea.*

Categories
Gaming

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 ((we usually pick up the Jetmax from just south of Rockshore West in Las Venturas, or west of City Hall in San Fierro)) 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?

Categories
Displeasure In The News

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.

Categories
Meander

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.

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.

Categories
Blogging Guidance TITGIG

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.*

Categories
Computing Displeasure

Bankers

If my bank were to check the access logs of their online banking site, they’d discover a few requests every day with the following user agent:

Mozilla/5.0 (Windows; U; Windows NT 5.1; en; rv:1.8.1.11) Gecko/20071127 Firefox/2.0.0.11 (actually 3.0b5 but a certain banking site won't let me in unless I lie about it)

Someone should tell them that trying to block people using user agent sniffing is about as futile as trying to reduce the teenage pregnancy rate by means of abstinence-only education.

Categories
Photos

Sceptic tank

sceptic tank

Fnar.

This image is licensed under Creative Commons by-sa 2.0, as is the original source image.

Categories
Music

How to choose the right cover versions

Cover versions serve two main purposes for a fledgling band. Firstly, a new band may only have four original songs. But add on a few covers, and all of a sudden they have enough material to fill a 45 minute slot. Secondly, they assist in maintaining the attention of an audience who are probably totally unfamiliar with your original material. Here are a few guidelines to choosing the perfect cover versions. They’re only guidelines, so there are exceptions, but if you do break them, you need to be able to justify your decision.

Familiarity

Choose a song that your audience will know.

As I said above, one of the main reasons why a band would play a cover version is to maintain the attention of the audience. If you play a song that they don’t know, then you gain absolutely no benefit. In fact, you’ll be making life unnecessarily hard for yourself. It’s relatively easy to draw a positive response from an audience member if you play a song that they know. It’s harder to draw a positive response if you play them one of your own songs that they haven’t heard before. But if you play them a song that they haven’t heard before, and it isn’t even one of your own original compositions, then they’ll have practically zero incentive to listen.

When to break this rule: If you love a song so very very much, and you can play it exceptionally well, then you might want to do a cover version of it anyway. This is, in effect, saying to your audience “I love this song, it’s amazing, you absolutely have to hear it.” But your performance has to be outstanding for this to work. If you’ve only been playing guitar for six months and you attempt this move, then there’s a 90% chance that you’re making a big mistake.

Originality

Choose a song that hasn’t been “covered to death”.

When was the last time that you heard a group of four pimply teenagers play Creep and found the experience to be wholly transcendental? When was the last time that you heard a group of middle-aged men play Yesterday and thought anything other than “Oh great, this one again.”

You should be aiming to select songs that are well-known, but have somehow been overlooked for covering. You want your audience’s response to be “this is a fantastic song, how come I’ve never heard anyone do a cover version of it before?” If you can elicit that response, you’re guaranteed success, even if the quality of your performance is modest.

When to break this rule: There are three clear circumstances: If you know your audience, and you know that they will accept it; if you know that your performance is exceptionally good, and this will be the greatest cover version of song X that your audience has ever heard; if you are doing “something substantially different” with the song.

Playability

If you can’t play it, then don’t try to play it.

It’s 24 hours until the gig, and the song still sounds crap. Don’t try to convince yourself that it will be alright on the night, because it won’t. It will be even worse on the night. When you look back on a gig, the most vivid memories are always the songs that you shouldn’t have played. If you ask me really nicely, I’ll upload an MP3 of my band’s cover of Neighbourhood by Space, and you’ll see what I mean. Every time I think of that gig, the first thing that comes into my mind is that song.

When to break this rule: There’s no excuse for breaking this rule. If you’re worried about your set being 4 minutes too short, then just spend a little bit of time chatting with the audience. They’ll appreciate it. If you’re too shy to talk, then just leave the stage 4 minutes early. I assure you, it’s much, much better than the alternative.

Entertainment value

Choose a song that will entertain you and your audience.

If the song is long and repetitive, then your audience will probably get bored. If you don’t enjoy playing it, then your performance will be lacklustre. Don’t settle for a second-rate song just because you know how to play it. Remember, these cover versions are here to help you to keep the audience alive. Make them count.

When to break this rule: If the song is so good that even a half-assed effort can’t ruin it. No examples spring to mind, but it’s not beyond the realms of possibility that they exist.

It’s about the song

Avoid the “hey, aren’t we ironic” cover version.

At my second gig, we did a cover version of Wannabe by The Spice Girls. This was a big mistake.

For the first 30 seconds, the audience might get the joke, and might chuckle. But then you’re stranded there on stage and you have to finish the song. It’s quite embarrassing.

When to break this rule: I’ve successfully broken this rule once before, but I’m not going to tell you about it. For now, just take this one as gospel.

It’s about the music

Consider how the song sounds when the vocals are inaudible. Added 2008-04-22

As a fledgling band, you’re going to be playing gigs in venues with terrible acoustics, useless sound engineers, and heaps of background chatter. To your audience, the vocals will be unclear and indistinct. It will sound not unlike the lead vocalist is humming the melody. So try that. Practise the song, but instead of singing the lead vocals, just hum the melody. What does the song sound like now? The same four chords repeated over and over again for four and a half minutes? That’s what your audience will hear. Maybe you should drop that song from your repertoire.

When to break this rule: When the song is so well-known and singalongable that the audience are going to be drowning you out anyway. Or if you can be absolutely certain that the vocals will be audible (ie if you have played a gig at a certain venue with a certain sound engineer and your friends in the crowd told you afterwards that they could make out the vocals clearly on every song, then it’s a decent bet that you’ll get similar results on a subsequent occasion).

When to break all of these rules

When you’re just starting out. Your repertoire is limited, and you have to do what you must. But as time goes by, you should aim to replace your weak cover versions with stronger ones. Right now, you have a valid excuse, but it doesn’t last for long, so don’t get complacent. Your band won’t fulfil its potential until you’ve ditched the deadweight.

What about recording?

Putting cover versions on your album or demo CD is generally a bad idea. “Filler” is bad enough when it’s original material, but when it’s someone else’s song, it’s bordering on the criminal.

When to break this rule: If you feel that your version is better than the original, or significantly different, then by all means, show it off. Here’s a list of good examples.