Very quick aide-memoire for me: to quickly choose {theirs} when faced with a Git conflict, just do:
git checkout HEAD [filename]
Simples!
Warning: morose, rambling words follow; this is more an attempt at catharsis than anything I particularly care if anyone else reads -- Al
I suppose it's inevitable that, if you travel around enough on the rail network, you're going to come into close contact with a suicide attempt where someone has thrown themselves under a train at some point.
A couple of weeks ago I was on a train passing through a local station when I saw a man crouching less than a foot from the edge of the fast train platform, almost at the end of the platform. It was late at night and there was no reason for him to be there. Going on the way he was dressed, he didn't look like the train-spottery type. I didn't see a camera. It looked, in short, like he had no reason to be there. I remember thinking at the time that he looked out of place. I even tweeted, in some impotent attempt to alert the gods, that I hoped he would maybe get back from the edge of the platform, rather than get any closer to the passing trains. Thankfully, to the best of my knowledge, nothing came of it; I was just being paranoid. That was enough stress for me though, thanks very much...
Flying in the face of my GCSE statistics tutor's warning that just because something rare has occurred - a lightning strike, for example - it can just as easily reoccur, I thought that that would probably be as close as I'd come to seeing someone put themselves in the path of danger on the railway in my presence. Maybe, somewhere deep down, I even went so far as to hope that was the case. I know these things - suicides, accidental deaths, whatever - will happen; I just hoped, like anyone who doesn't slow down at the scene of road accidents and crane their heads round to try and see some gore, that that was it for me, and that I would be spared any more unpleasantness for the forseeable future.
Clearly, my powers to foresee the future are somewhat lacking...
Having just got onto my train to work this morning, about as late for work as I've ever been and therefore on a train I shouldn't have been on, as we pulled into the next station along the line, and with the train almost into the station and therefore moving no faster than a brisk walk, I realised that the brakes were on harder than usual, felt the wheels skid momentarily, and then we stopped abruptly. The doors didn't open, and the driver, whose compartment was just ahead of my seat in the front carriage, jumped out and started looking under the train.
Passengers on the platform almost as one turned their heads to look at something I couldn't see, a couple with hands to mouth. The look of a person who's seen something, but they don't know what; a person no longer standing where they were just a moment ago, as it happened.
Almost as if under water, or maybe in slow motion, everything slid sideways slightly. Standing up, I looked out of the window at the passengers on the platform, as one seemingly frozen in place, unable to decide what to do, looking for an authority figure to take charge. Railway workers working nearby in their fluorescent orange safety clothing suddenly realised what had happened; presumably it was one of them who went to cut the power to the third rail.
I remember commenting, seemingly inanely, to another passenger still engrossed in his book that I thought someone had gone under the train. It was so quiet; no sounds, certainly no screaming. It felt unreal. I questioned my sanity. Was I imagining something that simply wasn't there?
Those of us on the train were stuck; the doors were deactivated, and moments later as the power was switched off, only a handful of the train's lights remaining lit from the train's backup batteries. That's when it became clear that it was really happening. Something had gone very wrong.
The guard came up from the back of the train. He didn't seem to know what was happening either, just knew that something was up. I told him what I had gathered. He pushed on, letting himself into the guard's compartment, locking the door behind himself.
Unable to get out of the train, I called to a person standing on the platform whether they knew what had happened. Their reply confirmed my fears that someone was down there, had gone under.
Still there was no sound, even as people started to stand inside the carriage, getting out of their seats as they realised something wasn't right. A woman in her '60s asked me whether the train would be going soon; I told her that someone had fallen under the train. Maybe it didn't register with her; she responded that it was very important that she got to her meeting. It didn't even occur to me to be angry, or disappointed, or to make a judgement about her response. I just let it pass me; I had to do something, keep myself busy. Didn't want to think about what had happened, how powerless I felt to help.
That's the thing that always gets to me; the times when I've witnessed a road accident, or anything bad happening, where I can't help - I always feel the same absolute need to help, and I always feel completely powerless to do so.
Still, at least I've never run away. God knows it occurs to you to do so, but you're all in it together. Can't shirk the responsibility thrust upon you. Wouldn't be right, would it?
I ended up walking the length of the train, telling the passengers sitting in the gloom what I knew, which wasn't much, just to do something. Minutes later we were able to file off. I was last, checking the train was empty as I went; there were maybe thirty passengers walking up the platform to the station exit, a route which thankfully didn't allow a view of the body. A sideways glance showed me that paramedics were already present, presumably having come from the nearby hospital; one at the edge of the platform at the front of the train with a red-blanketed stretcher, the other standing on the tracks in front of the train.
Exiting the station, I just wanted to get past the people variously milling in the ticket hall demanding to know what the train company would do to ensure they got where they wanted to go, or simply in shock that this had happened in front of them, the back-and-forward exchanges of people simultaneously trying to work out what had just happened, and what to do next.
A lost-looking girl told me she needed to get to Wimbledon. Somehow we muddled our way to the nearby bus stop, making inane chat, both of us trying to avoid talking about the one thing we felt compelled to discuss. She's training to be an accountant and simultaneously studying philosophy, the latter a subject she thinks is a waste. I disagreed, as you do...
That person who decided that they couldn't go on was, to the best of my knowledge, a woman in her '50s. Just "a woman"; her name hasn't been publicly reported yet. It may never be. The saddest thing about this all, as far as I can see, is that, reading the news website article about the incident, a police spokesperson was quoted as saying that they were opening an investigation to identify the woman; did she set out that morning with no identification on her, knowing she was going to finish things in this way?
It doesn't bear thinking about. There's certainly nothing more I can do or say to help her, or her family, if she has one.
Maybe it would be better if it turned out now that she didn't have any family left behind to wonder where they went wrong, how they let her down.
That's the point about suicide, isn't it? It's designed to kill two people, not just the one...
I don't fully understand recruiters, and have never claimed to have ever fully understood them. I've heard former bosses speak about them in the same way that victims of cockroach infestation talk about their having been overrun by the little buggers, all wide-eyed and bemused at having been invaded by this horde of frankly amazing and terrifying creatures whose sole purpose seems to be to cause a right pain in the arse for everyone... I fear I may have digressed. I don't think recruiters are cockroaches. It just seemed relevant to mention it. Anyway...
I received this e-mail from a clearly very-enthusiastic recruiter this evening. It's a pretty standard e-mail, but since it arrived at a time - a quarter past midnight, fer gawd's sake - when all decent, law-disrespecting folk should really be out doing stuff that doesn't involve work, I may have proceeded to send back a reply which was slightly below the level of professionalism I typically aim (roughly) for...
Hi Recruiter Whose Name I'll Keep Private, you sound like a seriously hard-working recruiter. It's midnight-thirteen on a Friday; don't you ever sleep?
Best of luck placing someone in this role; sadly, I'm not your man. Not for this, anyway. I could probably pop round and make them a cup of tea while they wait for the right guy to turn up though? Actually, I probably couldn't - traffic in London's pretty terrible and I wouldn't want to be late back from lunch.
I might be rambling a bit here...
Thanks for thinking of me though. Especially at this time on a Friday.
G'night =o)
Alex
Well, it'd be rude to say _nothing_ now, wouldn't it...?

