<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>the Official Robert Churchill</title>
	<atom:link href="http://www.robertchurchill.co.uk/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.robertchurchill.co.uk</link>
	<description></description>
	<lastBuildDate>Wed, 30 Nov 2011 23:22:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Line drawing lion drawing</title>
		<link>http://www.robertchurchill.co.uk/2011/09/line-drawing-lion-drawing/</link>
		<comments>http://www.robertchurchill.co.uk/2011/09/line-drawing-lion-drawing/#comments</comments>
		<pubDate>Sat, 10 Sep 2011 14:55:45 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[birthday]]></category>
		<category><![CDATA[birthday_lion]]></category>
		<category><![CDATA[drawing]]></category>
		<category><![CDATA[lion]]></category>
		<category><![CDATA[pen_and_ink]]></category>
		<category><![CDATA[sketching]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=163</guid>
		<description><![CDATA[&#160;]]></description>
			<content:encoded><![CDATA[<div id="attachment_164" class="wp-caption alignleft" style="width: 650px"><a href="http://www.robertchurchill.co.uk/wp-content/uploads/2011/09/line-drawing-lion-drawing.jpg"><img class="size-full wp-image-164" title="line-drawing-lion-drawing" src="http://www.robertchurchill.co.uk/wp-content/uploads/2011/09/line-drawing-lion-drawing.jpg" alt="Line drawing lion drawing" width="640" height="489" /></a><p class="wp-caption-text">Drawn as a birthday card for the nephew</p></div>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/09/line-drawing-lion-drawing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Dear MySQL</title>
		<link>http://www.robertchurchill.co.uk/2011/06/dear-mysql/</link>
		<comments>http://www.robertchurchill.co.uk/2011/06/dear-mysql/#comments</comments>
		<pubDate>Wed, 01 Jun 2011 00:35:00 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[Geekblog]]></category>
		<category><![CDATA[carpel_tunnel_syndrom]]></category>
		<category><![CDATA[MySQL]]></category>
		<category><![CDATA[not_saving_your_typing_muscles]]></category>
		<category><![CDATA[ridiculousness]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=159</guid>
		<description><![CDATA[Dear MySQL, thanks for your limited regular expression support: (Of course I forget to not look a gift horse in the mouth ; )]]></description>
			<content:encoded><![CDATA[<p>Dear <a href="http://www.mysql.com">MySQL</a>, thanks for your limited regular expression support:</p>
<pre class="brush: sql; title: ; notranslate">
SELECT
    REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(REPLACE(name, '2006', ''), '2007', ''), '2008', ''), ' ', ''), '/', ''), '.', ''), '\'', ''), '!', ''), '&amp;amp;', '') AS name,
    description
