<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>This is the personal blog of the San-Francisco-based Londoner, geek and beer enthusiast commonly known as Sam Stokes.

I plan to write mostly about software development, programming languages, technology and startups.  Beer, music, London and San Francisco might occasionally feature.

I’m making email a better place with Rapportive.

I tweet.</description><title>Coding with Honour</title><generator>Tumblr (3.0; @samstokes)</generator><link>http://blog.samstokes.co.uk/</link><item><title>Early afternoon serendipity: rainbow uplighting.</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_lalb5wfGag1qarkt9o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Early afternoon serendipity: rainbow uplighting.&lt;/p&gt;</description><link>http://blog.samstokes.co.uk/post/1358591858</link><guid>http://blog.samstokes.co.uk/post/1358591858</guid><pubDate>Wed, 20 Oct 2010 06:08:19 -0700</pubDate><category>serendipity</category></item><item><title>Inception isn't science fiction (spoilers!)</title><description>&lt;p&gt;This is an insightful analysis of &lt;em&gt;Inception&lt;/em&gt;, but I think it doesn&amp;#8217;t go far enough:&lt;/p&gt;

&lt;p&gt;&lt;a href="http://halphillips.tumblr.com/post/822919795/inception" class="tumblr_blog"&gt;halphillips&lt;/a&gt;:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;i&gt;Inception&lt;/i&gt; is one of those movies people theorize about, so here’s my take.  I have not read about it or looked it up except to check the characters’ names, so this is based solely on what I got from watching it.  Needless to say, tremendous spoilers follow for those who have not seen it.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://halphillips.tumblr.com/post/822919795/inception"&gt;Read More&lt;/a&gt;&lt;/p&gt;&lt;/blockquote&gt;



&lt;h1&gt;Spoilers below&lt;/h1&gt;

&lt;p&gt;&lt;img src="http://farm4.static.flickr.com/3424/3380212745_b7d0270bbd_b.jpg" alt="OMFG huge spoilers" title="OMFG huge spoilers"/&gt;&lt;/p&gt;

&lt;p&gt;Hal&amp;#8217;s interpretation of &lt;em&gt;Inception&lt;/em&gt;&amp;#8217;s ambiguous ending is that the whole film is Cobb&amp;#8217;s dream, and that the titular &amp;#8220;inception&amp;#8221; is convincing Cobb that he has to move past his guilt (&amp;#8220;Non, je ne regrette rien&amp;#8221;).  He suggests that in the true reality, which we never see in the film, Ariadne attempts to perform this inception on Cobb, with presumably therapeutic motivations.  I think if you take this interpretation a little further, you get a much more satisfying answer.&lt;/p&gt;

&lt;p&gt;The whole premise of the film is a technology which allows a sleeping person to enter another&amp;#8217;s dream and interact with them. The dream-sharing technology is given a hasty introduction halfway through the film (&amp;#8220;the military developed it for combat training&amp;#8221;) and never explained.  There&amp;#8217;s nothing wrong with that - plenty of science fiction movies depend on some hokey tech to make their cool settings or plotlines possible - but to me it does stick out as an oddity.&lt;/p&gt;

&lt;p&gt;All the other fantastic elements of &lt;em&gt;Inception&lt;/em&gt; - zero-gee fistfights, tops that spin forever, bending Paris in on itself - take place in dreams, so we don&amp;#8217;t think to question them.  Like science fiction films, dreams often take place in the context of some absurd premise which you accept as perfectly natural and obvious.  You&amp;#8217;ve got to get somewhere, but you&amp;#8217;re on the wrong train, and you&amp;#8217;re going to be late - only when you wake up do you realise you don&amp;#8217;t even remember where you needed to go.  Or you can fly and shoot lasers from your hands, and of course you can, because how else could you save the world from the evil killer wasps?  Fantasy in dreams is normal, familiar and obvious during the dream, and fantastic only when you wake up.  But &lt;em&gt;Inception&lt;/em&gt; asks us to suspend disbelief that dream-sharing is possible.&lt;/p&gt;

&lt;p&gt;Wait a second&amp;#8230;&lt;/p&gt;

&lt;p&gt;If the whole film is Cobb&amp;#8217;s dream, then the one piece of science fiction, the nebulous dream-sharing technology, on which the whole plot depends but is never properly explained&amp;#8230; is just part of the dream!&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Inception&lt;/em&gt; isn&amp;#8217;t a science fiction adventure where people can invade each other&amp;#8217;s dreams and plant secrets in their minds.  It&amp;#8217;s a chronicle of &lt;em&gt;Cobb&amp;#8217;s dream&lt;/em&gt;, which &lt;em&gt;is&lt;/em&gt; a science fiction adventure.  Dream-sharing, extractors, architects, the sinister corporation chasing him - they don&amp;#8217;t have to actually exist, because they&amp;#8217;re all figments of Cobb&amp;#8217;s imagination!&lt;/p&gt;

