<?xml version="1.0"?>
<rss version="2.0">
<channel>
<title>lazygnome - A big jumble of words</title>
<link>http://www.lazygnome.net/</link>
<description>Nonsensical words from Iain Cuthbertson</description>
<language>en-gb</language>
<docs>http://www.rssboard.org/rss-specification</docs>
	<item>
  <title>Select the last word in a string with MySQL</title>
  <link>http://www.lazygnome.net/diary/599</link>
  <guid>http://www.lazygnome.net/diary/599</guid>
  <description>Following on from last month's &lt;a href="http://www.lazygnome.net/diary/597"&gt;Select the 1st letter of the last word in MySQL&lt;/a&gt;, I then needed a way to select the last word from string (or column).&lt;br/&gt;&lt;p class="code"&gt;SELECT REVERSE(LEFT(REVERSE('Iain Cuthbertson'), LOCATE(' ', REVERSE('Iain Cuthbertson')) -1));&lt;/p&gt;&lt;br/&gt;Now I can sort rows by surname when the full name is in just one cell!</description>
  <comments>http://www.lazygnome.net/diary/599#comments</comments>
  <pubDate>Thu, 20 Nov 2008 09:53:21 +0000</pubDate>
</item>
<item>
  <title>Fixing Ordered Lists in IE6</title>
  <link>http://www.lazygnome.net/diary/598</link>
  <guid>http://www.lazygnome.net/diary/598</guid>
  <description>IE6, oh how you destroy my will to code.&lt;br/&gt;&lt;br/&gt;1st Problem:&lt;br/&gt;List item numbers dissapear in IE6.&lt;br/&gt;&lt;br/&gt;Solution:&lt;br/&gt;&lt;div class="code"&gt;ol { margin: 0; padding: 0; }&lt;br/&gt;ol li { margin: 0 2em 0 2.5em; padding: 0 }&lt;/div&gt;&lt;br/&gt;&lt;br/&gt;2nd Problem:&lt;br/&gt;List item numbers are all set to 1.&lt;br/&gt;&lt;br/&gt;Solution:&lt;br/&gt;&lt;div class="code"&gt;ol li { zoom: 0; }&lt;/div&gt;&lt;br/&gt;</description>
  <comments>http://www.lazygnome.net/diary/598#comments</comments>
  <pubDate>Mon, 03 Nov 2008 13:29:07 +0000</pubDate>
</item>
<item>
  <title>Select the 1st letter of the last word in MySQL</title>
  <link>http://www.lazygnome.net/diary/597</link>
  <guid>http://www.lazygnome.net/diary/597</guid>
  <description>I recently had a need to select the 1st letter of the last word in a stored field.&lt;br/&gt;This is my 10min stumbling result:&lt;br/&gt;&lt;p class="code"&gt;select SUBSTRING(REVERSE('Iain Cuthbertson'), LOCATE(' ', REVERSE('Iain Cuthbertson')) - 1, 1) as result;&lt;/p&gt;&lt;br/&gt;MySQL only code I'm afraid folks.</description>
  <comments>http://www.lazygnome.net/diary/597#comments</comments>
  <pubDate>Mon, 20 Oct 2008 12:45:15 +0000</pubDate>
</item>
<item>
  <title>the experiment</title>
  <link>http://www.lazygnome.net/diary/596</link>
  <guid>http://www.lazygnome.net/diary/596</guid>
  <description>I've mentioned this on Facebook and Twitter, I guess I should say something here as well.&lt;br/&gt;&lt;br/&gt;Every now and then, I forget to shave.  Sometimes I can forget to shave for several weeks in a row.&lt;br/&gt;&lt;br/&gt;The most recent forgetting to shave lasted 4-5 weeks!&lt;br/&gt;In an effort to look a little more human, I made the effort to shave on Sunday morning.&lt;br/&gt;&lt;br/&gt;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:&lt;br/&gt;&lt;br/&gt;&lt;center&gt;&lt;a href="http://www.flickr.com/photos/bigcuthy/sets/72157606644018228/"&gt;&lt;img src="http://farm4.static.flickr.com/3170/2748799905_5be7911c9c.jpg" width="333" height="500" alt="img_5258" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;Click for the full series!&lt;/center&gt;</description>
  <comments>http://www.lazygnome.net/diary/596#comments</comments>
  <pubDate>Tue, 12 Aug 2008 11:30:32 +0000</pubDate>
</item>
<item>
  <title>Note to self</title>
  <link>http://www.lazygnome.net/diary/595</link>
  <guid>http://www.lazygnome.net/diary/595</guid>
  <description>&lt;ol&gt;&lt;li&gt;Create amazing new blog with symfony.&lt;/li&gt;&lt;li&gt;Measure and cost tiling area around bath so a proper shower can be fitted.&lt;/li&gt;&lt;li&gt;Figure out where workstation will go in own bedroom if 2nd bedroom is to be sub-let.&lt;/li&gt;&lt;/ol&gt;With regard to blog: what to do with old entries?  allow commenting?  look for a designer?</description>
  <comments>http://www.lazygnome.net/diary/595#comments</comments>
  <pubDate>Sat, 29 Mar 2008 20:09:52 +0000</pubDate>
