<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom">
 
  <title>krig</title>
  <link href="http://kri.gs"/>
  <link type="application/atom+xml" rel="self" href="http://kri.gs/atom.xml"/>
  <updated>2013-01-27T12:59:38+01:00</updated>
  <id>http://kri.gs</id>
  <author>
    <name>krig</name>
    <email>atom@koru.se</email>
  </author>

  
  <entry>
    <id>http://kri.gs/2013/01/21/phr-password-generator</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2013/01/21/phr-password-generator/"/>
    <title>Phr Password Generator</title>
    <updated>2013-01-21T22:57:21+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;Here's a quick hack: I wanted a command line utility version of &lt;a href=&quot;http://passphra.se&quot; title=&quot;passphra.se&quot;&gt;passhra.se&lt;/a&gt; so I could use it from a more complicated password/passphrase storage solution I'm working on once in a while. This is an implementation of the ideas expressed in this &lt;a href=&quot;http://xkcd.com/936/&quot; title=&quot;xkcd: Password Strength&quot;&gt;xkcd comic&lt;/a&gt;, to basically forego short random passwords for longer but more human-friendly ones.&lt;/p&gt;

&lt;p&gt;Turns out that once you have a list of english words, this is really easy to do. Here's the python code for my quick hack. Download the &lt;a href=&quot;/text/phrdict.txt&quot; title=&quot;Word list&quot;&gt;word list&lt;/a&gt; and save it as &lt;code&gt;$HOME/.phrdict&lt;/code&gt; (or modify the code below to load the dictionary from another location). The dictionary is just a space-and-newline separated list of words, feel free to modify it to suit your needs.&lt;/p&gt;

&lt;p&gt;All the program does is load the dictionary, pick four words at random from it and print them to the screen.&lt;/p&gt;

&lt;h3&gt;Source code&lt;/h3&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;python&quot;&gt;&lt;span class=&quot;c&quot;&gt;#!/usr/bin/env python&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;os.path&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expanduser&lt;/span&gt;
&lt;span class=&quot;kn&quot;&gt;from&lt;/span&gt; &lt;span class=&quot;nn&quot;&gt;random&lt;/span&gt; &lt;span class=&quot;kn&quot;&gt;import&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;seed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;sample&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;phrdict&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;expanduser&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;#39;~/.phrdict&amp;#39;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;n&quot;&gt;seed&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;bp&quot;&gt;None&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
&lt;span class=&quot;k&quot;&gt;with&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;open&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;phrdict&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;as&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;:&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;words&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;nb&quot;&gt;set&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;nb&quot;&gt;sum&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;([&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;l&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;split&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;l&lt;/span&gt; &lt;span class=&quot;ow&quot;&gt;in&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;read&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;splitlines&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()],&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;[]))&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;print&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;#39; &amp;#39;&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;.&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;join&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;sample&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;words&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;



</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2013/01/19/defer-cpp</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2013/01/19/defer-cpp/"/>
    <title>Another golang defer for C++11</title>
    <updated>2013-01-19T23:44:11+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;blockquote&gt;&lt;p&gt;Note: As I was putting this post together, I noticed that Ignacio Casta&amp;ntilde;o updated his version, linked below, to be pretty much identical to the one I arrived at. I'll take that as confirmation that this variant might actually be valid. :)&lt;/p&gt;&lt;/blockquote&gt;

&lt;h2&gt;DEFER()&lt;/h2&gt;

&lt;p&gt;First of all, here's the code:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;cpp&quot;&gt;&lt;span class=&quot;cp&quot;&gt;#include &amp;lt;functional&amp;gt;&lt;/span&gt;

&lt;span class=&quot;k&quot;&gt;namespace&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;detail&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;typename&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Fn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;struct&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Defer&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Fn&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;Defer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Fn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;:&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;forward&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Fn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;))&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{}&lt;/span&gt;
    &lt;span class=&quot;o&quot;&gt;~&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Defer&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;();&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;};&lt;/span&gt;

  &lt;span class=&quot;k&quot;&gt;template&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;k&quot;&gt;typename&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Fn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;Defer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Fn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;defer_fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Fn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;Defer&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Fn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;std&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;::&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;forward&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;Fn&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;&amp;gt;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fn&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;));&lt;/span&gt;
  &lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;

&lt;span class=&quot;cp&quot;&gt;#define DEFER_1(x, y) x##y&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#define DEFER_2(x, y) DEFER_1(x, y)&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#define DEFER_3(x) DEFER_2(x, __COUNTER__)&lt;/span&gt;
&lt;span class=&quot;cp&quot;&gt;#define DEFER(x) auto DEFER_3(_defer_) = detail::defer_fn([&amp;amp;] { x });&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;h2&gt;Explanation&lt;/h2&gt;

&lt;p&gt;I've seen a few different implementations of a construct resembling the &lt;a href=&quot;http://golang.org&quot; title=&quot;The Go Programming Language&quot;&gt;Go&lt;/a&gt; &lt;code&gt;defer&lt;/code&gt; statement in various degrees, but none of them really felt that great to me. Either they incurred a performance cost due to adding heap allocations via &lt;code&gt;std::function&lt;/code&gt;, or they didn't quite do what I needed.&lt;/p&gt;

&lt;p&gt;I don't know if my attempt is much more appealing, but at least it's fairly simple. I also don't know if it's actually valid C++11. My use of &lt;code&gt;std::forward&lt;/code&gt; and move constructors may be incorrect. I've only tested it on Apple's version of clang 3.1 which ships with Xcode 4.5.&lt;/p&gt;

&lt;p&gt;That said, first of all I should probably explain what &lt;code&gt;defer&lt;/code&gt; does. The statement takes a function call expression as parameter, and calls this function just before exiting the enclosing function. All the deferred expressions within one function are executed in the order they were deferred. A more complete explanation with examples can be found on &lt;a href=&quot;http://golang.org/doc/effective_go.html#defer&quot; title=&quot;Effective Go - Defer&quot;&gt;this page&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;This C++ version superficially equivalent, but is in fact quite different. My use case is a specific one: When dealing with C APIs for resource management like the standard library &lt;code&gt;fopen&lt;/code&gt;/&lt;code&gt;fclose&lt;/code&gt;, it is quite cumbersome to get the code exception safe without creating RAII style wrappers for every API. With this defer implementation, it's usually possible to avoid creating any RAII wrappers, a simple defer statement containing the &lt;code&gt;fclose&lt;/code&gt; call does the trick.&lt;/p&gt;

&lt;p&gt;Three main things are different compared to Go, as far as I can tell:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;In this implementation, a complete block of code can be deferred, not just a function call.&lt;/li&gt;
&lt;li&gt;Deferred blocks are executed in reverse order: the last block to be deferred is executed first.&lt;/li&gt;
&lt;li&gt;Deferred blocks are executed at the end of the nearest enclosing &lt;em&gt;scope&lt;/em&gt;, not function.&lt;/li&gt;
&lt;/ol&gt;


&lt;h2&gt;Examples&lt;/h2&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;cpp&quot;&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;foo&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;kt&quot;&gt;FILE&lt;/span&gt;&lt;span class=&quot;o&quot;&gt;*&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;fopen&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;test.txt&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;s&quot;&gt;&amp;quot;r&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;if&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;==&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;nullptr&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;k&quot;&gt;return&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;DEFER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;fclose&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;f&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;););&lt;/span&gt;
  &lt;span class=&quot;c1&quot;&gt;// use f here&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;This would work as the Go programmer expects. The following example won't:&lt;/p&gt;

&lt;div class=&quot;highlight&quot;&gt;&lt;pre&gt;&lt;code class=&quot;cpp&quot;&gt;&lt;span class=&quot;kt&quot;&gt;void&lt;/span&gt; &lt;span class=&quot;nf&quot;&gt;bar&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;()&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;{&lt;/span&gt;
  &lt;span class=&quot;k&quot;&gt;for&lt;/span&gt; &lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;kt&quot;&gt;int&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;=&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;0&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;&amp;lt;&lt;/span&gt; &lt;span class=&quot;mi&quot;&gt;4&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;;&lt;/span&gt; &lt;span class=&quot;o&quot;&gt;++&lt;/span&gt;&lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;)&lt;/span&gt;
    &lt;span class=&quot;n&quot;&gt;DEFER&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;({&lt;/span&gt;
      &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;%d &amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;,&lt;/span&gt; &lt;span class=&quot;n&quot;&gt;i&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
    &lt;span class=&quot;p&quot;&gt;});&lt;/span&gt;
  &lt;span class=&quot;n&quot;&gt;printf&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;(&lt;/span&gt;&lt;span class=&quot;s&quot;&gt;&amp;quot;done.&amp;quot;&lt;/span&gt;&lt;span class=&quot;p&quot;&gt;);&lt;/span&gt;
&lt;span class=&quot;p&quot;&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;