&lt;p&gt;So, my own interpretation of &lt;em&gt;Inception&lt;/em&gt;: Cobb&amp;#8217;s flashbacks of his kids and of his wife&amp;#8217;s life and death are idealised glimpses of the &lt;em&gt;real&lt;/em&gt; real world, which we don&amp;#8217;t otherwise see in the film.  He has very real issues to deal with.  He&amp;#8217;s also apparently been watching &lt;em&gt;The Matrix&lt;/em&gt; a lot, because when he dreams, his subconscious chooses to frame his issues in an epic struggle against faceless oppression with reality-bending special effects.  Sure, it&amp;#8217;s elaborate and intricate even by dream standards, but Cobb&amp;#8217;s &lt;em&gt;really&lt;/em&gt; messed up.&lt;/p&gt;

&lt;p&gt;The &amp;#8220;inception team&amp;#8221; - Ariadne, Arthur, Saito and the rest - are simply projections of Cobb&amp;#8217;s subconscious; their purpose is to force him to confront those aspects of his memories and emotions he can&amp;#8217;t face up to while awake.  His revelation in the cottage on top of the skyscraper is real: that clinging to his guilt is what is keeping him from his children.  That&amp;#8217;s the climax of the movie because that&amp;#8217;s where his subconscious was trying to get him all along.  Cobb is performing inception &lt;em&gt;on himself&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;If you&amp;#8217;re not yet convinced that all the characters are simply created by Cobb&amp;#8217;s unconscious mind, look at Ariadne - named for the woman who gave Theseus the tools he needed to slay the dreaded Minotaur, and then escape from the Labyrinth that is its lair.  The first thing Cobb asks of her is to &lt;em&gt;design&lt;/em&gt; a maze which he can&amp;#8217;t find his way out of: he must surround his guilt - the Minotaur - in a Labyrinth before he can slay it.  She leads him to the confrontation, gives him the strength to win, then shows him the way back out.&lt;/p&gt;

&lt;p&gt;This interpretation feels pretty satisfying to me.  It doesn&amp;#8217;t seem to have any holes.  Anything is possible in a dream, and indeed noticing strange inconsistencies and inaccuracies after you &amp;#8220;wake up&amp;#8221; (leave the cinema) is a familiar feeling.  And the way the film both refers to and represents itself is a hallmark of Nolan&amp;#8217;s films: see for example &lt;em&gt;The Prestige&lt;/em&gt;, which illustrates the mystery and allure of stage magic by performing an elaborate feat of misdirection on the viewer, who - Nolan asserts - &amp;#8220;wants to be fooled&amp;#8221;.  Dreams are so powerful because we fool ourselves.&lt;/p&gt;

&lt;p&gt;Tell me why I&amp;#8217;m wrong in the comments.&lt;/p&gt;

&lt;hr&gt;&lt;p&gt;Spoiler photo credit: &lt;a href="http://www.flickr.com/photos/charlo_be/3380212745/"&gt;charlo.be on Flickr&lt;/a&gt;&lt;/p&gt;</description><link>http://blog.samstokes.co.uk/post/890499536</link><guid>http://blog.samstokes.co.uk/post/890499536</guid><pubDate>Sun, 01 Aug 2010 16:25:00 -0700</pubDate><category>movies</category><category>science-fiction</category><category>dreams</category></item><item><title>Vim wizardry #1</title><description>&lt;p&gt;(I wrote this as a &lt;a href="http://news.ycombinator.com/item?id=1485009"&gt;response&lt;/a&gt; to an Ask Hacker News &lt;a href="http://news.ycombinator.com/item?id=1484061"&gt;post about learning Vim&lt;/a&gt;, but I thought it deserved a life of its own.)&lt;/p&gt;