There's only so much a man can be expected to do to try and hold his gut in while trying to look attractive on the train to work, on the (not-entirely-smooth) tube to work, or, for that matter, whilst sitting at one's desk at work. Yup, the weather's getting warmer, people are wearing fewer and more revealing clothes, and summer's generally making its presence felt, albeit not necessarily by actually giving us sunshine - oh no, that would be gauché, too obvious, for a British summer - so we have to make do with oppressive humidity and sweat patches. I digress...
I've also had to face the fact that, no matter how much I suck my gut in while walking past mirrors in the changing rooms at the gym, I'm definitely still carrying my winter space blanket on my gut. I'm positive there's a six-pack hiding under there, desperate to get out. Mrs Greyhead isn't so sure...
The other reason why I've bashing out this rambling stream-of-consciousness, while I sit in a pub drinking alcoholic drinks (did you know alcohol has 7 calories per gramme? That's almost as much as pure fat; 60 calories per vodka shot!), is that today I found out that the hotel for our Ibiza 2011 trip, all the way off in September, has been chosen, and it's one I know of from my previous long-stay jaunt out there in 2008.
So, the prospect of me and my wibbly-wobbly gut sending small children screaming for cover on a beach somewhere on The White Isle of Ibiza looms large, and my conscience won't allow me to inflict such cruelty on the innocent minds of island's holidaying little ones.
Anyway, to the point: as of today, I've resolved to start working just that bit harder to get into shape. Not too hard, mind you, but harder than I am at the moment. So, Bob, since you asked, here's the plan:
Cut down on the alcohol: over the last few weeks, I must admit, I've developed a bit of a taste for a drink. In fact, I've been tipsy more often than I haven't when I've been trying to fall asleep lately. In fact, come to think of it, what with alcohol's stimulant properties, it's less than surprising that I've been having trouble falling asleep lately...
Obviously, this is all more than a little difficult what with Mrs Greyhead working in a bar which I have to sit in for an hour or so three nights a week while she finishes work, but I have a cunning plan; I'm going to take up smoking crack. Something at the back of my mind seems to be telling me that this plan may not be entirely sound. No idea why though...
Drink more protein shakes: I've been having at least one protein shake per day lately. I've gone for a reputable brand's "diet" version, which has less fat, more protein, and other goodies such as caffeine, guarana, B vitamins and various other odds and ends designed to promote weight loss.
These protein shakes are easily as filling as a meal, and I'm a bit of a fan of mixing the chocolate and strawberry or banana flavours together which is *really* quite tasty.
The only psychological barrier, so far, is that whenever I explain my cunning plan to get slimmer by drinking protein shakes, I'm reminded of South Park's Cartman shouting "beef caaaaake!" and piling on the pounds, not the muscle. It's ok though; it's only a fleeting image...
Anyway, since one of those shakes can keep me going for most of the day, with a small healthy meal of lean white meat and veg in the evening to provide nourishment. That's all fallen down lately with the lure of lunchtime scavenging at work though, so I need to rein that in and stick to three shakes per day and something small and healthy so I don't go to bed starving.
Get to the gym at least five times a week, ideally six: at the end of the day, this is the main "biggie"; I currently get down the gym three or four times a week, and usually burn off 300-500 calories on interval-based cardio. I've had a problem with my back over the last few weeks which has just been diagnosed via an MRI as two herniated discs - the bottom two in my spine - so I need to take it easy, but that doesn't mean I can't get on the cross-trainer and burn off 500 calories per session.
That, then, is my fitness plan; get to the gym, get back to eating more healthily, cut down on the alcohol and fatty snacks (although I've been pretty damned good with that side of things lately), and generally keep my goal of not being a lardo on the beach this September forefront in my mind when confronted with the option to stuff my gob full of crap, or hold back and stock up on healthy food.
I'm still thinking that crack pipe might be a good way to get thin, though, non...?
Ran into a bit of a strange error today; I was getting a Drupal "table not found" SQL error on my live site after pushing an updated feature from the dev site, and then reverting the feature to get the settings back to default.
The query was:
user warning: Table 'greyhead.node_field_instance' doesn't exist query: SELECT * FROM node_field_instance nfi LEFT JOIN node_field nf ON nf.field_name = nfi.field_name WHERE nf.active = 1 AND nfi.widget_active = 1 in <noodle foo bar>/sites/all/modules/cck/content.install on line 187.
... So I dived into the CCK module's content.install and line 187 called this function: content_instance_tablename(), which I tracked down to content.module, where the function calls this: variable_get('content_schema_version', 0);
On both dev and live sites, this returns 6009, so the content_instance_tablename() function should return a value of content_node_field_instance, but instead seems to be returning a value which is evaluating to < 6001; i.e. the function returns the old CCK schema table name of node_field_instance, and this breaks any queries which rely on this value.
Putting two and two together, my guess was that Strongarm is over-writing the content_schema_version value in the {variable} table at some point during the execution of certain pages, which is breaking CCK's variable_get call.
So I hopped over to the command line to look into the feature files for "content_schema_version"; cd'ing to the feature's directory, I ran:
grep -irn "content_schema_version" *
... which showed that the variable was defined in the feature:

... but that it was providing the right value of 6009. At this point I figured that I was likely to be running into a strange issue being caused by the variable_get running during a variable_set, or some other such voodoo-based weirdness. Easy solution? Remove the field's definition from the feature and allow CCK to look after provision of that variable au-naturel.
So, in the end I simply recreated the feature from the live site (admin > build > features > greyhead settings > recreate) and under the Strongarm drop-down, unticked the checkbox for content_schema_version. Then I re-exported the feature and unpacked it into my MAMP localhost install, did a git commit on the localhost followed by a git push, the over on the server did a git pull, followed by drush cc all and a drush updatedb, just for good measure. Finally, I had to run variable_set('content_schema_version', 6009); using the Devel module.
Touch wood, so far, I haven't seen that error since.
Very odd...
Just a quick "hello" to anyone passing by who might for some inane reason be worried that this blog may actually be dead; it isn't! Huzzah, rejoice, etc.
The terrible truth of the matter is much more mundane; I've simply not been particularly motivated to write on here when microbloggage is so much more easy and accessible.
Anyway, I'd better get back to work - I'm currently in the middle of figuring out how to debug a strange Apache Solr/Drupal 6/Views 3 issue which is proving very odd...
Ttfn //Al
This is a very cool little tip from Lullabot (down the page under "What branch am I on?") for those of you using Git on the command line which allows you to see which repository branch you're currently in via the command prompt. Simply add this code to the ~/.bash_profile file (or create it if you don't already have it):
##############
## Bash prompt
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/'
}
function proml {
local BLUE="\[\033[0;34m\]"
local RED="\[\033[0;31m\]"
local LIGHT_RED="\[\033[1;31m\]"
local GREEN="\[\033[0;32m\]"
local LIGHT_GREEN="\[\033[1;32m\]"
local WHITE="\[\033[1;37m\]"
local LIGHT_GRAY="\[\033[0;37m\]"
case $TERM in
xterm*)
TITLEBAR='\[\033]0;\u@\h:\w\007\]'
;;
*)
TITLEBAR=""
;;
esac
PS1="${TITLEBAR}\
$BLUE[$RED\$(date +%H:%M)$BLUE]\
$BLUE[$RED\u@\h:\w$GREEN\$(parse_git_branch)$BLUE]\
$GREEN\$ "
PS2='> '
PS4='+ '
}
proml
Open a new Terminal shell and your command prompt should now look a little different. Try cd'ing to a directory containing a git repo and you should see the branch name shown. Handy stuff, innit?
You might want to tweak the colours a bit to suit your tastes; if you manage to break anything, you can always revert the file back (perhaps put it into it's own mini Git repo...?). If you come up with a better colour scheme, please let me know!
/Al
Key requirements for a blog: 1) write little; 2) write often; 3) write interesting(ly); and 4) engage your audience.
I'm proud to be able to tell you today that I excel on no less than zero out of the four of the above principles.
Ah.
Not only am I too scared to look at the date of my last blog post on here, but I've completely forgotten what I wrote about. You could wave a copy of my last entry under my nose and I'd have trouble distinguishing it from a hole in the ground, although that probably says more about my goldfish-capacity memory.
Here's a lightning-quick, probably-not-as-interesting-to-you-as-I-think-it-is recap of the last 12-ish months of my life:
- Stopped smoking;
- Left job and England behind and moved to Ibiza;
- Got bored of not using my brain after 1 week and came home;
- Went back to my former NHS job;
- Bought 'spensive suit at Marks & Sparks. Felt (and walked) like a pimp. Got funny looks from other commuters;
- Visited parents for xmas. Ate too much;
- Took some photos of some things;
- Wisdom tooth snapped in half. Still managed to avoid seeing dentist for two months;
- Went to dentist. Dentist pulled tooth out. Asked me - with evil glint in eye - to come back next week. TBC;
- Took some more photos of some more things (to be posted to Flickr sometime);
- Visited the Better Half's parents in Belgium, yet wasn't kidnapped by MI6 operatives, didn't experience extraordinary rendition to a far-away corner of Russia to answer "questions", didn't enjoy a polonium milkshake in a Belgian Maccy D's, and wasn't even punched in the face by BH's father. Highly disappointing...;
- Did some coding with this Drupal interwebs thingbob I build websites with. Very fun (for me; highly boring for normal people, I know); will be releasing three Drupal modules - probably to perpetual dev/alpha - just as soon as I figure out how to do so on drupal.org;
- Noticed slight draft in "downstairs area" and stifled giggling behind/below me as I ascended escalators at London Bridge station one morning. On arriving home, found fist-sized hole worn through crotch of suit trousers. Suspect hot pink-trimmed boxer shorts may have been complicit in giving the game away;
- Took trousers to M&S today and begged lady to help me fix my suit in time for next week's job interviews. I was prepared to use begging, pleading, and offers of bribery with freshly baked goods from Greggs, but in the end only had to resort to being polite. Turns out she was a Very Nice Lady indeed, as I got a full refund on trousers and jacket and headed straight downstairs where Frank the Suit Fitter, the BH and I picked out a hella-nice new suit;
- Tomorrow I'm taking back my shoes which have also fallen apart. What's the worst that could happen?**
- Oh, and did I mention I'm looking for a job? Yes? Then I shall shaddap now.
* Sorry, there's no talk of proportional representation here really; I only said it to get you to read the rest of this blog entry - I know how politics can be sexy. Ahem... ;o)
** Yes, I have seen the Dr Pepper adverts :o)
Thanks for reading! See you all in 12 months...?
So I got bored last night, and found that Picasa can turn a photo album into a video, so I put my 1,000-ish photos from last weekend in and this came out the other end... :o)