<?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! &#187; rajbot</title>
	<atom:link href="http://www.tikirobot.net/wp/author/rajbot/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>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>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>What&#8217;s he building in there?</title>
		<link>http://www.tikirobot.net/wp/2010/01/02/whats-he-building-in-there/</link>
		<comments>http://www.tikirobot.net/wp/2010/01/02/whats-he-building-in-there/#comments</comments>
		<pubDate>Sat, 02 Jan 2010 20:20:03 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[video]]></category>
		<category><![CDATA[beats]]></category>
		<category><![CDATA[Tom Waits]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2892</guid>
		<description><![CDATA[
- Tom Waits, via reddit
]]></description>
			<content:encoded><![CDATA[<p><object width="480" height="385"><param name="movie" value="http://www.youtube-nocookie.com/v/JaLjwSpZ6Cs&#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/JaLjwSpZ6Cs&#038;hl=en_US&#038;fs=1&#038;rel=0" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="480" height="385"></embed></object></p>
<p>- Tom Waits, via reddit</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2010/01/02/whats-he-building-in-there/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Look what Zara got me!</title>
		<link>http://www.tikirobot.net/wp/2009/12/25/look-what-zara-got-me/</link>
		<comments>http://www.tikirobot.net/wp/2009/12/25/look-what-zara-got-me/#comments</comments>
		<pubDate>Fri, 25 Dec 2009 20:27:47 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[zara]]></category>
		<category><![CDATA[books]]></category>
		<category><![CDATA[How To Teach Physics To Your Dog]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2889</guid>
		<description><![CDATA[
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/rkumar/4213341097/" title="How To Teach Physics To Your Dog by rkumar, on Flickr"><img src="http://farm3.static.flickr.com/2736/4213341097_3e2d70a5c1.jpg" width="375" height="500" alt="How To Teach Physics To Your Dog" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2009/12/25/look-what-zara-got-me/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Grayscale Santa</title>
		<link>http://www.tikirobot.net/wp/2009/12/15/grayscale-santa/</link>
		<comments>http://www.tikirobot.net/wp/2009/12/15/grayscale-santa/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 17:04:19 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[photos]]></category>
		<category><![CDATA[san francisco]]></category>
		<category><![CDATA[santacon]]></category>
		<category><![CDATA[santarchy]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2871</guid>
		<description><![CDATA[At this year&#8217;s Santacon, someone Brody dressed up as a grayscale Santa. Here is a picture by NV6V:

Another pic from sfgate&#8230;
Update: more info in the description of this pic:

&#8220;Custom gray &#038; white Santa suit, made by me. Wig + contacts + Kryolan body paint&#8221;
Unreal&#8230;
]]></description>
			<content:encoded><![CDATA[<p>At this year&#8217;s Santacon, <del datetime="2009-12-16T07:35:42+00:00">someone</del> <a href="http://www.flickr.com/people/hlscotland/">Brody</a> dressed up as a grayscale Santa. <a href="http://www.flickr.com/photos/nv6v/4182194550/in/photostream/">Here is a picture by NV6V</a>:</p>
<p><a href="http://www.flickr.com/photos/nv6v/4182194550/in/photostream"><img src="http://farm3.static.flickr.com/2524/4182194550_50b844d6d5_d.jpg" width="345" height="500"/></a></p>
<p><a href="http://www.sfgate.com/cgi-bin/object/article?f=/g/a/2009/12/14/dip.DTL">Another pic from sfgate&#8230;</a></p>
<p>Update: more info in the description of this pic:<br />
<a href="http://www.flickr.com/photos/hlscotland/4179680498"><img src="http://farm3.static.flickr.com/2692/4179680498_de3efe7c3b_d.jpg" width="345" height="500"/></a></p>
<blockquote><p>&#8220;Custom gray &#038; white Santa suit, made by me. Wig + contacts + Kryolan body paint&#8221;</p></blockquote>
<p>Unreal&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2009/12/15/grayscale-santa/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Copenhagen&#8217;s Awesome Bicycle Infrastructure</title>
		<link>http://www.tikirobot.net/wp/2009/12/14/copenhagens-awesome-bicycle-infrastructure/</link>
		<comments>http://www.tikirobot.net/wp/2009/12/14/copenhagens-awesome-bicycle-infrastructure/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 06:56:10 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[cycling]]></category>
		<category><![CDATA[Copenhagen]]></category>
		<category><![CDATA[transportation]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2866</guid>
		<description><![CDATA[StreetFilms has posted this video showing off the bicycle infrastructure in Copenhagen, where 37% of all commute trips are made on bike.

Update somewhat related: The Senseable City Lab at MIT has unveiled their Copenhagen Wheel.
It transforms ordinary bicycles quickly into hybrid e-bikes that also function as mobile sensing units. The Copenhagen Wheel allows you to [...]]]></description>
			<content:encoded><![CDATA[<p>StreetFilms has posted this video showing off <a href="http://www.streetfilms.org/copenhagen’s-climate-friendly-bike-friendly-streets/#more-23141">the bicycle infrastructure in Copenhagen</a>, where 37% of all commute trips are made on bike.</p>
<p><object width="500" height="339" type="application/x-shockwave-flash" data="http://www.streetfilms.org/wp-content/plugins/flowplayer_wp/flowplayer/flowplayer.swf?g"><param value="http://www.streetfilms.org/wp-content/plugins/flowplayer_wp/flowplayer/flowplayer.swf?g" name="movie" /><param value="true" name="allowfullscreen" /><param value="config=http://www.streetfilms.org/config.js?post_id=23141" name="flashvars" /><param value="always" name="allowscriptaccess" /></object></p>
<p>Update somewhat related: The Senseable City Lab at MIT has unveiled their <a href="http://senseable.mit.edu/copenhagenwheel/">Copenhagen Wheel</a>.</p>
<blockquote><p>It transforms ordinary bicycles quickly into hybrid e-bikes that also function as mobile sensing units. The Copenhagen Wheel allows you to capture the energy dissipated while cycling and braking and save it for when you need  a bit of a boost. It also maps pollution levels, traffic congestion, and road conditions in real-time. </p></blockquote>
<p><object width="480" height="295"><param name="movie" value="http://www.youtube-nocookie.com/v/S7y3qIQu3Gc&#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/S7y3qIQu3Gc&#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/2009/12/14/copenhagens-awesome-bicycle-infrastructure/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Death of the Newspaper Greatly Exaggerated</title>
		<link>http://www.tikirobot.net/wp/2009/12/14/death-of-the-newspaper-greatly-exaggerated/</link>
		<comments>http://www.tikirobot.net/wp/2009/12/14/death-of-the-newspaper-greatly-exaggerated/#comments</comments>
		<pubDate>Mon, 14 Dec 2009 20:59:36 +0000</pubDate>
		<dc:creator>rajbot</dc:creator>
				<category><![CDATA[design]]></category>
		<category><![CDATA[san francisco]]></category>
		<category><![CDATA[McSweeney's]]></category>

		<guid isPermaLink="false">http://www.tikirobot.net/wp/?p=2861</guid>
		<description><![CDATA[
I just picked up the latest issue of the San Francisco Panorama today from Green Apple. McSweeney&#8217;s has proven that the American newspaper is still viable. It just takes a team of writers five months to produce a single issue, which sells for $17.52 :)
]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.tikirobot.net/wp/wp-content/uploads/2009/12/Photo-17-500x375.jpg" alt="Photo 17" title="Photo 17" width="500" height="375" class="aligncenter size-medium wp-image-2862" /></p>
<p>I just picked up the latest issue of the <a href="http://store.mcsweeneys.net/index.cfm/fuseaction/catalog.detail/object_id/46ea295f-d5fb-4d20-8ffd-2e07fbd4a13d">San Francisco Panorama</a> today from Green Apple. McSweeney&#8217;s has proven that the American newspaper is still viable. It just takes a team of writers five months to produce a single issue, which sells for $17.52 :)</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tikirobot.net/wp/2009/12/14/death-of-the-newspaper-greatly-exaggerated/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