&lt;p&gt;The Go programmer would expect this to print &lt;code&gt;done.0 1 2 3&lt;/code&gt;. It will print &lt;code&gt;0 1 2 3 done.&lt;/code&gt;. The deferred calls are executed within each for loop, just like an un-deferred &lt;code&gt;printf&lt;/code&gt; would.&lt;/p&gt;

&lt;h2&gt;See also&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://the-witness.net/news/2012/11/scopeexit-in-c11/&quot; title=&quot;scope(exit) in C++11, by Ignacio Casta&amp;ntilde;o&quot;&gt;Alternative implementation 1&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://blog.korfuri.fr/post/go-defer-in-cpp/&quot; title=&quot;Go's defer operator in C++&quot;&gt;Alternative implementation 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2012/09/16/kodsnack</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2012/09/16/kodsnack/"/>
    <title>Kodsnack</title>
    <updated>2012-09-16T15:01:46+02:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;Jag, tillsammans med &lt;a href=&quot;http://about.me/thieta&quot;&gt;Tobias Hieta&lt;/a&gt; och &lt;a href=&quot;http://bjoreman.com&quot;&gt;Fredrik Björeman&lt;/a&gt;, har börjat spela in en podcast för svenska programmerare: &lt;a href=&quot;http://kodsnack.se&quot;&gt;Kodsnack&lt;/a&gt;!&lt;/p&gt;

&lt;p&gt;Så här långt har vi släppt två avsnitt, ett intro-avsnitt och nu senast idag, ett avsnitt om olika programmeringsplattformar. Några vi använt, några vi använder/jobbar med idag, och några tips på intressanta plattformar/programmeringsspråk vi tänkt titta på men inte hunnit med.&lt;/p&gt;

&lt;p&gt;Den plattform jag pratade om som jag hoppas på att kunna titta på någon dag är &lt;a href=&quot;http://clojure.org&quot;&gt;Clojure&lt;/a&gt;. Istället för att prata om samma saker som jag svamlade om i podcasten tänkte jag länka till lite olika videor som ligger uppe på nätet, dels lite om Clojure i sig men också några andra, mer generella presentationer från Rich Hickey, mannen som ligger bakom Clojure och som har en del ideer som jag håller med om, speciellt när han pratar om komplexitet och hur man skriver bättre kod.&lt;/p&gt;

&lt;h2&gt;Keynote: Simplicity Matters by Rich Hickey&lt;/h2&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/rI8tNMsozo0&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;


&lt;h2&gt;Rich Hickey: Deconstructing the Database&lt;/h2&gt;

&lt;iframe width=&quot;560&quot; height=&quot;315&quot; src=&quot;http://www.youtube.com/embed/Cym4TZwTCNU&quot; frameborder=&quot;0&quot; allowfullscreen&gt;&lt;/iframe&gt;


&lt;h2&gt;Annat&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;http://www.infoq.com/clojure&quot;&gt;Clojure @ infoq&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2012/02/21/podcasts---february-2012</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2012/02/21/podcasts---february-2012/"/>
    <title>Podcasts - February 2012</title>
    <updated>2012-02-21T09:43:10+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;Presenting an unsorted list of links to podcasts, for listening while driving.&lt;/p&gt;

&lt;hr /&gt;

&lt;h3&gt;&lt;a href=&quot;http://www.dancarlin.com/disp.php/hh&quot; title=&quot;Hardcore History&quot;&gt;Hardcore History&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;Increasingly long shows (the latest one is around 4.5 hours) on different aspects of history, by Dan Carlin. Engaging, very high quality.&lt;/p&gt;

&lt;h3&gt;&lt;a href=&quot;http://www.dancarlin.com/disp.php/cs&quot; title=&quot;Common Sense&quot;&gt;Common Sense&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;American politics by the same creator as is behind the Hardcore History show. I don't agree with everything Carlin says, but his views on the mainstream american political events are generally interesting.&lt;/p&gt;

&lt;h3&gt;&lt;a href=&quot;http://www.econtalk.org/&quot; title=&quot;EconTalk&quot;&gt;EconTalk&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;This is an economy podcast. Each show is an interview by the host, Russ Roberts. I think he would be considered to be of the austrian school, but the interviews range across the spectrum. Surprisingly easy to follow even for someone with no experience in economics.&lt;/p&gt;

&lt;h3&gt;&lt;a href=&quot;http://theskepticsguide.org/&quot; title=&quot;Skeptics' Guide to the Universe&quot;&gt;The Skeptics' Guide to the Universe&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;A weekly show on skepticism. Debunking bunk science, discussing the current events from a skeptical point of view.&lt;/p&gt;

&lt;h3&gt;&lt;a href=&quot;http://www.thisamericanlife.org/&quot; title=&quot;This American Life&quot;&gt;This American Life&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;This podcast is probably familiar to anyone who listens to a lot of podcasts, but since it is the best podcast out there, it is worth bringing up.&lt;/p&gt;

&lt;h3&gt;&lt;a href=&quot;http://radiolab.org/&quot; title=&quot;Radiolab&quot;&gt;RadioLab&lt;/a&gt;&lt;/h3&gt;

&lt;p&gt;The style reminds me a lot of This American Life, although much more aggressively edited. The content is mainly science-related. Think of it as This American Life (Science edition).&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2012/01/20/piracy-3-character</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2012/01/20/piracy-3-character/"/>
    <title>Piracy 3: Character</title>
    <updated>2012-01-20T23:39:48+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;This entry on my series on piracy (see &lt;a href=&quot;/2012/01/19/on-cake-and-piracy/&quot; title=&quot;Part 1 on piracy&quot;&gt;part 1&lt;/a&gt; and &lt;a href=&quot;/2012/01/20/piracy-2-more-discussion/&quot; title=&quot;Part 2 on piracy&quot;&gt;part 2&lt;/a&gt;) is the shortest, and is focused on a single question. What is the character of the pirate? The common anti-pirate view is that the pirate is a simple thief, a leech, someone who doesn't want to pay and steals without remorse. I think that is a simplistic view, a narrow view, and one that is ultimately not supported by empirical evidence.&lt;/p&gt;

&lt;p&gt;Taking a systemic view instead of focusing on the specific transaction in question - that is, look at the pirate, not the piracy - might shed some light on why I think that ultimately, piracy is not a destructive force.&lt;/p&gt;

&lt;p&gt;There is research showing that pirates, on average, spend more money on the things they pirate than non-pirates. While this may sound counter-intuitive, on reflection, it begins to make sense.&lt;/p&gt;

&lt;p&gt;There are those who pirate for the sake of pirating. Lets call them &lt;em&gt;hoarders&lt;/em&gt;. Hoarders download everything they can, with no intention to ever pay for any of it. Hoarders are &lt;em&gt;not&lt;/em&gt; potential customers. Hoarders can't really be accurately described as thieves either. They would never be customers in a system where they would have to pay, and they do not actually take anything, since what they hoard are copies, not originals.&lt;/p&gt;

&lt;p&gt;The other category of pirates that do not fit the mold of robbers are people who, lets take music for example, who really love music. The &lt;em&gt;enthusiasts&lt;/em&gt;. These are the tape traders, the music bloggers, the connoisseurs. Enthusiasts spend a &lt;strong&gt;lot&lt;/strong&gt; of money on music. They also have an active network, trading music with other enthusiasts. In fact, this trading network is what provides feedback and drives their interest in music to begin with. The piracy forms an integral part of this enthusiast network. The downloading of music that they engage in is the fuel that drives their consumption up, beyond that of a regular, law-abiding consumer who just buys one or two records per month.&lt;/p&gt;

&lt;p&gt;I'm not saying that these are the only types of pirates. The statistical evidence from several studies done on musical piracy seem to support this characterization, though (see &lt;a href=&quot;http://torrentfreak.com/swiss-govt-downloading-movies-and-music-will-stay-legal-111202/&quot; title=&quot;Swiss study on piracy&quot;&gt;this swiss study&lt;/a&gt; or &lt;a href=&quot;http://www.techdirt.com/articles/20090119/1943093458.shtml&quot; title=&quot;Respected Dutch Researchers Note That Piracy Has A Positive Impact On The Economy&quot;&gt;this dutch study&lt;/a&gt;, for example).&lt;/p&gt;

&lt;p&gt;So in this case, the view of the pirate as a leech is not an accurate account. In fact, the pirate is the perfect customer, and it is the piracy that made him that.&lt;/p&gt;