&lt;p&gt;This is one of my favourite Vim features.  Say you have the following code:&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;do_something_with(some + long * complicated * expression)
                           ^
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Say your cursor is where the caret indicates.  Typing &lt;code&gt;ci)&lt;/code&gt; (&amp;#8220;change inside parens&amp;#8221;) in normal mode will:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;delete all the text between the two matching parens&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;place you in insert mode with the cursor between the two (now adjacent) parens&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;put the deleted text in the yank buffer so that &lt;code&gt;p&lt;/code&gt; will paste it.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The use case here is obviously so you can assign a name to that long complicated expression.  &lt;code&gt;ci)&lt;/code&gt; is much easier than selecting it with the mouse, and keeps your hands on the keyboard where they belong ;)&lt;/p&gt;

&lt;p&gt;With nested parentheses, it does what you expect (affects the text contained by the innermost matching pair to contain your cursor - try it and see).&lt;/p&gt;

&lt;p&gt;Other equally useful variants:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;i"&lt;/code&gt; - &amp;#8220;inside double quotes&amp;#8221; - everything between double quotes&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;i'&lt;/code&gt; - &amp;#8220;inside single quotes&amp;#8221;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;iw&lt;/code&gt; - &amp;#8220;inside word&amp;#8221; - the word the cursor is on&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;is&lt;/code&gt; - &amp;#8220;inside sentence&amp;#8221; - great for editing prose&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;ip&lt;/code&gt; - &amp;#8220;inside paragraph&amp;#8221;&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;There are also similar motions beginning with &amp;#8220;a&amp;#8221;:&lt;/p&gt;

&lt;ul&gt;&lt;li&gt;&lt;p&gt;&lt;code&gt;a)&lt;/code&gt; - like &lt;code&gt;i)&lt;/code&gt; but includes the parens (e.g. &lt;code&gt;da)&lt;/code&gt; deletes everything inside parens and the parens themselves)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;a"&lt;/code&gt; - similarly&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;code&gt;aw&lt;/code&gt; - like &lt;code&gt;iw&lt;/code&gt; but includes trailing whitespace.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;For another great taste that goes great with this, see the &lt;a href="http://www.vim.org/scripts/script.php?script_id=1697"&gt;surround.vim&lt;/a&gt; plugin.  To whet your appetite: six keystrokes to wrap your current selection in &amp;lt;div&amp;gt; tags; four to change a string from &amp;#8220;double-quoted&amp;#8221; to &amp;#8216;single-quoted&amp;#8217;.&lt;/p&gt;</description><link>http://blog.samstokes.co.uk/post/767636740</link><guid>http://blog.samstokes.co.uk/post/767636740</guid><pubDate>Sat, 03 Jul 2010 20:24:00 -0700</pubDate><category>vim</category><category>programming</category><category>tips</category></item><item><title>Please demand debate on the Digital Economy Bill</title><description>&lt;!--
vim:ft=mkd
--&gt;

&lt;p&gt;Don&amp;#8217;t let the Government rush draconian internet laws through Parliament before the election: &lt;a href="http://www.38degrees.org.uk/page/speakout/extremeinternetl"&gt;write to your MP&lt;/a&gt;!  I did.&lt;/p&gt;

&lt;p&gt;(&lt;a href="http://blog.samstokes.co.uk/post/247434685/on-three-strikes-email-to-my-mp"&gt;Others&lt;/a&gt; in this &lt;a href="http://blog.samstokes.co.uk/post/263522599/why-the-digital-economy-bill-is-flawed"&gt;series&lt;/a&gt;.)&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Dear Meg Hillier,&lt;/p&gt;
  
  &lt;p&gt;Thank you for your thoughtful response of 17 December regarding the Digital
  Economy Bill.  I appreciate your taking my concerns on board, and indicating
  that you shared some of them.&lt;/p&gt;
  
  &lt;p&gt;I&amp;#8217;m writing today to ask you to demand a full Commons debate on this highly
  controversial Bill, and not to support Government plans to rush it into law
  before the election.&lt;/p&gt;
  
  &lt;p&gt;In our previous correspondence, I told you about my concerns about the measures
  in the Bill to tackle illegal file-sharing: that besides their intended effect
  of incentivising creation, these measures would&lt;/p&gt;
  
  &lt;ol&gt;&lt;li&gt;&lt;p&gt;stifle the UK&amp;#8217;s digital businesses (including my own software consulting
  business, and the businesses of my clients) by creating a restrictive and
  uncertain legal environment;&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;damage British social justice, by exacting disproportionate penalties on a
  potentially huge number of citizens (and voters), without a required standard
  of evidence or right to redress for false accusation (points with which you
  indicated you shared my concern), and without a court trial or presumption of
  innocence; and&lt;/p&gt;&lt;/li&gt;
  &lt;li&gt;&lt;p&gt;harm British democracy, by building in &amp;#8220;reserve powers&amp;#8221; for unelected
  officials to change copyright law without Parliamentary scrutiny, and by
  allowing massive and largely evidence-free lobbying from special interest
  groups to unduly influence the legislation.&lt;/p&gt;&lt;/li&gt;
  &lt;/ol&gt;&lt;p&gt;Especially in light of point 3 above, I have been extremely concerned to read
  in the press that the Government is likely to force the Bill into law before
  the upcoming election.  It is disturbing that the Government would deny MPs the
  chance to fully consider the implications.  It is downright scary that crucial
  details of the most controversial proposals might be worked out behind closed
  doors in the &amp;#8220;wash-up&amp;#8221;.&lt;/p&gt;
  
  &lt;p&gt;As a constituent, I am writing to you today to ask you to do all you can
  to ensure the Government doesn&amp;#8217;t just rush the bill through and deny us our
  democratic right to scrutiny and debate.&lt;/p&gt;
  
  &lt;p&gt;There is no evidence that the need is so pressing as to justify passing bad
  laws.  The content industry lobbyists asking for this hasty lawmaking claim
  that they urgently need the measures in the Bill to keep their industry alive.
  This is an extraordinary claim in light of recent news that, in the midst of a
  recession, &lt;a href="http://news.bbc.co.uk/1/hi/business/8567099.stm" title="Online music royalties up by 73% in 2009, according to PRS for Music"&gt;online music revenues &lt;em&gt;grew&lt;/em&gt; by 73%&lt;/a&gt;!  The sky is clearly not
  falling.&lt;/p&gt;
  
  &lt;p&gt;The concerns raised by myself and many others are still largely unaddressed,
  despite the large number of amendments proposed during the debate in the Lords
  (itself evidence of the importance and contentious nature of this Bill).  The
  proposed legislation will still fail to support authors of copyrighted works,
  and it will still do great harm to Britain&amp;#8217;s digital economy.&lt;/p&gt;
  
  &lt;p&gt;I apologise for extending this already long letter, but I would like to close
  by quoting from a &lt;a href="http://www.labourlist.org/digital-bill-a-wise-move-lisa-ansell" title='"The Digital Economy Bill: A wise move?"'&gt;post written today on the LabourList blog&lt;/a&gt;:&lt;/p&gt;
  
  &lt;blockquote&gt;
    &lt;p&gt;The bill which is supposed to provide the structure for Britain’s digital
    future, is currently being opposed by the internet service provders who are
    central to that future – not because they are worried about their profits,
    but because they don&amp;#8217;t want to police their customers in this way, especially
    not on the basis of an assumption that has not been proved. Consumers are
    worried that this clause could have serious effects on their lives. Consumers
    vote.&lt;/p&gt;
    
    &lt;p&gt;Is this clause so important that it is necessary to push it through at any
    cost? Is it really wise to have this bill become an easily recalled symbol of
    Labour&amp;#8217;s record on civil liberties, and a &amp;#8216;sidestepping&amp;#8217; of democratic
    process?  This close to this election?&lt;/p&gt;
  &lt;/blockquote&gt;
  
  &lt;p&gt;Once again, please demand a full democratic debate on the Digital Economy Bill.&lt;/p&gt;
  
  &lt;p&gt;Yours sincerely,&lt;/p&gt;
  
  &lt;p&gt;Sam Stokes&lt;/p&gt;
