<?xml version="1.0" encoding="UTF-8"?>
<!-- generator="wordpress/2.0.4" -->
<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/"
	>

<channel>
	<title>Two Second Memory</title>
	<link>http://blog.twosecondmemory.org</link>
	<description>The outpourings of an ADD mind</description>
	<pubDate>Sat, 14 Jun 2008 00:09:34 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.0.4</generator>
	<language>en</language>
			<item>
		<title>Solar Power in Portugal</title>
		<link>http://blog.twosecondmemory.org/2008/06/14/solar-power-in-portugal/</link>
		<comments>http://blog.twosecondmemory.org/2008/06/14/solar-power-in-portugal/#comments</comments>
		<pubDate>Sat, 14 Jun 2008 00:08:39 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2008/06/14/solar-power-in-portugal/</guid>
		<description><![CDATA[<style>.newl {display:none}</style><div class=newl></div>I live in Australia. Australia is the driest inhabited continent on the planet (Antarctica is the driest) and we get a phenomenal amount of sunshine, as many Queenslanders will testify &#8212; Queensland has the worlds highest rate of skin cancer.
Unfortunately for Australia we have lots of coal and more importantly a very powerful coal industry. [...]]]></description>
			<content:encoded><![CDATA[<p>I live in Australia. Australia is the driest inhabited continent on the planet (Antarctica is the driest) and we get a phenomenal amount of sunshine, as many Queenslanders will testify &#8212; Queensland has the worlds highest rate of skin cancer.</p>
<p>Unfortunately for Australia we have lots of coal and more importantly a <em>very</em> powerful coal industry. So while countries like Portugal are doing the <a href="http://www.guardian.co.uk/environment/2008/jun/06/renewableenergy.alternativeenergy">right thing</a>. We are told renewables are too expensive, blah, blah. Lies. Coal is too cheap and the coal industry is too powerful.</p>
<p>Our leaders and economists tell us we are in a resources boom why don&#8217;t we put that money to good use and follow Portugal&#8217;s lead.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2008/06/14/solar-power-in-portugal/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Why eating fish is not as good as you might think.</title>
		<link>http://blog.twosecondmemory.org/2008/05/11/why-eating-fish-is-not-as-good-as-you-might-think/</link>
		<comments>http://blog.twosecondmemory.org/2008/05/11/why-eating-fish-is-not-as-good-as-you-might-think/#comments</comments>
		<pubDate>Sun, 11 May 2008 05:19:37 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2008/05/11/why-eating-fish-is-not-as-good-as-you-might-think/</guid>
		<description><![CDATA[It&#8217;s about 13 years ago that I gave up eating commercially caught fish as a personal protest against the practice. I would eat fish caught locally (in fact the last fish I ate was a trout barbecued in butter and garlic caught by a friend&#8217;s neighbour) but this only lasted a year or so and [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s about 13 years ago that I gave up eating commercially caught fish as a personal protest against the practice. I would eat fish caught locally (in fact the last fish I ate was a trout barbecued in butter and garlic caught by a friend&#8217;s neighbour) but this only lasted a year or so and I stopped shortly afterwards</p>
<p>After reading this <a href="http://www.guardian.co.uk/environment/2008/may/11/fishing.food?gusrc=rss&amp;feed=worldnews">article</a> in the Guardian I see that nothing has changed. In fact it&#8217;s got worse.</p>
<p>A couple of facts from the article:</p>
<ul>
<li>There is 32 million tonnes of bycatch a year, i.e. about one third of all fish caught are thrown away</li>
<li>For every prawn you eat fish weighting 10&#8212;20 times the weight are thrown away. Yes that&#8217;s right for every 1Kg of prawns you eat 10 to 20 Kgs of all kinds of fish are caught, often left to die on the deck while the prawns are being pulled out, and then thrown back overboard.</li>
</ul>
<p>There are many, many other horrifying points raised in the article and I implore you to read it.</p>
<p>Finally: &#8221; &#8230; that by 2050 we will only be able to meet the fish protein needs of half the world population: all that will be left for the unlucky half may be, as he puts it, &#8216;jellyfish and slime&#8217;.&#8221;. And the really sad thing about this whole affair is that the half won&#8217;t be the fat and over fed west.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2008/05/11/why-eating-fish-is-not-as-good-as-you-might-think/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Rails caching woes</title>
		<link>http://blog.twosecondmemory.org/2007/10/09/rails-caching-woes/</link>
		<comments>http://blog.twosecondmemory.org/2007/10/09/rails-caching-woes/#comments</comments>
		<pubDate>Mon, 08 Oct 2007 22:13:24 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2007/10/09/rails-caching-woes/</guid>
		<description><![CDATA[I&#8217;ve just been going round in circles trying to work out why my caching sweeper in rails was not working after I changed the relationship between two models.
I have a post and comment model which was a has_many/belongs_to relationship which I recently change to has_and_belongs_to_many. That part was fine but when I deployed to staging [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just been going round in circles trying to work out why my caching sweeper in rails was not working after I changed the relationship between two models.</p>
<p>I have a post and comment model which was a <tt>has_many</tt>/<tt>belongs_to </tt>relationship which I recently change to <tt>has_and_belongs_to_many</tt>. That part was fine but when I deployed to staging when I tried to delete a comment I was getting <tt>NoMethodError</tt> on a nil object error. Ummm. So after spending a good few hours banging my head against the brick wall conveniently located on my desk for moments such as this and invoking the &#8220;I really like rails but some bits of it &#8230;&#8221; mantra I finally worked it out.</p>
<p>When the object is passed to the <tt>after_destroy</tt> method the object has already been deleted from the database and given that ActiveRecord lazily loads, when I tried to access the post object from the comment object it did a dummy spit because it&#8217;s trying to load an object via another object that doesn&#8217;t exist.</p>
<p>So I changed the method to <tt>before_destroy</tt> and all is good. You might argue this is incorrect as you would want to make sure that the object has actually been deleted before the cache is invalidated but in all honesty I don&#8217;t care. The worst case that can happen is that I invalidate and object from the cache that still exists.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2007/10/09/rails-caching-woes/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Problogger</title>
		<link>http://blog.twosecondmemory.org/2007/10/04/problogger/</link>
		<comments>http://blog.twosecondmemory.org/2007/10/04/problogger/#comments</comments>
		<pubDate>Thu, 04 Oct 2007 09:01:57 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2007/10/04/problogger/</guid>
		<description><![CDATA[In the name of winning two monitors from here I&#8217;m writting this blog post. Good luck to me!
Oh what fun it would be if I won.

]]></description>
			<content:encoded><![CDATA[<p>In the name of winning two monitors from <a href="http://www.problogger.net/archives/2007/10/03/win-two-lg-usb-monitors-from-displaylink-giveaway/">here</a> I&#8217;m writting this blog post. Good luck to me!</p>
<p>Oh what fun it would be if I won.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2007/10/04/problogger/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Theory</title>
		<link>http://blog.twosecondmemory.org/2007/09/05/theory/</link>
		<comments>http://blog.twosecondmemory.org/2007/09/05/theory/#comments</comments>
		<pubDate>Wed, 05 Sep 2007 10:23:43 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2007/09/05/theory/</guid>
		<description><![CDATA[There is much said in the name of a theory. So I just want to clarify the different meanings and their uses of the word theory. There are two main meanings: the vernacular and the &#8220;science&#8221; definition.
In the vernacular the general meaning of theory is conjecture; something that is speculated, I could easily say &#8220;I [...]]]></description>
			<content:encoded><![CDATA[<p>There is much said in the name of a theory. So I just want to clarify the different meanings and their uses of the word theory. There are two main meanings: the vernacular and the &#8220;science&#8221; definition.</p>
<p>In the vernacular the general meaning of theory is conjecture; something that is speculated, I could easily say &#8220;I have a theory that the sun is blue&#8221;. Now I might have pulled this out of my arse but it is a valid use of the word theory and I will get labeled (justifiably so) a crank if I start peddling &#8220;theories&#8221; like that.</p>
<p>In science a theory is a &#8220;logical explanation&#8221; or a &#8220;testable model&#8221; (both quotes from the mighty <a href="http://en.wikipedia.org/wiki/Theory">wikipedia</a>). So if I say &#8220;I&#8217;ve got this mathematical theory that says the sun is blue&#8221; it would be wrong. There is no testable model that says the sun is blue (well this isn&#8217;t strictly true as there is a component of the sun&#8217;s light that is blue but sunlight, if measured across the full spectrum of visible light, is generally considered to be white).</p>
<p>The people who believe in creationism and &#8220;Intelligent design&#8221; are being very disingenuous when they say evolution is only a theory. They are applying the vernacular meaning to the scientific theory of evolution. As such they should (justifiably) be called cranks.</p>
<p>Just though I&#8217;d try and clear that up! For a longer discussion on this, as always, see wikipedia.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2007/09/05/theory/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Note to Self &#8212; caps lock -&#62; escape</title>
		<link>http://blog.twosecondmemory.org/2007/07/24/note-to-self-caps-lock-escape/</link>
		<comments>http://blog.twosecondmemory.org/2007/07/24/note-to-self-caps-lock-escape/#comments</comments>
		<pubDate>Tue, 24 Jul 2007 01:56:27 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>Notes to Self</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2007/07/24/note-to-self-caps-lock-escape/</guid>
		<description><![CDATA[printf "! Esc on caps Lock\n \
remove Lock = Caps_Lock\n \
keysym Caps_Lock = Escape\n"  &#62; $HOME/.Xmodmap
]]></description>
			<content:encoded><![CDATA[<pre><code>printf "! Esc on caps Lock\n \
remove Lock = Caps_Lock\n \
keysym Caps_Lock = Escape\n"  &gt; $HOME/.Xmodmap</code></pre>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2007/07/24/note-to-self-caps-lock-escape/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Project Honey Pot</title>
		<link>http://blog.twosecondmemory.org/2007/07/20/project-honey-pot/</link>
		<comments>http://blog.twosecondmemory.org/2007/07/20/project-honey-pot/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 06:27:27 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2007/07/20/project-honey-pot/</guid>
		<description><![CDATA[Well after being hounded by Mr Palmer (well he suggested that I join a couple of times) to join Project Honey Pot I finally joined and donated some MX records and put it on this website. I want to put it on Limes &#38; Lycopene but there is no script for Ruby as of yet.
There [...]]]></description>
			<content:encoded><![CDATA[<p>Well after being hounded by <a href="http://www.hezmatt.org/~mpalmer/blog">Mr Palmer</a> (well he suggested that I join a couple of times) to join <a title="Project Honey Pot" href="http://www.projecthoneypot.org/">Project Honey Pot</a> I finally joined and donated some MX records and put it on this website. I want to put it on <a title="Limes &amp; Lycopene" href="http://www.kathrynelliott.com.au/blog">Limes &amp; Lycopene</a> but there is no script for Ruby as of yet.</p>
<p>There are a number of good introductions to Project Honey Pot: <a title="The Joining   " href="http://www.hezmatt.org/~mpalmer/blog/general/project_honeypot_the_joining.html">here</a> &amp;<a title="Project Honey Pot" href="http://en.wikipedia.org/wiki/Project_Honey_Pot"> here</a> but it essentially boils down to laying traps for spammers (or more specifically <a title="Harvestering" href="http://en.wikipedia.org/wiki/Harvesting">harvesters</a>) and then tracking them when they send spam. This information is then made available via their <a title="http:BL" href="http://www.projecthoneypot.org/httpbl_configure.php">http:BL</a> service which allows you to do a DNS lookup on an ip address to determine if it is a known spammer.</p>
<p>Given that I&#8217;ve just finished the new blog and Kathryn is still getting some spam even though she is using <a title="Akismet" href="http://akismet.com/">akismet</a> (albeit a very small amount) I thought that I use http:BL there. Unfortunately there was no ruby code written that I could find (this is an unusual thing in it&#8217;s own right) so I&#8217;ve knocked up a small class that interfaces to the http:BL.</p>
<p>The code in it&#8217;s entirety is:</p>
<textarea name="code" class="ruby:nocontrols:nogutter" cols="60" rows="10">
    require 'resolv'
    require 'ipaddr'

    class HttpBl

        TYPE = { "0" =&gt; [:search_engine],
                 "1" =&gt; [:suspicious],
                 "2" =&gt; [:harvester],
                 "3" =&gt; [:suspicious, :harvester],
                 "4" =&gt; [:comment_spammer],
                 "5" =&gt; [:suspicious, :comment_spammer],
                 "6" =&gt; [:harvester, :comment_spammer],
                 "7" =&gt; [:suspicious, :harvester, :comment_spammer] }

        # Create a new HttpBL with the key as required to access this service.
        # See http://www.projecthoneypot.org/httpbl_configure.php to get a key.
        def initialize(key)
            @key = key
        end


        # Perform a lookup on the provided ip address.
        def check(ip_addr)
            ip = IPAddr.new(ip_addr)
            query = "#{@key}.#{ip.reverse.gsub("in-addr.arpa", "dnsbl.httpbl.org")}"

            begin
                lookup = Resolv.getaddress(query)
                values = lookup.split(".")
                { :last_activity =&gt; values[1], :threat =&gt; values[2], :type =&gt; TYPE[values[3]], :raw_data =&gt; lookup }
            rescue Resolv::ResolvError =&gt; error
                return {}
            end
        end
    end
</textarea>
<p>And that&#8217;s it. You can download a tarball <a href="http://twosecondmemory.org/wp-content/uploads/httpbl.tar.gz">here</a> containing the above code and some tests.</p>
<p>Any comments welcome.
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2007/07/20/project-honey-pot/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Brittany Spears and Semiconductor Physics</title>
		<link>http://blog.twosecondmemory.org/2007/07/20/brittany-spears-and-semiconductor-physics/</link>
		<comments>http://blog.twosecondmemory.org/2007/07/20/brittany-spears-and-semiconductor-physics/#comments</comments>
		<pubDate>Fri, 20 Jul 2007 00:24:19 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>General</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2007/07/20/brittany-spears-and-semiconductor-physics/</guid>
		<description><![CDATA[Not to be outdone by Mr Palmers post Britney Spears explains Garbage Collection here is Britney&#8217;s Guide to Semiconductor Physics.
But the thing I really love about this site is that if you do a google search for britney spears this site appears ninth. Go Britney!

]]></description>
			<content:encoded><![CDATA[<p>Not to be outdone by <a title="Brane Dump" href="http://www.hezmatt.org/~mpalmer/blog/">Mr Palmers</a> post <a title="Britney Spears explains Garbage Collection" href="http://www.hezmatt.org/~mpalmer/blog/general/britney_spears_explains_garbage_collection.html">Britney Spears explains Garbage Collection</a> here is <a title="Britney's Guide to Semiconductor Physics" href="http://britneyspears.ac/lasers.htm">Britney&#8217;s Guide to Semiconductor Physics</a>.</p>
<p>But the thing I really love about this site is that if you do a <a title="Britney's Guide to Semiconductor Physics " href="http://www.google.com/search?ie=UTF8&amp;q=britney+spears">google search for britney spears</a> this site appears ninth. Go Britney!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2007/07/20/brittany-spears-and-semiconductor-physics/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>Inernet Explorer</title>
		<link>http://blog.twosecondmemory.org/2007/07/20/inernet-explorer/</link>
		<comments>http://blog.twosecondmemory.org/2007/07/20/inernet-explorer/#comments</comments>
		<pubDate>Thu, 19 Jul 2007 23:20:39 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>Internet</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2007/07/20/inernet-explorer/</guid>
		<description><![CDATA[This article posted on slashdot stating that IE is down to 70% market share in Europe is very encouraging. Microsoft has been playing silly buggers with respect to web browsers for so long it&#8217;s nice to finally see some comeuppance. IE has a very poor track record with regards to security, is wantonly non-standards compliant [...]]]></description>
			<content:encoded><![CDATA[<p>This <a title="Firefox narrowly misses 28% use in Europe Internet Explorer under 70%" href="http://www.xitimonitor.com/en-us/browsers-barometer/firefox-july-2007/index-1-2-3-102.html">article</a> posted on <a title="Slashdot" href="http://slashdot.org/">slashdot</a> stating that IE is down to 70% market share in Europe is very encouraging. Microsoft has been playing silly buggers with respect to web browsers for so long it&#8217;s nice to finally see some comeuppance. IE has a very poor track record with regards to security, is wantonly non-standards compliant (something that Microsoft has excelled at for years) and is significantly lacking in useful functionality. Here are a few articles to whet your appetite: <a title="why you should dump internet explorer" href="http://www.lockergnome.com/nexus/news/2004/06/15/why-you-should-dump-internet-explorer/">why you should dump internet explorer</a>, <a title="Developers gripe about IE standards inaction" href="http://news.com.com/2100-1032-5088642.html">Developers gripe about IE standards inaction</a>, <a title="The Web Standards Project" href="http://www.webstandards.org/">The Web Standards Project</a> and there are plenty more.</p>
<p>So in short if you are using IE change! The most obvious choice is <a title="Mozilla" href="http://mozilla.org/">Mozilla</a> but if you are using a Mac then <a title="Safari" href="http://www.apple.com/safari/">Safari</a> is probably a good choice. Safari is now available under windows but is still in beta. If you use a number of different platforms then again mozilla is probably the best choice.</p>
<p>Do it and the web developers of the world will thank you!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2007/07/20/inernet-explorer/feed/</wfw:commentRSS>
		</item>
		<item>
		<title>New Blogging Engine</title>
		<link>http://blog.twosecondmemory.org/2007/07/16/new-blogging-engine/</link>
		<comments>http://blog.twosecondmemory.org/2007/07/16/new-blogging-engine/#comments</comments>
		<pubDate>Mon, 16 Jul 2007 07:27:57 +0000</pubDate>
		<dc:creator>rgh</dc:creator>
		
	<category>Internet</category>
		<guid isPermaLink="false">http://blog.twosecondmemory.org/2007/07/16/new-blogging-engine/</guid>
		<description><![CDATA[For the past few months I&#8217;ve been writing a new blogging engine for Limes &#38; Lycopene. It is written in Ruby on Rails and is designed to provide the functionality need for a blogging engine but nothing more. Although i&#8217;ve tried to make it fairly minimal I&#8217;ve put some effort into doing the Right Thing™, [...]]]></description>
			<content:encoded><![CDATA[<p>For the past few months I&#8217;ve been writing a new blogging engine for <a title="Limes &amp; Lycopene" href="http://www.kathrynelliott.com.au/blog/">Limes &amp; Lycopene</a>. It is written in <a title="Ruby on Rails" href="http://www.rubyonrails.org">Ruby on Rails</a> and is designed to provide the functionality need for a blogging engine but nothing more. Although i&#8217;ve tried to make it fairly minimal I&#8217;ve put some effort into doing the Right Thing™, for example the search functionality is quite sophisticated. If you want to search for &#8216;lycopene&#8217; in the title you would enter title:lycopene.</p>
<p>Now I know most people at this stage say why on earth would you write you own blogging engine there are loads of them out there. And that would be a fair question! There are a number of reasons:</p>
<ul>
<li>The blog is going to part of a much bigger system and I didn&#8217;t want to have to maintain and integrate a third party blog.</li>
<li>The existing blog (Wordpress) is <strong>extremely unreliable</strong>. To give you an example of what I mean I have a script that runs every minute and makes a five request to the blog, if the requests time out after five seconds I restart the server. The server is sometimes restarted 20 times a day. Yes I know it is widely used and therefore &#8220;must be reliable for me it isn&#8217;t.</li>
<li>Google Analytics would not work on Kathryn&#8217;s site but would work on mine. This seems to be a product of the theme.</li>
<li>The page used to write posts can only be described as evil (yes I know you can change it).</li>
<li>Wordpress is written using php which is being run using fcgi under lightty and is not a particularly elegant solution and uses a fair amount of memory (see this <a title="Lighttpd &amp; Wordpress" href="http://blog.twosecondmemory.org/2006/11/13/lighttpd-wordpress/">post</a> for more details). The machine that runs <a title="Limes &amp; Lycopene" href="http://www.kathrynelliott.com.au/blog/">Limes &amp; Lycopene</a> is a small memory constrained <a title="Xen Wiki" href="http://wiki.xensource.com/xenwiki/">Xen VM</a> and the less running on that machine the better.</li>
<li>I wanted to gain more experience using ruby on rails.</li>
</ul>
<p>So on Saturday afternoon I released the new engine, it wasn&#8217;t a particularly pleasant experience, mainly due to exporting the existing data from Wordpress, but it is now done (and the export only needs to be done once). There are a number of defects that need to be fixed but are not serious enough to delay the release. I have to say that I&#8217;m very pleased with the results and my admiration for rails has increased dramatically. Let me know what you think.</p>
<p>I would also like to thank <a title="Style Shout" href="http://www.styleshout.com/">Styleshout</a> for there fantastic website template and an even bigger thank you for releasing it under the <a title="Creative Commons license - version 2.5" href="http://creativecommons.org/licenses/by/2.5/">Creative Commons Attribution 2.5 License</a>. I had been looking for an open source site design for quite a while before I found pixel green so thank you, thank you, thank you.</p>
<p>As I mentioned above there are still a few defect to fix up and some more functionality that really does need to be added but once I&#8217;ve done that I will be releasing it under the GPL license. If anyone has any bright ideas for a name please let me know!
</p>
]]></content:encoded>
			<wfw:commentRSS>http://blog.twosecondmemory.org/2007/07/16/new-blogging-engine/feed/</wfw:commentRSS>
		</item>
	</channel>
</rss>
