<?xml version='1.0' encoding='UTF-8' ?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title>Things Of Interest</title>
		<link>http://qntm.org/</link>
		<atom:link href="http://qntm.org/rss.php?blog" rel="self" type="application/rss+xml" />
		<description>the personal website of Sam Hughes</description>
		<item>
			<guid>http://qntm.org/streetmentioner</guid>
			<title>Time travel grammar</title>
			<link>http://qntm.org/streetmentioner</link>
			<description><![CDATA[<b><a href="http://qntm.org/streetmentioner">Blog</a> »</b> 
	"Dude, are you hungry? I haven't eaten since later this afternoon."


It is often held that time travel is difficult to talk about because of shortfalls in the English language. In his science fiction book The Restaurant At The End Of The Universe, Douglas Adams introduces a fictional author "Dr. Dan Streetmentioner" whose own Time-Traveller's Handbook Of 1001 Tense Formations explains at great and convoluted length how to describe events in your past but another person's future, events averted through time travel, events which you are, while speaking, travelling through time to avoid, and many more. This involves the introduction of many new verb tenses and convoluted verb conjugation rules for these tenses.
In fact, existing grammatical rules are already perfectly well-suited to talking about time travel. All we need to do is obey some conventions.

Part one: fixed history
There are multiple distinct models of time travel which a universe may obey. In the simplest model, ti...]]></description>
			<pubDate>Mon, 26 Mar 2012 13:20:13 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/hypertime</guid>
			<title>Hypertime: an excessively convoluted time travel framework</title>
			<link>http://qntm.org/hypertime</link>
			<description><![CDATA[<b><a href="http://qntm.org/hypertime">Blog</a> »</b> While trying to figure out the plot for Ra, I came up with a brand new model of time travel which I decided to call "hypertime" because it featured a second dimension of time. (This "hypertime" has no relation to the concept from DC comics.) However, I found this model of time travel so insanely complicated that I couldn't even reason logically about what would happen if the universe were to behave in such a way... let alone convey such a cosmic structure to readers in the form of a compelling story.

So I abandoned the concept and I'm now exploring a new idea. However, I don't see any reason to just bury this idea for eternity, so here it is. Make of it what you will. I suggest you draw diagrams, it'll highlight how complicated this thing is.

*

There are parallel universes.

Each universe is offset in time from the next, but each universe is exactly identical to the others. In our universe, it is currently 2011. In the universe "above" ours, however, it is 2012, and 2011 has...]]></description>
			<pubDate>Tue, 04 Oct 2011 22:50:57 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/chess</guid>
			<title>Chess: THE MOVIE</title>
			<link>http://qntm.org/chess</link>
			<description><![CDATA[<b><a href="http://qntm.org/chess">Blog</a> »</b> They've already made Clue (Cluedo). They've filmed Battleship and they're going to release that too. There's going to be a Monopoly movie. Somebody, somewhere, has the rights to Candyland. And, arguably, there are also Twister and Downfall. Okay, not really. But we were sitting around a hypothetical table in an internet chat room figuring out what other board games you could turn into profitable film franchises.
Bruce Willis is played out; but ten years ago, he could easily have carried "Jenga" - obviously a disaster movie set in a high-rise building. "Hippos: The Hunger", a variation on "Anaconda". "Mousetrap", a remake of Mousehunt with more elaborate Rube Goldberg machines? Experimental science fiction slasher/horror "Rubik's Cube"? "Connect Four", followed by its sequel, "Connect Four II: Connect Five"?
And then somebody threw this down on the table. I was blown away by the elegance of this concept. It's the E=mc2 of board game flicks. You don't even have to buy the rights. It's ...]]></description>
			<pubDate>Mon, 12 Sep 2011 23:28:34 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/timeline</guid>
			<title>Futurama timeline</title>
			<link>http://qntm.org/timeline</link>
			<description><![CDATA[<b><a href="http://qntm.org/timeline">Blog</a> »</b> Now accurate up to the end of production season 6.

Notes

 The Futurama universe is assumed to be exactly identical to ours except where the show explicitly diverges from reality.
 Several episodes' dates are formed based on projections which may prove unreliable. For example, "Put Your Head On My Shoulder" can be firmly dated to 14th February only if Valentine's Day doesn't get moved over the next thousand years, and "That's Lobstertainment!" features the 1074th Academy Awards, which places it in 3002 only if no Oscar ceremonies are cancelled.
 Except where stated (and where direct contradictions arise), it is assumed that production order of episodes is the same as chronological order.
 The events of the episodes "The Why Of Fry", "Bender's Big Score" and "All The Presidents' Heads" resulted in changes to the Futurama timeline. This timeline deals solely with the final timeline to date. There are other timelines in which events played out differently, which no longer apply to...]]></description>
			<pubDate>Sun, 11 Sep 2011 18:37:42 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/test</guid>
			<title>Thing I Have Learned About Software Testing</title>
			<link>http://qntm.org/test</link>
			<description><![CDATA[<b><a href="http://qntm.org/test">Blog</a> »</b> Firstly, it's a thing. I didn't even realise this at first.
I was bred on a diet of console videogames and I knew in my soul that playing games was the best thing ever. Being paid to play games was obviously even better than the best thing ever. Being a professional videogame tester was, logically, the greatest profession possible. You get to play great games before anybody else, right? And you get paid for it! There was no lightning flash when I realised that being a professional videogame tester means playing great games before they are actually great (before, in fact, they can even be described as "games", or "playable"). It was just a realisation that I eventually came around to. If you need a lightning bolt, Here's Your Reality Program. Videogame testing is tiresome and unfun. Any videogame becomes tiresome and unfun to test, after ten months.
Later, when I started coding as a hobby, my typical development process was to write some code, run the program and see if it failed in t...]]></description>
			<pubDate>Mon, 29 Aug 2011 19:50:39 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/twit</guid>
			<title>When is a URL shortener not a URL shortener?</title>
			<link>http://qntm.org/twit</link>
			<description><![CDATA[<b><a href="http://qntm.org/twit">Blog</a> »</b> The URL http://qntm.org contains 15 characters. Twitter's naïve URL "shortener" helpfully shortens this to 20 characters, leaving me with 120 remaining when I should have 125:

If I type a full 140-character string, Twitter reports that I am 5 characters over budget and refuses to let me tweet:

When is a URL shortener not a URL shortener? When it fails to ensure that the new URL is shorter than the original.
I'm a professional software tester, you know. We catch this kind of thing.
*
This was the case as of 2011-08-16, and I only saw it in the main web interface, not when you (for example) click the "tweet this" button at the bottom of this page. Once it's fixed (I'll let them know about it tomorrow and I expect it'll be rectified in a day or two) I'll update this page, but until that time, try it for yourself....]]></description>
			<pubDate>Tue, 16 Aug 2011 00:59:12 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/crystal2</guid>
			<title>Crystal Maze Pub Crawl attempt #1</title>
			<link>http://qntm.org/crystal2</link>
			<description><![CDATA[<b><a href="http://qntm.org/crystal2">Blog</a> »</b> Yesterday (Saturday 13th August 2011) we made our first attempt/reconnaissance run of the Crystal Maze Pub Crawl.
There were a few question marks still remaining. For example, my route map doesn't contain any Mental, Mystery, Physical or Skill challenges. In my head, I had one Physical challenge worked out - "down your drink" and one Skill challenge worked out - "flip N beer mats where N is the number of people on the crawl".
The night before the crawl, friend H and I sat down in the Railway Tavern on Tulse Hill (which is a great pub, though sadly a long way off the route) to bash out some additional challenges. Here's the full list we worked out.
Challenges

SKILL: Buy a bar snack, ideally peanuts. You must catch, in your mouth, one peanut thrown by each member of the team (including yourself).
PHYSICAL: You may not touch the ground between this pub and the next one. (That is, your teammates will have to carry you.)
SKILL: place a stack of N beer mats on the side of the table, ...]]></description>
			<pubDate>Sun, 14 Aug 2011 16:28:39 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/perl</guid>
			<title>Learn Perl in about 2 hours 30 minutes</title>
			<link>http://qntm.org/perl</link>
			<description><![CDATA[<b><a href="http://qntm.org/perl">Blog</a> »</b> A bunch of new people started at work and we use a lot of Perl in our department. So I put together some information about Perl and I thought it might be worth sharing so here it is.

 Perl in about 2 hours 30 minutes

This was originally dispensed in the form of a presentation and about a dozen Perl scripts and half a dozen modules, which I've consolidated into one fairly readable file. If you find something that has been omitted from the file, this is probably either because it isn't used very frequently in my department, because it's trivial to look up, or because it just wouldn't fit due to time constraints.
It turns out that two and a half hours is barely enough to rattle through the essentials of Perl. The biggest example of this is use, a critical core feature which requires knowledge of packages, modules (which are different from packages), BEGIN blocks and class methods (i.e. object-oriented Perl) in order to fully explain....]]></description>
			<pubDate>Sat, 30 Jul 2011 22:42:50 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/cmd</guid>
			<title>Escaping strings for use at any command line</title>
			<link>http://qntm.org/cmd</link>
			<description><![CDATA[<b><a href="http://qntm.org/cmd">Blog</a> »</b> Okay, I have finally sussed this problem on both Windows and Linux.
The following code is written in Perl but it can be quite easily adapted to work for pretty much any programming language.

Procedure for escaping an arbitrary argument for use at a command line

sub escape_arg {
	my $arg = shift;

	# Windows cmd.exe:
	if($^O eq "MSWin32") {

		# Sequence of backslashes followed by a double quote:
		# double up all the backslashes and escape the double quote
		$arg =~ s/(\\*)"/$1$1\\"/g;
		
		# Sequence of backslashes followed by the end of the string
		# (which will become a double quote later):
		# double up all the backslashes
		$arg =~ s/(\\*)$/$1$1/;

		# All other backslashes occur literally

		# Quote the whole thing:
		$arg = "\"".$arg."\"";

		# Escape shell metacharacters:
		$arg =~ s/([()%!^"&lt;&gt;&amp;|;, ])/\^$1/g;
	}

	# Unix shells:
	else {
		# Backslash-escape any hairy characters:
		$arg =~ s/([^a-zA-Z0-9_])/\\$1/g;
	}

	return $arg...]]></description>
			<pubDate>Fri, 15 Jul 2011 19:46:34 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/bulbs</guid>
			<title>The Bulb Dropping Problem</title>
			<link>http://qntm.org/bulbs</link>
			<description><![CDATA[<b><a href="http://qntm.org/bulbs">Blog</a> »</b> The problem
You have a 100-storey building and 2 identical, supposedly-unbreakable light bulbs.
You know for a fact that if you drop a bulb at floor 0 (i.e. ground level), the bulb will not break. You also know for a fact that if you drop a bulb at floor 101 (i.e. go to the roof and throw it off), the bulb will definitely break. In fact, there is some floor f with 0 ≤ f ≤ 100 such that if you drop a bulb at floor f or lower it will not break, and if you drop it at floor f+1 or higher, it will definitely break.
You have only 2 light bulbs. Once they are both broken, there are no more. Assume that dropping a bulb multiple times does not weaken it. How many bulb drops must be performed to find f, in the worst-case scenario?
Hint: the answer is below 20.

Suppose we had just 1 bulb
Consider a simpler scenario in which we have only 1 light bulb. In this case the solution is obvious.
We cannot drop bulb 1 at, say, the 50th floor. If it breaks, then we have learned that f is betwe...]]></description>
			<pubDate>Tue, 12 Jul 2011 22:29:54 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/combinators</guid>
			<title>Parser combinators explained</title>
			<link>http://qntm.org/combinators</link>
			<description><![CDATA[<b><a href="http://qntm.org/combinators">Blog</a> »</b> A parser is a function which takes a string (a series of tokens) as input, and returns a set of matches as output. In the most basic form, each match is simply an index, an integer marking a position further on in the string, but it could also be something more complicated, like a full parse tree.
A combinator is a higher-order function (a "functional") which takes zero or more functions (each of the same type) as input and returns a new function of the same type as output.
A parser combinator is a higher-order function which takes parsers as input and returns a new parser as output.

Simple example parsers
Suppose we had an extremely simple parser called A, designed to recognise the single character a. See what happens when we provide A with various strings as input:


	
		A(&epsilon;) = {}
		A(a) = {1}
		A(ab) = {1}
		A(acegi) = {1}
		A(aaaa) = {1}
		A(xa) = {}
	


(We assume that the indices of characters in the string begin at 0. For example, the string xyz has 3 ...]]></description>
			<pubDate>Tue, 28 Jun 2011 22:24:46 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/top</guid>
			<title>The difference between top-down parsing and bottom-up parsing</title>
			<link>http://qntm.org/top</link>
			<description><![CDATA[<b><a href="http://qntm.org/top">Blog</a> »</b> Given a formal grammar and a string produced by that grammar, parsing is figuring out the production process for that string.
In the case of the context-free grammars, the production process takes the form of a parse tree. Before we begin, we always know two things about the parse tree: the root node, which is the initial symbol from which the string was originally derived, and the leaf nodes, which are all the characters of the string in order. What we don't know is the layout of nodes and branches between them.

For example, if the string is acddf, we know this much already:


    S
   /|\

   ???

| | | | |
a c d d f


Example grammar for use in this article


  S &rarr; xyz | aBC
  B &rarr; c | cd
  C &rarr; eg | df


Bottom-up parsing

This approach is not unlike solving a jigsaw puzzle. We start at the bottom of the parse tree with individual characters. We then use the rules to connect the characters together into larger tokens as we go. At the end of th...]]></description>
			<pubDate>Mon, 27 Jun 2011 17:13:06 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/bash</guid>
			<title>SOLVED: Escaping strings in Bash</title>
			<link>http://qntm.org/bash</link>
			<description><![CDATA[<b><a href="http://qntm.org/bash">Blog</a> »</b> Update, 2011-06-13:

I raised a question on Stack Overflow, How can I escape an arbitrary string for use as a command line argument in Bash?. Several people contributed incomplete or incorrect answers but eventually I figured out the following.
To escape a string for use as a command line argument in Bash, simply put a backslash in front of every non-alphanumeric character. Do not wrap the string in single quotes or double quotes. Escape everything that is non-alphanumeric, including spaces, exclamation marks, dollar signs, ampersands, angle brackets, double quotes and single quotes.

In Perl, the code looks like this:

my @args = (
    # a list of arbitrary strings...
);

$cmd = join " ", map { escape($_); } @args;

sub escape {
    my $arg = shift;
    $arg =~ s/([^a-zA-Z0-9])/\\$1/g;
    return $arg;
}


In fact, you can leave some characters unescaped safely, such as underscores. But there seems to be no complete list of "dangerous" characters in Bash, and you c...]]></description>
			<pubDate>Mon, 13 Jun 2011 10:38:31 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/urls</guid>
			<title>On short URLs</title>
			<link>http://qntm.org/urls</link>
			<description><![CDATA[<b><a href="http://qntm.org/urls">Blog</a> »</b> Let me tell you about my URL schema.
The more alert of my readers might have noticed that qntm.org has very short URLs. http://qntm.org/destroy, for example, is a much shorter URL than, to pluck an example out of clear air, http://uk.kotaku.com/5800473/portal-2s-erik-wolpaw-lecture-now-online-for-your-viewing-pleasure. You will also notice that unlike the URLs which fall out of a typical URL shortening service, qntm.org URLs are at least a little bit descriptive. This is one hundred percent deliberate.

Why
Extremely short URLs have several distinct advantages over verbose, highly expository URLs.

 They're memorable. I don't know about my readers, but I know for a fact that "How To Destroy The Earth" is located at http://qntm.org/destroy. If I want to see that page, I can just type that into my address bar. I don't have to load up my own index page and browse the site until I find HTDTE manually and I don't have to do a Google search, not even a site-specific Google search. Anyb...]]></description>
			<pubDate>Tue, 10 May 2011 23:01:45 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/stags2</guid>
			<title>Further staggery</title>
			<link>http://qntm.org/stags2</link>
			<description><![CDATA[<b><a href="http://qntm.org/stags2">Blog</a> »</b> Well this has been a lengthy Bank Holiday Weekend and no mistake. Thursday 28th April: Witney for my sister's husband's birthday and to collect some Easter beer gifts (Wychwood, naturally). We played Pass The Parcel - the parcel soon bifurcated into two parcels which travelled in opposite directions, which I maintain should have happened multiple times, like Asteroids. There was Portal 2 on the giant projector, some tree-climbing and Rock Band. Apparently playing a musical instrument requires coordination. Amazing.
My sister and her husband were hosting a - I'll be honest - impractical number of people in their house. I ended up wedged down the side of some bed somewhere. I then spent the following day reading a little bit more of their copy of I Shall Wear Midnight which unexpectedly features the return of Eskarina Smith, last seen about 25 years ago in Equal Rites. Don't spoil the end, I'm not going to get there until I visit them at least a few more times.
After that and for the n...]]></description>
			<pubDate>Mon, 02 May 2011 23:53:34 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/stags</guid>
			<title>Stags</title>
			<link>http://qntm.org/stags</link>
			<description><![CDATA[<b><a href="http://qntm.org/stags">Blog</a> »</b> You see, stag dos (doos? does?) aren't my thing because honestly I would just rather sit in the pub and have some good pints, but my mon Ching is getting married (as are several of my other university contemporaries, but he is first), so we were invited up to Bristol for miscellaneous events and entertainments. Friend Wntrmute (off of Everything2) is also in Bristol and I hadn't seen him in ages either so I decided to split the difference. I opted out of the morning's paintballing and quad biking and instead turned up in Bristol in the middle of the afternoon and Wntrmute and I went for a wander and what turned into a very lengthy chin-wag.
Bristol is a very vertical city, much more so than Winchester. It has hills. It's also a reasonably nice-looking place, there's some greenery, some water, some modern architecture, some nice 19th-century stuff which reminds me very strongly of Cambridge. We traipsed up the hill to Clifton and sat at the White Lion pub which overlooks (well, underlo...]]></description>
			<pubDate>Sun, 03 Apr 2011 23:15:51 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/beers</guid>
			<title>Desert Island Beers</title>
			<link>http://qntm.org/beers</link>
			<description><![CDATA[<b><a href="http://qntm.org/beers">Blog</a> »</b> You are going to spend the rest of your life on a desert island and you may only take five different beers with you.
For the purposes of the Desert Island Discs metaphor, you may also take one luxury item (bar snack). Plus, you are by default provided with an unlimited supply of Guinness and The Complete Works of Lousy Four Percent Lager: Foster's, Carlsberg and Carling. This is the equivalent of the Bible and the complete works of Shakespeare - not because they are of equivalent importance, of course, but because P and I reckon they are quite likely to be very common, banal selections. Finally, they must be beers/ales/ciders: no gin, no tonic, no wine, because those open up entire ridiculous possibilities.
I haven't completely constructed my selections yet. P suggested this idea to me on Friday at the pub and he was thinking mainly of selecting a range of real ales that would be suitable for all weathers and seasons. Something quite light and golden for summer days, something denser...]]></description>
			<pubDate>Sun, 27 Mar 2011 02:28:04 +0100</pubDate>
		</item><item>
			<guid>http://qntm.org/graph</guid>
			<title>Charts/graphs in Perl - some cautionary notes</title>
			<link>http://qntm.org/graph</link>
			<description><![CDATA[<b><a href="http://qntm.org/graph">Blog</a> »</b> I started something that I hoped would be a very small and quick project, but it looks like it's close to impossible to draw a decent XY scatter plot in Perl. Here are two cautionary notes:
GD::Graph can't do numerical X-axes
It's right here in the documentation that data on the X-axis in any GD::Graph graph will always be evenly spaced. This is despite the facts that GD::Graph has no problem whatsoever with numerical Y-axis data, and that GD::Graph has no problem whatsoever with you submitting numerical data on the X-axis in the first place. It just casts the numerical data to a string and evenly spaces the strings.
And no, the workaround mentioned in the documentation doesn't work. That makes it impossible to do an XY scatter plot in GD::Graph. Since GD::Graph is the graphing package for Perl, this is a pretty glaring shortcoming.
Chart::Gnuplot doesn't work on Windows
Of course I downloaded gnuplot before trying this, and set up the command line so that the module would find it...]]></description>
			<pubDate>Sat, 26 Feb 2011 17:16:32 +0000</pubDate>
		</item><item>
			<guid>http://qntm.org/crystal1</guid>
			<title>Crystal Maze Pub Crawl route v1.0</title>
			<link>http://qntm.org/crystal1</link>
			<description><![CDATA[<b><a href="http://qntm.org/crystal1">Blog</a> »</b> The Crystal Maze Pub Crawl is a pub crawl in London based on the classic game show The Crystal Maze. Inspired by the format, it consists of:


	3 pubs in the Industrial Zone (Battersea)
	3 pubs in the Mediaeval Zone (City of London)
	3 pubs in the Oceanic Zone (Maritime Greenwich)
	3 pubs in the Futuristic Zone (Docklands)
	1 pub overlooking the Crystal (Millennium) Dome.


History

This crawl was designed as a lighter, more pleasant alternative to the ambitious and ill-fated Alphabet Pub Crawl. This crawl includes only 13 pubs as opposed to the 26 of the ABC or the Monopoly Pub Crawl. However, the pubs have been chosen carefully for high quality (rather than just their initial letter). The additional time will hopefully provide time for sightseeing, leisurely food-eating and photography. It also takes us through some nice areas of London.

Pub recommendations came from friends, CAMRA's Good Beer Guide 2010 and the AA Pub Guide 2011. The map includes many pubs considered ...]]></description>
			<pubDate>Wed, 23 Feb 2011 20:52:44 +0000</pubDate>
		</item><item>
			<guid>http://qntm.org/human</guid>
			<title>Human-powered spaceflight</title>
			<link>http://qntm.org/human</link>
			<description><![CDATA[<b><a href="http://qntm.org/human">Blog</a> »</b> First, build 100km-tall tower. 100 kilometres is the official threshold of space and that's going to be our baseline.

(Of course, no tower can be just 100 kilometres tall. A real space elevator would have to go all the way to geostationary orbit, which is 38,000 kilometres up, and further beyond, so that it would stay upright due to tension in the structure rather than compression. But whatever.)

Next, connect a pedal-powered elevator car to your tower, climb in at the bottom and begin pedalling. Gears and chains convert your exerted kinetic energy into gravitational potential energy and then into height.

The amount of gravitational potential energy a person of mass m has while standing at ground level on Earth, which itself has mass M and radius R, is -GMm/R joules, or -GM/R = -62.5 MJ/kg.

Meanwhile, the amount of potential energy that same person has while stationary 100km up in the air (let r = 100km), would be -GMm/(R + r) joules, or -GM/(R + r) = -61.5 MJ/kg.

The po...]]></description>
			<pubDate>Mon, 17 Jan 2011 22:26:18 +0000</pubDate>
		</item> 
	</channel>
</rss>