</item>
<item>
  <title>Trim whitespace from the beging and end of a string in javascript</title>
  <link>http://www.lazygnome.net/diary/594</link>
  <guid>http://www.lazygnome.net/diary/594</guid>
  <description>var elm = document.getElementById('foo');&lt;br/&gt;elm.value = elm.value.replace(/(^\s+|\s+$)/g, '');</description>
  <comments>http://www.lazygnome.net/diary/594#comments</comments>
  <pubDate>Mon, 10 Dec 2007 12:33:03 +0000</pubDate>
</item>
<item>
  <title>Sorting arrays of SimpleXML objects</title>
  <link>http://www.lazygnome.net/diary/593</link>
  <guid>http://www.lazygnome.net/diary/593</guid>
  <description>This is how I've tackeled the problem of changing the order of some SimpleXML objects.&lt;br/&gt;&lt;br/&gt;Adding an attribute to the top level of an object can add as the position reference.&lt;br/&gt;So Passing an array of SimpleXML objects to the following function will return the same array of objects, but reordered by the $key attribute.&lt;br/&gt;&lt;br/&gt;[Edited 26th Feb 2008]&lt;br/&gt;&lt;div class="code"&gt;function xmlSort($dataArray, $sortKey)&lt;br/&gt;{&lt;br/&gt;  $outputArray = array();&lt;br/&gt;&lt;br/&gt;  for ($i = 0; $i &lt; count($dataArray); $i++)&lt;br/&gt;  {&lt;br/&gt;    $sortArray[] = (int)$dataArray[$i]{$sortKey};&lt;br/&gt;  }&lt;br/&gt;&lt;br/&gt;  for ($i = 0; $i &lt; count($sortArray); $i++)&lt;br/&gt;  {&lt;br/&gt;    $outputArray[] = $dataArray[$sortArray[$i]];&lt;br/&gt;  }&lt;br/&gt;&lt;br/&gt;  for ($i = 0; $i &lt; count($outputArray); $i++)&lt;br/&gt;  {&lt;br/&gt;    $outputArray[$i]{$sortKey} = $i;&lt;br/&gt;  }&lt;br/&gt;  &lt;br/&gt;  return $outputArray;&lt;br/&gt;}&lt;br/&gt;&lt;/div&gt;&lt;br/&gt;See &lt;a href="http://uk2.php.net/manual/en/ref.simplexml.php"&gt;PHP.net SimpleXML&lt;/a&gt; for the dataset used.&lt;br/&gt;&lt;br/&gt;Adding 'pos="#"' to each &lt;movie&gt; element will allow for reordering.&lt;br/&gt;&lt;br/&gt;An example usage would be:&lt;br/&gt;&lt;div class="code"&gt;$sorted_xml = xmlSort($xml-&gt;movie, 'pos');&lt;br/&gt;&lt;/div&gt;</description>
  <comments>http://www.lazygnome.net/diary/593#comments</comments>
  <pubDate>Sun, 14 Oct 2007 17:55:47 +0000</pubDate>
</item>
<item>
  <title>My new mythTV box</title>
  <link>http://www.lazygnome.net/diary/592</link>
  <guid>http://www.lazygnome.net/diary/592</guid>
  <description>PVR PVR PVR, PVR PVR PVRRRRRR.&lt;br/&gt;&lt;br/&gt;Having spent Tuesday evening building this box of fun tricks&lt;br/&gt;&lt;center&gt;&lt;a href="http://www.flickr.com/photos/bigcuthy/1534211423/" title="Photo Sharing"&gt;&lt;img src="http://farm3.static.flickr.com/2069/1534211423_49c9b9efb2.jpg" width="500" height="375" alt="mythTV outer" border="0" /&gt;&lt;/a&gt;&lt;/center&gt;&lt;br/&gt;I spent Wednesday evening setting up the mighty mythTV - and all I had to do was &lt;a href="http://parker1.co.uk/mythtv_ubuntu.php"&gt;follow this guide for installing mythTV on Ubuntu&lt;/a&gt;!&lt;br/&gt;&lt;br/&gt;It's late now, so I'll try sorting out the remote control and LCD display another night.&lt;br/&gt;&lt;br/&gt;To sum-up: I'm a happy linux lad again :)</description>
  <comments>http://www.lazygnome.net/diary/592#comments</comments>
  <pubDate>Wed, 10 Oct 2007 22:57:53 +0000</pubDate>
</item>
<item>
  <title>How to fix all CSS problems in IE</title>
  <link>http://www.lazygnome.net/diary/591</link>
  <guid>http://www.lazygnome.net/diary/591</guid>
  <description>Place this just before &amp;lt;/head&amp;gt;&lt;br/&gt;&lt;br/&gt;&amp;lt;!--[if IE]&amp;gt;&amp;lt;style type="text/css"&amp;gt;body { display: none; }&amp;lt;/style&amp;gt;&amp;lt;![endif]--&amp;gt;</description>
  <comments>http://www.lazygnome.net/diary/591#comments</comments>
  <pubDate>Fri, 14 Sep 2007 17:16:19 +0000</pubDate>
</item>
<item>
  <title>5 years without a cigarette</title>
  <link>http://www.lazygnome.net/diary/590</link>
  <guid>http://www.lazygnome.net/diary/590</guid>
  <description>Time has flown by in that respect and I would have forgotten completely it wasn't dated in my diary.&lt;br/&gt;&lt;br/&gt;It would be a better celebration, if I was not so stressed.  Having to work on a Bank Holiday sucks.</description>
  <comments>http://www.lazygnome.net/diary/590#comments</comments>
  <pubDate>Mon, 27 Aug 2007 18:14:51 +0000</pubDate>
</item>
</channel>
</rss>
	