<?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>Cthulhu and other crazies</title>
	<atom:link href="http://swizec.com/blog/feed" rel="self" type="application/rss+xml" />
	<link>http://swizec.com/blog</link>
	<description>A blog about life, the universe and everything else</description>
	<lastBuildDate>Fri, 03 Sep 2010 11:57:26 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Apple&#8217;s Ping is a big pile of steaming dung</title>
		<link>http://swizec.com/blog/apples-ping-is-a-big-pile-of-steaming-dung/swizec/1444</link>
		<comments>http://swizec.com/blog/apples-ping-is-a-big-pile-of-steaming-dung/swizec/1444#comments</comments>
		<pubDate>Fri, 03 Sep 2010 11:57:25 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apple]]></category>
		<category><![CDATA[ITunes Store]]></category>
		<category><![CDATA[Last.fm]]></category>
		<category><![CDATA[ping]]></category>
		<category><![CDATA[Social network]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1444</guid>
		<description><![CDATA[A few days ago Apple released a social network. Gee, how bloody creative of them and they used to be so cool. There are enough social networks, too many actually. But I digress.
Yesterday when I updated iTunes and got the slightly odd new version (what&#8217;s with the vertical window buttons anyway?) there was no Ping [...]]]></description>
			<content:encoded><![CDATA[<p>A few days ago <a class="zem_slink freebase/en/apple_inc" title="Apple" rel="homepage" href="http://www.apple.com">Apple</a> released a social network. Gee, how bloody creative of them and they used to be so cool. There are enough social networks, too many actually. But I digress.</p>
<p>Yesterday when I updated iTunes and got the slightly odd new version (what&#8217;s with the vertical window buttons anyway?) there was no Ping in sight. Very well then, failed already as predicted by my tweet?</p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.19.39-PM.png" rel="lightbox[1444]"><img class="aligncenter size-full wp-image-1445" title="Screen shot 2010-09-03 at 1.19.39 PM" src="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.19.39-PM.png" alt="" width="621" height="287" /></a></p>
<p>Well today when I opened iTunes again. There it was! Let&#8217;s go click that bad boy.</p>
<p>The first screen was pretty nice, some blahblahblah about how this is a social network and can do socially stuff. Create account!</p>
<p>Ok, first thing that&#8217;s a bit odd is that my Ping account is the same as my <a class="zem_slink freebase/en/itunes_store" title="ITunes Store" rel="homepage" href="http://itunes.com">iTunes store</a> account. Luckily I have a slightly hacked one so I can use the US store, otherwise Ping wouldn&#8217;t even exist for me.</p>
<p><strong>Fail #1</strong> &#8211; only exists for US people like I suddenly woke up in the middle ages.</p>
<p>Another thing that strook me as odd was setting up an avatar:<a href="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.17.32-PM.png" rel="lightbox[1444]"><img class="aligncenter size-full wp-image-1446" title="Screen shot 2010-09-03 at 1.17.32 PM" src="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.17.32-PM.png" alt="" width="812" height="115" /></a></p>
<p>I can swallow the fact there&#8217;s no Gravatar support but what&#8217;s this nonsense about my avatar being <em>approved!?</em> What the flying fuck is going on here?</p>
<p>Then there&#8217;s this lovely tidbit about being forced to choose a whole of three genres of music that I listen to and being forced to choose between a very poor variety of stuff.<a href="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.17.23-PM.png" rel="lightbox[1444]"><img class="aligncenter size-full wp-image-1447" title="Screen shot 2010-09-03 at 1.17.23 PM" src="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.17.23-PM.png" alt="" width="798" height="196" /></a></p>
<p><strong>Fail #2</strong> &#8211; nobody likes more than three genres and certainly nobody listens to Metal, Punk, <a class="zem_slink freebase/en/alternative_rock" title="Alternative rock" rel="wikipedia" href="http://en.wikipedia.org/wiki/Alternative_rock">Alternative Rock</a>, Punk-Rock, Cabaret,  Swing, Folk and so on. Just the top10 chart on <a class="zem_slink freebase/en/last_fm" title="Last.fm" rel="homepage" href="http://Last.fm">last.fm</a> lists stuff from at least 6 different genres, most of them not on this list.</p>
<p>Coming to terms with the uselessness of this profile creation screen I finally clicked &#8220;Continue&#8221; and was greeted with this little ditty:</p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.29.51-PM.png" rel="lightbox[1444]"><img class="aligncenter size-full wp-image-1448" title="Screen shot 2010-09-03 at 1.29.51 PM" src="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.29.51-PM.png" alt="" width="592" height="166" /></a>Sure, alright, I have to allow them to scrobble what I like. This makes sense. But what the hell!? They &#8230; they aren&#8217;t scrobbling what I&#8217;m actually listening to? Just what I&#8217;m &#8230; buying? What the fuck Apple? Don&#8217;t you realise the last time I bought any music was a few years ago and even that was only after I had been a fan of the artist for a few years and only really considered that CD merchandise?</p>
<p>That&#8217;s <strong>Fail #3</strong> right there &#8211; need to buy/rate/review stuff through the iTunes store for Ping to do anything.</p>
<p>And then, then I was greeted by the most hilarious thing ever:</p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.33.27-PM.png" rel="lightbox[1444]"><img class="aligncenter size-full wp-image-1449" title="Screen shot 2010-09-03 at 1.33.27 PM" src="http://swizec.com/blog/wp-content/uploads/2010/09/Screen-shot-2010-09-03-at-1.33.27-PM.png" alt="" width="697" height="247" /></a>Quite obviously they recommended some weird stuff. Ok, granted, I like Linkin Park. Good guess. But Katy Perry? No, good boobs, bad music. <a class="zem_slink freebase/en/lady_gaga" title="Lady Gaga" rel="homepage" href="http://www.ladygaga.com/">Lady GaGa</a>? LoL! And U2? Not really a fan, some songs are good, but meh. And I have no idea who <a class="zem_slink freebase/en/yo-yo_ma" title="Yo-Yo Ma" rel="homepage" href="http://www.yo-yoma.com/">Yo-Yo Ma</a> and Jack Johnson even are.</p>
<p>This is a problem that Ping could easily have solved by syncing with my last.fm account that contains the past 4 years of my listening habits.</p>
<p><strong>Fail #4 </strong>- obviously commercially inspired music recommendations are obviously lametastic.</p>
<p>Ok let&#8217;s try searching for some of my favourite bands so I can, you know, follow them on Ping and hopefully get something useful out of this pile of steaming cow dung.</p>
<p>Cherry Poppin&#8217; Daddies &#8211; nope, not there</p>
<p>The Dresden Dolls &#8211; nope</p>
<p><a class="zem_slink" title="Amanda Palmer" rel="homepage" href="http://amandapalmer.net">Amanda Palmer</a> &#8211; nope, just some fat chick, no sign of my beloved Amanda Palmer</p>
<p>Inkubus Sukkubus &#8211; nope</p>
<p>Voltaire &#8211; nein</p>
<p>Cruxshadows &#8211; negative</p>
<p>Jack Off Jill &#8211; nope</p>
<p>Blink-182 &#8211; halleluya they&#8217;re there, but as a &#8230; user? O.o</p>
<p>Ok now I found someone and &#8230; where the fuck is my search box? Ah ok, it was a few clicks away.</p>
<p>The Doors &#8211; nothing</p>
<p>Dropkick Murphys &#8211; nope</p>
<p>Meh I give up, there is nothing worth following on Ping. The artists I do find are labeled as users and everybody knows it&#8217;s not really them there, it&#8217;s some automated bot thing to keep us notified of their stuff. But none of the artists I&#8217;m actually listening to are there &#8230;</p>
<p><strong>Fail #5</strong> &#8211; Ping is empty. There are no artists or anything of worth following.</p>
<p>I&#8217;m going to give Ping the benefit of the doubt. They&#8217;re just having a bit of a cold start problem and nobody at Apple was smart enough to put at least placeholders for some of the most popular bands/artists of recent decades on there. Even <a class="zem_slink freebase/guid/9202a8c04000641f8000000015b6c79a" title="Marilyn Manson" rel="homepage" href="http://www.marilynmanson.com">Marilyn Manson</a>, Iron Maidden and Offspring aren&#8217;t there &#8230;</p>
<p>Oh and here are some more fails:</p>
<p><strong>Fail #6 </strong>- Everything is locked in iTunes, you can&#8217;t send music to people, can&#8217;t use other players, nothing. It&#8217;s just plain old locked to the single worts music player in the history of music players</p>
<p><strong>Fail #7</strong> &#8211; can only invite via Email, who cares about twitter and facebook where my social network actually is? Yeah, nobody cares about that</p>
<p><strong>Fail #8 </strong>- no integration with anything. at all. Last.fm would make sense, but at least Twitter and Facebook? Anyone? Yeah I didn&#8217;t think so. Who uses that crap huh?</p>
<p><strong>Fail #9</strong> &#8211; oh yeah, there&#8217;s already a <a href="http://ping.fm/" target="_blank">ping.fm</a>, which, coincidentally, is a social network for music that integrates with stuff and works pretty well from what I heard</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=ffb7f017-5402-4e8f-9ce4-f22d785e005b" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/apples-ping-is-a-big-pile-of-steaming-dung/swizec/1444/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>On the buying of new hair and other silly stuff</title>
		<link>http://swizec.com/blog/on-the-buying-of-new-hair-and-other-silly-stuff/swizec/1437</link>
		<comments>http://swizec.com/blog/on-the-buying-of-new-hair-and-other-silly-stuff/swizec/1437#comments</comments>
		<pubDate>Mon, 23 Aug 2010 13:19:21 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[Hair]]></category>
		<category><![CDATA[Hairstyle]]></category>
		<category><![CDATA[Health]]></category>
		<category><![CDATA[Long hair]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1437</guid>
		<description><![CDATA[It&#8217;s not often that I go buy a new set of hair, actually I only do it once every two years or so. I don&#8217;t really mind going, in fact I kind of like the type of pampering my hair can only get at a hair salon. And the girls there are always so nice [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s not often that I go buy a new set of hair, actually I only do it once every two years or so. I don&#8217;t really mind going, in fact I kind of like the type of pampering my hair can only get at a <a class="zem_slink freebase/en/beauty_salon" title="Beauty salon" rel="wikipedia" href="http://en.wikipedia.org/wiki/Beauty_salon">hair salon</a>. And the girls there are always so nice and chatty. It&#8217;s pretty cool.</p>
<p>But I&#8217;m lazy.</p>
<p>And I like longish hair. The good thing about <a class="zem_slink freebase/en/long_hair" title="Long hair" rel="wikipedia" href="http://en.wikipedia.org/wiki/Long_hair">long hair</a> is that it just sort of happens on its own, you don&#8217;t have to really think too much. Once you get used to the mop it doesn&#8217;t even take that long to wash, certainly not as long as some girls will have you think to get out of a date they don&#8217;t want. Nope, nothing like having long hair. Who wants to be forced into going to the hairdresser&#8217;s once a month to keep their &#8216;do just the way they want it?</p>
<p>Pffft.</p>
<p>So anyway, today I went to CityPark because I wanted to try some new hair salon I&#8217;d never been to and the few times I passed this one it looked intriguing enough. Probably because of all the girls of Just The Right Age &#8482; working in there.</p>
<p>First thing I did was step up to a random pillar and take a Before photo:</p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/08/IMG00443.jpg" rel="lightbox[1437]"><img class="aligncenter size-medium wp-image-1438" title="Before" src="http://swizec.com/blog/wp-content/uploads/2010/08/IMG00443-300x225.jpg" alt="" width="300" height="225" /></a>If you look carefully you&#8217;ll see the hair was pretty long. It was actually about two centimeters beyond nipple-length. Definitely time to get a <a class="zem_slink freebase/en/hairstyle" title="Hairstyle" rel="wikipedia" href="http://en.wikipedia.org/wiki/Hairstyle">haircut</a> because making a tail was getting annoying.</p>
<p>The whole salon experience was pretty fun. The lass complained a lot about having to cut so much hair &#8230; apparently it&#8217;s a sin for people who want long hair but can&#8217;t get them to make long hair short &#8230; or something like that. There was also some complaining from the other girls about why they didn&#8217;t get to cut me &#8230; but since I don&#8217;t know what that was about I&#8217;ll just pretend they found me cute and wanted to touch my awesomeness <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Anyway, the hairdresser chick took the After photo and this is what my mop looks like now:</p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/08/IMG00445.jpg" rel="lightbox[1437]"><img class="aligncenter size-medium wp-image-1439" title="After" src="http://swizec.com/blog/wp-content/uploads/2010/08/IMG00445-300x225.jpg" alt="" width="300" height="225" /></a>I actually quite like it. Turned out nice.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=eb95657e-4e29-4b56-a242-9092955a236b" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/on-the-buying-of-new-hair-and-other-silly-stuff/swizec/1437/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The strangestest Hello World I ever made</title>
		<link>http://swizec.com/blog/the-strangestest-hello-world-i-ever-made/swizec/1429</link>
		<comments>http://swizec.com/blog/the-strangestest-hello-world-i-ever-made/swizec/1429#comments</comments>
		<pubDate>Thu, 19 Aug 2010 10:47:16 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Murray]]></category>
		<category><![CDATA[Compiler]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Lisp]]></category>
		<category><![CDATA[Open source]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Programming language]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Turing completeness]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1429</guid>
		<description><![CDATA[



Image by 0k1n via Flickr



Earlier this week while under the influence of being stressed out of my mind being CEO of a startup and watching way too much Sherlock (there are only three episodes, watched every one at least four times) I decided that it was time for a new hobby.
The only requirements for said [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 170px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/48298733@N07/4906662333"><img title="Le Belem" src="http://swizec.com/blog/wp-content/uploads/2010/08/4906662333_7139b3e5cf_m.jpg" alt="Le Belem" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/48298733@N07/4906662333">0k1n</a> via Flickr</dd>
</dl>
</div>
</div>
<p>Earlier this week while under the influence of being stressed out of my mind being CEO of a startup and watching way too much Sherlock (there are only three episodes, watched every one at least four times) I decided that it was time for a new hobby.</p>
<p>The only requirements for said hobby were:</p>
<ul>
<li>mentally very bloody stimulating</li>
<li>doable in polynomic time (rules out things like &#8216;invent cold fusion&#8217;)</li>
<li>learn something new</li>
</ul>
<p>Obviously the only real solution to this problem is designing a new <a class="zem_slink freebase/en/programming_language" title="Programming language" rel="wikipedia" href="http://en.wikipedia.org/wiki/Programming_language">programming language</a> and making a <a class="zem_slink freebase/en/compiler" title="Compiler" rel="wikipedia" href="http://en.wikipedia.org/wiki/Compiler">compiler</a> or <a class="zem_slink freebase/en/interpreter" title="Interpreter (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Interpreter_%28computing%29">interpreter</a> for it. Sure, the other obvious solution is to find a cool opensource project and become an Important Contributor &#8482;. But I&#8217;m gonna do that anyway, contribute code I&#8217;m developing at Preona to opensource projects that is.</p>
<p>No I needed something completely different. Totally unrelated to my daily work and so on. Making a language it was!</p>
<p>Because @skatey reminded me of Monkey Island earlier that day the language is called <a href="http://github.com/Swizec/Murray">Murray</a>.</p>
<p>Murray is a talking demonic skull in Monkey Island.</p>
<p>This led to some interesting design ideas. Since obviously the language needs to be inspired by the demonic talking skull &#8230; so let&#8217;s make the whole thing behave like you&#8217;re talking to the computer rather than programming.</p>
<p>Oh also I wanted it to run on Python and be inspired by <a class="zem_slink freebase/guid/9202a8c04000641f80000000000247bb" title="Lisp (programming language)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Lisp_%28programming_language%29">Lisp</a>, but without parentheses. No parentheses if at all avoidable!</p>
<p>Another big design goal is to eventually write a Murray-to-Python compiler in <a href="http://github.com/Swizec/Murray">Murray</a>. Right now I&#8217;m writing it in Python.</p>
<p>So let&#8217;s recap the primary design goals</p>
<ul>
<li>functional</li>
<li>no parentheses</li>
<li>as akin to talking as possible</li>
<li>can compile itself</li>
<li><a class="zem_slink freebase/en/turing_completeness" title="Turing completeness" rel="wikipedia" href="http://en.wikipedia.org/wiki/Turing_completeness">Turing complete</a></li>
</ul>
<h3 id="thehelloworld">The hello world</h3>
<p>The hello world turns out to be pretty simple.</p>

<div class="wp_syntax"><div class="code"><pre class="murray" style="font-family:monospace;">say &quot;Hello World&quot;</pre></div></div>

<p>Compiles to python and works. And no, no I&#8217;m not just using a regex to replace &#8217;say&#8217; with &#8216;print&#8217;. I actually wrote a parser for this thing.</p>
<p>Everything that sticks together is considered a paragraph of code and will essentially evaluate to a big <a class="zem_slink freebase/en/function_composition" title="Function composition" rel="wikipedia" href="http://en.wikipedia.org/wiki/Function_composition">function composition</a> like so f(g(h(x))). Ok? ok.</p>
<p>So when I write this:</p>

<div class="wp_syntax"><div class="code"><pre class="murray" style="font-family:monospace;">say &quot;hello world&quot; say &quot;meow&quot; say &quot;hai&quot;</pre></div></div>

<p>It compiles into something a bit like so: say( &#8220;hello world&#8221;, say(&#8220;meow&#8221;, say(&#8220;hai&#8221;)))</p>
<p>So the output becomes:</p>
<pre>hai
None meow
None hello world</pre>
<p>Which doesn&#8217;t seem too logical, the None should go on the other side &#8230; I should fix this.</p>
<p>But anyway, the None is there because &#8217;say&#8217; doesn&#8217;t return anything, we can fix the wonky output like this:</p>

<div class="wp_syntax"><div class="code"><pre class="murray" style="font-family:monospace;">say &quot;hello world&quot;. say &quot;meow&quot;. say &quot;hai&quot;</pre></div></div>

<p>What magic buffonery is this!?</p>
<p>Well the dot is another function again and <a href="http://github.com/Swizec/Murray">Murray</a> can understand one-char functions even when they are attached to something else. The dot is a simple function anyway, it sort of &#8216;destroys&#8217; output by returning an empty string so it doesn&#8217;t get in the way later on in the execution stack.</p>
<p>But what about them code paragraphs I mentioned earlier? Well their intended use eventually is to define &#8216;functions&#8217;, but I haven&#8217;t figured this out too much yet. Right now they just do this:</p>

<div class="wp_syntax"><div class="code"><pre class="murray" style="font-family:monospace;">say &quot;meow1&quot;
&nbsp;
say &quot;meow2&quot;</pre></div></div>

<p>This compiles into two distinct function calls so the output is like this:</p>
<pre>meow1
meow2</pre>
<p>Anyway, that&#8217;s all I&#8217;ve got figured out so far. It&#8217;s only been a few days since I started working on this and there&#8217;s a long way still to go. Suggestions very welcome, contributors appreciated, everything is <a class="zem_slink freebase/en/open_source" title="Open Source" rel="wikinvest" href="http://www.wikinvest.com/concept/Open_Source">open source</a> and living on <a href="http://github.com/Swizec/Murray">github</a>. Just fork and ping me about it if you&#8217;re interested <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Oh yeah, this Hello World is strange because it took me writing a compiler and making up a lot of stuff.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://kirkwylie.blogspot.com/2010/08/i-want-new-programming-language.html">I Want A New Programming Language</a> (kirkwylie.blogspot.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.reddit.com/r/programming/comments/280is/is_lisp_secretly_the_worlds_most_popular/">Is Lisp secretly the world&#8217;s most popular programming language? : programming</a> (reddit.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.paulgraham.com/icadmore.html">Re: Revenge of the Nerds</a> (paulgraham.com)</li>
<li class="zemanta-article-ul-li"><a href="http://lambda-the-ultimate.org/node/1646">Lisp sans (((paren-theses ((hell))))) | Lambda the Ultimate</a> (lambda-the-ultimate.org)</li>
<li class="zemanta-article-ul-li"><a href="http://blog.licenser.net/2010/07/08/on-parentheses">lice! : On Parentheses</a> (licenser.net)</li>
<li class="zemanta-article-ul-li"><a href="http://thecleancoder.blogspot.com/2010/08/why-clojure.html">The Clean Coder: Why Clojure?</a> (thecleancoder.blogspot.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.oreillynet.com/onlamp/blog/2005/12/why_lisp_still_hasnt_won.html">Why Lisp Still Hasn&#8217;t Won &#8211; O&#8217;Reilly ONLamp Blog</a> (oreillynet.com)</li>
<li class="zemanta-article-ul-li"><a href="http://ask.metafilter.com/162577/Help-me-find-something-new-to-do-with-my-time">Help me find something new to do with my time</a> (ask.metafilter.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=0f444050-7748-4c28-8a4c-b172081bb171" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/the-strangestest-hello-world-i-ever-made/swizec/1429/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Programatically uploading to blobstore in python</title>
		<link>http://swizec.com/blog/programatically-uploading-to-blobstore-in-python/swizec/1423</link>
		<comments>http://swizec.com/blog/programatically-uploading-to-blobstore-in-python/swizec/1423#comments</comments>
		<pubDate>Tue, 10 Aug 2010 13:52:55 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Application programming interface]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Form (web)]]></category>
		<category><![CDATA[Google AppEngine]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Uploading and downloading]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1423</guid>
		<description><![CDATA[Officially this is something that cannot be done. Or rather that shouldn&#8217;t be done. When you look at the google appengine docs on &#8220;uploading to blobstore&#8221; this is what they have to say:
Blobs are useful for serving large files, such as video or image files, and for allowing users to upload large data files.
To prompt [...]]]></description>
			<content:encoded><![CDATA[<p>Officially this is something that cannot be done. Or rather that shouldn&#8217;t be done. When you look at the <a class="zem_slink freebase/en/google_app_engine" title="Google App Engine" rel="homepage" href="http://code.google.com/appengine/">google appengine</a> docs on &#8220;<a class="zem_slink freebase/en/uploading_and_downloading" title="Uploading and downloading" rel="wikipedia" href="http://en.wikipedia.org/wiki/Uploading_and_downloading">uploading</a> to blobstore&#8221; this is what they have to say:</p>
<blockquote><p>Blobs are useful for serving large files, such as video or image files, and for allowing users to upload large data files.</p>
<p>To prompt a user to upload a Blobstore value, your app presents a <a class="zem_slink freebase/guid/9202a8c04000641f8000000000955540" title="Form (web)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Form_%28web%29">web form</a> with a file upload field.</p></blockquote>
<p>So ok, obviously the official documentation isn&#8217;t of much use here since it only talks about letting users upload files. But I needed something different. I needed to fetch an image from an url (gotten by intricate means, different story) and store it in the blobstore so it could later be served to many users. Obviously since <a class="zem_slink freebase/en/file_system" title="File system" rel="wikipedia" href="http://en.wikipedia.org/wiki/File_system">file access</a> isn&#8217;t permitted on appengine the only choice left was storing the file in the blobstore.</p>
<p>Naturally someone else has had this problem before right?</p>
<p>No. There are no solutions I could find online. None. Nada. Zilch. Niente.</p>
<p>After a few hours of hacking a week or so ago, however, I got it working.</p>
<p>Essentially the solution is to fake a form post to the blobstore url the <a class="zem_slink freebase/guid/9202a8c04000641f80000000163b3ef7" title="Application programming interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Application_programming_interface">API</a> creates. An interesting gotcha is that a redirect happens. Initially I thought I was making the form post right back to my application, but apparently you&#8217;re first posting to the blobstore, then the blobstore posts back to you. For some reason I couldn&#8217;t keep the associated meta-data to go through with the request so there&#8217;s an ugly-ish workaround that happens.</p>
<p>Another thing that&#8217;s important to note for this tutorial/howto is that I am using django-nonrel and that the initial event that starts the process is triggered by appengine&#8217;s task queue.</p>
<h4>The howto</h4>
<p>First, these are all the imports I&#8217;m using, there&#8217;s quite a few, so heh <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">http</span> <span style="color: #ff7700;font-weight:bold;">import</span> HttpResponse, HttpResponseBadRequest, HttpRequest
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">views</span>.<span style="color: black;">decorators</span>.<span style="color: black;">csrf</span> <span style="color: #ff7700;font-weight:bold;">import</span> csrf_exempt
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">conf</span> <span style="color: #ff7700;font-weight:bold;">import</span> settings
<span style="color: #ff7700;font-weight:bold;">from</span> django.<span style="color: black;">core</span>.<span style="color: black;">urlresolvers</span> <span style="color: #ff7700;font-weight:bold;">import</span> reverse
<span style="color: #ff7700;font-weight:bold;">import</span> simplejson <span style="color: #ff7700;font-weight:bold;">as</span> json
<span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">urllib2</span>, <span style="color: #dc143c;">urllib</span>
<span style="color: #ff7700;font-weight:bold;">from</span> <span style="color: #dc143c;">cStringIO</span> <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">StringIO</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">api</span>.<span style="color: black;">urlfetch</span> <span style="color: #ff7700;font-weight:bold;">import</span> ResponseTooLargeError, DownloadError
<span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">ext</span> <span style="color: #ff7700;font-weight:bold;">import</span> blobstore
<span style="color: #ff7700;font-weight:bold;">from</span> google.<span style="color: black;">appengine</span>.<span style="color: black;">api</span> <span style="color: #ff7700;font-weight:bold;">import</span> urlfetch
&nbsp;
<span style="color: #ff7700;font-weight:bold;">from</span> forms <span style="color: #ff7700;font-weight:bold;">import</span> ArticleProcForm
<span style="color: #ff7700;font-weight:bold;">from</span> models <span style="color: #ff7700;font-weight:bold;">import</span> Article
<span style="color: #ff7700;font-weight:bold;">from</span> lib <span style="color: #ff7700;font-weight:bold;">import</span> ImageExtractor
<span style="color: #ff7700;font-weight:bold;">from</span> lib <span style="color: #ff7700;font-weight:bold;">import</span> urllib2_file
<span style="color: #ff7700;font-weight:bold;">from</span> lib.<span style="color: black;">urllib2_file</span> <span style="color: #ff7700;font-weight:bold;">import</span> UploadFile
<span style="color: #ff7700;font-weight:bold;">from</span> lib.<span style="color: black;">decorators</span> <span style="color: #ff7700;font-weight:bold;">import</span> form_valid</pre></div></div>

<p>First thing that you&#8217;re going to need is the function that starts the whole process (in my case this is a django view)</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> ArticleProcForm<span style="color: black;">&#40;</span>forms.<span style="color: black;">Form</span><span style="color: black;">&#41;</span>:
    article = forms.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
&nbsp;
@csrf_exempt
@form_valid<span style="color: black;">&#40;</span>ArticleProcForm, <span style="color: #483d8b;">'POST'</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">def</span> article<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        article = Article.<span style="color: black;">objects</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #008000;">id</span>=request.<span style="color: black;">form</span>.<span style="color: black;">cleaned_data</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'article'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span> Article.<span style="color: black;">DoesNotExist</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span>json.<span style="color: black;">dumps</span><span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'status'</span>: <span style="color: #483d8b;">'Bad Article'</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">try</span>:
        image_url = ImageExtractor.<span style="color: black;">getImages</span><span style="color: black;">&#40;</span>article.<span style="color: black;">url</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'url'</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">IndexError</span>:
        <span style="color: #ff7700;font-weight:bold;">pass</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #808080; font-style: italic;"># important bit</span>
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            image = <span style="color: #dc143c;">StringIO</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">urllib2</span>.<span style="color: black;">urlopen</span><span style="color: black;">&#40;</span>image_url<span style="color: black;">&#41;</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: black;">&#40;</span><span style="color: #dc143c;">urllib2</span>.<span style="color: black;">HTTPError</span>, DownloadError<span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">pass</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            image = UploadFile<span style="color: black;">&#40;</span>image, <span style="color: #483d8b;">'.'</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span><span style="color: #008000;">str</span><span style="color: black;">&#40;</span>article.<span style="color: #008000;">id</span><span style="color: black;">&#41;</span>, image_url.<span style="color: black;">rsplit</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'.'</span>, <span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#93;</span><span style="color: black;">&#91;</span>:<span style="color: #ff4500;">4</span><span style="color: black;">&#93;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
            upload_url = blobstore.<span style="color: black;">create_upload_url</span><span style="color: black;">&#40;</span>reverse<span style="color: black;">&#40;</span><span style="color: #483d8b;">'Articles.views.upload'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #ff7700;font-weight:bold;">try</span>:
                <span style="color: #dc143c;">urllib2</span>.<span style="color: black;">urlopen</span><span style="color: black;">&#40;</span>upload_url, <span style="color: black;">&#123;</span><span style="color: #483d8b;">'file'</span>: image<span style="color: black;">&#125;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: black;">&#40;</span>DownloadError, RequestTooLargeError<span style="color: black;">&#41;</span>:
                <span style="color: #ff7700;font-weight:bold;">pass</span>
        <span style="color: #808080; font-style: italic;"># end of important bit</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span>json.<span style="color: black;">dumps</span><span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'status'</span>: <span style="color: #483d8b;">'OK'</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Here is basically what happens in the important bit:</p>
<ol>
<li>Download image from url and change it to a StringIO</li>
<li>Make an UploadFile (basically a bundle of <a class="zem_slink freebase/en/string" title="String (computer science)" rel="wikipedia" href="http://en.wikipedia.org/wiki/String_%28computer_science%29">byte-string</a>-data and desired filename)</li>
<li>Create an upload_url with the blobstore API</li>
<li>Fake a file-upload form post</li>
</ol>
<p>The next thing we need is a view that will handle the request the blobstore will send back to our app.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;">@csrf_exempt
<span style="color: #ff7700;font-weight:bold;">def</span> upload<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">if</span> request.<span style="color: black;">method</span> == <span style="color: #483d8b;">'POST'</span>:
        blobs = get_uploads<span style="color: black;">&#40;</span>request, field_name=<span style="color: #483d8b;">'file'</span>, populate_post=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
&nbsp;
        article = Article.<span style="color: black;">objects</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #008000;">id</span>=<span style="color: #008000;">int</span><span style="color: black;">&#40;</span>blobs<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: black;">filename</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'.'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        article.<span style="color: black;">media</span> = blobs<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: black;">filename</span>
        article.<span style="color: black;">parsed</span> = <span style="color: #008000;">True</span>
        article.<span style="color: black;">save</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponseRedirect<span style="color: black;">&#40;</span>reverse<span style="color: black;">&#40;</span><span style="color: #483d8b;">'Articles.views.upload'</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span><span style="color: #483d8b;">'meow'</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Basically it extracts the article&#8217;s id from the filename (the only way I could make work to pass that information) and stores some changes into the datastore. You&#8217;ll notice that I&#8217;m basically just storing the article&#8217;s id again in another field, this is to preserve knowledge of the file extension. It&#8217;s also important to note that the blobstore requires a redirect response upon success, otherwise it will throw an error.</p>
<p>Here is the get_uploads function I found online somewhere.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> get_uploads<span style="color: black;">&#40;</span>request, field_name=<span style="color: #008000;">None</span>, populate_post=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>:
    <span style="color: #483d8b;">&quot;&quot;&quot;Get uploads sent to this handler.
    Args:
      field_name: Only select uploads that were sent as a specific field.
      populate_post: Add the non blob fields to request.POST
    Returns:
      A list of BlobInfo records corresponding to each upload.
      Empty list if there are no blob-info records for field_name.
    &quot;&quot;&quot;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">hasattr</span><span style="color: black;">&#40;</span>request,<span style="color: #483d8b;">'__uploads'</span><span style="color: black;">&#41;</span> == <span style="color: #008000;">False</span>:
        request.<span style="color: black;">META</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'wsgi.input'</span><span style="color: black;">&#93;</span>.<span style="color: black;">seek</span><span style="color: black;">&#40;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#41;</span>
        fields = <span style="color: #dc143c;">cgi</span>.<span style="color: black;">FieldStorage</span><span style="color: black;">&#40;</span>request.<span style="color: black;">META</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'wsgi.input'</span><span style="color: black;">&#93;</span>, environ=request.<span style="color: black;">META</span><span style="color: black;">&#41;</span>
&nbsp;
        request.__uploads = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> populate_post:
            request.<span style="color: black;">POST</span> = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">for</span> key <span style="color: #ff7700;font-weight:bold;">in</span> fields.<span style="color: black;">keys</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
            field = fields<span style="color: black;">&#91;</span>key<span style="color: black;">&#93;</span>
            <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">isinstance</span><span style="color: black;">&#40;</span>field, <span style="color: #dc143c;">cgi</span>.<span style="color: black;">FieldStorage</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">and</span> <span style="color: #483d8b;">'blob-key'</span> <span style="color: #ff7700;font-weight:bold;">in</span> field.<span style="color: black;">type_options</span>:
                request.__uploads.<span style="color: black;">setdefault</span><span style="color: black;">&#40;</span>key, <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>.<span style="color: black;">append</span><span style="color: black;">&#40;</span>blobstore.<span style="color: black;">parse_blob_info</span><span style="color: black;">&#40;</span>field<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">elif</span> populate_post:
                request.<span style="color: black;">POST</span><span style="color: black;">&#91;</span>key<span style="color: black;">&#93;</span> = field.<span style="color: black;">value</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> field_name:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">list</span><span style="color: black;">&#40;</span>request.__uploads<span style="color: black;">&#91;</span>field_name<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">KeyError</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
        results = <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> uploads <span style="color: #ff7700;font-weight:bold;">in</span> request.__uploads.<span style="color: black;">itervalues</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
            results += uploads
        <span style="color: #ff7700;font-weight:bold;">return</span> results</pre></div></div>

<p>Now the process of serving this blob to the browser is very simple and goes something like this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> ImageForm<span style="color: black;">&#40;</span>forms.<span style="color: black;">Form</span><span style="color: black;">&#41;</span>:
    <span style="color: #008000;">id</span> = forms.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
&nbsp;
@form_valid<span style="color: black;">&#40;</span>ImageForm, <span style="color: #483d8b;">'GET'</span><span style="color: black;">&#41;</span>
@cache_response
<span style="color: #ff7700;font-weight:bold;">def</span> image<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
    blob = BlobInfo.<span style="color: black;">gql</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;WHERE filename='%s' LIMIT 1&quot;</span> <span style="color: #66cc66;">%</span> request.<span style="color: black;">form</span>.<span style="color: black;">cleaned_data</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'id'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span>BlobReader<span style="color: black;">&#40;</span>blob.<span style="color: black;">key</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>,
                        content_type=blob.<span style="color: black;">content_type</span><span style="color: black;">&#41;</span></pre></div></div>

<h4>One final note</h4>
<p>And one VERY important final note. The vanilla urllib2 library can&#8217;t handle file uploads, so I found one online that can. It&#8217;s called <a href="http://fabien.seisen.org/python/urllib2_file/">urllib2_file</a>.</p>
<p>However it doesn&#8217;t quite work on google appengine. For example it can&#8217;t handle being told what you want the filename to be and some other details because it relies on raw file access. So I changed it a little bit, unfortunately I don&#8217;t quite know how to upstream my changes so I&#8217;m hosting it on github.</p>
<p>You can get it <a href="http://github.com/Swizec/urllib2_file">at github</a>, feel free to contribute.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://blog.notdot.net/2010/08/Using-BlobReader-wildcard-subdomains-and-webapp2">Using BlobReader, wildcard subdomains and webapp2 on Google AppEngine</a> (notdot.net)</li>
<li class="zemanta-article-ul-li"><a href="http://swizec.com/blog/django-protip-2-forms-are-awesome/swizec/1410">Django protip #2: Forms are awesome</a> (swizec.com)</li>
<li class="zemanta-article-ul-li"><a href="http://googleappengine.blogspot.com/2010/06/app-engine-sdk-135-released-with-new.html">App Engine SDK 1.3.5 Released With New Task Queue, Python Precompilation, and Blob Features</a> (googleappengine.blogspot.com)</li>
<li class="zemanta-article-ul-li"><a href="http://debuggable.com/posts/parsing-file-uploads-at-500-mb-s-with-node-js:4c03862e-351c-4faa-bb67-4365cbdd56cb">Parsing file uploads at 500 mb/s with node.js</a> (debuggable.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=82ae7610-8dea-47af-9e81-485f91ffacd6" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/programatically-uploading-to-blobstore-in-python/swizec/1423/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Django protip #2: Forms are awesome</title>
		<link>http://swizec.com/blog/django-protip-2-forms-are-awesome/swizec/1410</link>
		<comments>http://swizec.com/blog/django-protip-2-forms-are-awesome/swizec/1410#comments</comments>
		<pubDate>Tue, 03 Aug 2010 08:50:29 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Django Protip]]></category>
		<category><![CDATA[Application programming interface]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Login]]></category>
		<category><![CDATA[RSS]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Website]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1410</guid>
		<description><![CDATA[



Image by warrenski via Flickr



Welcome to another installment of Swizec&#8217;s Django protip. Previously we discussed a better way to structure your django apps, but nobody cared about that because everybody is rather silly. This time we&#8217;ll be talking about how awesome forms are and why you should be using them for pretty much everything. At [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 170px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/50811886@N00/2686845422"><img title="Moss" src="http://swizec.com/blog/wp-content/uploads/2010/08/2686845422_d924cc453e_m.jpg" alt="Moss" width="160" height="240" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/50811886@N00/2686845422">warrenski</a> via Flickr</dd>
</dl>
</div>
</div>
<p>Welcome to another installment of Swizec&#8217;s <a class="zem_slink freebase/en/django_web_framework" title="Django (web framework)" rel="homepage" href="http://www.djangoproject.com">Django</a> protip. Previously we discussed a better way to <a href="http://swizec.com/blog/django-protip-1-a-better-app-structure/swizec/1386">structure your django apps</a>, but nobody cared about that because everybody is rather silly. This time we&#8217;ll be talking about how awesome forms are and why you should be using them for pretty much everything. At the end, I&#8217;ll show you some neat <a class="zem_slink freebase/en/tips_tricks" title="Tips &amp; Tricks" rel="wikipedia" href="http://en.wikipedia.org/wiki/Tips_%26_Tricks">tips and tricks</a> I discovered during my Django Epiphany.</p>
<h3>Why forms</h3>
<p>When you look at code a lot of web developers produce (and yes, even I did it plenty of times back in the day) you will notice a lot of work goes into retrieving data from GET and POST parameters. Now despite most developers simply ignoring GET parameters as anything really special or dangerous and just handling them as if they were regular variables, because hey, what could go wrong about retrieving a page number right? At best you&#8217;ll see code having a bunch of lines sort of like this:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$page</span> <span style="color: #339933;">=</span> <span style="color: #009900;">&#40;</span><span style="color: #990000;">isset</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> ? <span style="color: #990000;">intval</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'page'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></pre></div></div>

<p>Anyone notice a security flaw? Then think of this, what happens if the page is set to -1? Sure, if errors aren&#8217;t being displayed right to the user nothing too important. But if they get shown an <a class="zem_slink freebase/en/sql" title="SQL" rel="wikipedia" href="http://en.wikipedia.org/wiki/SQL">SQL</a> error &#8230; or worse &#8230;</p>
<p>However people are usually at least a little bit more careful about POST data because they realise that hey, this is something a person filled in a <a class="zem_slink freebase/guid/9202a8c04000641f8000000000955540" title="Form (web)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Form_%28web%29">web form</a> and perhaps the data should go through a series of a little bit more stringent tests before it gets chucked into the <a class="zem_slink freebase/en/database" title="Database" rel="wikipedia" href="http://en.wikipedia.org/wiki/Database">database</a>. Hell, maybe we could even tell the user where they screwed up and if the planets are in constelation, why not also make sure those required fields are actually filled out &#8230; you know, so we don&#8217;t get any weird inconsistencies in our database.</p>
<p>But still, it&#8217;s a lot of work to do all of that by hand every god damn time. If only there were something easier, more transparent and plain old automagical &#8230;</p>
<h3>Cue Django Forms</h3>
<p>In django, all of this comes automagically. There is this thing called a &#8220;form&#8221;, which basically lets you define what parameters a request needs, be it GET or POST based, what they should validate against and most importantly, what&#8217;s required and what is not.</p>
<p>If you&#8217;re into that sort of stuff you even get building the form in a html, so the users can use it, completely for free and magically with all the required &#8220;Hey bozo, you filled so and so field wrong. Fix it!&#8221;. For every field! Magic.</p>
<p>But since most of my time is spent on developing <a class="zem_slink freebase/guid/9202a8c04000641f80000000163b3ef7" title="Application programming interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Application_programming_interface">API</a>&#8217;s rather than user-facing <a class="zem_slink freebase/en/website" title="Website" rel="wikipedia" href="http://en.wikipedia.org/wiki/Website">websites</a> let me show you how to use forms effectively in that sort of environment. For the html stuff just go check out the <a href="http://docs.djangoproject.com/en/dev/topics/forms/" target="_blank">django form docs</a>.</p>
<p>The basic use of forms goes a little bit like this (hopefully your forms are in a separate file from your views, this is just an example <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> )</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">from</span> django <span style="color: #ff7700;font-weight:bold;">import</span> forms
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> ListForm<span style="color: black;">&#40;</span>forms.<span style="color: black;">Form</span><span style="color: black;">&#41;</span>:
    feed = forms.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    category = forms.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    since = forms.<span style="color: black;">DateTimeField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    count = forms.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    page = forms.<span style="color: black;">IntegerField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
    include_content = forms.<span style="color: black;">BooleanField</span><span style="color: black;">&#40;</span>required=<span style="color: #008000;">False</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #008000;">list</span><span style="color: black;">&#40;</span>request, format=<span style="color: #483d8b;">'json'</span><span style="color: black;">&#41;</span>:
    form = ListForm<span style="color: black;">&#40;</span>request.<span style="color: #dc143c;">user</span>, request.<span style="color: black;">GET</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> form.<span style="color: black;">is_valid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
       articles = Article.<span style="color: black;">objects</span>.<span style="color: #008000;">filter</span><span style="color: black;">&#40;</span>feed__in=form.<span style="color: black;">cleaned_data</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'feeds'</span><span style="color: black;">&#93;</span>
                                                  <span style="color: black;">&#41;</span>.<span style="color: black;">order_by</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'-time'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span>page<span style="color: #66cc66;">*</span>count:page<span style="color: #66cc66;">*</span>count+count<span style="color: black;">&#93;</span>
       <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span>json.<span style="color: black;">dumps</span><span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'status'</span>: <span style="color: #483d8b;">'OK'</span>,
                                        <span style="color: #483d8b;">'count'</span>: <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>articles<span style="color: black;">&#41;</span>,
                                        <span style="color: #483d8b;">'articles'</span>: articles<span style="color: black;">&#125;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">else</span>:
	<span style="color: #ff7700;font-weight:bold;">return</span> HttpResponseBadRequest<span style="color: black;">&#40;</span>json.<span style="color: black;">dumps</span><span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'status'</span>: <span style="color: #483d8b;">'ERROR'</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Well something along those lines anyhow. What you can see is that I basically define a form and check that it&#8217;s valid. Once I know it&#8217;s valid I can go on using its cleaned_data without much regard for anything.</p>
<h3>Some tips&amp;tricks</h3>
<p>And now let&#8217;s get onto some tips&amp;tricks <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>First thing you&#8217;ll notice once you start using forms like you properly should is that all of your views follow this pattern: get form; validate form; do something; or do something else;</p>
<p>So I wrote up a descriptor for that, now I can be certain that when I&#8217;m in my view the form is valid and I can use the data.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> form_valid<span style="color: black;">&#40;</span>form_type, data_type<span style="color: black;">&#41;</span>:
    <span style="color: #ff7700;font-weight:bold;">def</span> inner<span style="color: black;">&#40;</span>view_func<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">def</span> wrapper<span style="color: black;">&#40;</span>request, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
            form = form_type<span style="color: black;">&#40;</span>request.<span style="color: #0000cd;">__getattribute__</span><span style="color: black;">&#40;</span>data_type<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
            <span style="color: #ff7700;font-weight:bold;">if</span> form.<span style="color: black;">is_valid</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
                request.<span style="color: black;">form</span> = form
                <span style="color: #ff7700;font-weight:bold;">return</span> view_func<span style="color: black;">&#40;</span>request, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
            <span style="color: #ff7700;font-weight:bold;">else</span>:
                <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponseBadRequest<span style="color: black;">&#40;</span>json.<span style="color: black;">dumps</span><span style="color: black;">&#40;</span><span style="color: black;">&#123;</span><span style="color: #483d8b;">'status'</span>: <span style="color: #483d8b;">'ERROR'</span><span style="color: black;">&#125;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> wraps<span style="color: black;">&#40;</span>view_func<span style="color: black;">&#41;</span><span style="color: black;">&#40;</span>wrapper<span style="color: black;">&#41;</span>
    <span style="color: #ff7700;font-weight:bold;">return</span> inner
&nbsp;
<span style="color: #808080; font-style: italic;">## the usage goes like so</span>
@form_valid<span style="color: black;">&#40;</span>ImageForm, <span style="color: #483d8b;">'GET'</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">def</span> image<span style="color: black;">&#40;</span>request<span style="color: black;">&#41;</span>:
    blob = BlobInfo.<span style="color: black;">gql</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;WHERE filename='%s' LIMIT 1&quot;</span> <span style="color: #66cc66;">%</span> request.<span style="color: black;">form</span>.<span style="color: black;">cleaned_data</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'id'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">return</span> HttpResponse<span style="color: black;">&#40;</span>BlobReader<span style="color: black;">&#40;</span>blob.<span style="color: black;">key</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>.<span style="color: black;">read</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>,
                        content_type=blob.<span style="color: black;">content_type</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Using the decorator thus makes for much much cleaner code.</p>
<p>Now let&#8217;s look at some magic done with custom clean functions inside forms <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">## this enables us to handle &lt;a class=&quot;zem_slink freebase/en/comma-separated_values&quot; title=&quot;Comma-separated values&quot; rel=&quot;wikipedia&quot; href=&quot;http://en.wikipedia.org/wiki/Comma-separated_values&quot;&gt;comma separated values&lt;/a&gt; seamlessly</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> clean_feed<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            feed = <span style="color: black;">&#91;</span><span style="color: #008000;">int</span><span style="color: black;">&#40;</span><span style="color: #008000;">id</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> <span style="color: #008000;">id</span> <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">str</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">cleaned_data</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'feed'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">','</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: black;">&#40;</span><span style="color: #008000;">AttributeError</span>, <span style="color: #008000;">ValueError</span>, <span style="color: #008000;">KeyError</span><span style="color: black;">&#41;</span>:
            feed = <span style="color: #008000;">None</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> feed
&nbsp;
<span style="color: #808080; font-style: italic;">## automagically parsing json parameters can be done too</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> clean_feeds<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        feeds = json.<span style="color: black;">loads</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">cleaned_data</span><span style="color: black;">&#91;</span><span style="color: #483d8b;">'feeds'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">type</span><span style="color: black;">&#40;</span>feeds<span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #008000;">list</span>:
            <span style="color: #ff7700;font-weight:bold;">raise</span> forms.<span style="color: black;">ValidationError</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;list of feeds expected&quot;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> feeds
&nbsp;
<span style="color: #808080; font-style: italic;">## or how about logging in the user while we're checking the user/pass is correct</span>
<span style="color: #808080; font-style: italic;">## don't manually log in users unless you know at least somewhat what you're doing, usually django handles this</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> clean<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        cleaned_data = <span style="color: #008000;">self</span>.<span style="color: black;">cleaned_data</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">errors</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #ff4500;">0</span>:
            <span style="color: #ff7700;font-weight:bold;">return</span> cleaned_data
&nbsp;
        <span style="color: #dc143c;">user</span> = authenticate<span style="color: black;">&#40;</span>username=cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'email'</span><span style="color: black;">&#93;</span>,
                            password=cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'password'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #dc143c;">user</span> <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span>:
            <span style="color: #ff7700;font-weight:bold;">del</span> cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'email'</span><span style="color: black;">&#93;</span>
            <span style="color: #ff7700;font-weight:bold;">del</span> cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'password'</span><span style="color: black;">&#93;</span>
            <span style="color: #ff7700;font-weight:bold;">raise</span> forms.<span style="color: black;">ValidationError</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'Bad login'</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'user'</span><span style="color: black;">&#93;</span> = <span style="color: #dc143c;">user</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">return</span> cleaned_data
&nbsp;
<span style="color: #808080; font-style: italic;">## now the strangest thing, when you have to handle grabbing data by different parameters</span>
<span style="color: #808080; font-style: italic;">##(like being given a set of feed ids, or a feed category id, you can do this by returning</span>
<span style="color: #808080; font-style: italic;">## a QuerySet in the form's cleaned_data</span>
<span style="color: #ff7700;font-weight:bold;">def</span> clean<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        cleaned_data = <span style="color: #008000;">self</span>.<span style="color: black;">cleaned_data</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #ff7700;font-weight:bold;">not</span> <span style="color: black;">&#40;</span>cleaned_data.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'feed'</span>, <span style="color: #008000;">None</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #008000;">None</span> <span style="color: #ff7700;font-weight:bold;">or</span> cleaned_data.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'category'</span>, <span style="color: #008000;">None</span><span style="color: black;">&#41;</span> <span style="color: #66cc66;">!</span>= <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
            <span style="color: #ff7700;font-weight:bold;">raise</span> forms.<span style="color: black;">ValidationError</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;feed or category required&quot;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'feed'</span><span style="color: black;">&#93;</span> <span style="color: #66cc66;">!</span>= <span style="color: #008000;">None</span>:
            user_feeds = UserFeed.<span style="color: black;">objects</span>.<span style="color: #008000;">filter</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">user</span>=<span style="color: #008000;">self</span>.<span style="color: #dc143c;">user</span>,
                                                 id__in=cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'feed'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">else</span>:
            user_feeds = UserFeed.<span style="color: black;">objects</span>.<span style="color: #008000;">filter</span><span style="color: black;">&#40;</span><span style="color: #dc143c;">user</span>=<span style="color: #008000;">self</span>.<span style="color: #dc143c;">user</span>,
                                                 categories__contains=<span style="color: #483d8b;">&quot;'%d'&quot;</span> <span style="color: #66cc66;">%</span> cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'category'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
        cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'feeds'</span><span style="color: black;">&#93;</span> = <span style="color: #008000;">map</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> f: f.<span style="color: #008000;">id</span>,
                                    Feed.<span style="color: black;">objects</span>.<span style="color: #008000;">filter</span><span style="color: black;">&#40;</span>id__in=<span style="color: #008000;">map</span><span style="color: black;">&#40;</span><span style="color: #ff7700;font-weight:bold;">lambda</span> f: f.<span style="color: black;">feed</span>, user_feeds<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
        reverse_feeds = <span style="color: black;">&#123;</span><span style="color: black;">&#125;</span>
        <span style="color: #ff7700;font-weight:bold;">for</span> feed <span style="color: #ff7700;font-weight:bold;">in</span> user_feeds:
            reverse_feeds<span style="color: black;">&#91;</span>feed.<span style="color: black;">feed</span><span style="color: black;">&#93;</span> = feed.<span style="color: #008000;">id</span>
        cleaned_data<span style="color: black;">&#91;</span><span style="color: #483d8b;">'reverse_feeds'</span><span style="color: black;">&#93;</span> = reverse_feeds
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">return</span> cleaned_data</pre></div></div>

<h3>Conclusion</h3>
<p>Anyhow, that&#8217;s it as far as forms are concerned. Do sound off in the comments or on twitter if I fucked up somewhere. I know geeks like to argue. Come back next week when I&#8217;ll be talking about different magical things you can do with decorators and why they are uber awesome to use in django (or well any other type of python development really)</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://swizec.com/blog/django-protip-1-a-better-app-structure/swizec/1386">Django protip #1: A better App structure</a> (swizec.com)</li>
<li class="zemanta-article-ul-li"><a href="http://swizec.com/blog/small-trick-for-seamless-base64-password-storage-in-django/swizec/1378">Small trick for seamless base64 password storage in django</a> (swizec.com)</li>
<li class="zemanta-article-ul-li"><a href="http://tidbids.posterous.com/saas-with-django-and-postgresql">Django and SaaS</a> (tidbids.posterous.com)</li>
<li class="zemanta-article-ul-li"><a href="http://almirkaric.com/2010/5/2/things-i-hate-in-django/">Things i hate in django</a> (almirkaric.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=c1b237d5-fb11-4a02-a61d-ebecc9071b07" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/django-protip-2-forms-are-awesome/swizec/1410/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>The mountains are beautiful magnificent beasts</title>
		<link>http://swizec.com/blog/the-mountains-are-beautiful-magnificent-beasts/swizec/1401</link>
		<comments>http://swizec.com/blog/the-mountains-are-beautiful-magnificent-beasts/swizec/1401#comments</comments>
		<pubDate>Mon, 26 Jul 2010 08:39:18 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hiking]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Mountain]]></category>
		<category><![CDATA[Outdoors]]></category>
		<category><![CDATA[Recreation]]></category>
		<category><![CDATA[Tourism]]></category>
		<category><![CDATA[Trail]]></category>
		<category><![CDATA[travel]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1401</guid>
		<description><![CDATA[Yesterday I finally managed to take that hiking trip I&#8217;ve been meaning to for months.
And it was fucking awesome!
We went to something called Vodotocno jezero &#8211; a small mountain puddle really. But it was beautiful anyway. The trip started off with a long and bloody awesome drive. I like driving around tight gravel curves and [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I finally managed to take that <a class="zem_slink freebase/en/hiking" title="Hiking" rel="wikipedia" href="http://en.wikipedia.org/wiki/Hiking">hiking</a> trip I&#8217;ve been meaning to for months.</p>
<p>And it was fucking awesome!</p>
<p>We went to something called <a href="http://www.hribi.net/gora/vodotocno_jezero_veza/3/288" target="_blank">Vodotocno jezero</a> &#8211; a small <a class="zem_slink freebase/en/mountain" title="Mountain" rel="wikipedia" href="http://en.wikipedia.org/wiki/Mountain">mountain</a> puddle really. But it was beautiful anyway. The trip started off with a long and bloody awesome drive. I like driving around tight <a class="zem_slink freebase/en/gravel" title="Gravel" rel="wikipedia" href="http://en.wikipedia.org/wiki/Gravel">gravel</a> curves and making the car drift without using the handbrake. <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>When we got to the starting point it was hellishly cold. Probably less than 10C. Luckily for Girlfriend the backpack I was carrying contained some forgotten gloves. After a short wall some really lovely views opened up from a small and funny shepherd&#8217;s cottage thingy.</p>
<p>Then the real hike began. First there was a little steepness through a bit of a forest and after that a very nice and unsteep path across some hillsides with such a magnificently awesome view I almost shat my pants.</p>
<p>But the real fun began once we got off the marked <a class="zem_slink freebase/guid/9202a8c04000641f800000000007cc03" title="Trail" rel="wikipedia" href="http://en.wikipedia.org/wiki/Trail">trails</a> and just winged it across the terrain. Some grass here, a <a class="zem_slink freebase/en/rock_music" title="Rock music" rel="wikipedia" href="http://en.wikipedia.org/wiki/Rock_music">rock</a> there and those weird short <a class="zem_slink freebase/en/pine" title="Pine" rel="wikipedia" href="http://en.wikipedia.org/wiki/Pine">pine</a> things that grow up in the high mountains because trees can&#8217;t. Sure we almost got lost once we were near the saddle between to summits and we couldn&#8217;t quite discern where it was anymore but meh.</p>
<p>Eventually the view onto the small puddle and cottage next to it opened up and it was plain sailing therefrom. Well no, no it was not. Girlfriend twisted her ankle and what was supposed to be the final ten minutes before reaching the destination turned into a thirty minute painful weirdness. Turns out hoping rock to loose rock on a steep steep hill with a twisted ankle isn&#8217;t at all an easy task.</p>
<p>The trip back was even cunner. Took us something like three hours getting back to the car and we got a little bit lost so we took a nicely more dangerous path to get down than w did for getting up. Hoorah!</p>
<p>But hey, fuck it. I&#8217;m just incredibly choked that the <a class="zem_slink freebase/en/global_positioning_system" title="Global Positioning System" rel="wikipedia" href="http://en.wikipedia.org/wiki/Global_Positioning_System">GPS</a> data later showed that saddle was 2004 meters high and I don&#8217;t think I&#8217;ve ever walked anywhere near that high before. Was awesome!</p>
<p>Therefore, some pics.</p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_FFB489E9-7FD2-4E9D-8A75-7F69964878DD.jpeg" rel="lightbox[1401]"><img class="alignnone size-full" src="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_FFB489E9-7FD2-4E9D-8A75-7F69964878DD.jpeg" alt="" /></a></p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_6D6880BA-1CB1-4A8C-ADAF-405C28C592AC.jpeg" rel="lightbox[1401]"><img class="alignnone size-full" src="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_6D6880BA-1CB1-4A8C-ADAF-405C28C592AC.jpeg" alt="" /></a></p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_9A770133-F516-473B-AD52-122F6D3451F4.jpeg" rel="lightbox[1401]"><img class="alignnone size-full" src="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_9A770133-F516-473B-AD52-122F6D3451F4.jpeg" alt="" /></a></p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_77873199-4A7A-4FA5-AAD0-17FBE163B039.jpeg" rel="lightbox[1401]"><img class="alignnone size-full" src="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_77873199-4A7A-4FA5-AAD0-17FBE163B039.jpeg" alt="" /></a></p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_F77F4C04-C5E3-461E-9969-EBDED8BEC833.jpeg" rel="lightbox[1401]"><img class="alignnone size-full" src="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_F77F4C04-C5E3-461E-9969-EBDED8BEC833.jpeg" alt="" /></a></p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_15167C8F-D294-4688-8C00-44F8AF9B84A2.jpeg" rel="lightbox[1401]"><img class="alignnone size-full" src="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_15167C8F-D294-4688-8C00-44F8AF9B84A2.jpeg" alt="" /></a></p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_4A52AA59-5C29-4ABD-B0B6-01F57F9736ED.jpeg" rel="lightbox[1401]"><img class="alignnone size-full" src="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_4A52AA59-5C29-4ABD-B0B6-01F57F9736ED.jpeg" alt="" /></a></p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_12ABBB3A-7507-4E33-96FD-6DFFAB675883.jpeg" rel="lightbox[1401]"><img class="alignnone size-full" src="http://swizec.com/blog/wp-content/uploads/2010/07/l_2044_1536_12ABBB3A-7507-4E33-96FD-6DFFAB675883.jpeg" alt="" /></a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=5288279a-04df-4383-ba01-69b7586c769d" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/the-mountains-are-beautiful-magnificent-beasts/swizec/1401/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Django protip #1: A better App structure</title>
		<link>http://swizec.com/blog/django-protip-1-a-better-app-structure/swizec/1386</link>
		<comments>http://swizec.com/blog/django-protip-1-a-better-app-structure/swizec/1386#comments</comments>
		<pubDate>Wed, 21 Jul 2010 11:42:36 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Django Protip]]></category>
		<category><![CDATA[Application programming interface]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Web Frameworks]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1386</guid>
		<description><![CDATA[



Image via Wikipedia



When I started coding for our latest project at Preona a bit of an epiphany happened. I suddenly got django. Every pattern that used to feel a bit strange and I may have fought a little, suddenly became obvious and simple. Suddenly out of the blue my whole codebase is so marvelously organised [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/File:Derfflinger%27s_crow%27s_nest.JPG" rel="lightbox[1386]"><img title="Crow's nest of SMS Derfflinger" src="http://swizec.com/blog/wp-content/uploads/2010/07/300px-Derfflinger%27s_crow%27s_nest.jpg" alt="Crow's nest of SMS Derfflinger" width="300" height="429" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/File:Derfflinger%27s_crow%27s_nest.JPG" rel="lightbox[1386]">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>When I started coding for our latest project at Preona a bit of an epiphany happened. I suddenly <em>got</em> django. Every pattern that used to feel a bit strange and I may have fought a little, suddenly became obvious and simple. Suddenly out of the blue my whole <a class="zem_slink freebase/en/codebase" title="Codebase" rel="wikipedia" href="http://en.wikipedia.org/wiki/Codebase">codebase</a> is so marvelously organised and separated into files it brings a tear to my eye.</p>
<p>In the old days the average <a class="zem_slink freebase/en/django_web_framework" title="Django (web framework)" rel="homepage" href="http://www.djangoproject.com">Django</a> App in my project had a structure a file structure a bit like so:</p>
<ul>
<li>models.py</li>
<li>views.py</li>
<li>tests.py</li>
<li>RandomActualWorkLogic.py</li>
<li>AnotherRandomOfWork.py</li>
<li>&#8230;</li>
</ul>
<p>Sure this works quite alright, but it feels a little weird and after way too much work you suddenly realise that instead of the clean design you envisioned as you started out, you&#8217;re left with a <a class="zem_slink freebase/guid/9202a8c04000641f8000000000586299" title="Crow's nest" rel="wikipedia" href="http://en.wikipedia.org/wiki/Crow%27s_nest">crow&#8217;s nest</a> of interdependancy, circular crappery and your project is in pretty miserable shape.</p>
<p>This point was really driven home when I figured two different django projects should share some code. Extrapolating a clean interface and making stuff work &#8230; was a nightmare. I actually gave up after a week and decided to start afresh.</p>
<p>And boy, was that the best decision ever!</p>
<h2>Better <a class="zem_slink freebase/en/application_software" title="Application software" rel="wikipedia" href="http://en.wikipedia.org/wiki/Application_software">application</a> structure</h2>
<p>The first step was to take up a better way to organise my codebase inside applications. It goes something like this:</p>
<ul>
<li>models.py</li>
<li>managers.py</li>
<li>views.py</li>
<li>tests.py</li>
<li>forms.py</li>
<li>decorators.py</li>
<li>processing.py &#8212; <em>(this is for certain special views)</em></li>
<li>urls.py</li>
<li>settings.py</li>
</ul>
<p>The first result of this organisation is that now everything has its own place. There are no StrangeWorker.py crappy things anymore. All of those reside in a special &#8216;application&#8217; just for those called a <em>lib. </em>Whenever you are making something and are looking for a place to put it -&gt; the file is an obvious pick!</p>
<p>Another great result is that it&#8217;s now much easier to keep applications contained within themselves. Because both its specific url config and its specific settings config are contained within the application you can easily switch it around between projects or even make it a standalone thingy that projects can simply include.</p>
<p>Also because the file structure makes sense now and all those WeirdoWorker.py are separated elsewhere as proper libraries, there is less of a temptation to create mixed and confusing dependancies all over the place.</p>
<h2>Conclusion</h2>
<p>That&#8217;s it for django application structure. If you&#8217;ve got any better ideas do mention them on twitter or via the comments below. If not, that&#8217;s alright <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Either way, join me in the next installment of Django Protip when I&#8217;ll be talking about using &#8220;Forms, forms for everything&#8221;</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=1985aade-c198-44e0-a12f-c32c11144665" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/django-protip-1-a-better-app-structure/swizec/1386/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Small trick for seamless base64 password storage in django</title>
		<link>http://swizec.com/blog/small-trick-for-seamless-base64-password-storage-in-django/swizec/1378</link>
		<comments>http://swizec.com/blog/small-trick-for-seamless-base64-password-storage-in-django/swizec/1378#comments</comments>
		<pubDate>Wed, 14 Jul 2010 21:20:51 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[Application programming interface]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Encryption]]></category>
		<category><![CDATA[OAuth]]></category>
		<category><![CDATA[Password]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Shareware]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1378</guid>
		<description><![CDATA[



Image via Wikipedia



These days even the noobiest of the noobs know that passwords should never be stored in plain-tect on the server. For various good and bad reasons, but the gist of it is security through obscurity.
What a few less people know is that base64 is the same as plaintext. Not only is it a [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/File:Oauth_logo.svg"><img title="OAuth logo" src="http://swizec.com/blog/wp-content/uploads/2010/08/300px-Oauth_logo.svg_.png" alt="OAuth logo" width="300" height="301" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/File:Oauth_logo.svg">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>These days even the noobiest of the noobs know that <a class="zem_slink freebase/guid/9202a8c04000641f80000000000308d9" title="Password" rel="wikipedia" href="http://en.wikipedia.org/wiki/Password">passwords</a> should never be stored in plain-tect on the <a class="zem_slink freebase/guid/9202a8c04000641f8000000000054790" title="Server (computing)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Server_%28computing%29">server</a>. For various good and bad reasons, but the gist of it is <a class="zem_slink freebase/guid/9202a8c04000641f8000000000039975" title="Security through obscurity" rel="wikipedia" href="http://en.wikipedia.org/wiki/Security_through_obscurity">security through obscurity</a>.</p>
<p>What a few less people know is that <a class="zem_slink freebase/guid/9202a8c04000641f800000000016c05b" title="Base64" rel="wikipedia" href="http://en.wikipedia.org/wiki/Base64">base64</a> is the same as <a class="zem_slink freebase/guid/9202a8c04000641f800000000012648f" title="Plaintext" rel="wikipedia" href="http://en.wikipedia.org/wiki/Plaintext">plaintext</a>. Not only is it a very simple two way hashing function, if it can be called that, it&#8217;s certainly not <a class="zem_slink freebase/guid/9202a8c04000641f80000000000162b1" title="Encryption" rel="wikipedia" href="http://en.wikipedia.org/wiki/Encryption">encryption</a>, what&#8217;s worse is that any coder worth their salt can recognise base64 encoding at a glance. Decoding it is trivial, many tools online can do it.</p>
<p>On top of all of that, django already stores its user&#8217;s passwords very securily with one-way hashing AND <a class="zem_slink freebase/guid/9202a8c04000641f800000000031fdf5" title="Salt (cryptography)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Salt_%28cryptography%29">salting</a>.</p>
<p>So what the fuck am I doing trying to save passwords in base64?</p>
<h3>Problem</h3>
<p>The reason is in fact quite simple: External <a class="zem_slink freebase/guid/9202a8c04000641f80000000000078b4" title="Application programming interface" rel="wikipedia" href="http://en.wikipedia.org/wiki/Application_programming_interface">API</a>&#8217;s.</p>
<p>Here&#8217;s the problem: what do you do when your service is accessing a third party API, which doesn&#8217;t support <a class="zem_slink" title="OAuth" rel="homepage" href="http://oauth.net">OAuth</a> or OAuth is impractical in your situation for various reasons and the API doesn&#8217;t support some other means of <a class="zem_slink freebase/guid/9202a8c04000641f80000000055d5879" title="Login" rel="wikipedia" href="http://en.wikipedia.org/wiki/Login">logging in</a> with a hashed password. Basically, the only way you can access this API is if you know the user&#8217;s password?</p>
<p>The obvious solution is to fuck it and store plain-text passwords. Nothing you can do right? Hopefully nobody will hack your database and get to the passwords.</p>
<p>Sure. But what when you&#8217;re browsing around for debugging purposes? How do you prevent yourself from accidentally reading someone&#8217;s password?</p>
<h3>Solution</h3>
<p>That&#8217;s where base64 comes in.</p>
<p>But since we don&#8217;t want to make our code silly, here&#8217;s a simple way of achieving this without ever having to worry about it again.</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> PasswordManager<span style="color: black;">&#40;</span>models.<span style="color: black;">Manager</span><span style="color: black;">&#41;</span>:
    use_for_related_fields = <span style="color: #008000;">True</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> create<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            kwargs<span style="color: black;">&#91;</span><span style="color: #483d8b;">'password'</span><span style="color: black;">&#93;</span> = <span style="color: #dc143c;">base64</span>.<span style="color: black;">encodestring</span><span style="color: black;">&#40;</span>kwargs<span style="color: black;">&#91;</span><span style="color: #483d8b;">'password'</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">KeyError</span>:
            <span style="color: #ff7700;font-weight:bold;">pass</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>PasswordManager, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">create</span><span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> get<span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, <span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>:
        data = <span style="color: #008000;">super</span><span style="color: black;">&#40;</span>PasswordManager, <span style="color: #008000;">self</span><span style="color: black;">&#41;</span>.<span style="color: black;">get</span><span style="color: black;">&#40;</span><span style="color: #66cc66;">*</span>args, <span style="color: #66cc66;">**</span>kwargs<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">try</span>:
            data.<span style="color: black;">password</span> = <span style="color: #dc143c;">base64</span>.<span style="color: black;">decodestring</span><span style="color: black;">&#40;</span>data.<span style="color: black;">password</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">except</span> <span style="color: #008000;">AttributeError</span>:
            <span style="color: #ff7700;font-weight:bold;">pass</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> data
&nbsp;
<span style="color: #ff7700;font-weight:bold;">class</span> GoogleAccount<span style="color: black;">&#40;</span>models.<span style="color: black;">Model</span><span style="color: black;">&#41;</span>:
    <span style="color: #dc143c;">user</span> = models.<span style="color: black;">ForeignKey</span><span style="color: black;">&#40;</span>User, unique=<span style="color: #008000;">True</span><span style="color: black;">&#41;</span>
    <span style="color: #dc143c;">email</span> = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">255</span><span style="color: black;">&#41;</span>
    password = models.<span style="color: black;">CharField</span><span style="color: black;">&#40;</span>max_length=<span style="color: #ff4500;">255</span><span style="color: black;">&#41;</span>
&nbsp;
    objects = PasswordManager<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></pre></div></div>

<p>Basically we write a module manager that encodes all passwords in insert queries to base64 and decodes them again on select queries. For completeness sake it&#8217;s also good to define a <em>filter</em> function where we perform the decoding on the whole set of returned entries. But for this sort of thing that&#8217;s rarely needed because you&#8217;re rarely going to be performing third party actions for miriads of users at once.</p>
<p>This way we achieve perfectly seamless base64 storage of passwords. Nice and easy.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=eded0a7d-aadf-4552-a54d-328c43c8a709" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/small-trick-for-seamless-base64-password-storage-in-django/swizec/1378/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Barefoot running</title>
		<link>http://swizec.com/blog/barefoot-running/swizec/1374</link>
		<comments>http://swizec.com/blog/barefoot-running/swizec/1374#comments</comments>
		<pubDate>Tue, 06 Jul 2010 12:13:10 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[Athletic]]></category>
		<category><![CDATA[barefoot]]></category>
		<category><![CDATA[Footwear]]></category>
		<category><![CDATA[Leather]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Shoe]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1374</guid>
		<description><![CDATA[



Image via Wikipedia



The story begins with a young boy who had a pair of shoes he loved very much. They were the bestest and most durablest pair of shoes he ever did own.
And they were pretty too! My god, all the female shoes turned their heads as they walked by. The shoes were sporting a [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/File:Bust_shot_leather_art.jpeg" rel="lightbox[1374]"><img title="Handmade leather art" src="http://swizec.com/blog/wp-content/uploads/2010/07/300px-Bust_shot_leather_art.jpeg" alt="Handmade leather art" width="300" height="414" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/File:Bust_shot_leather_art.jpeg" rel="lightbox[1374]">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>The story begins with a young boy who had a pair of shoes he loved very much. They were the bestest and most durablest pair of shoes he ever did own.</p>
<p>And they were pretty too! My god, all the female shoes turned their heads as they walked by. The shoes were sporting a lovely black leather body with a red line or two in strategic places, topped off by a magnificent red Fallen logo. The shoe laces were knotted off at the base and survived most of their time being stunk up and walked upon by dirty socks as was the fashion of the time.</p>
<p>The shoes lived life together with the boy through all sorts of haps and mishaps. They were there when he got drunk, they were there when he decided it might be a good thing to do some sporty things like running and stuff. They bared it all!</p>
<p>Resilient little shoes that they were.</p>
<p>There were times when younger, more sexier shoes, almost took their place in the boy&#8217;s life. But it never happened, somehow, through some turn of fortune, they always came back to embrace the boy&#8217;s feet and make the nasty experience of walking all lovely and comfortable and just like he was floating about on a cushion of air.</p>
<p>But despite all, they were getting old.</p>
<p>There were giant holes gaping from pretty much everywhere. Their posterior was old and battered and nearly mashed up and eaten through like a pack of rabid wolves got their hands on them. Almost every time they made a step they tore through the boy&#8217;s socks in an act of defiance as if to scream &#8220;HEY I&#8217;M FUCKING OLD! I DON&#8217;T LIKE WALKING ANYMORE LEAVE ME ALONE!&#8221;</p>
<p>And the boy heeded their call and he did decide to buy a new pair very soon. But his mother heard them even more so one day she up and threw them in the trash. Alas, the boy now had not a shoe to put on his feet.</p>
<p>He decided to go for a run despite all. Do it barefoot so to speak.</p>
<p>Now his soles are kind of tender.</p>
<p>The end.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://seattletimes.nwsource.com/html/health/2012236317_barefoot02.html?syndication=rss">Barefoot running gains a following</a> (seattletimes.nwsource.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.wired.com/geekdad/2010/06/vivo-barefoot-shoes-now-for-kids/">Vivo Barefoot Shoes, Now for Kids</a> (wired.com)</li>
<li class="zemanta-article-ul-li"><a href="http://walking-running-training.suite101.com/article.cfm/how-to-transition-from-running-shoes-to-barefoot-running">How to Transition from Running Shoes to Barefoot Running</a> (walking-running-training.suite101.com)</li>
<li class="zemanta-article-ul-li"><a href="http://seattletimes.nwsource.com/html/health/2012287080_shoeshealth06.html?syndication=rss">5 shoes to rock your world</a> (seattletimes.nwsource.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.atomiurl.com/are-shoes-that-simulate-walking-barefoot-better">Are Shoes That Simulate Walking Barefoot Better?</a> (atomiurl.com)</li>
<li class="zemanta-article-ul-li"><a href="http://www.runblogger.com/2010/06/barefoot-running-baby-forefoot-steps-in.html">Barefoot Running &#8211; Baby (Forefoot) Steps in the Right Direction on Run #3</a> (runblogger.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=7eed4716-4cd2-4eb7-94b3-ffbec15314ed" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/barefoot-running/swizec/1374/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Today was the worst day I&#8217;ve ever had</title>
		<link>http://swizec.com/blog/today-was-the-worst-day-ive-ever-had/swizec/1370</link>
		<comments>http://swizec.com/blog/today-was-the-worst-day-ive-ever-had/swizec/1370#comments</comments>
		<pubDate>Mon, 21 Jun 2010 20:57:07 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Energy drink]]></category>
		<category><![CDATA[Food and Drink]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[London]]></category>
		<category><![CDATA[Opportunities]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1370</guid>
		<description><![CDATA[



Image by Still Burning via Flickr



Ok so today has probably been one of the crappiest days in a very very long time. Nothing spectacular happened, just a bunch of small very very irritating and annoying things, just enough to ruin your mood for a whole week.
Which is awesome since it&#8217;s Monday.
Even better, I&#8217;m going to [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 195px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/95239135@N00/639800453"><img title="Vending Machine for Books" src="http://swizec.com/blog/wp-content/uploads/2010/06/639800453_8b1b6f3c26_m.jpg" alt="Vending Machine for Books" width="185" height="240" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/95239135@N00/639800453">Still Burning</a> via Flickr</dd>
</dl>
</div>
</div>
<p>Ok so today has probably been one of the crappiest days in a very very long time. Nothing spectacular happened, just a bunch of small very very irritating and annoying things, just enough to ruin your mood for a whole week.</p>
<p>Which is awesome since it&#8217;s Monday.</p>
<p>Even better, I&#8217;m going to <a class="zem_slink freebase/en/london" title="London" rel="geolocation" href="http://maps.google.com/maps?ll=51.5080555556,-0.124722222222&amp;spn=0.1,0.1&amp;q=51.5080555556,-0.124722222222 (London)&amp;t=h">London</a> tomorrow and am expected to be all chirpy and awesome.</p>
<p>Because the day can speak for itself, I&#8217;m just going to list everything:</p>
<ol>
<li>I got up quite a bit later than I intended.</li>
<li>It was cold and incredibly humid outside.</li>
<li>By the time I got to uni to have a grade officially noted down, I was dripping sweat.</li>
<li>Went to hackerspace to study, made tea.</li>
<li>10 minutes later realised I&#8217;d forgotten my calculator at home, went get it.</li>
<li>Dripping sweat when got home.</li>
<li>This time get in car and go back to hackerspace.</li>
<li>Going for calculator took an hour. Made new tea.</li>
<li>Ten minutes later classmates called, let&#8217;s go study at a random open classroom.</li>
<li>It is now almost noon and I&#8217;ve only had a few sips of tea.</li>
<li>All vending machines at the faculty are out of energy drinks, everyone&#8217;s studying.</li>
<li>With the last change I&#8217;ve got I grab a coke.</li>
<li>At 3pm the exam starts and it&#8217;s a fucking assrape. I literally felt the professor&#8217;s dick go up my arse when I put my eyes on the problem.</li>
<li>Struggle through somewhat solving everything.</li>
<li>It took so long I couldn&#8217;t pick a time/date to go get my grade. Got one that is on a day when I&#8217;m in London.</li>
<li>Go back to hackerspace to mostly hang out, do some business stuff.</li>
<li>Laptop runs out of disk. Quickly empty trash.</li>
<li>Emptying trash takes two hours.</li>
<li>While emptying trash the only data file for my time logging app where I log pretty much everything I do so I can have an oversee of what I&#8217;m doing with my time &#8230; goes missing.</li>
<li>Fine I&#8217;ll just restore it from backups.</li>
<li>Mate beats me in almost every single game of Guitar Hero.</li>
<li>Get home, start restoring that file from backups.</li>
<li>Find out someone had turned Time Machine off on December 6th 2009.</li>
<li>Give up. The day is officially horrible. The only way it could get worse is if I magically break my leg while sleeping.</li>
</ol>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=940b47df-4429-48c5-bd5d-5a6a9ce36151" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/today-was-the-worst-day-ive-ever-had/swizec/1370/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>This summer a bunch of hackers might realize your crazy idea</title>
		<link>http://swizec.com/blog/this-summer-a-bunch-of-hackers-might-realize-your-crazy-idea/swizec/1365</link>
		<comments>http://swizec.com/blog/this-summer-a-bunch-of-hackers-might-realize-your-crazy-idea/swizec/1365#comments</comments>
		<pubDate>Fri, 18 Jun 2010 10:06:15 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Hacker (hobbyist)]]></category>
		<category><![CDATA[Hacking]]></category>
		<category><![CDATA[IPad]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1365</guid>
		<description><![CDATA[



Image by Wollbinho via Flickr



A local hackerspace I&#8217;m a part of is organizing a summer long hackday that&#8217;s starting in a few weeks.
What we need right now are the crazies, most whackiest and twoplus insane ideas you can possibly think of. And pimp &#8216;em out, get votes!
When the hacking carnage begins the highest voted ideas [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 250px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/10177557@N08/4449940571"><img title="totaly insane crazy shit" src="http://swizec.com/blog/wp-content/uploads/2010/06/4449940571_0e57af61b0_m.jpg" alt="totaly insane crazy shit" width="240" height="191" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/10177557@N08/4449940571">Wollbinho</a> via Flickr</dd>
</dl>
</div>
</div>
<p>A local hackerspace I&#8217;m a part of is organizing a summer long hackday that&#8217;s starting in a few weeks.</p>
<p>What we need right now are <a href="http://summer.hekovnik.si/ideas-and-projects/" target="_blank">the crazies, most whackiest and twoplus insane ideas</a> you can possibly think of. And pimp &#8216;em out, get votes!</p>
<p>When the hacking carnage begins the highest voted ideas will be gathered up and teams will start working on them. You are also welcome to come put your arse where your mouth is and help make the idea happen, just so you know.</p>
<p>Then, when the carnage is over, there will be a demoday. Each team will present their idea in front of a bunch of business people and the likes, although personally I&#8217;m all for making them public and creating a huge party where everyone is invited. Hell, a barcamp. Hmm &#8230; yeah, I&#8217;ll convince everyone that that&#8217;s the way it should be done.</p>
<p>Anyhow, the demo day, then whomever is the best gets heaps upon heaps upon shitloads of bragging rights. They have essentially just become the awesomest dudes in the whole of Europe. That&#8217;s right, if you&#8217;re too much of a pussy to even participate in this thing you&#8217;re a de facto loser. Turn in your hacking license at once. You aren&#8217;t worthy of calling yourself a hacker.</p>
<p>Also, while you&#8217;re reading this, why not go ahead and vote for the three ideas I contributed <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<ul>
<li><a href="http://summerinabasement.uservoice.com/forums/59903-ideas-and-projects/suggestions/835095-web-cheaper-than-beowulf-cluster?ref=title" target="_blank">Cheaper-than-beowulf cluster</a></li>
<li><a href="http://summerinabasement.uservoice.com/forums/59903-ideas-and-projects/suggestions/834765-mobile-smart-ipad-rss-reader?ref=title">Smart RSS reader for iPad</a></li>
<li><a href="http://summerinabasement.uservoice.com/forums/59903-ideas-and-projects/suggestions/841441-mobile-web-mood-music?ref=title" target="_blank">Mood music</a></li>
</ul>
<p>Oh and do pass this around, the more crazy ideas people contribute the merrier <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=e0a5ac72-c0d8-450c-bbdd-aea80e892dfd" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/this-summer-a-bunch-of-hackers-might-realize-your-crazy-idea/swizec/1365/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>List of things I need to do before I&#8217;m 30</title>
		<link>http://swizec.com/blog/list-of-things-i-need-to-do-before-im-30/swizec/1359</link>
		<comments>http://swizec.com/blog/list-of-things-i-need-to-do-before-im-30/swizec/1359#comments</comments>
		<pubDate>Thu, 10 Jun 2010 21:56:21 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[Inspiration]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1359</guid>
		<description><![CDATA[So I was thinking, for the longest of times I&#8217;ve been wanting to do a whole bunch of things &#8230;
&#8230; and I never quite get around to doing them.
Fuck. This. Shit.
This year, I make a list and I fucking clear it by the time I&#8217;m 30. There is no sense in living if you aren&#8217;t [...]]]></description>
			<content:encoded><![CDATA[<p>So I was thinking, for the longest of times I&#8217;ve been wanting to do a whole bunch of things &#8230;</p>
<p>&#8230; and I never quite get around to doing them.</p>
<p>Fuck. This. Shit.</p>
<p>This year, I make a list and I fucking clear it by the time I&#8217;m 30. There is no sense in living if you aren&#8217;t having way over the top fun with it.</p>
<p>Also making a list, publicly posting it and putting a deadline on it is a sure fire way to have a really really really really crappy 30th birthday when you inevitably realise that you&#8217;ve done way too few of these things and have just run out of soup.</p>
<ol>
<li><a class="zem_slink freebase/en/bungee_jumping" title="Bungee jumping" rel="wikipedia" href="http://en.wikipedia.org/wiki/Bungee_jumping">Bungee jump</a></li>
<li>Canyoning</li>
<li>Solo sky dive from plane</li>
<li><a class="zem_slink freebase/en/base_jumping" title="BASE jumping" rel="wikipedia" href="http://en.wikipedia.org/wiki/BASE_jumping">BASE jump</a> the fjords</li>
<li>Flying suit BASE jump the fjords</li>
<li>Jump off a few other things with a flying suit</li>
<li>Climb Triglav</li>
<li>Climb Everest</li>
<li>Drive at least one official european <a class="zem_slink freebase/en/rallying" title="Rallying" rel="wikipedia" href="http://en.wikipedia.org/wiki/Rallying">rally race</a></li>
<li>Drive and finish the desert oldsmobile rally (I keep forgetting the name)</li>
<li>Ride the trans-siberian railway</li>
<li>Learn to do a no handed endo</li>
<li>Perform a <a class="zem_slink freebase/en/tailwhip" title="Tailwhip" rel="wikipedia" href="http://en.wikipedia.org/wiki/Tailwhip">double tailwhip</a> with a mountain bike</li>
<li>Come to a board meeting with a parachute through the window</li>
</ol>
<p>Noticed a pattern? <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>Well I&#8217;ve got 8 (although I like to pretend it&#8217;s 9) years to do all of this. Will happily take suggestions for things I haven&#8217;t thought of.</p>
<p>EDIT:</p>
<p>Oh and 15: Learn to ride a unicycle</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Enhanced by Zemanta" href="http://www.zemanta.com/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/zemified_e.png?x-id=06bfcd19-405b-4160-9440-b74acc7d6fb9" alt="Enhanced by Zemanta" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/list-of-things-i-need-to-do-before-im-30/swizec/1359/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The best post in the history of posting on the internets</title>
		<link>http://swizec.com/blog/the-best-post-in-the-history-of-posting-on-the-internets/swizec/1354</link>
		<comments>http://swizec.com/blog/the-best-post-in-the-history-of-posting-on-the-internets/swizec/1354#comments</comments>
		<pubDate>Sun, 06 Jun 2010 20:51:28 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1354</guid>
		<description><![CDATA[I can only wish that it were mine
To the entire Black race living in America, we, the Adamic, pink complexioned race (better known to you as the White race) that came to these shores from Europe, England, Scotland, Ireland, and Iceland, apologize for freeing you from slavery by fighting a horrible war among ourselves that [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://swizec.com/blog/wp-content/uploads/2010/06/1275855598323.jpg" rel="lightbox[1354]"><img class="alignright size-full wp-image-1356" title="1275855598323" src="http://swizec.com/blog/wp-content/uploads/2010/06/1275855598323.jpg" alt="" width="370" height="331" /></a>I can only wish that it were mine</p>
<div id="_mcePaste">To the entire Black race living in America, we, the Adamic, pink complexioned race (better known to you as the White race) that came to these shores from Europe, England, Scotland, Ireland, and Iceland, apologize for freeing you from slavery by fighting a horrible war among ourselves that cost the lives of almost two million of our own race. We apologize for continuing to fight among ourselves over that very issue, even though you&#8217;ve never told us you appreciate our freeing you.</div>
<div id="_mcePaste">We apologize for splitting to pieces our entire race the world over to take sides with you to help you survive and become a freer race. We apologize for forcing the rest of the world to outlaw the slavery which your ancestors had practiced for thousands of years, even though many nations on your home continent still practice it today.</div>
<div id="_mcePaste">We apologize for thinking we could civilize you when you have proven that it is indeed an impossible feat, a feat beyond anything we could have ever imagined.</div>
<div id="_mcePaste">We apologize for teaching you to add and subtract (what little you can), thereby enabling you to run a household and pay your bills (what few you will) and count your children other than on your fingers and sometimes toes when you have so many you run out of fingers.</div>
<div id="_mcePaste">We apologize for providing you with medical care instead of leaving you under the witch doctors you used before we arrived, as a result of which you have been able to survive all sorts of diseases to multiply in massive numbers beyond what you could have without these aides.</div>
<div id="_mcePaste">We apologize for building schools for you which we have had to repair over and over after you vandalized them beyond use. We apologize for inventing computers and the Internet, neither of which you use very much, but when you do use them it&#8217;s mostly to bash our race.</div>
<div id="_mcePaste">We apologize for building factories and businesses that employ you, if you so desire to work. We apologize for creating millions of bureaucratic jobs within our government system simply to give you employment, instead of leaving you to find work on your own.</div>
<div id="_mcePaste">We apologize for promoting and buying your music, although you refuse to buy ours. We apologize for talking and acting as you do, although you refuse to talk and act as we do.</div>
<div id="_mcePaste">We apologize for placing you in our movies and TV shows and elevating you to a fictional, heroic level that you have never reached in real life. We apologize for creating this false image of yourselves in your minds, for we realize after 400 years of trying to help you that you cannot solve problems and provide leadership and create original thoughts; and the image we&#8217;ve placed in your minds causes you to live in a delusional world. For that we truly apologize.</div>
<div id="_mcePaste">We apologize for creating quota systems and forced employment programs to make sure you have the best jobs, if you so desire to work. We apologize for thinking we could educate you so that you could learn to build and help others, when you obviously have only the ability to tear down and take from others.</div>
<div id="_mcePaste">We apologize for giving you welfare and food stamps, with the result that for four generations over half of your race has not had to work, except in makesift type of jobs in our governments and bureaucracies.</div>
<div id="_mcePaste">We apologize for promoting your children in school as if they could understand basic arithmetic and grammar, such as multiplication and past participles, when we should have made sure they were accustomed to manual labor so that we would not have had to make up jobs for them in our governments dusting seats with their butts.</div>
<div id="_mcePaste">We apologize for developing farms in our own lands which you have never been able to do, and that to this day feed most of your race still living in Africa. We apologize for coming to Africa and building farms, from which you have now run us off of and have devastated beyond use, forcing us to continue feeding you.</div>
<div id="_mcePaste">We apologize for creating the International Monetary Fund (IMF) and the World Bank (WB) and U.S. Government Foreign Aid Programs and hundreds of charities that funnel billions of our tax dollars and charitable donations to nations around the world run by your race, all because your race cannot take care of itself by itself anywhere you live.</div>
<div id="_mcePaste">We apologize for giving you the right to vote so you could take over all our major cities and turn them into high-taxed, crime-ridden cess pools that no civilized human being can live in.</div>
<div id="_mcePaste">We apologize for creating the term &#8220;reverend,&#8221; which your leaders use to give themselves credentials and which their actions have denigrated beyond repair, with the result that no decent person would call himself &#8220;reverend,&#8221; much less a Christian</div>
<div id="_mcePaste">We apologize for trying to come up with an AIDS vaccine to stop the epidemic spread of AIDS in Africa, AIDS being a disease that you created and passed on to us after having sexual intercourse with monkeys and then with one of our idiotic race-mixers who then passed it on to the rest of the world.</div>
<div id="_mcePaste">We apologize for providing you with warm, custom-made garments instead of the animal skins and leaves that you wore before we arrived. We apologize for providing you with shoes instead of leaving you barefooted as you were before we arrived in Africa.</div>
<div id="_mcePaste">We apologize for teaching you how to clean yourselves and your homes, and how to sanitize the water you drink to keep you from getting even more dreadful diseases than the rest of your race gets that still lives in Africa. We apologize for teaching you to cook your foods, which keeps you from getting the hundreds of parasitic diseases that your race gets that still lives on your home continent of Africa.</div>
<div id="_mcePaste">We apologize for providing you with solidly built, heated, and cooled homes with grass yards instead of the straw huts and dirt yards you were living in before we arrived, and in which most of your race is still living in in Africa.</div>
<div id="_mcePaste">We apologize for inventing sports so that you can make millions of dollars and live like kings, then kill and rape people with impunity, as O.J. Heisman-Trophy-Winner Simpson and Mike Heavy-Weight-Champion-of-the-World Tyson have done, as well as many others among your race.</div>
<div id="_mcePaste">We apologize for producing such beautiful people for you to race-mix with, and if they won&#8217;t voluntarily mix, you often casually rape them as if you were eating a piece of fried chicken.</div>
<div id="_mcePaste">We apologize for building thousands of prisons around the nation to house dangerous criminals, of which your race makes up over sixty percent even though you&#8217;re only thirteen percent of the U.S. population, and this at an expense of billions of dollars and manpower every year.</div>
<div id="_mcePaste">We apologize for taking precious metals from the earth on your home continent of Africa, metals which you neither knew were there nor how to use them if you had known they were there, but which you love to puncture and cover your bodies with in the most tawdry way imaginable.</div>
<div id="_mcePaste">We apologize for those among us who have established charitable organizations, donated billions of dollars and hours of time, and have devoted their entire lives to make life easier and better for your race, although most often to no positive result.</div>
<div id="_mcePaste">We apologize for all the stupid White ministers whom your race has martyred in Africa where they were trying to evangelize you to a faith that you can&#8217;t understand nor do you want to; yet when you claim to join it soon pervert it with the Voodooistic concepts you have inherited from your forefathers.</div>
<div id="_mcePaste">We apologize for building highways and railroads and for inventing flying machines that you could never have invented but which you use everyday to move about, yet without thinking or appreciating their origins in the least.</div>
<div id="_mcePaste">We apologize for paying the majority of both federal and state taxes, to maintain the governments which protect and promote you but fight against our own people at every turn.</div>
<div id="_mcePaste">We apologize for some members of our race who worship the monstrosities your genes have created, such as Jacko the Wacko and Little Fruity Richard and Dennis Nutman Rodman and Don Electrified King and Daryl Coke-Head Strawberry and Whitney Whacked-Out-Screaming Houston and Cassius If-Only-I-Be-White-But-I&#8217;m-Really-Black Clay and Tiger Adamic-Hater Woods and Whoopi Thinks-She&#8217;s-White Goldberg and Oprah Interview-a-Nut New-Age-Goof Winfrey and Ru Triple-Freak Paul and Morgan Act-White-But-Hate-White Freeman and Sammy Convert-To-The-Christ-haters-Religion Davis and Colin Have-A-Black-Pet-In-The-White-House Powell, to name only a few.</div>
<div id="_mcePaste">We apologize for defeating the major part of the communist threat which cost us several trillion dollars and hundreds of thousands of lives, but whose doctrines you still wish to have implemented on the backs of our race to further torture us and tear us down.</div>
<div id="_mcePaste">We apologize for spending over $2 trillion dollars on welfare and food stamps in the last thirty-five years, funds which your race received the majority of, although you are a small minority among us.</div>
<div id="_mcePaste">We apologize for introducing you to the rule of law under a republican form of government, a government that has gone abroad to keep your own warring nations from slaughtering other members of your race by the hundreds of thousands as they did year in and year out before we arrived, and still do every time we leave them alone and do not intervene.</div>
<div id="_mcePaste">We apologize for teaching you to read a language that contains more than a few words and a couple of hand signs, which has allowed you to take part in our philosophies, our culture, our art, our industry, our collegial nature, and our freedom, even though as soon as you get around them you pervert them.</div>
<div id="_mcePaste">For surely, if you could not read, how could you have learned the teachings of Karl Marx, Mao Tse Sung, Joseph Stalin, Leon Trotsky, Nikolai Lenin, Howard Zinn, the Damocrat Party, the Neo-cons in the Republicoward Party, and others who hate our race, and have brainwashed you into believing our race is evil and that you are severely oppressed?</div>
<div id="_mcePaste">We apologize for placing you under the form of government that our own forefathers died to create, and for which you are helping to destroy, instead of leaving you under the anarchy you lived under before we arrived.</div>
<div id="_mcePaste">For all these wrongs we&#8217;ve carried out against you, we apologize deeply and unreservedly, and if you will please accept our apology, we shall happily and immediately take back all of the above mentioned evils we have cast upon you and return you to your home continent, if you so desire.</div>
<div id="_mcePaste">We would with the greatest of glee and cheer even provide you with a nice, little stipend for traveling money, if you&#8217;d go and take your race-traitor wives and husbands and Mulatto children with you.</div>
<div id="_mcePaste">We have enjoyed having you here, but because you claim we&#8217;ve been, and are still being, so mean to you, we&#8217;d like to atone by helping you get back to where you came from.</div>
<div id="_mcePaste">You could live in peace without our persecuting you anymore, and we could save ourselves trillions of dollars over the next few years by shrinking our governments and emptying our prisons. We could take hundreds of thousands of security guards and police officers around the country off their jobs and put them to more productive use, and we could celebrate our own culture without offending you anymore.</div>
<div id="_mcePaste">Moreover, we could take the three-point shot and the forty-five second shot clock out of basketball which would return it to a game of plays and strategies, instead of the run and gun show our enemies have tailored especially for you. We could place the &#8220;palming penalty&#8221; and the &#8220;walking penalty&#8221; and the &#8220;charging penalty&#8221; back in to slow the game down to the point that defense and brains matter.</div>
<div id="_mcePaste">We could place the &#8220;bump and run&#8221; rule back in football and have referees start calling &#8220;offensive pass interference&#8221; again, to change the game to one where something more than straight-ahead speed is what matters. The &#8220;taunting rule&#8221; and the &#8220;roughing the quarterback rule&#8221; that we had to implement because of you, we could do away with completely, because civility would automatically come back into the game.</div>
<div id="_mcePaste">The race traitors of our race who hate their own culture and heritage could go with you, and we won&#8217;t offend them anymore either. For after a few generations of mixing with your race they would disappear into the dark tar-mix which your dominant design-genes make up.</div>
<div id="_mcePaste">What say? Do you accept our apology? Do we have a deal? Please let us know, soon!</div>
<p>To the entire Black race living in America, we, the Adamic, pink complexioned race (better known to you as the White race) that came to these shores from Europe, England, Scotland, Ireland, and Iceland, apologize for freeing you from slavery by fighting a horrible war among ourselves that cost the lives of almost two million of our own race. We apologize for continuing to fight among ourselves over that very issue, even though you&#8217;ve never told us you appreciate our freeing you.<br />
We apologize for splitting to pieces our entire race the world over to take sides with you to help you survive and become a freer race. We apologize for forcing the rest of the world to outlaw the slavery which your ancestors had practiced for thousands of years, even though many nations on your home continent still practice it today.<br />
We apologize for thinking we could civilize you when you have proven that it is indeed an impossible feat, a feat beyond anything we could have ever imagined.<br />
We apologize for teaching you to add and subtract (what little you can), thereby enabling you to run a household and pay your bills (what few you will) and count your children other than on your fingers and sometimes toes when you have so many you run out of fingers.<br />
We apologize for providing you with medical care instead of leaving you under the witch doctors you used before we arrived, as a result of which you have been able to survive all sorts of diseases to multiply in massive numbers beyond what you could have without these aides.<br />
We apologize for building schools for you which we have had to repair over and over after you vandalized them beyond use. We apologize for inventing computers and the Internet, neither of which you use very much, but when you do use them it&#8217;s mostly to bash our race.<br />
We apologize for building factories and businesses that employ you, if you so desire to work. We apologize for creating millions of bureaucratic jobs within our government system simply to give you employment, instead of leaving you to find work on your own.<br />
We apologize for promoting and buying your music, although you refuse to buy ours. We apologize for talking and acting as you do, although you refuse to talk and act as we do.<br />
We apologize for placing you in our movies and TV shows and elevating you to a fictional, heroic level that you have never reached in real life. We apologize for creating this false image of yourselves in your minds, for we realize after 400 years of trying to help you that you cannot solve problems and provide leadership and create original thoughts; and the image we&#8217;ve placed in your minds causes you to live in a delusional world. For that we truly apologize.<br />
We apologize for creating quota systems and forced employment programs to make sure you have the best jobs, if you so desire to work. We apologize for thinking we could educate you so that you could learn to build and help others, when you obviously have only the ability to tear down and take from others.<br />
We apologize for giving you welfare and food stamps, with the result that for four generations over half of your race has not had to work, except in makesift type of jobs in our governments and bureaucracies.<br />
We apologize for promoting your children in school as if they could understand basic arithmetic and grammar, such as multiplication and past participles, when we should have made sure they were accustomed to manual labor so that we would not have had to make up jobs for them in our governments dusting seats with their butts.<br />
We apologize for developing farms in our own lands which you have never been able to do, and that to this day feed most of your race still living in Africa. We apologize for coming to Africa and building farms, from which you have now run us off of and have devastated beyond use, forcing us to continue feeding you.<br />
We apologize for creating the International Monetary Fund (IMF) and the World Bank (WB) and U.S. Government Foreign Aid Programs and hundreds of charities that funnel billions of our tax dollars and charitable donations to nations around the world run by your race, all because your race cannot take care of itself by itself anywhere you live.<br />
We apologize for giving you the right to vote so you could take over all our major cities and turn them into high-taxed, crime-ridden cess pools that no civilized human being can live in.<br />
We apologize for creating the term &#8220;reverend,&#8221; which your leaders use to give themselves credentials and which their actions have denigrated beyond repair, with the result that no decent person would call himself &#8220;reverend,&#8221; much less a Christian<br />
We apologize for trying to come up with an AIDS vaccine to stop the epidemic spread of AIDS in Africa, AIDS being a disease that you created and passed on to us after having sexual intercourse with monkeys and then with one of our idiotic race-mixers who then passed it on to the rest of the world.<br />
We apologize for providing you with warm, custom-made garments instead of the animal skins and leaves that you wore before we arrived. We apologize for providing you with shoes instead of leaving you barefooted as you were before we arrived in Africa.<br />
We apologize for teaching you how to clean yourselves and your homes, and how to sanitize the water you drink to keep you from getting even more dreadful diseases than the rest of your race gets that still lives in Africa. We apologize for teaching you to cook your foods, which keeps you from getting the hundreds of parasitic diseases that your race gets that still lives on your home continent of Africa.<br />
We apologize for providing you with solidly built, heated, and cooled homes with grass yards instead of the straw huts and dirt yards you were living in before we arrived, and in which most of your race is still living in in Africa.<br />
We apologize for inventing sports so that you can make millions of dollars and live like kings, then kill and rape people with impunity, as O.J. Heisman-Trophy-Winner Simpson and Mike Heavy-Weight-Champion-of-the-World Tyson have done, as well as many others among your race.<br />
We apologize for producing such beautiful people for you to race-mix with, and if they won&#8217;t voluntarily mix, you often casually rape them as if you were eating a piece of fried chicken.<br />
We apologize for building thousands of prisons around the nation to house dangerous criminals, of which your race makes up over sixty percent even though you&#8217;re only thirteen percent of the U.S. population, and this at an expense of billions of dollars and manpower every year.<br />
We apologize for taking precious metals from the earth on your home continent of Africa, metals which you neither knew were there nor how to use them if you had known they were there, but which you love to puncture and cover your bodies with in the most tawdry way imaginable.<br />
We apologize for those among us who have established charitable organizations, donated billions of dollars and hours of time, and have devoted their entire lives to make life easier and better for your race, although most often to no positive result.<br />
We apologize for all the stupid White ministers whom your race has martyred in Africa where they were trying to evangelize you to a faith that you can&#8217;t understand nor do you want to; yet when you claim to join it soon pervert it with the Voodooistic concepts you have inherited from your forefathers.<br />
We apologize for building highways and railroads and for inventing flying machines that you could never have invented but which you use everyday to move about, yet without thinking or appreciating their origins in the least.<br />
We apologize for paying the majority of both federal and state taxes, to maintain the governments which protect and promote you but fight against our own people at every turn.<br />
We apologize for some members of our race who worship the monstrosities your genes have created, such as Jacko the Wacko and Little Fruity Richard and Dennis Nutman Rodman and Don Electrified King and Daryl Coke-Head Strawberry and Whitney Whacked-Out-Screaming Houston and Cassius If-Only-I-Be-White-But-I&#8217;m-Really-Black Clay and Tiger Adamic-Hater Woods and Whoopi Thinks-She&#8217;s-White Goldberg and Oprah Interview-a-Nut New-Age-Goof Winfrey and Ru Triple-Freak Paul and Morgan Act-White-But-Hate-White Freeman and Sammy Convert-To-The-Christ-haters-Religion Davis and Colin Have-A-Black-Pet-In-The-White-House Powell, to name only a few.<br />
We apologize for defeating the major part of the communist threat which cost us several trillion dollars and hundreds of thousands of lives, but whose doctrines you still wish to have implemented on the backs of our race to further torture us and tear us down.<br />
We apologize for spending over $2 trillion dollars on welfare and food stamps in the last thirty-five years, funds which your race received the majority of, although you are a small minority among us.<br />
We apologize for introducing you to the rule of law under a republican form of government, a government that has gone abroad to keep your own warring nations from slaughtering other members of your race by the hundreds of thousands as they did year in and year out before we arrived, and still do every time we leave them alone and do not intervene.<br />
We apologize for teaching you to read a language that contains more than a few words and a couple of hand signs, which has allowed you to take part in our philosophies, our culture, our art, our industry, our collegial nature, and our freedom, even though as soon as you get around them you pervert them.<br />
For surely, if you could not read, how could you have learned the teachings of Karl Marx, Mao Tse Sung, Joseph Stalin, Leon Trotsky, Nikolai Lenin, Howard Zinn, the Damocrat Party, the Neo-cons in the Republicoward Party, and others who hate our race, and have brainwashed you into believing our race is evil and that you are severely oppressed?<br />
We apologize for placing you under the form of government that our own forefathers died to create, and for which you are helping to destroy, instead of leaving you under the anarchy you lived under before we arrived.<br />
For all these wrongs we&#8217;ve carried out against you, we apologize deeply and unreservedly, and if you will please accept our apology, we shall happily and immediately take back all of the above mentioned evils we have cast upon you and return you to your home continent, if you so desire.<br />
We would with the greatest of glee and cheer even provide you with a nice, little stipend for traveling money, if you&#8217;d go and take your race-traitor wives and husbands and Mulatto children with you.<br />
We have enjoyed having you here, but because you claim we&#8217;ve been, and are still being, so mean to you, we&#8217;d like to atone by helping you get back to where you came from.<br />
You could live in peace without our persecuting you anymore, and we could save ourselves trillions of dollars over the next few years by shrinking our governments and emptying our prisons. We could take hundreds of thousands of security guards and police officers around the country off their jobs and put them to more productive use, and we could celebrate our own culture without offending you anymore.<br />
Moreover, we could take the three-point shot and the forty-five second shot clock out of basketball which would return it to a game of plays and strategies, instead of the run and gun show our enemies have tailored especially for you. We could place the &#8220;palming penalty&#8221; and the &#8220;walking penalty&#8221; and the &#8220;charging penalty&#8221; back in to slow the game down to the point that defense and brains matter.<br />
We could place the &#8220;bump and run&#8221; rule back in football and have referees start calling &#8220;offensive pass interference&#8221; again, to change the game to one where something more than straight-ahead speed is what matters. The &#8220;taunting rule&#8221; and the &#8220;roughing the quarterback rule&#8221; that we had to implement because of you, we could do away with completely, because civility would automatically come back into the game.<br />
The race traitors of our race who hate their own culture and heritage could go with you, and we won&#8217;t offend them anymore either. For after a few generations of mixing with your race they would disappear into the dark tar-mix which your dominant design-genes make up.<br />
What say? Do you accept our apology? Do we have a deal? Please let us know, soon!</p>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/the-best-post-in-the-history-of-posting-on-the-internets/swizec/1354/feed</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>The upcoming month right out from hell!</title>
		<link>http://swizec.com/blog/the-upcoming-month-right-out-from-hell/swizec/1351</link>
		<comments>http://swizec.com/blog/the-upcoming-month-right-out-from-hell/swizec/1351#comments</comments>
		<pubDate>Mon, 31 May 2010 09:52:16 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[Hell]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1351</guid>
		<description><![CDATA[That is correct, the exam season is upon us once again.
It&#8217;s going to be a hellish few weeks and I&#8217;m already dreading climbing out of bed each and every day respectfully. Horrible horrible times are afoot.
This week I&#8217;m facing two midterms, one somewhat long paper and having to defend my homework before scrutiny. Next week [...]]]></description>
			<content:encoded><![CDATA[<p>That is correct, the exam season is upon us once again.</p>
<p>It&#8217;s going to be a hellish few weeks and I&#8217;m already dreading climbing out of bed each and every day respectfully. Horrible horrible times are afoot.</p>
<p>This week I&#8217;m facing two midterms, one somewhat long paper and having to defend my homework before scrutiny. Next week it&#8217;s three rather not very easy exams. Yikes!</p>
<p>And then nobody knows! I fully expect the one exam that&#8217;s scheduled and the three oral exams partaining to the exams that are next week. Hoorah!</p>
<p>Oh well, the exam season will behave like the drunk daddy in a particular song methinks.</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/lspXdFPKmEY&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/lspXdFPKmEY&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/e95abd04-fee4-4075-9f46-1789f8e79607/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=e95abd04-fee4-4075-9f46-1789f8e79607" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/the-upcoming-month-right-out-from-hell/swizec/1351/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Študentske demonstracije? Pha! Prej farsa s smešnim izidom</title>
		<link>http://swizec.com/blog/studentske-demonstracije-pha-prej-farsa-s-smesnim-izidom/swizec/1342</link>
		<comments>http://swizec.com/blog/studentske-demonstracije-pha-prej-farsa-s-smesnim-izidom/swizec/1342#comments</comments>
		<pubDate>Wed, 19 May 2010 20:18:11 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1342</guid>
		<description><![CDATA[Strah in groza v Las Vegasu Ljubljani.
Približno tako je danes zgledalo, oz. vsaj zvenelo na twitterju.
Kaotično. Zmedeno. Prijetno brez cilja in vsake logike.
Imeli smo študentske demonstracije proti opresiji nadgroznega državnega aparata!
A demonstrirali so pijani dijaki.
Imeli smo študentske demonstracije za pravo študentsko stvar!
A skup niso spravili niti sence kakega manifesta.
Imeli smo bitko in sekla bridka so [...]]]></description>
			<content:encoded><![CDATA[<p>Strah in groza v <del datetime="2010-05-19T21:44:50+00:00">Las Vegasu</del> Ljubljani.</p>
<p>Približno tako je danes zgledalo, oz. vsaj zvenelo na twitterju.</p>
<p>Kaotično. Zmedeno. Prijetno brez cilja in vsake logike.</p>
<p>Imeli smo študentske demonstracije proti opresiji nadgroznega državnega aparata!</p>
<p>A demonstrirali so pijani dijaki.</p>
<p>Imeli smo študentske demonstracije za pravo študentsko stvar!</p>
<p>A skup niso spravili niti sence kakega manifesta.</p>
<p>Imeli smo bitko in sekla bridka so se jekla proti zlobnim policistom!</p>
<p>A vsi so se poskrili že po dobri uri.</p>
<p>Imeli smo razbijanje in divjanje po ulicah, da se nas vidi! Da povemo svoje!</p>
<p>A par ur zatem so posledice le na 10 metrih pred parlamentom, drugje niti smeti več ni.</p>
<p>Imeli smo zavzemanje nadsuper študentskih organizacij za študentsko stvar!</p>
<p>A <a href="http://www.facebook.com/pages/19-maj-2010-Sram-me-je-da-sem-student/122899267730285">študentje</a> se že <a href="http://www.facebook.com/group.php?gid=112004728842213">jezno</a> <a href="http://www.facebook.com/group.php?gid=115050728536417">zbirajo</a> in <a href="http://www.facebook.com/group.php?gid=124634080889905">zahtevajo</a> <a href="http://www.facebook.com/group.php?gid=124901234203021">ukinitev</a> <a href="http://www.facebook.com/group.php?gid=118410654865056">ŠOS</a> <a href="http://www.facebook.com/group.php?gid=108658565835490">in</a> <a href="http://www.facebook.com/group.php?gid=120662134634976">ŠOU</a>.</p>
<p>&#8230;</p>
<p>Jah, takle mamo, študentsko gibanje je le še senca tega kar smo imeli v 70ih. Sicer nisem bil zraven, ampak <a href="http://sl.wikipedia.org/wiki/Manifest_zasedene_Filozofske_fakultete">Zasedba Filozofske Fakultete </a>je bilo tako epska, da še zdaj stari Ljubljančani govorijo o tem. Takrat &#8230; to je bilo tisto pravo, tako se te stvari delajo.</p>
<p>Ne pa zdaj, neka na pol mafijska organizacija, ki parazitira ljudi katere naj bi ščitila organizira proteste samo in izključno takrat kadar nekdo stopi na prste njenega denarja. Pa čeprav se vsi študentje strinjajo ali pa jim celo dol visi. Potem je pa treba pijano drhal dijaško nahujskat in jo spravit na ceste, da ne bi slučajno bilo preveč očitno za koga dejansko so demonstracije. Ja tako je, po pričevanjih očividcev so bili edini študentje na demonstracijah organizatorji in nekaj lolekov s FDV-ja.</p>
<p>Takrat ko so nam pa bone dražili in so jokali in pizdili res vsi študentje kar jih poznam, takrat pa nič. O ne, to pa ne bomo protestirali, še malo bomo probali skrit vso zadevo.</p>
<p>Ampak priznam, malo sem pa vseeno ponosen na današnje dogajanje. Cel dopoldan sem se spraševal kaj bi bilo potrebno da sprožimo nekaj pravega, nekaj kar bo vsaj na daleč zgledalo, kot da imamo kaj povedat:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/TsXQ8-iAGC0&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/TsXQ8-iAGC0&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Najprej je zgledalo zelo klavrno. Mislim, jao, demonstracije proti državi so se začele popoldan, zato ker za dopoldan niso dobili dovoljenja od države. Wtf? No saj, potem ko se je pa zares začelo dogajat je pa organizator namesto, da bi podprl svoje lutke, stisnil rep med noge in se &#8220;distanciral od nasilja&#8221;.</p>
<p>Pa vseeno, dobili smo tole:</p>
<p><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="640" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/k6xF8_cKoZ8&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="640" height="385" src="http://www.youtube.com/v/k6xF8_cKoZ8&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Nahujskani dijački, ki sami zase ne vejo zakaj so tam. &#8220;kdor ne skače ni slovenc&#8221; &#8230; čaki kaj? Zakaj že demonstrirate in se tepete s prašiči? Al ste morebiti na fuzbal tekmi?</p>
<p>No saj, resnost izgredov se vidi že v tem kako dolgo so trajali in kako daleč so se razširili. Bojim se da Kresalka vseeno ne bo mogla upravičit nakupa tiste vodne pištolce &#8230;</p>
<p>Kakorkoli, ponosen sem na študentsko organizacijo in predvsem na svoje kolege študente -</p>
<p><span style="font-size: 1.8em;"><strong>Dobili smo iskro potrebno za upor proti ŠOU/ŠOS, izkoristimo jo do konca!</strong></span></p>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/studentske-demonstracije-pha-prej-farsa-s-smesnim-izidom/swizec/1342/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Malo delo? Poserjem se na vas in vaše demonstracije</title>
		<link>http://swizec.com/blog/malo-delo-poserjem-se-na-vas-in-vase-demonstracije/swizec/1338</link>
		<comments>http://swizec.com/blog/malo-delo-poserjem-se-na-vas-in-vase-demonstracije/swizec/1338#comments</comments>
		<pubDate>Tue, 18 May 2010 10:01:56 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[food for thought]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1338</guid>
		<description><![CDATA[



Image by Steve Crane via Flickr



Because this is a local topic the post is in slovene, apologies to both my international readers.
Zadnje dni ŠOU že kar malo precej najeda z vso propagando okoli malega dela in kako je to oh in sploh konec sveta, pa da sploh ne omenimo ubogih študentekov kako, da ga bomo [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 250px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/49503062604@N01/237431962"><img title="Riot Control" src="http://swizec.com/blog/wp-content/uploads/2010/05/237431962_1444b6dad7_m.jpg" alt="Riot Control" width="240" height="160" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/49503062604@N01/237431962">Steve Crane</a> via Flickr</dd>
</dl>
</div>
</div>
<p>Because this is a local topic the post is in slovene, apologies to both my international readers.</p>
<p>Zadnje dni ŠOU že kar malo precej najeda z vso propagando okoli malega dela in kako je to oh in sploh konec sveta, pa da sploh ne omenimo ubogih študentekov kako, da ga bomo nasrkali in ne bomo niti za kavico več imeli.</p>
<p>Pa pustimo, da študent sploh ne rabi kavice ampak se na faksu kaj naučit pa zraven en malo štipendije za knjige in kak sendvič.</p>
<p>Ok priznam, odkar sem na faksu še ni minil mesec, ko ne bi več časa zapravil za &#8220;službo&#8221; kot za študijske zadeve &#8211; izvzemši seveda izpitna obdobja potem ko sem se pred kakim letom malce spametoval.</p>
<p>A vseeno podpiram in pozdravljam malo delo, čeprav sem direktor malega startupa sestavljenega izključno iz študentarije. Malo delo bo super.</p>
<p>Zakaj?</p>
<p>Ja ker se nič ne bo spremenilo, samo malo se bo povečal obseg kdo vraga lahko dela in tisti ki delajo bodo imeli kako pravico več. Kurba je ko si dva tedna bolan in zato konec mesca ne morš plačat telefona, ali pa greš na malo dopusteka in magično zmanjka vsega denarja.</p>
<p>Zveni zelo viktorijansko mar ne? Mogoče celo ameriško.</p>
<p>Pfuj in pfej. Amerika in viktorijanstvo sta kul samo za nadbogate, študentarija in reveži se v nobenem primeru nimajo kaj preveč fino. Pri nas pa? Jah študent je car &#8230;</p>
<p>&#8230; in tako naj ostane.</p>
<p>Če znaš dobro delat, kar seveda znaš mar ne, sej te močno srbijo omejitve urnih postavk, to valjda pomeni da zdaj zaslužiš bajno več mar ne? Boš po preračunih z malim delom še vedno lahko zaslužil 6000 eurov na leto. In ja, to ravno pade v tisti minimum, da še ne plačaš davkov.</p>
<p>Osebno sem tista leta ko sem zaslužil več kot 6k gagal ko majmun cele dneve in naredil prekleto malo izpitov.</p>
<p>Kar se pa tiče demonstracij &#8230;</p>
<p>Jaz in ŠOU sva opravila. Današnja automagična prijava na nekakšen SMS klub in to da me zdaj kar nekaj spamajo sta bila pika na i. Ne grem se več.</p>
<p>Sem hotel it na demonstracije čist samo tako, za špas, mogoče bi bili pa izgredi in po mojem nisi zares živel dokler nisi bil vsaj enkrat v resnih izgredih &#8211; po možnosti v študentskih letih, kasneje ni več fore. Ampak izgredov ne bo, smo preveliki papki.</p>
<p>Ah kje so cajti, ki jih opisujejo stari ljubljančani, ko je študentarija zavojevala fakse in ohromila Ljubljano, da so povedali svoje. Zdaj so demonstracije samo še show in komerciala. Pa kak alkohol več se proda na ta račun.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/a3a05ea0-525e-4c09-bf92-94aed194ddb5/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=a3a05ea0-525e-4c09-bf92-94aed194ddb5" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/malo-delo-poserjem-se-na-vas-in-vase-demonstracije/swizec/1338/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>An engineer&#8217;s view on philosophy</title>
		<link>http://swizec.com/blog/an-engineers-view-on-philosophy/swizec/1333</link>
		<comments>http://swizec.com/blog/an-engineers-view-on-philosophy/swizec/1333#comments</comments>
		<pubDate>Wed, 12 May 2010 12:23:31 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[Philosophers]]></category>
		<category><![CDATA[Philosophy]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1333</guid>
		<description><![CDATA[



Image via Wikipedia



Disclaimer: I am writing this on my phone while walking to work
Reading a funny comic  on philosophy vs. engineering and a short discourse on twitter has got me to thinking.
Just why is there such a huge divide between engineers and philosophers?
Because philosophers are annoying brats.
Most of it comes from their general inability to [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Aristotle_Altemps_Inv8575.jpg" rel="lightbox[1333]"><img title="Bust of Aristotle. Marble, Roman copy after a ..." src="http://swizec.com/blog/wp-content/uploads/2010/05/300px-Aristotle_Altemps_Inv8575.jpg" alt="Bust of Aristotle. Marble, Roman copy after a ..." width="300" height="401" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Aristotle_Altemps_Inv8575.jpg" rel="lightbox[1333]">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Disclaimer: I am writing this on my phone while walking to work</p>
<p>Reading a <a href="http://www.smbc-comics.com/index.php?db=comics&amp;id=1879#comic">funny comic  on philosophy vs. engineering</a> and a short discourse on twitter has got me to thinking.</p>
<p>Just why is there such a huge divide between engineers and philosophers?</p>
<p>Because philosophers are annoying brats.</p>
<p>Most of it comes from their general inability to actually think, that is to say, consider all the variables.</p>
<p>For example, a philosopher will natter on and on about how a copy of a copy is an original and completely indistinguishable from the original and arguing that it is now magically impossible to tell which came first.</p>
<p>All the while programmers have been copying variables left and right to good use and distinguishing them quite well for over 60 years.</p>
<p>The philosophers still don&#8217;t quite know whether a copy is an original or a copy.</p>
<p>Now while I do think philosophy has made some marvelous contributions to our society &#8211; like inventing mathematics, most of the time it&#8217;s just about being a colossal brat and regurgitating memorised thousands of years of actual thinking to look smart.</p>
<p>Then again, like a guitar, a good way to impress chicks.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/4020dd1e-ac80-4db8-b431-2f8bff7b0eda/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=4020dd1e-ac80-4db8-b431-2f8bff7b0eda" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/an-engineers-view-on-philosophy/swizec/1333/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Freelance teaching is great, or why C/Java/etc. are horrible teaching tools</title>
		<link>http://swizec.com/blog/freelance-teaching-is-great-or-why-cjavaetc-are-horrible-teaching-tools/swizec/1326</link>
		<comments>http://swizec.com/blog/freelance-teaching-is-great-or-why-cjavaetc-are-horrible-teaching-tools/swizec/1326#comments</comments>
		<pubDate>Mon, 03 May 2010 14:38:06 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Education]]></category>
		<category><![CDATA[food for thought]]></category>
		<category><![CDATA[Language]]></category>
		<category><![CDATA[Learning]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Teacher]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1326</guid>
		<description><![CDATA[



Image via Wikipedia



Seriously why aren&#8217;t there more teachers in the world? What a bunch of charlatans.
But I&#8217;m getting ahead of myself in this story.
Last week I was doing a lot of freelancing as a teacher and instructor in the dark arts of programming. There was this kid who desperately wanted to get a passing grade [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Jordanhill_college.jpg" rel="lightbox[1326]"><img title="Main Building" src="http://swizec.com/blog/wp-content/uploads/2010/05/300px-Jordanhill_college.jpg" alt="Main Building" width="300" height="225"></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Jordanhill_college.jpg" rel="lightbox[1326]">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Seriously why aren&#8217;t there more teachers in the world? What a bunch of charlatans.</p>
<p>But I&#8217;m getting ahead of myself in this story.</p>
<p>Last week I was doing a lot of freelancing as a teacher and instructor in the <a class="zem_slink freebase/guid/9202a8c04000641f80000000001c8c10" title="Magic in Harry Potter" rel="wikipedia" href="http://en.wikipedia.org/wiki/Magic_in_Harry_Potter">dark arts</a> of <a class="zem_slink freebase/en/computer_programming" title="Computer programming" rel="wikipedia" href="http://en.wikipedia.org/wiki/Computer_programming">programming</a>. There was this kid who desperately wanted to get a passing grade on a test this Wednesday. And there was this guy with a hat who has never in his life done any teaching and has spent all his life adamantly convinced he&#8217;s got no patience of such things. But he could do with some money in his pockets.</p>
<p>So the story begins. We had a three hour session almost every day and an even better reward than the easiest lump of money I ever made, was the fact that kid suggested, and seriously meant it, that I should think about becoming a teacher when I &#8220;grow up&#8221;. It was truly quite marvelous.</p>
<p>And all I did was explain some basic things to him and make him think.</p>
<p>Which brings us to the next question. Why was it that this poor bastard who has spent almost a year at the hands of professional teachers even needed someone to explain to him how a <a class="zem_slink freebase/en/for_loop" title="For loop" rel="wikipedia" href="http://en.wikipedia.org/wiki/For_loop">for loop</a> works? How to distill an <a class="zem_slink freebase/en/algorithm" title="Algorithm" rel="wikipedia" href="http://en.wikipedia.org/wiki/Algorithm">algorithm</a> out of a problem description? How to &#8230; stuff?</p>
<p>I mean, seriously. What the hell!?</p>
<p>They trouble these young dudes with details like variable types, function prototypes and the fact that this thing called Dev-C needs a System(&#8220;PAUSE&#8221;) at the end.</p>
<p>All the while they don&#8217;t even understand that a variable will just keep its value and that this (and loops) is the basic principle behind everything a computer does and that you can change the way a computer does something by tweaking values in variables.</p>
<div class="zemanta-img zemanta-action-dragged" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px; float: left">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Ataturkstatue.jpg" rel="lightbox[1326]"><img title="Ataturk teaching the children of Turkey the La..." src="http://swizec.com/blog/wp-content/uploads/2010/05/300px-Ataturkstatue.jpg" alt="Ataturk teaching the children of Turkey the La..." width="300" height="236"></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Ataturkstatue.jpg" rel="lightbox[1326]">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Pretty pathetic if you ask me.</p>
<p>When I was a little dude in that kid&#8217;s shoes I hated flowcharts and I hated everything to do with real programming. All I wanted to do was pump out functioning code. But the thing is, far before that there was somebody to instill The Way a Programmer Thinks in my head. I already knew most of the basic stuff.</p>
<p>But for those who don&#8217;t understand thinking like a programmer. Who can&#8217;t empathise with a computer. They need a different learning method and schools and universities (at least around here) are horrible when it comes to that. All they ever do at school is try teaching you languages before you even learn how to talk.</p>
<p>Ever tried speaking a foreign language right out of the dictionary?</p>
<p>That&#8217;s how people try to teach you programming these days.</p>
<p>It sucks and it&#8217;s got to change.</p>
<p>Personally I think pupils should be taught to do nothing but programming for at least a year when they start. Then, maybe, they could start getting into coding.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/f7e63a2f-e5c1-42f3-acc6-9af9df602967/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=f7e63a2f-e5c1-42f3-acc6-9af9df602967" alt="Reblog this post [with Zemanta]"></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/freelance-teaching-is-great-or-why-cjavaetc-are-horrible-teaching-tools/swizec/1326/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tracking runs is fun! :D</title>
		<link>http://swizec.com/blog/tracking-runs-is-fun-d/swizec/1322</link>
		<comments>http://swizec.com/blog/tracking-runs-is-fun-d/swizec/1322#comments</comments>
		<pubDate>Fri, 30 Apr 2010 07:52:36 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[GPS]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[running]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1322</guid>
		<description><![CDATA[Today I finally figured out how to get sportypal working. Tomorrow I&#8217;m testing the hypotesis to make sure it wasn&#8217;t a one-time fluke.
The trick is to start it up when you&#8217;re home. Then after the warmup walk kill it and open it again. This time GPS connect is instant.
But the true lesson for today is [...]]]></description>
			<content:encoded><![CDATA[<p>Today I finally figured out how to get sportypal working. Tomorrow I&#8217;m testing the hypotesis to make sure it wasn&#8217;t a one-time fluke.</p>
<p>The trick is to start it up when you&#8217;re home. Then after the warmup walk kill it and open it again. This time GPS connect is instant.</p>
<p>But the true lesson for today is that tracking runs is FUN. I even got a map and everything <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  Sure it looks a bit weird where it decided I was running zigzag through houses and trees and cars and garages and pretty much everything at a sooper speed of <strong>30! </strong>kilometers per hour.</p>
<p>But hey, it&#8217;s a blackberry not an iPhone (or Android), so I shan&#8217;t complain. I&#8217;m just glad I can finally use this crap.</p>
<p>Hmmm &#8230; for some reason wordpress won&#8217;t let me embed the map, so here&#8217;s a screenshot.</p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-30-at-9.51.27-AM.png" rel="lightbox[1322]"><img class="alignnone size-full wp-image-1323" title="Screen shot 2010-04-30 at 9.51.27 AM" src="http://swizec.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-30-at-9.51.27-AM.png" alt="" width="799" height="529" /></a></p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/7512ac06-9c72-4184-92e8-eafed79ca5bd/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=7512ac06-9c72-4184-92e8-eafed79ca5bd" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/tracking-runs-is-fun-d/swizec/1322/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>First hike of the season</title>
		<link>http://swizec.com/blog/first-hike-of-the-season/swizec/1317</link>
		<comments>http://swizec.com/blog/first-hike-of-the-season/swizec/1317#comments</comments>
		<pubDate>Mon, 26 Apr 2010 12:09:38 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[Hiking]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Outdoors]]></category>
		<category><![CDATA[Recreation]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1317</guid>
		<description><![CDATA[For the past &#60;all of my life&#62; years I&#8217;ve been forced to go hiking now and anon by my nature nutter mum.
Then last year I started contracting the bug and sort of wanted to go a few times.
This year I totally want to go for a good hike at least once a month.
Weird right? Does [...]]]></description>
			<content:encoded><![CDATA[<p>For the past &lt;all of my life&gt; years I&#8217;ve been forced to go hiking now and anon by my nature nutter mum.</p>
<p>Then last year I started contracting the bug and sort of <em>wanted</em> to go a few times.</p>
<p>This year I totally want to go for a good hike at least once a month.</p>
<p>Weird right? Does this mean I&#8217;m getting old? Or just that I spend too much time inside?</p>
<p>Whatever it is, yesterday the girlfriend and I went for a lovely hike. The first of the season. The destination was this <a class="zem_slink freebase/en/observation_tower" title="Observation tower" rel="wikipedia" href="http://en.wikipedia.org/wiki/Observation_tower">observation tower</a> thing upon some hill above Vrhnika.</p>
<p><a href="http://foursquare.com/venue/2957164">I foursquared</a> when we were there of course <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
<p>The hike was quite lovely through some woods and such, many birds were chirping and there were no mammals in sight except for some cyclist a dog or two and a few children. There were also some humans.</p>
<p>An hour of walking each way &#8230; it hurt a lot more than I thought it would. No soreness today, but it was surprisingly hard yesterday and I felt strangely sleepy as early as midnight. Maybe I&#8217;m just not at all in shape yet?</p>
<p>Anyhow, here are two photos of the purdiful view we got from the top of the tower.</p>

<a href='http://swizec.com/blog/first-hike-of-the-season/swizec/1317/img00363' title='IMG00363'><img width="150" height="150" src="http://swizec.com/blog/wp-content/uploads/2010/04/IMG00363-150x150.jpg" class="attachment-thumbnail" alt="" title="IMG00363" /></a>
<a href='http://swizec.com/blog/first-hike-of-the-season/swizec/1317/img00364' title='IMG00364'><img width="150" height="150" src="http://swizec.com/blog/wp-content/uploads/2010/04/IMG00364-150x150.jpg" class="attachment-thumbnail" alt="" title="IMG00364" /></a>

<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/5cdcd674-ba89-409a-9ee9-fa1a55421f7c/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=5cdcd674-ba89-409a-9ee9-fa1a55421f7c" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/first-hike-of-the-season/swizec/1317/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Do you memento mori?</title>
		<link>http://swizec.com/blog/do-you-memento-mori/swizec/1313</link>
		<comments>http://swizec.com/blog/do-you-memento-mori/swizec/1313#comments</comments>
		<pubDate>Wed, 21 Apr 2010 10:17:36 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Carpe Diem]]></category>
		<category><![CDATA[Carpe Noctem]]></category>
		<category><![CDATA[Death]]></category>
		<category><![CDATA[food for thought]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Steve Jobs]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1313</guid>
		<description><![CDATA[Today I read a nice post about the 6 myths that stand in your way. And there was one that stood out the most
Myth: There is time
Reality: You have less time now than you have ever had. You have less time now than you had an hour ago. You are nearer to your death than [...]]]></description>
			<content:encoded><![CDATA[<p>Today I read a nice post about the <a href="http://laz.ly/Nc" target="_blank">6 myths that stand in your way.</a> And there was one that stood out the most</p>
<blockquote><p><strong>Myth:</strong> There is time</p>
<p><strong>Reality:</strong> You have less time now than you have ever had. You have less time now than you had an hour ago. You are nearer to your death than you have ever been. Plan thoroughly, but don’t wait too long before taking action.</p></blockquote>
<p>And then when you remember that <a class="zem_slink freebase/en/steve_jobs" title="Steve Jobs" rel="imdb" href="http://www.imdb.com/name/nm0423418/">Steve Jobs</a> had a speech devoted almost completely to this notion of memento mori.<br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="480" height="385" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/UF8uR6Z6KLc&amp;hl=en_US&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="480" height="385" src="http://www.youtube.com/v/UF8uR6Z6KLc&amp;hl=en_US&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></p>
<p>Hell, the Romans came up with the whole memento mori crap far far ago &#8230; I forget how the tradition went, but they used to punch winning generals in the face or something &#8230; or was it that a slave was following them through the whole festivity whispering &#8220;memento mori&#8221; in their ear. Something like that.</p>
<p>Then there&#8217;s that tradition in greek weedings (judging from <a class="zem_slink freebase/en/my_big_fat_greek_wedding" title="My Big Fat Greek Wedding" rel="anyclip" href="http://anyclip.com/my-big-fat-greek-wedding">Big Fat Greek Wedding</a>) where the bride is thrown off her chair &#8211; just to remind her she&#8217;s mortal too.</p>
<p>And way back when some smart poetry geek came up with the idea of <a class="zem_slink freebase/en/carpe_diem" title="Carpe diem" rel="wikipedia" href="http://en.wikipedia.org/wiki/Carpe_diem">Carpe Diem</a> (later transformed to <a class="zem_slink freebase/guid/9202a8c04000641f8000000000984a89" title="Carpe Noctem (Angel episode)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Carpe_Noctem_%28Angel_episode%29">Carpe Noctem</a> and Carpe Pijem, the slovene version). Again basically the same concept!</p>
<p>Then there&#8217;s an interesting story I read on a forum once, it happened to a forumite&#8217;s cousin or somesuch:</p>
<blockquote><p>She was a lass, around 23 years of age. Two lovely children, a loving husband, nice house and so on. One day they have a fight over something extremely mundane and boring. She gets pissed off and storms out of the house &#8230; only to be mowed down by a truck.</p>
<p>To death.</p></blockquote>
<p>So yeah, I know as <a class="zem_slink freebase/en/human" title="Human" rel="wikipedia" href="http://en.wikipedia.org/wiki/Human">humans</a> we like to think we&#8217;re something special, that each and everyone of us is a special little snowflake unique and wonderful in their own right.</p>
<p>Well you&#8217;re not. You too will die, today, tomorrow, in an hour, it doesn&#8217;t matter.</p>
<p>And nothing of value will be lost!</p>
<p>Nothing!</p>
<p>Nobody will care, absolutely nobody.</p>
<p>I think people often forget these things and spend their whole lives doing boring shit they don&#8217;t care about. Stop that!</p>
<p>For the end, a quote from <a class="zem_slink freebase/en/anthony_de_mello" title="Anthony de Mello" rel="wikipedia" href="http://en.wikipedia.org/wiki/Anthony_de_Mello">Anthony de Mello</a>:</p>
<blockquote><p>Most people, even though they don’t know it, are asleep. They’re born asleep, they marry in their sleep, they breed children in their sleep, they die in their sleep without ever waking up</p></blockquote>
<p>But that just brings to mind this:</p>
<p><img class="alignnone" title="xkcd subway scene" src="http://swizec.com/blog/wp-content/uploads/2010/04/sGMHosUzGq3f97umNNcaQBvXo1_500.png" alt="" width="500" height="533" /></p>
<p>I dunno, just remember that whatever you do, all your life, you&#8217;re on the verge of imminent death. Never forget.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/41235a64-4632-4197-837a-31060887dedf/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=41235a64-4632-4197-837a-31060887dedf" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/do-you-memento-mori/swizec/1313/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The sad state of BlackBerry apps</title>
		<link>http://swizec.com/blog/the-sad-state-of-blackberry-apps/swizec/1309</link>
		<comments>http://swizec.com/blog/the-sad-state-of-blackberry-apps/swizec/1309#comments</comments>
		<pubDate>Mon, 19 Apr 2010 10:44:05 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[BlackBerry]]></category>
		<category><![CDATA[food for thought]]></category>
		<category><![CDATA[Handhelds]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[RunKeeper]]></category>
		<category><![CDATA[Smartphone]]></category>
		<category><![CDATA[SportyPal]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1309</guid>
		<description><![CDATA[



Image via CrunchBase



This morning just as I was battling with the question of going for a morning run or not I came across this facebook status
&#60;a status I am currently unable to find&#62;
But anyway, it was of something called @runkeeper and a dude reported he just ran 0.00 kilometers.
So why would this matter?
Because it gave [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 260px;">
<dt class="wp-caption-dt"><a href="http://www.crunchbase.com/product/iphone"><img title="Image representing iPhone as depicted in Crunc..." src="http://swizec.com/blog/wp-content/uploads/2010/04/19797v1-max-250x250.jpg" alt="Image representing iPhone as depicted in Crunc..." width="250" height="195" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://www.crunchbase.com">CrunchBase</a></dd>
</dl>
</div>
</div>
<p>This morning just as I was battling with the question of going for a morning run or not I came across this facebook status</p>
<blockquote><p>&lt;a status I am currently unable to find&gt;</p></blockquote>
<p>But anyway, it was of something called @runkeeper and a dude reported he just ran 0.00 kilometers.</p>
<p>So why would this matter?</p>
<p>Because it gave me the idea that hey, if I tracked my runs I could get empirical data on what I&#8217;m doing and being the geek that I am this would inspire me to run more, harder and oftener.</p>
<p>Yayz! \o/</p>
<p>Then I went looking for this <a class="zem_slink" title="RunKeeper" rel="homepage" href="http://runkeeper.com/">RunKeeper</a> app &#8230; well whaddya know, it only exists for <a class="zem_slink freebase/en/iphone" title="iPhone" rel="homepage" href="http://www.apple.com/iphone">iPhones</a>, who cares about you dirty <a class="zem_slink freebase/en/blackberry" title="BlackBerry" rel="homepage" href="http://www.blackberry.com">BlackBerry</a> users. You all suck anyway, you never do cool things! (gee I wonder why)</p>
<p>Well, after minutes upon minutes upon minutes upon dirty minutes of looking for something I finally came across an app that supports blackberries in the seedy underbelly of the internet&#8217;s shady alleys where drug dealing pederast&#8217;s push their wares.</p>
<p>It is called SportyPal.</p>
<p>Hoorah!</p>
<p>I downloaded it, fired it up and went for my run. After half an hour I come back home, look at the app and &#8230; why the flying shit is this? The stupid thing didn&#8217;t even manage to start getting GPS data during this time. Yep, 30 minutes of running and it didn&#8217;t even <em>begin</em> tracking anything.</p>
<p>Then two minutes later it failed with a &#8220;I&#8217;m sorry&#8221;</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/740d9278-a559-4fb4-9cca-c2da19eeb5b1/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=740d9278-a559-4fb4-9cca-c2da19eeb5b1" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/the-sad-state-of-blackberry-apps/swizec/1309/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>A little bit of burn out? Perhaps</title>
		<link>http://swizec.com/blog/a-little-bit-of-burn-out-perhaps/swizec/1304</link>
		<comments>http://swizec.com/blog/a-little-bit-of-burn-out-perhaps/swizec/1304#comments</comments>
		<pubDate>Thu, 15 Apr 2010 15:59:39 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[life]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1304</guid>
		<description><![CDATA[This whole week has been one sluggish lazy blur.




Image by Archman8 via Flickr



Yes I know it&#8217;s only Thursday.
All week the earliest I ventured outside the apartment was at noon. And I just didn&#8217;t do anything very productive at all for some reason. Whenever I did do some work it was at a slow leisurely pace. [...]]]></description>
			<content:encoded><![CDATA[<p>This whole week has been one sluggish lazy blur.</p>
<div class="zemanta-img zemanta-action-dragged" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 190px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/27674701@N00/2597952748"><img title="IMG_0067a" src="http://swizec.com/blog/wp-content/uploads/2010/04/2597952748_4ae4250c21_m.jpg" alt="IMG_0067a" width="180" height="240" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/27674701@N00/2597952748">Archman8</a> via Flickr</dd>
</dl>
</div>
</div>
<p>Yes I know it&#8217;s only Thursday.</p>
<p>All week the earliest I ventured outside the apartment was at noon. And I just didn&#8217;t do anything very productive at all for some reason. Whenever I did do some work it was at a slow leisurely pace. A few clicks here. Tap tap there. Point point test yonder.</p>
<p>Like, for example, instead of working hard on building a testing framework for my machine learning frameworks last night I &#8230; invited the girlfriend over, had a nice and comfortable dinner (unfortunately not a very tasty one) then watched a movie or somesuch and went to bed earlier than midnight.</p>
<p>No, cuddling is not being productive.</p>
<p>And today we watched television, TELEVISION, until something like 12 o&#8217;clock and went off into the great wide open to find new adventures.</p>
<p>Yep, the whole week has been one big lazy yawn with a bit of running and exercise and a little productivity. Hell, it&#8217;s already Thursday and I&#8217;ve only been productive 43 hours this week! Ew! If I didn&#8217;t love it so much I&#8217;d almost be disgusted with myself.</p>
<div class="zemanta-img" style="margin: 1em; display: block; float: left">
<div>
<dl class="wp-caption alignright" style="width: 250px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/31355686@N00/2715700690"><img title="20080523 - computer - 1 - 157-5735 - stickers" src="http://swizec.com/blog/wp-content/uploads/2010/04/2715700690_c7f92c51d2_m.jpg" alt="20080523 - computer - 1 - 157-5735 - stickers" width="240" height="156" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/31355686@N00/2715700690">Rev. Xanatos Satanicos Bombasticos (ClintJCL)</a> via Flickr</dd>
</dl>
</div>
</div>
<p>But truth be told, I absolutely needed a week just like this. I don&#8217;t really deal well with proper vacations, get too bored. So this is perfect for me, have a week like normal people for once.</p>
<p>It&#8217;s nice. Guilty pleasures are always the bestest.</p>
<p>Do people really survive their whole lives on only 9-ish hours of productivity every day <em>excluding</em> weekends?</p>
<p>I don&#8217;t know if I can really believe that &#8230; someone enlighten me.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/e75fbbbc-72f4-4135-9719-2426e4b36267/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=e75fbbbc-72f4-4135-9719-2426e4b36267" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/a-little-bit-of-burn-out-perhaps/swizec/1304/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Processing as-you-read in clojure</title>
		<link>http://swizec.com/blog/1294/swizec/1294</link>
		<comments>http://swizec.com/blog/1294/swizec/1294#comments</comments>
		<pubDate>Mon, 12 Apr 2010 10:01:48 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[Clojure]]></category>
		<category><![CDATA[Function]]></category>
		<category><![CDATA[Java]]></category>
		<category><![CDATA[Languages]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1294</guid>
		<description><![CDATA[



Image via Wikipedia



Sometimes we&#8217;re given a stupid algorithm or two to implement at this or that course at uni. This time &#8217;round they wanted us to implement something called external matrix transposition &#8230; the idea is that you have to transpose a matrix live from the hard drive because it is potentially so bloody huge [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:SixHardDriveFormFactors.jpg" rel="lightbox[1294]"><img title="Six hard disk drives with cases opened showing..." src="http://swizec.com/blog/wp-content/uploads/2010/04/300px-SixHardDriveFormFactors.jpg" alt="Six hard disk drives with cases opened showing..." width="300" height="225" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:SixHardDriveFormFactors.jpg" rel="lightbox[1294]">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Sometimes we&#8217;re given a stupid <a class="zem_slink freebase/en/algorithm" title="Algorithm" rel="wikipedia" href="http://en.wikipedia.org/wiki/Algorithm">algorithm</a> or two to implement at this or that course at uni. This time &#8217;round they wanted us to implement something called external <a class="zem_slink freebase/en/matrix" title="Matrix (mathematics)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Matrix_%28mathematics%29">matrix</a> transposition &#8230; the idea is that you have to <a class="zem_slink freebase/en/transpose" title="Transpose" rel="wikipedia" href="http://en.wikipedia.org/wiki/Transpose">transpose</a> a matrix live from the <a class="zem_slink freebase/en/hard_disk" title="Hard disk drive" rel="wikipedia" href="http://en.wikipedia.org/wiki/Hard_disk_drive">hard drive</a> because it is potentially so bloody huge you can&#8217;t store a single row in memory.</p>
<p>Which is a bit silly, who&#8217;s got 60+ gig huge matrixes these days? You&#8217;re doing it wrong if you need that many dimensions! VERY wrong!</p>
<p>But anyway, what really struck me as a bit silly is that they were big nazis when it comes to how we&#8217;re supposed to do this. Needs to compile with their specific command, can only be done in <a class="zem_slink freebase/guid/9202a8c04000641f800000000f8545aa" title="Java (programming language)" rel="homepage" href="http://java.sun.com">Java</a> or C/C++ &#8230; yeah fuck you and fuck your grade, let&#8217;s <em>learn</em> something.</p>
<p>So I went and did it in <a class="zem_slink freebase/en/clojure" title="Clojure" rel="homepage" href="http://clojure.org">Clojure</a> &#8230; well not really since I didn&#8217;t finish, but I came close.</p>
<p>Surprisingly, it is in fact very <em>very</em> hard to process data live as it&#8217;s being read in a functional environment. Every library that&#8217;s already out there open-read-closes the file, at best you get something that can read lines and allows you to work on every line as it&#8217;s being read, but oh no, not characters. Nope, what sort of bloody idiot would want <em>that</em>?</p>
<p>Well &#8230; me.</p>
<p>So here is my implementation, probably not the most elegant thing out there since I&#8217;m new to this, of what Java people call &#8220;nextInt&#8221;. It returns the next integer in a file as a proper integer and so on.</p>

<div class="wp_syntax"><div class="code"><pre class="clojure" style="font-family:monospace;">(ns io (:require [clojure.contrib.io :as io]))
&nbsp;
(defn read-char [rdr]
   (char (.read rdr)))
&nbsp;
(defn delimiter? [c]
  (if (or (&amp;lt; (int c) (int '\0)) (&amp;gt; (int c) (int '\9)) (= c nil)) true false))
&nbsp;
(defn digit [c place]
  (* (- (int c) 48) (Math/pow 10 (- place 1))))
&nbsp;
(defn numify [seq acc]
  (if (= seq nil)
    (int acc)
    (numify (next seq)
	    (+ acc (digit (first seq) (count seq))))))
&nbsp;
(defn read-number [rdr acc]
  (let [c (read-char rdr)]
    (if (delimiter? c)
      (numify acc 0)
      (read-number rdr (concat acc [c])))))</pre></div></div>

<p>You call it with an open reader and an empty [] thingy because, the latter because I couldn&#8217;t figure out optional <a class="zem_slink freebase/guid/9202a8c04000641f800000000f117fa8" title="Function (mathematics)" rel="wikipedia" href="http://en.wikipedia.org/wiki/Function_%28mathematics%29">function</a> arguments.</p>
<p>And if anyone&#8217;s interested, here&#8217;s the rest of the code that opens a file where the first number denotes the number of columns in the matrix and then contains the rest of it delimited with spaces or tabs or anything non-numerical, and copies every row into a separate file so a transposition can then be done (didn&#8217;t quite get to this part)</p>

<div class="wp_syntax"><div class="code"><pre class="clojure" style="font-family:monospace;">(defn copy-number [rdr writer]
  (.write writer (str (read-number rdr []) &quot; &quot;)))
&nbsp;
(defn copy-row [rdr writer i]
  (copy-number rdr writer)
  (if (&amp;gt; i 1) (copy-row rdr writer (dec i))))
&nbsp;
(defn break-row [rdr i columns]
  (try
   (with-open [writer (io/writer (str &quot;podatki-0-&quot; i))]
     (copy-row rdr writer columns))
   (break-row rdr (inc i) columns)
  (catch Exception e
    nil)))
&nbsp;
(defn transpose-matrix [file-name]
  (with-open [rdr (io/reader file-name)]
    (let [columns (read-number rdr [])]
      (break-row rdr 0 columns))))
&nbsp;
(transpose-matrix &quot;/home/swizec/Documents/APS2/input.txt&quot;)</pre></div></div>

<p>PS: that try/catch in there is fugly, but I didn&#8217;t know how else to check for EOF *blush*</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/40a33885-b638-42dc-8b23-c0933a1af6bb/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=40a33885-b638-42dc-8b23-c0933a1af6bb" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/1294/swizec/1294/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>How long is your coding schlong?</title>
		<link>http://swizec.com/blog/how-long-is-your-coding-schlong/swizec/1287</link>
		<comments>http://swizec.com/blog/how-long-is-your-coding-schlong/swizec/1287#comments</comments>
		<pubDate>Wed, 07 Apr 2010 18:15:22 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1287</guid>
		<description><![CDATA[Every now and then a new silly service pops up that helps people measure the length of their penis and compare it to others without being &#8230; you know &#8230; very ew about it.
&#8217;cause nobody wants that
nope.
So one of these days, doesn&#8217;t really matter when, but I found out about it today, a new service [...]]]></description>
			<content:encoded><![CDATA[<p>Every now and then a new silly service pops up that helps people measure the length of their penis and compare it to others without being &#8230; you know &#8230; very ew about it.</p>
<p>&#8217;cause nobody wants that</p>
<p>nope.</p>
<p>So one of these days, doesn&#8217;t really matter when, but I found out about it today, a new service called MyTechne popped up out of the blue &#8230; and oh great, Zemanta just flashed me with a bunch of dicks in the recommendations media gallery, thanks guise &#8230;</p>
<p>The point is that you sign up and create a collection of all the different programming languages you&#8217;ve ever used and when you used them and so on and so forth. Marvelous!</p>
<p>Now the age long debate of who has the biggest coding schlong over at the pub can get fucking substantiated. Why try to remember everything when you&#8217;re drunk out of your mind? Just pull out an internet and SHOW them.</p>
<p>As Hugh Laurie would say in Blackadder&#8217;s fourth series: Hoorah!!</p>
<p>Anyway, here&#8217;s <a href="http://mytechne.com/user/Swizec/">my coding schlong</a> if anyone&#8217;s interested. For the love of god DO show me yours in the comments alright. Cheers.</p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-07-at-4.21.12-PM.png" rel="lightbox[1287]"><img class="alignnone size-full wp-image-1288" src="http://swizec.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-07-at-4.21.12-PM.png" alt="" width="925" height="627" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/how-long-is-your-coding-schlong/swizec/1287/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I justified a weekend of videogaming and gorging as an exercise in hardcore personal improvement</title>
		<link>http://swizec.com/blog/how-i-justified-a-weekend-of-videogaming-and-gorging-as-an-exercise-in-hardcore-personal-improvement/swizec/1282</link>
		<comments>http://swizec.com/blog/how-i-justified-a-weekend-of-videogaming-and-gorging-as-an-exercise-in-hardcore-personal-improvement/swizec/1282#comments</comments>
		<pubDate>Tue, 06 Apr 2010 15:24:25 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[intrigues]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Richard Burns Rally]]></category>
		<category><![CDATA[Yungas Road]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1282</guid>
		<description><![CDATA[



Image via Wikipedia



And thus the three day easter weekend is behind us.
Finally.
Was getting a bit long to be honest.
But what&#8217;s more important than this is what I spent most of my weekend doing &#8211;&#62; Videogames and piles upon piles of omnom yummy foods. Mostly junk foods like bits of smoked pigs and copious amounts of [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Bolivia_Yunga_Road.jpg" rel="lightbox[1282]"><img title="Yungas Road in Bolivia" src="http://swizec.com/blog/wp-content/uploads/2010/04/300px-Bolivia_Yunga_Road.jpg" alt="Yungas Road in Bolivia" width="300" height="400" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Bolivia_Yunga_Road.jpg" rel="lightbox[1282]">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>And thus the three day easter weekend is behind us.</p>
<p>Finally.</p>
<p>Was getting a bit long to be honest.</p>
<p>But what&#8217;s more important than this is what I spent most of my weekend doing &#8211;&gt; Videogames and piles upon piles of omnom yummy foods. Mostly <a class="zem_slink freebase/en/junk_food" title="Junk food" rel="wikipedia" href="http://en.wikipedia.org/wiki/Junk_food">junk foods</a> like bits of smoked pigs and copious amounts of chocolate &#8230; very little eggs though, that&#8217;s a bit silly considering easter is supposed to be all about eggs.</p>
<p>No matter, food was omnom.</p>
<p>Now, how can a guy justify wasting so many hours on something as simple as <a class="zem_slink freebase/en/video_game" title="Video game" rel="wikipedia" href="http://en.wikipedia.org/wiki/Video_game">videogames</a>? Well, I could say I was trying to have fun &#8230; but that&#8217;s a cop out, way too easy.</p>
<p>The most importantest thing is the mechanics of my adventures. The game I was playing was <a class="zem_slink freebase/en/richard_burns_rally" title="Richard Burns Rally" rel="wikipedia" href="http://en.wikipedia.org/wiki/Richard_Burns_Rally">Richard Burns Rally</a>, known far and wide as being one of the most, if not <em>the</em> most, difficult and realistic rally simulation games. The map I was playing was Mineshaft from Australia, in my humble opinion the hardest fucking map in the whole game.</p>
<p>See in most of the maps you drive in some forrest or something and the worst that can happen is you ram a tree or lose time by going a bit wide and over some grass or something.</p>
<p>But Mineshaft is different. Most of that damn thing is comprised of a road with a sheer drop cliff on one side and a cliff on the other. It&#8217;s a bit like trying to rally over the <a class="zem_slink freebase/en/yungas_road" title="Yungas Road" rel="wikipedia" href="http://en.wikipedia.org/wiki/Yungas_Road">Yungas Road</a> (most dangerous road in the world FYI).</p>
<p>So what the fuck are you rambling about Swizec. Just get on with the fucking point already sheesh!</p>
<p>Alright alright. <img src='http://swizec.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>My point is that ALL I did. For SEVERAL fucking hours. Was. Play. Richard Burns Rally. On. The. Hardest. Map.</p>
<p>But why on god&#8217;s fucking earth would you do something like that?</p>
<p>Well, because I could.</p>
<p>But the important bit is why I wanted to. The game is insane to play on keyboards and needless to say I never once survived to the end of the map. Out of ~200 plays. I never once finished.</p>
<p>Wtf, masochist?</p>
<p>No. Through endless repetition and stupid iteration I learned. I learned a whole fucking lot! By the time I got fed up with playing I was habitually achieving mid times several seconds faster than the world record for that stage. Yes, the realistic world record.</p>
<p>*gasp* *shocker*</p>
<p>But I still didn&#8217;t finish, so the quest continues.</p>
<p>My point is that this little experience teaches us a lot about life, the universe and everything. <span style="font-size: 1.5em;"><strong>Life is a series of insurmountable obstacles on the road to imminent disaster</strong></span></p>
<p>And that is all. Remember that. Whenever you are failing in life, you&#8217;re not failing, you&#8217;re <em>learning</em>. That&#8217;s what it&#8217;s all about. The more you fail the better a person you become, those times you dont&#8217; fail you haven&#8217;t learned a single thing. So stop that.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/ef748e69-9a88-46da-a6e5-f4d35edc270b/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=ef748e69-9a88-46da-a6e5-f4d35edc270b" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/how-i-justified-a-weekend-of-videogaming-and-gorging-as-an-exercise-in-hardcore-personal-improvement/swizec/1282/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The creepiest fucking image ever!</title>
		<link>http://swizec.com/blog/the-creepiest-fucking-image-ever/swizec/1270</link>
		<comments>http://swizec.com/blog/the-creepiest-fucking-image-ever/swizec/1270#comments</comments>
		<pubDate>Tue, 30 Mar 2010 12:11:29 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1270</guid>
		<description><![CDATA[Sometimes I wonder how to tell that I really exist, so imagine my creeped-out-edness when I found this.

]]></description>
			<content:encoded><![CDATA[<p>Sometimes I wonder how to tell that I really exist, so imagine my creeped-out-edness when I found this.</p>
<p><a href="http://swizec.com/blog/wp-content/uploads/2010/03/1269949052928.jpg" rel="lightbox[1270]"><img class="alignnone size-full wp-image-1279" title="1269949052928" src="http://swizec.com/blog/wp-content/uploads/2010/03/1269949052928.jpg" alt="" width="400" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/the-creepiest-fucking-image-ever/swizec/1270/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Yay my blog is up and running again! :D</title>
		<link>http://swizec.com/blog/yay-my-blog-is-up-and-running-again-d/swizec/1266</link>
		<comments>http://swizec.com/blog/yay-my-blog-is-up-and-running-again-d/swizec/1266#comments</comments>
		<pubDate>Mon, 29 Mar 2010 22:06:23 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[Web server]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1266</guid>
		<description><![CDATA[



Image by jimmagz via Flickr



Now this is the story all about how
My blog got flipped, turned upside down
And I&#8217;d like to take a minute just sit right there
I&#8217;ll tell you how I fucked it all up so damn well
In West Apache born and raised
On the playground where it spent most of his days
Chilling out, maxing, [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 250px;">
<dt class="wp-caption-dt"><a href="http://www.flickr.com/photos/22641075@N03/2583922605"><img title="Carlton Banks" src="http://swizec.com/blog/wp-content/uploads/2010/03/2583922605_d074c280da_m.jpg" alt="Carlton Banks" width="240" height="180" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image by <a href="http://www.flickr.com/photos/22641075@N03/2583922605">jimmagz</a> via Flickr</dd>
</dl>
</div>
</div>
<p>Now this is the story all about how<br />
My blog got flipped, turned upside down<br />
And I&#8217;d like to take a minute just sit right there<br />
I&#8217;ll tell you how I fucked it all up so damn well</p>
<p>In West Apache born and raised<br />
On the playground where it spent most of his days<br />
Chilling out, maxing, relaxing all cool<br />
And all serving some blabber outside of the school<br />
When a couple of admins said &#8216;we&#8217;re up in no good&#8217;<br />
Started making trouble in my neighbourhood<br />
I forgot one little date and my blog got scared<br />
And said &#8216;you&#8217;re moving with your aunt and uncle in nginx&#8217;</p>
<p>I begged and pleaded with them the other day<br />
But they packed my suitcase and sent me on my way<br />
They gave me a kissin&#8217; and they gave me my ticket<br />
I put my walkman on and said I might as well kick it</p>
<p>First class, yo this is bad,<br />
Drinking errors juice out of a config glass<br />
Is this what the people of nginx livin&#8217; like,<br />
Hmm this might be alright!</p>
<p>I whistled for a cab and when it came near the<br />
Licensplate said &#8216;Fresh&#8217; and had a dice in the mirror<br />
If anything I could say that this cab was rare<br />
But I thought now forget it, yo home to nginx</p>
<p>I pulled up to a house about seven or eight<br />
And I yelled to the cabby &#8216;Yo, home smell you later&#8217;<br />
Looked at my kingdom I was finally there<br />
To settle my throne as the prince of Bel-Air</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/07d6515b-ed71-417a-b3ee-2bc76a13aaa3/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=07d6515b-ed71-417a-b3ee-2bc76a13aaa3" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/yay-my-blog-is-up-and-running-again-d/swizec/1266/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pure Pwnage is the best show ever</title>
		<link>http://swizec.com/blog/pure-pwnage-is-the-best-show-ever/swizec/1258</link>
		<comments>http://swizec.com/blog/pure-pwnage-is-the-best-show-ever/swizec/1258#comments</comments>
		<pubDate>Mon, 22 Mar 2010 15:37:51 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Insanity]]></category>
		<category><![CDATA[Canada]]></category>
		<category><![CDATA[Games]]></category>
		<category><![CDATA[intrigues]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[Pure Pwnage]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1258</guid>
		<description><![CDATA[



Image via Wikipedia



Hai guise, long time no funky and interesting posting around here.
That&#8217;s all about to change.
&#8216;Cause I&#8217;ve got something incredibly awesome and silly to tell all y&#8217;all.
Remember Pure Pwnage? That show about a gaming dude called Jeremy otherwise known as teh_pwnerer who is followed around by his noob brother Kyle and they make a [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://en.wikipedia.org/wiki/Image:Purepwnage.jpg" rel="lightbox[1258]"><img title="Pure Pwnage" src="http://swizec.com/blog/wp-content/uploads/2010/03/300px-Purepwnage.jpg" alt="Pure Pwnage" width="300" height="245" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://en.wikipedia.org/wiki/Image:Purepwnage.jpg" rel="lightbox[1258]">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Hai guise, long time no funky and interesting posting around here.</p>
<p>That&#8217;s all about to change.</p>
<p>&#8216;Cause I&#8217;ve got something incredibly awesome and silly to tell all y&#8217;all.</p>
<p>Remember <a class="zem_slink freebase/en/pure_pwnage" title="Pure Pwnage" rel="homepage" href="http://www.purepwnage.com">Pure Pwnage</a>? That show about a gaming dude called Jeremy otherwise known as <em>teh_pwnerer </em>who is followed around by his <a class="zem_slink freebase/en/newbie" title="Newbie" rel="wikipedia" href="http://en.wikipedia.org/wiki/Newbie">noob</a> brother Kyle and they make a show?</p>
<p>Yeah that one, the best fucking internet show ever devised by man. I loved that damn thing!</p>
<p>But then it sort of died, with T-Bone&#8217;s crash and everything. It also just so happened to <a class="zem_slink freebase/en/jumping_the_shark" title="Jumping the shark" rel="wikipedia" href="http://en.wikipedia.org/wiki/Jumping_the_shark">jump the shark</a> a little bit even before then. It was much awesomer when everyone still believed Jeremy was Jeremy and Kyle was Kyle and so on. Seriously, it looked totally legit.</p>
<p>Thing was, once they published that they were professionals, alright, doesn&#8217;t hurt the show and Jeremy was still a pretty heavy <a class="zem_slink freebase/en/gamer" title="Gamer" rel="wikipedia" href="http://en.wikipedia.org/wiki/Gamer">gamer</a> IRL anyway. I mean they had to be to know that many jokes about games. Thing was, they suddenly felt the freedom of not having to be constrained by reality and it degraded the quality a bit.</p>
<p>BUT NO MATTER!</p>
<p>Because NOW, oh yeas, yes!, NOW they&#8217;re back! And.</p>
<p>it.</p>
<p>is.</p>
<p>fucking.</p>
<p>awesome!</p>
<p>They finally managed to become a proper TV show so the quality of everything is a bit better, but they&#8217;ve retained the good old format of behind-the-camera Kyle and Jeremy his brother and so on. I watched the season premiere last night and I recommend anyone and everyone who&#8217;s ever played a video game to go download it and give it a good watch.</p>
<p>Unfortunately, yeah, with becoming more proper they&#8217;ve also become moronic about copyright. In the old days you could just go to their site and watch it anywhere in the world. They had a huge worldwide fanbase and they really really took care of us fans methinks. Now you can only watch it from Canada and US or something. A huge waste.</p>
<p>They basically threw away the one thing that made them really popular and successful &#8211; openness. But oh well, at least there&#8217;s piratebay and such.</p>
<h6 class="zemanta-related-title" style="font-size: 1em;">Related articles by Zemanta</h6>
<ul class="zemanta-article-ul">
<li class="zemanta-article-ul-li"><a href="http://www.nationalpost.com/rss/story.html?id=2667931">Pure Pwnage: This is what the nerds&#8217; revenge looks like</a> (nationalpost.com)</li>
</ul>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/d7ffe976-02e2-41e5-b2d3-79a66ad853bb/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=d7ffe976-02e2-41e5-b2d3-79a66ad853bb" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/pure-pwnage-is-the-best-show-ever/swizec/1258/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Student+entrepreneur != hard</title>
		<link>http://swizec.com/blog/studententrepreneur-hard/swizec/1254</link>
		<comments>http://swizec.com/blog/studententrepreneur-hard/swizec/1254#comments</comments>
		<pubDate>Thu, 18 Mar 2010 14:22:37 +0000</pubDate>
		<dc:creator>Swizec</dc:creator>
				<category><![CDATA[Inspiration]]></category>
		<category><![CDATA[Boxing]]></category>
		<category><![CDATA[Business]]></category>
		<category><![CDATA[Entrepreneur]]></category>
		<category><![CDATA[food for thought]]></category>
		<category><![CDATA[Health]]></category>
		<category><![CDATA[life]]></category>
		<category><![CDATA[People]]></category>

		<guid isPermaLink="false">http://swizec.com/blog/?p=1254</guid>
		<description><![CDATA[



Image via Wikipedia



Yesterday I gave a guest talk sort of thing at the Jobfair on my faculty. The point was to perform the function of a live demo for my startup incubator and help them get more startups that way.
My personal point was to get some blokes to go &#8220;HEY! I wanna to help with [...]]]></description>
			<content:encoded><![CDATA[<div class="zemanta-img" style="margin: 1em; display: block; float: right;">
<div>
<dl class="wp-caption alignright" style="width: 310px;">
<dt class="wp-caption-dt"><a href="http://commons.wikipedia.org/wiki/Image:Boxing080905_photoshop.jpg" rel="lightbox[1254]"><img title="Ricardo Dominguez (left) rallied late to win a..." src="http://swizec.com/blog/wp-content/uploads/2010/03/300px-Boxing080905_photoshop.jpg" alt="Ricardo Dominguez (left) rallied late to win a..." width="300" height="185" /></a></dt>
<dd class="wp-caption-dd zemanta-img-attribution" style="font-size: 0.8em;">Image via <a href="http://commons.wikipedia.org/wiki/Image:Boxing080905_photoshop.jpg" rel="lightbox[1254]">Wikipedia</a></dd>
</dl>
</div>
</div>
<p>Yesterday I gave a guest talk sort of thing at the Jobfair on my faculty. The point was to perform the function of a live demo for my startup incubator and help them get more startups that way.</p>
<p>My personal point was to get some blokes to go <em>&#8220;HEY! I wanna to help with that too!&#8221;, </em>which of course did not happen because the audience was mostly electronics and hardware people. But nevertheless, it was a lovely chat.</p>
<p>Although, I noticed a very interesting trend. None of them felt very keen on becoming entrepreneurs while still at uni. They thought it was too hard, that next to classes and studying they don&#8217;t really have time to do anything else. Hell, I even got an almostpplause for being such an impressive lad that I can do both AND keep a girlfriend.</p>
<p>But seriously, it&#8217;s not hard at all. Just take this week&#8217;s Tuesday as an example:</p>
<blockquote><p>On Tuesday I worked for nine hours, five of which were studying/taking a hard maths exam (I count school as work because it&#8217;s my &#8220;job&#8221;). I went to the playhouse and I watched an episode of <a class="zem_slink freebase/guid/9202a8c04000641f80000000004a9577" title="House (TV series)" rel="wikipedia" href="http://en.wikipedia.org/wiki/House_%28TV_series%29">House</a>. I also helped my girlfriend prepare a presentation for school.</p>
<p>And I still went to bed by midnight.</p></blockquote>
<p>See, it&#8217;s <em>that</em> fucking hard!</p>
<p>Not only have I never passed as many exams as I have now that I&#8217;m also an <a class="zem_slink freebase/en/entrepreneur" title="Entrepreneur" rel="wikipedia" href="http://en.wikipedia.org/wiki/Entrepreneur">entrepreneur</a>, I&#8217;ve also taken up a new sport (boxing), which takes six hours out of every week.</p>
<p>Sure it&#8217;s not all fun and games and many people find it difficult to jam 60 to 70 working hours into every week. But if you think being a student and an entrepreneur is hard, you&#8217;re trippin&#8217; man. Seriously.</p>
<p>Just get off yer arse and <em>do</em> it. The television and alcohol can take care of themselves.</p>
<div class="zemanta-pixie" style="margin-top: 10px; height: 15px;"><a class="zemanta-pixie-a" title="Reblog this post [with Zemanta]" href="http://reblog.zemanta.com/zemified/bd314f7b-c5ee-4679-9dac-34dffbed9ae6/"><img class="zemanta-pixie-img" style="border: none; float: right;" src="http://img.zemanta.com/reblog_e.png?x-id=bd314f7b-c5ee-4679-9dac-34dffbed9ae6" alt="Reblog this post [with Zemanta]" /></a><span class="zem-script more-related more-info pretty-attribution"><script src="http://static.zemanta.com/readside/loader.js" type="text/javascript"></script></span></div>
]]></content:encoded>
			<wfw:commentRss>http://swizec.com/blog/studententrepreneur-hard/swizec/1254/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
	</channel>
</rss>
