<?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>ferrouswheel</title>
	<atom:link href="http://ferrouswheel.me/feed/" rel="self" type="application/rss+xml" />
	<link>http://ferrouswheel.me</link>
	<description>watching the world turn.</description>
	<lastBuildDate>Wed, 20 Jan 2010 19:51:54 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>International Conference on Advanced Intelligence 2010</title>
		<link>http://ferrouswheel.me/2010/01/international-conference-on-advanced-intelligence-2010/</link>
		<comments>http://ferrouswheel.me/2010/01/international-conference-on-advanced-intelligence-2010/#comments</comments>
		<pubDate>Wed, 20 Jan 2010 19:51:54 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[work]]></category>
		<category><![CDATA[ai]]></category>
		<category><![CDATA[opencog]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=456</guid>
		<description><![CDATA[The 2nd International Conference on Advanced Intelligence 2010 has just released it&#8217;s call for papers, which you can download here: ICAI2010 Call For Papers.
How is &#8220;Advanced Intelligence&#8221; different from general AI? The release says:

Typical features of Advanced Intelligence include: (1) Close interaction and coordination between Natural Intelligence and Artificial Intelligence, (2) Ideas and applications that [...]]]></description>
			<content:encoded><![CDATA[<p>The 2nd International Conference on Advanced Intelligence 2010 has just released it&#8217;s call for papers, which you can download here: <a href='http://ferrouswheel.me/files/2010/01/ICAI2010-cfp.pdf'>ICAI2010 Call For Papers</a>.</p>
<p>How is &#8220;Advanced Intelligence&#8221; different from general AI? The release says:</p>
<blockquote><p>
Typical features of Advanced Intelligence include: (1) Close interaction and coordination between Natural Intelligence and Artificial Intelligence, (2) Ideas and applications that push the frontiers of both Artificial Intelligence and Natural Intelligence, (3) Large-scale Distributed Intelligence and Web Intelligence
</p></blockquote>
<p>FWIW, I&#8217;m not sure I agree with the name, since &#8220;advanced&#8221; is a relative term, and the field of AGI (artificial general intelligence) is already fragmented enough without adding additional labels. Having said that, I&#8217;ve been invited to be an assistant co-chair, so I cordially invite you to submit interesting papers since then they&#8217;ll be a greater chance of me getting interesting papers to review <img src='http://ferrouswheel.me/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2010/01/international-conference-on-advanced-intelligence-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Python to parse fields in Amazon S3 logs</title>
		<link>http://ferrouswheel.me/2010/01/python_tparse-fields-in-s3-logs/</link>
		<comments>http://ferrouswheel.me/2010/01/python_tparse-fields-in-s3-logs/#comments</comments>
		<pubDate>Tue, 12 Jan 2010 22:23:19 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[s3]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=450</guid>
		<description><![CDATA[The log format for Amazon S3 is slightly annoying. Not overwhelmingly so, but the date field has the field separator (a space) in the middle of it and it isn&#8217;t encapsulated by quote characters. Here&#8217;s some code to split the fields up, assuming you&#8217;ve downloaded the log file already (it&#8217;s easy enough to list all [...]]]></description>
			<content:encoded><![CDATA[<p>The log format for Amazon S3 is slightly annoying. Not overwhelmingly so, but the date field has the field separator (a space) in the middle of it and it isn&#8217;t encapsulated by quote characters. Here&#8217;s some code to split the fields up, assuming you&#8217;ve downloaded the log file already (it&#8217;s easy enough to list all logs and retrieve them with boto):</p>
<p>[cce lang="Python"]<br />
import csv<br />
r = csv.reader(open(&#8216;logfilename&#8217;),<br />
        delimiter=&#8217; &#8216;,quotechar=&#8217;&#8221;&#8216;)<br />
log_entries = []<br />
for i in r:<br />
    i[2] = i[2] + &#8221; &#8221; + i[3] # repair date field<br />
    del i[3]<br />
    log_entries.append(i)<br />
[/cce]</p>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2010/01/python_tparse-fields-in-s3-logs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SizeUp behaviour using Compiz</title>
		<link>http://ferrouswheel.me/2010/01/sizeup-behaviour-using-compiz/</link>
		<comments>http://ferrouswheel.me/2010/01/sizeup-behaviour-using-compiz/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 01:47:31 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[linux]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=447</guid>
		<description><![CDATA[Recently I found out about SizeUp in OSX and found it really useful. Basically it gives you hot keys for window positions, such that you can maximise them vertically and attach them to the left or right of the screen. Great for placing terminal windows and browsers. This is similar to the behaviour in Windows [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I found out about <a href="http://www.irradiatedsoftware.com/sizeup/">SizeUp</a> in OSX and found it really useful. Basically it gives you hot keys for window positions, such that you can maximise them vertically and attach them to the left or right of the screen. Great for placing terminal windows and browsers. This is similar to the behaviour in Windows 7 (don&#8217;t know what they call it or care, they are just copying this stuff from existing window managers and getting all the credit). You can also send a window to a corner, or maximise horizontally and attach to top/bottom.</p>
<p>I knew it must be possible in linux somehow. For one thing, there&#8217;s <a href="http://tripie.sweb.cz/utils/wmctrl/">wmctrl</a>, a command line program for scripting window positions and I found <a href="http://ubuntuforums.org/showthread.php?t=1042042">some</a> <a href="http://ubuntuforums.org/showthread.php?t=979648">scripts</a> made by others in the Ubuntu forums that act similar to the way I wanted.</p>
<p>However, it turns out there is something already available if you&#8217;re using Compiz as your display manager.</p>
<p>To change to using Compiz and get the required config tool, run:</p>
<p><code>sudo aptitude install compizconfig-settings-manager</code></p>
<p>And then open the menu System &rarr; Preferences &rarr; Appearance. Go to the Visual Effects tab and choose &#8220;Extra&#8221;.</p>
<p>Then fire up the CompizConfig Settings Manager that&#8217;s also under System &rarr; Preferences. When the dialog loads, go to the filter and type &#8220;grid&#8221;. This is the module of Compiz that gives you almost the same behaviour as SizeUp (you can get the rest of the behaviour using other modules in the &#8220;Window Management&#8221; category.</p>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2010/01/sizeup-behaviour-using-compiz/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bits and bobs as we enter 2010</title>
		<link>http://ferrouswheel.me/2010/01/bits-and-bobs-as-we-enter-2010/</link>
		<comments>http://ferrouswheel.me/2010/01/bits-and-bobs-as-we-enter-2010/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 23:10:21 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[kickboxing]]></category>
		<category><![CDATA[opencog]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=437</guid>
		<description><![CDATA[
OpenCog is getting get a bit of comment on twitter, which might in part be due to it being linked on Hacker News.
I&#8217;ve started up at Jai Thai Kickboxing, which is just around the corner from where I live so I hope to get 4-5 sessions in a week. After my first session my shins [...]]]></description>
			<content:encoded><![CDATA[<ul>
<li><a href="http://opencog.org">OpenCog</a> is getting get a bit of comment <A href="http://twitter.com/#search?q=opencog">on twitter</A>, which might in part be due to it being linked on <a href="http://news.ycombinator.com/item?id=1020213">Hacker News</a>.</li>
<li>I&#8217;ve started up at <a href="http://jaithaiboxing.com/">Jai Thai Kickboxing</a>, which is just around the corner from where I live so I hope to get 4-5 sessions in a week. After my first session my shins and feet are somewhat bruised, this could indicate that my technique leaves something to be desired. Equally likely however is that my shins just need to harden up!</li>
<li>I read in the paper that Avatar is the faster movie to reach a billion dollars at the box office. It was very pretty, but it was also only a passable story. I hope that Avatar&#8217;s success will show the movie industry that they need to adapt by making cinema an immersive experience so that they are providing people a reason to go to the cinema instead of watching movies at home.</li>
<li>My life experience keeps expanding and it makes me feel alive. I stand by my assertion that the meaning of life is experience.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2010/01/bits-and-bobs-as-we-enter-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Licensing dynamic systems and AI</title>
		<link>http://ferrouswheel.me/2009/12/licensing-ai/</link>
		<comments>http://ferrouswheel.me/2009/12/licensing-ai/#comments</comments>
		<pubDate>Sat, 26 Dec 2009 09:33:46 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=433</guid>
		<description><![CDATA[Recently I&#8217;ve been contemplating a number of potential directions for creating a start-up based on application of OpenCog to a problem or field.
One evening, I had an interesting discussion in bed with my partner that was related to licensing such technology. OpenCog is open source, which is my personal preference for the development of AGI, [...]]]></description>
			<content:encoded><![CDATA[<p>Recently I&#8217;ve been contemplating a number of potential directions for creating a start-up based on application of <a href="http://www.opencog.org">OpenCog</a> to a problem or field.</p>
<p>One evening, I had an interesting discussion in bed with my partner that was related to licensing such technology. OpenCog is open source, which is my personal preference for the development of AGI, even if <a href="http://singinst.org/grants/transparency">the jury on whether it&#8217;s beneficial or needless reckless is still out</a>. As open source software, it means that if we sold expert systems based on OpenCog to end-users, we&#8217;d have to also provide the source. Even though we can license it under different terms from <a href="http://singinst.org">SIAI</a>, this isn&#8217;t entirely needed since my current viewpoint is that the real value will be in data within the system.</p>
<p>As an analogy, the biological design for the brain isn&#8217;t what makes us unique or what encompasses our knowledge and experience of the world. The pattern that&#8217;s formed during our childhood and education is what is really valuable, otherwise we&#8217;d make no distinction between twins and not particularly care if one twin passed away.</p>
<p>So, the digital mind&#8217;s pattern would be the important part that we&#8217;d license or sell. However dealing with a dynamic system makes that interesting, since the pattern that was sold/licensed would inevitably change. Learning software could well have the valuable part (the &#8220;identity&#8221; if you will) morph and change beyond the original deployment. In fact, the software could learn new things which makes the individual deployment &#8220;smarter&#8221; than the original or any other deployment.</p>
<p>In that case, who owns those improvements? Should <a href="http://fruitionnz.com/">we</a> get<br />
the rights, since it was our software that altered itself, or does it belong to the license-holder since the AI learnt the improvement in their environment?</p>
<p>I&#8217;m sure with sufficiently rigorous legal-work one could protect towards one view over another, but I&#8217;m more interested in what <i>seems</i> right.</p>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2009/12/licensing-ai/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Connectedness and gift giving</title>
		<link>http://ferrouswheel.me/2009/12/connectedness-and-gift-giving/</link>
		<comments>http://ferrouswheel.me/2009/12/connectedness-and-gift-giving/#comments</comments>
		<pubDate>Sun, 20 Dec 2009 05:05:50 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[mind]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=426</guid>
		<description><![CDATA[It&#8217;s Christmas time, and I enjoy getting gifts for people even though I&#8217;m not religious. I&#8217;ve also been enjoying getting rid of lots of stuff I don&#8217;t use/need. This not only makes me feel like I&#8217;m clearing out mental space (I have Tyler Durden&#8217;s words echoing in my head &#8220;The things you own, end up [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s Christmas time, and I enjoy getting gifts for people even though I&#8217;m not religious. I&#8217;ve also been enjoying getting rid of lots of stuff I don&#8217;t use/need. This not only makes me feel like I&#8217;m clearing out mental space (I have <a href="http://en.wikipedia.org/wiki/Fight_Club_%28film%29">Tyler Durden&#8217;s</a> words echoing in my head &#8220;The things you own, end up owning you&#8221;) but also makes me feel good that other people are getting something that they want/need. Especially since I&#8217;m either giving the stuff away or selling it cheaply on <a href="http://www.trademe.co.nz/Members/Listings.aspx?member=137586">TradeMe</a>. </p>
<p>I googled &#8220;It&#8217;s better to give than receive.&#8221; since that&#8217;s the quote that&#8217;s automatically been ingrained into my psyche. Turns out it&#8217;s from the Bible, Acts 20:35 (King James Version):</p>
<blockquote><p>&#8220;I have showed you all things, how that so labouring ye ought to support the weak, and to remember the words of the Lord Jesus, how he said: &#8216;It is more blessed to give than to receive.&#8217;&#8221;</p></blockquote>
<p>(I guess &#8220;more blessed&#8221; translates to &#8220;better&#8221; these days.)</p>
<p><a href="http://www.guardian.co.uk/science/2008/mar/21/medicalresearch.usa">Never mind that giving psychologically makes us happier than spending money on ourselves</a>. It also physiologically affects us, by releasing, not only the good old reward molecule <a href="http://en.wikipedia.org/wiki/Dopamine">Dopamine</a>, but also the <a href="http://www.pnas.org/content/103/42/15623.abstract">love neurotransmitter Oxytocin</a> (unfortunately the mention of <a href="http://en.wikipedia.org/wiki/Oxytocin">oxytocin</a> isn&#8217;t in the abstract, but it&#8217;s discussed <a href="http://www.sciencentral.com/articles/view.php3?article_id=218392880">here</a>).</p>
<p>There is another aspect of gift giving I want to mention, which I haven&#8217;t got any references for, but is based on my intuition on the mechanics of intelligence. When we give someone a gift, we usually have a reason for it, and when we choose a gift for them we tend to think &#8220;Will the person like this?&#8221;. The act of that means we have to emulate, model, and predict what they want and by activation it re-enforces their pattern within our mind. Does this inadvertently get us thinking of other aspects of their personality and of what other people might like too? I&#8217;ve discussed how part of love is the strong bonding of patterns, one&#8217;s self in another mind, their mind emulated in the self. This twinning makes us feel connected to the other person. To me, it makes sense that going through this process while selecting gifts for other people will inevitably make one feel more connected in general. And as mentioned above, the neurotransmitter associated with love is also released during giving.</p>
<p>Maybe this is why the gifting economy of <a href="http://www.kiwiburn.com">Kiwiburn</a> (and <a href="http://burningman.com/">the American equivalent</a>) is such a central part of the festivals and contributes to them being such enjoyable experiences.</p>
<blockquote><p>
&#8220;We make a living by what we get, but we make a life by what we give.&#8221;<br />
&#8211; Winston Churchill</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2009/12/connectedness-and-gift-giving/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload a file to S3 with Boto</title>
		<link>http://ferrouswheel.me/2009/12/upload-a-file-to-s3-with-boto/</link>
		<comments>http://ferrouswheel.me/2009/12/upload-a-file-to-s3-with-boto/#comments</comments>
		<pubDate>Wed, 16 Dec 2009 08:35:25 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=409</guid>
		<description><![CDATA[Amazon S3 is a distributed storage service which I&#8217;ve recently been working with. Boto is Python library for working with Amazon Web Services, which S3 is one facet of. This post will demonstrate how to upload a file using boto (a future post will demonstrate who to create the parameters for POST multi-part request that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="https://s3.amazonaws.com/">Amazon S3</a> is a distributed storage service which I&#8217;ve recently been working with. <a href="http://code.google.com/p/boto">Boto</a> is Python library for working with Amazon Web Services, which S3 is one facet of. This post will demonstrate how to upload a file using boto (a future post will demonstrate who to create the parameters for POST multi-part request that another client can use to upload to S3 without knowing your AWS key id or secret access key).</p>
<p>I will assume you&#8217;ve signed up for S3 already, and successfully downloaded and installed boto.</p>
<p>[cce lang="Python"]<br />
import boto</p>
<p># Fill these in &#8211; you get them when you sign up for S3<br />
AWS_ACCESS_KEY_ID = &#8221;<br />
AWS_SECRET_ACCESS_KEY = &#8221;</p>
<p>bucket_name = AWS_ACCESS_KEY_ID.lower() + &#8216;-mah-bucket&#8217;<br />
conn = boto.connect_s3(AWS_ACCESS_KEY_ID,<br />
            AWS_SECRET_ACCESS_KEY)<br />
[/cce]</p>
<p>If you&#8217;ve previously learnt about S3 you&#8217;ll know that bucket names need to be unique, so that&#8217;s why we&#8217;ve used the AWS Key ID as a prefix (as this is your unique id it&#8217;s unlikely someone else will be using it as a prefix). We&#8217;ve also converted the bucket to lowercase, as DNS is case-insensitive and it&#8217;s nice to use vanity domains of the form http://[bucket_name].s3.amazonaws.com/.</p>
<p>We create the connection object with boto.connect_s3() and this object let&#8217;s us interact with S3. We now create ourselves a bucket and upload a file:</p>
<p>[cce lang="Python"]<br />
bucket = conn.create_bucket(bucket_name,<br />
        location=s3.connection.Location.DEFAULT)</p>
<p>testfile = &#8220;replace this with an actual filename&#8221;<br />
print &#8216;Uploading %s to Amazon S3 bucket %s&#8217; % \<br />
       (testfile, bucket_name)</p>
<p>import sys<br />
def percent_cb(complete, total):<br />
    sys.stdout.write(&#8216;.&#8217;)<br />
    sys.stdout.flush()</p>
<p>from boto.s3.key import Key<br />
k = Key(bucket)<br />
k.key = &#8216;my test file&#8217;<br />
k.set_contents_from_filename(testfile,<br />
        cb=percent_cb, num_cb=10)<br />
[/cce]</p>
<p>There you have it! The set_contents_from_filename is a particularly nifty method which simplifies all the streaming of data to S3. Amazon&#8217;s prototype python S3 library required that the file be loaded into memory. This doesn&#8217;t work too well if you are working with large media files.</p>
<p>Oh, and the percent_cb function is a call back that gets called as the upload progresses.</p>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2009/12/upload-a-file-to-s3-with-boto/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Code-brain</title>
		<link>http://ferrouswheel.me/2009/12/code-brain/</link>
		<comments>http://ferrouswheel.me/2009/12/code-brain/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 21:14:02 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[geek]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=417</guid>
		<description><![CDATA[    I have the code-brain.
    Now that I live centrally, I’ve been finding myself more frequently excusing myself for having code-brain. What is code-brain? It’s when I’ve spent a day immersed in hacking code without social interaction… and to get out of this state generally just requires time. Usually [...]]]></description>
			<content:encoded><![CDATA[<p>    I have the code-brain.</p>
<p>    Now that I live centrally, I’ve been finding myself more frequently excusing myself for having code-brain. What is code-brain? It’s when I’ve spent a day immersed in hacking code without social interaction… and to get out of this state generally just requires time. Usually if I went anywhere it’d require a drive and enough temporal separation for me to revert to a more sociable state, but now that I live in town, it’s about a 5 minute walk to meet up with people which is not enough time and words come with difficulty.</p>
<p>    Given the plasticity of the brain, I sometimes wonder if coding for a living is psychologically stunting for one’s social behaviour. However, I can quickly reject that because many coders I know are very social and I don’t see them having the same difficulty.</p>
<p>    I sometimes liken it to a mild form of Aspergers, since when dealing with code, for the most part it’s possible to keep everything you need to know about in front of you and it’s finite. It’s not overwhelming except when you’re thrown into a new project with a large existing code-base. Coming from being immersed in such a controlled environment it’s hard to adapt to being in a room full of people because it’s impossible to predict exactly what everyone else will do.</p>
<p>    I don’t want to predict what everyone else will do, that’d make life boring. I just know it personally takes time to adjust between the two environments. If anyone has read or seen anything about this phenomenon then I’d appreciate links/comments – mostly so I can understand how to speed the transition and get more enjoyment from social situations without the painful transition.</p>
<p>    Possibly I just need to make the transition more often and it’ll become easier <img src='http://ferrouswheel.me/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' />  </p>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2009/12/code-brain/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Filtering Python dictionaries</title>
		<link>http://ferrouswheel.me/2009/12/filtering-python-dictionaries/</link>
		<comments>http://ferrouswheel.me/2009/12/filtering-python-dictionaries/#comments</comments>
		<pubDate>Wed, 09 Dec 2009 02:07:07 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[geek]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=412</guid>
		<description><![CDATA[Here&#8217;s a little Python snippet I just made up, but is immensely useful because I couldn&#8217;t find an obvious method like filter that applied to dictionaries instead of lists. This code pulls out specific key-value pairs from a dictionary and puts them in a new dictionary.
[cce lang="Python"]
&#62;&#62;&#62; x={ &#8216;test1&#8242;:1, &#8216;test2&#8242;:2, &#8216;test3&#8242;:3 }
&#62;&#62;&#62; my_keys = (&#8216;test1&#8242;,&#8217;test2&#8242;)
&#62;&#62;&#62; [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a little Python snippet I just made up, but is immensely useful because I couldn&#8217;t find an obvious method like filter that applied to dictionaries instead of lists. This code pulls out specific key-value pairs from a dictionary and puts them in a new dictionary.</p>
<p>[cce lang="Python"]<br />
&gt;&gt;&gt; x={ &#8216;test1&#8242;:1, &#8216;test2&#8242;:2, &#8216;test3&#8242;:3 }<br />
&gt;&gt;&gt; my_keys = (&#8216;test1&#8242;,&#8217;test2&#8242;)<br />
&gt;&gt;&gt; y=dict(filter(lambda t: t[0] in my_keys, x.items()))<br />
{&#8216;test&#8217;: 1, &#8216;test2&#8242;: 2}<br />
[/cce]</p>
<p>Obviously the performance characteristics of this won&#8217;t scale, but if you just want a few keys out of a dictionary then you should be fine.</p>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2009/12/filtering-python-dictionaries/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Will it be okay?</title>
		<link>http://ferrouswheel.me/2009/12/will-it-be-okay/</link>
		<comments>http://ferrouswheel.me/2009/12/will-it-be-okay/#comments</comments>
		<pubDate>Thu, 03 Dec 2009 23:16:25 +0000</pubDate>
		<dc:creator>Joel</dc:creator>
				<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://ferrouswheel.me/?p=401</guid>
		<description><![CDATA[This is a piece of writing from Hubbards cereal newsletter #36 &#8211; I used to have it on my wall when I was incredibly depressed, it was a amusing light in otherwise dark time. I&#8217;m miles from that place now, so am going to throw the newsletter out, but the writing itself deserves transcribing.
Will it [...]]]></description>
			<content:encoded><![CDATA[<p>This is a piece of writing from Hubbards cereal newsletter #36 &#8211; I used to have it on my wall when I was incredibly depressed, it was a amusing light in otherwise dark time. I&#8217;m miles from that place now, so am going to throw the newsletter out, but the writing itself deserves transcribing.</p>
<p><strong>Will it be okay?</strong><br />
by <a href="http://crescentdragonwagon.typepad.com/">Crescent Dragonwagon</a>.</p>
<p>Yes it will.</p>
<p><em>But what if a big dog comes?</em></p>
<p>You will know whether it is friendly or not, if it is friendly, you pat it, if it is not you stand perfectly still and unafraid and it stops barking and comes to you and sits quietly beside you.</p>
<p><em>But what if there is thunder and lightning?</em></p>
<p><span id="more-401"></span></p>
<p>You sit at your window and watch the rain beating down over the houses and fields in the dark night. You see how special it is because the lightning shows the rainy sky and countryside and all the city. You pay attention because the loud thunder is calling you saying &#8220;Look, the world is receiving a deep drink&#8221;.<br />
<em><br />
But what if there is lots of snow?</em></p>
<p>You put on your thermals , gloves, coat and scarf and play in it.</p>
<p><em>But what if snakes come in the night?</em></p>
<p>You keep a flute by your bed and play a song and the snakes hear and are quiet.<br />
<em><br />
But what if the cabbages don&#8217;t come up?</em></p>
<p>We drive to the nursery, purchase seven tomato plants, just in case. Then we come home we dig seven holes in the garden and plant a tomato in each one. We pat back the earth around them and pour a bucket of water around them. Then we go inside and read a book. When we come out again, there is a tiny row of cabbage seedlings.</p>
<p><em>But what if I hate everyone?</em></p>
<p>You run away. You pack raisins, walnuts, oranges, crackers and a flashlight in a bandanna. You knot its four corners together and walk and walk until you come to the park. You stay all afternoon, sitting by yourself under a tree. When you come home again, you don&#8217;t hate everyone.</p>
<p><em>But what if someone hates me?</em></p>
<p>You feel lonely and sad. You walk and walk until you come to a small pond. You kneel in the grass by the edge of the pond, you see something move. You put out your hand and a tiny frog hops onto it. Very carefully you lift your hand up to your ear and the frog whispers &#8220;Other people love you. Maybe that person will love you again, maybe not, in any case, it is all right&#8221;.</p>
<p><em>But what if nobody likes the way I dance?</em></p>
<p>You go dancing in the woods, alone in the crackling leaves. One day you meet someone else dancing in the woods and you dance together. You throw leaves on each other, you lie down in the leaves. Then you go home and draw pictures and drink warm milo together.</p>
<p><em>But what if you die?</em></p>
<p>My loving doesn&#8217;t die. It says with you, when you remember you and me, you say &#8220;What can I do with so much love? I will have to give some away&#8221;.</p>
<p>So you love thunder and lightning, dogs and snakes, snow and planting cabbages. You dance with other people in the leaves and run away with them. You love them and they love you, and you eat raisins together, so, yes it will be okay.</p>
]]></content:encoded>
			<wfw:commentRss>http://ferrouswheel.me/2009/12/will-it-be-okay/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
