A Turtle and a Giant Baby Blanket

I’ve just finished another slowpoke, like one I made earlier, and this one is at least as cute!

slow poke in the sun slow poke

I realised after finishing this one that they original pattern has them with their heads looking sideways, maybe this is why mine always look a bit strange!! This one also doesn’t have a tail … when I came to assemble him, I hadn’t made one and somehow it just never happened.

My next project is a square (or maybe more than one, who knows?) for the Oxfam Baby Blanket campaign. The plan is for loads of squares to be knitted and joined together into one large blanket which they display places to campaign on the state of maternal mortality in the world. Then they’ll turn the squares into lots of baby blankets to be sent to places where they will be useful. I think its a great cause, this is how I’m doing so far:

charity square start

If anyone else is knitting for this then add a comment!

Vim Macro: cleaning up line endings

When development teams have people working on a variety of platforms, its pretty common to end up with wrong line endings. In vim these will look like ^M at the end of each line. To get rid of these line endings you can use the following command (in command mode)

:% s/^M$//

To type the correct ^M character, you’ll need to press Ctrl + V followed by Ctrl + M (the first combination means “take the next combination literally).

To turn this into a macro you should do the following. In command mode, pressq, followed by any letter. This will be the shortcut to access the macro. Then type the command as above. Finally, press q again to stop recording and its done. You can use your macro by pressing @ and then the letter you chose.

Serendipity and Feed Problems

This site uses a blogging platform called serendipity which is a nice little tool and I’ve been mostly happy since moving across from textpattern (I did write about the experience). Recently however, a few things have been going wrong with the feeds.

I edited an old post, because the image links were broken (I did have a nightmare migrating because I was so inconsistent about the format of the image tags in textpattern, completely my own fault). I was very careful not to update the published date of the article, however the edited article appeared in the feed, which wasn’t what I had in mind! It turned out that this is by design. On line 262 of includes/functions_entries.inc.php (I have serendipity 1.1.3), I found this:

$cond['orderby'] = 'last_modified DESC';

I’ve commented out this line, which was in an if($modified_since) clause. Hopefully this will stop updated entries from appearing in the feed – I have a few other old ones to fix images in so we’ll soon see.

At around the same time, Ivo mentioned that he was seeing the order of posts change in his reader (google reader) when people commented on my posts. I suspect that this is part of the same issue and I’m optimistic of it also being fixed by this change. However when I was looking into the problem I noticed that the URL he was using to access my feed, http://lornajane.net/index.rss2, actually returned RSS 0.91. Not ideal! The problem is the rewrite rule in serendipity’s .htaccess file, which looks like this:

RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss|rdf|rss2|xml) rss.php?file=$1&ext=$2

When you request index.rss2 it should rewrite to rss.php?file=$1&ext=$2 but the “rss” matches first so the user gets redirected to index.rss instead. As a nasty hack to get around this I removed the rss from the above example and gave it a line of its own:

RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rdf|rss2|xml) rss.php?file=$1&ext=$2
RewriteRule ^(index|atom[0-9]*|rss|b2rss|b2rdf).(rss) rss.php?file=$1&ext=rss

Requests to index.rss2 are now correctly rewritten as rss.php?file=index&ext=rss2 and will get RSS 2.0 format in the response. I have just noticed however that this is the most requested page on the site so I really hope I didn’t break anything!

Zend Core Mysql Error

I’ve had this error more than once. On a debian virtual machine, with Zend Core installed, and when mysql doesn’t restart when the machine reboots. It looks something like this:

debian:/usr/local/Zend/mysql/bin# ./mysqld
080627 12:31:16 [ERROR] Can't find messagefile '/usr/local/mysql/share/mysql/english/errmsg.sys'
080627 12:31:16 [ERROR] Aborting

This is for two reasons. First: you need to be up one level of directory to be able to run these commands. Some errors will tell you that but this one doesn’t. Secondly, you need to use the mysqld_safe command.

debian:/usr/local/Zend/mysql# bin/mysqld_safe
Starting mysqld daemon with databases from /usr/local/Zend/mysql/data

This works for me – I have no idea if it is the prescribed method but background the process above and you’re good to go.

A Wedding Weekend

We spent the weekend at the wedding of a friend of ours, where Kevin was the best man. Here’s the two boys together before the ceremony itself:

Groom and Best Man

The weather forecast was rather bad and although we didn’t get weather as bad as we might have, it did rain on the post-ceremony photographs which was a shame! The day was great all round, the happy couple were infectiously happy and everyone else was dressed up and being happy along with them. There are more photos on my flickr account – although in a rather wonderful testament to what a good time I had last night, I don’t have any photos taken later than the cutting of the cake. The evening event was a ceilidh and I literally danced the night away, not realising Kevin wasn’t taking any photos either, so hopefully someone else did!

Congratulations to Andrew and Rachel, here’s wishing them a long and happy marriage.

DPC Talk Review

A couple of days ago I had the pleasure of speaking at the excellent Dutch PHP Conference in Amsterdam. I haven’t done anything like this before and I did a lot of preparation – as you’ll know if you read this blog regularly.

My talk was entitled “PHP Deployment with Subversion” and was a series of suggested tricks for using Subversion, both tools and structure, to help with deployment. I’m on holiday in Amsterdam for a few days (since I haven’t visited the city before) so I’m currently not able to upload my slides but I will post them here in a day or two. You can get a sneak preview though as there is flickr evidence of my presentation available.

I included a demonstration in my talk which showed a nabaztag (electronic funky rabbit device) notifying of different events, such as tests failing. What I hadn’t really taken into account was that I’d be speaking in such a large room – there was seating for 400 people (about half full I think) and the rabbit is only 8 inches high or so, he was a bit little! I wasn’t following the chatter at the time but I was hugely amused to see this tweet from Breuls when I checked twitter the next day!!

Overall my talk was relatively successful in the sense that I said what I wanted to, I didn’t talk too much or too little, and my nabaztag demo actually worked. I do feel however that my nerves got the better of me – I’m rarely intimidated but having never spoken at a conference before I found it very difficult to adapt to speaking in the main hall. This is the first time I’ve used a microphone, they clipped it onto me and then I started giving the presentation, that was really strange. And also having a large stage with my slides projected on a screen the size of a small house … you can’t look at them, or point at them, or anything. I thought I’d become less nervous with time but I’m afraid it never happened! On a personal level, to give a talk like that, perfectly competently, is an achievement in itself and I’m trying to forget how hard it really was and just feel proud instead :) After the talk I only got one question, which was “Where can I get one of those rabbits?”, so I wasn’t sure if I had put my technical content across well. However quite a few people came to pick my brain afterwards so I guess I did OK.

I owe huge thanks to everyone who provided moral support and tried to convince me I’d be fine, and even more thanks to my boyfriend Kevin who did the setup for the nabaztag (Naz the nabaztag needed his own wireless network) and helped me write the code to run the demo. I’ll write more about the rabbit and the demo at a later point, looks like a lot of people will be getting them :)

Speaking aside, I had a great few days meeting old friends and new ones at the conference, and attending some really interesting sessions. Speaking was very very stressful although perhaps only because I didn’t handle it as well as I might have. The definite upside though is getting to hang out with the very cool kids at the Speakers Dinner afterwards – thanks guys, I had a wonderful night. All in all I can’t wait for next year!

DPC Day 1

Well, its a misleading title because the day is only half over but the Dutch PHP Conference 2008 is well and truly underway! Today I’ve been in the Zend Framework tutorial given by Matthew Weir O’Phinney, which is a full-day session. Its been excellent – with some concepts, some examples, and now a real working application to take a look around and learn from. I’ve had to work with ZF a little bit lately and I wish I’d been able to have this tutorial before I did that!

I’ve been able to catch up with a lot of people since arriving late last night and making the mistake of not going to bed until late because I wasn’t tired (still on UK time) and then having to get up early today! Tonight we have an Ibuildings employees event which will be great, I’m excited to put faces to names for all my colleagues – the downside of the telecommute is that I mostly know people on Skype or IRC and not in real life. Later on there is a pre-conference social as well (from 8pm) – which is why my day is only half done :)

Looking forward to tomorrow, when there will be a phpwomen stand upstairs outside the main hall, we’ll be giving out shirts (they’re white this year) so if you want one then come and get it! Tomorrow at 2pm I’m giving my talk “PHP Deployment with Subversion” which looks like it will be well attended. Oh and its Worldwide Knit In Public Day as well so I’ll be attempting to fit that in as well!