Notice: Undefined index: a in /home/lazyg72/HTML/global_subs.php on line 15

Notice: Undefined index: a in /home/lazyg72/HTML/global_subs.php on line 19

Notice: Undefined index: a in /home/lazyg72/HTML/global_subs.php on line 23

Warning: Cannot modify header information - headers already sent by (output started at /home/lazyg72/HTML/global_subs.php:15) in /home/lazyg72/HTML/feed.php on line 22
lazygnome - A big jumble of words http://www.lazygnome.net/ Nonsensical words from Iain Cuthbertson en-gb http://www.rssboard.org/rss-specification My Rant http://www.lazygnome.net/diary/602 http://www.lazygnome.net/diary/602
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
It's been ages since I last did anything here. And I find that I have little time for blog updating. <br/> <br/>That said, I've started a new site over here <a href="http://myrant.net/" target="_blank">myrant.net</a>. <br/> <br/>It's not to replace this site, more of a quick place for me to keep my semi-rants that are longer than twitter can cope with. <br/> <br/>My intention is that anybody can register and post their rants, though I've not had any takers yet. <br/> <br/>Peace out! http://www.lazygnome.net/diary/602#comments Thu, 29 Oct 2009 17:42:03 +0000
Brand new specs http://www.lazygnome.net/diary/601 http://www.lazygnome.net/diary/601
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
It's hard to believe, but it's been 2 years since I 1st donned <a href="http://www.lazygnome.net/diary/583">these prescription specs</a>. <br/> <br/>Now, I have a new prescription and 2 new pairs of glasses. Having a deeper frame will allow me to start using them for night time driving. <br/> <br/>I took a photo, I look fat: <br/><center><a href="http://www.flickr.com/photos/bigcuthy/3544808359/" title="New specs by Iain Cuthbertson, on Flickr"><img src="http://farm3.static.flickr.com/2274/3544808359_fa6042eacf.jpg" width="375" height="500" alt="New specs" border="0" /></a></center> <br/> <br/><strike>No photo just yet, but</strike> here's an image for the time being: <br/><center><img src="http://www.lazygnome.net/images/austin_24084086.jpg" alt="Austin 24084086" border="0" /></center> http://www.lazygnome.net/diary/601#comments Mon, 18 May 2009 10:06:38 +0000
Snow in Malvern, who'd have thunk it? http://www.lazygnome.net/diary/600 http://www.lazygnome.net/diary/600
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
As I haven't posted anything here for a while, why not enjoy some <a href="http://flickr.com/search/?w=34574952%40N00&q=snow&m=tags" target="_blank">wintery photos</a> from my flickr account. <br/> <br/>I think that my fave has to be: <br/><center><a href="http://flickr.com/photos/bigcuthy/3269265912/in/set-72157613589306222/" title="Police car slides into Great Malvern Post Office by Iain Cuthbertson, on Flickr" target="_blank"><img src="http://farm4.static.flickr.com/3334/3269265912_92cc6b82a1.jpg" width="375" height="500" alt="Police car slides into Great Malvern Post Office" border="0"/></a><br />Police car slides into Great Malvern Post Office</center> http://www.lazygnome.net/diary/600#comments Wed, 11 Feb 2009 12:19:03 +0000
Select the last word in a string with MySQL http://www.lazygnome.net/diary/599 http://www.lazygnome.net/diary/599
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
Following on from last month's <a href="http://www.lazygnome.net/diary/597">Select the 1st letter of the last word in MySQL</a>, I then needed a way to select the last word from string (or column). <br/><p class="code">SELECT REVERSE(LEFT(REVERSE('Iain Cuthbertson'), LOCATE(' ', REVERSE('Iain Cuthbertson')) -1));</p> <br/>Now I can sort rows by surname when the full name is in just one cell! http://www.lazygnome.net/diary/599#comments Thu, 20 Nov 2008 09:53:21 +0000
Fixing Ordered Lists in IE6 http://www.lazygnome.net/diary/598 http://www.lazygnome.net/diary/598
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
IE6, oh how you destroy my will to code. <br/> <br/>1st Problem: <br/>List item numbers dissapear in IE6. <br/> <br/>Solution: <br/><div class="code">ol { margin: 0; padding: 0; } <br/>ol li { margin: 0 2em 0 2.5em; padding: 0 }</div> <br/> <br/>2nd Problem: <br/>List item numbers are all set to 1. <br/> <br/>Solution: <br/><div class="code">ol li { zoom: 0; }</div> <br/> http://www.lazygnome.net/diary/598#comments Mon, 03 Nov 2008 13:29:07 +0000
Select the 1st letter of the last word in MySQL http://www.lazygnome.net/diary/597 http://www.lazygnome.net/diary/597
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
I recently had a need to select the 1st letter of the last word in a stored field. <br/>This is my 10min stumbling result: <br/><p class="code">select SUBSTRING(REVERSE('Iain Cuthbertson'), LOCATE(' ', REVERSE('Iain Cuthbertson')) - 1, 1) as result;</p> <br/>MySQL only code I'm afraid folks. http://www.lazygnome.net/diary/597#comments Mon, 20 Oct 2008 12:45:15 +0000
the experiment http://www.lazygnome.net/diary/596 http://www.lazygnome.net/diary/596
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
I've mentioned this on Facebook and Twitter, I guess I should say something here as well. <br/> <br/>Every now and then, I forget to shave. Sometimes I can forget to shave for several weeks in a row. <br/> <br/>The most recent forgetting to shave lasted 4-5 weeks! <br/>In an effort to look a little more human, I made the effort to shave on Sunday morning. <br/> <br/>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: <br/> <br/><center><a href="http://www.flickr.com/photos/bigcuthy/sets/72157606644018228/"><img src="http://farm4.static.flickr.com/3170/2748799905_5be7911c9c.jpg" width="333" height="500" alt="img_5258" border="0" /></a><br />Click for the full series!</center> http://www.lazygnome.net/diary/596#comments Tue, 12 Aug 2008 11:30:32 +0000
Note to self http://www.lazygnome.net/diary/595 http://www.lazygnome.net/diary/595
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
<ol><li>Create amazing new blog with symfony.</li><li>Measure and cost tiling area around bath so a proper shower can be fitted.</li><li>Figure out where workstation will go in own bedroom if 2nd bedroom is to be sub-let.</li></ol>With regard to blog: what to do with old entries? allow commenting? look for a designer? http://www.lazygnome.net/diary/595#comments Sat, 29 Mar 2008 20:09:52 +0000
Trim whitespace from the beging and end of a string in javascript http://www.lazygnome.net/diary/594 http://www.lazygnome.net/diary/594
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
var elm = document.getElementById('foo'); <br/>elm.value = elm.value.replace(/(^\s+|\s+$)/g, ''); http://www.lazygnome.net/diary/594#comments Mon, 10 Dec 2007 12:33:03 +0000
Sorting arrays of SimpleXML objects http://www.lazygnome.net/diary/593 http://www.lazygnome.net/diary/593
Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/feed.php on line 46

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 443

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 444

