<?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>And Slaters Go Plop &#187; Technology</title>
	<atom:link href="http://damian.peterson.net.nz/category/technology/feed/" rel="self" type="application/rss+xml" />
	<link>http://damian.peterson.net.nz</link>
	<description>The Bloggery of Damian Peterson</description>
	<lastBuildDate>Thu, 03 Nov 2011 02:39:47 +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>Safely recover from a freeze in Ubuntu</title>
		<link>http://damian.peterson.net.nz/2011/07/26/safely-recover-from-a-freeze-in-ubuntu/</link>
		<comments>http://damian.peterson.net.nz/2011/07/26/safely-recover-from-a-freeze-in-ubuntu/#comments</comments>
		<pubDate>Mon, 25 Jul 2011 23:09:35 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[magic sysreq key]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=747</guid>
		<description><![CDATA[If you ever encounter a system lockup in Ubuntu here&#8217;s a little trick you can use to safely restart your computer. Hold down the Alt and PrtScn/SysRq keys at the same time and, keeping them held down, enter the following sequence of keys: R, E, I, S, U, B. Hold each key down for a [...]]]></description>
			<content:encoded><![CDATA[<p>If you ever encounter a system lockup in Ubuntu here&#8217;s a <a href="http://en.wikipedia.org/wiki/Magic_SysRq_key#.22Raising_Elephants.22_mnemonic_device">little trick</a> you can use to safely restart your computer.</p>
<p>Hold down the Alt and PrtScn/SysRq keys at the same time and, keeping them held down, enter the following sequence of keys: R, E, I, S, U, B. Hold each key down for a second or so and don&#8217;t rush.</p>
<p>What it does is it allow Linux to take control of your system, requests politely that all processes close, forces all processes to close, flushes data to disk, unmounts your filesystems and reboots.</p>
<p>Here&#8217;s a couple of mnemonics: &#8221;<strong>R</strong>aising <strong>E</strong>lephants <strong>I</strong>s <strong>S</strong>o <strong>U</strong>tterly <strong>B</strong>oring&#8221; or &#8220;<strong>R</strong>eboot <strong>E</strong>ven <strong>I</strong>f <strong>S</strong>ystem <strong>U</strong>tterly <strong>B</strong>roken&#8221;.</p>
<p>It&#8217;s extremely rare that this is necessary due to Linux&#8217;s stability but I&#8217;ve found I&#8217;ve needed this a couple of times recently (I suspect Google Chrome is the culprit) so I&#8217;m posting this here for easy future reference from my phone.</p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2011/07/26/safely-recover-from-a-freeze-in-ubuntu/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Change default Google localisation in Firefox in Ubuntu</title>
		<link>http://damian.peterson.net.nz/2011/05/04/change-default-google-localisation-in-firefox-on-linux/</link>
		<comments>http://damian.peterson.net.nz/2011/05/04/change-default-google-localisation-in-firefox-on-linux/#comments</comments>
		<pubDate>Tue, 03 May 2011 21:33:30 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[.co.nz]]></category>
		<category><![CDATA[.com]]></category>
		<category><![CDATA[firefox]]></category>
		<category><![CDATA[google]]></category>
		<category><![CDATA[seach]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=738</guid>
		<description><![CDATA[Be default in Firefox on Linux, when you use the Google search up in the address bar it defaults to a search of google.com instead of my preferred google.co.nz. If you want to change this, go look in /usr/lib/firefox[--version--]/searchplugins/google.xml and swap out the .com for .co.nz (or whatever localised Google site you prefer).]]></description>
			<content:encoded><![CDATA[<p>Be default in Firefox on Linux, when you use the Google search up in the address bar it defaults to a search of google.com instead of my preferred google.co.nz. If you want to change this, go look in /usr/lib/firefox[--version--]/searchplugins/google.xml and swap out the .com for .co.nz (or whatever localised Google site you prefer).</p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2011/05/04/change-default-google-localisation-in-firefox-on-linux/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Search and Replace PHP split() with Python</title>
		<link>http://damian.peterson.net.nz/2010/05/04/search-and-replace-php-split-with-python/</link>
		<comments>http://damian.peterson.net.nz/2010/05/04/search-and-replace-php-split-with-python/#comments</comments>
		<pubDate>Mon, 03 May 2010 20:13:29 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[explode()]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[split()]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=622</guid>
		<description><![CDATA[A couple of days ago I upgraded to Ubuntu 10.04 which, in turn, upgraded my PHP version from 5.2 to 5.3. In PHP 5.3 they have completely deprecated the use of the split() function in favour of explode(). I did a quick search in my /work directory and it turns out that I have 832 [...]]]></description>
			<content:encoded><![CDATA[<p>A couple of days ago I upgraded to <a href="http://www.ubuntu.com">Ubuntu 10.04</a> which, in turn, upgraded my PHP version from 5.2 to 5.3. In PHP 5.3 they have completely deprecated the use of the split() function in favour of explode(). I did a quick search in my /work directory and it turns out that I have 832 files that are affected by this. All of them need to have split() replaced with explode() or the websites will throw errors every time they encounter it.</p>
<p>Here&#8217;s how I did it using an altered <a href="http://damian.peterson.net.nz/2007/11/29/search-and-replace-text-in-files-with-python/">Python script I wrote a couple of years ago</a>:</p>
<pre>
#!  /usr/bin/python
import os
import re

mydir = "/home/damian/work"

def doReplace(filePath):
	fin = open(filePath, "r")
	s = fin.read()
	fin.flush()
	fin.close()
	p = re.compile('(\s|\(|=)split\(')
	if p.search(s):
		fout = open(filePath, "w")
		s = p.sub(r'\1explode(', s)
		fout.write(s)
		fout.close()

for root, dirs, files in os.walk(mydir):
	for f in files:
		name, ext = os.path.splitext(f)
		if ext == '.php':
			doReplace(root + '/' + f)
</pre>
<p>(**UPDATE** I&#8217;ve switched the search and replace to use regular expressions because I found that &#8216;split()&#8217; can be prefixed by a number of symbols but not others &#8212; i.e. don&#8217;t replace &#8216;preg_split()&#8217;)</p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2010/05/04/search-and-replace-php-split-with-python/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Carbon Monoxide and Black-bottomed Pots</title>
		<link>http://damian.peterson.net.nz/2010/04/12/carbon-monoxide-and-black-bottomed-pots/</link>
		<comments>http://damian.peterson.net.nz/2010/04/12/carbon-monoxide-and-black-bottomed-pots/#comments</comments>
		<pubDate>Sun, 11 Apr 2010 23:29:03 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[General]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[burner]]></category>
		<category><![CDATA[carbon monoxide]]></category>
		<category><![CDATA[gas]]></category>
		<category><![CDATA[poisoning]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=528</guid>
		<description><![CDATA[I recently purchased a four ring burner, assembled it and boiled up lots of water only to find that it didn&#8217;t do a very good job and blackened the bottom of the pot at the same time. I did a bit of Internet research and discovered that, due to the way I&#8217;d set it up [...]]]></description>
			<content:encoded><![CDATA[<p>I recently purchased a four ring burner, assembled it and boiled up lots of water only to find that it didn&#8217;t do a very good job and blackened the bottom of the pot at the same time. I did a bit of Internet research and discovered that, due to the way I&#8217;d set it up (the instructions weren&#8217;t clear), I was potentially in danger of carbon monoxide poisoning. So it&#8217;s probably a good idea to get the information out there.</p>
<p><img src="http://photos.nice.s3.amazonaws.com/damian/ring-burner.jpg" alt="Ring burner" /></p>
<p>When burning with gas you really don&#8217;t want to see a yellow flame. It&#8217;s an indication that you&#8217;ve got an obstruction or that not enough oxygen is being mixed with the gas before burning. It&#8217;s the yellow flame when burning gas that causes pots to have blackened bottoms. It&#8217;s also the yellow flame that&#8217;s generating carbon monoxide which is undetectable and will kill you without sufficient ventilation.</p>
<p>On my setup, there are adjustable disks that can control the flow of air that is mixed with the gas. I had these tightened flush so that not much air was being mixed. They should have been wound back a bit to let more air in which gives a bluer flame and is more powerful at the same time.</p>
<p>That&#8217;s all. I hope this saves someone&#8217;s life. You never know.</p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2010/04/12/carbon-monoxide-and-black-bottomed-pots/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Wiring up a TempMate</title>
		<link>http://damian.peterson.net.nz/2010/02/10/wiring-up-a-tempmate/</link>
		<comments>http://damian.peterson.net.nz/2010/02/10/wiring-up-a-tempmate/#comments</comments>
		<pubDate>Wed, 10 Feb 2010 09:48:06 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Home Brew]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[controller]]></category>
		<category><![CDATA[craftbrewer]]></category>
		<category><![CDATA[enclosure]]></category>
		<category><![CDATA[fermentation]]></category>
		<category><![CDATA[tempmate]]></category>
		<category><![CDATA[wiring]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=489</guid>
		<description><![CDATA[According to experienced homebrewers, temperature control during the fermentation is second only to sanitation (and perhaps healthy yeast). It&#8217;s been hot here over the last few months and I&#8217;ve been struggling to keep my fermentation temperatures down to a reasonable level by way of a laundry sink full of water with regular additions of slicker [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://photos.nice.s3.amazonaws.com/damian/tempmate1.jpg" alt="tempmate" /></p>
<p>According to <a href="http://thebrewingnetwork.com/shows/Brew-Strong">experienced homebrewers</a>, temperature control during the fermentation is second only to sanitation (and perhaps healthy yeast). It&#8217;s been hot here over the last few months and I&#8217;ve been struggling to keep my fermentation temperatures down to a reasonable level by way of a laundry sink full of water with regular additions of slicker pads from the freezer. So, I went ahead and scored myself a full-sized fridge for just <a href="http://www.trademe.co.nz/Browse/Listing.aspx?id=266361593">$30 on TradeMe</a> (broken thermostat which I removed and hard-wired to permanently on) as well as a <a href="http://www.craftbrewer.com.au/shop/details.asp?PID=2592">$100 TempMate from CraftBrewer</a> in Australia.</p>
<p>The TempMate allows me to keep a constant 18 degrees (you can set the temperature to anything you like) for my ales by turning the fridge on when it gets too warm and by turning on a heading pad (not needed yet as it&#8217;s still too warm) when the temperature drops below that. The TempMate ships with very few instructions as to how to wire it up, and, given that the penalty for getting it wrong is possibly death by electrocution and also keeping in mind that if you are a home brewer you are likely going to wire it up yourself instead of consulting an electrician (undoubtedly with a belly full of beer like I did), I&#8217;ve decided to share my setup.</p>
<p><strong>A caution: this is 240V mains stuff and cocking it up really can result in an untimely death so if you are going to do it yourself be very careful.</strong></p>
<p>The best guide I could find was on the<a href="http://www.melbournebrewers.org/index.php?option=com_content&amp;view=article&amp;id=108:building-a-temperature-controller&amp;catid=47:automation&amp;Itemid=102"> Melbourne Homebrewers website</a> and I basically copied their setup so check them out.</p>
<p><img src="http://photos.nice.s3.amazonaws.com/damian/tempmate2.jpg" alt="tempmate wiring" /></p>
<p>From Ideal Electrical I shelled out a whopping $50 (I could buy almost two fridges for that!) for a fully sealed enclosure along with two unswitched sockets ($20) &#8212; one for the fridge and one for the heat pad &#8212; and cable glands ($7) to hold my power and temperature probe cables firmly in place at the back. All of the cabling came from an old computer monitor power cable which I shortened and divided up to make all of the cross connections as well as the main power-in lead. I used a drill, a hacksaw blade and a craft knife to create all the cut-outs and holes. It&#8217;s a thing of beauty and it works a treat. Now, to brew a batch of <a href="http://www.bjcp.org/2008styles/style08.php">Ordinary Bitter</a> on Saturday morning and keep the bugger at 18 degrees throughout fermentation!</p>
<p>(<a href="http://photos.nice.s3.amazonaws.com/damian/tempmate3.jpg">Here is an unobstructed close-up of the wiring</a>)</p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2010/02/10/wiring-up-a-tempmate/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>How to delete all .svn directories</title>
		<link>http://damian.peterson.net.nz/2009/07/30/how-to-delete-all-svn-directories/</link>
		<comments>http://damian.peterson.net.nz/2009/07/30/how-to-delete-all-svn-directories/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 22:25:44 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[delete]]></category>
		<category><![CDATA[find]]></category>
		<category><![CDATA[remove]]></category>
		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=438</guid>
		<description><![CDATA[In Linux, if you want to remove all .svn files and folders within a directory, navigate to the directory in your terminal and use: find . -name ".svn" -type d -exec rm -rf {} \; Credit]]></description>
			<content:encoded><![CDATA[<p>In Linux, if you want to remove all .svn files and folders within a directory, navigate to the directory in your terminal and use:</p>
<pre>find . -name ".svn" -type d -exec rm -rf {} \;</pre>
<p><a href="http://snippets.dzone.com/posts/show/2486">Credit</a></p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2009/07/30/how-to-delete-all-svn-directories/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programming with VIM</title>
		<link>http://damian.peterson.net.nz/2009/07/28/programming-with-vim/</link>
		<comments>http://damian.peterson.net.nz/2009/07/28/programming-with-vim/#comments</comments>
		<pubDate>Tue, 28 Jul 2009 09:37:55 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=436</guid>
		<description><![CDATA[For years now I&#8217;ve used IDEs like Visual Studio and Eclipse occasionally falling back to plain text editors like GEdit or Notepad2 when making quick changes. I&#8217;ve been running Linux for almost three years now and, as you do when dealing with remote servers, have sometimes had to edit text files via the console using [...]]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-435" title="VIM screenshot" src="http://photos.nice.s3.amazonaws.com/damian/vim.png" alt="vim" /></p>
<p>For years now I&#8217;ve used IDEs like Visual Studio and Eclipse occasionally falling back to plain text editors like GEdit or Notepad2 when making quick changes. I&#8217;ve been running Linux for almost three years now and, as you do when dealing with remote servers, have sometimes had to edit text files via the console using VIM.</p>
<p><a href="http://www.vim.org/">VIM</a> has been around for 18 years and is an extended version of VI which has in turn been around for 33 years. VIM = VImproved. It&#8217;s a console-based text editor designed on the assumption that you will only ever be using your keyboard (kiss your mouse goodbye) which means that much of the most common functions are based around the home keys (&#8216;asdf&#8217; and &#8216;jkl;&#8217;) and it&#8217;s packed with great programming features.</p>
<p>But the learning curve is about the steepest I&#8217;ve ever come across.</p>
<p>I decided a couple of months ago to make an effort to get to grips with it and it took a good four weeks before I was matching the programming speed I was used to with Eclipse. But now I&#8217;m finding that my speed is continuing to increase and there is no way I can go back now. It&#8217;s not the be-all-and-end-all though; if you are writing a document from scratch (like this blog entry) then VIM doesn&#8217;t really have much to offer but if you are <em>editing</em> an existing document (as you often are when programming) it&#8217;s streets ahead of IDEs and text editors.</p>
<p>One of the hardest things to get your head around is the fact that VIM is modal which means that you switch between typing stuff and doing stuff to existing text. By default you are not in &#8216;typing stuff&#8217; mode and so when you type the letter <strong>w</strong> it&#8217;ll skip to the next word. If you want to add text you have to press <strong>i</strong> and then press <strong>Esc</strong> after you&#8217;ve finished to go back to &#8216;doing stuff&#8217; mode. For example, to copy an entire line, paste it below, move to the new line, skip three words along, delete the remaining text on the line and start typing, in VIM you would type <strong>yy</strong>, <strong>p</strong>, <strong>3w</strong>, <strong>c$</strong> but the equivalent in a text editor would be to press <strong>Shift-End, Ctrl-C, End, Return, Ctrl-V, Home, Ctrl-Right, Ctrl-Right, Ctrl-Right, Shift-End, Delete</strong> and then start typing. Those key combinations may seem strange but, once you are used to them, they make a lot more sense than having to constantly move your hands away from the home keys. Especially on a laptop!</p>
<p>VIM is free, open source and is <a href="http://www.vim.org/download.php">available</a> for AmigaOS, Atari MiNT, BeOS, DOS, MacOS, NextStep, OS/2, OSF, RiscOS, SGI, UNIX, VMS, Windows, FreeBSD and Linux. If you are a programmer or edit plain text on a regular basis I recommend you give it a go but be aware that the curve is about as steep as curves get. If you decide to try it out I can also recommend <a href="http://www.viemu.com/a_vi_vim_graphical_cheat_sheet_tutorial.html">this website</a> to get you on your feet.</p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2009/07/28/programming-with-vim/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Sign up to Sign On</title>
		<link>http://damian.peterson.net.nz/2009/05/30/sign-up-to-sign-on/</link>
		<comments>http://damian.peterson.net.nz/2009/05/30/sign-up-to-sign-on/#comments</comments>
		<pubDate>Fri, 29 May 2009 23:03:40 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Environment]]></category>
		<category><![CDATA[Nature]]></category>
		<category><![CDATA[Politics]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[40%]]></category>
		<category><![CDATA[campaign]]></category>
		<category><![CDATA[climate change]]></category>
		<category><![CDATA[sign on]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=426</guid>
		<description><![CDATA[This week saw the launch of the new Sign On campaign. The essence of it is that world leaders are meeting in Copenhagen later this year and by signing up to Sign On we are letting John Key know that we want New Zealand to agree to set a target 40% reduction of emissions by [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Sign On - The World Needs Us" href="http://www.signon.org.nz"><img class="alignright" src="http://www.signon.org.nz/sites/default/files/uploads/press/sign-on-the-world-needs-us215x120.gif" alt="Sign On - The World Needs Us" width="215" height="120" /></a>This week saw the launch of the new Sign On campaign. The essence of it is that world leaders are meeting in Copenhagen later this year and by signing up to Sign On we are letting John Key know that we want New Zealand to agree to set a target 40% reduction of emissions by 2020.</p>
<p>The reasons I support this campaign are threefold:</p>
<p>Firstly, the science behind the need for a 40% reduction is clear and strong; anything less is not going to be enough.</p>
<p>Secondly, I don&#8217;t have the willpower myself to achieve a 40% reduction and I believe this is one of the roles governments perform; to constrain some of our harmful and selfish urges and to reward behaviour that is mutually beneficial.</p>
<p>And, finally, I see great technological opportunities for our civilisation should we find the motivation to innovate. I&#8217;m confident we&#8217;ll come up with energy, transport, agriculture and production technologies far superior to what we have now. We just need the will to do so. As I heard someone say, the bronze age didn&#8217;t come about because stones became scarce; bronze was a better technology. I think that there is another age waiting for us beyond the oil-and-deforestation age.</p>
<p>I also like the fact that the campaign is saying nothing about how we ought to go about achieving a 40% reduction. That can wait. First we need the will to make a commitment and then we can act on the best advice from our scientists, politicians and economists to see how we will best achieve this target.</p>
<p>So, if you share my opinions on this, <a href="http://www.signon.org.nz/">head on over to the Sign Up website</a> and add your name to their list of participants. And perhaps let your local MP know where you stand on the issue too. Hopefully enough people will step forward to let our prime minister know that we taking this seriously.</p>
<p><object width="425" height="344"><param name="movie" value="http://www.youtube.com/v/PsofVvlfnPk&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="http://www.youtube.com/v/PsofVvlfnPk&#038;rel=0&#038;color1=0xb1b1b1&#038;color2=0xcfcfcf&#038;hl=en&#038;feature=player_embedded&#038;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2009/05/30/sign-up-to-sign-on/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Blogosphere observations</title>
		<link>http://damian.peterson.net.nz/2009/05/21/blogosphere-observations/</link>
		<comments>http://damian.peterson.net.nz/2009/05/21/blogosphere-observations/#comments</comments>
		<pubDate>Thu, 21 May 2009 00:25:12 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Entertainment]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[blogosphere]]></category>
		<category><![CDATA[mental stability]]></category>
		<category><![CDATA[social media]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=422</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-421" title="social_media" src="http://photos.nice.s3.amazonaws.com/damian/social_media.jpg" alt="social_media" width="358" height="525" /></p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2009/05/21/blogosphere-observations/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Methinks it is like a weasel</title>
		<link>http://damian.peterson.net.nz/2009/05/03/methinks-it-is-like-a-weasel/</link>
		<comments>http://damian.peterson.net.nz/2009/05/03/methinks-it-is-like-a-weasel/#comments</comments>
		<pubDate>Sun, 03 May 2009 03:16:45 +0000</pubDate>
		<dc:creator>Damian</dc:creator>
				<category><![CDATA[Nature]]></category>
		<category><![CDATA[Science]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[dawkins]]></category>
		<category><![CDATA[evolution]]></category>
		<category><![CDATA[natural selection]]></category>
		<category><![CDATA[weasel]]></category>

		<guid isPermaLink="false">http://damian.peterson.net.nz/?p=370</guid>
		<description><![CDATA[Hamlet: Do you see yonder cloud that&#8217;s almost in shape of a camel? Polonius: By the mass, and &#8217;tis like a camel, indeed. Hamlet: Methinks it is like a weasel. In attempting to discredit evolution by natural selection, creationists have often described the impossibility of random mutations in DNA being capable of anything beneficial as [...]]]></description>
			<content:encoded><![CDATA[<blockquote><p><em>Hamlet:</em> Do you see yonder cloud that&#8217;s almost in shape of a camel?<br />
<em>Polonius:</em> By the mass, and &#8217;tis like a camel, indeed.<br />
<em>Hamlet:</em> Methinks it is like a weasel.</p></blockquote>
<p>In attempting to discredit evolution by natural selection, creationists have often described the impossibility of random mutations in DNA being capable of anything beneficial as the equivalent of a tornado in a junkyard accidentally building a 747 or a group of monkeys bashing the keys of a typewriter to successfully write the works of Shakespeare.</p>
<p>And they&#8217;re right. If evolution was merely random mutations then it would be unfathomably impossible for life to evolve as it does. But here&#8217;s the rub: no evolutionary biologists claim that random mutations alone cause the diversity of life we observe. This is where the crucial <em>natural selection</em> part comes in. Evolution occurs by random mutations, most of them neutral, where any beneficial mutations are <em>selected for</em> by the environment and those successful mutations go on to have more children who will likely <em>inherit</em> those beneficial mutations. And so on and so on.</p>
<p>To illustrate the point, back in 1986 Richard Dawkins in his book, <em><a href="http://en.wikipedia.org/wiki/The_Blind_Watchmaker">The Blind Watchmaker</a></em> demonstrated a simple program which he named &#8216;<a href="http://en.wikipedia.org/wiki/Weasel_program">Weasel</a>&#8216; as a reference to the concept of monkeys and typewriters and the above quote from Shakespeare. &#8216;Weasel&#8217; starts with a jumble of letters, spawns &#8216;children&#8217; from them (i.e. multiple copies), each with slight mutations and selects whichever &#8216;child&#8217; is the most similar to a target phrase to spawn a new generation of children.</p>
<p>The point of the program was not to demonstrate every aspect of evolution by natural selection (that&#8217;s rather too much to ask of a small page of code), just the power of mutation when combined with a selection process as opposed to brute-force random chance.</p>
<p>Below I&#8217;ve created a simple version of Dawkins&#8217; program that is limited to a single word and which will, due to the limitations of Javascript and browsers, only attempt a maximum of 500 generations. Have a play around to get a feel for how random mutations can result in very non-random outcomes when there is a selection criteria combined with heritability. </p>
<p>(Note: an updated version is available in a new post, <a href="http://damian.peterson.net.nz/2011/03/18/methinks-it-is-still-like-a-weasel/">Methinks it is [still] like a weasel</a>)</p>
<p><iframe src="http://files.nice.s3.amazonaws.com/weasel.html" style="height:300px;width:100%;border:1px solid #797956;"></iframe><br />
<a href="http://files.nice.s3.amazonaws.com/weasel.html">Full screen version</a></p>
<p>If you know how to run Python and want to check out a version closer to that of the original &#8216;Weasel&#8217;, <a href="http://theatavism.blogspot.com/2009/05/weaselpy.html">take a look</a> at the one created by fellow blogger and PhD student in evolutionary genetics, David, over at <a href="http://theatavism.blogspot.com/">The Ativism</a>. His is not limited to 500 generations like mine and he includes the newer concept of the option of &#8216;locking&#8217; successful mutations.</p>
]]></content:encoded>
			<wfw:commentRss>http://damian.peterson.net.nz/2009/05/03/methinks-it-is-like-a-weasel/feed/</wfw:commentRss>
		<slash:comments>21</slash:comments>
		</item>
	</channel>
</rss>