FROM courses;
</pre>
<p>(Of course I forget to not look a gift horse in the mouth ; )</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/06/dear-mysql/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why should we change our voting system?</title>
		<link>http://www.robertchurchill.co.uk/2011/04/why-should-we-change-our-voting-system/</link>
		<comments>http://www.robertchurchill.co.uk/2011/04/why-should-we-change-our-voting-system/#comments</comments>
		<pubDate>Sun, 24 Apr 2011 20:02:10 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[Random]]></category>
		<category><![CDATA[alternative vote]]></category>
		<category><![CDATA[av]]></category>
		<category><![CDATA[cartoon]]></category>
		<category><![CDATA[first past the post]]></category>
		<category><![CDATA[fptp]]></category>
		<category><![CDATA[voting reform]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=151</guid>
		<description><![CDATA[As the referendum on the Alternative Vote approaches I&#8217;m getting more worried that the change will be voted out and we&#8217;ll be stuck with First Past the Post for another umpteen years. So I did a little xkcd-style cartoon to help illustrate some of the points and why, from my perspective, we should vote &#8216;Yes&#8217;. [...]]]></description>
			<content:encoded><![CDATA[<p>As the referendum on the Alternative Vote approaches I&#8217;m getting more worried that the change will be voted out and we&#8217;ll be stuck with First Past the Post for another umpteen years. So I did a little xkcd-style cartoon to help illustrate some of the points and why, from my perspective, we should vote &#8216;Yes&#8217;. (With &#8216;No&#8217; as second-choice, ha ha&#8230;)<br />
<a href="http://www.robertchurchill.co.uk/wp-content/uploads/2011/04/alternative-vote2.png"><img class="size-medium wp-image-152 alignnone" title="alternative-vote2" src="http://www.robertchurchill.co.uk/wp-content/uploads/2011/04/alternative-vote2-300x177.png" alt="" width="300" height="177" /></a></p>
<p>The Alternative Vote has its problems too, but I see it as a ‘gateway’ voting system that might lead to proportional representation in the future.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/04/why-should-we-change-our-voting-system/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Internet Explorer 9 vs CSS: don’t do this</title>
		<link>http://www.robertchurchill.co.uk/2011/04/internet-explorer-9-vs-css-don%e2%80%99t-do-this/</link>
		<comments>http://www.robertchurchill.co.uk/2011/04/internet-explorer-9-vs-css-don%e2%80%99t-do-this/#comments</comments>
		<pubDate>Wed, 06 Apr 2011 22:21:45 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[Geekblog]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[ie9]]></category>
		<category><![CDATA[serif]]></category>
		<category><![CDATA[times new roman]]></category>
		<category><![CDATA[trident]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=145</guid>
		<description><![CDATA[Microsoft is now pushing out its latest and greatest Internet Explorer 9 through Windows Update. Immediately noticed some problems on some sites with default serif fonts appearing in unexpected places. The F12 development tools didn&#8217;t throw much light, suggesting that the element was correctly inheriting Arial. Turned out to be some empty style rules tripping [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.robertchurchill.co.uk/wp-content/uploads/2011/04/trident_missile.jpg"><img class="alignright size-medium wp-image-146" title="Trident" src="http://www.robertchurchill.co.uk/wp-content/uploads/2011/04/trident_missile-300x225.jpg" alt="Trident" width="300" height="225" /></a>Microsoft is now pushing out its latest and greatest Internet Explorer 9 through Windows Update. Immediately noticed some problems on some sites with default <span style="font-family: serif;">serif</span> fonts appearing in unexpected <span style="font-family: serif;">places</span>.</p>
<p>The F12 development tools didn&#8217;t throw much light, suggesting that the element was correctly inheriting <span style="font-family: serif;">Arial</span>. Turned out to be some empty style rules tripping up Trident, the likes of:</p>
<p><code>font-family: ; font-size: ;</code></p>
<p>Removed, and all was back to normal.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/04/internet-explorer-9-vs-css-don%e2%80%99t-do-this/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Recipe for debugging with XDebug, Netbeans and CakePHP</title>
		<link>http://www.robertchurchill.co.uk/2011/03/recipe-for-debugging-with-xdebug-netbeans-and-cakephp/</link>
		<comments>http://www.robertchurchill.co.uk/2011/03/recipe-for-debugging-with-xdebug-netbeans-and-cakephp/#comments</comments>
		<pubDate>Wed, 30 Mar 2011 20:49:16 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[Geekblog]]></category>
		<category><![CDATA[apache]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[netbeans]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[xdebug]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=137</guid>
		<description><![CDATA[It took me a while to get this working so I didn&#8217;t spend all my time debugging the debugging. I&#8217;ll be brief and hope that you don&#8217;t run into any problems following this : ) Ingredients: XDebug latest (new version out I notice, must try that soon) PHP 5.2 or 5.3 Netbeans 7.1 Local install [...]]]></description>
			<content:encoded><![CDATA[<p>It took me a while to get this working so I didn&#8217;t spend all my time debugging the debugging. I&#8217;ll be brief and hope that you don&#8217;t run into any problems following this : )</p>
<h3>Ingredients:</h3>
<ul>
<li><a href="http://www.xdebug.org/">XDebug latest</a> (new version out I notice, must try that soon)</li>
<li>PHP 5.2 or 5.3</li>
<li>Netbeans 7.1</li>
<li>Local install of Apache HTTPD server</li>
<li>CakePHP 1.3</li>
<li>Windows 7</li>
</ul>
<h3>Cooking time:</h3>
<p>5 &#8211; 15 mins according to taste.</p>
<h3>Preparation:</h3>
<ol>
<li>Add XDebug extension to your php.ini file. Note with PHP 5.2 you must use <strong>zend_extension_ts</strong> and with PHP 5.3 you must use <strong>zend_extension</strong>. Restart Apache.</li>
<li>Set the run configuration for your Netbeans project so that index file is <code>webroot/index.php</code> (or <code>webroot/test.php</code> works, I think <code>webroot/</code> is the key). Open the Advanced dialog and tell it not to open the web browser, &#8220;Do Not Open Web Browser&#8221;!</li>
<li>Open Netbeans / Options / PHP / General / Debugging and check &#8220;Stop at first line&#8221;. Haven&#8217;t had much success otherwise. Check &#8220;Watches and Balloon Evaluations&#8221; if you want but this sometimes causes problems.</li>
<li>Select Debug / Debug Project. Netbeans will start listening for the debugger.</li>
<li>Use Firefox. Install <a href="https://addons.mozilla.org/en-US/firefox/addon/easy-xdebug/">easy XDebug</a> plugin.</li>
<li>Click the green bug icon at the bottom-right of Firefox. XDebug will turn on.</li>
<li>Refresh the page on your site and you should be able to step through your scripts and set breakpoints as necessary.</li>
</ol>
<p>You might find in some situations Netbeans loses the connection to XDebug. Closing and reopening Netbeans is usually necessary to get it working again, but nevertheless, this is the best experience I&#8217;ve had debugging PHP so far. Comments and suggestions welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/03/recipe-for-debugging-with-xdebug-netbeans-and-cakephp/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>CakePHP: throw Exceptions with gay abandon</title>
		<link>http://www.robertchurchill.co.uk/2011/03/cakephp-throw-exceptions-with-gay-abandon/</link>
		<comments>http://www.robertchurchill.co.uk/2011/03/cakephp-throw-exceptions-with-gay-abandon/#comments</comments>
		<pubDate>Sat, 19 Mar 2011 19:35:14 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[Geekblog]]></category>
		<category><![CDATA[cakephp]]></category>
		<category><![CDATA[exceptions]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[save_your_typing_muscles]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=131</guid>
		<description><![CDATA[Throwing exceptions when appropriate is a much cleaner way to handle errors in your PHP applications than the usual return false; and the inevitable if statement to check whether your method call worked. Not only does it make your code cleaner, you actually get some information about the error. In a CakePHP MVC structure it&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>Throwing exceptions when appropriate is a much cleaner way to handle errors in your PHP applications than the usual <code>return false;</code> and the inevitable <code>if</code> statement to check whether your method call worked. Not only does it make your code cleaner, you actually get some information about the error.</p>
<p>In a CakePHP MVC structure it&#8217;s fun to throw Exceptions from your models, but including a try/catch in every single controller method starts to get unwieldy. Instead you can create an exception handler in your <code>AppController</code>, something like this:</p>
<pre class="brush: php; title: ; notranslate">
    public function beforeFilter()
    {
        set_exception_handler(array($this, 'handleException'));
        parent::beforeFilter();
    }

    public function handleException(Exception $exception)
    {
        try
        {
            throw $exception;
        }
        catch (ResourceNotFoundException $ex)
        {
            $this-&gt;cakeError('error404', array('message' =&gt; $ex-&gt;getMessage()));
        }
        catch (Exception $ex)
        {
            $this-&gt;cakeError('error500', array('message' =&gt; $ex-&gt;getMessage()));
        }
    }
</pre>
<p>Notice that we can rethrow the exception in the handler to avoid using an <code>if</code> or <code>switch</code> construct. Now in our controller method we can write code like this:</p>
<pre class="brush: php; title: ; notranslate">
         $bagpuss = $this-&gt;Bagpuss-&gt;read(null, $id);
         if (!$bagpuss)
         {
             throw new ResourceNotFoundException('Could not find bagpuss');
         }
</pre>
<p>We could even go as far as to override <code>read()</code> in <code>AppModel</code> to throw a <code>ResourceNotFoundException</code> to simplify our controllers further, though I worry this will (a) break existing tools (change of contract), and (b) create too much dependency between model and controller.</p>
<p>Comments or suggestions welcome.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/03/cakephp-throw-exceptions-with-gay-abandon/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>tian&#8217;anmen square</title>
		<link>http://www.robertchurchill.co.uk/2011/02/tiananmen-square/</link>
		<comments>http://www.robertchurchill.co.uk/2011/02/tiananmen-square/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 21:25:39 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[photo]]></category>
		<category><![CDATA[beijing]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[panorama]]></category>
		<category><![CDATA[tiananmen]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=120</guid>
		<description><![CDATA[http://www.flickr.com/photos/ contrebis/5365855692/in/set-72157625848311844/ To the right of the image you can see the entrance to the Forbidden City. Zoom in to see Chairman Mao&#8217;s portrait hanging above the gateway. In the centre of the image there is the Great Hall of the People; to the left of that, the Monument to the People’s Heroes; and further [...]]]></description>
			<content:encoded><![CDATA[<p><script src="http://zoom.it/7dgm.js?width=auto&#038;height=400px"></script></p>
<p><a href="http://www.flickr.com/photos/contrebis/5365855692/in/set-72157625848311844/">http://www.flickr.com/photos/ contrebis/5365855692/in/set-72157625848311844/</a></p>
<p>To the right of the image you can see the entrance to the Forbidden City. Zoom in to see Chairman Mao&#8217;s portrait hanging above the gateway.</p>
<p>In the centre of the image there is the Great Hall of the People; to the left of that, the Monument to the People’s Heroes; and further left, the Chairman Mao Zedong Memorial Hall.</p>
<p>It was tempting to stand in front of one of the police buggies, but after entering the Square you have already been intimidated by the security checks and bag scans.</p>
<h3>Excuses</h3>
<p>It’s very difficult to avoid visual artefacts when people are moving around so much. Even with this picture, with the orphaned shadows and noticeable seams, I spent several hours trying to improve the joins and matches between images. A good half-hour was taken up with trying to identify the same fence post between two images, taking into account the parallax shift. I don&#8217;t think it made any difference in the end.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/02/tiananmen-square/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>the forbidden city, beijing</title>
		<link>http://www.robertchurchill.co.uk/2011/02/the-forbidden-city-beijing/</link>
		<comments>http://www.robertchurchill.co.uk/2011/02/the-forbidden-city-beijing/#comments</comments>
		<pubDate>Tue, 08 Feb 2011 20:54:02 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[photo]]></category>
		<category><![CDATA[beijing]]></category>
		<category><![CDATA[china]]></category>
		<category><![CDATA[panorama]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=117</guid>
		<description><![CDATA[http://www.flickr.com/photos/contrebis/ 5365247405/in/set-72157625848311844/]]></description>
			<content:encoded><![CDATA[<p><script src="http://zoom.it/oW9X.js?width=auto&amp;height=400px"></script></p>
<p><a href="http://www.flickr.com/photos/contrebis/5365247405/in/set-72157625848311844/">http://www.flickr.com/photos/contrebis/ 5365247405/in/set-72157625848311844/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/02/the-forbidden-city-beijing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>qianshan national park</title>
		<link>http://www.robertchurchill.co.uk/2011/01/qianshan-national-park/</link>
		<comments>http://www.robertchurchill.co.uk/2011/01/qianshan-national-park/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 00:49:52 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[photo]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=114</guid>
		<description><![CDATA[http://www.flickr.com/photos/contrebis/5365225193/in/set-72157625848311844/]]></description>
			<content:encoded><![CDATA[<p><script src="http://zoom.it/tt59.js?width=auto&#038;height=400px"></script></p>
<p><a href="http://www.flickr.com/photos/contrebis/5365225193/in/set-72157625848311844/">http://www.flickr.com/photos/contrebis/5365225193/in/set-72157625848311844/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/01/qianshan-national-park/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>looking north from the Great Wall</title>
		<link>http://www.robertchurchill.co.uk/2011/01/looking-north-from-the-great-wall/</link>
		<comments>http://www.robertchurchill.co.uk/2011/01/looking-north-from-the-great-wall/#comments</comments>
		<pubDate>Fri, 21 Jan 2011 00:44:52 +0000</pubDate>
		<dc:creator>roberto</dc:creator>
				<category><![CDATA[photo]]></category>

		<guid isPermaLink="false">http://www.robertchurchill.co.uk/?p=112</guid>
		<description><![CDATA[http://www.flickr.com/photos/contrebis/5365854816/in/set-72157625848311844/]]></description>
			<content:encoded><![CDATA[<p><script src="http://zoom.it/iwLR.js?width=auto&#038;height=400px"></script></p>
<p><a href="http://www.flickr.com/photos/contrebis/5365854816/in/set-72157625848311844/">http://www.flickr.com/photos/contrebis/5365854816/in/set-72157625848311844/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.robertchurchill.co.uk/2011/01/looking-north-from-the-great-wall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

