<?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>Looking Out To Sea &#187; Life</title>
	<atom:link href="http://www.dougalstanton.net/blog/index.php/category/life/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dougalstanton.net/blog</link>
	<description></description>
	<lastBuildDate>Sat, 28 Jan 2012 17:49:36 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Here&#8217;s to us, we&#8217;re no deid</title>
		<link>http://www.dougalstanton.net/blog/index.php/2012/01/28/heres-to-us-were-no-deid/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2012/01/28/heres-to-us-were-no-deid/#comments</comments>
		<pubDate>Sat, 28 Jan 2012 17:44:34 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Friends]]></category>
		<category><![CDATA[Health]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2012/01/28/to-whas-like-us/</guid>
		<description><![CDATA[We are on our way to a Burns supper in Morningside this evening, though I feel unsure about the whole proceedings. 

Last year we went straight from a Sunday night roda to the Burns supper and generally felt great. Through some freak event I was the only fellow to wear a kilt and so was &#8220;volunteered&#8221; [...]]]></description>
			<content:encoded><![CDATA[<p>We are on our way to a Burns supper in Morningside this evening, though I feel unsure about the whole proceedings. </p>

<p>Last year we went straight from a Sunday night roda to the Burns supper and generally felt great. Through some freak event I was the only fellow to wear a kilt and so was &#8220;volunteered&#8221; to give the toast to the lassies.</p>

<p>This year I feel much worse. I am not sure if this is medical problems, the effects of being back on a full dose of medication, work stress, the weather and travel, Helen&#8217;s studies or a grand mixtur of them all, but I will not be wearing a kilt this evening.</p>

<p>Out of the three capoeira classes since the beginning of the year I have missed two from injury. I need to feel more alive.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2012/01/28/heres-to-us-were-no-deid/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>All I need is a wardrobe and a lamppost</title>
		<link>http://www.dougalstanton.net/blog/index.php/2012/01/26/all-i-need-is-a-wardrobe-and-a-lamppost/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2012/01/26/all-i-need-is-a-wardrobe-and-a-lamppost/#comments</comments>
		<pubDate>Thu, 26 Jan 2012 18:57:27 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/index.php/2012/01/26/all-i-need-is-a-wardrobe-and-a-lamppost/</guid>
		<description><![CDATA[One day pouring rain, the next day snow. At least I&#8217;m not worried I shouldn&#8217;t have got waterproof panniers.

What the fancy panniers don&#8217;t do is make it any easier to ride face first into the snow &#8212; that was exciting! &#8212; or salve my extremely sore bum from my ice slip this morning.

I think I [...]]]></description>
			<content:encoded><![CDATA[<p>One day pouring rain, the next day snow. At least I&#8217;m not worried I shouldn&#8217;t have got waterproof panniers.</p>

<p>What the fancy panniers don&#8217;t do is make it any easier to ride face first into the snow &#8212; that was exciting! &#8212; or salve my extremely sore bum from my ice slip this morning.</p>

<p>I think I just need to make it a rule that I don&#8217;t ride straight out of the station in the morning until the weather improves. That short stretch of road isn&#8217;t well used, is twisty, sits on a hill and is in the shadow of the rising sun. A recipe for pain which I would do well to remember.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2012/01/26/all-i-need-is-a-wardrobe-and-a-lamppost/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bike lights</title>
		<link>http://www.dougalstanton.net/blog/index.php/2011/11/29/bike-lights/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2011/11/29/bike-lights/#comments</comments>
		<pubDate>Tue, 29 Nov 2011 23:33:49 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/?p=1423</guid>
		<description><![CDATA[The clocks have been changed for a month now and this has made a massive difference to my commute. Whereas before I would leave the house as light was beginning to creep into the world, and arrive home as the last light was dying, I now leave the house in partial daylight and return home [...]]]></description>
			<content:encoded><![CDATA[<p>The clocks have been changed for a month now and this has made a massive difference to my commute. Whereas before I would leave the house as light was beginning to creep into the world, and arrive home as the last light was dying, I now leave the house in partial daylight and return home in full darkness.</p>

<p>Amongst other things, this has turned my thoughts to bike safety when cycling in low light conditions. As Helen pointed out, the first thing to do is investigate the findings of the Evidence-Based Biking community. What is actually effective on the roads in darkness? The Cochrane Library, source of &#8220;independent high-quality evidence for health care decision making&#8221;, has a <a href="http://www.thecochranelibrary.com/userfiles/ccoch/file/Safety_on_the_road/CD003438.pdf" title="Interventions for increasing pedestrian and cyclist visibility for the prevention of death and injuries (Review)">survey covering the topic of night-time visibility of pedestrians and cyclists</a>. Sadly if you pin your hopes on the studies available you have to be content when they say &#8220;not enough evidence to make a conclusion&#8221;.</p>

<p>The one interesting aspect brought up by the review is summed up in this statement from the results summary:</p>

<blockquote>
  <p>Retroreﬂective materials enhance recognition, in particular when arranged in a &#8216;biomotion&#8217; conﬁguration, taking advantage of the motion from a pedestrian’s limbs.</p>
</blockquote>

<p>I was very aware that while my <em>bike</em> was reasonably visible (lights, reflectors) my <em>body</em> was not. So actions like signalling were largely invisible, especially in rain where everything is glistening and car windscreens are harder to see through. So it&#8217;s odd that high-viz cycling jackets don&#8217;t emphasise either the arms or the general human body shape in their design.</p>

<p>I&#8217;ve got myself a new rear light just to be on the safe side. But on my searches I came across this <a href="http://revolights.com/">extremely cool Tron-light-cycle system</a> which is still in development, which looks like it has great potential to push us from bike lights being &#8220;torches strapped to bikes&#8221; to something which is designed around the bike itself. I wish the developers luck with their project. And maybe in a few years we&#8217;ll all own lights like this&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2011/11/29/bike-lights/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Bike to work</title>
		<link>http://www.dougalstanton.net/blog/index.php/2011/10/09/bike-to-work/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2011/10/09/bike-to-work/#comments</comments>
		<pubDate>Sun, 09 Oct 2011 18:35:38 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Life]]></category>
		<category><![CDATA[Work]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/?p=1415</guid>
		<description><![CDATA[I&#8217;ve recently started commuting to work by bike which is both more enjoyable than walking and gets me there quicker. There are a few downsides but they&#8217;re small enough that I&#8217;m going to continue like this until the weather really forces me off the road.

I was initially quite afraid of the ride through the centre [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve recently started <a href="http://www.commutebybike.com/">commuting to work by bike</a> which is both more enjoyable than walking and gets me there quicker. There are a few downsides but they&#8217;re small enough that I&#8217;m going to continue like this until the weather really forces me off the road.</p>

<p>I was initially quite afraid of the ride through the centre of Glasgow. There are lots of one-way streets, really steep hills and traffic lights. I was even contemplating leaving the bike at the station overnight and commuting through town by subway. But a few more days of the inner-city commute set me at ease. It can be a bit daunting but I know the route now, and I know the tricky points and where to position myself so I&#8217;m not trapped by buses and so on.</p>

<p><a href="http://www.flickr.com/photos/bayareafairtrade/4617093512/" title="Bike to Work Day at the Mid Market Energizer Station by Bay Area Fair Trade Coalition, on Flickr"><img src="http://farm5.static.flickr.com/4003/4617093512_987d32f7f9.jpg" class="show" width="500" height="375" alt="Bike to Work Day at the Mid Market Energizer Station"></a></p>

<p>The train is also good. There&#8217;s a bike carriage on every train with six hooks to hang bikes. The biggest problem is caused by station staff who create deliberate bottlenecks (!) on the platform ends during peak commuter times, which cause all the following trains to be late. I honestly can&#8217;t believe it&#8217;s more worth their while to start off the day behind schedule than to just employ enough conductors for the trains.</p>

<p>My work isn&#8217;t the most cycle-friendly environment. There&#8217;s nowhere particular to chain up a bike, so mine gets tied to the banister at the foot of a stairwell, next to the mops and Slippery Surface signs. Classy! There&#8217;s also no shower/changing facilities and the toilets are a bit of an offence to hygiene, so things could be better. But then who puts an office in an industrial estate in the middle of nowhere anyway?</p>

<p>My next steps are to get some panniers for the bike, to reduce the need for a rucksack (which just makes cycling hotter and sweatier) and get more familiar with maintaining my trusty steed. I would have said &#8220;I can probably pump up the tyres without assistance&#8221; but since the front inner-tube was involved in a &#8220;rapid deflation event&#8221; last time I tried to pump it up maybe that&#8217;s not true! If I suffer a puncture en route I just have to walk it to my destination as I don&#8217;t have the immediate skills or materials to patch things up.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2011/10/09/bike-to-work/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Trip to China (pt 3)</title>
		<link>http://www.dougalstanton.net/blog/index.php/2011/10/08/trip-to-china-pt-3/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2011/10/08/trip-to-china-pt-3/#comments</comments>
		<pubDate>Sat, 08 Oct 2011 17:13:31 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/?p=1410</guid>
		<description><![CDATA[Our first big trip out in Xi&#8217;an was to the city walls, which are huge and intact. So huge that you can hire a bike to ride round the entire thing, which takes about forty minutes if I remember.

We first walked through the streets at the base of the walls, past the calligraphy stands and [...]]]></description>
			<content:encoded><![CDATA[<p>Our first big trip out in Xi&#8217;an was to the city walls, which are huge and intact. So huge that you can hire a bike to ride round the entire thing, which takes about forty minutes if I remember.</p>

<p>We first walked through the streets at the base of the walls, past the calligraphy stands and the vendors of tourist tat, and came to rest in a quiet garden just outside the walls. We sat in the shade with other people enjoying the calm, just two minutes walk from the main busy roads.</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6223255402/" title="View from the city walls by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6175/6223255402_910700e0a6.jpg" width="375" height="500" alt="View from the city walls"></a></p>

<p>This was our first step from industrial China into something reminiscent of ancient China from films. The greenery seemed right, the pigeons were suitably exotic and even the concrete shaded walkway was made to a different design than it would in the UK.</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6223255030/" title="Shaded in a tranquil public garden by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6060/6223255030_3aa7056cda.jpg" width="375" height="500" alt="Shaded in a tranquil public garden"></a></p>

<p>The people lazing around us got in some good staring at this point. The gawping never really disappeared, though it was less common in Beijing than Xi&#8217;an. The only occasions on which we weren&#8217;t the centre of attention was walking down the street with my brother and his girlfriend &#8212; a Chinese girl and a pasty Westerner holding hands attract much more attention than we ever could.</p>

<p>When we found the steps up to the wall itself it was a bit disappointing. If the air had been clear we could have seen across the city in all directions. But Xi&#8217;an is enveloped in a cloud of perpetual smog. The temperature is in the mid-30s but you never see the sky. In the late afternoon we often looked into the sky and though &#8220;oh look, it&#8217;s the moon&#8221;. It was the sun, shining as hard as it could but still looking wan and inconsequential. There were no shadows on the ground. The temperature didn&#8217;t really drop at night. It was all very disconcerting.</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6223254642/" title="Standing on the city wall by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6226/6223254642_20f5a590a9.jpg" width="375" height="500" alt="Standing on the city wall"></a></p>

<p>We walked a quarter of the wall, or a bit less than, until we were tired and hungry. We then wandered the streets getting stressed and angry, and ever more lost, until we found something to eat. And food fixed everything.</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6222737883/" title="That looks really good by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6109/6222737883_e9cc76dc5a.jpg" width="375" height="500" alt="That looks really good"></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2011/10/08/trip-to-china-pt-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Trip to China (pt 2)</title>
		<link>http://www.dougalstanton.net/blog/index.php/2011/09/28/trip-to-china-pt-2/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2011/09/28/trip-to-china-pt-2/#comments</comments>
		<pubDate>Wed, 28 Sep 2011 23:39:04 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Family]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/?p=1406</guid>
		<description><![CDATA[As promised, it&#8217;s time to continue the record of our recent trip to China. My brother lives in a new high-rise flat on the edge of Xi&#8217;an, in an area still under massive construction. In fact the bottom floors of his building weren&#8217;t even finished. I&#8217;m not sure if they built all 26 storeys from [...]]]></description>
			<content:encoded><![CDATA[<p>As promised, it&#8217;s time to continue the record of our recent trip to China. My brother lives in a new high-rise flat on the edge of Xi&#8217;an, in an area still under massive construction. In fact the bottom floors of his building weren&#8217;t even finished. I&#8217;m not sure if they built all 26 storeys from the top down.</p>

<p>Inside the house are my brother, his girlfriend and five (!) cats. The tale is that he used to have two cats but one died. He bought a companion kitten for the lonely cat that was left&#8230; but this kitten turned out to be pregnant. This kitten, illustrated here, is now known simply as &#8220;Mama&#8221;.</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6186854496/" title="Mama by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6158/6186854496_47383819d0.jpg" width="500" height="375" alt="Mama"></a></p>

<p>And she&#8217;s no longer a kitten, obviously, because she&#8217;s got three of her own &#8212; Milk, Chocolate and Milkshake, who are white, black and a mixture of the two colours, respectively.</p>

<p>Life revolves around the low table in the living room, and in drinking tea.</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6190221816/" title="A relaxing cup in the afternoon by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6123/6190221816_4d1d01e206.jpg" width="500" height="375" alt="A relaxing cup in the afternoon"></a></p>

<p>This is the same style of tea-drinking that my brother treated us to for my birthday when he visited Scotland last year. It involves lots of heating cups and rinsing the tea and very fast infusions (seconds). The tea is poured into tiny little cups, like espresso mugs. It was very different from British tea-drinking &#8212; and the ceremony (well, the process anyway; there was no formality) was something that became quite comforting for all its strangeness.</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6189705433/" title="Tea by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6026/6189705433_c2c2bbcbba.jpg" width="375" height="500" alt="Tea"></a></p>

<p>Near the flat there were a couple of supermarkets which gave us our first glimpse of Chinese consumerism. Oddly, many of the shops reminded me of Chinese supermarkets in the UK. I wonder if the same holds for other immigrant supermarkets? Are all the Polish convenience stores on Leith Walk just like they are in Poland?</p>

<p>It&#8217;s amazing how little one can determine from some packaged products. You&#8217;d think many mass-produced items would have simple pictures to let you know what you&#8217;re dealing with but that isn&#8217;t actually the case. And any English description which did appear could be suspect to say the least:</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6189702513/" title="Missing some nuance by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6154/6189702513_c71eb671a9.jpg" width="375" height="500" alt="Missing some nuance"></a></p>

<p>We saw many great Engrish slogans, and t-shirt watching became a full-time occupation in the crowded parts of the city. The glossy branded products were also not above some awkward or ill-advised English text:</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6189702853/" title="As sold by the Vatican by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6175/6189702853_96a929fac1.jpg" width="375" height="500" alt="As sold by the Vatican"></a></p>

<p>Not really in the spirit of the One Child policy, is it?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2011/09/28/trip-to-china-pt-2/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Trip to China (pt 1)</title>
		<link>http://www.dougalstanton.net/blog/index.php/2011/09/27/trip-to-china-pt-1/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2011/09/27/trip-to-china-pt-1/#comments</comments>
		<pubDate>Tue, 27 Sep 2011 22:20:55 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Family]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/?p=1401</guid>
		<description><![CDATA[Helen and I recently went to China. China! It&#8217;s a long way away and my brother&#8217;s been living there for several years, so I don&#8217;t see him often. We visited him in Xi&#8217;an &#8212; but first things first. We took a lot of photos there and I&#8217;m slowly putting them all online. I&#8217;ll try to [...]]]></description>
			<content:encoded><![CDATA[<p>Helen and I recently went to China. China! It&#8217;s a long way away and my brother&#8217;s been living there for several years, so I don&#8217;t see him often. We visited him in <a href="http://en.wikipedia.org/wiki/Xi'an">Xi&#8217;an</a> &#8212; but first things first. We took a lot of photos there and I&#8217;m slowly putting them all online. I&#8217;ll try to blog about them as they appear.</p>

<p>We left Edinburgh airport at some unreasonable hour in the morning and arrived in Charles de Gaulle airport for six hours of hardcore sitting. I read my book and Helen slept for much of the time, though we took some time out from this rigorous schedule to pay through the nose for a bottle of Coke. Even &euro;3.80 wasn&#8217;t enough to dampen the spirits:</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6186850502/" title="Holidays ahead! by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6160/6186850502_2158966b9e.jpg" width="500" height="375" alt="Holidays ahead!"></a></p>

<p>Then we hopped on the second leg of our journey to Beijing, which was longer and less comfortable. Ten-and-something hours later we landed in an extremely foreign country. The words were not related to any words we knew, and the writing even less so. Somehow, through gesture and confused looks we got a bus to Beijing West train station and then onto the sleeper train to Xi&#8217;an.</p>

<p>The restaurant car was our first attempt at prolonged transaction and ordering a meal. We got some things on plates and a couple of beers, and that was all we could really ask. The staff and train crew sat and smoked underneath the no-smoking signs.</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6186327249/" title="Restaurant car by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6166/6186327249_5d4bbff930.jpg" width="500" height="375" alt="Restaurant car"></a></p>

<p>I&#8217;ll spare you the picture of my bleary-eyed face as we pulled into Xi&#8217;an the next morning. Just be assured that I had really needed that sleep and that the train could have been stationed in a steel works all night and I still wouldn&#8217;t have stirred.</p>

<p>Outside the train station in the bright lights of another strange and bustling city, we managed to call my brother&#8217;s mobile and get him to meet us. He lived with his girlfriend, Joy, at the edge of town (er, city) which was an hour&#8217;s ride away on the bus.</p>

<p><a href="http://www.flickr.com/photos/thederelictpavilion/6186329419/" title="Joy and Ali by Dougal Stanton, on Flickr"><img class="show" src="http://farm7.static.flickr.com/6152/6186329419_ee06d44041.jpg" width="500" height="375" alt="Joy and Ali"></a></p>

<p>I will introduce you to his house in the next post!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2011/09/27/trip-to-china-pt-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PyWeek April 2011 post-mortem</title>
		<link>http://www.dougalstanton.net/blog/index.php/2011/04/13/pyweek-april-2011-post-mortem/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2011/04/13/pyweek-april-2011-post-mortem/#comments</comments>
		<pubDate>Wed, 13 Apr 2011 20:52:09 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Friends]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/?p=1383</guid>
		<description><![CDATA[Well, it&#8217;s been a while since I wrote in this little box. My new job continues to form and my commute has been easier lately, since I&#8217;ve been getting a lift from a colleague who also lives in Edinburgh. I get back home in the evening much earlier, which is nice, though the start is [...]]]></description>
			<content:encoded><![CDATA[<p>Well, it&#8217;s been a while since I wrote in this little box. My new job continues to form and my commute has been easier lately, since I&#8217;ve been getting a lift from a colleague who also lives in Edinburgh. I get back home in the evening much earlier, which is nice, though the start is still as early as ever (the alarm goes off at 5.30).</p>

<p>But I didn&#8217;t break this hiatus to talk about commuting, I promise. Last week was PyWeek, a twice-yearly programming challenge to write a computer game in the Python programming language. Nick was keen to give it a go, so between me, him and Mat we concocted an idea which was just interesting enough that it might be worth playing.</p>

<p>Due to some unforeseen problems we didn&#8217;t get much time to write code, so the game didn&#8217;t really come together in time for the deadline. I think, in fact, that the code was broken as zero-hour ticked over. Oh well.</p>

<p>Having started we decided to finish, so we all met on Monday night (for the first time since the challenge started&#8230;) and got large chunks of the game completed. It&#8217;s now playable, I think, though outrageously taxing and quite awkward for one person to play against themselves. The plan, then, is to iron out some of the kinks and see if we can pitch the difficulty at just the right level to make it addictive. Maybe we&#8217;ll get it transferred to an Android/iPhone app in the future?</p>

<p>I&#8217;ve known these guys for years but we&#8217;ve never actually sat down and written a program together for the fun of it. It was really interesting, especially since we were all basically learning Python from scratch for the purpose, and I was trying to remember what all this OO stuff is supposed to be about. Maybe we&#8217;ll tackle it again for the autumn PyWeek with a new game idea, more experience and maybe a bit more time scheduled to the task.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2011/04/13/pyweek-april-2011-post-mortem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting embedded in my new role</title>
		<link>http://www.dougalstanton.net/blog/index.php/2011/03/12/getting-embedded-in-my-new-role/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2011/03/12/getting-embedded-in-my-new-role/#comments</comments>
		<pubDate>Sun, 13 Mar 2011 00:07:27 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Life]]></category>
		<category><![CDATA[Maths & Computer Science]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/?p=1379</guid>
		<description><![CDATA[I&#8217;m in a new job. I&#8217;ve done one week, so my life has mostly been on hold while I work out how things will fit together. I&#8217;m working for Honeywell Security writing embedded software. Similar to before but in alarm systems instead of networking.

The job requires a hefty commute &#8212; at least two hours each [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m in a new job. I&#8217;ve done one week, so my life has mostly been on hold while I work out how things will fit together. I&#8217;m working for <a href="http://www.security.honeywell.com/" title="Honeywell Security Group">Honeywell Security</a> writing embedded software. Similar to before but in alarm systems instead of networking.</p>

<p>The job requires a hefty commute &#8212; at least two hours each way if things go well, but between delayed trains and poor weather it&#8217;s sometimes an extra half hour on top of that. Which means I get up at 5.30, leave the house before 6.30 and get home in the evening around 7&#160;o&#8217;clock. You can see why the rest of my life has been a bit quiet. I&#8217;m having to rethink how I look at the week. The arrival of the weekend is important and precious!</p>

<p>I&#8217;m still learning the ins and outs of work but the people are all very friendly and helpful, which makes the travelling more bearable. Spending hours travelling to and from a hateful job would be horrible. I spend an hour on the train each way which has given me more time for other things. I&#8217;ve been splitting my travelling activities, so that in the morning I read the freebie Metro for a bit and then do some &#8220;thinking&#8221; to limber up for the day. Recently I&#8217;ve been doing simple program calculation exercises, deriving the fusion rules for fold/unfold or map/map and so on. I&#8217;m really interested in the idea of deriving correct and efficient programs from executable specification.</p>

<p>(Just to show you what I&#8217;m talking about, this is the fold/unfold fusion rule. Let us say there are two functions, <code>foldr</code> and <code>unfoldr</code> defined as follows:</p>

<p><div>
<pre class="haskell"><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:foldr"><span style="font-weight: bold;">foldr</span></a> f z     <span style="color: green;">&#91;</span><span style="color: green;">&#93;</span> = z
<a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:foldr"><span style="font-weight: bold;">foldr</span></a> f z <span style="color: green;">&#40;</span>x:xs<span style="color: green;">&#41;</span> = f <span style="color: green;">&#40;</span><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:foldr"><span style="font-weight: bold;">foldr</span></a> f z xs<span style="color: green;">&#41;</span>
&nbsp;
unfoldr g s = <span style="color: #06c; font-weight: bold;">case</span> g s <span style="color: #06c; font-weight: bold;">of</span>
                Nothing     -&gt; <span style="color: green;">&#91;</span><span style="color: green;">&#93;</span>
                Just <span style="color: green;">&#40;</span>x,s'<span style="color: green;">&#41;</span> -&gt; x : unfoldr g s'</pre>
</div></p>

<p>The function <code>foldr</code> combines a list of elements according to the function <code>f</code> and <code>unfoldr</code> creates a list of elements from the seed <code>s</code>. We might use <code>foldr</code> to define a <code>product</code> function which combines the elements of the list by multiplying them together:</p>

<p><div>
<pre class="haskell"><a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:product"><span style="font-weight: bold;">product</span></a> = <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:foldr"><span style="font-weight: bold;">foldr</span></a> <span style="color: green;">&#40;</span>*<span style="color: green;">&#41;</span> <span style="color: red;">1</span></pre>
</div></p>

<p>And we might create a list of elements from 1 to <em>n</em> with an unfold.</p>

<p><div>
<pre class="haskell">enumTo n = unfoldr step <span style="color: red;">1</span>
  <span style="color: #06c; font-weight: bold;">where</span> step s = <span style="color: #06c; font-weight: bold;">if</span> s&gt;n <span style="color: #06c; font-weight: bold;">then</span> Nothing <span style="color: #06c; font-weight: bold;">else</span> Just <span style="color: green;">&#40;</span>s, s<span style="color: red;">+1</span><span style="color: green;">&#41;</span></pre>
</div></p>

<p>The observant reader will have noticed that combining these two separate functions will give us <code>factorial</code>, the product of numbers from 1 to <em>n</em> &#8212; first we create the numbers 1 to <em>n</em>, then we multiply them all together.</p>

<p><div>
<pre class="haskell">factorial = <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:product"><span style="font-weight: bold;">product</span></a> . enumTo</pre>
</div></p>

<p>The inefficiency is that <code>enumTo</code> works on producing a list which is consumed by <code>product</code>. The elements are inserted into a list only to be removed straight away. Can we omit the redundant list production? It turns out we can, and we can do it for <em>all</em> cases where <code>foldr</code> operates on the result of <code>unfoldr</code>. The <code>product</code> and <code>enumTo</code> are specific instances of a general method which we can use to fuse production and consumption of values.</p>

<p>This fusion rule can be demonstrated by algebraic manipulation of the programs we&#8217;ve defined so far. We&#8217;ll call the <code>unfoldr</code> and then <code>foldr</code> by the name <code>hylo</code>, with the naive implementation shown:</p>

<p><div>
<pre class="haskell">hylo f z g = <a href="http://haskell.org/ghc/docs/latest/html/libraries/base/Prelude.html#v:foldr"><span style="font-weight: bold;">foldr</span></a> f z . unfoldr g</pre>
</div></p>

<p>The equational style here facilitates some nice rearrangements which help to assert their correctness from step to step. Let&#8217;s see how this works &#8212; each line will be justified by some comment in braces:</p>

<p><div>
<pre>  hylo f z g s
= { definition from above }
  foldr f z (unfoldr g s)
= { definition of unfoldr }
  foldr f z (case g s of
                  Nothing     -&gt; []
                  Just (x,s') -&gt; x : unfoldr g s')
= { push foldr into result }
  case g s of
       Nothing     -&gt; foldr f z []
       Just (x,s') -&gt; foldr f z (x : unfoldr g s')
= { foldr on empty lists }
  case g s of
       Nothing     -&gt; z
       Just (x,s') -&gt; foldr f z (x : unfoldr g s')
= { foldr on non-empty lists }
  case g s of
       Nothing     -&gt; z
       Just (x,s') -&gt; f x (foldr f z (unfoldr g s'))
= { definition of hylo }
  case g s of
       Nothing     -&gt; z
       Just (x,s') -&gt; f x (hylo f z g s')</pre>
</div></p>

<p>Each step <em>should</em> be clearly equivalent to the one before and the one after, but by the end we have a definition for <code>hylo</code> which doesn&#8217;t construct a useless list.</p>

<p><div>
<pre class="haskell">hylo f z g s = <span style="color: #06c; font-weight: bold;">case</span> g s <span style="color: #06c; font-weight: bold;">of</span>
                 Nothing     -&gt; z
                 Just <span style="color: green;">&#40;</span>x,s'<span style="color: green;">&#41;</span> -&gt; f x <span style="color: green;">&#40;</span>hylo f z g s'<span style="color: green;">&#41;</span></pre>
</div></p>

<p>Naturally we can use the original definitions of <code>product</code> and <code>enumTo</code> to create an optimised <code>factorial</code> using this logic. The result is that <code>factorial</code> doesn&#8217;t create a redundant list either:</p>

<p><div>
<pre class="haskell">factorial n = hylo <span style="color: green;">&#40;</span>*<span style="color: green;">&#41;</span> <span style="color: red;">1</span> step
  <span style="color: #06c; font-weight: bold;">where</span> step s = <span style="color: #06c; font-weight: bold;">if</span> s &gt; n <span style="color: #06c; font-weight: bold;">then</span> Nothing <span style="color: #06c; font-weight: bold;">else</span> Just <span style="color: green;">&#40;</span>s,s<span style="color: red;">+1</span><span style="color: green;">&#41;</span></pre>
</div></p>

<p>I think this is beautiful result despite its obvious simplicity. However this has been a long digression, so I&#8217;ll stop now. But if you found it interesting I encourage you to check out work on &#8220;program calculation&#8221;, &#8220;program derivation&#8221;, &#8220;algebra of programming&#8221;, &#8220;origami programming&#8221; and so on.)</p>

<p>My evening journeys have been spent unwinding with a book, though the evening trains are noisier. I&#8217;m reading <em>Brighton Rock</em> right now and it&#8217;s good though the story makes me feel quite uncomfortable at times. One of the characters seems close to doing something wild and dangerous and it&#8217;s a fight between &#8220;must find out what happens&#8221; and &#8220;can&#8217;t bear to read any more&#8221; on a daily basis.</p>

<p>I hope week two will be easier and I will start to feel like my routine is falling into place. Watch this space.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2011/03/12/getting-embedded-in-my-new-role/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Books: Incoming, outgoing and in a holding pattern</title>
		<link>http://www.dougalstanton.net/blog/index.php/2011/01/24/books-incoming-outgoing-and-in-a-holding-pattern/</link>
		<comments>http://www.dougalstanton.net/blog/index.php/2011/01/24/books-incoming-outgoing-and-in-a-holding-pattern/#comments</comments>
		<pubDate>Mon, 24 Jan 2011 13:16:49 +0000</pubDate>
		<dc:creator>Dougal</dc:creator>
				<category><![CDATA[Books]]></category>
		<category><![CDATA[Friends]]></category>

		<guid isPermaLink="false">http://www.dougalstanton.net/blog/?p=1344</guid>
		<description><![CDATA[Right now I&#8217;m reading The Three Musketeers by Alexandre Dumas. It&#8217;s really enjoyable so far &#8212; whimsical and witty like a 19th-century The Princess Bride (not inconceivable). I&#8217;ve got a big ol&#8217; pile of things to get through after that. I still have a book from my birthday in June and a bunch from Christmas [...]]]></description>
			<content:encoded><![CDATA[<p>Right now I&#8217;m reading <em>The Three Musketeers</em> by Alexandre Dumas. It&#8217;s really enjoyable so far &#8212; whimsical and witty like a 19th-century <em>The Princess Bride</em> (not inconceivable). I&#8217;ve got a big ol&#8217; pile of things to get through after that. I still have a book from my birthday in June and a bunch from Christmas too. I came away from last night&#8217;s book group with two more &#8212; <em>Pathfinders: The Golden Age of Arabic Science</em> by Jim Al-Khalili. I&#8217;d been swithering over this one until I noticed the author. He has produced some great science television so I thought his book might be worth it. And <em>Under Milk Wood</em>, a play I associate strongly with my father though I&#8217;ve never heard or read it. But I&#8217;ve been quoted it a lot!</p>

<p>I took along Seamus Heaney&#8217;s translation of <em>Beowulf</em> but no-one was interested. I think a lot of people had book overload and weren&#8217;t taking new ones to read. We&#8217;re not having our next meeting until March so there will be plenty of time for people to finish the books they&#8217;ve got. Hopefully I can deplete my to-read pile slightly by then.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dougalstanton.net/blog/index.php/2011/01/24/books-incoming-outgoing-and-in-a-holding-pattern/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

