<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
     xmlns:atom="http://www.w3.org/2005/Atom"
     xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:wfw="http://wellformedweb.org/CommentAPI/"
     >
  <channel>
    <title>Code Kills</title>
    <link>http://blog.codekills.net</link>
    <description></description>
    <pubDate>Sun, 22 Jan 2012 21:05:58 GMT</pubDate>
    <generator>Blogofile</generator>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Vim functions to change tab treatment</title>
      <link>http://blog.codekills.net/2012/01/22/vim-functions-to-change-tab-treatment</link>
      <pubDate>Sun, 22 Jan 2012 16:00:00 EST</pubDate>
      <category>Vim</category>
      <guid isPermaLink="true">http://blog.codekills.net/2012/01/22/vim-functions-to-change-tab-treatment</guid>
      <description>Vim functions to change tab treatment</description>
      <content:encoded>

&lt;p&gt;I&#39;ve gotten tired of doing the &lt;tt&gt;:setlocal tabstop=...&lt;/tt&gt; dance every
time I start editing a file from someone who has their own unique feelings
about how wide tabs should be... So I&#39;ve written two little functions which
make it easy to change a buffer&#39;s tab mode:&lt;/p&gt;

&lt;script src=&#34;https://gist.github.com/1658762.js?file=tabtreatment.vim&#34;&gt;&lt;/script&gt;