&lt;p&gt;I also don't think that this type of pirate is new at all, it's just that the trading has become a lot more visible, and these networks have become open to more people.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2012/01/20/piracy-2-more-discussion</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2012/01/20/piracy-2-more-discussion/"/>
    <title>Piracy 2: More Discussion</title>
    <updated>2012-01-20T07:26:52+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;...where I continue my &lt;a href=&quot;/2012/01/19/on-cake-and-piracy/&quot; title=&quot;previous discussion&quot;&gt;previous discussion&lt;/a&gt; on piracy, the ethics and the law.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;[...] I don't think piracy ruins businesses. However, I don't think that anyone can make the argument that they ethically have the right to disregard the producer's terms for consuming their product, regardless of the form the product is in or how unreasonable those terms are. (&lt;a href=&quot;http://news.ycombinator.com/item?id=3486568&quot; title=&quot;bluebridge @ hn&quot;&gt;bluebridge at hn&lt;/a&gt;)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;No, I've never worked for myself as in paying the bills based on my own copyright, although not from a lack of trying. I, like many people, started out with dreams of fame and glory through music, but gave it up quite early as the risks involved in choosing that career far outweighed the potential benefit. Plus, this was during the first dot com bubble, so getting into computers seemed like a good deal.&lt;/p&gt;

&lt;p&gt;I see you brought it back to a question of ethics, which is something that I think is ultimately not very interesting. Ask any horse-cart driver during the infancy of the car industry, and they would probably curse cars for being noisy and dangerous, and car drivers for being unethical and immoral for supporting this metal abomination. These days no one cares. In the same way, hopefully, we'll one day look back at the era of government anti-freedom bills and shake our heads in disbelief.&lt;/p&gt;

&lt;p&gt;Because short of actually going into the heads of all the people who, unlike you, don't see piracy as a parasitic activity, what can you actually do about it?&lt;/p&gt;

&lt;p&gt;It's so easy to copy works digitally that many people are no doubt doing it without realizing it. If you have a blog, and someone links to a youtube music video, and you like it and want to share the experience of seeing it with a friend.. you put a link to the video on your blog. But! Unbeknownst to you, that video was put there without the permission of the original creator, and you just committed a crime (by proxy, in this case, but a moral crime nontheless).&lt;/p&gt;

&lt;p&gt;A short history of Minecraft, as told by me (guaranteed to be inaccurate in many ways):&lt;/p&gt;

&lt;p&gt;Minecraft rose to fame by being heavily shared while in the alpha/beta stage at various indie game forums, 4chan, something awful and other places like these, from where the word of mouth spread wider and wider. From the start, it was for sale (I think for $10), it has never been a free game as far as I know. It was pirated like crazy from the beginning. By the time notch formed mojang, he was already a millionare from the sales of minecraft.&lt;/p&gt;

&lt;p&gt;Of course he didn't become a millionare from the piracy directly. The piracy didn't stop him from becoming one, though. In fact, I don't think it's possible to say definitively what impact piracy really had, other than that it helped spread the word. Given the graphics of Minecraft, would millions of people buy it without trying it? Maybe. You say that piracy doesn't provide resources, but in this case it did provide that one elusive thing that every independent developer desperately needs: exposure.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;If you liked Minecraft, there is nothing to prevent you from paying for it and touting it. Minecraft is an especially relevant example because the developers set the bar so low in regards to price and people still pirated something they claimed to love? That's so bizarre to me- I want to support independent developers much more so than the big guys and they weren't asking for much. (&lt;a href=&quot;http://news.ycombinator.com/item?id=3487403&quot; title=&quot;bluebridge @ hn&quot;&gt;bluebridge at hn&lt;/a&gt;)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Okay, so the problem that I'm seeing is that in your mind, you are equating a &lt;em&gt;pirated copy&lt;/em&gt; with a &lt;em&gt;lost sale&lt;/em&gt;. But that's an outdated and incorrect assumption, and hopefully one that time will deal with (when we've all grown up with infinite copies available from birth). A pirated copy is definitely not the same as a lost sale.&lt;/p&gt;

&lt;p&gt;Plenty of people payed for and touted Minecraft, obviously. A huge category of people didn't pay, but still touted it.&lt;/p&gt;

&lt;p&gt;Would that category of people have paid if piracy was impossible?&lt;/p&gt;

&lt;p&gt;I've argued against that reality since making piracy impossible would most likely also make Minecraft impossible (since you'd have to distribute through government-approved channels). I don't see how someone could possibly create an independent product and be able to self-distribute if piracy is technically impossible. And arguably the environment that spawned and formed the successful indie game maker is heavily dependent on free and easy peer-to-peer sharing of information, code and software.&lt;/p&gt;

&lt;p&gt;Secondly, clearly these people didn't have any moral issue with pirating the game while at the same time loving it.&lt;/p&gt;

&lt;p&gt;It may be bizarre to you, but a huge number of people will happily break the law if it's to their benefit, without feeling bad over lost sales. Most likely, these people wouldn't have paid even if they couldn't have had the game. They would just have gone without the game.&lt;/p&gt;

&lt;p&gt;I'd even go so far as to say that generally acting in their own self interest with little regard to people outside their closest circle is a &lt;em&gt;fundamental human behavioral constant&lt;/em&gt;, and it's shocking to me that this is so shocking to other people.&lt;/p&gt;

&lt;p&gt;You do know that children are &lt;a href=&quot;http://library.thinkquest.org/C002291/high/present/stats.htm&quot; title=&quot;world starvation&quot;&gt;starving to death&lt;/a&gt; in poor areas of the world? You certainly have the means to &lt;a href=&quot;http://www.oxfam.org/&quot; title=&quot;oxfam&quot;&gt;save&lt;/a&gt; at least one of them. Yet you don't. Why? Because their plight is too remotely removed from you. You have no emotional connection to them.&lt;/p&gt;

&lt;p&gt;Closing the emotional gap is key to exploiting the modern economy. See the success of pay-what-you-want schemes, where people end up paying more than they would have with a set price. I'd argue that this demonstrates another interesting detail: the humble bundle, which was available as pay-what-you-want, was &lt;a href=&quot;http://blog.wolfire.com/2010/05/Saving-a-penny----pirating-the-Humble-Indie-Bundle&quot; title=&quot;pirating the humble bundle&quot;&gt;heavily pirated&lt;/a&gt;! Why? It was essentially free already! Perhaps because people like to share, and the distribution model and the economic profit margins of the creator are both lesser forces than the innate emotional desires to have and to share.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2012/01/19/on-cake-and-piracy</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2012/01/19/on-cake-and-piracy/"/>
    <title>On Cake and Piracy</title>
    <updated>2012-01-19T19:29:18+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;Via &lt;a href=&quot;http://news.ycombinator.com&quot; title=&quot;news.ycombinator.com&quot;&gt;hacker news&lt;/a&gt;, I came across &lt;a href=&quot;http://broadmuse.com/piracy&quot; title=&quot;broadmuse.com/piracy&quot;&gt;this article&lt;/a&gt; titled
&quot;you can't have your cake and eat it&quot;, which itself is an article
referring to previous postings that have been discussed on hacker news
on the issue of piracy. More specifically, on the morality of piracy.&lt;/p&gt;

&lt;p&gt;The original articles were attempts to describe why the author felt
morally justified in pirating something, &lt;a href=&quot;http://ploum.net/post/im-a-pirate&quot; title=&quot;ploum.net/post/im-a-pirate&quot;&gt;music&lt;/a&gt; in one case and &lt;a href=&quot;http://littlebitofcode.com/2012/01/18/im-pirating-the-next-version-of-windows&quot; title=&quot;littlebitofcode.com&quot;&gt;windows&lt;/a&gt;
in the other. The article I am addressing here generally accepted the
arguments presented by those people, but counters by saying that no
matter what the argument is, there is never a good reason for doing
anything illegal, basically. Here is a quote,&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;if there is no legal way for you to enjoy it, unfortunate though it
  is, tough. write to them. email them. call them to protest. but
  don't decide to take the law into your own hands...it's not your
  decision.&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Well... actually, it is. See, that's the thing about piracy. It is
very much their decision to pirate something, or not, depending on
their moral position on the issue and how scared they are of
ending up in legal problems.&lt;/p&gt;

&lt;p&gt;The argument that you can't and shouldn't do anything that is illegal
is also somewhat simplistic. There are a lot of things that are
illegal. Sweden is not a huge country, so I suspect we don't have
quite as many laws as the United States do, but there are definitely
more laws than anyone can keep track of. There's simply no way of
knowing if anything you do is legal or not, other than getting
arrested for doing it, in which case you've just found out.&lt;/p&gt;

&lt;p&gt;Certain things are obviously illegal, such as killing
someone. Although, if I am correct, it &lt;em&gt;is&lt;/em&gt; legal to kill someone that
trespasses on your property in some states, is it not? So even a
clear-cut biblical law like that isn't always quite so
clear-cut. Another example of this problem of knowing whether you are
breaking a law or not is reflected in the number of times that
legislators driving harsher copyright infringement laws have been
found to be violating the current, not-so-harsh infringement laws by
using photos on their websites without permission. So the basic idea
of living a law-abiding life is problematic from that standpoint
alone.&lt;/p&gt;