Deprecated: Function ereg_replace() is deprecated in /home/lazyg72/HTML/global_subs.php on line 445
This is how I've tackeled the problem of changing the order of some SimpleXML objects. <br/> <br/>Adding an attribute to the top level of an object can add as the position reference. <br/>So Passing an array of SimpleXML objects to the following function will return the same array of objects, but reordered by the $key attribute. <br/> <br/>[Edited 26th Feb 2008] <br/><div class="code">function xmlSort($dataArray, $sortKey) <br/>{ <br/> $outputArray = array(); <br/> <br/> for ($i = 0; $i < count($dataArray); $i++) <br/> { <br/> $sortArray[] = (int)$dataArray[$i]{$sortKey}; <br/> } <br/> <br/> for ($i = 0; $i < count($sortArray); $i++) <br/> { <br/> $outputArray[] = $dataArray[$sortArray[$i]]; <br/> } <br/> <br/> for ($i = 0; $i < count($outputArray); $i++) <br/> { <br/> $outputArray[$i]{$sortKey} = $i; <br/> } <br/> <br/> return $outputArray; <br/>} <br/></div> <br/>See <a href="http://uk2.php.net/manual/en/ref.simplexml.php">PHP.net SimpleXML</a> for the dataset used. <br/> <br/>Adding 'pos="#"' to each <movie> element will allow for reordering. <br/> <br/>An example usage would be: <br/><div class="code">$sorted_xml = xmlSort($xml->movie, 'pos'); <br/></div> http://www.lazygnome.net/diary/593#comments Sun, 14 Oct 2007 17:55:47 +0000