December 2006

Typo, typo, how I love thee

by Suw on December 29, 2006

I haven't had a chance to look at my Ruby on Rails for a few weeks, but finally on Wednesday I had a few hours to play with it. I had left my charger in the suitcase that Kevin had by his desk at work, though, so my window of opportunity would last only as long as my battery.
The last time I worked on my RoR, I ended up with an unexpected result. The book I'm working through, Agile Web Development with Rails, has you make a web shop, and I'd got to the bit where I was implementing the shopping cart function. I went through a ton of coding, but when it came time to test I got an unexpected result – the shop page failed to show any products, just the 'Show my cart' link. I was expecting to see a list of products with the 'Show my cart' link at the bottom.
I ran out of time and had to leave it, but coming back to it this time round, it still wasn't clear what the problem was. The book's publishers provide you with a bunch of files that show you what the code should look like at each stage of development. Now, I could cut and paste the code, but I don't because that way I wouldn't learn anything. Instead, I type it in from the book, and use the source files as a reference in the event of anything going wrong. Of course, things go wrong regularly, because there is always a typo somewhere.
I sat and pored over the code, file by file, line by line. Fixed a couple of typos, but neither of them actually fixed the problem (although I'm sure they fixed other problems that had yet to manifest themselves). I was starting to feel really frustrated, as my battery was not going to last long, and I wanted to actually make progress, not just hit my head against a brick wall for two hours.
I compared the code to the code in the source files, and to the code in the book, but still nothing. Then, going back step by step over what I had done, I noticed one little action taken in Terminal (i.e. at the command line):
drop table if exists line_items;
create table line_items […]

D'oh! This command deletes the old table called 'line_items' if it exists and replaces it with a new, empty one. Suddenly, a moment of clarity: the store front wasn't displaying the products because I had deleted them all! In fact, there's even a footnote on page 85 which says “If you don't see a list of products, you'll need to go back to the administration section of the application and add some.”
Oh dear. Note to self: Read the footnotes.
Anyway, progress after that was good, despite further typos. I made it all the way to the end of Chapter 8, and this afternoon I'm going to have a stab at Chapter 9. I'm still really just doing what I'm told in the book, but patterns of meaning are starting to coalesce out in my mind. I'm not sure I could yet create an application from first principles, but I'm starting to generalise out rules from what I'm doing which will, in due course, give me my much needed first principles.
Besides all that, it's actually a lot of fun. I can't wait til I have a bit more time on my hands to work on this more regularly.

{ Comments on this entry are closed }

I've got my replacement phone

by Suw on December 26, 2006

Haven't had a chance to blog before now, but Saturday, as soon as we got off the coach in Dorset, Dad took us down to Poole to pick up my replacement Nokia E61. Phew. I have to say, the staff in the Poole Carphone Warehouse were lovely, and the entire unpleasant experience was very much softened by their kindness, and by the efficiency of the Carphone Warehouse's insurance department, who didn't quibble at all about replacing my mobile even though I'd had it such a short time. Even the excess, which I expected to be quite a lot, was only 30 quid. Compared to the 200 quid nature of the phone, that's trivial.
In fact, I wouldn't ever buy direct from a phone provider now, as I always have in the past – I will always go to the Carphone Warehouse, and I will always buy their insurance. Especially now that I'm hooked on smartphones and am unlikely to go back to the kinds of cheap, minimalist phones that you can easily replace at little cost.
That said, I'm much more aware now that having a flashy phone makes you a target, and being 'normally so careful' – as my amazed parents described me as they tried to comprehend that their diligent daughter had had her phone nicked – isn't good enough. You have to always be careful.
I will, therefore, be much less likely to use my phone outside and in public unless I really, really have to. Which somewhat makes a mockery of bothering to have a phone that's mobile, but I just don't want to go through all that again.
One annoying point, though, is that I can't transfer my number over from Orange to O2, because unlike T-Mobile who will transfer your number at any time after you've bought your phone, 02 want you to do it at the time you buy, so I'm too late. Rats. So it's a new phone number for me, whether I like it or not. Which is a bummer as I've just sent out Christmas cards with the wrong phone number in. Oops.
Anyway, all's well that ends well, and frankly it's not like I'm not easily found online if people really want to find me.

{ Comments on this entry are closed }

Merry Christmas

by Suw on December 25, 2006

Merry Christmas to you all! I hope you have a lovely day today, and that Santa has seen fit to spoil you rotten!

{ Comments on this entry are closed }

Good news about the phone

by Suw on December 22, 2006

I had a message last night that Carphone Warehouse have accepted my claim and that I can go into any branch and pick up my replacement Nokia E61. Yay!! Very pleased about that (although I'll be more pleased when I actually have it in my hands – tend to be a little wary of getting to excited about such things til they have come to pass).
Because I need my insurance certificate, and because that's in Dorset, I have to wait until Saturday, but with any luck I will have a new E61 very soon. The speed and efficiency with which Carphone Warehouse have dealt with this has been excellent.
I also had calls from the police this morning asking for more details. I now have a case number, but I suspect that will be the end of the matter. They were very nice and polite, though, so it was nice talking to them.

{ Comments on this entry are closed }

Just had my phone stolen

by Suw on December 18, 2006

I think I'm going to give up on mobile phones. My shiny new Nokia E61, which I purchased a mere 19 days ago, just got stolen. I was chatting to a friend on my way to Waitrose, and when I got there I put the phone in my coat pocket and picked up a basket. A few minutes later, I thought 'I had better put my phone in my bag, in case it gets stolen', but too late.
I didn't feel anyone reach into my pocket. I wasn't aware of anyone coming too close, or watching me or bumping into me. Whoever it was was a very, very good pickpocket, and I'm sure they'll enjoy the phone for the next 24 hours until the bar kicks in, and after that I'm sure they'll sell it on Ebay for hundred quid or so.
Meantime, I await with bated breath to find out if the insurance got sorted out in time, otherwise I'm fucked. Plus the Treo is seriously buggered now and I can't even make calls on it, so I'm doubly fucked.
Merry fucking Christmas.
UPDATE, 19 Dec: Rang the police back this morning with my IMEI number. Never heard of an IMEI number? No, me neither. Apparently it's very important if you get your phone nicked, though, so find out what it is now, and make a note somewhere safe – you'll find it on the box that your phone came in, or maybe behind the phone's battery. If you lose or have your phone stolen, they'll need this number.
I also got my case number, and rang up Carphone Warehouse's insurance department. They've opened a claim for me, and I should find out by Friday if I can go and get another phone, or if I am going to remain phoneless.
Emotionally, I feel a bit of a wreck. On the one hand, I feel stupid for putting my phone in my coat pocket and not putting it away immediately like I usually do. I feel frustrated because I am normally so careful with my gadgets, but this one time I slip, this 1% of unawareness, and pooofft, my phone is gone. I feel guilty for feeling upset, because really it's all pretty tame, I wasn't mugged like Kevin was – he ended up with three stitches last year after three little yobs jumped him near Television Centre in White City and tried unsuccessfully to steal his laptop, only to find out that he may be wiry but he's very powerful. I wasn't thrown to the ground like the girl whose mugging I witnessed last year. I just had my personal space violated an an expensive gadget taken.
I feel extremely pissed off that some little fucker who probably hasn't earnt a penny his (or her) whole life is gonna profit from the sale of my phone.
I feel upset because London didn't used to be like this. I lived here for five years in the mid-90s, and in that time I personally knew just two people who'd been mugged. I've been back in London just over a year, and the catalogue of crime that has happened to people I know is:
– Kevin got mugged
– I witnessed a mugging
– I got my phone stolen
– our friend Vicki has had two phones stolen
– Karina, her phone and her purse
– the cleaner at Kevin's old house had her phone stolen
– I've been spat on (not a crime, I suppose, but not very nice)
– Kev and I were threatened with a stabbing (no knife in evidence)
– Kev witness a security guard being harassed by yobs on bikes
I don't like London anymore. I don't want to live here. But unfortunately, for the stuff that Kevin and I do, it's the only place we can be right now.
But, to cap it all, I was just starting to really love that phone. 19 days is just enough to start to get used to the way a new OS and a new phone works. I liked the shortcuts that made using the phone simple, I liked the Symbian OS which allows you to run more than one process at a time (in stark contrast to Palm, which has to fake it), I liked the form of the E61, it's QWERTY keyboard and its nice, bright screen. More than anything, I loved having Google Maps on it, and Google Mail. I adored the web browser which made surfing the net on a phone actually doable. I was totally in love with the wifi.
Does this make me a materialistic, spoilt brat? I hope not. This phone came as close as I have ever been to a decent mobile internet solution which, given how much I travel, actually was threatening to turn into a valuable business tool. I still had to find a good AIM client (the built in chat client doesn't like AIM), and a better way of dealing with RSS, but I was really pleased with the way that I could set it up to sync with my Macbook without too much trouble.
If that evil little swine had swiped my Treo, I would have laughed, barred the account and not been all that bothered. But they took my E61, and I bet they don't even bloody appreciate what they stole.
I am grateful that I wasn't hurt, and that they didn't steal, say, my Macbook (I carry my Macbook in a Crumpler rucksack, so pretty hard to steal, I hope). But still. Bastards.

{ Comments on this entry are closed }

WordPress and importing/exporting content

by Suw on December 17, 2006

Having decided that yes, I am going to look through all my old posts to see if any of them might possibly work in dead tree form, the next thing to do is figure out precisely how to do that.
My current preferred methodology is to have a local installation of WordPress on my Macbook, import all my blog posts, and then be able to go through and categorise them as 'yes', 'no', and 'maybe'. That way I can try to filter them on the fly until I have a collection that looks like it might work.
I spent quite a bit of time on Friday night trying to get WordPress up and running. Thanks to help from my friends on IRC, and the Maczealot tutorial, I got it halfway there. Everything worked apart from the final WordPress installation page. Then Dan told me that the version of PHP4 that OS X ships with doesn't actually support MySQL, which is somewhat less than handy. However, he pointed me at PHP5 which, once installed, made WordPress just work.
Nice!
Having done it once, I will now be able to have as many WordPress blogs as I like on my Macbook, and I can set them up myself.
Now for importing all my various Chocolate and Vodka archives into WordPress. I tried importing my Blogware and Blog-City archives as 'RSS', but WP wasn't having any of that at all. When I try to import Blog-City XML archive as RSS, it says that it has been imported, but it hasn't – there's nothing there. Well, I sort of expected that as Blog-City has never played well with others, and so I'm about as unsurprised as you can be and still have a pulse.
Blogware, though, that should be different. I tried the RSS import, but nothing. So I had a Google, and I came across a post by Chris Pirillo about importing Blogware archives, which includes a link to a WordPress plug-in that goes in the 'import' folder and gives you an 'import from Blogware option'. Unfortunately, it doesn't work.
I started off with the error 'The uploaded file exceeds the upload_max_filesize directive in php.ini', so I dug out php.ini and edited the upload_max_filesize to something absurdly big. Then reset Apache by stopping and restarting Personal Web Sharing.
Then I got a new error, 'Unable to create directory /Library/WebServer/Documents/CnVthebook/wp-content/uploads/2006/12. Is its parent directory writable by the server?', so I had to go and set the wp-content and uploads directories to read-writable.
OK, great, at least it's progress.
Then came the brick wall. When I try to import from Blogware I can browse to my archive file, select it, click 'import', and then I get a screen which just says 'Import Blogware'. And nothing else. Nothing to click, nothing to indicate that anything more is happening. Nothing. Nada.
A quick Google gets you a page on the WordPress forums that says:

In Firefox, I found that I receive “script timeout” errors that offer “Stop” and “Continue” — if you're using this browser or MSFT's IE gives you a similar error, keep hitting continue.

But I don't get these buttons at all, not in Safari or Firefox.
So now I have a nice shiny new blog, and nothing in it.
It's ludicrous that it should be so hard to export from one blog engine and import into another. These words are my words, and if I want to move them from A to B, then I should be able to do so. It annoys me no end that my words get stuck in XML files that I can't then import into the blogging platform of my choice.
I'm sure that I'll somehow manage to do this in the end. I'm sure that someone kind will write me some script that will tidy the XML I have into a format that can be imported by WordPress. But it shouldn't be this hard.

{ Comments on this entry are closed }

Book meme

by Suw on December 17, 2006

Although Wendy didn't tag me, I'm going to do this book meme anyway, because I think it's fun.
Grab the book closest to you.
Open to page 123, go down to the fifth sentence
Post the text of next 3 sentences on your blog
Name of the book and the author
Tag three people
Ok…
digon – enough
digonedd (m) – abundance, plenty
dwbl (m) – double
6000 Welsh Words, by Ceri Jones. Ok, so no one said that it had to be a work of fiction!
I tag Steve, Kate, and Kevin (although I'm not sure this will fit in on Strange Attractor, Kev, so you might just have to get yourself that personal blog you mentioned earlier…).

{ Comments on this entry are closed }

Deg o bethau i wneud yn Gymreg ar y we

by Suw on December 10, 2006

1. Gwyliwch teledu efo S4C
Mae 'na lawer o raglenni teledu ar gael ar wefan S4C nawr. Dach chi'n str?Æmio 4 Wal, Chez Dudley, a Natur Anghyfreithlon, a lot o betha eraill. Yn anffodus, does 'na ddim is-deitlau, sydd poen yn y din amdani i (achos dw i ddim deallt unrhywbeth fod Dudley'n dweud.)
2. Chwyliwch y we efo Google
Dach chi'n teimlo'n lwcus?
3. Grwandwch ar Radio Cymru
Os dach chi'n hoffi pethau fel 'ny.
4. Crewch gwystl efo Pledgebank
Fel mae'r wefan yn dweud: Dwedwch wrth y byd “Fe wna i, ond dim ond os wnewch chi helpu”.
5. Darllenwch blogiau
Mae 'na lawer o flogiau Cymreag ar gael ar y we. Mae Nic Dafis yn sgwennu Morfablog, un o'r blogiau cynta Cymraeg – mae'n bendigedig.
6. Gwyliwch fideo ar YouTube
Mae 'na betha dda yn Gymraeg ar YouTube. Dw i'n hoffi fideos NeilWyn.
7. Ysgrifennwch erthyglau ar gyfer Wicipedia
Mae 'na 5,932 o erthyglau yn y fersiwn Cymraeg ar hyn o bryd, ac maen nhw eisiau eich help chi.
8. Trafodwch petha ar Maes-E
Llawer o sgwrs a llawer o bobl. Be' mwy dach chi eisiau?
9. Llawrlwytho meddalwedd Cymraeg
O Opera i OpenOffice i Linux neu Ubunto.
10. Chwyliwch a defnyddio Del.icio.us yn y Gymraeg
Mae 'na lawer o petha arlein yn Gymraeg. Crewch dalen-nodyn yn defnyddio Del.icio.us neu Furl, neu pori'r dolennau.

{ Comments on this entry are closed }

Where have all the Christmas carols gone?

by Suw on December 10, 2006

This morning, having woken up in a particularly good mood, I decided to play the mix CD that my friend Stuart had kindly (and unexpectedly) made and sent me with my first Christmas card of this year. The first track was the wonderful Nos Galan, by the Treorchy, Morriston Orpheus & Pontarddulais Male Choirs with the Band of the Welsh Guards. The song is more well known in English as Deck The Halls, but in Welsh the lyrics don't translate as having anything to do with holly, and in fact is a celebration of Nos Galan, or New Year's Eve.
I pinged a note to the Clwb Malu Cachu mailing list about it, to see if anyone knew of any other Welsh carols, and it turns out that one of our regulars actually sang on this recording of Nos Galan! Cool!
Anyway, I got into a mood for a Christmas carols, so we started to look for a Christmas internet radio station. Well, there are dozens of them. Trouble is, they all seem to be out of America and playing that sort of 30s/40s schmaltz that is fine for a while but then soon starts to sap your will to live. Not that I don't like Bing or Frank, but after too many White Christmases the only chestnuts I want to see roasted over an open fire are theirs.
Kevin thinks I'm being tetchy, but really, what I wanted to listen to was just traditional Christmas carols. Y'know, O Little Star of Bethlehem, or Silent Night, or Good King Wenceslas (who, when I was a kid, I thought was Good King Wences, who last looked out… I couldn't figure what had happened to him after the Feast of Stephen, no matter how hard I focused on the words). I really wasn't after God Rest Ye Merry Gentlemen Sung with Big Swooping Strings and Added Saccharine, but the usual choral versions I used to sing when I was at school.
But apparently it's not to be. Hours later and we can't find a single station that actually plays carols. Well, none that haven't been soaked in high fructose corn syrup and covered in chocolate sprinkles, anyway.

{ Comments on this entry are closed }

I'm all for not exaggerating beauty but…

by Suw on December 4, 2006

I just saw an ad on Sky Three promoting the concept that using condoms is cool. Four young lads are walking through the park to have a game of footie. Boy A asks Boy B if Boy B could give him back the condom he loaned him. Boy B says no, he's used it. Intercut with this is footage of two girls clearing up after a party, one of whom looks particularly smug and happy.
Which is all fine. Would all be fine. If only the girls hadn't been really hot, and Boy B hadn't been a complete minger. My lingering response is not 'Oh, condoms are cool!” (and yes, I realise I'm not the target demographic), but 'Ewwwwwwwwwwww'.

{ Comments on this entry are closed }

A hypothetical question

December 3, 2006

If you were to find yourself in a lift with blogger who had, say, been writing for the last… oh, four and a half years, and that blogger said that, despite an underlying feeling that it was in some way cheating, she was considering pulling together some of her best posts and tidying them up […]

Read the full article →

Thank you for Amelie

December 3, 2006

Earlier in the year, someone, somewhere bought the Amelie DVD for me, from my Amazon wish list. I don't know who you are, but thank you. Because I hadn't changed my address on Amazon, the DVD went to my parents' house in Dorset, and arrived whilst they were in Australia. My brother forwarded it on, […]

Read the full article →