&lt;p&gt;Then there's the question of laws that you don't agree with. There are
many stupid, old and irrelevant laws. Many countries have religious
blasphemy laws, some have laws against women driving or peeling
bananas. Is it morally okay to break a law against assembly to protest
a dictatorial regime, or to break speeding laws to rush an injured
child to the emergency room? I would say that it is morally, but
perhaps not legally, forgivable to break just about any law under the
right circumstances.&lt;/p&gt;

&lt;p&gt;There. That's that. Now, on to the bigger issue: Is piracy wrong?&lt;/p&gt;

&lt;h2&gt;Piracy - is it wrong to eat the cake?&lt;/h2&gt;

&lt;p&gt;Here's the thing: The digital age is upon us. Anything that can be
expressed as a binary number can be processed and stored practically
for free, and anything that can be stored on a computer can also be
copied. In fact, it is impossible to even see what is stored on a
computer hard drive without first &lt;em&gt;copying it&lt;/em&gt; to the working memory, and
eventually the graphics memory, of the computer.&lt;/p&gt;

&lt;p&gt;Expressed as a binary number, what does that mean.. well, first of
all, it means books. It also means any music, image, video or genetic
sequence imaginable, for example. It's possible to store vast amounts
of information on tiny amounts of hardware these days, at a
ridiculously low cost.&lt;/p&gt;

&lt;p&gt;So, that's a fact. Everything that can be copied, will be
copied. Anything that is made available to the public will eventually
be copied and spread outside the channels originally provided by the
publisher. Unless no one cares about it, in which case it will never
be copied, and will eventually be forgotten. Any form of digital
rights management or attempts to control the spread of information
technically is doomed to fail, since, as touched on previously, to be
seen, information has to be copied. Standards such as HDMI attempt to
address this by enforcing the DRM at every stage of the informational
lifetime. Data is encrypted and inaccessible on the harddrive, and
stays in that form all the way through working memory, to the graphics
memory, to the TV that displays it. Of course, it only takes one weak
link in one single TV or computer, somewhere in the world, for that
chain to be broken and the information to escape its artifical
prison. And once the informational cat is out of the bag, it stays
out.&lt;/p&gt;

&lt;p&gt;Now, that's the technical argument: You can't stop piracy using
technology. Piracy it's a fact of the digital era. No, let me restate
that: You don't &lt;em&gt;want to&lt;/em&gt; stop piracy, because doing so would mean
destroying computers as we know them today.&lt;/p&gt;

&lt;p&gt;Thus, the only hope for those who want to get rid of piracy is the
moral argument. If everyone could just agree that pirating copyrighted
information is akin to watching child pornography, almost no one would
do it and those who did could be locked up in prison for a long time
and everyone would be happy. The problem is that people just don't
want to agree to that. In fact, there's a growing group of people who
not only think piracy is acceptable, but who actually think piracy is
&lt;em&gt;morally right&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;See, that's the problem with the moral argument: Unless the person you
are directing it against agrees with you, it has no weight. If I
personally don't think that pirating software is wrong, then you
telling me that it is wrong doesn't make me change my mind, just as
little as me saying it is right changes yours. This is not a matter of
intellectual dishonesty, as many in the pro-copyright camp seem to
think. It's not the case that everyone really do think that piracy is
wrong, but that they do it anyway, shamefully. No, I would argue that
most people who pirate actually don't feel bad about it in the
slightest. I would wager that most music pirates don't think there is
anything wrong with sharing music they like with their friends. I
suspect that most people who pirate music do so because they
enjoy the sharing of music as much as they enjoy listening to it.&lt;/p&gt;

&lt;p&gt;So, two points have been established:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Stopping piracy by technical means is not a good idea and won't
have the desired effect.&lt;/li&gt;
&lt;li&gt;We can't agree on whether piracy is right or wrong, so appealing to
our common sense of justice won't have the desired effect.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;What other option is there?&lt;/p&gt;

&lt;h2&gt;The solution!&lt;/h2&gt;

&lt;p&gt;Work around it. That's the only way to deal with piracy. The funny
thing is, the people who complain the loudest about the evils of
piracy are doing just fine in the face of it! The movie industry is
making &lt;em&gt;insane&lt;/em&gt; amounts of money, year by year. There's musical
artists so rich they can't possibly spend it all, ending up coating their
toilet rolls in gold. And software continues to sell,
despite much of it being pirated. Pirated, regardless of DRM and complicated
technical protections - the &lt;a href=&quot;http://en.wikipedia.org/wiki/Forbes_list_of_billionaires&quot; title=&quot;List of billionares&quot;&gt;second richest man&lt;/a&gt; in the world made
his fortune by creating perhaps the most pirated piece of software in the
history of the world, for crying out loud.&lt;/p&gt;

&lt;p&gt;Yes, there are struggling artists who have trouble making ends
meet. Then again, haven't artists always struggled? One common
argument against piracy is that if I create something, I somehow have
the &lt;em&gt;right&lt;/em&gt; to profit from it. But that is an absurd claim! If that
was true, we would all be artists, happily profiting from the artistic
crap we produce that no one wants to see. It's not that simple. To be
successful, you need an audience, you need to produce goods that
people &lt;em&gt;desire&lt;/em&gt;. Somehow, those that do usually do fine,
financially, regardless of how much free sharing goes on with their
art.&lt;/p&gt;

&lt;p&gt;Some business models won't hold up in the face of the digital
age. That's to be expected. Yet other business models will
appear. Would &lt;a href=&quot;http://notch.tumblr.com/&quot; title=&quot;The Word of Notch&quot;&gt;notch&lt;/a&gt; have been as successful as he has been making
Minecraft in a world without digital sharing? Probably not, he would
not have been on the entertainment industry-approved gaming network,
his game would not fit in with the slick triple-A productions that
those companies produce. Yet in a world where anyone can &quot;steal&quot; his
work, he manages to sell millions of copies of it.&lt;/p&gt;

&lt;p&gt;Piracy may be right, it may be wrong. But sharing is caring. Any
technical limitation or legislation that prevents me from handing the
amazing book I just read to my friend so he can read it and we can
talk about it afterwards... is &lt;strong&gt;bullshit&lt;/strong&gt;.&lt;/p&gt;

&lt;h2&gt;On World of Goo&lt;/h2&gt;

&lt;p&gt;&lt;a href=&quot;http://news.ycombinator.com/item?id=3485665&quot; title=&quot;chaz @ hn&quot;&gt;Someone&lt;/a&gt; at HN quoted a study that showed that more than 90% of all
copies of World of Goo were pirated copies, pointing to it as to show
how bad piracy can be. This is the kind of thing that boggles my
mind.&lt;/p&gt;

&lt;p&gt;World of Goo was a huge success! How the piracy rate fits into
the relative success or failure of World of Goo is not at all clear. I
don't see how anyone can believe that there's a possible reality where
World of Goo would be just as successful as it was with a 0% piracy
rate, and where information exchange is free. You can't have both.&lt;/p&gt;

&lt;p&gt;If World of Goo had made a pittance and its developers had died in
poverty, maybe there would have been an argument to make there. But as
it is, that piracy figure is just a number that has no tangible
connection to the number of possible sales in a world where piracy is
either morally abhorrent to everyone, or technically impossible. And
that world is something for dystopian science fiction to explore, not
one that I would ever wish to experience.&lt;/p&gt;

&lt;h2&gt;On knowing what I'm talking about&lt;/h2&gt;

&lt;blockquote&gt;&lt;p&gt;You have no idea what you are talking about, I'm guessing this is
  because you have never created anything worthwhile on which your
  livelihood depended. I'm sure you'd be quick to whine if your
  employer (assuming you are old enough to work) could decide whether
  or not you should be paid for your work after you had done it. I
  hope you congratulate the next person to steal from you with a
  cheery &quot;well done, that's my morality too&quot;. (&lt;a href=&quot;http://news.ycombinator.com/item?id=3484536&quot; title=&quot;epo @ hn&quot;&gt;epo&lt;/a&gt; at hn)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;You have no idea what you are talking about, I'm guessing this is
because you are too old to have grown up with tape trading, VHS copies
of films and pirate cable. I have a contract with my employer, he is
bound by that agreement to pay me. If he decides he doesn't want to, I
stop working for him. If I write a book, no one is under contract to
purchase and read it. I'd be happy if someone did, but I'd be foolish
to assume that would happen when I started writing it.&lt;/p&gt;

&lt;p&gt;I have created worthwhile things on which my livelihood depended, and
those things have been cheerfully and rampantly pirated (piracy rates
of video games estimated at +90%). And the company I worked for made
great profits and paid me a nice bonus. Would it have made as much of
a profit if those 90%+ of people who played the game, liked it, talked
about it, reviewed it without paying for it, had never played it at
all? I don't know. Would it have made more profit? I can't say. I
doubt you can either.&lt;/p&gt;

