- Hot. Lots of women wearing pink. #raceforife #bromsgrove #
- At last. Summer is back. We'll soon be moaning it's too hot. #
- Love pacman at http://google.co.uk. Wonder how much this has cost the country in wasted work time ? 😉 #
- Grr. 4sq Is vaguely intelligent. To think I might have to go inside the places I visit and stay there for a bit. #
- There are too many smug people around today, who are strangely happy considering some chav has stolen the roof off their car. #
- If the council paid me £1 a go to pick up other peoples dog poo, I'd be rich. #bromsgrove #
- Must stop laughing at the 'new' dog (well he's had a good coat trim) #
- First 2 applications from Aston uni students for an industrial placement year are failures – customise your cv/letter for the job! #
- I wonder how much of bromsgrove I can rule over in 4square #
- An interesting end to season 1 of V … good episode. #
- RT @OpenRightsGroup Nick Clegg asks what laws to delete, tell your MPs, the #DEAct http://bit.ly/repeal-the-dea #DEBill #
- An eventful but uneventful night. Everyone's tired Jim. #
- Check out my OnePage card at http://myonepage.com/david.goodwin #onepage #
- RT @GeneHunt I liked the idea of being married. It's great to find that one special person you can annoy for the rest of your life. #
- RT @jakebible Dead Mech Episode 19 is so gonna put a mechanized boot in yo ass! Subscribe at http://jakebible.com (plz RT) #
- Learning about vaginal dividers, dual cervixes and horned uteruses. I'm glad I'm not a woman. #
- RT @birminghampost Woman banned from drinking in public found drunk in Bromsgrove street http://tinyurl.com/39lw3oc #
Twitter Weekly Updates for 2010-05-16
- I've never walked a dog which can't make it up a small hill without collapsing in a panting heap. #
- The neighbours are walking a young cat on a lead. Guess they're trying to keep up with the girl who walks a ferrett in town #bromsgrove #
- RT @GeneHunt A prisoner escaped last night, she's a clairvoyant midget. We're warning the public that there's a small medium at large. #
- RT @GeneHunt You know what it means when you come home to a little affection, tenderness and sympathy? It means you're in the wrong house. #
- RT @grifferz Believe me, it's possible. http://www.lamebook.com/wp-content/uploads/2010/05/PhoDohs1.jpg nice spelling. #
- RT @PalePurpleLtd Looking for professional php dev. Contract or full time. See http://bit.ly/cbk1H1 #
- I wonder how often someone types in a bit.ly URL incorrectly and gets/leaves a rude surprise. #
- I signed the petition to repeal the Digital Economy Act http://bit.ly/deapetition #DEBill #DEAct #GE2010 #
- Right, time to run off this stupid sore throat and looming crapiness. #
- I'm mentally washed out now. Time to degenerate down to a 2 year old's level soon. #
- Strange sales pitch about sales training with someone from Sandler Training (anyone come across them? http://uk.sandler.com/) #
- Everyone will suffer now; everyone will suffer now. You can't help yourself. #
- Run away (for 40 minutes) #
- Dear Twitterverse: Is Nightmare on Elm Street any good / worth watching?
http://bit.ly/9PrXdg # - Don't use phpunit from Debian Lenny (v3.3.16) – full of fail; Install via pear. My tests now pass; I now get code-coverage reports. Win. #
- Toddler clearly deciding that he should have a lie in. In the interests of Good parenting I can't get up till he does … 😉 #
- Today's discovery – orange marmalade with ginger. nom nom. #
- 35 weeks http://twitpic.com/1mn5vm #
Twitter Weekly Updates for 2010-05-09
- Just found Prey – remote tracking of laptop etc incase of theft … http://preyproject.com/ #osx #linux #windows #
- Stripping done, holes filled; now to get the gun out and do some kinky latex^h^h silicone sealant stuff … Then lawn mowing. #
- Roast lamb after 17 mile run seems good. (2.5 hours; worship me) #
- 10k isn't far enough – let's do http://gb.mapometer.com/en/running/route_578234.html instead. #
- RT @UKLabourParty We need 100,000 people to retweet if you want Proportional Representation #
- Suggestions on how to stop a dog chewing stuff when he's left alone welcome. (attention seeking?) has bone etc to chew …. #
- Think I'll wait for an android like ipad or spend the money on an iPhone v4. #
- My tummy and bed are now a drum with toddler hand sized drumsticks beating away. #
- Ah that's better. Second waking at 9am. This is more civilised. #
- Waking at 550 on a saturday is not ideal. #
- Right. Time to cudde up to the boss and fall asleep. #
- RT @GeneHunt Why is it that one careless match can start a forest fire, but it takes a whole box to start a barbeque? #
- Is rowan trying to give me a hint by the way he's washing the bath (as opposed to washing himself in the bath) #
- Emergency chocolate fix applied. Recovery underway. Now I want more …. #
- Sweet. I definitely don't need a tv license – http://bit.ly/3s3jM9 & still use iplayer #
- RT @alexmace This is exactly why I voted Lib Dem: http://bit.ly/bhfwgw RT if you did too. #votelibdem #
- #ukvote B61 #
- Git is too quick. I have difficulty accepting it's done anything – perhaps it should sleep(1) to give me confidence it's done something. #
- I've just registered my opinion for my constituency for #ge2010 at http://www.twitVoteUK.org.uk, why don't you? #twitVoteUK #
- Fixing your router's WIFI since 1903 #
- TV harms children / toddlers / babies – http://news.bbc.co.uk/1/hi/health/8654963.stm – no news (haha) there then (or surprise) #
- Haha. I've had the window open and blinds drawn in the office for at least an hour and the minions haven't noticed / burnt from sunlight. #
- Damn you ubuntu – updates to an existing release shouldn't break everything. Grr. #
- There's a horrible smell of burning plastic/dead computer in the office and my desktop is unwell. Are the two linked? Fuckitallnotagoodday #
- Guess I should run. 10k race this Sunday. Still doing 6 miles this morning isn't much shorter. #lazyweekend #
- RT @GeneHunt I'm proud of my Grandfather. He shot down two German planes. Admittedly that was in 1972 but you can't be too careful. #
- Iron man 2 perhaps. #
- Stupid hail. It's summer. Get lost. Come back in November. #
Trac and Git on Debian Lenny
Random Brain dump – Trac 0.11 with Git on Debian Lenny; this worked for me …
We’ll use /var/git/ as the location where our git repositories live – e.g. /var/git/repository1, /var/git/repository2 etc.
So, assuming you have git-core installed, create the Git repository:
mkdir -p /var/git/repository
cd /var/git/repository
git init –bare
Next, install the trac-git extension so trac can do ‘git’ like things:
apt-get install trac-git
Ensure the WebDAV FS module is enabled in Apache:
a2enmod dav_fs
And Expose where the Git repository is on the web server – e.g.
cd /var/www
ln -s /var/git git
And add something like :
<Location /git> DAV on </Location>
Next, let’s create the Trac Repository:
trac-admin /var/trac/repository initenv \
   repository sqlite:db/trac.db git /var/git/repository
Configure Trac to do Git things:
Edit /var/trac/repository/conf/trac.ini and make sure it contains something like :
[components]
tracext.git.* = enabled
[git]
cached_repository = false
git_bin = /usr/bin/git
persistent_cache = false
shortrev_len = 7
Finally, just make sure permissions are correct:
chown -R www-data /var/trac/repository
chown -R www-data /var/git/repository
Then finally, restart Apache, point your web browser at the trac repository (assuming you’ve already setup Trac via e.g mod_python or similar) and you’ll probably seen an AssertionFailed error (with no helpful message). This seems to be a one off when the repository is empty… so try :
mkdir ~/src/tmp
cd ~/src/tmp
git init
echo 'test' > hello.txt
git add hello.txt
git commit
git config remote.upload.url https://user@remote.host/git/repository/
git push upload master
(If this fails with some unhelpful message like :
orange:~/src/tmp $ git push upload master .... error: Cannot access URL https://david@remote.host/git/repository/,
return code 60 error: failed to push some refs to
'https://david@remote.host/git/repository/'
Twitter Weekly Updates for 2010-05-02
- Good luck with the #dyfienduro mtb'ers. #enduro #mountainbiking #Machynlleth #
- Time to say goodbye to "cd /pub; more beer" (t-shirt). You've lasted at least 10 years but now look a bit too old. #
- I tried to get some non-dull coloured clothes. http://twitpic.com/1k046l #
- Chewing my £15 (new) running hat is not smart or clever dog. http://twitpic.com/1k038b Maybe I'll forget to take you to the farm tomorrow? #
- Best add Predators To my list of films to watch. #
- RT @GeneHunt What's long, hard, easy to erect and makes women groan?…… An Ironing Board. #
- http://www.whatthefuckshouldimakefordinner.com/ – my biggest problem of the day is now solved!! 🙂 #
- The dog has a hard life. Eating a donut. http://twitpic.com/1jloat #
- Cameron was smarmy and didn't answer questions; Brown tired and boring. Clegg genuine but niave? Seeing DC may have put me off voting Tory. #
- Ought to find a running club/group in Bromsgrove…. and/or Squash. #
- welcome #ubuntu lucid …. time to upgrade desktop soon then. #
- This is how you to scream (while chasing a dog) – toddler style…. http://www.youtube.com/watch?v=9vDXZjnknoI #
- RT @GeneHunt 'Ultra-sensitive condoms?!' What do they do? Keep her talking after you've gone to sleep & ask how she's feeling? #
- RT @schmooster #bigotgate For the sake of balance, here's Cameron with the public. http://short.to/26n59 <- nice 'documentary' #
- wondering if I'm somehow damaged a nerve along the top of my foot; weird sensation occasionally…. still at least it's not my hand. #
- Anyway. Time to go running. 7 miles perhaps. Rests are for girls and babys. Sort of. #
- This is not orange (or any fruit) juice on my arm….. "bloody dog" http://twitpic.com/1iw4od #
- Avatar is only £8 on DVD on release. So it really was over hyped and not that good then? (3d ++; story —-) #
- I'm sheltering in the blind (warm) spot of an overactive aircon unit waiting for gparted to do succeed. Not quite
my idea of fun. # - Stupid Compaq server vs gparted. Gparted seems to be winning. Phew. #
- I wish I'd remember to upgrade $server before feeling tired at mid-night. #
- Woo… 148 out of 844 marathon wise (http://jand.co.uk/Results2010/ShakespeareFull.pdf); now my head has expanded. #stratford #marathon #
- Won't be voting for them…. http://twitpic.com/1iotli #bnp #
phing / unit tests and global variables
Yesterday I thought I’d move one project over to using phing (with the end goal of hopefully getting some sort of Continuous Integration setup in place, with graphs and stuff to show the customer).
All went reasonably well – svn update, php documentation generation, php code sniffer tasks etc were all in place. Unfortunately when I got to do the unit tests (simpletest) things failed, and it seemed to be the case that no global variables in use within the code base were available. As my brain finally realised why this is the case this morning, I thought I’d better write a blog post in the hope it may help someone else in the future.
The code base itself is ‘legacy’ – in that it’s been pulled in different directions over the years before we got our hands on it. There’s bits of procedural code (e.g. query(..) which seems to just be the same as calling mysql_query(..)) and object oriented ($db->query(..)). Mixed in with this is a liberal use of global variables (e.g. $db, $database_name, $software_root and so on).
My unit tests, when run via a script on the command line look like :
<?php require_once('common.php'); require_once('simpletest/reporter.php'); require_once('simpletest/unit_tester.php'); $test = new GroupTest('my tests'); $test->addTestFile('WhateverTest.php'); $test->addTestFile('FooTest.php'); exit($test->run(new TextReporter()) ? 0 : 1);
And worked fine.
Within the code base, there is one include file within the application which defines a number of variables, on the assumption it’s at the top level scope – e.g.
$database_name = "blahblah_live"; $db = new Database($database_name, $database_username, $database_password, $database_host);
Which works fine. However, because $db hasn’t been explicitly defined as a global variable, when the tests are run through phing – they run within the scope of a function, and hence the global variables aren’t available (because they’ve not been implicitly registered as globals – the code just makes an assumption that they are).
So, to fix it, I just need to find all the variables defined in the script, and make them explicitly global.
i.e.
global $db; global $database_name $database_name = "whatever"; $db = new Database(.....);
One step closer; perhaps soon I’ll be posting about getting Xinc or something similar working.
My First Marathon
But will it be my last?
To detail it here – hopefully instead of telling everyone the same thing – and to remind myself next year… here’s how it went.
We arrived in Stratford for the Shakespeare marathon at about 8:45am, changed, herded toddlers and children towards the start and did the toilet ritual. The start line had moved from last year, but it was obvious where to go. Then we spent about 15 minutes standing around waiting for the start klaxon.
Obviously the start was crowded; there were fat/slow/lazy people everywhere – as I did a lap around the town centre, I just found myself zig-zagging through them all and getting frustrated somewhat. It was nice to have Rowan, Kat, Jenny, Emily, Rachel, Helen, Vickie, Anderson and Bailey all looking on as I raced past. Suffice to say, I was full of beans at this point in the race 🙂
I knew I was running relatively quickly, at least for the first half marathon – I did 12 miles in about 1 hour 30, or thereabouts – and enjoyed myself certainly until sometime after this point, which makes me wonder if I should do half marathon’s in the future and not bother with full ones (now I’ve done it… ) but that’s an argument for another day.
Anyway, at about 16(?) miles, I went to the loo; while sitting down on the toilet (hey, at least I didn’t just hide behind a hedge) my legs were busy shaking. By about 18 miles I was making a conscious effort to slow down a little, and keep my heart beat at around 150-156. I suspect I generally failed at this. In my mind I knew I had little more than my daily morning run left to complete – but it certainly dragged on. My fingers and toes had been getting slightly numb since perhaps 18 miles. Maybe earlier.
The last 5-8 (?) miles of the marathon involve running down a straight disused railway track – the Greenway – this dragged on for a long time. Especially as we’d covered part of it on lap one. By about 20 miles, my stomach area was starting to cramp slightly; By 22-23 ish miles, I had slowed down quite a lot – but discovered myself overtaking walkers doing the half marathon. My vision started to blur slightly, and my legs felt pretty useless perhaps at about 24 miles – and time / distance seemed to drag on and on.
Eventually I returned to the recreation ground/park in the middle of Stratford for the finish. In retrospect I could have upped my pace at bit at this point – but it still seemed like there was some distance left to run, and I couldn’t remember the route that well from last year – so it wasn’t until the last corner that I sprinted what is probably the last 50 metres to the finish line. My legs were numb, I was just glad the ground was quite flat as I couldn’t really feel them. Thankfully I didn’t trip which would have been a pain.
Once over the finish line I just wanted to collapse and remove my t-shirt. My shoulders had ached for about the last hour. I staggered back to where the waiting family were and promptly collapsed on the floor. My legs then took turns in cramping in alternate muscles – Jenny didn’t approve of my method of punching myself in the appropriate cramping muscle and helped me stretch – which I think helped.
So, anyway, would I do it again? Yes. But I somehow need to get a better sense of pace. On my own, two to three weeks ago – with no one to chase – I did 24 miles in about 3 hours 30 mins and that was difficult enough; yet I did the entire marathon in 3 hours 35 mins on Sunday. I can see that I probably went too quick for the first half, but I’m not sure I have the discipline (?) to slow myself down in the first half enough to have an effect towards the end.
So, Nottingham’s marathon beckons sometime in September, I think.
If I’d done just the half marathon, I’d have been in good form at the end (not tired, able to run the last mile or so very quickly etc); yet I did the full marathon and found it pretty hard going. So, should I focus instead on just doing half marathons quickly? I don’t think I have the lanky runners physique which suits marathon runners…..
Update: apparently I was 184th out of nearly 900 runners. 🙂
Twitter Weekly Updates for 2010-04-25
- Stratford marathon done – 3hrs 35m. Did first 12 miles in 1hr 30. Failed to pace myself. Legs enjoyed cramping for 30 mins after. Good fun #
- Podrunner's PowerTools mix – 174bpm; I wonder if this will help me run or not…. http://bit.ly/vXbcS #
- Hmmm. Not long now. Best pull finger out and move it. Alarms don't wake toddlers. An interesting fact perhaps. #
- Spoilt dog http://twitpic.com/1i3avu #
- Palringo seems pretty good (Im client for iPhone, pc, mac etc) #
- Marathon tomorrow. Better start peparing. Food. Food. Music 4 iPod and check schedule. #
- "this shirt would look good on your bedroom floor" – you're fat and ugly, so it's not going to happen for you mate, let's be honest. #
- Ah, tetris – http://www.last.fm/music/MidTown+Dickens/_/Tetris #
- I like playing tetris in the shower…. tetris is my favourite video game… (lyrics to a song being played in the office) #
- Since poundland opened in bromsgrove all other shops seem to have started to price things at £1. Wasn't it 99p before? 😉 #
- Reasons to be a dog: #1 good looking women pet you randomly and scratch your back. #2 you can't go in most shops. #
- Shorts. Thick jumper. Hmm. Dogs have it easy – none of this clothing nonsense. #
- Taking a day off work just so Eon can change the electric meter is not going to happen. FFS be more specific than 8-8pm. 1 hr slot perhaps? #
- Dog's hungry. #nickcleggsfault #
- I need to shave/shop/eat. #nickcleggsfault #
- RT @PalePurpleLtd Interviewing students for placement year – my findings – http://bit.ly/cSUD4v #
- RT @guardiantech Facebook introduces Docs, based on Microsoft Web Office http://bit.ly/cnHviA #
- Lunch time view. Bit better than normal. http://twitpic.com/1ha3r5 #
- RT @carolinegoodwin Spoof Daily Mail article http://twitpic.com/1h8ik8 Quite funny #
- More spam from prospective mps #bromsgrove #straight2recycling just have a f'ing web presence…. #bromsgrove #
- Bad things today: 1) diesel £1:20 a litre; car drank 45+ litres. 2) tired 3) poss. last run before Sunday – better make it count (7miles) #
- Pershore looks quote nice. Wish bromsgrove wad as good #jealousofcustomersoffice #
- Now, can I find a running hat in preparation for Sunday ? #
- Stourbridge road properly blocked; looks like they've nearly finished (hole filling up) http://twitpic.com/1gru97 no more cheating drivers! #
- Don't appreciate being overtaken by an old woman on an electric bike while running uphill. She got away on the downhill. Old fat lazy Cow. #
Post #1 on the UK Election…. (Bromsgrove)
So the Lib Dems might finally shake things up – I’ve not supported them before, and still dislike many of their policies – but I do feel that were they to get in, there would be an adequate shake up of the establishment in Westminster (PR or something similar would be a good move for a start – I’m increasingly fed up with (I feel) politicians getting ‘safe’ seats and effectively not listening to their constituents).
Unfortunately I suspect the polls will keep remain somewhat level, or Mr Clegg’s honeymoon will end as voters are either disillusioned by the ongoing press attention and we’ll just end up with Labour winning as our First Past the Post system seems to be favouring them for some reason.
At the moment I’m not sure who I’ll vote for; our local replacement Tory couldn’t be arsed to reply to an email I sent which just asked where he stood on DeBill / WhatDeBill etc – which didn’t particularly impress me. I’d expected to effectively get a copy+pasted generic reply saying whatever the party line was, but he couldn’t be bothered with that. Oh, and he also seems incapable of using Twitter/Facebook etc.
Having said that, my local LibDem candidate has figured such things out (website / facebook etc) but judging from what’s fallen through my letter box (and then straight into the recycling box) he is being outspent by the conservative campaign, in a seat where my vote counts for 0.09 of a ‘normal vote’ (clearly some votes are more equal than others?!) I can’t think he can be very optimistic.
Twitter Weekly Updates for 2010-04-18
- Sanders park is busy. Lovely day #
- Hmm. Lidl almond ice cream things. #
- Hockey match done. Lovely day. #
- The coffee which has been keeping me alert/awake at work turns out to be decaf. A definite #wtf moment. #
- I love chilli. #
- RT @carolinegoodwin they're a rough lot in Bromsgrove http://bit.ly/dg8Tzt (woman banned from alcohol buying) #
- So… The sky. Grey from ash? Is that what I can smell? Or is it just normal boring overcast Britian with local pollution? #ashtag #
- More & more drivers think "road closed" doesn't apply to them (Stourbridge road, bromsgrove). Why is it closed, why not traffic lights? #
- RT @poorlydressed Someone Get the Lifeguard – Poorly Dressed People of the World – Fashion Fails http://bit.ly/awSYm9 #
- RT @dvntownsend Today's FREE MP3 from @AOLRadio is "Hyperdrive" from @dvntownsend: http://ow.ly/1yve6 + free sampler from @AmazonMP3: … #
- Kick Ass is an excellent film – one of the best i've seen recently; def. better than avatar / green zone etc http://is.gd/bs2j0 #
- Stourbridge road is much nicer closed. Perhaps I need to buy some road closed signs and dig a big hole in it …. #bromsgrove #
- Not impressed that this stupid griffin iPhone case is broken. Can haz metal case plz? #
- The dog is changing career – cat chasing is so passé, fly catching is the way forward… #
- Wow. Bank paid me 14p in interest this last year on our current account. Why bother? #
- Potential office viewing booked for later today; <30 metres from telephone exchange; I'm not a bandwidth whore… honest. #
- Doesn't like being woken up, by his calf muscle cramping. #
- My MP Julie Kirkbride didn't bother voting on #debill Find yours http://www.VoteThemOut.co.uk #