&lt;p&gt;For example, when I start editing something written by someone who believes
spaces are evil and tabs should be five spaces wide, I just need to &lt;tt&gt;:call
HardTabs(5)&lt;/tt&gt;.&lt;/p&gt;
</content:encoded>
    </item>
    <item>
      <title>In case of Wikimergency (removing Wikipedia&#39;s blackout)</title>
      <link>http://blog.codekills.net/2012/01/18/in-case-of-wikimergency</link>
      <pubDate>Wed, 18 Jan 2012 02:06:12 EST</pubDate>
      <category>Uncategorized</category>
      <guid isPermaLink="true">http://blog.codekills.net/2012/01/18/in-case-of-wikimergency</guid>
      <description>In case of Wikimergency (removing Wikipedia&#39;s blackout)</description>
      <content:encoded>

&lt;p&gt;Here&#39;s a bookmarklet that will remove the &lt;a href=&#34;http://en.wikipedia.org/wiki/Wikipedia:SOPA_initiative/Learn_more&#34;&gt;SOPA&lt;/a&gt; blackout overlay from
Wikipedia:&lt;/p&gt;

&lt;code&gt;
javascript:(function(){document.getElementById(&#34;mw-sopaOverlay&#34;).style.display = &#34;none&#34;; var ids = [&#34;mw-page-base&#34;, &#34;mw-head-base&#34;, &#34;content&#34;, &#34;mw-head&#34;, &#34;mw-panel&#34;, &#34;footer&#34;]; for (var i = 0; i &lt; ids.length; i += 1) document.getElementById(ids[i]).style.display = &#34;block&#34;;})()
&lt;/code&gt;

&lt;p&gt;Or &lt;a href=&#34;javascript:(function(){document.getElementById(&amp;qt;mw-sopaOverlay&amp;qt;).style.display = &amp;qt;none&amp;qt;; var ids = [&amp;qt;mw-page-base&amp;qt;, &amp;qt;mw-head-base&amp;qt;, &amp;qt;content&amp;qt;, &amp;qt;mw-head&amp;qt;, &amp;qt;mw-panel&amp;qt;, &amp;qt;footer&amp;qt;]; for (var i = 0; i &lt; ids.length; i += 1) document.getElementById(ids[i]).style.display = &amp;qt;block&amp;qt;;})()&#34;&gt;bookmark this link&lt;/a&gt;.&lt;/p&gt;


</content:encoded>
    </item>
    <item>
      <title>Loading Google Closure libraries from Node.js</title>
      <link>http://blog.codekills.net/2012/01/10/loading-google-closure-libraries-from-node.js</link>
      <pubDate>Tue, 10 Jan 2012 01:24:42 EST</pubDate>
      <category>JavaScript</category>
      <guid isPermaLink="true">http://blog.codekills.net/2012/01/10/loading-google-closure-libraries-from-node.js</guid>
      <description>Loading Google Closure libraries from Node.js</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;While developing &lt;a class=&#34;reference external&#34; href=&#34;http://wolever.github.com/remora/example/&#34;&gt;remora&lt;/a&gt; (which will be released &amp;quot;soon&amp;quot;) I had to load
&lt;a class=&#34;reference external&#34; href=&#34;http://code.google.com/closure/&#34;&gt;Google Closure&lt;/a&gt; libraries from &lt;a class=&#34;reference external&#34; href=&#34;http://nodejs.org/&#34;&gt;Node.js&lt;/a&gt;. As it turns out, I&#39;m the first
one who has had to do this, so a blog post seemed in order.&lt;/p&gt;
&lt;p&gt;I&#39;ve loaded my Closure library in Node by creating a Node module which loads
Closure&#39;s &lt;tt class=&#34;docutils literal&#34;&gt;base.js&lt;/tt&gt;, tells Closure how to load JavaScript files, loads my
Closure library, then exports everything (the &lt;tt class=&#34;docutils literal&#34;&gt;goog&lt;/tt&gt; name space and my
namespace) through &lt;tt class=&#34;docutils literal&#34;&gt;module.exports&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;First, an &lt;tt class=&#34;docutils literal&#34;&gt;execfile&lt;/tt&gt; function is needed, which will load and evaluate a
JavaScript file using a particular namespace:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
var vm = require(&amp;quot;vm&amp;quot;);
var fs = require(&amp;quot;fs&amp;quot;);

function execfile(path) {
  var data = fs.readFileSync(path);
  vm.runInThisContext(data, path);
}
&lt;/pre&gt;
&lt;p&gt;Note: for various reasons (one of which being &lt;a class=&#34;reference external&#34; href=&#34;http://stackoverflow.com/q/8873969/71522&#34;&gt;that you can&#39;t control the value
of &#39;this&#39; from the &#39;vm&#39; module&lt;/a&gt;) &lt;tt class=&#34;docutils literal&#34;&gt;vm.runInThisContext&lt;/tt&gt; &lt;em&gt;must&lt;/em&gt; be used to load
the scripts into the &lt;em&gt;global&lt;/em&gt; context. Trying to load the into a sandbox
seems to fail for reasons I can&#39;t fully explain yet.&lt;/p&gt;
&lt;p&gt;Next, the Closure &lt;tt class=&#34;docutils literal&#34;&gt;base.js&lt;/tt&gt; and &lt;tt class=&#34;docutils literal&#34;&gt;deps.js&lt;/tt&gt; files are loaded and
&lt;tt class=&#34;docutils literal&#34;&gt;CLOSURE_IMPORT_SCRIPT&lt;/tt&gt; is set to a thin wrapper around &lt;tt class=&#34;docutils literal&#34;&gt;execfile&lt;/tt&gt;:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
var base_basedir = &amp;quot;../src/browser/&amp;quot;;
execfile(base_basedir + &amp;quot;base.js&amp;quot;);
execfile(base_basedir + &amp;quot;deps.js&amp;quot;);
goog.global.CLOSURE_IMPORT_SCRIPT = function(path) {
  execfile(base_basedir + path);
  return true;
};
&lt;/pre&gt;
&lt;p&gt;Now Closure libraries which use &lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;goog.require(...)&lt;/span&gt;&lt;/tt&gt; and
&lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;goog.provide(...)&lt;/span&gt;&lt;/tt&gt; can be loaded:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
execfile(&amp;quot;../src/remora.js&amp;quot;);
&lt;/pre&gt;
&lt;p&gt;(note: only the base library needs to be loaded; its dependencies will be taken
care of by &lt;tt class=&#34;docutils literal&#34;&gt;&lt;span class=&#34;pre&#34;&gt;goog.require(...)&lt;/span&gt;&lt;/tt&gt;).&lt;/p&gt;
&lt;p&gt;Normal JavaScript packages can also be loaded:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
execfile(&amp;quot;../libs/underscore-1.2.3.js&amp;quot;);
&lt;/pre&gt;
&lt;p&gt;Finally, &lt;tt class=&#34;docutils literal&#34;&gt;module.exports&lt;/tt&gt; is set:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
module.exports = {
    goog: GLOBAL.goog,
    remora: GLOBAL.remora,
};
&lt;/pre&gt;
&lt;p&gt;Note: because Closure scripts expect that require/provide will inject items
into the global namespace, the global names created (ex, &lt;tt class=&#34;docutils literal&#34;&gt;goog&lt;/tt&gt; and
&lt;tt class=&#34;docutils literal&#34;&gt;remora&lt;/tt&gt;) cannot be deleted from the global namespace.&lt;/p&gt;
&lt;p&gt;And that&#39;s all there is to it. This file can now be loaded like any other Node
module (ex, &lt;tt class=&#34;docutils literal&#34;&gt;var my_closure_library = &lt;span class=&#34;pre&#34;&gt;require(&amp;quot;./closure_compat.js&amp;quot;)&lt;/span&gt;&lt;/tt&gt;).&lt;/p&gt;
&lt;p&gt;For a complete example, see &lt;a class=&#34;reference external&#34; href=&#34;https://github.com/wolever/remora/blob/master/src/node/remora.dev.js&#34;&gt;remora/src/node/remora.dev.js&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>Which SSD You Should Buy</title>
      <link>http://blog.codekills.net/2011/11/22/which-ssd-you-should-buy</link>
      <pubDate>Tue, 22 Nov 2011 19:32:25 EST</pubDate>
      <category>Miscellany</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/11/22/which-ssd-you-should-buy</guid>
      <description>Which SSD You Should Buy</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;I&#39;m thinking about buying a 200+ GB SSD for my laptop, and this post summarizes
my research. Note that it is current as of November 22, 2011 and will likely be
irrelevant by 2012.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt; The &lt;a class=&#34;reference external&#34; href=&#34;http://www.amazon.com/mn/search?_encoding=UTF8&amp;amp;x=0&amp;amp;y=0&amp;amp;field-keywords=corsair%20force%20gt&amp;amp;url=search-alias%3Daps&amp;amp;sprefix=corsair%20fo&amp;amp;_encoding=UTF8&amp;amp;tag=codekills-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=390957&#34;&gt;Corsair Force GT&lt;/a&gt; seems to be the fastest choice with
&lt;a class=&#34;reference external&#34; href=&#34;http://www.amazon.ca/mn/search?_encoding=UTF8&amp;amp;x=0&amp;amp;y=0&amp;amp;field-keywords=Crucial%20M4&amp;amp;url=search-alias%3Daps&amp;amp;_encoding=UTF8&amp;amp;tag=codekills09-20&amp;amp;linkCode=ur2&amp;amp;camp=15121&amp;amp;creative=390961&#34;&gt;Crucial m4&lt;/a&gt; coming in a fairly close second. Data on failure rates for these
drives/controllers has been hard to find, though, and all signs point to Intel
drives being the most reliable (but also most expensive and slowest).&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;reference external&#34; href=&#34;http://techreport.com/articles.x/21843&#34;&gt;TechReport&#39;s SSD performance review&lt;/a&gt; which &lt;a class=&#34;reference external&#34; href=&#34;http://twitter.com/samstokes&#34;&gt;&amp;#64;samstokes&lt;/a&gt; sent me, which seems
to find the two aforementioned drives to have the best performance, with the
&lt;a class=&#34;reference external&#34; href=&#34;http://www.amazon.ca/mn/search?_encoding=UTF8&amp;amp;x=0&amp;amp;y=0&amp;amp;field-keywords=force%20series%203&amp;amp;url=search-alias%3Daps?rh=k:forceseries3,i:electronics&amp;amp;_encoding=UTF8&amp;amp;tag=codekills09-20&amp;amp;linkCode=ur2&amp;amp;camp=15121&amp;amp;creative=390961&#34;&gt;Corsair Force Series 3&lt;/a&gt; making a decent showing as well. It also suggests
that the &lt;a class=&#34;reference external&#34; href=&#34;http://www.amazon.com/mn/search?_encoding=UTF8&amp;amp;x=0&amp;amp;y=0&amp;amp;field-keywords=intel%20ssd&amp;amp;url=search-alias%3Daps?url=search-alias=aps&amp;amp;_encoding=UTF8&amp;amp;tag=codekills-20&amp;amp;linkCode=ur2&amp;amp;camp=1789&amp;amp;creative=390957&#34;&gt;Intel 500 series&lt;/a&gt; is a bit slower and significantly more expensive than
the competition.&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;reference external&#34; href=&#34;http://www.tomshardware.com/reviews/ssd-reliability-failure-rate,2923.html&#34;&gt;Tom&#39;s Hardware investigation on SSD reliability&lt;/a&gt; suggests that &lt;a class=&#34;reference external&#34; href=&#34;http://www.tomshardware.com/reviews/ssd-reliability-failure-rate,2923-4.html&#34;&gt;Intel&#39;s SSDs
are much more reliable&lt;/a&gt; (specifically their X25-M series; a sentiment I&#39;ve
read in other places too), but it doesn&#39;t compare their failure rates to other
manufacturers because &amp;quot;&lt;a class=&#34;reference external&#34; href=&#34;http://www.tomshardware.com/reviews/ssd-reliability-failure-rate,2923-9.html&#34;&gt;those are the drives that big businesses currently
trust the most&lt;/a&gt;&amp;quot;.&lt;/p&gt;
&lt;p&gt;Friends on Twitter and Facebook generally recommended the m4.&lt;/p&gt;
&lt;p&gt;It&#39;s also worth noting that I&#39;ve read quite a few posts similar to &lt;a class=&#34;reference external&#34; href=&#34;http://www.codinghorror.com/blog/2011/05/the-hot-crazy-solid-state-drive-scale.html&#34;&gt;The
Hot/Crazy Solid State Drive Scale&lt;/a&gt; which suggest that failures can be fairly
common. These posts have mostly been more than six months old, though, so I&#39;m
hoping that most of these problems have been sorted out in newer drives (it
seems that there are often issues which can be fixed by a software update).&lt;/p&gt;
&lt;p&gt;The net result is that I&#39;m probably going to get a Force GT or m4, which ever I
can find for a reasonable price from a local retailer with a good return
policy.&lt;/p&gt;
&lt;p&gt;Disclaimer: what you see is what you get. I&#39;ve done enough research to convince
myself that an SSD isn&#39;t a terrible idea, but that&#39;s definitely far from enough
research to objectively show that an SSD isn&#39;t a terrible idea. Also, I&#39;ve
included links to Amazon for two reasons: 1) because prices change so often
that quoting them here wouldn&#39;t be that useful, and 2) I&#39;ve just setup a fancy
affiliate account, so I stand a small chance of making a small amount of money
from them.&lt;/p&gt;
&lt;img alt=&#34;https://www.assoc-amazon.com/e/ir?t=codekills-20&amp;amp;l=ur2&amp;amp;o=1&#34; src=&#34;https://www.assoc-amazon.com/e/ir?t=codekills-20&amp;amp;l=ur2&amp;amp;o=1&#34; /&gt;
&lt;img alt=&#34;https://www.assoc-amazon.ca/e/ir?t=codekills09-20&amp;amp;l=ur2&amp;amp;o=15&#34; src=&#34;https://www.assoc-amazon.ca/e/ir?t=codekills09-20&amp;amp;l=ur2&amp;amp;o=15&#34; /&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>howto: running the wifi and power at medium sized tech events</title>
      <link>http://blog.codekills.net/2011/11/07/running-wifi-and-power-at-tech-events</link>
      <pubDate>Mon, 07 Nov 2011 13:32:36 EST</pubDate>
      <category>Events</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/11/07/running-wifi-and-power-at-tech-events</guid>
      <description>howto: running the wifi and power at medium sized tech events</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;Because I&#39;ve done it a few times now and picked up a few tricks, I thought I
would write a checklist for anyone who needs (or wants) to run the wifi and
power at a medium sized (10 - 100 people) tech event.&lt;/p&gt;
&lt;p&gt;I hope that this checklist will be a useful for events like &lt;a class=&#34;reference external&#34; href=&#34;http://software-carpentry.org/&#34;&gt;Software
Carpentry&lt;/a&gt; or &lt;a class=&#34;reference external&#34; href=&#34;http://ladieslearningcode.com/&#34;&gt;Ladies Learning Code&lt;/a&gt;, as it will give someone with some
networking knowledge &lt;a class=&#34;footnote-reference&#34; href=&#34;#id5&#34; id=&#34;id1&#34;&gt;[0]&lt;/a&gt; the nuts-and-bolts they need to setup and run a great
(or at least functional) network.&lt;/p&gt;
&lt;p&gt;I&#39;ve published this document as a Gist on GitHub to make updates easy.&lt;/p&gt;
&lt;p&gt;The document: &lt;a class=&#34;reference external&#34; href=&#34;https://gist.github.com/1346886&#34;&gt;Wifi and power for medium sized tech events:
https://gist.github.com/1346886&lt;/a&gt;&lt;/p&gt;
&lt;table class=&#34;docutils footnote&#34; frame=&#34;void&#34; id=&#34;id5&#34; rules=&#34;none&#34;&gt;
&lt;colgroup&gt;&lt;col class=&#34;label&#34; /&gt;&lt;col /&gt;&lt;/colgroup&gt;
&lt;tbody valign=&#34;top&#34;&gt;
&lt;tr&gt;&lt;td class=&#34;label&#34;&gt;&lt;a class=&#34;fn-backref&#34; href=&#34;#id1&#34;&gt;[0]&lt;/a&gt;&lt;/td&gt;&lt;td&gt;anyone who knows the function of DHCP and the meaning of &amp;quot;default
gateway&amp;quot; should be fine.&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>Winter protip: hand warmers. Lots of them.</title>
      <link>http://blog.codekills.net/2011/10/31/winter-protip--hand-warmers.-lots-of-them.</link>
      <pubDate>Mon, 31 Oct 2011 00:08:47 EDT</pubDate>
      <category>Miscellany</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/10/31/winter-protip--hand-warmers.-lots-of-them.</guid>
      <description>Winter protip: hand warmers. Lots of them.</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;Now that winter is coming, I&#39;d like to share a tip that has been the difference
between a terrible and a great day: &lt;a class=&#34;reference external&#34; href=&#34;http://www.mec.ca/AST/ShopMEC/HikingCamping/HealthSafety/OutdoorSafety/PRD~4016-235/heat-factory-hand-warmer.jsp&#34;&gt;hand warmers&lt;/a&gt;. Lots of hand warmers.&lt;/p&gt;
&lt;p&gt;Here&#39;s what you do:&lt;/p&gt;
&lt;ol class=&#34;arabic simple&#34;&gt;
&lt;li&gt;Buy hand warmers. Lots of them. Like fifteen pairs of them. They are $1.20
for a pair, so no banks will be broken by having a few extras.&lt;/li&gt;
&lt;li&gt;Put a pair (or two?) in the pocket of each of your winter jackets.&lt;/li&gt;
&lt;li&gt;Use them! Next time you (or your friend/spouse/child) is uncomfortably cold,
just rip a hand warmer open. Ten minutes later you&#39;ll have a warm little
bundle of joy to stick in your boot/glove/jacket/hat.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;There are a bunch of reasons I&#39;ve found step three to be hard: I don&#39;t want to
admit to myself that I&#39;m &lt;em&gt;actually&lt;/em&gt; cold, I don&#39;t want to use them now because
I may need them even more in the future, or because I don&#39;t feel like the
warmth is worth the $1.20 it will cost... But since I have &lt;em&gt;never&lt;/em&gt; regretted
using one, I feel like it&#39;s worth tricking myself into using them more
liberally by keeping lots of spares around, using it &amp;quot;for a friend&amp;quot;, and
telling myself that each one only costs 60¢ (that&#39;s like two quarters!).&lt;/p&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>On Startups and Identity</title>
      <link>http://blog.codekills.net/2011/10/18/on-startups-and-identity</link>
      <pubDate>Tue, 18 Oct 2011 15:18:42 EDT</pubDate>
      <category>Uncategorized</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/10/18/on-startups-and-identity</guid>
      <description>On Startups and Identity</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;A curious thing I&#39;ve noticed recently is that a large number of startups don&#39;t
include any information about the identity of the founders/employees.&lt;/p&gt;
&lt;p&gt;I find this strange because, in my opinion, a big advantage of working with (or
using the product of) a startup is that I can get to know the person (or
people) behind the scenes. They might even be someone I know, or someone a
friend knows.&lt;/p&gt;
&lt;p&gt;I would go on, but I would just be repeating what Jason Cohen says in &lt;a class=&#34;reference external&#34; href=&#34;http://blog.asmartbear.com/youre-a-little-company-now-act-like-one.html&#34;&gt;You&#39;re a
little company, now act like one&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;So, if you&#39;re part of a startup: please, include your identity and the
identity of the other founders/employees somewhere on your website.&lt;/p&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>What Makes a Good Resume</title>
      <link>http://blog.codekills.net/2011/10/17/what-makes-a-good-resume</link>
      <pubDate>Mon, 17 Oct 2011 21:40:54 EDT</pubDate>
      <category>Uncategorized</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/10/17/what-makes-a-good-resume</guid>
      <description>What Makes a Good Resume</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;I&#39;ve read a small but nontrival number of resumes in my life, and each time
I&#39;ve vocalized strong feelings about what makes a resume good or bad.&lt;/p&gt;
&lt;p&gt;Some people, presumably mistaking these strong feelings for expertise,
have asked me for advice when writing their resume... So I will summarize here
the things which I appreciate or despise while reading a resume.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Disclaimer&lt;/strong&gt;: these are just my feelings. It&#39;s likely that people similar
to me will have similar feelings, but it&#39;s unlikely that someone like me
will be the first one reading your resume.&lt;/p&gt;
&lt;p&gt;For many positions a non-technical recruiter or HR person will be the first
to see your resume. They will likely apply naive pattern matching against a
given set of buzzwords to determine the quality of applicants, so a section
containing buzzwords and synonyms (ex, &amp;quot;Python, CPython, Django 1.3, Django
1.2, Django forms, Django admin, AJAX, ...&amp;quot;) would likely be helpful
(although, again, I can&#39;t speak with authority as I&#39;m not a non-technical
recruiter).&lt;/p&gt;
&lt;p&gt;&lt;a class=&#34;reference external&#34; href=&#34;http://stevehanov.ca/&#34;&gt;Steve Hanov&lt;/a&gt; has a &lt;a class=&#34;reference external&#34; href=&#34;http://stevehanov.ca/blog/index.php?id=56&#34;&gt;comic that might be helpful&lt;/a&gt;.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;As I&#39;m looking at a resume I&#39;m trying to answer three questions: what does the
applicant know? How well do they know it? Would an interview with this
applicant be a waste of time?&lt;/p&gt;
&lt;p&gt;Some of the things I like to see are:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;A summary of skills, programming languages and tools&lt;/strong&gt; &lt;em&gt;sorted by
experience&lt;/em&gt;. I can&#39;t count the number of times a applicant includes a list
like this on their resume:&lt;/p&gt;
&lt;blockquote&gt;
&lt;dl class=&#34;docutils&#34;&gt;
&lt;dt&gt;&lt;strong&gt;Programming languages&lt;/strong&gt;:&lt;/dt&gt;
&lt;dd&gt;Python, Java, C/C++, Objective-C, JavaScript, C#, Visual Basic, HTML,
CSS, Perl, Scheme, ML, Prolog.&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Tools&lt;/strong&gt;:&lt;/dt&gt;
&lt;dd&gt;Make, Vim, Emacs, Word, Power Point, Terminal, Linux, Firefox, Flash
Player.&lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;
&lt;p&gt;This kind of list is &lt;em&gt;absolutely useless&lt;/em&gt;. Actually, no, that&#39;s not true.
It&#39;s very useful. It tells me that the applicant doesn&#39;t feel the need to
distinguish between their knowledge of Prolog and their knowledge of
JavaScript, and they think C is similar enough to C++ to warrant listing them
together.&lt;/p&gt;
&lt;p&gt;A list ordered by experience is much more useful. For example, my list might
look something like this:&lt;/p&gt;
&lt;blockquote&gt;
&lt;dl class=&#34;docutils&#34;&gt;
&lt;dt&gt;&lt;strong&gt;Programming languages&lt;/strong&gt;:&lt;/dt&gt;
&lt;dd&gt;Python (5 years, 50k &lt;a class=&#34;reference external&#34; href=&#34;http://en.wikipedia.org/wiki/Source_lines_of_code&#34;&gt;SLOC&lt;/a&gt;), ActionScript (2 years, 20k SLOC),
JavaScript (5 years, 5k SLOC), HTML+CSS (5 years), C (2 years, 2k
SLOC), some knowledge of PHP, Scheme, Haskell, and ML.&lt;/dd&gt;
&lt;dt&gt;&lt;strong&gt;Tools&lt;/strong&gt;:&lt;/dt&gt;
&lt;dd&gt;Vim (6 years), Bash (4 years), POSIX shell environment and utilities (4
years), Linux (8 years, mostly Debian and server administration),
Mercurial (3 years), git (1 year).&lt;/dd&gt;
&lt;/dl&gt;
&lt;/blockquote&gt;
&lt;p&gt;Alternatively, the headings &amp;quot;most experience with&amp;quot; and &amp;quot;some experience with&amp;quot;
could be used, as they give some idea of both expertise and breadth.&lt;/p&gt;
&lt;p&gt;It&#39;s also worth noting that, at least in students, &lt;a class=&#34;reference external&#34; href=&#34;http://computinged.wordpress.com/2011/08/17/eric-mazurs-keynote-at-icer-2011-observing-demos-hurts-learning-and-confusion-is-a-sign-of-understanding/&#34;&gt;self assessment of
knowledge is useless&lt;/a&gt;, so when I see &amp;quot;export&amp;quot; or &amp;quot;very good&amp;quot; in a resume I
mentally replace it with &amp;quot;&lt;a class=&#34;reference external&#34; href=&#34;http://www.damninteresting.com/unskilled-and-unaware-of-it/&#34;&gt;dangerously ignorant&lt;/a&gt;&amp;quot;.&lt;/p&gt;
&lt;a class=&#34;reference external image-reference&#34; href=&#34;http://www.slideshare.net/olvemaudal/deep-c&#34;&gt;&lt;img alt=&#34;https://img.skitch.com/20111018-cct5dckmiwpi2tg8a3r12mtket.png&#34; src=&#34;https://img.skitch.com/20111018-cct5dckmiwpi2tg8a3r12mtket.png&#34; /&gt;&lt;/a&gt;
&lt;p&gt;&lt;strong&gt;Relevant links&lt;/strong&gt;. I feel like this should go without saying, but I would
guess that less than 10% of the resumes I have read included &lt;em&gt;any kind&lt;/em&gt; of
link.&lt;/p&gt;
&lt;p&gt;I appreciate any links to a applicant&#39;s online presence: a blog or personal
website (if it has been updated in the last five years) is good, and an account
on GitHub, BitBucket, StackOverflow, Reddit or other social site would be even
better. It&#39;s hard to convey interpersonal and communication skills on a resume,
but social sites serve as a good way to demonstrate those skills.&lt;/p&gt;
&lt;p&gt;And a corollary which, based on experience, isn&#39;t as obvious as you might
expect: &lt;em&gt;irrelevant&lt;/em&gt; links (for example, to a &amp;quot;home page&amp;quot; without any
interesting content) are worse than useless - they waste my time and make the
applicant look silly.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Length&lt;/strong&gt;. I don&#39;t care. After the summary of skills, languages and tools I&#39;m
usually skimming for interesting things... And if the applicant has three pages
worth of interesting things, I would like to read those three pages. But if the
applicant has three pages of boring things, I will probably skim the second and
glance over the third.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Relevant work experience&lt;/strong&gt;. And, more specifically, &lt;em&gt;specific&lt;/em&gt; work
experience. A statement like &amp;quot;worked on a team&amp;quot; or &amp;quot;helped implement&amp;quot; isn&#39;t as
helpful as &amp;quot;wrote server-side JavaScript&amp;quot; or &amp;quot;designed the database schema&amp;quot;.
Also, while others might, I don&#39;t care about unrelated work experience.&lt;/p&gt;
&lt;p&gt;It&#39;s also useful to include the technologies used at a job. For example:
&amp;quot;MegaCorp - 2001 - 2003; - Designed database schema to optimize sale
transactions; - Performed A/B testing to optimize widget sales; Technologies:
PostgreSQL, PHP, libABTestOMatic&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;School&lt;/strong&gt;. As a university dropout, I&#39;m a bit biased here, but I care very
little about school or degrees unless they are directly relevant to the job at
hand. For example, if I the position I&#39;m hiring for would benefit from a strong
knowledge of a particular academic field, formal education in that field would
be important... But, in general, I haven&#39;t found formal education to be very
important for the types of programming that I do, so it&#39;s not important to me
while I&#39;m hiring.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Look, feel and other little things&lt;/strong&gt; are important too. Not in the
it-needs-to-look-pretty sense — I don&#39;t have any problem with a bland resume
written in Word — but in the fanatic-attention-to-detail sense. I want a
programmer who cares as much as I do about consistency, attention to detail and
never, ever, under any circumstances using tabs and spaces interchangeably. If
an applicant&#39;s resume has bullets that don&#39;t line up, text in random fonts and
obviously missing punctuation, I&#39;m going to assume that their code will look
similar.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Cover letters&lt;/strong&gt;. I have read one or two very good cover letters where the
applicant gave specific reasons they were interested in the job and why they
would be worth my time to interview. They were short, to the point, and
distinctly lacking in phrases such as &amp;quot;I would make an excellent …&amp;quot;. I
appreciated these cover letters. I have skimmed and subsequently ignored all
other cover letters.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;tl;dr&lt;/strong&gt;: I want a resume to show me in as much detail as is sensible what the
applicant has done, what they know, and why they are a good programmer. Bonus
points for interesting content and links to social sites like StackOverflow or
Reddit.&lt;/p&gt;
&lt;p&gt;PS: My startup is (or will in the near future be) hiring! If you&#39;re interested
in working for a Toronto based startup which employs incredibly brilliant
people, uses a lot of Python, produces a real, physical product, and pays real,
actual money, send me an email: &lt;a class=&#34;reference external&#34; href=&#34;mailto:david&amp;#64;wolever.net&#34;&gt;david&amp;#64;wolever.net&lt;/a&gt;.&lt;/p&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>The evils of `except:`</title>
      <link>http://blog.codekills.net/2011/09/29/the-evils-of--except--</link>
      <pubDate>Thu, 29 Sep 2011 15:34:24 EDT</pubDate>
      <category>Python</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/09/29/the-evils-of--except--</guid>
      <description>The evils of `except:`</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;I had some discussion recently about the evils of using a naked &lt;tt class=&#34;docutils literal&#34;&gt;except:&lt;/tt&gt;.
Here is a more complete description of the dangers, and of the correct
solutions.&lt;/p&gt;
&lt;p&gt;In short, &lt;tt class=&#34;docutils literal&#34;&gt;except:&lt;/tt&gt; is bad because hides the source source of the exception
and frustrates debugging.  For example, consider this code:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
try:
    parsed = parse(file_name)
except:
    raise ParseError(&amp;quot;can&#39;t parse file&amp;quot;)
&lt;/pre&gt;
&lt;p&gt;It will likely produce an error something like this:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
$ ./my_program.py
Traceback (most recent call last):
    ...
ParseError: can&#39;t parse file
&lt;/pre&gt;
&lt;p&gt;This kind of error makes me want to high-five someone. In the face. With a
chair.&lt;/p&gt;
&lt;p&gt;Notice that it does not contain &lt;em&gt;any&lt;/em&gt; information about:&lt;/p&gt;
&lt;ul class=&#34;simple&#34;&gt;
&lt;li&gt;The file which caused the error&lt;/li&gt;
&lt;li&gt;The line which caused the error&lt;/li&gt;
&lt;li&gt;The nature of the error (is it an expected error? A bug? Who knows!)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;And tracking down the source of this error would likely involve some binary
searching on the input file or dropping into a debugger.&lt;/p&gt;
&lt;p&gt;These are some other, equally unhelpful, bits of code that I have seen:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
# There isn&#39;t much worse than completely hiding the error
except:
    pass

# Almost as bad is not giving any hit at what it was
except:
    print &amp;quot;there was an error!&amp;quot;

# And even showing the original error can be unhelpful if the error is
# something like an IndexError which could come from anywhere
except Exception, e:
    raise MyException(&amp;quot;there was an error: %r&amp;quot; %(e, ))
&lt;/pre&gt;
&lt;p&gt;Now, there &lt;em&gt;is&lt;/em&gt; a situations where using a naked &lt;tt class=&#34;docutils literal&#34;&gt;except:&lt;/tt&gt; can be used
safely. Exactly one.&lt;/p&gt;
&lt;div class=&#34;section&#34; id=&#34;the-except-block-is-terminated-with-a-raise&#34;&gt;
&lt;h1&gt;1. The &lt;tt class=&#34;docutils literal&#34;&gt;except:&lt;/tt&gt; block is terminated with a &lt;tt class=&#34;docutils literal&#34;&gt;raise&lt;/tt&gt;&lt;/h1&gt;
&lt;p&gt;For example, when some cleanup needs to be done before leaving the function:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
cxn = open_connection()
try:
    use_connection(cxn)
except:
    close_connection(cxn)
    raise
&lt;/pre&gt;
&lt;p&gt;(note that, usually, the &lt;tt class=&#34;docutils literal&#34;&gt;finally:&lt;/tt&gt; block should be used for this kind of
cleanup, but there are some situations where the code above makes more sense)&lt;/p&gt;
&lt;p&gt;Every other situation should use &lt;tt class=&#34;docutils literal&#34;&gt;except Exception, e:&lt;/tt&gt;:&lt;/p&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;a-new-exception-is-raised-but-the-original-stack-trace-is-used&#34;&gt;
&lt;h1&gt;2. A new exception is raised but the original stack trace is used&lt;/h1&gt;
&lt;p&gt;For example:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
try:
    parsed = parse(file_name)
except Exception, e:
    raise ParseError(&amp;quot;error parsing %r: %r&amp;quot; %(file_name, e)), None, sys.exc_info()[2]
&lt;/pre&gt;
&lt;p&gt;A few things to note: first, the &lt;a class=&#34;reference external&#34; href=&#34;http://docs.python.org/reference/simple_stmts.html#grammar-token-raise_stmt&#34;&gt;three expression&lt;/a&gt;
version of &lt;tt class=&#34;docutils literal&#34;&gt;raise&lt;/tt&gt; is used, the third of which being the current stack trace.
This means that the stack trace will point to the &lt;em&gt;original source&lt;/em&gt; of the
error:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
File &amp;quot;my_program.py&amp;quot;, line 9, in &amp;lt;module&amp;gt;
  parse(file_name)
File &amp;quot;parser.py&amp;quot;, line 2, in parse
  for lineno, line in enumerate(open(file_name), &amp;quot;rb&amp;quot;):
ParseError: error parsing &#39;input.bin&#39;: TypeError(&amp;quot;&#39;str&#39; object cannot be interpreted as an index&amp;quot;,)
&lt;/pre&gt;
&lt;p&gt;Instead of the (less helpful) line which re-raised the error:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
File &amp;quot;my_program.py&amp;quot;, line 11, in &amp;lt;module&amp;gt;
  raise ParseError(&amp;quot;error parsing %r: %r&amp;quot; %(file_name, e))
ParseError: error parsing &#39;input.bin&#39;: TypeError(&amp;quot;&#39;str&#39; object cannot be interpreted as an index&amp;quot;,)
&lt;/pre&gt;
&lt;p&gt;Second, the error includes the file name and original exception, which will
make debugging significantly easier. When I&#39;m writing particularly fragile code
I&#39;ll often wrap the entire block in a try/except which will include as much
state as is sensible in the error. For example, the main loop of the &lt;tt class=&#34;docutils literal&#34;&gt;parse&lt;/tt&gt;
function might be:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
def parse(file_name):
    lineno = -1
    current_foo = None
    try:
        f = open(file_name)
        for lineno, line in enumerate(f):
            current_foo = line.split()[0]
            ...
    except Exception, e:
        raise ParseError(&amp;quot;error while parsing %r (line %r; current_foo: %r): %r&amp;quot;
                         %(file_name, lineno, current_foo, e)), None, sys.exc_info()[2]
&lt;/pre&gt;
&lt;/div&gt;
&lt;div class=&#34;section&#34; id=&#34;the-exception-and-stack-trace-are-logged&#34;&gt;
&lt;h1&gt;3. The exception and stack trace are logged&lt;/h1&gt;
&lt;p&gt;For example, the main runloop of an application might be:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
while 1:
    try:
        do_stuff()
    except Exception, e:
        log.exception(&amp;quot;error in mainloop&amp;quot;)
        time.sleep(1)
&lt;/pre&gt;
&lt;p&gt;A few things to note: first, a naked &lt;tt class=&#34;docutils literal&#34;&gt;except:&lt;/tt&gt; should &lt;em&gt;not&lt;/em&gt; be used here, as
it will also catch &lt;tt class=&#34;docutils literal&#34;&gt;KeyboardInterrupt&lt;/tt&gt; and &lt;tt class=&#34;docutils literal&#34;&gt;SystemExit&lt;/tt&gt; exceptions, which
is almost certainly a bad thing.&lt;/p&gt;
&lt;p&gt;Second, &lt;tt class=&#34;docutils literal&#34;&gt;log.exception&lt;/tt&gt; is used, which includes a complete stack trace in the
log (care should also be taken to make sure that these logs will be checked -
for example by sending an email on exception logs).&lt;/p&gt;
&lt;p&gt;Third, the &lt;tt class=&#34;docutils literal&#34;&gt;time.sleep(1)&lt;/tt&gt; ensures that the system won&#39;t get clobbered if the
&lt;tt class=&#34;docutils literal&#34;&gt;do_stuff()&lt;/tt&gt; function immediately raises an exception.&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
</content:encoded>
    </item>
    <item>
      <title>Checking types in Python</title>
      <link>http://blog.codekills.net/2011/09/26/checking-types-in-python</link>
      <pubDate>Mon, 26 Sep 2011 13:53:08 EDT</pubDate>
      <category>Python</category>
      <guid isPermaLink="true">http://blog.codekills.net/2011/09/26/checking-types-in-python</guid>
      <description>Checking types in Python</description>
      <content:encoded>&lt;div class=&#34;document&#34;&gt;
&lt;p&gt;A friend asked me recently when it&#39;s acceptable to check types in Python. Here
is my reply:&lt;/p&gt;
&lt;p&gt;It is almost never a good idea to check that function arguments are exactly the
type you expect. For example, these two functions are very, very bad:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
def add(a, b):
    if not isinstance(a, int):
        raise ValueError(&amp;quot;a is not an int&amp;quot;)
    if not isinstance(b, int):
        raise ValueError(&amp;quot;b is not an int&amp;quot;)
    return a + b

def sum(xs):
    if not isinstance(xs, list):
        raise ValueError(&amp;quot;xs is not a list&amp;quot;)
    base = 0
    for x in xs:
        base += x
    return base
&lt;/pre&gt;
&lt;p&gt;There&#39;s no reason to impose those restrictions, and it makes life difficult if,
for example, you want to add floats or sum an iterator:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
&amp;gt;&amp;gt;&amp;gt; add(1.2, 3)
...
ValueError(&amp;quot;a is not an int&amp;quot;)
&amp;gt;&amp;gt;&amp;gt; sum(person.age for person in people)
...
ValueError(&amp;quot;xs is not a list&amp;quot;)
&lt;/pre&gt;
&lt;p&gt;Type checking to correctly handle different kinds of input is occasionally
acceptable, but should be used carefully (ex, to do optimizations, or
situations where method overloading would be used in other languages). For
example, these functions could be ok:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
def contains_all(haystack, needles):
    if not isinstance(haystack, (set, dict)):
        haystack = set(haystack)
    return all(needle in haystack for needle in needles)

def ping_ip(addr):
    if isinstance(addr, numbers.Number):
        addr = numeric_ip_to_string(addr)
    # ping &#39;addr&#39; which should be a string in &amp;quot;1.2.3.4&amp;quot; form
    ...
&lt;/pre&gt;
&lt;p&gt;But it&#39;s almost always better to check for &lt;em&gt;capabilities&lt;/em&gt; instead of checking for
types. For example, if you want to make sure that &lt;tt class=&#34;docutils literal&#34;&gt;add&lt;/tt&gt; throws an error on
invalid input, this would be a better way:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
def add(a, b):
    if not (hasattr(a, &amp;quot;__add__&amp;quot;) or hasattr(b, &amp;quot;__radd__&amp;quot;)):
        raise ValueError(&amp;quot;can&#39;t add a to b&amp;quot;))
    return a + b
&lt;/pre&gt;
&lt;p&gt;This would be equivalent to excepting an interface instead of an implementation
in a statically typed language:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
// This is equivilent to ``isinstance(xs, list)`` -- usually bad
public static int sum(ArrayList xs) {
    ...
}

// This is equivilent to ``hasattr(xs, &amp;quot;__iter__&amp;quot;)`` -- almost always better
public static int sum(Collection xs) {
    ...
}
&lt;/pre&gt;
&lt;p&gt;Or better yet, Just Do It and wrap any exceptions which pop up:&lt;/p&gt;
&lt;pre class=&#34;literal-block&#34;&gt;
def add(a, b):
    try:
        return a + b
    except Exception, e:
        raise ValueError(&amp;quot;cannot add %r and %r: %r&amp;quot; %(a, b, e)), None, sys.exc_info()[2]
&lt;/pre&gt;
&lt;p&gt;In general, though, &lt;em&gt;code should assume that function arguments will behave
correctly&lt;/em&gt;, then let the caller use your documentation and Python&#39;s helpful
stack traces and debugging facilities to figure out what they did wrong.&lt;/p&gt;
&lt;/div&gt;
</content:encoded>
    </item>
  </channel>
</rss>