&lt;blockquote&gt;&lt;p&gt;As an employee, you have no basis for understanding the perceived
  loss that piracy incurs- you are paid 100% what you agreed upon for
  your creative efforts. Someone else is taking the risk and losing
  the profit. If you went to get your paycheck and found out that it
  was 40% lower than what you thought, you might feel some of that
  self-righteous anger that businesses are espousing.&lt;/p&gt;

&lt;p&gt;More realistically the worst you will feel is a denied promotion, or
  lost a job because your company can't realize it's investment in
  you.&lt;/p&gt;

&lt;p&gt;Unless you are directly culpable for the creation and distribution
  of a product and lose money on it because people won't honor your
  effort, you don't have a basis for passing judgment based on your
  personal experience (in other words, you're no expert :)
  ). (&lt;a href=&quot;http://news.ycombinator.com/item?id=3485821&quot; title=&quot;bluebridge @ hn&quot;&gt;bluebridge&lt;/a&gt; at hn)&lt;/p&gt;&lt;/blockquote&gt;

&lt;p&gt;Now you are making a different argument, but I can argue just as
effectively against this one. :)&lt;/p&gt;

&lt;p&gt;In my role as copyright superhero have I not only worked as an
employee at companies producing copyrighted works, I have also,
personally, produced and sold copyrighted works that have, to some
extent, been pirated. I have yet to feel any self-righteous anger. The
only anger I might feel is a certain frustration where some of these
copyrighted works have not been as successful as I would have wished
them to be, but I would be foolish to lay the blame on piracy. More
likely, the timing was not right and the quality was not high enough
to ensure success.&lt;/p&gt;

&lt;p&gt;Any business endeavor entails risk. I would hope that my employer has
factored in piracy rates and other non-specific factors in the
business plan before hiring me to create a video game for
him. Sometimes, things don't work out as hoped and the result is a
flop. That can happen for many reasons. I have yet to see a convincing
argument where piracy was the reason something did not succeed. On the
other hand, I can point to numerous examples were piracy was the
deciding factor that let something become a success to begin with. The
currently popular example is Minecraft, which spread entirely through
word of mouth. How successful would that game have been if there had
been no way to send it to a friend while telling them to check it out
because it's awesome? I really doubt anyone would have known about it
at all.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/17/trying-out-namecoin</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/17/trying-out-namecoin/"/>
    <title>Trying Out Namecoin</title>
    <updated>2011-11-17T23:20:19+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://krig.bit/&quot; title=&quot;krig.bit/&quot;&gt;http://krig.bit/&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;That URL up there will most likely not work for you. If it does, you
probably already know more about &lt;a href=&quot;http://dot-bit.org/&quot; title=&quot;dot-bit.org/&quot;&gt;namecoin&lt;/a&gt; than I do. Roughly,
here's what I know about it: Namecoin is a peer-to-peer technology
based on &lt;a href=&quot;http://en.wikipedia.org/wiki/Bitcoin&quot; title=&quot;Bitcoin at Wikipedia&quot;&gt;bitcoin&lt;/a&gt;, the distributed currency that there has been
some noise about recently. Now, just to make it clear: I don't want to
imply that I support or endorse the bitcoin project. I don't know
enough about it to take a stand. Not saying that I'm against it, just
that, well, I don't know anything about it, really.&lt;/p&gt;

&lt;p&gt;Namecoin is not about money. It's a possible replacement for the
&lt;a href=&quot;http://en.wikipedia.org/wiki/Domain_Name_System&quot; title=&quot;Domain Name System at Wikipedia&quot;&gt;DNS&lt;/a&gt; name lookup system used on the internet today. There are
others out there as well, but at the moment there is nothing that has
gained any significant traction, and that includes namecoin. In fact,
namecoin is a very new project, so new that the
&lt;a href=&quot;http://dot-bit.org/Domain_names&quot; title=&quot;Namecoin draft proposal&quot;&gt;draft proposal&lt;/a&gt; is still being written. Still, I find it
fascinating.&lt;/p&gt;

&lt;p&gt;In the last few days, there has been a lot of talk of proposed
legislation in the US that would strike a huge blow against the free
and open internet. The SOPA (Stop Online Piracy Act) -
&lt;em&gt;alternatively, the Stop Online Privacy Act&lt;/em&gt; - is being pushed through
the US congress at the moment, and it has some pretty dreadful
implications. Read more about SOPA at the &lt;a href=&quot;https://www.eff.org/deeplinks/2011/10/sopa-hollywood-finally-gets-chance-break-internet&quot; title=&quot;SOPA: Hollywood Finally Gets A Chance to Break the Internet&quot;&gt;EFF&lt;/a&gt;. As I understand it,
the law forces ISPs to block any site that is reported as infringing, and
to qualify as an infringing site under this legislation, it is enough to
host a single link to something that can be alleged to &quot;engage in, enable or facilitate&quot;
copyright infringement.&lt;/p&gt;

&lt;p&gt;Clearly, if this passes, a lot of sites will be unfairly blocked. The only
way to prevent such blocks at the DNS level will be to opt out of the current,
US government controlled DNS structure. That is where namecoin comes in as an
alternative to regular DNS.&lt;/p&gt;

&lt;p&gt;Namecoin is distributed, peer to peer. This means that there is no central root nameserver.
There is, however, a registrar for the &lt;code&gt;.bit&lt;/code&gt; top domain. I decided to see if I could register
a domain.&lt;/p&gt;

&lt;p&gt;Here is the process I went through, following the instructions &lt;a href=&quot;http://dot-bit.org/HowToRegisterAndConfigureBitDomains&quot; title=&quot;How to Register and Configure Bit Domains&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;

&lt;h2&gt;Compiling namecoin&lt;/h2&gt;

&lt;p&gt;To interact with the namecoin network, you need to run the peer software, &lt;code&gt;namecoind&lt;/code&gt;.
This can in theory run on any operating system, but since the code is very much in flux, it seems that
the only viable alternative at the moment is to build a 32 bit executable for GNU/Linux.&lt;/p&gt;

&lt;p&gt;There are a couple of main forks of the source. This is the command line I used to clone a copy of
&lt;a href=&quot;https://github.com/khalahan/namecoin&quot; title=&quot;github.com/khalahan/namecoin&quot;&gt;the fork that I used&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone https://github.com/khalahan/namecoin.git
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;On Ubuntu 11.04, these are the libraries I had to install to get it to build:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;apt-get install libwxbase2.8-dev libssl-dev libcrypto++-dev \
     libdb4.8++-dev libboost-dev libboost-filesystem-dev \
     libboost-system-dev libboost-thread-dev libboost-program-options-dev
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You may need additional libraries that I happened to have installed already, but
I think that should cover all the dependencies at this time.&lt;/p&gt;

&lt;p&gt;Compile via make,&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;cd namecoin/src
make -f makefile.unix
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This should produce the &lt;code&gt;namecoind&lt;/code&gt; executable. Before starting it, you need to create a
configuration file in &lt;code&gt;~/.namecoin/bitcoin.conf&lt;/code&gt;. In this file, you add the following lines:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;rpcuser=[your user name here]
rpcpassword=[make something up here]
rpcport=8336
daemon=1
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;You should also make sure port &lt;code&gt;8336&lt;/code&gt; is open and pointing to the machine running &lt;code&gt;namecoind&lt;/code&gt;
in your firewall/router.&lt;/p&gt;

&lt;p&gt;Once this is done, you can start &lt;code&gt;namecoind&lt;/code&gt;. This should print&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;bitcoin server starting
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;and return immediately. If you leave out the &lt;code&gt;daemon=1&lt;/code&gt; line in &lt;code&gt;bitcoin.conf&lt;/code&gt;, nothing will be
printed and the program will appear to hang. You can run it in the background or in a separate
terminal like that, but the most convenient option is to run the peer as a daemon.&lt;/p&gt;

&lt;p&gt;Now you can find out your namecoin address:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;namecoind listreceivedbyaddress 0 true
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;This should print a JSON blob with a field saying &lt;code&gt;&quot;address&quot; : &quot;N...&quot;&lt;/code&gt;.
Don't worry if the address doesn't start with an N.&lt;/p&gt;

&lt;p&gt;Once you get this far, you are going to need some namecoins in order to register a domain.
I got some from &lt;a href=&quot;http://faucet.yepcorp.com/&quot; title=&quot;faucet.yepcorp.com&quot;&gt;faucet.yepcorp.com&lt;/a&gt;, but there are additional methods for obtaining
namecoins listed on the &lt;code&gt;dot-bit.org&lt;/code&gt; website.&lt;/p&gt;

&lt;p&gt;The rest is simple. Once you have some namecoins - oh, you can check your balance via this command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;namecoind getinfo
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Once you have some coins, you can ask to register a new &lt;code&gt;.bit&lt;/code&gt; domain name using this command:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;namecoind name_new d/&amp;lt;name&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;&lt;code&gt;&amp;lt;name&amp;gt;&lt;/code&gt; in this case is the domain you want, minus the &lt;code&gt;.bit&lt;/code&gt; part. So &lt;code&gt;example.bit&lt;/code&gt; becomes &lt;code&gt;d/example&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;This will return two large numbers. Save them. Now check the &lt;code&gt;&quot;blocks&quot;&lt;/code&gt; value using &lt;code&gt;namecoind getinfo&lt;/code&gt;.
This number will be increasing slowly. Wait until it has increased 12 blocks from the time you requested a name.
It should take between 2 hours and 2 days for this to happen. For me, it took around 3 hours.&lt;/p&gt;

