Monday 13 April 2009

websiting

This morning I watched 'Me too', 'Louie' (or might be called 'Hey Louie'), and 'Big Cook, Little Cook'.

In Me too it was about the woman (well I think it's a woman, though could be a Dame Edna style bloke) who drives a bright pink taxi. She wanted to give a swing that she had in her garage to Granny Murray, but the string that holds the seat up was broke. So she got Raymond (the train cafe bloke) to fix it for her, then he pushed her on it - very weird and scary.

After that she took the swing apart and reversed over the seat. Why, I don't know. When she ran over the seat, it didn't look like it had done the seat any harm, but when she picked it up, it was magically snapped in two. Also the seat had somehow burst the taxi's tyre. So, remembering what Granny Murray had muttered to her in the morning, she decided that she could use the burst tyre as a seat for the swing.

After putting a new tyre on the taxi and putting the bits of swing and old tyre in the taxi, Mickey John (the useless teacher) came along. He wanted a taxi ride, so the taxi woman said she'd let him have a free ride to where he wanted to go if he'd come to Granny Murray's with her and help put up the swing.

Mickey John put the swing up really weirdly, so the tyre was hanging vertically, and you have to sit with your bum in between the rims of the tyre, and for the little kids, the top part of the tyre was right in front of their faces. So it looked very rubbish and uncomfortable.

After that the Taxi woman came, which was strange since she was supposed to have brought Mickey John there to make the swing. Maybe she took him there and then went away for a bit before coming back. She took her kid away, and then Granny Murray gave an overview of what she and the kids she'd been looking after had been doing all day. It included both napping and sleeping!

In real life after watching TV, I played on Animal Crossing for a bit, then did some work on my website.

After lunch I went in the garden with Mac and Ben and we sorted out the old pond water, which was in a bin. I took a bucket, filled it with pond water from the bin, then poured it onto the garden through a sieve. Then if the sieve had any visible life in it, (which it usually did), I would dip the sieve in the pond so the insects could live in the pond. When it got near the bottom of the old pond water, it took ages to do as you could only pour out a very little bit of water at a time, or you'd just get a sieve full of mud and not be able to see if there was anything living in it.

That took probably a couple of hours, and the sun was actually shining for quite a bit of the time, which made a nice change to the weather we've had the past week.

After that I went on Animal Crossing again for a few minutes to check what furniture and clothes etc. were available and whether I already had them. Then I went on my comp and did a bit more work on my website. I seem (haven't tested extensively) to now have inserting nodes and moving nodes in the hierarchy working, so I decided to edit the functions so they would also update the node paths, which I am storing in a seperate table.

I thought the easiest way to do this would be that when I update the lft and rgt values of the nodes that gain or loose a parent somewhere in the hierarchy, to also update their path at the same time, using a regular expression to add or remove the new node/removed node's name at the appropriate place. e.g. If I had node with path Birds/Thrushes/Turdus, and I wanted to insert 'Songbirds' as a parent of 'Thrushes', then I would do a regex replace to replace 'Thrushes' with 'Songbirds/Thrushes', so the path would then read Birds/Songbirds/Thrushes/Turdus.

However, googling about this, it seems that MySQL doesn't have any regular expression replace functions. You can download some user defined functions that adds regular expression replace capability to MySQL, but it seems you need to compile MySQL with these functions, and since I doubt my webhost has done that, they're not that useful to me.

I think I probably could do the replace just using the plain REPLACE() function, so long as I made sure each path started with a forward slash, it would just be a case of searching for the node name with a forward slash either side of it.

The option I think I will probably go for though, is to just replace the full path, using a query that will create the path from the main table. This is what I was doing first to display the path, before I started storing the path in the database.

I had quite a few pages open in firefox in Ubuntu, so I decided to close down the ones I wasn't using and add the useful ones to my bookmarks (and organise my bookmarks a bit). One of them that I closed, but would like to keep a note of, is MC Hammer and Vanilla Ice doing a concert together.

After dinner I did some more website work, and decided that for the moment I'll probably try NOT storing the paths to nodes in a seperate table, and instead I'll just generate them when requested. It probably won't be as fast, (though updates should be faster), but it will save me quite a bit of time. At the moment I just want to get a working website rather than one that does everything as efficently as possible. I can make it more efficient once it's up and running (hopefully).

In the evening I watched 'Disturbia', which was about Shia LaBeouf spying on his neighbours, voyeur that he is. His mum is Trinity from the Matrix, and I spent most of the film wishing she'd run up the wall and kick Shia in the face, mainly because he's such a lazy slob. The large majority of the movie is boring and probably like Dawson's Creek, not that I've ever watched that. It did get a bit better near the end, but still not that great really, though just enough to make it up to 5/10 rating for me.

I bid on a used Manfrotto 410 Junior Geared Tripod head today, and it ended up going for £134, even though it's £118 brand new from Amazon. I think I might buy it from Amazon actually, since I can get about £40 of Amazon vouchers by redeeming my piggypoints. Someone did get a good deal on ebay though, there was a canon 400/2.8 II (not IS) that was on a buy it now of £1900.

The weather today was overcast in the morning, then sunny the rest of the day.

Food
Breakfast: Bowl of Maple & Pecan crunch oat cereal and multigrain hoops cereal; cup o' tea.
Lunch: Mature Farmhouse Cheddar cheese with crunchy salad sandwich; cherry tomatoes; banana; Cadbury's fudge cakebar; cup o' tea.
Dinner: ⅓ Mozerella thin & crispy pizza; salad; chips; salt. Pudding was some tinned mandarins and a couple of American style chocolate Brownie cookies. Coffee; piece of Ben's Galaxy cookie crumble (or sumat like that) chocolate.
Supper: Dark chocolate digestive; cup o' tea.

No comments: