Things Of Interest a website SCP Foundation Fiction » Hey, did you know that for the past couple of years I've been writing fiction for the SCP Foundation wiki? Here's my author page. 2019-04-11 I'm not totally sure how to go about cross-linking my SCP Foundation wiki contributions here on my own site, but the latest chapter of Five Five Five Five Five is called CASE HATE RED, so now you know. ...]]> Thu, 11 Apr 2019 01:03:43 +0100 Time travel in The Peripheral Time » Time travel in William Gibson's 2014 novel The Peripheral seems to obey a relatively straightforward forking model with a few sensible twists which facilitate the plot and bring forward some themes very familiar to those familiar with time travel stories. I'm going to avoid specifics, but read on with caution. * More than a century into the future, there is, somewhere, a server of unclear provenance, construction and purpose. Using this server, it is possible to send information back in time and interfere with the past. The first act of interference causes the timeline to fork. The present timeline where our characters dwell remains unaffected. Meanwhile, a new timeline (referred to as a "continuum" or "stub") spins off from the original at the point of the fork, and begins to chart its own history, unconstrained by anything which happened in the original timeline. As we would guess, it's likely that events in the new timeline will, for the medium-term at least, play out largely as...]]> Thu, 14 Mar 2019 02:08:37 +0000 Ra Fiction » Magic is real. Discovered in the 1970s, magic is now a bona fide field of engineering. There's magic in heavy industry and magic in your home. It's what's next after electricity. Student mage Laura Ferno has designs on the future: her mother died trying to reach space using magic, and Laura wants to succeed where she failed. But first, she has to work out what went wrong. And who her mother really was. And whether, indeed, she's dead at all... New! Ebooks! Paid You can buy Ra as an ebook from these places: Google Play (EPUB) Amazon (Kindle edition): US UK DE FR ES IT NL JP BR CA MX AU IN It should be about three dollars. Free Alternatively, try one of these free, unofficial editions created by readers: Ra (EPUB) transcribed by Bela Lubkin. Old ending only, plus appendices Ra (EPUB) transcribed by raylu. Old ending only Ra (EPUB) transcribed by Ivan Krylov. Also contains the old ending and all appendices Or just read it here for free! Read from top to bottom. Ra ...]]> Thu, 13 Dec 2018 19:16:43 +0000 SCP wiki Fiction » Hey, did you know that for the past couple of years I've been writing fiction for the SCP wiki? Here's my author page. ...]]> Fri, 23 Nov 2018 18:59:47 +0000 Thaumic Sky Ra » Previously Vivid red lasers unzip the Earth from top to bottom, slicing it along criss-crossing spiral rhumb lines. The lasers are powerful enough to be visible to the naked eye from Pluto; with good telescopy, the light show can be seen from other star systems. One beam even plays across the Moon's face, leaving an angled scar of slag which, after freezing again, will persist for the rest of its existence. The lasers represent the smaller share of the energy. Far more is spent to physically lift the jigsaw pieces of the first crust layer into the sky, hoisting significant amounts of sky with it. The planet unfurls like an onion, individual shreds of country and rainforest unfolding themselves into thinner shreds still, absorbing further sunlight and reconstituting themselves into first-stage hosting substrate. Boosted with useful pulses of momentum from the coordinating core, the shreds radiate away into free space and align themselves against the solar wind, effecting an orbital ch...]]> Sat, 01 Sep 2018 14:01:41 +0100 Based On A Twitter Thread About Worldbuilding Blog » A picture is worth a thousand words, so let's start like this: [draws a big circle] This is the fictional universe which you created. It should have solid fundamentals and internal consistency. You should be able to answer most sensible questions about it. [draws a much smaller circle inside it] Your story will only cover this bit. * By "you" I mean "me". You can write whatever, however the heck you like. But I've found this approach to work for me. Why do we worldbuild? I can think of two major answers to this question. One is consistency. In most cases it's desirable to avoid genuine contradictions wherever possible in a story. Direct contradictions (a character's eye colour changes from one chapter to the next) are relatively avoidable. What's harder to avoid are the contradictions which arise if the audience just asks "Why?" a few times. When an audience is nicely engaged with a story, some of that audience, the curious ones, will start asking follow-up questions which l...]]> Sun, 12 Aug 2018 01:12:02 +0100 Continuity Ra » Previously Anil Devi jolts awake on the floor of the locked, guarded meeting room, back at Chedbury Bridge. He awakens poorly-rested, creaky, cold and late. He checks his watch and checks his timekeeping arithmetic and discovers that nearly an hour has elapsed since the last thing he remembers; it's long past the scheduled demolition of Earth. Outside the window, the sky is clear of Dehlavi warnings and the Sun is still rising. The sunlight has just crept down far enough to reach his eye, waking him. There are blackbirds cawing. Everything is fine. He stands. Natalie is seated at the far end of the table, slumped over with her head on folded arms, snoring gently. "Nat!" Anil says. "What did you do?" He says these things very softly, so as not to wake her, hard-wired courtesy overriding the need to make sense. She doesn't stir. Anil checks the wall clock in the room; it agrees with his wristwatch to within a few seconds. T plus thirty-nine minutes and change. Natalie's Kovachev oracl...]]> Wed, 01 Aug 2018 22:54:26 +0100 Free Ra » Previously Exa Watson stands at the bay window, sipping from a glass of the finest whisky that's ever existed, watching the city of New York melt down under emergency lighting which makes it look like Hell on Earth. Every three or so seconds another whump of white light is a Wheel Group member leaving the world, being transformed into a superamplified state vector and beamed out of the Sol system towards Sirius. The energy usage is colossal; it has to be, to guarantee clear reception at the far end. The whole planet Earth is being run dry of magic to do it. There are maybe sixty Wheel members left, and they're clustered in resigned groups, mostly doing the same as Exa, sampling some final priceless vice. The atmosphere is thick and black, something beyond mere total defeat. Exa holds his glass in one hand and with the other he frets with his kara. It would have been the simplest thing in the world to lodge all of this deeply magical medical capability directly in the brain of each Whe...]]> Sun, 01 Jul 2018 12:31:58 +0100 This Can't Happen Ra » Previously Laura doesn't have time for disorientation or indecision. The universe is half black and half red, rolling around her like some demonic Macintosh mouse ball, furious wind is rising in her ears, there's an organ-rearranging urge to vomit-- all of this is irrelevant. "Tanako" got the drop on her, again. The last time, she vows. It's the end of the world. Plan A. Beat the Glass Man. She powers all the way up to her phoenix form, full aerospace mobility with a twelve-metre wingspan. Dynamic pressure hammers into her wings, slowing her corkscrew roll. Purple crosshairs flash across her HUD, highlighting the mana output from Nat, Anil and even Nick. Far below them all, Rachel Ferno is a paralysed, dying blip, and the Bridge is outputting a weird alien helix of red and blue. But all the blips are dwarfed by the tornado of leaky force shields which represents the Glass Man. Laura folds her wings around herself, aims her engines at the sky and dives. One second and she's past the ot...]]> Fri, 01 Jun 2018 21:19:33 +0100 Stomp on the mystery box Blog » First, go and watch The Force Awakens and The Last Jedi. J. J. Abrams has this storytelling device which he uses, which he calls a "mystery box". Me just telling you those two words, and then pausing for a little while as you think about all of the works of J. J. Abrams you've ever seen, might be enough for you to work out what a "mystery box" is all by yourself. The basic idea, upon which he elaborates in this TED talk, is that you, the writer of the story, construct an elaborate mystery which causes the audience to ask questions. You construct figurative or, quite commonly, real impenetrable barriers in the story — an opaque "box" — and don't show what's inside the box, and then you make it really important to know what's inside the box. A few great examples are: the locked hatch in the first season of Lost the purpose of the works of Milo Rambaldi in Alias Rey's parentage in The Force Awakens Snoke's identity and origins in The Force Awakens Having constructed this mys...]]> Tue, 19 Dec 2017 21:01:56 +0000 Efficiently encoding binary data in Tweets Code » tl;dr: if you wish to efficiently encode binary data as Tweets, don't use Base64 (210 bytes per Tweet) normally use Base2048 (385 bytes per Tweet) unless you can circumvent the client-side check, in which case use Base65536 (560 bytes per Tweet) So anyway How much binary data can you fit into the text of a Tweet? For this piece of work I'll be ignoring the prospect of using automatically-minified URLs. Let's focus on the pure, unmodified text of the Tweet. This is a Unicode string. Note that this string is subject to normalization when in transit through the guts of Twitter. This means that we can't just use any character we like for this purpose — such normalization may alter the text of the Tweet, which for our purposes constitutes data corruption. We need to stick with characters which do not change when normalized. For a longer discussion of this topic, see What makes a Unicode code point safe? Additionally, the amount of data which will fit in a Tweet depends on the ...]]> Sun, 17 Dec 2017 19:39:19 +0000 What makes a Unicode code point safe? Code » Base64 is used to encode arbitrary binary data as "plain" text using a small, extremely safe repertoire of 64 (well, 65) characters. Base64 remains highly suitable to text systems where the range of characters available is very small — i.e., anything still constrained to plain ASCII, and it makes just about the best possible use of that small range of characters. However, now that Unicode rules the world, the range of characters available to us is often significantly larger. This increases our expressive power and in many situations it increases the amount of data which can be encoded in a Unicode string. This led to the creation of: Base32768, optimised for UTF-16 (93.75% efficiency vs. 37.5% for Base64), Base65536, optimised for UTF-32 (50% efficiency vs. 18.75% for Base64) and old-school 140-character Twitter (280 bytes per Tweet vs. 105 bytes per Tweet for Base64), and Base2048 optimised for new-style 280-character Twitter (385 bytes per Tweet vs. 210 bytes per Tweet fo...]]> Wed, 08 Nov 2017 00:23:48 +0000 So You Want Continuous Time Zones Time » At present the world is partitioned into a finite number of large, discrete time zones. A time zone is an area on Earth where all of the clocks are set to the same time. An example of a time zone is America/Santiago, an area which covers continental Chile. All the clocks in this area are normally set to UTC-04:00. During local summer (~September to ~April), clocks are simultaneously set forward one hour to UTC-03:00, and continue to agree. Here, UTC (Coordinated Universal Time) is a highly accurate, uniform time standard realised using atomic clocks. In general, time zone offsets are chosen so that local time roughly agrees with solar time in that time zone. For example, when local clocks say 12:00, the Sun is at or near its zenith. With continuous time zones, local time is instead derived directly from the position of the Sun, as captured using, for example, a sundial. This is called apparent solar time. Local 12:00 is precisely when the Sun is at its zenith. Exactly when this appea...]]> Sat, 11 Mar 2017 02:43:40 +0000 Learn JavaScript promises in ~70 minutes? Code » From the continuing archives of "things which people at work were unclear on, so I put some education together to help them out", here is my guide to how promises work in JavaScript. Promise? A few things I plan to add to this essay if I get the chance: syntax highlighting for those JavaScript snippets; maybe a button you can click to try the code out; optional example snippets for each of those numerous bullet points. Putting all of this together into an explanation where it makes sense was much harder for me than just trying to understand promises in and of themselves, which was already pretty hard. This essay was intended to be brief, and to be read slowly. If you're coming in to this not understanding promises, I would love to hear whether you found this edifying and if not what you would like to have cleared up. Also let me know how long it took you to get to the end. One of these days I will move those extra "files" here into the main content management system. Bef...]]> Sat, 10 Sep 2016 00:15:40 +0100 Write Like A Programmer Blog » I program computers and I also write. There is more than one way to program, but there are a few good practices in programming which have analogous good practices in writing. Here is how you write like a programmer. The following is not necessarily advice.   First, write with purpose. Do not write just because. Don't write because you love writing, because you love reading your own writing, because you love other people reading your writing or because you love feedback. Instead, write because you have an objective. Your text is supposed to achieve something. Write because you want your writing to accomplish something, because you want your writing to have an effect on the reader. In fact, flip those two things around in the phrase, in order to make the emphasis clearer: First, develop an objective. Discover that there is a story you want to tell, a particular piece of information you need to share, an emotional instant that you want others to experience, a particular reference wor...]]> Fri, 24 Jun 2016 18:11:53 +0100 Taxonomy of teleportation models Blog » Teleportation is when a physical object travels from one place to another without passing through the intervening space. Teleportation is, at least to a first-order approximation, fictitious. However, when it does appear in fiction, it frequently has some kind of logical underpinning, and it becomes interesting to break down those various models. In fact we come up with a sort of taxonomical tree. Wormholery The subject travels through some sort of "exotic matter tunnel", "Einstein-Podolsky-Rosen bridge", "folded space" etc. etc., reaching a distant location through what essentially amounts to a shortcut. Examples: Stargate, Portal. This is not teleportation. Although it is true that the subject did not travel through most of "the intervening space", there are numerous physical routes between locations in the real universe; a wormhole in the usual sense is nothing more than regular space, highly distorted or contorted or warped or compressed to present one route which is much shorter ...]]> Thu, 23 Jun 2016 22:49:10 +0100 Emissions Test-Driven Development Code » Emissions Test-Driven Development is a software development methodology adapted specifically to the programming of internal combustion engine control units (ECUs). ETDD is a subcategory of a more general form of software development known as "Adversarial TDD", which is a kind of Test-Driven Development. In Test-Driven Development, the software development cycle begins with the creation of a test case, which naturally fails at first. Once this is done, a minimal amount of code is produced which causes the test case to pass. The process continues, tests first, code second, with the tests forming an implicit specification for the behaviour of the software. If the tests pass, then the software is considered correct. Assuming the tests fully encompass all the desired behaviour of the software, then the software is complete. (Opinions differ on whether this a universally sound approach for creating good software. But opinions also differ on whether there is such a thing as good software; on ...]]> Mon, 02 May 2016 20:22:03 +0100 Efficiently encoding binary data in Unicode Code » Something which leaps out at me when reading Wikipedia's article on binary-to-text encodings is that apparently "plain text" is synonymous with "ASCII", or more specifically ASCII minus the control characters. This is admittedly a fairly safe definition of "plain text", although there's a strong argument to be made that there is no such thing as "plain text". But there's another argument that "plain text" is Unicode strings. An increasing number of text-based systems accept Unicode. This gives us a vastly expanded character set to play with. This also changes our definition of "efficiency" — in fact it makes it a little more complicated, since there are several ways of encoding Unicode strings in turn. UTF-8-encoded Unicode strings are a superset of ASCII, and here we find that encodings staying inside ASCII are generally the most efficient, bit-for-bit. But UTF-16-encoded Unicode strings are surprisingly prevalent (Windows, Java) and here we find that constraining ourselves only...]]> Mon, 04 Apr 2016 22:29:55 +0100 Chronological cut Fine Structure extras, appendices, feedback » Fine Structure is noted for its highly nonlinear, not to say garbled, presentation. As part of work on an end-to-end rewrite of the story, I assembled a chronological listing of the chapters, which you may find makes more sense. Read from top to bottom. Unbelievable scenes On Digital Extremities Taphophobia Amber Indistinguishable from magic Paper universe Power Of Two Two killed in "transporter accident" Worth Dying For / Jim Akker The Four-Dimensional Man Failure Mode Exponents 2048 The Story So Far Sundown Fight Scene / Freak Tornado Fight Scene / Capekiller Leaving The Real World Oul's Egg / halfway homes, catacombs, twilight zones Oul's Egg / The artifact was completely impenetrable to all forms of matter except living human flesh Die least significant bits 'Verse Chorus Worth Dying For / Seph Baird Worth Dying For / Mike Murphy this was supposed to be a parable about the power of the imagination There Was No Leak The Chaotician this is not over and...]]> Thu, 17 Mar 2016 19:41:55 +0000 Gödel's incompleteness theorems Blog » For every mathematical statement S, exactly one of the following two claims is true: 1. S can be proven 2. S cannot be proven Every statement S has a negation which is also a statement: ~S So, furthermore, for every statement S exactly one of the following two claims is also true: A. ~S can be proven B. ~S cannot be proven (To put it another way, we might also say: A. S can be disproven, or B. S cannot be disproven) Putting these together, for every statement S exactly one of the following four claims is true: 1A. S can be proven and ~S can be proven 1B. S can be proven and ~S cannot be proven 2A. S cannot be proven and ~S can be proven 2B. S cannot be proven and ~S cannot be proven Case 1B uncontroversially indicates that S is "true" and case 2A uncontroversially indicates that S is "false". These cases are relatively straightforward and can be put aside. If case 1A holds, both S and ~S can be proven. Thanks to something called the principle of explosion...]]> Sun, 04 Oct 2015 18:36:26 +0100 To destroy the Earth Blog » Be privileged. Be lucky. Be rich. Be powerful. Be good-looking. Be intelligent, smart and wise, but more importantly educated-- suggested fields of undergraduate study are biology, anthropology and politics. Contrary to popular suggestions, I do not advise you to drop out. Network. Be charismatic. Meet people. Know people. Remember names. Make contacts. Act. Do favours. Be or become powerful. Have parents who can help you with all of these things, who are lucky, rich, smart and powerful themselves. Be successful, by every definition of "successful". You don't need to be self-made. You can climb there over the stabbed backs of others, it doesn't matter. Just be made. Almost all of this is dumb luck. You can read as many Successmanship books as you want and work every extra hour of every day you're given, and still not get any of the things listed in the above paragraph. Billions of people other than you already do. It's much easier to just be born on the top rung.   Be driven, ...]]> Sun, 04 Oct 2015 15:32:43 +0100 Time travel in Doctor Who Time » This essay is not going to be as long as you think. In broad terms there are two ways to approach the topic of time travel in Doctor Who. In the top-down approach, I'm going to start from a strictly external, real-world point of view, looking at how the needs of the television production shape the time science inside it. In the bottom-up approach I'll look at the "in-universe" evidence and see if it's possible to assemble that evidence into anything meaningful and/or internally consistent. Top-down Doctor Who is a television show which has existed in one form or another - with one significant gap - for more than half a century. The show has been running for so long, through the televisual equivalent of several geological epochs, that it's impossible for the show's purpose and driving forces not to have changed dramatically over time. I'm not a scholar of the early days of Doctor Who but there must have been an early period of uncertainty when nobody really knew how much potential t...]]> Fri, 17 Jul 2015 20:53:01 +0100 Obergefell v. Hodges: the database engineering perspective Code » Previously All the computer systems that exist exist to support requirements and processes arising in the real world. In particular, this includes databases intended to store personal information about human beings, such as who is married to whom, when they got married, when (if ever) they got divorced, and so on. Accurately storing this information is important because marriage often confers real-world legal privileges and obligations to the married people. It is also often important to the married people themselves that their union be public, and well-recorded, and recognised by the organisation doing the recording. The responsibility for accurately and reliably storing this information falls in part on the database administrator (DBA). Each jurisdiction in the world imposes its own constraints upon who is allowed to marry whom. These constraints can be arbitrarily wide or narrow, but nevertheless they always exist. Because computer systems are not just structureless masses of inform...]]> Sat, 27 Jun 2015 00:41:36 +0100 Time travel in About Time Time » I looked this film up on Wikipedia after it was done, and Wikipedia said it was a "romantic comedy-drama". "Comedy!" I thought. "That's what that was." This film is bad. Giving it genre labels seems too much like praise, because this film is barely anything. It angered me, and so now it must anger you. About Time is a story about a upper/middle class British family with no characteristics at all. I won't go any further in my own description of these people because the opening narration of the film itself is about as damning an indictment as it gets. These are people whose defining traits are drinking tea on the beach, and watching films together outdoors, in the rain. The most interesting person in the family is the daughter, Kit, who is perceived as outgoing and quirky due to her "purple T-shirts and bare feet". Already that's two strikes: extremely dull characters, and telling instead of showing. Character personality traits shouldn't be handed to us in narration, they should reveal ...]]> Mon, 13 Apr 2015 01:48:27 +0100 Ranking the Bond film titles Blog » Not the films. Their titles. In a world where the production process for the biggest new films is essentially live-streamed in its entirety, the title is what comes first, and comes under harsh analysis before anything else, even the earliest teasers. With this in mind, I intend to rank the Bond films' titles according to how good they are as titles of Bond films. For the purposes of this article I have tried to deliberately blot out everything I know about the content or quality of any specific James Bond film. I am considering each film by their title alone. This listing is subjective and I don't know yet what criteria I'll consider most significant. Read on to find out. The rankings "Octopussy" No better place to start than the bottom of the barrel. How does it get worse? I'm really asking. What titles were rejected in favour of this one? What's the target audience supposed to be thinking? "Well, I love octopuses, and I love juvenile, cack-handed portmanteaux! I'm in! ...]]> Sat, 11 Apr 2015 20:39:23 +0100 If Deckard's a replicant Blog » then: Whose is the unicorn dream? Deckard is an original creation. None of his memories are his own, they were given to him. Someone, some human, must have had the unicorn dream before he did, and then it was implanted in replicant Deckard. Who? * "It doesn't make any difference [...], it's completely hypothetical." If Deckard's a replicant, who knows Deckard's a replicant? Who's part of this conspiracy? Let's start with Bryant. It looks like Bryant is on some kind of established terms with Deckard. "I need you, Deck. I need the old blade runner," and dang it feels strange to write that noun phrase out in lower case. Bryant and Deckard are not on friendly terms at all, adversarial, but they clearly have some years of shared history. Could it be that all of this just a charade by Bryant? Is he acting the part of a long-term "friend"? Is he being subtle? Is it in character for this replicant-hating police captain to work cheerfully with, and provide sensitive information to, a known r...]]> Fri, 06 Mar 2015 23:57:15 +0000 Time travel in Braid Blog » I bought Braid on the promise of lavish visuals and neat puzzles with temporal mechanics, and on this basis I was rewarded. I found some frustration with the controls, which I eventually traced to dodgy keyboard drivers - the game wouldn't register the up or down arrows while I was holding Shift, making it impossible to rewind at high speed. Since I wasn't even aware that you could rewind at high speed, this made one particular puzzle impossible until I eventually caved, broke a long-standing personal rule and looked the answer up online. The game itself, though, is joyous. It's old, I guess, which means either you've played it already or you haven't and never intend to. In the event that you've never played it and can be swayed, I suggest you check it out. Well-judged puzzle difficulty, extraordinary visuals, super desktop wallpaper material, cool new gameplay mechanics, and I discovered some good new music as well. Most of the music in this game is by Jami Sieber, check her out. I a...]]> Tue, 03 Mar 2015 23:00:25 +0000 So you want to abolish time zones Blog » Laudable! Let's take a look at some of the changes that arise from this, through a simple case study: making an international phone call to a relative. Before abolishing time zones I want to call my Uncle Steve in Melbourne. What time is it there? Google tells me it is currently 4:25am there. It's probably best not to call right now. After abolishing time zones I want to call my Uncle Steve in Melbourne. What time is it there? It's 4:25am there, same as it is here, of course! Same as it is in New York, Bangalore and Hawaii, at the South Pole and on the Moon. Although... the terms "a.m." and "p.m." (ante meridian and post meridian) are strongly deprecated now, along with "noon", "midday" and "midnight", because they are now either meaningless or ambiguous. In much of the world, 12:00 is nowhere near the middle of the solar day, if it's even during the solar day. Likewise, 00:00 is nowhere near the middle of the solar night. Worse, in much of the world, there is still a "7 in the morni...]]> Fri, 16 Jan 2015 23:55:59 +0000 Time travel in Back To The Future Blog » This turned out to be a long one. Back To The Future is one of two films, along with Bill & Ted's Excellent Adventure, which forms the bedrock of what most people of my generation understand about time travel. Back To The Future is so iconic that its model of time travel forms a kind of universal canon. Even people who've not seen it seem to have picked the rules up through osmosis. And why shouldn't they? This is the gold standard of time travel stories, ranking up there with the very best of popular science fiction. This model of time travel is so widely known, in fact, that it can be safely used as the basis for many further time travel stories, with a relatively minimal amount of explanation. And it frequently is. Back To The Future's model almost seems to be the default model of time travel in most time travel fiction, and certainly there's a wide collection of stories whose models can be understood well by comparing them qualitatively with this one. How could there not be? Ho...]]> Wed, 07 Jan 2015 23:54:26 +0000 Easter is a coding horror Blog » You may be like me. Every now and then, at least once a year, when you think about Easter, you go to try and find out exactly how the date of Easter is calculated. You get as far as this Wikipedia page, you read it for a while, and then your head sort of caves in a little. In my case, I have a page called the Lent Countdown. Currently, the date of Easter is hard-coded in that small bit of JavaScript, which means it needs updating manually every year. Every year I try to write an extra small bit of JavaScript to save myself the effort and every year I give up and fix the date manually, handing the problem off to a future self who is potentially more intelligent or tenacious. Easter, it seems, is a coding horror. It may be the human race's first. Most calendar systems are of necessity pretty horrible due to the way in which the rotation of the Earth, the revolution of the Sun, the phases of the Moon and the normal progression of SI seconds all fail to synchronise with one another. The ec...]]> Sat, 03 Jan 2015 00:19:12 +0000 Time travel in Bill & Ted's Excellent Adventure Blog » "Don't worry, it'll all make sense. I'm a professional." It's about time I wrote this up. I have a lot of non-time travel-related praise for both of these films, but I'm going to try to stay on topic. Bill & Ted's Excellent Adventure is the first film in the unexpectedly successful, and still one hundred percent canonical, if sadly short-lived, American reboot of Doctor Who. It's one of two films - along with Back To The Future, obviously - which forms the bedrock of what most people of my generation understand about time travel in fiction. Excellent Adventure adopts the second-simplest model of time travel. As is well recorded, in the simplest model of time travel, time travel is completely impossible and no time travel takes place. This is the model of time travel seen in almost all works of fiction. In the second simplest model, known as "fixed history", time travel is, by whatever means, possible, but the timeline is absolutely rigid, unalterable and perfectly internally consi...]]> Sat, 20 Dec 2014 00:50:57 +0000 The Ra playlist Blog » While writing Ra I listened to the following tracks pretty much incessantly. There were more in the list but I've cut it down to about one track per artist, and also randomised it. James Shimoji - Red Line Dire Straits - Brothers In Arms Nine Inch Nails - And All That Could Have Been Mansun - Railings Idlewild - Modern Way Of Letting Go Cliff Martinez - Bride Of Deluxe CHVRCHES - Science/Vision Arkasia - She's The One Massive Noise Machine - What Army Mike Foyle - Pandora (The Blizzard remix) BANKS - Drowning (Lido Remix) Noel Gallagher's High Flying Birds - AKA... What A Life! Fleetwood Mac - The Chain Deadmau5 - Ghosts N Stuff Tool - The Grudge Hans Zimmer - Mombasa Mogwai - Auto Rock Godspeed You! Black Emperor - Dead Metheny... Jamie N Commons - The Preacher Cloudkicker - Seattle Markus Shulz - Blown Away Homeland OST - It Was Always About Him Celldweller - Birthright Homestuck - Cascade Hiroyuki Sawano - The Reluctant Heroes Steven Price - Debris Donna Burke - Sins Of The Father...]]> Sun, 14 Dec 2014 11:54:20 +0000 Destructor Ra » Previously Forty-six decillion joules is horrific overkill, commensurate with the urgency of Virtual civilisation's combined desire for more processing power. The energy packet distorts spacetime as it travels, and when the Earth's core node catches it, the planet measurably increases in mass and widens in orbit. Vivid red lasers unzip the planet from top to bottom, slicing it along criss-crossing spiral rhumb lines. The lasers are powerful enough to be visible to the naked eye from Pluto; with good telescopy, the light show can be seen from other star systems. One beam even plays across the Moon's face before the dicing procedure is over, scorching it mildly. The lasers represent the smaller share of the energy. Far more is spent to physically lift the jigsaw pieces of the first crust layer into the sky, hoisting significant amounts of sky with it. The planet unfurls like an onion over the course of an hour, individual shreds of country and rainforest unfolding themselves into thinn...]]> Sat, 13 Dec 2014 19:13:20 +0000 Perl comparison table Code » Perl has distinct operators == and eq for numerical and lexical comparisons respectively. Many comparisons raise warnings, as noted. Note: unlike PHP and JavaScript, Perl does not have booleans. When an equality test succeeds, 1 is returned; when it fails, the empty string '' is returned. Perl lacks the === "strict equality" operator. Some variables Note the differing behaviour of @arr0, %hash0 and the literal (). my @arr0 = (); my %hash0 = (); my @arr1 = ("perl"); my %hash1 = ("perl" => "equality"); Numerical equality ==undef()'''perl'0'0'(0)('0')@arr0%hash01'1'(1)('1')@arr1%hash1undeftrue**true**true**true**true*true*true*true*true*true*false*false*false*false*false*false**()true**true**true**true**true*true*true*true*true*true*false*false*false*false*false*false**''true**true**true**true**true*true*true*true*true*true*false*false*false*false*false*false**'perl'true**true**true**true**true*true*true*true*true*true*fa...]]> Sun, 07 Sep 2014 00:39:46 +0100 Why Not Just Ra » Previously Laura doesn't have time for disorientation or indecision. The universe is half black and half red, rolling around her like some demonic Macintosh mouse ball, furious wind is rising in her ears, there's an organ-rearranging urge to vomit-- all of this is irrelevant. "Tanako" got the drop on her, again. The last time, she vows. It's the end of the world. Plan A. Beat the Glass Man. She powers all the way up to her phoenix form, full aerospace mobility with a twelve-metre wingspan. Dynamic pressure hammers into her wings, slowing her corkscrew roll. Purple crosshairs flash across her HUD, highlighting the mana output from Nat, Anil and even Nick. Far below them all, Rachel Ferno is a paralysed, dying blip, and the Bridge is a weird alien helix of red and blue. But all the blips are dwarfed by the tornado of leaky force shields which represents the Glass Man. Laura folds her wings around herself, aims her engines at the sky and dives. One second and she's past the other three. ...]]> Mon, 11 Aug 2014 22:23:56 +0100 It Has To Work Ra » Previously There's an invisible penthouse in the sky over the East River in New York, New York, and more than a hundred people have just materialised there simultaneously. It's the entire Wheel. "Give me my God-damned kara back," Adam King hisses, still pinned face down by Exa, although now in golden and scarlet deep-pile carpet. "You're done, Adam," Exa declares. He jabs a particular bundle of nerves in the back of King's skull, and the man flops unconscious. They're in the ballroom, with a window showing almost all of the city skyline, which is dominated by the pattern of terrifying red high-energy magic warning signs. They're holographic, tiling the whole atmosphere of Earth, and kilometres long on each side. "What's happening to the sky?" someone asks. "Is this global? Everybody in the world can see this!" "Ra is waking," Casaccia gasps, his medring resurrecting him with all the finesse of a boot to the stomach. "This was never supposed to happen. This was supposed to be impossibl...]]> Tue, 22 Jul 2014 12:36:46 +0100 Machine Space Ra » Previously If shorn of its rock embedding and raised up to face sunlight, the listening post would be a twenty-kilometre tall Cambrian organism, a black beetle/rosebud with nested soft shells and creepy greebles. Laura's death-switch laser tripwire originates at its tail and fires almost directly upwards into the structure's internal organs. The quantity of energy released is unimaginable, enough to punch a hole through kilometres and kilometres of machine space, eventually emerging at a near-vertical angle from the listening post's limb and progressing several klicks further through solid rock, although not far enough to reach the surface. The base ring room is gone, plasmised along with Natalie and Laura Ferno and the entire nineteen-hundred-metre-wide Montauk storage ring. The Floor room, a hemispherical cavity located towards the top of the listening post, is missed entirely by the laser blast. By the time the laser shuts off, the vast majority of the released energy has been con...]]> Thu, 03 Jul 2014 12:24:35 +0100 From Death, Lead Me To Immortality Ra » Previously It's midsummer of 1993, and Rajesh Vidyasagar is eighty-and-a-half years old, and it's time. It happens almost too fast to follow. Although hardly sprightly, and still noticeably decelerating, Rajesh is coherent and inventive up until the tail end of August of that year. He attends a physics conference in California, speaks well, fields fewer questions than usual; at dinner after the lectures, he collapses. In the hospital, it's discovered that he had a heart attack. The conference has another day to go, but Rajesh exits early, flying back to Calcutta against stern medical advice. His wife Sharmila meets him at the airport. Rajesh is just climbing the steps of his home when the second attack incapacitates him. He spends his final three days at home, with Sharmila at his side, and a lamp, and a mantra to focus on. He doesn't feel the need for the mantra, because his last two decades have left his mind swimming in significant syllables. His mantra is his name, which is aum, w...]]> Sat, 07 Jun 2014 10:53:24 +0100 All Hell Ra » Previously The Floor is becoming chaotic and Anil Devi can't keep track of it all. Exa holds him under guard at the back of the main control area, the D-class magic circle at the centre rear of the gigantic hemiellipsoidal room. Exa doesn't carry any visible weapons and is actually quite a bit shorter than Anil, but his grip as he steers Anil is vicelike and his expression says, "I know how to win every fight that could ever take place; I've fought a star, and you're just a basic guy." So Anil sits where he's shown to sit and stays silent and pays attention. There are almost fifty Wheel Group members in the room now, most of them loitering around the perimeter of the D, observing the proceedings. Inside the D-class it's all business. There are seven or eight men working at arrays of screens, although Anil isn't privileged to see the screens' content; all he sees are thin red outlines to indicate where they've been placed in the room's virtual space. At the front is King, and in front ...]]> Mon, 26 May 2014 22:02:08 +0100 Akheron Ra » Previously Directly under Tanako's world's three-pointed Sun there's a hulking hemisphere bunker which grumbles electronically, like a mosquito whine slowed down ten thousand times. Its exterior is black body black. It pulls at space around it, as if it has its own gravity. Laura Ferno (LF-4) discards her final pair of spent SRBs, and once her still-unnamed orbiter runs dry she kicks away from it too, crossing the final distance on an unpowered flat trajectory. This part of T-world is daylight, pure white glass desert with light from Ra hammering down on every square centimetre from directly overhead. Laura's far too far beyond the sound barrier for there to be sound. She catches a shape out of the corner of her eye and swivels in the air to look at it. It's her shadow, streaking across the ground directly below her. As she gets closer to her destination the glass desert clears and the shadow becomes a reflection. She sees herself as a brilliant figure suspended in the sunlight, glowi...]]> Sun, 11 May 2014 19:29:08 +0100 Last Thursdayism Ra » Previously In 19390, Triton's last layers of sacrificial armour are boiling away at a rate of hundreds of metres per second. In the next few minutes, the heat will reach the computation fleck at the ship's core and start to destroy it. When that happens, no matter what else has happened, the operation will be over, and the war will be over. They have Ra's brain laid out in front of them, vivisected and still operating. The machine has been successfully attacked and subdued. In the lower three thorns, Virtual human civilisation has been frozen indefinitely. Nobody is left who could pass further judgement on them. As for the fourth thorn, it will obey one further command, ever, and Ashburne is the only person who can deliver that command. Ra will unthread her thought processes to determine what it is she's truly asking for, and deliver that result, and then permanently disable its raw public interface. But none of the crew are in a position to handle this decision rationally. None of th...]]> Sat, 26 Apr 2014 16:14:27 +0100 Why Do You Hate Ra Ra » Previously Psamathe (Neptune X): Natalie's interrogator stands with her feet shoulder-width apart and one hand resting on a device at her hip, a block full of weapon. She has almost no hair. Her irises are a piercingly bright blue, close to luminous, and hexagonal. She speaks Natalie's English like a native. Even her body language has visibly shifted into something that Natalie understands more clearly. She says, "I can't cover the whole history book for you. We don't have ten years, so I'm going to have to dramatically oversimplify. There was a schism. Humanity, effectively, forked. "On one side were the humans who believed that all humans should remain real." * They believed that humans were meant to scratch out real lives on real, rocky planets in the real, harsh universe; that the planet Earth should be kept intact and habitable and should have humans inhabiting it for as long as humanly possible; and that if the human race wanted more living space, it should build or terrafor...]]> Sat, 29 Mar 2014 22:51:45 +0000 Futurama timeline Blog » Now including all of season 7B. This may be the final significant update of the Futurama timeline. It's been an emotional day for me. 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", "All The Presidents' Heads" and "Decision 3012" resulted in changes to the Futurama timeline. This timeline deals solely with the final timeline to dat...]]> Mon, 17 Mar 2014 16:43:08 +0000 Learn regular expressions in about 55 minutes Code » This is another one from the "adapted from educational materials produced for work" department (previously). Regular expressions in about 55 minutes I know there are a quadrillion tutorials on this subject but none of them explain regular expressions in exactly the way I prefer: specifically, by stating up front that a regular expression is just a computer program (i.e. a sequence of instructions) written in a terse domain-specific programming language. I think the main area for improvement for this article is in the "further reading" section, which currently doesn't exist....]]> Sun, 09 Mar 2014 23:18:13 +0000 Everything Is Real Ra » Previously There are no half-measures in space combat. There's no sideways lurch when a lucky shot gets through. There's no "shields at sixty percent". If the concept spacecar's systems had been late to respond to the shockwaves, the passengers would have been pulped. If one millionth of the arriving energy had actually made it through the car's shields, the entire vehicle would have been atomised. And so Natalie and Anil are barely alive, but it's impossible to actually feel that way. The opening salvo of Abstract War saw the simultaneous destruction of sixty thousand Earths, but for them it was just a light show, experienced passively from the other side of a windscreen. The car never even rattled. The car is completely silent in all its operations, and its interior remains as pristine and precise as its exterior. It manoeuvres like soft cream. It's been twenty minutes since War began. They're actually behind the expanding wreckage shell now, watching Earth-8162's pieces spread away...]]> Fri, 07 Mar 2014 22:20:03 +0000 Closures explained Code » A closure is a function which has captured ("closed over") some of the local variables that were available when the function was defined. There are several similar ways to implement closures. This is best understood by example. I will use pseudocode here. Explicit capture by value In some languages, you have to explicitly state which variables you want to capture. var x = "chips" var more_spam = function () capture (x) { x = x + " and spam" print(x) } more_spam() // "chips and spam" more_spam() // "chips and spam and spam" x = "bacon" more_spam() // "chips and spam and spam and spam" Notice how a new variable x is "attached" to the function more_spam, and follows it everywhere. The value of more_spam's x is "chips" at first, but persists from call to call, for as long as more_spam also persists. Meanwhile, the original x can be reassigned freely. Explicit capture by reference var x = "chips" var more_spam = function () capture (x) { ...]]> Sat, 08 Feb 2014 15:51:09 +0000 Magic spells Blog » Magic spells This is background information about how magic spells work in Ra. This is information that I've been keeping up to date since the story began, but now it can be released publically. This article contains one serious spoiler for anybody who hasn't finished reading chapter 18, Deeper Magic, and mild spoilers beyond that point. In fact, you should probably read the whole of Ra to date before reading this. This is reference information; Ra is the real story. The language of magic The (spoken) language of magic is called "" (the empty string). Or rather, it calls itself this. This has been demonstrated experimentally: The language of magic has a pronouncable name for itself. This name contains no syllables. Like many languages, magic has an alphabet, a vocabulary, a grammar and an accent. The language is convoluted, ugly to look at and difficult to speak correctly. Like natural languages, it has very good expressive power and numerous inconsistencies/edge cas...]]> Mon, 03 Feb 2014 21:49:25 +0000 Abstract War Ra » Previously Anil's dreams are disturbingly garbled reinterpretations of the previous day. They're full of flashing red and blue lights, and huge concussive noises, and coffee and adrenaline and incoherent new revelations. He wakes up the slow way, one limb at a time, as the dreams fizzle away to be replaced with clearer memories which still seem to him to be entirely dreamlike. There was the insane (sun-worshipping?) terrorist group. There was the brilliant kaleidoscope effect inside the Sun, which the woman looking exactly like Laura Ferno thought was fantastically significant. He remembers-- Oh, hell... Ferno's dead. And so is the unknown boyfriend, Nigel something. Nick something. Anil remembers the bathtubs, full of scarlet bone sludge and black chunks of dissolving shoe leather. He remembers the sprinkled layer of driver dots and other magical equipment, warped by the acid to the colour and shape of battered fish bits. Yesterday simply would not end. He went for almost twenty...]]> Mon, 03 Feb 2014 20:32:47 +0000 The Hardest Logic Puzzle Ever Code » George Boolos' original puzzle is stated as follows: Three gods A, B, and C are called, in no particular order, True, False, and Random. True always speaks truly, False always speaks falsely, but whether Random speaks truly or falsely is a completely random matter. Your task is to determine the identities of A, B, and C by asking three yes-no questions; each question must be put to exactly one god. The gods understand English, but will answer all questions in their own language, in which the words for yes and no are da and ja, in some order. You do not know which word means which. It could be that some god gets asked more than one question (and hence that some god is not asked any question at all). What the second question is, and to which god it is put, may depend on the answer to the first question. (And of course similarly for the third question.) Whether Random speaks truly or not should be thought of as depending on the flip of a coin hidden in his brai...]]> Sun, 26 Jan 2014 00:01:00 +0000 Personas: imaginary friends for software developers Blog » In the beginning there were user stories. Well, actually in the beginning there were requirements, but that was too easy, so it came to pass that everything had to be phrased using the following snowclone: "As an X, I want to Y." where X is some kind of user and Y was something you could sell. This was easy enough to subvert: "As Dave, the IT guy, I want customers to stop yelling at me about our terrible software." But somewhere along the line, some daydreamer had a thought bubble in which the following words appeared: "What about the users of these so-called 'user stories'?" Now, instead of having a simple requirement or even a user story, you create an entire fake human being, with their own thoughts and dreams and needs. In fact, you create several such humans, and the user stories are attached to them. After you've done that, you hope that all of your requirements were attached in at least one of these fake people, otherwise it'll fall through the cracks, never to...]]> Tue, 31 Dec 2013 10:12:48 +0000 Direct Sunlight Ra » Previously "Wait," says Scin. They're hours into the investigation now. There are five mages on the Floor, burrowing separate paths into the problem. Scin has replaced Casaccia at the post of "seer of the Past", has untangled the figurative wires that Casaccia had no clue how to manage, and is pulling data out of the akashic records as fast as the others can request it. Kila Arkov, blond-ish and bearded, is shepherding the akashic records system itself-- a system occupying cubic kilometres of reality and metaphorical square light years of virtual space. Ward, "The Future", is the latest to have arrived. He constructs high-definition analyses of the future using a dizzyingly complicated framework whose operation is tantamount to... well, dark magic. Casaccia frets about global security and King tells them all what to do. The air is crowded with virtual screens. It almost wasn't worth going paperless. "Wait..." says Scin. He reaches out for the stadium-sized bank of images and bec...]]> Mon, 16 Dec 2013 22:55:58 +0000 You advocate a ________ approach to calendar reform... Blog » You advocate a ( ) lunar ( ) solar ( ) lunisolar ( ) atomic ( ) metric ( ) Luddite approach to calendar reform. Your idea will not work. Here is why: ( ) solar years are real and the calendar year needs to remain in sync with them ( ) solar days are real and the calendar day needs to remain in sync with them ( ) the solar year cannot be evenly divided into solar days ( ) the solar day cannot be evenly divided into seconds ( ) leap days suck ( ) leap seconds suck ( ) the length of the solar day is not constant ( ) inconsistent intercalation of leap seconds sucks even more ( ) leap seconds have been a fact of life for more than forty years ( ) high-tech applications need far more accuracy than your scheme allows ( ) years which count down instead of up are not very funny ( ) there needs to be a year 0 ( ) the lunar month cannot be evenly divided into solar days ( ) the solar year cannot be evenly divided into lunar months ( ) having one or two days per year w...]]> Mon, 09 Dec 2013 11:38:44 +0000 The Hunt For Red October as hard science fiction Blog » On reflection after a recent re-watch, I've decided that The Hunt For Red October has everything I look for in a hard science fiction film. A complete, functional universe with its own rules and jargon. This film mostly takes place in the north Atlantic Ocean, an extremely hostile environment where life, while practical and even routine, has to follow completely different rules from those that most of us are familiar with. Red October presents a relatively small window on this universe, or maybe a tour of its most interesting parts. The sensation, though, is that this is a place where these people have been carrying out difficult work for decades, work which is going to continue for decades after the film is over. The scenario is consistent and convincing. "There are other stories here, but today we show you this one." Everything's explained, but never dumbed down. The audience has to pay attention. I'm thinking of things like the Crazy Ivan manoeuvre, the caterpillar drive's noise...]]> Sat, 30 Nov 2013 01:01:22 +0000 From Darkness, Lead Me To Light Ra » Previously "Did you say Natalie Ferno?" Exa just took a mobile phone call while travelling through the Channel Tunnel. This is a completely normal thing that he can do. He was bound for bomb site already, but the specific task of interrogating this one woman has only just arrived. "Affirma--" "Natalie Ferno?" "Affirmative," Casaccia repeats. "Problem?" "Check your files," Exa says. "Hmm?" "We have history with that woman. Four years ago. I don't blame you for trying to forget about it. Look her up, do it now. The relevant keyword is 'fiasco'." Casaccia does so. Some seconds elapse as he reads. His eventual response is a long inhalation followed by a single, drawn-out swear word. Exa sighs. He sometimes thinks he's the only competent person in the entire organisation. * Zeck's been called Zeck for so long that it even appears on official University documentation. Sometimes people who don't know him well try to call him by his birth name, but it always comes off as slig...]]> Mon, 25 Nov 2013 19:34:12 +0000 Gravity Blog » "I hate space!" Gravity is a spectacular, awe-inspiring and thrilling film which retrospectively really ticks me off. It never ceases to astonish me how good special effects are right now. We're spoilt! Ron "Apollo 13" Howard would have killed for this technology. I saw Gravity on a screen which claimed to be IMAX (but realistically, probably wasn't quite there), and what I saw was crystal clear and so lush as to be almost edible. We are finally, finally in an era in which 2001: A Space Odyssey - the high water mark of space technology FX for what, four decades? - has been definitively surpassed. We have perfect clarity of picture in an environment entirely without atmospheric effects. More importantly, we're finally in an era which can do that environment justice. It really looks like that! We have impressively accurate reproduction of real-world space hardware from the Space Shuttle (called Explorer in the film, but for some reason still referred to as Atlantis on the soundtrack?)...]]> Mon, 18 Nov 2013 09:35:18 +0000 Inferno Ra » Previously The Wheel Group sits on limitless power and hates using it. Fudged magical teleportation - biological deconstruction/reconstruction followed by transfer-of-control - is a completely real ability that they possess, but the world is real and can be traversed physically, so why tax the system? Why risk discovery? They could blip all over the world in thousand-kilometre steps, but they don't. (And there is another reason.) The Floor is real, and can be reached simply by walking if you start on the appropriate continent and know which secret paths to follow. But this is time-consuming. Case in point - the Floor's "helm" is far enough from any of its walls that crossing the patterned floor to get there is a fifteen-minute walk. Hence the subway layer. Paulo Casaccia arrives at the miniature rail terminal in a comfortably spacious, pleasantly noiseless single-occupant pod. After he steps out, the vehicle closes its door and retreats into storage for future reference, alongside...]]> Fri, 15 Nov 2013 23:08:44 +0000 What is magic? Blog » I have a directory full of background information about the Ra universe, and I realised recently that some of this information is now wholly "declassified". That means you folks might want to see it. Here's the first one. Technically, there are no spoilers here, even if you haven't started reading Ra yet. However, this is not the preferred entry point to the story! This is reference information. What is magic? Magic is a type of energy and a set of methods for manipulating and transducing that energy into other, more useful forms. Magic energy is called mana to distinguish it from the practice of magic. Mana is moved around and spent by people, using verbal commands known as magic words or spells. Spells form a sort of API for requesting magical services. Spells are localised and for the most part take effect at the point in space where they are spoken. Simply speaking the words is not sufficient. The words serve as a mantra for the person speaking them, and it is the proce...]]> Mon, 04 Nov 2013 20:46:18 +0000 Citation found Blog » Red is the color of blood, rubies and strawberries. Yellow is the color of gold, butter, or ripe lemons. Green is the color of emeralds, jade, and growing grass. Blue is the colour of the clear sky and the deep sea. ...]]> Sun, 27 Oct 2013 15:12:47 +0000 Scrap Brain Zone Ra » Previously Don't quip until the quarry's dead. It's one of the first things Exa learned. Exa isn't short for "Alexander", or at least it wasn't originally. It's "Executor", the one who carries out instructions. If a person's existence and interference need to end, Exa's job, typically, is to bring them to that end. Quips are a distraction and a delay. They're also bad manners. If somebody's going to die, their last thought might as well not be "Dear God, that was the best you could come up with?" It's December 1969 in the replay and he's sitting down for a meal of rare, Platonically perfect steak. There is salad involved, the most divine salad which could ever exist, but an article of jewellery on his wrist chases away extraneous sodium and replaces it with effortless muscle, so the greenery is window dressing, so why bother? Others around him have opted for more elaborate preparations of dishes generally considered theoretical, and of animals and vegetables which no longer exist, b...]]> Wed, 23 Oct 2013 23:58:49 +0100 How many infinities are there? Blog » Is there more than one infinity? Yes. Are some infinities larger than others? Yes. Is there a largest infinity? No. Does that mean that there are infinitely many infinities? Yes. So... which infinity is the number of infinities? How many infinities are there? There are two types of number. There are ordinal numbers and there are cardinal numbers. The finite ordinals and the finite cardinals are exactly the same. The infinite ordinals and the infinite cardinals are different from one another. Which of the two would you like me to settle first? How many ordinals are there? There are infinitely many ordinals. Okay... but which infinity? "How many" is a tricky concept in set theory when we start dealing with infinite sets. What you're actually trying to ask is: What is the cardinality of the set of all ordinals? Answer: There is no set of all ordinals. The ordinals form a sequence. Each ordinal is defined in terms of all the ordinals that are smaller than it. ...]]> Mon, 21 Oct 2013 23:30:07 +0100 Protagonism Ra » Previously "I'm trying to find Laura Ferno. You're her emergency contact," is what the fellow on the phone leads with, Hollywood-style, no greeting. "Is it an emergency?" Natalie Ferno asks, mildly refreshed to be getting to the point the conversation so quickly. She keeps a thick pad of A4 next to the phone. It is measurably thicker with the weight of doodles. People, in Nat's experience, can lock themselves into a kind of verbal holding pattern, constantly emitting syllables while never advancing the conversation. "It's two halves of an emergency," says the man. "Who is this?" "Anil Devi, I worked with your sister at Hatt Group." "You fired her," Nat observes. Anil Devi, personally, worked with Laura Ferno only for a few weeks altogether while she was still in gainful employment. The decision to fire her was made completely in his absence, for reasons completely unrelated to him. "No," he explains. On the other hand, Devi is contacting Natalie Ferno as a formal representativ...]]> Sat, 05 Oct 2013 15:11:29 +0100 MetaFizzBuzz Code » The common programming challenge, FizzBuzz, is usually phrased something like this: Write a program which does the following. For each of the integers from 1 to 100 inclusive: If the integer is divisible by 3, print "Fizz". If the integer is divisible by 5, print "Buzz". If nothing else has been printed, print the integer. Print a line break, "\n". If you are just starting to learn a programming language, or just starting to learn to program in general, FizzBuzz tests a few extremely basic concepts: variables, conditionals, loops, output and escaping. I'm teaching Perl again, so I've assigned FizzBuzz as a nominal piece of homework. Unfortunately, manually checking every FizzBuzz implementation to see that it does the correct thing is a little tiresome. And simply eyeballing the output is prone to human error. Wouldn't it be better if I had another Perl script which could mark FizzBuzz submissions for me? Introducing MetaFizzBuzz MetaFizzBuzz (...]]> Sat, 14 Sep 2013 18:05:02 +0100 I don't know, Timmy, being God is a big responsibility Fiction » Drabblecast audio in Polish in French Tim already had his bag and overcoat on and his keys in his hand and was about to leave when Diane stopped him at the door. "I just got this thing working. You have to come and see it." "I have a bus to catch." "You can get the next one." "They're every half an hour," he objected. "This had better be good." "It's super-duper. Look at the big screen, it's easier than squinting at my terminal." "Will this take long?" "A mere instant. Okay, quantum computing, right?" If you're reading this message, you're reading copypasta. Read the original by Sam Hughes at "That's the name of the game," he replied. They - by which we now refer to Tim, Diane, their eight colleagues, their two supervisors, four chemical engineers, six electrical engineers, the janitor, a countable infinity of TEEO 9.9.1 ultra-medium-density selectably-foaming non-elasticised quantum waveform frequency rate range collapse selectors and the...]]> Wed, 11 Sep 2013 23:40:44 +0100 Hey look, I'm on Drabblecast Blog » Not me specifically, a thing I wrote. The thing I wrote was I don't know, Timmy, being God is a big responsibility, a short science fiction story about the very real dangers of hypercomputation. The thing on Drabblecast is an audio recording of the same! You need to be a subscribing Drabblecast member to listen to it. So, if you are, maybe you already listened to it! The recording is from a live reading of the story at... well, supposedly, at WorldCon 72, but that hasn't happened yet, so I think it was more likely to have been WorldCon 71 in San Antonio....]]> Wed, 11 Sep 2013 23:38:17 +0100 Deus Ex Ultimate Run walkthrough Blog » Conditions for the ultimate Deus Ex run are: "Realistic" difficulty setting No items. In particular: No weapons No augmentations No lockpicks or multitools No skills upgrades. In particular: No hacking Never use a door code or a computer login without first legitimately acquiring it from somewhere Spend no money Never use the one augmentation which is available by default, the flashlight Never use a repairbot or at any time recharge your bioelectricity These are the conditions for the famed "Alginon run". Although fully captured on video, this run is long (~4 hours in total), involving some very cautious strategies, and the game audio has been lost. Unfortunately, this makes keeping track of Alginon's strategy difficult, particularly when individual techniques span multiple videos. Annotating the videos is also difficult because YouTube only permits 500 characters per comment. What follows is a...]]> Sat, 07 Sep 2013 23:26:30 +0100 There Is No Cabal Ra » Previously Laura is stumbling drunkenly across a world that's like the sterilised mirror underside of reality, the blue and black and silver-grey upside-down place seen in rain puddles. It's a place where nothing that happens is good; where some nightmare was uncorked and spread through the air, worming its way into people's tongues and eyeballs and alveoli, seeping into the surfaces until there was nothing but nightmare to see or eat or drink. The air is as cold as bone and seems to breeze through her instead of around her. The air has an unsettling texture, as if there are occasional invisible strands of cobweb stirred into it. There's an irritating electronic buzzing, like some combination of metal cutting devices operating intermittently half a street away. It hurts to think. Laura blitters across the glass landscape. Nobody can remember the start of a dream. She is trudging through a black glass mountain valley with jagged glass boulders and glass shards crackling underfoot li...]]> Fri, 06 Sep 2013 21:32:00 +0100 Deeper Magic Ra » Previously The entity possessing Nick Laughon sits in the easy chair. It sits easily. Laura remains standing, arms folded. Laura's been watching it carefully. There's a thing that the-thing-that-isn't-Nick hasn't done. It hasn't displayed any unfamiliarity with its surroundings. Right after being "woken up", the thing that isn't Nick got up, took a leak, put some clothes on. Now it slouches in a very Nick-like position, enviably comfortable, feet up, with a big glass of water. It moves like Nick. It? He? Laura has waited long enough. "Explain." "I am Kazuya Tanako. My True Name was ra." There it is. It's beautiful to her, like light dawning. "...Of course you are. Of course! That makes sense. You died in Tanako's world. Your world! The place we named after you after you'd died there. You didn't call it that, obviously. You called it something else." "'The glass place', 'the glass dream', 'pattern one', 'black marble', lots of different things," Tanako explains. "Now, my question ...]]> Sat, 13 Jul 2013 19:19:34 +0100 The difference between call-by-value and call-by-reference Code » The difference between call-by-value and call-by-reference is most easily explained using the following pseudocode. function modify(input) { input = "red" } x = "blue" modify(x) print(x) // "blue" if call-by-value // "red" if call-by-reference Hint: most popular programming languages call by value. This includes C, Java and Python. The most notable exception is Perl. Look out! Confusingly, many call-by-value programming languages pass an object reference as their value. Use this pseudocode to test this behaviour. function modify(input) { input.colour = "red" } x = new Object x.colour = "blue" modify(x) print(x.colour) // "blue" if call-by-value and value is whole object // "red" if call-by-value and value is reference to object // "red" if call-by-reference Hint: most popular call-by-value programming languages use a reference to the object as their value. The most notable exception is PHP. That'...]]> Mon, 17 Jun 2013 19:18:17 +0100 Review: Star Wars Episode VII Blog » It's difficult to put together a cogent response to this film because of how heavily the media/merchandising storm in front of it distorted my preconceptions. I live under a rock and have a mild allergy to advertisements and I couldn't get away from it. But it seems fitting to me that the significance of the film would feel small compared to the significance of everything around it. Episode VII would feel like that even if it had been released into a vacuum, because it isn't a significant moment in cinema. It isn't even a significant moment in Star Wars. This isn't the resurrection that Doctor Who had. The franchise wasn't dead, the franchise never died. The truth about Episode VII is that it's just another Star Wars film. Despite marking the beginning of a new trilogy -- indeed, very probably a trilogy of trilogies, extending decades into the future of both the Star Wars universe and our own -- it feels like business as usual. Episode VII begins during the events of A New Hope, with...]]> Fri, 14 Jun 2013 23:04:07 +0100 Redeeming Quantum of Solace Blog » First, watch Casino Royale and Quantum of Solace back-to-back. ... Wasn't that an improvement? I think they make a solid double-bill. The join between the two is seamless; Casino Royale is by far the better-received film and Quantum can coast on that good feeling for a good percentage of its running length. Casino Royale was always a little bloated with that fourth act, whereas Quantum of Solace is well-understood to be very rushed both in production and the final product. Knocking out the wall between the two evens things out. Now let's go one step further and see if we can completely fix this thing: move the fourth act of Casino Royale to the start of Quantum of Solace. What we have are two new films: Casino Roya— In his first outing as 007, James Bond tracks down and matches wits with a man named Le Chiffre, "private banker to the world's terrorists". Bond defeats the man at poker, ruining him and leaving him with nowhere to run but into the arms of MI6. Le Chiffre captu...]]> Wed, 12 Jun 2013 19:10:52 +0100 Java class finder Code » "Agh I know that that class is in one of these two hundred JARs, just tell me which one for crying out loud" import os, sys, zipfile top = sys.argv[1] # e.g. "C:\\Program Files (x86)" classname = sys.argv[2] # e.g. "javax.wsdl.factory.WSDLFactory" member = "/".join(classname.split(".")) + ".class" # e.g. "javax/wsdl/factory/WSDLFactory.class" for dirpath, _, filenames in os.walk(top): for filename in filenames: if not filename.endswith(".jar"): continue filename = os.path.join(dirpath, filename) with zipfile.ZipFile(filename) as jar: if member in jar.namelist(): print(filename) ...]]> Tue, 11 Jun 2013 22:56:26 +0100 Hatt's People Ra » Previously Rajesh Vidyasagar has begun to decelerate. He takes the lift to Hatt's floor, which is normal for visitors to Hatt's floor given what floor Hatt's is, but then when he reaches the ante-room where Sally works he leans on the chair for support as he lowers himself into it. He politely refuses Sally's offer of tea. When it's time for the meeting, he leans on the chair again to get up. He politely refuses Sally's offer of assistance. He's losing weight. He leans for support on the door handle to Hatt's office. "Hi. Have a seat." Ed Hatt knows Vidyasagar far better. He stays behind his desk, and lets Vidyasagar seat himself. "I don't come up here very often," Vidyasagar smiles. "I should have come to you," Hatt says apologetically. He knows the walk from Vidyasagar's office to this one is long and lengthening. "How are you? How's the family?" "How's the view?" Vidyasagar asks, nodding at the window behind Hatt. Hatt keeps the blinds permanently closed. "It's crap," he ...]]> Sun, 09 Jun 2013 23:40:41 +0100 A technical question about the URL schema Blog » Hey everybody. So, you may or may not have known that I designed to have extremely terse, human-readable, human-memorable URLs. The full rationale behind this design decision can be found in my article from a few years ago, On short URLs. One of the reasons given for this scheme is: Because each page has a short, unique "slug" (e.g. in "", the slug is "destroy"), each page has a unique URL. There is no redundancy in my URL schema - i.e., it is not possible to reach the same resource via multiple URLs. This keeps my site's complexity to a minimum and I'm told it's also good for SEO, although I honestly pay very little attention to the latter. Here's what happens, then, when you try to load various URLs: - 200 OK - 404 Not Found - 404 Not Found - 404 Not Found etc. Now, new content on is made available via an RSS feed which ...]]> Fri, 03 May 2013 20:39:00 +0100 QUIZ: Could you destroy the Earth? Geocide » Geocide is a lot more complicated than just pressing a big red button. It takes decades of hard work - and a lot more besides (as the book will indicate in much greater detail). Cast your eyes over the following questionnaire to see if you have what it takes. Which of these best describes your childhood? Many a happy day spent building sandcastles at the beach Whenever I saw a giant pyramid of cans in a supermarket, I had an irresistible desire to pull out the bottom can I generally worked on plans to destroy the Earth What level of scientific education do you possess? I dropped out of school and believe iPods run on magic smoke I have a bachelor's degree in engineering; I read Scientific American and build bridges out of stationery for entertainment I won the Nobel Prize for Physics at the age of eleven, with the help of my future self How much money do you have? None or less I earn an honest wage and put most of it towards my pension All of it; all legal currenc...]]> Mon, 29 Apr 2013 23:14:31 +0100 Review: Oblivion Blog » I'm one of Tron: Legacy's biggest apologists. I saw the movie as a feature-length music video. I think its soundtrack is the best work that Daft Punk have ever done. The visuals are sharp and pretty enough to keep the eye amused, and the storyline was largely incidental. Sure, it didn't have a single memorable line of dialogue. Sure, Michael Sheen was clearly acting in a completely different movie from everybody else in the production. And any kind of serious science fiction statement it was ever trying to make - the grand themes of science, medicine and religion promised in the trailer - was clearly quelled by Disney for fear of being remotely controversial, which is to say, thought-provoking. And yet every movie is the work of many hands, and it's statistically improbable that none of those hands will have any skill. Tron: Legacy clearly had a lot of love put into it. My particular highlight is the computer interfaces seen in the real world, used by Cillian Murphy's character to stop...]]> Thu, 25 Apr 2013 19:28:41 +0100 Bare Metal Ra » Previously "Rajesh is a fucking idiot," Ed Hatt explains. "That seems--" Martin Garrett begins, but then the toll barrier flips up and Hatt floors it, which means that for the next two or three seconds Garrett is squelched back into his seat by acceleration, and unable to respond. On the other side of the Dartford booth is a wide apron where exiting traffic condenses from twenty-four lanes down to three and resumes its course south around the rim of Greater London. At peak periods, there are close to a hundred vehicles jostling for position here, but it's not peak period. If anything, it's valley period: pitch dark, three fifteen on a chilly and wholly unremarkable weekday morning in the spring of 1986. "That seems harsh," Garrett concludes, once he recovers the ability to speak. "'Seems harsh'," Ed Hatt echoes. "He doesn't get it. If have to go through one more call with the man where I have straighten out his priorities, I may well have him retired." "That seems a brutal way to ...]]> Sat, 20 Apr 2013 18:39:18 +0100 Ra » Previously The heat in Calcutta is pulverising. Ed Hatt finds it almost impossible to think clearly about anything other than shade and cold water. His Bengali is good enough to direct a taxi driver to a place and count out the cash afterwards, but outside of vehicles, the only way to get anywhere in India is to traipse, or possibly to slog. Wandering, ambling and strolling simply aren't appropriate gaits for an Englishman in such a climate. The sky is unbroken blue, and standing in direct sunlight hurts. It's 1974 and Hatt is a newly-minted adult, fresh out of Oxford and adrift eastward, looking for whatever, or whatever. Real life has been on hold all the way through his MEng, and is still on hold. He knows that, some months from now, it will reassert itself. At that point, he will be grudgingly forced to find a job. He hopes that he can find something worth becoming excited about by then. He hopes for some kind of epiphany. Or, failing all of that, he hopes to bore himself and tir...]]> Wed, 03 Apr 2013 19:58:18 +0100 Variadic fixed point combinators Code » The procedure for creating a function which is recursive (self-calling) despite also being anonymous (i.e. having no name by which to call itself) is well-understood and straightforward. In a nutshell, the solution is to use a fixed point combinator. Unfortunately, this procedure is only effective for constructing anonymous functions which directly call themselves, such as: fibonacci = lambda n: \ 0 if n == 0 else \ 1 if n == 1 else \ fibonacci(n-1) + fibonacci(n-2) print(fibonacci(17)) # "1597" Now imagine you want to construct a pair of anonymous functions, such that each one potentially calls itself and/or the other, such as: even = lambda n: \ True if n == 0 else odd(n-1) odd = lambda n: \ False if n == 0 else even(n-1) print(even(6)) # "True" In this situation, a mere Y combinator isn't sufficient. We need a variadic fixed point combinator which can resolve the fixed points of multiple mutually referential functions simultaneously. Read on. Conten...]]> Sun, 24 Mar 2013 20:20:05 +0000 Zero Day Ra » Previously After the second resurrection, Exa's in free fall. This time he reacts quickly enough to yell a few magic words that crank his kara up to full power before impact. He lands in a field and bounces high enough to die a fourth time just from the bounce, but now his body is being rewritten from "damaged" to "optimal" on a nanosecond-by-nanosecond basis, making him effectively invincible. He lands on his feet after the second bounce, and looks up. The boy is way overhead and dropping hard, a fist raised and coming down. But that can't be it. Exa calls out, "Show invisibles." Now he sees the orange force field wireframe with which the boy is clothed, a polygonal network making up a mechanical soldier figure easily fifty metres tall. That must be what hit him the first time. He was slapped into the middle distance by an invisible robotic fist. Looking closer, Exa sees that the sword/weapon is already harvesting and transmuting air molecules to build the machine in reality, starti...]]> Sun, 03 Mar 2013 16:11:12 +0000 Death Surrounds This Machine Ra » Previously Exa comes back to life a split second before hitting the containment shield from the inside at ninety metres per second. It's not enough time to react. He breaks his neck, and dies again.   Next: Zero Day...]]> Sun, 03 Mar 2013 01:16:07 +0000 Abstract Weapon Ra » Previously Like an engineer deeply in tune with his machine, Exa feels the world's component error deep in his bones, fractionally before anything has literally gone wrong. The world runs according to rhythms and tidal patterns, networks of sine waves layered on top of one other. The perturbation is subtle enough to be missable by any baseline human, particularly one on the other side of the world from the malfunctioning, invading component. But it's as clear to Exa as a high-pitched sound system whine is to a child not yet old enough to start losing his or her hearing. He lunges for his phone and crams it to his ear just as it turns completely bright red and gives off its ear-splitting bleep. It's the first alert since he got the new phone, and the "ringtone" is like being kicked in the head. "Short horizon," says the duty controller. "We need you now." "Yeah yeah yeah I'm on my way in," Exa says. He falls most of the way out of bed and grabs his discarded suit trousers. It's almo...]]> Tue, 19 Feb 2013 22:18:25 +0000 Primer fan commentary Blog » Since Shane Carruth's second film, Upstream Color, is coming out very shortly, interest in his first film, Primer, is on an uptick right now. I've written two articles about this movie before, but now seemed like a good moment to revisit the movie. Here is my commentary track. Start the commentary first, then start the movie when you're told to. Apologies in advance for my silly accent, occasional mispronunciations, creaky office chair and low-quality borrowed microphone....]]> Fri, 15 Feb 2013 19:26:39 +0000 New RSS shenanigans Blog » Some housekeeping: I recently discovered that loads of the page were taking an inordinate amount of time, and routinely timing out. On closer inspection it looks like that particular page, due to incompetent coding on my behalf some years ago, causes the entire page database to be loaded at once. I've replaced this with a new system whereby RSS entries are stored in a dedicated table rather than being loaded dynamically, and I can push updates to that table whenever I create or modify a page. From your perspective, there should be no perceivable change other than improved loading time. Obviously, defects go in comments. Defects that are preventing you from commenting should be posted to me or something....]]> Thu, 07 Feb 2013 00:16:12 +0000 Time travel in Twelve Monkeys Blog » The simplest and by far the most consistent explanation for everything that happens in Twelve Monkeys is that there is exactly one timeline which cannot be altered. Naturally, explaining everything in chronological order doesn't make for the most comprehensible explanation any more than it (ever!) makes for the most compelling story. There's also no point in reciting the story from Cole's perspective because the movie (and, for example, Wikipedia's plot summary) follows this very closely. So for the sake of novelty I will take a different perspective, that of the heroes of the story: the scientists. * In winter 1996/1997 a virus was distributed across the world. The virus soon mutated, no cure could be found, and some five billion people - 99% of the human species - died. The survivors retreated underground. It's now about thirty years later, and the scientist/rulers of the world are working to take back the surface of the planet. To do this, they need to gather a sample of the viru...]]> Sat, 02 Feb 2013 20:17:26 +0000 Y Code » How can a subroutine call itself without it knowing its own name? Contents Problem Fix #1: Symbolic references Fix #2: strictness Fix #3: Anonymity Fix #4: Fixed-point combinators Fix #5: That was all a complete waste of time Problem This is Perl. In reality, my recursive subroutine was one designed to find the differences between two XML documents, but I don't have space for that, so instead I'll use, ugh, Fibonacci numbers: sub fib { my $n = shift; return $n == 0 ? 0 : $n == 1 ? 1 : fib($n-1) + fib($n-2); } print fib(17); # "1597" One day I renamed the subroutine and forgot to refactor all of the calls to it, resulting in a runtime error: sub fibonacci { my $n = shift; return $n == 0 ? 0 : $n == 1 ? 1 : fib($n-1) + fib($n-2); } print fibonacci(17); # "Undefined subroutine &main::fib called at line 3" This is a trivial defect to spot in this...]]> Sat, 26 Jan 2013 12:35:02 +0000 Password security in Deus Ex Blog » Deus Ex (every time you mention it, someone reinstalls it) takes place in a 2050s future world at the tipping point between dystopia and flat-out chaos. It's also a game world filled to the brim the computer terminals and numeric keypads, roughly half of which must be used to advance through the game. While it's possible to hack terminals and use multitools to bypass keypads, hacking is time-consuming and risky while multitools are in finite supply, which means you end up collecting usernames and passwords from dozens of different sources. Because so many of these logins and codes appear in the game, some interesting patterns emerge. As is true in every aspect of videogames, making a game which is realistic is a goal totally opposed with making a game which is enjoyable to play. Player character JC Denton is improbably difficult to see or hear, even when crouching in the peripheral vision of a guard in a brightly-lit corridor. Buildings have navigable ventilation shafts; security ca...]]> Fri, 04 Jan 2013 00:24:53 +0000 Invisibility theory Blog » As part of Ra I realised that I needed a character to become invisible. Since this requirement is coming up quite soon I decided to sit down and work out how this cloak of invisibility would work. I ran into some interesting problems. It turns out that becoming invisible is less than half of the problem. I haven't written any more of Ra yet, so the cloak might not come into the story in the next chapter, or even at all. Even if it does appear, the cloak might not function as described below, and even if that's the case I probably won't spend a huge amount of time laboriously explaining the full mechanism behind it in the story. So, other than the fact that an invisibility cloak might appear in Ra in the future, this article contains no spoilers. What you should already know Here are two things that have already been established in the story. The chapter What You Don't Know covers this in detail. Firstly, there is a special kind of mana called "chi" (the Greek letter Χ) which is...]]> Wed, 26 Dec 2012 23:31:17 +0000 Daemons Ra » Previously Nick Laughon teaches now. He's brand new at it, only a month into the job and still full of momentum. It's the first job he's had which uses any meaningful fraction of his energy each day. It's the first time he's ever gone to bed tired without serious exercise. It also means that he gets home earlier than most. Today, Laura is waiting for him. "Hello," he says, stacking a crate of unmarked red exercise books in the flat's nominal hallway and dumping a weighty rucksack on top of them. Laura's sitting in the living room, positioned to face the door directly. Between them on the coffee table is a glass filled with a colourless, effervescent liquid which Nick assumes to be gin and tonic. Basic signals given off by Laura suggest a relatively high gin-to-tonic ratio. The drink, however, is full. Laura sits behind it, not drinking it. Deliberately and purposefully not getting drunk. She is deeply unhappy. Nick last saw Laura more than twenty-four hours ago. Work has demanded th...]]> Fri, 21 Dec 2012 16:17:42 +0000 The Seventh Impossible Thing Ra » Previously Meditation is part of the workload of a professional mage. No employer wants to pay for its people to spend ten percent of the working day dozing off in the lotus position in quiet, well-lit, boringly-painted rooms which could be better used for office space; nor, despite appearances, is "dozing off" what happens in there. Meditation is mental exercise: heavily structured, exhausting, time-consuming, headache-inducing even under perfect circumstances and one hundred percent necessary. A mage whose brain is not properly aligned with the work is a mage unable to work. Laura is one of fifteen in Meditation 1 at Hatt Group that Monday morning, and has been sat down for barely two minutes when she has the revelation. It's a bad thing for a mage to have revelations while meditating. This is not a religious pursuit, and the achievement of enlightenment is not the aim of the game. Unbidden, distracting thoughts are a sign of a wandering mind, which is the exact opposite of what's...]]> Sun, 11 Nov 2012 19:27:59 +0000 Time travel in Looper Blog » "Every second that passes is bad." Let's talk about Looper. It's rare that I've seen a time travel movie which is so serious about its subject matter and serious in its subject matter while simultaneously being so unclear in its mechanics. At one end of that spectrum is Primer, which has hardcore (albeit fictitious) scientific principles behind it and which builds its story almost entirely on the logical consequences of those principles. At the other end we have Doctor Who in which time obeys whatever wibbly wobbly rules it needs to obey "today" in order to make today's stories work, but which gets away with that, because its stories and premise are as essentially "light" in tone as the "science". In Primer, you have to think very hard about how time travel works just to decode what you're seeing, let alone to grasp the emotional story. In Doctor Who, the harder you think about it, the more you're going to suffer and the less fun you're going to have. Looper, in the middle, is unusu...]]> Sat, 06 Oct 2012 02:04:57 +0100 Space Magic Ra » Previously Rachel Ferno's burning mana so fast to stay in the air that it feels like it's doing physical and mental damage to her, as if she were consuming body parts and organs and memories as reaction mass, as if whatever it is that's finally going to match velocities with the plummeting orbiter won't be even be a human being anymore but a spent propellant tank. Autokinetic effects must, on pain of burst retinas and crushing death, be applied uniformly across the whole body. She pulls what would be lethal gees to keep up with the machine's chaotic tumble, desperately fighting to stay out of its smoke trail where she can still eyeball her interception trajectory. Virtual instruments spread out in front of her like playing cards show her relative position and velocity, her airspeed and orientation, her oxygen levels, mana levels, and her degree of concentration, but the more closely she monitors the flashing values, the closer she edges towards completely losing it, breaking the spel...]]> Mon, 17 Sep 2012 22:47:00 +0100 Learn Perl in about 2 hours 30 minutes Code » 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 Japanese translation by ktat 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....]]> Tue, 11 Sep 2012 11:57:47 +0100 Teaching Perl Blog » I've taught Perl to a grand total of about fifty people at work now, in various sizes of group. These are, generally, newcomers to an office where a lot of Perl is used. Most of these newcomers are fresh out of university and if they have any programming experience it's usually Java from their CS courses. These people need to learn Perl to do their jobs, and my task is to show them how to do this work and how to find their way after the lessons are over. Here are some things I've discovered. Right out of the gate, there's an unavoidable culture shock which comes from learning Java and then learning Perl. Perl, by its very nature, encourages behaviours which Java, by its nature, strongly discourages or even makes impossible. For example: stern, protective type safety is not only missing from Perl but actually not even considered particularly desirable. Perl is relaxed. The reaction from students is, naturally: "Isn't this a huge obstacle to getting anything done?" Obviously the answer ...]]> Sun, 02 Sep 2012 00:06:13 +0100 Perform bit shuffling operations in Python Code » Here's another one from the "uncertain if anybody has any use for a thing like this" department. Let's say you were trying to decode a four-byte UTF-8 character to its Unicode code point, as a 32-bit integer. You might express that conversion in the form of a neat, short string as follows: 11110aaa 10bbbbbb 10cccccc 10dddddd -> 00000000 000aaabb bbbbcccc ccdddddd But manual bit-shuffling is tedious at the best of times. is a Python 3 script which takes this exact string as input and returns you some sample bit-shuffling code as output. C:\>python "11110aaa 10bbbbbb 10cccccc 10dddddd -> 00000000 000aaabb bbbbcccc ccdddddd" def shuffle(input, index): ''' 11110aaa 10bbbbbb 10cccccc 10dddddd -> 00000000 000aaabb bbbbcccc ccdddddd ''' assert index + 4 4, (input[index + 1] & 0b00001111) > 2, (input[index + 2] & 0b00000011) ...]]> Tue, 07 Aug 2012 22:27:38 +0100 Python lacks the Axiom of Choice Code » Python has sets, but lacks the axiom of choice. If I have a set object or a frozenset object then that object may or may not have members. If a set has a single member, then I can get that member using set.pop(): chars = {"a", "b", "c"} if len(chars) == 1: print(chars.pop()) else: print("[" + "".join(escape(char) for char in sorted(chars)) + "]") But this has two drawbacks. Firstly, it's destructive: chars is now empty after following the first code path. Secondly, it doesn't work on frozensets, because you can't modify a frozenset. The only option available to me is: chars = frozenset({"a", "b", "c"}) if len(chars) == 1: print([char for char in chars][0]) else: print("[" + "".join(escape(char) for char in sorted(chars)) + "]") which is just disgusting. Wouldn't it be much prettier if Python simply supported the axiom of choice? chars = frozenset({"a", "b", "c"}) if len(chars) == 1: print(chars.choose()) else: print("[" + "".j...]]> Thu, 02 Aug 2012 14:40:30 +0100 Finite state machines in Python Code » which is on GitHub now This is a library for the creation and manipulating of deterministic finite state machines in Python 3. I realise that this has been done before in basically every language under the sun, Python included, but doing it for myself was incredibly good fun and highly educational. fsm class overview This contains the basic fsm class. This allows you to create a deterministic finite-state machine (I guess "automaton" is a more correct term but never mind, if that bothers you too much you can do a find-and-replace). You can use the fsm.accepts() method to pass a string to the FSM and retrieve True or False. The fsm class also implements __str__() which means you can print an FSM using print(fsm). Finally and most importantly, if you also have my companion module, you can call to convert the FSM into an object representing a regular expression with exactly equivalent matching power to the original FSM. This process uses this algorithm ...]]> Wed, 01 Aug 2012 20:04:22 +0100 The Jesus Machine Ra » Previously Grey has just put the last of the pieces together in his head when he hears the first scream from outside the shaft. The timing is uncanny. He has spent a week and a half taking photographs and drawing schematics and dispatching hesitant mana pings into likely-looking receptors in the surface of the artifact. He has observed the series of inexplicable and then unnerving and then mind-wrenching real-world effects of powering the thing up. He has spent that time patiently avoiding leaping to the conclusion. He has tested every step and ruled out every alternative. And he has, after ten-and-a-half days, for one moment, permitted himself to entertain the possibility that what he's looking at is what he feared at first glance he was looking at, and at that instant he hears what sounds like the world above being Cleaned, and it's almost a relief. Magic is a science. It's a science as advanced as any other, as quantum field theory or general relativity, and there have been outlan...]]> Sat, 14 Jul 2012 15:47:59 +0100 Crystal Maze Pub Crawl route v2.0 Blog » 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 or location). 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. This is the second vers...]]> Mon, 09 Jul 2012 22:06:38 +0100 Abandoned screenplay ideas Blog » "Centurion" Based on and named after the drinking game "Centurion", in which you drink one shot of beer per minute for 100 minutes. This movie takes place in real time and focuses on a group of university students who gather together in somebody's room to play the game. Each is drinking a different beverage. The movie would be talking heads, driven by compelling Tarantino-style dialogue between interesting characters with a year or two of shared history behind them. The dialogue would probably eventually have to stop being about nothing in particular and start moving forward with some sort of actual story. Perhaps terrible revelations occur or the whole dynamic of the friends changes at this pivotal moment in some way. The drinking does not stop - some succeed in the game, some become weary or ill and drop out. The minute-by-minute pace of drinking provides a background, a rhythm, perhaps breaking up the whole movie into one hundred 60-second skits. I never really nailed any of this...]]> Wed, 13 Jun 2012 21:37:12 +0100 Thaumonuclear Ra » Previously The citadel is as tall as a thirty-storey building and featureless as a brick. Nat walks around it once, looking for windows and gates. Finding none, she tries imagining herself inside and then "stepping into" the mental image, which is how things usually work here. It doesn't work. Abandoning subtlety, she makes one hand gluey and uses it to pull a black stone as big as a refrigerator right out of the wall. She flings it away over her shoulder. That leaves a large rectangular slot, with just enough room for her to clamber into the dark place inside. The wall is a metre and a half thick, with nothing behind it but a half-metre gap and an identical wall. Natalie shuffles sideways along the narrow alley until she reaches the corner, where both walls turn ninety degrees. She looks up, and can't see a lot, but there's definitely clear space above her head. She concludes that what she's looking at is a second, slightly smaller citadel inside the first one. Everything goes dark...]]> Wed, 06 Jun 2012 22:20:54 +0100 Broken 'Verse Ra » Previously Laura and Natalie Ferno are engulfed in hellish red light underneath what might as well be a million tonnes of magma. Their world is barely larger than a pair of coffins. The noise the magma makes is strange, more of a creaking than a rumbling. The noise is pervasive and unpleasant. Their shared multiplied force shield fizzes under load as it races through Laura's mana reserves to maintain its structural integrity. The shield only lets visible light through, which is the only reason that they haven't both been incinerated by radiant heat. They're running out of air. About eight breaths each. "Laura," Nat hisses. Her voice rebounds strangely inside the tiny enclosed space. "You've got to do this. I've no mana left and you're running out. You've got to do this now." "I can't-- I don't know any spells that can get us out of here." Laura wonders why Natalie is talking so quietly. She realises it's to conserve oxygen. They must have used half of it up already. The orange-r...]]> Tue, 29 May 2012 19:05:09 +0100 Ragdoll Physicist Ra » Previously "Interesting" is the term geologists use to describe Iceland, and geologically interesting places are worth paying attention to in the same way that warzones and brand new nuclear powers are. Entire cubic kilometres of lava are seen emerging from the place. Sometimes it grows new islands. Sometimes its volcanic fissures eject so much sulphur dioxide into the atmosphere that the global temperature drops significantly, crops fail across the Northern Hemisphere and millions die from famine. Iceland is the place you go to remind yourself that planet Earth is a machine: very large, continuously operating, working on a time scale too long to easily observe, towards a highly uncertain end; and to remind yourself that all the organic life that has ever existed amounts to a greasy film that has survived on the exterior of that machine thanks to furious improvisation rather than any specific dispensation. Iceland is also one of the few places on Earth, other than on people's skin, ...]]> Fri, 04 May 2012 21:43:28 +0100 Time travel grammar Blog » "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...]]> Mon, 26 Mar 2012 13:20:13 +0100 Futurama timeline Blog » Now including all of season 7B. This may be the final significant update of the Futurama timeline. It's been an emotional day for me. 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", "All The Presidents' Heads" and "Decision 3012" resulted in changes to the Futurama timeline. This timeline deals solely with the final timeline to dat...]]> Sun, 11 Sep 2011 18:37:42 +0100