&lt;p&gt;Now you can actually register the domain, and ask for it to point to an IP address. This is how you do that:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;namecoind name_firstupdate d/&amp;lt;name&amp;gt; &amp;lt;number&amp;gt; '{&quot;map&quot;: {&quot;&quot;: &quot;&amp;lt;ip&amp;gt;&quot;}}'
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Again, &lt;code&gt;&amp;lt;name&amp;gt;&lt;/code&gt; is your domain minus &lt;code&gt;.bit&lt;/code&gt;. &lt;code&gt;&amp;lt;number&amp;gt;&lt;/code&gt; is the second, shorter of the two numbers returned by
by &lt;code&gt;name_new&lt;/code&gt;. Finally, &lt;code&gt;&amp;lt;ip&amp;gt;&lt;/code&gt; is the IP address that you want the domain name to point to.&lt;/p&gt;

&lt;p&gt;At this point, you should update your web server to accept requests for the domain you've registered. It will
take a little while for the registration to propagate in the P2P network, but pretty soon, you should be able
to access your web server using the &lt;code&gt;.bit&lt;/code&gt; domain name you just registered.&lt;/p&gt;

&lt;p&gt;Of course, in order to do that, you need to be able to access &lt;code&gt;.bit&lt;/code&gt; domains at all. There are multiple ways of
accomplishing that, all of which are listed &lt;a href=&quot;http://dot-bit.org/HowToBrowseBitDomains&quot; title=&quot;How to Browse Bit Domains&quot;&gt;here&lt;/a&gt;. The one I used involved installing the FoxyProxy
add-on for Firefox and loading a custom configuration. To test that it works, you can try accessing
&lt;a href=&quot;http://dot-bit.bit&quot; title=&quot;dot-bit.bit&quot;&gt;http://dot-bit.bit&lt;/a&gt;. At the time I tried this, the instructions recommmended accessing &lt;a href=&quot;http://example.bit&quot; title=&quot;example.bit&quot;&gt;example.bit&lt;/a&gt;,
but that domain was down for me even once I had the proxy working.&lt;/p&gt;

&lt;p&gt;As you may have guessed, this is a new and rapidly changing project. These instructions will probably be completely out of date
fairly soon. At the time of this writing (mid-November 2011), they worked for me.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/14/jekyll-plugins-at-github</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/14/jekyll-plugins-at-github/"/>
    <title>jekyll-plugins @ github.com</title>
    <updated>2011-11-14T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;I added a repository at github with the plugins I use at this site. All of them are based on other plugins I found, but most of them have been slightly modified or tweaked to fit me better.&lt;/p&gt;

&lt;p&gt;To clone:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;git clone git://github.com/krig/jekyll-plugins.git
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Repository page &lt;a href=&quot;https://github.com/krig/jekyll-plugins&quot; title=&quot;krig/jekyll-plugins - GitHub&quot;&gt;here&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/13/rebooting-the-franchise</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/13/rebooting-the-franchise/"/>
    <title>Rebooting the franchise</title>
    <updated>2011-11-13T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;h2&gt;Gone static&lt;/h2&gt;

&lt;p&gt;This website is now based on
&lt;a href=&quot;https://github.com/mojombo/jekyll&quot; title=&quot;mojombo/jekyll&quot;&gt;jekyll&lt;/a&gt;. Jekyll
is a static site generator written in Ruby. The basic idea of static
site generators is to create the layout and structure of the site
offline, by scanning various source documents and combining them with
templates to provide structure and design. For example, each page has
a common header and footer, so a simple site generator could be a
program that runs through a list of source documents and adds the
header and footer to all of them.&lt;/p&gt;

&lt;p&gt;Jekyll is pretty flexible and allows for plugins that can extend the
functionality. It's fairly easy to write new plugins, and I've created
a few to set this page up.&lt;/p&gt;

&lt;p&gt;Another important aspect to the use of a static site generator is a
distributed version control system like git. By using git to hold the
source documents, I can update the site from any computer simply by
cloning the repository, committing the new post and pushing to the
deployment remote repository. A post-commit-hook on the server can
then automatically regenerate the HTML files.&lt;/p&gt;

&lt;p&gt;Jekyll also provides simple support for RSS and Atom feeds.&lt;/p&gt;

&lt;p&gt;To add a subpage to the site, I simply create that page as a document
in the source directory. This document can be a HTML file, a
&lt;a href=&quot;http://daringfireball.net/projects/markdown/&quot; title=&quot;markdown&quot;&gt;Markdown&lt;/a&gt;
document, a &lt;a href=&quot;http://www.textism.com/tools/textile/&quot; title=&quot;textile&quot;&gt;Textile&lt;/a&gt;
document or a number of other formats supported by Jekyll. I also need
to add some front matter to the top of the file to let Jekyll know that
it should be processed. For example, this post has the following header:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;---
layout: post
title: A New Beginning
---
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;The &lt;code&gt;title&lt;/code&gt; field is the name of the post. &lt;code&gt;layout&lt;/code&gt; specifices
the template document used to style the page, and since this is a post
I use a special template that provides the tags and related pages
items at the bottom of this page.&lt;/p&gt;

&lt;p&gt;There are other options that can be set here, such as tags for
example.&lt;/p&gt;

&lt;p&gt;Posts are somewhat special. Any document created in a folder called
&lt;code&gt;_posts&lt;/code&gt; with the file format &lt;code&gt;YYYY-MM-DD-&amp;lt;title&amp;gt;.extension&lt;/code&gt; is
considered a post, and is automatically added to the list of articles
seen on the front page of this site. Posts get URLs based on this
filename, for example a post called &lt;code&gt;1983-12-04-decembur.html&lt;/code&gt; would
get the URL &lt;code&gt;http://example.com/1983/12/04/decembur&lt;/code&gt;. This can be
customized, but this is how I've set things up here.&lt;/p&gt;

&lt;h2&gt;The Gallery&lt;/h2&gt;

&lt;p&gt;I've spent some time writing a mostly automatic picture gallery
generator. To add a new image, I just create a new post in &lt;code&gt;/_posts&lt;/code&gt;
as usual. However, instead of using the regular &lt;code&gt;post&lt;/code&gt; layout, I use a
special layout called image. I also provide a link to the image
itself.&lt;/p&gt;

&lt;p&gt;In the actual post body, I can add additional images if I want to,
perhaps a step by step walkthrough of the image creation process.&lt;/p&gt;

&lt;p&gt;Here is an example entry:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;---
layout: image
title: My New Image
image: /gallery/the_new_image.jpg
tags:
 - new
 - image
---

This is just a new image.
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Jekyll will automatically create a thumbnail for the image using
ImageMagick and then add it to the gallery page.&lt;/p&gt;

&lt;p&gt;The code for this process is based on a couple of Jekyll plugins, but
the main sources of inspiration were&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href=&quot;https://github.com/zroger/jekyll-minimagick&quot; title=&quot;zroger&quot;&gt;jekyll-minimagick&lt;/a&gt; by
zroger which provided the thumbnail generation&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;https://gist.github.com/524748&quot; title=&quot;category plugin&quot;&gt;category&lt;/a&gt; by josegonzalez&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;Originally I also generated a &quot;feature&quot; image, which was a larger
version of the thumbnail. However, the gallery page got a bit too confusing
with the featured image added as well so I disabled it.&lt;/p&gt;

&lt;h2&gt;Mobile friendly&lt;/h2&gt;

&lt;p&gt;The site is designed to be mobile-friendly. The footer is obviously
the main issue being so big in its maximum-width incarnation, but I
think the way it works now is pretty usable. The main trick is a bunch
of declarations of this form:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;@media only screen and (min-width : 320px) and (max-width : 480px)
{
    ...
}
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;To get the mobile browsers to not screw everything up, it's also
necessary to add a few meta tags to the head section.&lt;/p&gt;

&lt;p&gt;This is what I'm using as of the creation of this document, mainly
lifted from the &lt;a href=&quot;http://html5boilerplate.com/mobile&quot; title=&quot;html5boilerplate.com/mobile&quot;&gt;HTML5 mobile boilerplate&lt;/a&gt;.&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;&amp;lt;meta name=&quot;HandheldFriendly&quot; content=&quot;True&quot;&amp;gt;
&amp;lt;meta name=&quot;MobileOptimized&quot; content=&quot;320&quot;&amp;gt;
&amp;lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&amp;gt;
&amp;lt;meta http-equiv=&quot;cleartype&quot; content=&quot;on&quot;&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Dynamic content?&lt;/h2&gt;

