LugRadio Live UK

I’m attending LUGRadio Live UK this weekend, in sunny Wolverhampton! I’m slightly concerned that this might be too geeky for me and I might be scared but there are people I’d like to meet, the talks look interesting, and I can imagine it will be a pretty good crowd. If you are there, please come and say hi to me – I’m very easy to spot because I am tall and female with curly hair, usually a rare combination at any technical gathering :)

Mysql Error

I was running an import script today taken from a mysqldump from another user, when I saw an error that looked like this:

ERROR 1005 (HY000) at line 123: Cant create table  (errno: 150)

This is caused by a mysqldump or export process exporting tables in alphabetical order and not in the order in which they rely on one another. My tables had foreign keys which fail on import if the other table doesn’t exist when you create the table with the key. In this case I was only importing six or eight tables so I simply opened the script in a text editor and re-ordered the import blocks. On a bigger scale a more technical solution might be required!

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://beta.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.

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!

Dutch Conference

Today I leave for Amsterdam, to visit the Dutch PHP Conference where I will be getting my first experience as a conference speaker. It would be fair to say that I’m very nervous – its a high profile event and the other speakers in the lineup are pretty amazing!

When I was invited (or perhaps that should be “volunteered”) to speak at this event, I realised that I would need a lot of preparation in order to be able to deliver something like this. I arranged to give short technical presentations at local GeekUp events and went to both Leeds and Sheffield and spoke there. When I had assembled the content of the talk for Amsterdam, I circulated the slides around a few technical colleagues and friends, to make sure that it was accurate and covering sensible material. I was also charmed and excited to have the chance to attend the PHP London User Group meet last week and to give the actual talk there. So, at this point, there is little more I can do to prepare other than attempt not to get too drunk at the pre-conference social on Friday night!

The social side of things is something I’m really looking forward – this conference is organised by my employers, so I’ll have the opportunity to meet the developers I work with every day but haven’t met yet or don’t see often. This in itself I know will be fabulous, although I will certainly forget everyone’s names! In addition there will be people I know online from #phpc and of course some members of phpwomen.org as well – we are running a PHP Women stand at the conference and giving out shirts – so if you want one you had better come along and ask nicely :) I am also looking forward to meeting new people that I don’t yet know I’m going to meet – so here’s hoping for a wonderful time and not too many talk nerves!! To recover I’m staying on in Amsterdam for a few days since I haven’t visited the city before, seems like a good opportunity.

Confessions of an Input Device Fetishist

What can I say? I really really like input devices. I use a laptop day-to-day, it has its own keyboard and glide pad. Do I use them …. err, not often! I’ve always been quite particular about keyboards and mice, and since developing tendonitis in my hands and arms a few years ago, I’m fussier now than ever. Some of the stuff I have is really good though so I thought I’d show you around my collection.

I have two external keyboards that I use a lot, because I find even at a desk, they are way easier on the hands than using the laptop integrated one. My complete favourite is the Logitech UltraX Premium keyboard. It wasn’t expensive, it feels really robust, its supposed to be spillproof which will hopefully make cleaning it a lot easier (I do eat at my desk so my keyboards take a lot of this kind of abuse), and its got a proper layout which is very important for programmers. I once had a laptop with both slashes next to each other in one corner of the keyboard … its really not helpful! The other keyboard is a mini one, I often work from different locations and normal sized keyboards are too long to cart around whereas this one fits in my laptop bag. Its an A4Tech X-Slim multimedia keyboard and, while unexciting, it does allow me to type for more than a couple of hours when away from the office without seizing up! These are the keyboards:

Next up, trackballs. I have two, for years I used one of those Microsoft ones with the ball in the middle and the buttons on the thumb … it died about a week from my dissertation hand-in and I’ve never managed to find another I like as much. At the time I bought the thumb-ball Microsoft Optical Trackball Mouse, which is hard to use and doesn’t suit my hands – useful though if you need to keep alternating inputs as I sometimes do, and of course it takes less space than a mouse. I probably won’t replace it but I do think that the Trackball Explorer has a lot of potential I think. I’ve always liked microsoft mice, despite not liking much else they make :) My other trackball is a real favourite, a fabulous piece of kit! Its a Kensington Expert Mouse (on the right below) and although I don’t use it a lot now (I don’t use a mouse a lot), when I am working with documents or whatever its great. The ring around the ball spins and acts as a scroll wheel – very neat. I did find that this helped a lot with my hand pain too. The best thing about this though, is that it was a gift!