&lt;/blockquote&gt;</description><link>http://blog.samstokes.co.uk/post/463663523</link><guid>http://blog.samstokes.co.uk/post/463663523</guid><pubDate>Sun, 21 Mar 2010 11:03:00 -0700</pubDate><category>digital rights</category><category>politics</category></item><item><title>The genesis of a building.  Witnessing this is pretty cool from...</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_kxy4r9nBk11qarkt9o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;The genesis of a building.  Witnessing this is pretty cool from a “making things” point of view.  Shame it’s happening right outside our flat.&lt;/p&gt;</description><link>http://blog.samstokes.co.uk/post/393068588</link><guid>http://blog.samstokes.co.uk/post/393068588</guid><pubDate>Tue, 16 Feb 2010 10:01:57 -0800</pubDate><category>london</category><category>hackney</category><category>making</category></item><item><title>Limerick Lisp-style</title><description>&lt;p&gt;In honour of the &lt;a href="http://skillsmatter.com/event/cloud-grid/functional-programming-exchange-2009"&gt;Functional Programming eXchange&lt;/a&gt;, on a bus to which I am writing this.&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;/code&gt;&lt;/p&gt;

&lt;pre&gt;
 (a (program (writtenp :in 'lisp))
     (may 'be (and (simple) (elegant) (crisp)))
     (but (cry '(C pros) "too *fancy();"
             "for (i; simply(); &amp;amp;cant++ + ++see)"
             "{ the code; for (;;) { the parenthesis; } }")))
&lt;/pre&gt;</description><link>http://blog.samstokes.co.uk/post/272996560</link><guid>http://blog.samstokes.co.uk/post/272996560</guid><pubDate>Mon, 07 Dec 2009 01:18:00 -0800</pubDate><category>humour</category><category>snippets</category><category>programming languages</category></item><item><title>My first Manhattan</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_ku5iahSPmB1qarkt9o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;My first Manhattan&lt;/p&gt;</description><link>http://blog.samstokes.co.uk/post/269546347</link><guid>http://blog.samstokes.co.uk/post/269546347</guid><pubDate>Fri, 04 Dec 2009 15:23:00 -0800</pubDate><category>drinks</category></item><item><title>Made enchiladas.</title><description>&lt;img src="http://24.media.tumblr.com/tumblr_ku1zhvrOHh1qarkt9o1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Made enchiladas.&lt;/p&gt;</description><link>http://blog.samstokes.co.uk/post/266994355</link><guid>http://blog.samstokes.co.uk/post/266994355</guid><pubDate>Wed, 02 Dec 2009 17:44:00 -0800</pubDate><category>food</category><category>cooking</category></item><item><title>Why the Digital Economy Bill is flawed</title><description>&lt;p&gt;&lt;!--
vim:ft=mkd
--&gt;
My MP, &lt;a href="http://www.theyworkforyou.com/mp/meg_hillier/hackney_south_and_shoreditch"&gt;Meg Hillier&lt;/a&gt;, was kind enough to respond by post to my &lt;a href="http://blog.samstokes.co.uk/post/247434685/on-three-strikes-email-to-my-mp"&gt;email&lt;/a&gt; about the proposed &amp;#8220;three strikes&amp;#8221; legislation in the UK.  The main content of her response was to forward me a letter she received from &lt;a href="http://www.theyworkforyou.com/mp/stephen_timms/east_ham"&gt;Stephen Timms&lt;/a&gt;, the Minister for Digital Britain (his actual job title, I&amp;#8217;m not making this up), to &amp;#8220;clarify the Government&amp;#8217;s position on this issue&amp;#8221;.&lt;/p&gt;

&lt;p&gt;The forwarded letter mostly just rattled off the party line - illegal file sharing is illegal, artists need to be compensated, the usual unjustified claims of urgency - but it did mention the recent report by the &lt;a href="http://www.ipo.gov.uk"&gt;UK Intellectual Property Office&lt;/a&gt;, awkwardly entitled &lt;a href="http://www.ipo.gov.uk/pro-types/pro-copy/c-policy/c-strategy.htm" title='"© The Way Ahead" - UK Intellectual Property Office, 28th October 2009'&gt;© The Way Ahead&lt;/a&gt;, which is actually pretty encouraging reading: I will discuss it in a separate post soon.&lt;/p&gt;

&lt;p&gt;My &lt;a href="http://blog.samstokes.co.uk/post/247434685/on-three-strikes-email-to-my-mp"&gt;previous email&lt;/a&gt; focused on problems with the &amp;#8220;three strikes&amp;#8221; approach.  Since the Digital Economy Bill was published we&amp;#8217;ve discovered that &amp;#8220;three strikes&amp;#8221; is only one of &lt;a href="http://blogscript.blogspot.com/2009/11/mandy-and-me-some-thoughts-on-digital.html" title="Lilian Edwards discusses in more detail the problems with the Bill"&gt;several nasty tricks up Mandy&amp;#8217;s sleeve&lt;/a&gt;.  Therefore, and because I felt from her letter that Ms Hillier hadn&amp;#8217;t really taken my concerns on board, I wrote back.&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Update 2009/12/02&lt;/em&gt; - since the Digital Economy Bill is currently being debated in the House of Lords, I also sent an edited version of this email yesterday to &lt;a href="http://www.theyworkforyou.com/search/?s=digital+economy&amp;amp;pid=13517&amp;amp;wtt=2"&gt;Lord Clement-Jones&lt;/a&gt;, who is taking part in this afternoon&amp;#8217;s Second Reading debate.&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;Dear Ms Hillier,&lt;/p&gt;
  
  &lt;p&gt;Thank you very much for your swift response to my email of 17th November.  Thank you also for forwarding a copy of Stephen Timms&amp;#8217; letter outlining the Government&amp;#8217;s position, reasoning and intentions regarding illegal filesharing.  I am grateful to him for drawing my attention to the UK Intellectual Property Office&amp;#8217;s report &lt;a href="http://www.ipo.gov.uk/pro-types/pro-copy/c-policy/c-strategy.htm" title='"© The Way Ahead" - UK Intellectual Property Office, 28th October 2009'&gt;© The Way Ahead&lt;/a&gt;, which I have read with interest.&lt;/p&gt;
  
  &lt;p&gt;Unfortunately, Mr Timms&amp;#8217; letter does not reassure me.  On the contrary, it reinforces my perception that the policies set out in the Government&amp;#8217;s Digital Economy Bill were drafted in haste, based on the shrill lobbying of special interests rather than empirical evidence and objective reasoning.&lt;/p&gt;
  
  &lt;p&gt;I do not believe the available evidence justifies imposing technical sanctions on internet users without trial in court, as the Government proposals would allow.  The UKIPO report, published only a month ago, finds that &lt;a href="http://www.ipo.gov.uk/pro-types/pro-copy/c-policy/c-strategy.htm" title="UKIPO report, page 16, paragraph 19"&gt;&amp;#8220;a lack of strong evidence across the world makes it difficult to establish the case for changes to aspects of copyright law and practice&amp;#8221;&lt;/a&gt;.  &lt;a href="http://papers.ssrn.com/sol3/papers.cfm?abstract_id=1227762" title='"The Economics of Copyright Law: A Stocktake of the Literature" - Towse, Handke &amp;amp; Stepan, August 2008'&gt;Meta-analyses of the economic literature&lt;/a&gt; have similarly observed a poor quality of available evidence and a lack of consensus.&lt;/p&gt;
  
  &lt;p&gt;Mr Timms&amp;#8217; letter does not even include the word &amp;#8220;evidence&amp;#8221;; I note with concern that this omission seems to be typical of Government communications on this topic.&lt;/p&gt;
  
  &lt;p&gt;This is not the only thing wrong with the Digital Economy Bill.  I wrote my previous email before the Bill was published.  Since then I have read with alarm section 17, which grants the Secretary of State power to amend by statutory instrument the Copyright, Designs and Patents Act of 1988 &amp;#8220;if it appears to the Secretary of State appropriate to do so&amp;#8221;.  To grant such broad powers to an unelected official is incredible, undemocratic and indefensible.&lt;/p&gt;
  
  &lt;p&gt;I acknowledge the problem this &amp;#8220;power to amend&amp;#8221; is designed to tackle: technology changes too quickly for primary legislation to keep up.  However, the case has not been made that this justifies circumventing the democratic process, especially in such an important and controversial area as copyright law.  To me it rather suggests, &lt;a href="http://www.ipo.gov.uk/pro-types/pro-copy/c-policy/c-strategy.htm" title='UKIPO report, page 47, paragraph 6: "[the Government] wishes copyright to develop in a technologically-neutral way"'&gt;to paraphrase the UKIPO report&lt;/a&gt;, that Parliament should amend copyright law to be more technologically neutral.&lt;/p&gt;
  
  &lt;p&gt;Therefore I once again urge you to reject the Digital Economy Bill unless it is substantially amended, including the removal of section 17, and the addition of a guarantee of trial in court before technical limitations can be imposed on internet users.  I would also appreciate it if you could pass on my concerns to the Minister responsible for the Bill, for example by forwarding him this email.&lt;/p&gt;
  
  &lt;p&gt;I am sure that, as a Government minister, you will be under considerable party pressure to support this Bill, and that I am unlikely to convince you.  However, I must reiterate that I will not vote for any MP or party who does support it, nor will many of my personal and professional acquaintances.&lt;/p&gt;
  
  &lt;p&gt;Finally, I would like to inform you that I am publishing my emails to you on &lt;a href="http://blog.samstokes.co.uk"&gt;my blog&lt;/a&gt;, where my &lt;a href="http://blog.samstokes.co.uk/post/247434685/on-three-strikes-email-to-my-mp"&gt;previous email&lt;/a&gt; has been read by over 70 people at time of writing.  With your permission, I would like to include your responses in these blog posts.&lt;/p&gt;
  
  &lt;p&gt;Thank you again for reading this email.&lt;/p&gt;
  
  &lt;p&gt;Yours sincerely,&lt;/p&gt;
  
  &lt;p&gt;Sam Stokes&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;Update 2009/12/14: response&lt;/h2&gt;

&lt;p&gt;Meg Hillier sent a brief reply to this email, stating that she supports the Digital Economy Bill because &amp;#8220;filesharing has a big impact on people&amp;#8217;s livelihoods&amp;#8221;.  This is a disappointing response, as it basically ignores the content of this second email.  I will continue the correspondence, but as this blog is already more politics-heavy than I intended, I will stop publishing my emails unless there is a noteworthy development.&lt;/p&gt;</description><link>http://blog.samstokes.co.uk/post/263522599</link><guid>http://blog.samstokes.co.uk/post/263522599</guid><pubDate>Mon, 30 Nov 2009 06:38:00 -0800</pubDate><category>copyright</category><category>politics</category><category>digital rights</category></item><item><title>Regex style in Ruby</title><description>&lt;!--
vim:ft=mkd
--&gt;

&lt;p&gt;Reading Patrick McKenzie&amp;#8217;s excellent &lt;a href="http://www.kalzumeus.com/2009/11/17/practical-metaprogramming-with-ruby-storing-preferences/"&gt;practical example of metaprogramming&lt;/a&gt;, I came across a line of code I didn&amp;#8217;t understand:&lt;/p&gt;

&lt;noscript&gt;
&lt;code&gt;
&lt;pre&gt;
caller[0][/`([^']*)'/, 1]
&lt;/pre&gt;
&lt;/code&gt;
&lt;/noscript&gt;

&lt;script src="http://gist.github.com/239767.js?file=regex-snippet.rb"&gt;&lt;/script&gt;&lt;p&gt;That line taught me three new things about Ruby:&lt;/p&gt;

&lt;ol&gt;&lt;li&gt;The syntax for the subscript operator &lt;code&gt;[]&lt;/code&gt; allows multiple arguments.  (It turns out I already knew this in another context: &lt;code&gt;[1,1,2,3,5,7][2,3] =&amp;gt; [2,3,5]&lt;/code&gt;)&lt;/li&gt;
&lt;li&gt;You can subscript a String with a Regexp, returning the first match: &lt;code&gt;"goal"[/[aeiou]/] =&amp;gt; "o"&lt;/code&gt; (&lt;code&gt;nil&lt;/code&gt; is returned if there is no match).&lt;/li&gt;
&lt;li&gt;If you throw in an index &lt;code&gt;n&lt;/code&gt;, then you get the &lt;code&gt;n&lt;/code&gt;th capturing group of the first match: &lt;code&gt;"xaabb"[/(.)\1/, 1] =&amp;gt; "a"&lt;/code&gt; (or &lt;code&gt;nil&lt;/code&gt; again if no match).&lt;/li&gt;
&lt;/ol&gt;&lt;p&gt;That last one is interesting, because it means there&amp;#8217;s a concise way I didn&amp;#8217;t previously know about to achieve a common regex task: checking if an input string matches a given format, and if so, extracting part of the format.  Say we want to pull out the domain from an email address, but complain if we can&amp;#8217;t find it:&lt;/p&gt;

&lt;noscript&gt;
&lt;code&gt;
&lt;pre&gt;
"foo@example.com"[/@(.*)/, 1] or raise "bad email"
# =&amp;gt; "example.com"
&lt;/pre&gt;
&lt;/code&gt;
&lt;/noscript&gt;

&lt;script src="http://gist.github.com/237534.js?file=regex-groups-subscript.rb"&gt;&lt;/script&gt;&lt;p&gt;Before learning this trick I would have either used a temporary match object &lt;a href="http://java.sun.com/javase/6/docs/api/java/util/regex/Pattern.html"&gt;&lt;em&gt;a la&lt;/em&gt; Java&lt;/a&gt;, or gritted my teeth and used a global variable Perl-style:&lt;/p&gt;

&lt;noscript&gt;
&lt;code&gt;
&lt;pre&gt;
match = /@(.*)/.match("foo@example.com")
if match
  match[1]
else
  raise "bad email"
end
# =&amp;gt; "example.com"
&lt;/pre&gt;
&lt;/code&gt;
&lt;/noscript&gt;

&lt;script src="http://gist.github.com/237534.js?file=regex-groups-matchobject.rb"&gt;&lt;/script&gt;&lt;noscript&gt;
&lt;code&gt;
&lt;pre&gt;
if "foo@example.com" =~ /@(.*)/
  $1
else
  raise "bad email"
end
# =&amp;gt; "example.com"
&lt;/pre&gt;
&lt;/code&gt;
&lt;/noscript&gt;

&lt;script src="http://gist.github.com/237534.js?file=regex-groups-global.rb"&gt;&lt;/script&gt;&lt;p&gt;Both of those seem rather verbose.  They can be &lt;a href="http://www.flickr.com/photos/trojanguy/3575375564/"&gt;golfed&lt;/a&gt; into one-liners, but the readability starts to suffer:&lt;/p&gt;

&lt;noscript&gt;
&lt;code&gt;
&lt;pre&gt;
$1 if "foo@example.com" =~ /@(.*)/ or raise "bad email" # =&amp;gt; "example.com"
 
require 'andand'
/@(.*)/.match("foo@example.com").andand[1] # =&amp;gt; "example.com"
&lt;/pre&gt;
&lt;/code&gt;
&lt;/noscript&gt;

&lt;script src="http://gist.github.com/237534.js?file=regex-groups-moreoneliners.rb"&gt;&lt;/script&gt;&lt;p&gt;So I&amp;#8217;m left wondering what&amp;#8217;s the most readable and/or idiomatic style for regexes in Ruby.  TMTOWTDI indeed!  Even now I know what it means, &lt;code&gt;"xaabb"[/(.)\1/,1]&lt;/code&gt; makes me double-take slightly - it&amp;#8217;s an unusual way to use &lt;code&gt;[]&lt;/code&gt; - but I guess it&amp;#8217;s just another Ruby idiosyncracy I&amp;#8217;ll come to know and love.&lt;/p&gt;</description><link>http://blog.samstokes.co.uk/post/251167556</link><guid>http://blog.samstokes.co.uk/post/251167556</guid><pubDate>Fri, 20 Nov 2009 14:03:00 -0800</pubDate><category>ruby</category><category>regex</category><category>programming</category><category>snippets</category></item><item><title>On "three strikes": email to my MP</title><description>&lt;!--
vim:ft=mkd
--&gt;

&lt;p&gt;An email I wrote to &lt;a href="http://www.theyworkforyou.com/mp/meg_hillier/hackney_south_and_shoreditch"&gt;my MP&lt;/a&gt; (using the very handy &lt;a href="http://www.writetothem.com/"&gt;WriteToThem&lt;/a&gt;) regarding the UK Government&amp;#8217;s so-called &amp;#8220;three strikes&amp;#8221; proposals to combat illegal filesharing.&lt;/p&gt;



&lt;blockquote&gt;&#13;
&lt;p&gt;Dear Ms Hillier,&lt;/p&gt;&#13;
&lt;p&gt;I am writing to ask you to vote against the Government&amp;#8217;s forthcoming Digital Economy Bill, unless the currently proposed measures to impair or disconnect without trial the internet connections of those accused of illegal filesharing are removed from said Bill.&lt;/p&gt;&#13;
&lt;p&gt;Copyright holders are already entitled to initiate private lawsuits against those they believe to be infringing their rights.  This of course involves a trial in court, with the accused party presumed innocent until proven guilty.  &lt;a target="_blank" href="http://dmca.cs.washington.edu/"&gt;Methods of detecting infringement are known to be unreliable, leading to false accusations&lt;/a&gt;, but currently this is the accuser&amp;#8217;s problem.&lt;/p&gt;&#13;
&lt;p&gt;The Government&amp;#8217;s plans would remove the inconvenient (to the rights holder) need for a court case to punish the accused.  The unreliability of detection would become an issue for every internet user, since these plans do not require proof of infringement, only repeated accusation.&lt;/p&gt;&#13;
&lt;p&gt;This circumvention of justice is justified only by evidence produced by the rights holders themselves.  It ignores evidence that &lt;a target="_blank" href="http://labs.timesonline.co.uk/blog/2009/11/12/do-music-artists-do-better-in-a-world-with-illegal-file-sharing/"&gt;the music industry has actually grown over the last five years&lt;/a&gt;, and that &lt;a target="_blank" href="http://www.independent.co.uk/news/uk/crime/illegal-downloaders-spend-the-most-on-music-says-poll-1812776.html"&gt;filesharing may be an opportunity for the content industries rather than a threat&lt;/a&gt;.&lt;/p&gt;&#13;
&lt;p&gt;I am also very concerned about the precedent that would be set by these proposals.  Music and film are not the only industries whose business models have been shaken by the emergence of new technology.  The news industry, for example, is considering charging for its previously free online content.  Without question people will find ways to circumvent these &amp;#8220;paywalls&amp;#8221; and access the content for free.  Will we then allow news publishers to join in selecting people for disconnection?  I myself, as an independent software developer, am a creator of copyrighted works.  Can I disconnect people I believe have used my work without permission?  If not, why can the BPI do it but not me?&lt;/p&gt;&#13;
&lt;p&gt;I believe the Government&amp;#8217;s plans to be short-sighted in conception, wrong in principle, and likely in practice to do more harm than good.  I will vote against any politician who supports them.&lt;/p&gt;&#13;
&lt;p&gt;I also ask you to sign &lt;a target="_blank" href="http://edmi.parliament.uk/EDMi/EDMDetails.aspx?EDMID=39226"&gt;Early Day Motion 1997&lt;/a&gt;, which echoes many of these sentiments.&lt;/p&gt;&#13;
&lt;p&gt;Thank you for reading.&lt;/p&gt;&#13;
&lt;p&gt;Yours sincerely,&lt;/p&gt;&#13;
&lt;p&gt;Sam Stokes&lt;/p&gt;&#13;
&lt;/blockquote&gt;

&lt;h2&gt;Update 2009/12/02: response&lt;/h2&gt;

&lt;p&gt;Ms Hillier was kind enough to respond by post to my email.  I will not reproduce her response here, as she has not given her consent to publish it; however I have blogged about &lt;a href="http://blog.samstokes.co.uk/post/263522599/why-the-digital-economy-bill-is-flawed"&gt;the further email I sent in reply&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Since the Digital Economy Bill was &lt;a href="http://www.publications.parliament.uk/pa/ld200910/ldbills/001/10001.i-ii.html"&gt;published&lt;/a&gt; between my first email and my second, the latter &lt;a href="http://blog.samstokes.co.uk/post/263522599/why-the-digital-economy-bill-is-flawed"&gt;brings up some new points&lt;/a&gt;, in particular regarding the lack of evidence to justify these measures and the broad powers to be given to the Secretary of State.&lt;/p&gt;</description><link>http://blog.samstokes.co.uk/post/247434685</link><guid>http://blog.samstokes.co.uk/post/247434685</guid><pubDate>Tue, 17 Nov 2009 10:18:00 -0800</pubDate><category>copyright</category><category>politics</category><category>digital rights</category></item></channel></rss>