&lt;p&gt;So the obvious limitation of using a static site generator is that the
resulting site is, well, static. This can be alleviated by the use of
javascript and ajax, for example adding comments via Disqus.
I'm planning to create my own version of a javascript-enabled commenting system
just so I can have some more control over the comments, but for now I'm using
Disqus.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/13/password-strategy</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/13/password-strategy/"/>
    <title>Password Strategy</title>
    <updated>2011-11-13T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;em&gt;Listen, friends, to my Tale of Woe.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I, like most people, used to select
between a small number of favorite passwords over and over again
when registering at different websites.&lt;/p&gt;

&lt;p&gt;I've always been slightly stressed about this. I knew that
from a security standpoint it's &lt;a href=&quot;http://www.schneier.com/blog/archives/2009/08/password_advice.html&quot; title=&quot;Password advice&quot;&gt;not a good idea&lt;/a&gt; to do that.
No matter how good my single password is, if someone gets hold of the password
database at some site or if that site stores my password in clear text,
all of the accounts using that same password are now wide open.&lt;/p&gt;

&lt;p&gt;I even created an &lt;a href=&quot;/keysea&quot; title=&quot;keysea&quot;&gt;iPhone app&lt;/a&gt; intended to help me
solve this problem. The idea is that the app would allow me to remember
a single password, but still enable the use of different passwords for every site.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;I never actually got around to using it.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;I have no good excuse. Having the log in process tied to an iPhone app seemed
cumbersome. I didn't want to keep losing passwords due to iOS upgrades, for
example.&lt;/p&gt;

&lt;p&gt;So, naturally, I got bit by my laziness / hesitance.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/intrusion.png&quot; style=&quot;float:right; margin:16px;&quot; alt=&quot;hacked gmail account (not mine)&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;My main GMail account got hacked.&lt;/strong&gt; One day I log in, and I see a huge
red warning message warning me that my last login was from the vicinity of
Beijing. My guess is that some password harvester somewhere had managed to
get my password from a leak at another site, probably with an association to
my email, and tried to use it. I changed the password and enabled 2-step
verification immediately, but what were the consequences?&lt;/p&gt;

&lt;p&gt;Getting hacked was a horribly stressful experience to me. I had used that GMail
account for &lt;em&gt;everything&lt;/em&gt;. I stored notes there, old correspondence,
financial information, who knows. I had to change my passwords
everywhere. I needed to change my whole password strategy. It was a
complete disaster.&lt;/p&gt;

&lt;p&gt;So, here is what I've done to avoid getting hacked again.&lt;/p&gt;

&lt;h3&gt;How to avoid my pain&lt;/h3&gt;

&lt;ol&gt;
&lt;li&gt;&lt;strong&gt;2-step verification&lt;/strong&gt;. Turn this on immediately, everywhere
possible. Both &lt;a href=&quot;http://www.google.com/support/accounts/bin/static.py?hl=en&amp;amp;page=guide.cs&amp;amp;guide=1056283&amp;amp;rd=1&quot; title=&quot;gmail 2-step verification&quot;&gt;GMail&lt;/a&gt; and &lt;a href=&quot;http://maketecheasier.com/configure-facebook-two-factor-authentication/2011/06/17&quot; title=&quot;Facebook 2-step verification&quot;&gt;Facebook&lt;/a&gt; provide 2-step
verification now. Using this means that even if someone has access to
your password, they cannot log in.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Unique passwords&lt;/strong&gt;. Yes, the thing that keysea was supposed to
provide. What I've done this time is simplify the password creation
process, and write the generator as both a command line tool written in
python and a web-app written in JavaScript. I haven't cleaned these up
enough to release publicly yet, but they work incredibly well for me.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Generate passwords&lt;/strong&gt;. For ideas on how to do this and still get
passwords that are possible to remember, see &lt;a href=&quot;http://xkcd.com/936/&quot; title=&quot;xkcd: Password strength&quot;&gt;this xkcd comic&lt;/a&gt;.
Don't do what most would do and take some common word, replace a letter
a number or append &lt;code&gt;123&lt;/code&gt;. Those passwords are incredibly easy to hack,
especially with access to MD5 sums from a leaked database.&lt;/li&gt;
&lt;/ol&gt;


&lt;p&gt;&lt;a href=&quot;http://xkcd.com/936/&quot; title=&quot;xkcd&quot;&gt;&lt;img src=&quot;/images/xkcd.png&quot; style=&quot;float:left; margin:16px;&quot; alt=&quot;xkcd&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;There are a number of good password generators and password databases
out there. However, I'm not a big fan of solutions like &lt;a href=&quot;https://agilebits.com/onepassword&quot; title=&quot;1Password&quot;&gt;1Password&lt;/a&gt; that
store all the passwords in a database somewhere. If I can generate new
passwords on the fly, all I need is my master password and the
generation algorithm to recreate the passwords later. I also don't risk
losing the password database.&lt;/p&gt;

&lt;p&gt;The main issue I had with keysea was that it tied the passwords to a
particular application on a particular platform. The strength of
generating the passwords on the fly is that I can have a web app up on
the internet somewhere, publicly. Since the generation happens
completely in JavaScript locally on the client machine, I can use it
safely from any computer.&lt;/p&gt;

&lt;p&gt;Generating the passwords for every site means that I have strong,
unique passwords everywhere without having to remember them.
Even if some site &lt;a href=&quot;http://www.labnol.org/internet/check-gawker-email-database/18341/&quot; title=&quot;Gawker leak&quot;&gt;leaks&lt;/a&gt; &lt;a href=&quot;http://thehackernews.com/2011/06/sony-pictures-hacked-and-database.html&quot; title=&quot;Sony leak&quot;&gt;its&lt;/a&gt; &lt;a href=&quot;http://store.steampowered.com/news/6761/&quot; title=&quot;Steam leak&quot;&gt;password&lt;/a&gt;
&lt;a href=&quot;http://www.skullsecurity.org/wiki/index.php/Passwords&quot; title=&quot;List of leaked passwords&quot;&gt;database&lt;/a&gt;, the only account that is threatened is the one
on the leaking site.&lt;/p&gt;

&lt;p&gt;My other accounts are (hopefully) safe.&lt;/p&gt;

&lt;p&gt;As an aside, now that my passwords are &gt;20 characters long containing a random
sequence of characters, numbers and symbols, it bugs me how many sites limit the length of passwords
or restrict the characters allowed. Banking and finance sites in particular are horrible in this regard!&lt;/p&gt;

&lt;p&gt;I've even come across sites that limit the passwords to exactly six characters with no symbols. I can
only hope that they at least don't store the passwords in clear text on the server, but if the restrictions
are any hint, my guess is that they do...&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/13/full-moon</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/13/full-moon/"/>
    <title>Full Moon</title>
    <updated>2011-11-13T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;em&gt;Drawn using Photoshop, a wacom tablet&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Inspired by the full moon outside my window.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/12/jellyfish</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/12/jellyfish/"/>
    <title>Jellyfish</title>
    <updated>2011-11-12T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;This was the startup image for &lt;a href=&quot;/keysea&quot; title=&quot;Keysea&quot;&gt;Keysea&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/12/feedbeast</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/12/feedbeast/"/>
    <title>Feedbeast</title>
    <updated>2011-11-12T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;A quick inkscape doodle originally intended as a mascot for an RSS reader for the iPad.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/11/pigdragon</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/11/pigdragon/"/>
    <title>PigDragon</title>
    <updated>2011-11-11T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;em&gt;Vector image, made in Inkscape.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;This started out as a plain mountain. It then felt appropriate to have a dragon cling to it, but a simple fire-breathing dragon seemed a bit clich&amp;eacute;.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/11/ohmcastle</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/11/ohmcastle/"/>
    <title>Ohm Castle</title>
    <updated>2011-11-11T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;I overused this image a bit when making &lt;a href=&quot;/ohmchesshd&quot; title=&quot;Ohm Chess HD&quot;&gt;Ohm Chess&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Here are some more images from the game:&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/chessknight.png&quot; alt=&quot;Black knight&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The black knight chesspiece, also used as the icon for the game.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/sprite_ai.png&quot; alt=&quot;Evil&quot; /&gt;&lt;/p&gt;

&lt;p&gt;&quot;Evil&quot; - Represents the AI.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/sprite_human1.png&quot; alt=&quot;Female&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Female human player.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/sprite_human2.png&quot; alt=&quot;Male&quot; /&gt;&lt;/p&gt;

&lt;p&gt;Male human player.&lt;/p&gt;

&lt;p&gt;&lt;img src=&quot;/images/theking.png&quot; alt=&quot;The King&quot; /&gt;&lt;/p&gt;

