window rain

Iain's nonsensical words

Dear diary...

I've mentioned this on Facebook and Twitter, I guess I should say something here as well.

Every now and then, I forget to shave. Sometimes I can forget to shave for several weeks in a row.

The most recent forgetting to shave lasted 4-5 weeks!
In an effort to look a little more human, I made the effort to shave on Sunday morning.

It's not that often that you get to try out a selection of different facial hair styles, so I took the chance to play around:

img_5258
Click for the full series!

  1. Create amazing new blog with symfony.
  2. Measure and cost tiling area around bath so a proper shower can be fitted.
  3. Figure out where workstation will go in own bedroom if 2nd bedroom is to be sub-let.
With regard to blog: what to do with old entries? allow commenting? look for a designer?

var elm = document.getElementById('foo');
elm.value = elm.value.replace(/(^\s+|\s+$)/g, '');

This is how I've tackeled the problem of changing the order of some SimpleXML objects.

Adding an attribute to the top level of an object can add as the position reference.
So Passing an array of SimpleXML objects to the following function will return the same array of objects, but reordered by the $key attribute.

[Edited 26th Feb 2008]
function xmlSort($dataArray, $sortKey)
{
$outputArray = array();

for ($i = 0; $i < count($dataArray); $i++)
{
$sortArray[] = (int)$dataArray[$i]{$sortKey};
}

for ($i = 0; $i < count($sortArray); $i++)
{
$outputArray[] = $dataArray[$sortArray[$i]];
}

for ($i = 0; $i < count($outputArray); $i++)
{
$outputArray[$i]{$sortKey} = $i;
}

return $outputArray;
}

See PHP.net SimpleXML for the dataset used.

Adding 'pos="#"' to each element will allow for reordering.

An example usage would be:
$sorted_xml = xmlSort($xml->movie, 'pos');

PVR PVR PVR, PVR PVR PVRRRRRR.

Having spent Tuesday evening building this box of fun tricks
mythTV outer

I spent Wednesday evening setting up the mighty mythTV - and all I had to do was follow this guide for installing mythTV on Ubuntu!

It's late now, so I'll try sorting out the remote control and LCD display another night.

To sum-up: I'm a happy linux lad again :)

Place this just before </head>

<!--[if IE]><style type="text/css">body { display: none; }</style><![endif]-->

Time has flown by in that respect and I would have forgotten completely it wasn't dated in my diary.

It would be a better celebration, if I was not so stressed. Having to work on a Bank Holiday sucks.

I've got a brand new combine harvister


For those who didn't know, I recently lost my shiney silver fish to the recent flooding.
Horay for fully comp. insurance though! For now I own the shiney green fish above :D

I pick it up this coming weekend, so I will write more about it once I've had more time to play...

  • parent 1

    • child 1.1
    • child 1.2
    • child 1.3
  • parent 2

    • child 2.1
    • child 2.2
    • child 2.3
  • parent 3

    • child 3.1
    • child 3.2
    • child 3.3


A project I was working on this week had a set of menus that were in need of something fancy.
MochiKit can do more than just 'fancy' stuff, but it fitted the bill quite nicely here. So the list above is a reduced version of what I have just put into production use.
Very handy it is :)

On a slightly related note: having struggled to set this example up within my own blog, it reminds me that the blog is still in need of finishing!

Maybe some day, when the million and one other ideas I have, I'll find time for lazygnome.net.

In the mean time, check out urlcatcher.org and dev.urlcatcher.org ;)

July 2007 floods

Click the photo for the image set. I'll write about this at another moment.


Diary feed
 + RSS 2.0 XML feed


Everything on this site is (c) Iain Cuthbertson unless otherwise noted.