<?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>TikiRobot!</title>
	<atom:link href="http://www.tikirobot.net/wp/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tikirobot.net/wp</link>
	<description>Mai Tais and Blinky Lights, Ahoy!</description>
	<lastBuildDate>Thu, 11 Mar 2010 17:39:20 +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>Bike Directions on Google Maps</title>
		<link>http://www.tikirobot.net/wp/2010/03/11/bike-directions-google-maps/</link>
		<comments>http://www.tikirobot.net/wp/2010/03/11/bike-directions-google-maps/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 17:38:13 +0000</pubDate>
		<dc:creator>may</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cycling]]></category>
		<category><![CDATA[google maps]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=3078</guid>
		<description><![CDATA[
Hooray! Google Maps now tells you how to get to places by bike! 
]]></description>
			<content:encoded><![CDATA[<p><object width="500" height="300"><param name="movie" value="http://www.youtube.com/v/JN5_NBSu7Lw&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/JN5_NBSu7Lw&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="300"></embed></object></p>
<p>Hooray! Google Maps now tells you how to get to places by bike! </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/03/11/bike-directions-google-maps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Banff Mountain Film Festival</title>
		<link>http://www.tikirobot.net/wp/2010/03/08/banff-mountain-film-festival/</link>
		<comments>http://www.tikirobot.net/wp/2010/03/08/banff-mountain-film-festival/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 19:28:39 +0000</pubDate>
		<dc:creator>may</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[banff]]></category>
		<category><![CDATA[mountains]]></category>
		<category><![CDATA[travel]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[wanderlust]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=3072</guid>
		<description><![CDATA[
This is going to be at the Palace of Fine Arts on Wednesday and Thursday.  It looks awesome. We should go!  
 Here&#8217;s a list of films that are playing (though I&#8217;m not sure which films are playing on which night).
]]></description>
			<content:encoded><![CDATA[<p><object width="500" height="300"><param name="movie" value="http://www.youtube.com/v/pW3tPjAbnAM&#038;hl=en_US&#038;fs=1&#038;"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/pW3tPjAbnAM&#038;hl=en_US&#038;fs=1&#038;" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="500" height="300"></embed></object></p>
<p>This is going to be at the Palace of Fine Arts on Wednesday and Thursday.  It looks awesome. We should go!  </p>
<p><a href="http://www.banffcentre.ca/MountainCulture/Tour/films/"> Here&#8217;s a list of films that are playing</a> (though I&#8217;m not sure which films are playing on which night).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/03/08/banff-mountain-film-festival/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Denne&#8217;s Aliens</title>
		<link>http://www.tikirobot.net/wp/2010/02/02/dennes-aliens/</link>
		<comments>http://www.tikirobot.net/wp/2010/02/02/dennes-aliens/#comments</comments>
		<pubDate>Wed, 03 Feb 2010 00:54:59 +0000</pubDate>
		<dc:creator>may</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[cuuuuute]]></category>
		<category><![CDATA[fonts]]></category>
		<category><![CDATA[illustration]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=3055</guid>
		<description><![CDATA[

How adorable is this font?!  It&#8217;s designed by Denise Bentulan and you can download it for free over here.
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.tikirobot.net/wp/wp-content/uploads/2010/02/denneALIENSpreview.jpg"><img src="http://www.tikirobot.net/wp/wp-content/uploads/2010/02/denneALIENSpreview.jpg" alt="" title="denneALIENSpreview" width="500" height="375" class="alignnone size-full wp-image-3064" /></a></p>
<p><a href="http://www.tikirobot.net/wp/wp-content/uploads/2010/02/dennesaliens1.jpg"><img src="http://www.tikirobot.net/wp/wp-content/uploads/2010/02/dennesaliens1-500x265.jpg" alt="" title="dennesaliens" width="500" height="265" class="alignnone size-medium wp-image-3057" /></a></p>
<p>How adorable is this font?!  It&#8217;s designed by Denise Bentulan and you can <a href="http://www.dafont.com/dennes-aliens.font">download it for free over here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/02/02/dennes-aliens/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replacing URLs with links&#8230; halp?</title>
		<link>http://www.tikirobot.net/wp/2010/01/26/replacing-urls-with-links-halp/</link>
		<comments>http://www.tikirobot.net/wp/2010/01/26/replacing-urls-with-links-halp/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 04:16:03 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[regex]]></category>
		<category><![CDATA[support]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2973</guid>
		<description><![CDATA[I found this crazy regex for matching URLs in python. Even though some very smart people went through the trouble of concocting that regex, I can&#8217;t seem to use for all test cases&#8230; hmm.
I&#8217;m trying to turn bare urls into links for our Twitter sidebar widget, and it almost works, except for the last crazy [...]]]></description>
			<content:encoded><![CDATA[<p>I found <a href="http://flanders.co.nz/2009/11/08/a-good-url-regular-expression-repost/">this crazy regex</a> for matching URLs in python. Even though some very smart people went through the trouble of concocting that regex, I can&#8217;t seem to use for all test cases&#8230; hmm.</p>
<p>I&#8217;m trying to turn bare urls into links for our Twitter sidebar widget, and it almost works, except for the last crazy case below (query string + anchor):</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!/usr/bin/python</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">re</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#41;</span>:
    <span style="color: #808080; font-style: italic;">#crazy regex from Shag, based on http://flanders.co.nz/2009/11/08/a-good-url-regular-expression-repost/</span>
&nbsp;
    prog = <span style="color: #dc143c;">re</span>.<span style="color: #008000;">compile</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'(?#FQURL)(?:(?#Protocol)(?:(?:ht|f)tp(?:s?)<span style="color: #000099; font-weight: bold;">\:</span><span style="color: #000099; font-weight: bold;">\/</span><span style="color: #000099; font-weight: bold;">\/</span>)(?#Username:Password)(?:<span style="color: #000099; font-weight: bold;">\w</span>+:<span style="color: #000099; font-weight: bold;">\w</span>+@)?(?#Subdomains)(?:(?:[-<span style="color: #000099; font-weight: bold;">\w</span>]+<span style="color: #000099; font-weight: bold;">\.</span>)*(?#TopLevel Domains)(?:[a-z]+<span style="color: #000099; font-weight: bold;">\.</span>?))(?#Port)(?::[<span style="color: #000099; font-weight: bold;">\d</span>]{1,5})?<span style="color: #000099; font-weight: bold;">\.</span>?(?#Directories)(?:(?:(?:<span style="color: #000099; font-weight: bold;">\/</span>(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,=]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>]{2})+)+|<span style="color: #000099; font-weight: bold;">\/</span>|)+|<span style="color: #000099; font-weight: bold;">\?</span>|#)?(?#Query)(?:(?:<span style="color: #000099; font-weight: bold;">\?</span>(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>{2}])+=?(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:=]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>]{2})*)(?:&amp;amp;(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>{2}])+=?(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:=]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>]{2})*)*)*(?#Anchor)(?:#(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:=]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>]{2})*)?|(?#BareURL)(?#Username:Password)(?:<span style="color: #000099; font-weight: bold;">\w</span>+:<span style="color: #000099; font-weight: bold;">\w</span>+@)?(?#Subdomains)(?:(?:[-<span style="color: #000099; font-weight: bold;">\w</span>]+<span style="color: #000099; font-weight: bold;">\.</span>)+(?#TopLevel Domains)(?:com|org|net|gov|mil|biz|info|mobi|name|aero|jobs|museum|travel|[a-z]{2}))(?#Port)(?::[<span style="color: #000099; font-weight: bold;">\d</span>]{1,5})?<span style="color: #000099; font-weight: bold;">\.</span>?(?#Directories)(?:(?:(?:<span style="color: #000099; font-weight: bold;">\/</span>(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,=]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>]{2})+)+|<span style="color: #000099; font-weight: bold;">\/</span>|)+|<span style="color: #000099; font-weight: bold;">\?</span>|#)?(?#Query)(?:(?:<span style="color: #000099; font-weight: bold;">\?</span>(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>{2}])+=?(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:=]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>]{2})*)(?:&amp;amp;(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>{2}])+=?(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:=]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>]{2})*)*)*(?#Anchor)(?:#(?:[-<span style="color: #000099; font-weight: bold;">\w</span>~!$+|.,*:=]|%[a-f<span style="color: #000099; font-weight: bold;">\d</span>]{2})*)?)'</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> prog.<span style="color: black;">sub</span><span style="color: black;">&#40;</span>r<span style="color: #483d8b;">'&lt;a href=&quot;<span style="color: #000099; font-weight: bold;">\g</span>&amp;lt;0&amp;gt;&quot;&gt;<span style="color: #000099; font-weight: bold;">\g</span>&amp;lt;0&amp;gt;&lt;/a&gt;'</span>, <span style="color: #008000;">str</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#single url</span>
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'http://tikirobot.net<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#string</span>
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'See http://tikirobot.net for more info.<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#string w/ anchor</span>
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'See http://tikirobot.net/#foo for more info.<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#two urls in a string</span>
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'See http://tikirobot.net or http://wikipedia.org for more info.<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#some test urls from flanders.co.nz</span>
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'This is a google search: http://www.google.com/search?q=good+url+regex&amp;amp;rls=com.microsoft:*&amp;amp;ie=UTF-8&amp;amp;oe=UTF-8&amp;amp;startIndex=&amp;amp;startPage=1<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'ftp://joe:password@ftp.filetransferprotocal.com is a ftp url<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'There is a bare url google.ru somewhere in this sentence<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#test cases from shag</span>
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'query string: https://some-url.com/?query=&amp;amp;name=joe&amp;amp;filter=*.*<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'both a query string and an anchor with no host name separator slash: https://some-url.com?query=&amp;amp;name=joe?filter=*.*#some_anchor<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'both a query string and an anchor: https://some-url.com/?query=&amp;amp;name=joe&amp;amp;filter=*.*#some_anchor<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'DNS name with a concluding period: http://some-url.com./<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'DNS name with a concluding period and query string: http://some-url.com./?foo=bar<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'single-component DNS name plus root: http://to./<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'single-component DNS name: http://to/<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span> convertLinks<span style="color: black;">&#40;</span><span style="color: #483d8b;">'words with slashes: unread/unregistered<span style="color: #000099; font-weight: bold;">\n</span>'</span><span style="color: black;">&#41;</span></pre></div></div>

<p><del datetime="2010-01-27T04:27:08+00:00">Also note my double-grouping on the regex.. There must be a better way!</del><br />
Update, figured out that the group zero backreference is \g&lt;0&gt; (\0 doesn&#8217;t work, so I was double-grouping so that I could use \1).</p>
<p><del datetime="2010-01-29T02:20:35+00:00">Little help, regex ninjas?</del> Update 2: Shag to the rescue!</p>
<p><strong>Updates 3, 4, and 5</strong>: Shag has provided us with a even moar better regex in the comments.. Yay Shag!!!!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/01/26/replacing-urls-with-links-halp/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Fever Ray WANTS YOUR BRAIN</title>
		<link>http://www.tikirobot.net/wp/2010/01/26/fever-ray-wants-your-brain/</link>
		<comments>http://www.tikirobot.net/wp/2010/01/26/fever-ray-wants-your-brain/#comments</comments>
		<pubDate>Wed, 27 Jan 2010 03:21:12 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[beats]]></category>
		<category><![CDATA[fever ray]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2970</guid>
		<description><![CDATA[Karin Dreijer Andersson made it on to Resident Advisor&#8217;s Top 100 albums of the &#8217;00s list twice, once for her solo album as Fever Ray and again for her collaboration with her brother as The Knife.
Here is an acceptance speech that Fever Ray gave at an awards show in Sweeden. It is one of the [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Karin_Dreijer_Andersson">Karin Dreijer Andersson</a> made it on to Resident Advisor&#8217;s <a href="http://www.residentadvisor.net/feature.aspx?1144">Top 100 albums of the &#8217;00s</a> list twice, once for her solo album as <a href="http://feverray.com">Fever Ray</a> and again for her collaboration with her brother as <a href="http://www.theknife.net/">The Knife</a>.</p>
<p>Here is an acceptance speech that Fever Ray gave at an awards show in Sweeden. It is one of the best acceptance speeches ever given:</p>
<p><object width="480" height="295"><param name="movie" value="http://www.youtube-nocookie.com/v/ymCP6zC_qJU&#038;hl=en_US&#038;fs=1&#038;rel=0"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/ymCP6zC_qJU&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="295"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/01/26/fever-ray-wants-your-brain/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Signing Amazon Web Services API Requests in Python</title>
		<link>http://www.tikirobot.net/wp/2010/01/24/signing-amazon-web-services-api-requests-in-python/</link>
		<comments>http://www.tikirobot.net/wp/2010/01/24/signing-amazon-web-services-api-requests-in-python/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 18:33:09 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[amazon]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[archive]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[code code]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2915</guid>
		<description><![CDATA[I wanted to ping the &#8220;Amazon Product Advertising API&#8221; which now requires an HMAC signature, and the pyAWS library doesn&#8217;t sign requests and is no longer maintained. Here is some Python code to create a signed request:

# pyAWS no longer works with the AWS signed request requirement
# Sign an AWS REST request using the method [...]]]></description>
			<content:encoded><![CDATA[<p>I wanted to ping the &#8220;Amazon Product Advertising API&#8221; which now requires an HMAC signature, and the pyAWS library doesn&#8217;t sign requests and is no longer maintained. Here is some Python code to create a signed request:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;"># pyAWS no longer works with the AWS signed request requirement</span>
<span style="color: #808080; font-style: italic;"># Sign an AWS REST request using the method described here</span>
<span style="color: #808080; font-style: italic;"># http://docs.amazonwebservices.com/AWSECommerceService/latest/DG/index.html?RequestAuthenticationArticle.html</span>
<span style="color: #808080; font-style: italic;">#_______________________________________________________________________________</span>
<span style="color: #ff7700;font-weight:bold;">def</span> getSignedUrl<span style="color: black;">&#40;</span>accessKey, secretKey, params<span style="color: black;">&#41;</span>:
&nbsp;
    <span style="color: #808080; font-style: italic;">#Step 0: add accessKey, Service, Timestamp, and Version to params</span>
    params<span style="color: black;">&#91;</span><span style="color: #483d8b;">'AWSAccessKeyId'</span><span style="color: black;">&#93;</span> = accessKey
    params<span style="color: black;">&#91;</span><span style="color: #483d8b;">'Service'</span><span style="color: black;">&#93;</span>        = <span style="color: #483d8b;">'AWSECommerceService'</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#Amazon adds hundredths of a second to the timestamp (always .000), so we do too.</span>
    <span style="color: #808080; font-style: italic;">#(see http://associates-amazon.s3.amazonaws.com/signed-requests/helper/index.html)</span>
    params<span style="color: black;">&#91;</span><span style="color: #483d8b;">'Timestamp'</span><span style="color: black;">&#93;</span>      = <span style="color: #dc143c;">time</span>.<span style="color: black;">strftime</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;%Y-%m-%dT%H:%M:%S.000Z&quot;</span>, <span style="color: #dc143c;">time</span>.<span style="color: black;">gmtime</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    params<span style="color: black;">&#91;</span><span style="color: #483d8b;">'Version'</span><span style="color: black;">&#93;</span>        = <span style="color: #483d8b;">'2009-03-31'</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#Step 1a: sort params</span>
    paramsList = params.<span style="color: black;">items</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
    paramsList.<span style="color: black;">sort</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#Step 1b-d: create canonicalizedQueryString</span>
    <span style="color: #808080; font-style: italic;"># This code comes from http://blog.umlungu.co.uk/blog/2009/jul/12/pyaws-adding-request-authentication/</span>
    <span style="color: #808080; font-style: italic;"># and the resulting discussion</span>
    canonicalizedQueryString = <span style="color: #483d8b;">'&amp;'</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'%s=%s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>k,<span style="color: #dc143c;">urllib</span>.<span style="color: black;">quote</span><span style="color: black;">&#40;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>v<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: black;">&#40;</span>k,v<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">in</span> paramsList <span style="color: #ff7700;font-weight:bold;">if</span> v<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#Step 2: create string to sign</span>
    host          = <span style="color: #483d8b;">'ecs.amazonaws.com'</span>
    requestUri    = <span style="color: #483d8b;">'/onca/xml'</span>
    stringToSign  = <span style="color: #483d8b;">'GET<span style="color: #000099; font-weight: bold;">\n</span>'</span>
    stringToSign += host +<span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span>
    stringToSign += requestUri+<span style="color: #483d8b;">'<span style="color: #000099; font-weight: bold;">\n</span>'</span>
    stringToSign += canonicalizedQueryString.<span style="color: black;">encode</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'utf-8'</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#Step 3: create HMAC</span>
    digest = <span style="color: #dc143c;">hmac</span>.<span style="color: #dc143c;">new</span><span style="color: black;">&#40;</span>secretKey, stringToSign, hashlib.<span style="color: black;">sha256</span><span style="color: black;">&#41;</span>.<span style="color: black;">digest</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#Step 4: base64 the hmac</span>
    sig = <span style="color: #dc143c;">base64</span>.<span style="color: black;">b64encode</span><span style="color: black;">&#40;</span>digest<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #808080; font-style: italic;">#Step 5: append signature to query</span>
    url  = <span style="color: #483d8b;">'http://'</span> + host + requestUri + <span style="color: #483d8b;">'?'</span>
    url += canonicalizedQueryString + <span style="color: #483d8b;">&quot;&amp;Signature=&quot;</span> + <span style="color: #dc143c;">urllib</span>.<span style="color: black;">quote</span><span style="color: black;">&#40;</span>sig<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> url</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/01/24/signing-amazon-web-services-api-requests-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fast manipulation of tar files using 7zip</title>
		<link>http://www.tikirobot.net/wp/2010/01/20/fast-manipulation-of-tar-files-using-7zip/</link>
		<comments>http://www.tikirobot.net/wp/2010/01/20/fast-manipulation-of-tar-files-using-7zip/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 01:43:32 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[archive]]></category>
		<category><![CDATA[code code]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2903</guid>
		<description><![CDATA[tar always reads every byte in an archive (never calles seek()) and is very slow when trying to extract a single file from a large archive.
One solution is to use 7z instead, which is found in the p7zip-full debian package. For some operations, 7z is three orders of magnitude faster than tar. Here are some [...]]]></description>
			<content:encoded><![CDATA[<p><strong>tar</strong> always reads every byte in an archive (never calles seek()) and is <strong>very</strong> slow when trying to extract a single file from a large archive.</p>
<p>One solution is to use 7z instead, which is found in the p7zip-full debian package. For some operations, 7z is three orders of magnitude faster than tar. Here are some timings that illustrate how much faster 7z is:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#4.5GB archive listing using tar</span>
<span style="color: #000000; font-weight: bold;">time</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> tvf fifteenthcensus00reel2149_jp2.tar 
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#40;</span>output suppressed, timing stable whether <span style="color: #c20cb9; font-weight: bold;">file</span> cache is warmed or not<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
real	2m1.876s
user	0m0.444s
sys	0m7.740s
&nbsp;
<span style="color: #666666; font-style: italic;">#4.5GB archive listing using 7z with cold file cache</span>
<span style="color: #000000; font-weight: bold;">time</span> 7z l fifteenthcensus00reel2149_jp2.tar 
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#40;</span>output suppressed<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
real	0m10.419s
user	0m0.080s
sys	0m0.124s
<span style="color: #000000;">5</span>:<span style="color: #000000;">28</span> PM
&nbsp;
<span style="color: #666666; font-style: italic;">#4.5GB archive listing using 7z with hot file cache</span>
<span style="color: #000000; font-weight: bold;">time</span> 7z l fifteenthcensus00reel2149_jp2.tar 
&nbsp;
<span style="color: #7a0874; font-weight: bold;">&#40;</span>output suppressed<span style="color: #7a0874; font-weight: bold;">&#41;</span>
&nbsp;
real	0m0.145s
user	0m0.052s
sys	0m0.040s
&nbsp;
&nbsp;
<span style="color: #666666; font-style: italic;">#extraction of last file in a 4.5GB archive using tar</span>
<span style="color: #000000; font-weight: bold;">time</span> <span style="color: #c20cb9; font-weight: bold;">tar</span> xvf fifteenthcensus00reel2149_jp2.tar fifteenthcensus00reel2149_jp2<span style="color: #000000; font-weight: bold;">/</span>fifteenthcensus00reel2149_0185.jp2
&nbsp;
real	2m3.545s
user	0m0.436s
sys	0m7.824s
&nbsp;
<span style="color: #666666; font-style: italic;">#extraction of last file in a 4.5GB archive using 7z and a hot file cache</span>
<span style="color: #000000; font-weight: bold;">time</span> 7z e fifteenthcensus00reel2149_jp2.tar fifteenthcensus00reel2149_jp2<span style="color: #000000; font-weight: bold;">/</span>fifteenthcensus00reel2149_0185.jp2
&nbsp;
real	0m0.104s
user	0m0.036s
sys	0m0.036s</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/01/20/fast-manipulation-of-tar-files-using-7zip/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Happy Belated Birthday!</title>
		<link>http://www.tikirobot.net/wp/2010/01/19/happy-belated-birthday/</link>
		<comments>http://www.tikirobot.net/wp/2010/01/19/happy-belated-birthday/#comments</comments>
		<pubDate>Tue, 19 Jan 2010 23:55:24 +0000</pubDate>
		<dc:creator>may</dc:creator>
				<category><![CDATA[video]]></category>
		<category><![CDATA[birthday]]></category>
		<category><![CDATA[comix]]></category>
		<category><![CDATA[jibjab]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2897</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<div style='background-color:#e9e9e9; width: 425px;'><object id='A64060' quality='high' data='http://aka.zero.jibjab.com/client/zero/ClientZero_EmbedViewer.swf?external_make_id=a23FYI6Fd4QDoMnz&#038;service=sendables.jibjab.com&#038;partnerID=JibJab' pluginspage='http://www.macromedia.com/go/getflashplayer' type='application/x-shockwave-flash' wmode='transparent' height='319' width='425'><param name='wmode' value='transparent'></param><param name='movie' value='http://aka.zero.jibjab.com/client/zero/ClientZero_EmbedViewer.swf?external_make_id=a23FYI6Fd4QDoMnz&#038;service=sendables.jibjab.com&#038;partnerID=JibJab'></param><param name='scaleMode' value='showAll'></param><param name='quality' value='high'></param><param name='allowNetworking' value='all'></param><param name='allowFullScreen' value='true' /><param name='FlashVars' value='external_make_id=a23FYI6Fd4QDoMnz&#038;service=sendables.jibjab.com&#038;partnerID=JibJab'></param><param name='allowScriptAccess' value='always'></param></object></div>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/01/19/happy-belated-birthday/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The Imaginarium of Dr Parnassus</title>
		<link>http://www.tikirobot.net/wp/2010/01/10/the-imaginarium-of-dr-parnassus/</link>
		<comments>http://www.tikirobot.net/wp/2010/01/10/the-imaginarium-of-dr-parnassus/#comments</comments>
		<pubDate>Mon, 11 Jan 2010 00:18:46 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[upcoming]]></category>
		<category><![CDATA[Terry Gilliam]]></category>
		<category><![CDATA[The Imaginarium of Doctor Parnassus]]></category>
		<category><![CDATA[Tom Waits]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2895</guid>
		<description><![CDATA[Speaking of Mr. Tom Waits, the new Terry Gilliam film The Imaginarium of Doctor Parnassus stars Tom Waits as THE DEVIL. It is playing at the Kabuki RIGHT NOW and all this week. When shall we go?

]]></description>
			<content:encoded><![CDATA[<p>Speaking of Mr. Tom Waits, the new Terry Gilliam film <em>The Imaginarium of Doctor Parnassus</em> stars Tom Waits as THE DEVIL. It is playing at the Kabuki RIGHT NOW and all this week. When shall we go?</p>
<p><object width="480" height="385"><param name="movie" value="http://www.youtube-nocookie.com/v/6jU3AimFaz0&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube-nocookie.com/v/6jU3AimFaz0&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/01/10/the-imaginarium-of-dr-parnassus/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A ramp for Mom!</title>
		<link>http://www.tikirobot.net/wp/2010/01/09/a-ramp-for-mom/</link>
		<comments>http://www.tikirobot.net/wp/2010/01/09/a-ramp-for-mom/#comments</comments>
		<pubDate>Sat, 09 Jan 2010 23:14:32 +0000</pubDate>
		<dc:creator>flickr</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[howto]]></category>
		<category><![CDATA[wheelchair ramp]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/2010/01/09/a-ramp-for-mom/</guid>
		<description><![CDATA[
.flickr-photo { border: solid 2px #000000; }
.flickr-yourcomment { }
.flickr-frame { text-align: left; padding: 3px; }
.flickr-caption { font-size: 0.8em; margin-top: 0px; }


	

	A ramp for Mom!, originally uploaded by tiki.robot.


	-raj
]]></description>
			<content:encoded><![CDATA[<style type="text/css">
.flickr-photo { border: solid 2px #000000; }
.flickr-yourcomment { }
.flickr-frame { text-align: left; padding: 3px; }
.flickr-caption { font-size: 0.8em; margin-top: 0px; }
</style>
<div class="flickr-frame">
	<a href="http://www.flickr.com/photos/22009051@N05/4260112609/" title="photo sharing"><img src="http://farm5.static.flickr.com/4012/4260112609_d3526c0961.jpg" class="flickr-photo" alt="" /></a><br />
<br />
	<span class="flickr-caption"><a href="http://www.flickr.com/photos/22009051@N05/4260112609/">A ramp for Mom!</a>, originally uploaded by <a href="http://www.flickr.com/people/22009051@N05/">tiki.robot</a>.</span>
</div>
<p class="flickr-yourcomment">
	-raj</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/01/09/a-ramp-for-mom/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