&lt;p&gt;The King, the first image I drew for the game.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/11/ghost-king</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/11/ghost-king/"/>
    <title>Ghost King</title>
    <updated>2011-11-11T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;An old doodle, but there's something about it I like.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/11/delicious-horror</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/11/delicious-horror/"/>
    <title>Delicious Horror from Beyond</title>
    <updated>2011-11-11T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;Gotta love tentacles.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/11/cloudsketch</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/11/cloudsketch/"/>
    <title>Clouds (sketch)</title>
    <updated>2011-11-11T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2011/11/10/scream</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2011/11/10/scream/"/>
    <title>Scream</title>
    <updated>2011-11-10T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;This is a very old sketch, and I don't look like this any longer.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2010/05/08/no-microphone-input-in-skype-ubuntu-10-04</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2010/05/08/no-microphone-input-in-skype-ubuntu-10-04/"/>
    <title>No microphone input in skype, ubuntu 10.04</title>
    <updated>2010-05-08T00:00:00+02:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;After upgrading to ubuntu 10.04, my audio input stopped working. I solved it by installing pavucontrol, going to the input tab, and lowering the volume on the right input channel to zero. Once that was set to zero, everything worked fine.&lt;/p&gt;

&lt;p&gt;Also make sure to unclick the &quot;allow skype to automatically adjust my volume settings&quot; option in skype itself, or it will lower the input volume to zero.&lt;/p&gt;
</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2009/12/20/dell-studio-17-laptop-keyboard-in-xorg</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2009/12/20/dell-studio-17-laptop-keyboard-in-xorg/"/>
    <title>Dell Studio 17 laptop keyboard in Xorg</title>
    <updated>2009-12-20T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/herrdoktorprofessor/4200363989/&quot; title=&quot;My laptop by volyova, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2646/4200363989_f63a518301_m.jpg&quot; width=&quot;135&quot; height=&quot;240&quot; alt=&quot;My laptop&quot; align=&quot;right&quot; /&gt;&lt;/a&gt; I have a pretty big &lt;a href=&quot;http://www.notebookreview.com/default.asp?newsID=4471&quot;&gt;Dell Studio&lt;/a&gt; laptop that I use as a desktop computer replacement. It's a very nice machine with good hardware support in Linux (if you can live with some closed source drivers), and has a gorgeous 17&quot; screen with a 1920x1200 resolution.&lt;/p&gt;




&lt;p&gt;Everything has been working well, except that ever since &lt;a href=&quot;http://www.x.org/&quot;&gt;Xorg&lt;/a&gt; switched to &lt;a href=&quot;http://en.wikipedia.org/wiki/Evdev&quot;&gt;evdev&lt;/a&gt; the numpad on the laptop keyboard hasn't been mapped correctly. I haven't bothered fixing it since I don't really use the numpad much.&lt;/p&gt;




&lt;p&gt;This weekend I decided to try running &lt;a href=&quot;http://kde.org/&quot;&gt;KDE&lt;/a&gt; for a while, and installed &lt;a href=&quot;http://www.kubuntu.org/&quot;&gt;kubuntu 9.10&lt;/a&gt;. When setting up my usual keyboard mappings - US, SV and caps lock turned in to another ctrl key - I discovered that there's an auspicious &lt;code&gt;-model&lt;/code&gt; parameter that you can give to &lt;code&gt;setxkbmap&lt;/code&gt;. Digging around a bit, this command makes everything work correctly for me on my laptop:&lt;/p&gt;




&lt;pre&gt;
  setxkbmap -model latitude -layout us,se -variant altgr-intl,
  setxkbmap -option -option ctrl:nocaps
&lt;/pre&gt;




&lt;p&gt;Putting it up here in case someone else is having similar issues.&lt;/p&gt;




&lt;p&gt;
&lt;strong&gt;Update, Nov 2011&lt;/strong&gt;:
The Studio 17 laptop has now completely stopped working. It's having huge problems with overheating, and will shutdown after only a few minutes of operation. I've gotten as much dust out as I am able, and now I suspect that what is needed is to re-seat the processor cooling with new cooling paste. Since I'm not using this laptop any longer, I haven't bothered. But a heads-up: These laptops get hot. As in, too hot to function properly.
&lt;/p&gt;

</content>
  </entry>
  
  <entry>
    <id>http://kri.gs/2009/12/15/n900</id>
    <link type="text/html" rel="alternate" href="http://kri.gs/2009/12/15/n900/"/>
    <title>N900</title>
    <updated>2009-12-15T00:00:00+01:00</updated>
    <author>
      <name>krig</name>
      <uri>http://kri.gs</uri>
    </author>
    <content type="html">&lt;p&gt;Through work, I got my hands on a &lt;a href=&quot;http://maemo.nokia.com/n900/&quot;&gt;Nokia N900&lt;/a&gt;. When it was first pre-ordered, the release was supposed to happen in October. It then got delayed and delayed, and finally exclusively delayed in sweden (yay!). After what seemed like forever, it arrived at the office yesterday.&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://www.flickr.com/photos/herrdoktorprofessor/4186663555/&quot; title=&quot;Ferris wheel in malmö by volyova, on Flickr&quot;&gt;&lt;img src=&quot;http://farm3.static.flickr.com/2580/4186663555_05b89808e6.jpg&quot; width=&quot;500&quot; height=&quot;281&quot; alt=&quot;Ferris wheel in malmö&quot; /&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Before I say too much about it, I should state some simple facts that might colour your perception of what I'm going to say about it:&lt;/p&gt;

&lt;ul&gt;
    &lt;li&gt;I am a professional GNU/Linux developer, and my primary tools are ZSH, Git and Emacs.&lt;/li&gt;
    &lt;li&gt;I've never owned an iPhone (although &lt;em&gt;b&lt;/em&gt; has one she's had for over a year, so I've played with one).&lt;/li&gt;
    &lt;li&gt;My previous phone was not a smart-phone at all, it was a Sony Ericsson w880i.&lt;/li&gt;
    &lt;li&gt;I have zero experience with Nokia phones or tablets before this one.&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;That said, here's my 2 second review:&lt;/p&gt;

&lt;h3&gt;good&lt;/h3&gt;


&lt;ul&gt;
    &lt;li&gt;Beautiful screen.&lt;/li&gt;
    &lt;li&gt;The camera has autofocus and takes &lt;a href=&quot;http://www.flickr.com/photos/herrdoktorprofessor/4187446618/sizes/l/&quot;&gt;pretty good photos&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;SSH! client + server. I update the phone through a terminal on my laptop. That is quite awesome.&lt;/li&gt;
    &lt;li&gt;Debian Linux behind the scenes. Tools I'm familiar with.&lt;/li&gt;
    &lt;li&gt;No problem importing my contacts (though I had to jump via my computer).&lt;/li&gt;
    &lt;li&gt;MicroB is alright as a browser, feels just as fast as the browser on the iphone to me.&lt;/li&gt;
    &lt;li&gt;Flash (meaning youtube).&lt;/li&gt;
    &lt;li&gt;Plays video like a dream. Xvid, m4v, anything.&lt;/li&gt;
    &lt;li&gt;Ogg and flac support (naturally, just have to install the right .debs).&lt;/li&gt;
    &lt;li&gt;Open development means I can fix bugs when I encounter them instead of learning to live with them. I've already filed a bug for and patched one program to fix an issue I encountered.&lt;/li&gt;
&lt;/ul&gt;


&lt;h3&gt;bad&lt;/h3&gt;


&lt;ul&gt;
    &lt;li&gt;The touch screen is finicky, and scrolling in lists tests my patience. This could be a software issue, I'm not sure.&lt;/li&gt;
    &lt;li&gt;Not much software yet, and even less software that is &lt;a href=&quot;https://wiki.maemo.org/Opt_Problem&quot;&gt;optified&lt;/a&gt;.&lt;/li&gt;
    &lt;li&gt;Haven't gotten email working.&lt;/li&gt;
    &lt;li&gt;Pretty much no games. There is Quake 3, Baldur's Gate, Scummvm and a bunch of emulators closing in (so maybe this should be under good)?&lt;/li&gt;
&lt;/ul&gt;


&lt;p&gt;My conclusion right now would be that if you're a programmer, you want this phone. If you're an active open source developer, you definitely want it. If you have an iPhone, you might as well keep it. The N900 isn't a better phone, and there is way more software for the iPhone.&lt;/p&gt;

&lt;h1&gt;Update, Nov 2011&lt;/h1&gt;

&lt;p&gt;I am now the owner of an iPhone 3Gs, after a brief encounter with the android platform. I'm also, at this point, an iOS developer. To me, the dream of a true open source phone again seems very distant. Android is a complete disappointment. At the same time, I don't know if I can even envision what a usable, consistent, open source phone would be like. Hopefully someone will show me, some day.&lt;/p&gt;

&lt;p&gt;See also: My rant on android, &lt;a href=&quot;http://koru.se/post/2911595702/my-android-rant&quot; title=&quot;My android rant&quot;&gt;elsewhere&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  
 
</feed>