I have a lot of mice. Which is strange as normally, I don’t use one! As a kubuntu user who mostly writes code or documents, I actually don’t need a mouse to interact with my computer most of the time. I browse using Opera’s spatial keyboard navigation, and find that not having the mouse around means I don’t use that and strain my hands – it sort of removes the temptation. To lean over the keyboard and reach the glidepad on my laptop is fine for the odd click when needed, but discourages me from using a mouse when I can use a keyboard. Since I touch type I can then just sit with my hands on the keyboard all day and I don’t get such bad pains if I set up in this way. Anyway, mice! I’ll start with a long-term favourite, which really wasn’t expensive. Its my Belkin Ergo Mouse which was a panic buy in response to the onset of RSI pains. Its a great little mouse and fits my hand really well. I don’t really know why I like it so much but its put up with a lot and still works like a dream. I’ve also recently acquired a contour mouse, as a hand-me-down, which doesn’t have a scroll wheel but apparently that’s because scrolling is really bad for your hands :) It’s got a space to rest your thumb while you use it which is good as it helps stop the resting of thumb and wrist on the desk and then twisting to move the mouse. Finally, my new gadget of joy, my Kensington SlimBlade Media Presenter Mouse. Since changing jobs, I’m doing more presenting – both as a trainer and as a speaker at various events. Since my laptop has no bluetooth or anything, I’ve been restricted to clicking the slides along using the laptop keyboard which is awkward if you have bad room layout or want to walk around. This mouse is a really cute little wireless mouse, but when you flip it over it doubles as a remote control for media and presentations. I’ve used it a few times and love it although I’m finding it very unreliable under windows vista and their technical support has been anything but supportive. Maybe I’ll write more about that another time. Anyway, its a lovely gadget and I’m happy to have it.

So, there you have it, my input device confession. Does anyone else hoard things in this way? And do you have a favourite device that I haven’t mentioned? Comments please :)

Manchester Is Decidedly Undiverse

So last night, more or less on a whim, I popped to the Geekup that was on in Manchester. I was slightly alarmed when I enquired at the bar where the event was and was told there was nothing like that booked for that night … anyway I wandered outside and found 30 or so people looking likely … predominantly t-shirted white males standing around slightly awkwardly, with an above-average ratio of laptop rucksacks :)

It was only after an hour or so when I properly looked around me, I realised I was the only woman there. The only one?? You can’t tell me there are no female geeks in Manchester, I refuse to believe it! Manchester is one of the most vibrant and happening cities I think I’ve ever been to in my life. Seriously, what’s going on? I can only think that either there really are no female geeks in Manchester, or there are – in which case they’re either oblivious to geekup or they’re avoiding it.

So, for what its worth I had a perfectly nice time and chatted to some interesting people (thanks guys!) but I would love to know which scenario above is actually the real explanation. If you have a theory then please post a comment!

Inaugural Sheffield Geekup

Last night I attended and spoke at the First Sheffield Geekup held at the Fat Cat in Sheffield. My talk was entitled “Deploying Web Projects with Subversion” and you can see the slides for that at http://www.slideshare.net/lornajane/deploying-web-projects-with-svn/.

Overall I think the event was well-organised, there were certainly plenty of people there and we had a projector, speakers and a room so it pretty much ticked all the boxes. The Fat Cat is a nice pub, with good beer, but for those of us coming from further afield it was a bit tricky to get to as its not exactly handy for the station. The evening was good however I felt that the timings slipped badly – I was the first speaker and although there was somthing else happening earlier on, the talks aimed for 7:30 were actually nearer 9pm … so a couple of pints later than I was expecting my audience to be and I think my talk came across as rather dry as a result! Also since one of the speakers ran over his time completely (now I understand why other geekups sit with a stopwatch and click the slides through for you!), I had about ten minutes after the talks to hand out a couple of business cards and answer a few quick questions before I had to dash off for my train. All of these though are only teething problems and I think everyone had a pretty good time, so well done to Jag for getting it off the ground … here’s to next month!