Bees: the miracle powering modern computing

Computers. How do they work? Magic? Bees? Magnets? Who knows. All those components, wires and other bits and bobs, it’s pretty much a mystery that we’ll never really understand. Well, no, actually. Almost nothing (I say almost because, well, you know) could be further from the truth. And it’s worse than that: as part of the ongoing stupidification of society in general, it’s now “cool” to be ignorant of the details even if you work in IT. It gets harder and harder to find good programmers who can write a computer friendly, high performing, memory efficient algorithm because increasingly, none of them have the faintest bloody clue what goes on under the hood. Frankly, for many programmers these days, it might as well be magic, bees and magnets.

Computers Work With Bees

As we learnt at school, computers are powered by bees and magnets. This diagram explains how.

The irony of rolling around in such ignorance is that computers are not difficult to understand. At their cores, they are incredibly simple beasts and a doddle to comprehend. I’ll tell you what, I’ll explain it to you and if it goes badly, we can negotiate on how I can send you a compensation slice of one of my truly incredible home made Swiss rolls. It is the most delicious dessert I have ever baked, and I make a mean cake. It contains almost the LD50 of deliciousness, true-facts!

Let’s unpack our example computer who will guide us through this process: the Girafferillo 32. He’s awesomely specified:

The Girafferillo 32 computer ready and waiting

If I had had the faintest idea how long this was going to make, I would have drawn it, or grown it, or carved it from granite using hot dog sausages. This represents an extraordinary quantity of work, double sided sticky tape, cardboard and careful cutting when Mrs Cobras was not looking (click for embiggening)

The cardboard boxes are memory locations. Each one of them can store a single number from 0 to 255. If there is nothing in a box, assume it contains zero – I genuinely ran out of steam cutting cardboard and paper. The giraffe itself is the actual computing device. He’s pretty simple. When he’s switched on, he looks in the first box (box zero, top left) and sees what number is in it. That number tells him what to do and how many boxes to move forward to find the next instruction. He keeps track of which box he’s looking in using his “left leg box”, which we will refer to as the LLB. Ok, without further ado, let’s plug this baby in. This could tingle a bit…

Ok, what’s in the first box, Mr Giraffe! Ah yes, code 165. Code 165 means that the next box contains a box number. Look in that box number and copy whatever number it contains into our "right leg box", or RLB, and then add 2 to our LLB so it points at the next instruction. Got that? Ok, so let’s follow the instruction: next box is box 1. It contains the number 28. Let’s look in box 28 – ooooo, the number “2”. Right oh, write “2” on the bit of paper in our RLB and then add 2 to our LLB as ordered.

Lots happened there, so let’s recap our current status. We have followed one instruction and as a result, we have 2 in our RLB and 2 in our LLB. Our LLB tells us which box to look in for our next instruction, which is box 2, so let’s crack on!

Box 2 contains the number 101. Oooooo, different instruction. This one is similar to code 165 but slightly different: the next box contains a box number. Look in that box, and ADD whatever number it contains to what is currently in our RLB and then add 2 to our LLB. Ok, so let’s do that. The next box contains the number 29. Box 29 contains the number 2. Add that to what’s already in our RLB and what do we have? 4. Pop that back into the RLB.

So let us continue. LLB contains 4 so we look inside box 4 for the next instruction. Ah, another new one, 133. 133 follows the same pattern as the other ones: the next box contains a box number. Overwrite whatever is in that box with a copy of what is in our RLB and add 2 to our LLB. Ok, sounds easy. The next box, box 5, contains the number 31. We note down what is in our RLB and pop it into box 31 throwing away what was there when we do it. Awesome. Let’s check out what we’ve ended up with:

Hmmm: looks to me like the Girafferillo has added the contents of box 28 and 29 together and slid the answer into box 31!

And let us see what is next. LLB contains 6 so let’s take a peek at what we’re doing next. Interesting, it contains a zero. Zero means stop, now, do nothing else.

Carry the one… profit!

The Girafferillo 32 has run its first program. The program was this: add the contents of box 28 and 29 together and store the result in box 31. You can run this program again and again with different numbers in boxes 28 and 29 and it will faithfully add them together… or will it? Run the program again, but this time with the numbers 200 and 100 in boxes 28 and 29. Did you get the result 300? If so, you’ve made a mistake. You see, the Girafferillo 32, as I mentioned above, can only store a single number from 0 to 255 in each box – 256 different combinations. When it adds 100 to 200, the RLB will overflow. The result that we will get is the remainder (300 – 256) which is 44, but our giraffe will be wearing the “carry hat” to tell us that this has happened. Let’s check him out in his snazzy hat:

Why, Mr Giraffe, that’s a fine hat you’re wearing.

To understand this, we need to take a trip back to school when you were a little girl/boy (delete according to your boobs/moobs status). When you were learning all about numbers, you may recall things like this:

Thousands Hundreds Tens Units
103 102 101 100
0 2 3 4

The number 234 is 4 in the units box, 3 in the tens and 2 in the hundreds. Or, (4 x 1) + (3 x 10) + (2 x 100). No box can store anything other than a number from 0 to 9, so if we’re counting up from 0, when we go from 9 to 10, we actually CARRY 1. That means reset our box to zero and add one to the box to the left, meaning we have 0 in the units column and 1 in the tens. If we added 3 to 9, we would end up with 12 – our 9 overflows over to 2 and we carry 1. Got that? Yeah, of course you have! It’s our day to day counting system which is base 10: we have ten digits. Column headers are 10 to the power of 0, 1, 2… etc.

Well, the Girafferillo 32 works the same way except he is using base 256. As a result, he has a units, 256s then 65536s column, etc. When any calculation overflows, I.e., we need to carry one, he puts on the carry hat so that we know.

So at least we know what is going on here. The carry hat means we need to add 1 to the next box, the 256 box, and the remainder, 44, goes in the units.

We reconstitute the whole number like this: 1 x 256 plus 44 x 1 = 300! Awesome. So how do we modify our program to deal with this? Well, firstly, note that I left box 30 un-used, sandwiched uncomfortably between the two numbers we are adding and the result. Well, that is where I plan on storing the number of 256s in the result. As it happens, of course, because we are adding two boxes, the maximum number of 256s will of course be 1: 255 + 255 is 510 which is 254 in the units box and 1 in the 256s box.

Time for a bit of programming. Box 6 currently contains a STOP instruction. Let’s replace it and the following few boxes as follows:

6 144
7 4
8 230
9 30
10 0

Hmm. Interesting. Any detectives want to look at the new boxes and make a rough stab in the dark as to what is happening? Well, there are some clues, so let’s piece together what we can from what we already know. Obviously to the casual observer, this is just a sequence of 5 numbers – but to us, the Girafferillo experts, we can immediately spot some interesting values. Firstly, there is a 30 in the sequence and that’s where we are storing our 256s. There is also a zero at the end, so that’s our STOP instruction. We know that the 144 is definitely an instruction, because it replaces the previous STOP instruction that was there and therefore the chances are that the 230 is an instruction too, and that, given the pattern of INSTRUCTION – BOX NUMBER we’ve seen before, is the one that adds one to our 256 box. So, from guesswork alone, we have established that our new bit of programming does something like this:

  • Mystery instruction with 2
  • Mystery instruction with 30, probably adding 1
  • STOP

Nice! The first mystery instruction, 144, is skip forwards if not wearing the carry hat, and it uses the following box to see how far to skip forwards. Thus, if we are not wearing the carry hat, we add a further 2 to our LLB (the 4 is the total number to add to the LLB if we are not wearing the carry hat) which takes us to the STOP instruction in box 10. If we ARE wearing the carry hat, we proceed to box 8. Instruction 230 means the next box contains a box number, add 1 to whatever is currently inside it.

Bingo. Our add two numbers together program is now complete. No matter what numbers you store in box 28 and 29, the correct result is calculated. The only catch is that we didn’t know whether the Giraffe was wearing his hat when we set out. Usually, to be sure, we’d add an instruction code of “24” before the add instruction. 24 means simply take your hat off.

Gobbledygook, STAT!

It is time to put some proper nerd definitions to our Girafferillo 32. Firstly, those boxes? Each one stores a BYTE. For reasons that we will come to, a byte stores a single integer (no point-something) between 0 and 255. The “32” of our computer’s name corresponds to the amount of memory it has. Thus we have 32 bytes of memory. When you go out and buy a new computer with 4 or 8GB of memory, you are buying one with 4 or 8 BILLION boxes. That is a lot of cardboard, so be thankful for miniaturisation.

Girafferillo: The Blueprints

Yes, this is exactly how it works. Officially.

The left-leg-box? That, in computer words, is called a “program counter”, or PC for short. It stores the box number that we’re going to fetch our next instruction from: a sort of “address of”. The right-leg-box is the accumulator. It’s a single memory location that we can use during calculations. Our carry hat is usually joined with a bunch more hats into a single thing I’ll call a hat rack, but is actually the processor status. Status, the PC and the accumulator are collectively called registers. The sequence that we did manually, fetching a byte from the box pointed to by our PC and then executing that instruction accordingly, is called the “fetch-execute” cycle. It’s the fundamental bit one needs to understand: fetch, act on, fetch next. In the meanwhile, our PC (left-leg-box) tells us where we’re fetching from. The giraffe is acting as the CPU, Central Processing Unit, or using its not-the-size-of-a-washing-machine-name, the microprocessor. Your phone or tablet probably contains an ARM CPU and your PC at home or work most likely has an Intel CPU of some sort. As for processing speed, we tend to refer to the instructions or mathematical operations that can be processed per second. This isn’t a wholly accurate measure, but it’s better than a rough stab in the dark. I don’t know about you, but I was managing one or two instructions per second with the manual cardboard based Girafferillo. The latest iPad can manage a good 1.5 billion operations per second so perhaps it will surprise you as much as it surprises me that it is so slow at keeping up with me in its word processor; but great performance and memory allows great laziness of software development as anyone who upgraded a totally usable PC to obsolescence with a new version of Windows will tell you.

Congratulations, you now know more about the low-level operations of computers than most programmers these days, so feel free to take a well deserved trip to the ‘fridge and help yourself to a cool, refreshing beer, or perhaps a glass of wine. Whatever tickles your fancy.

Oh, and one more thing

That’s pretty much it for the first part, and maybe all parts given how damn long it took to make the Girafferillo. However, there is one last thing that you might be amused to know. Our program consisted of the following numbers:

165, 28, 101, 29, 133, 31, 144, 4, 230, 30, 0
Assembly language

Here is our program broken down with the official mnemonics (a text representation of our numbers which we call “assembly language”):

0:  165 28       lda 28
2:  101 29       adc 29
4:  133 31       sta 31
6:  144 4        bcc skip
8:  230 30       inc 30
10: 0      .skip brk

(Five thousand bonus geek points to anyone who already knew that 6502 assembly language was part of the HUD for the Terminator)

I didn’t just make those instruction codes up. Someone else did, back in the mid 70s. These instruction/operation codes, or opcodes, as they’re called, are those of the 8 bit 6502 microprocessor designed in 1975. The 6502 and its variants powered the Apple II, the BBC-B, the Oric, the Atrai 2600 VCS, the Vic 20, the Super Nintendo, the Commodore 64 and numerous other computers that contributed so much to home computing and gaming in the late ’70s and throughout the 1980s. You have just written and understood a program written in 6502 machine code: the lowest level, most complex form of computer programming that is practically possible – manual programming in raw numbers.

If there is any single microprocessor that will give nerds over 35 a good, solid binary erection, it’s the 6502. In fact, I am on the verge of having to rearrange my clock weights just thinking about it. It is difficult to feel any love for any of the other processors of the generation: the Z80 felt like a complete mess (mostly because it was op-code compatible with the 8080) and the 6809 was woefully dated long before the 80s even kicked in. The 6502, though, was a gorgeous, neat, tidy, fast and wonderfully designed piece of kit that struck the perfect balance of complexity and programmer friendliness that was, in my humble opinion, only ever achieved twice. Once with the 6502 that powered, amongst other things, the Apple II, C64 and Atari VCS, and again with the Motorola 68000 that gave life and power to such classics as the Amiga, Atari ST and first generation of Macs. The Girafferillo pays homage to one of the chips that played such an important part in the journey to modern computing.

The 6502 and me

There are some skills that time strips the usefulness from. Skills like rewinding a cassette with a biro or attempting to untangle a barely viewable 15th generation porn video from the VCR before the girlfriend gets home (I succeeded, by the way, but the tape, well, RIP). First the years and then the decades click over and you just know that other than reminiscing about how things were when you were young, these wonderful things will no longer serve a purpose. Now it is just knowledge gathering dust in a dark corner of your brain. You can imagine my surprise, then, when recently I was called upon to attempt to make use of something that I last did in ’91 when I was a lot younger and personal privacy was still something that the everyday person on the street had: programming the 6502 microprocessor in machine code. I had a lot of fun doing it!

6502 Computer

I built this, back in ’91. It was supposed to be a Nintendo Gameboy Development system. It worked, after a fashion, but a combination of… well, a lot of things… meant it was never deployed. It uses the 65C102 – a slightly grooved up version of the 6502 with some extra instructions and stuff

But that’s not it for the Girafferillo 32. Next time he’s going to be upgraded to a whopping 256 bytes of memory (needless to say, there will not be a cardboard version) and will come with the ability to display stuff and gather input from the keyboard. All this and more when I release the ‘incredible’ Girafferillo hardware emulator as we bootstrap ourselves through the 80s and our understanding of how computers work.

Posted in Software development | Tagged , , , , , | 1 Comment

Duh duh duh. Duh duh duh. Duh duh duh

The 18:14 party train

The 18:14 from King’s Cross preparing to leave for King’s Lynn. Who knows when, or if, it will ever arrive.

Duh duh duh. The sound of GSM digital phones interfering with electronics. It’s also the sound of lies, as I enjoyed witnessing on BBC breakfast a couple of months ago. They’d wheeled in a chap called Michael Roberts from ATOC (Association of Train ‘Operating’ Companies) to show as much contempt for passengers as he possibly could. I must say, he did a delightful job. I particularly enjoyed the bit when, having said his ‘phone was actually off, he reached into his inside pocket, took it out and looked at the screen whilst being interviewed. This is the kind of rudeness I last saw at a Christmas meal a few years back when a teenager listened to music on an iPod through five delicious courses and three different wines.

Oh, he played the violins as one would expect, but with no passion and energy. It would be like apologising for winning a hundred million on the lottery: it has no meaning. He must know that both the price rises and increasingly questionable service are ridiculous, but his comfy position exists only if he plays the fiddle of the railway operators and I guess 7AM is just not a good time to bullshit with style, flair and zing. Regardless of performance, though, it’s going to be a challenge of galaxian proportions to have any sympathy for the arse hats Mr Roberts represents when they are, effectively, giving vast swathes of the country an involuntary pay cut every year. But, as is the nomenclature of the age, we’re all in it together, right? After all, the improvements that nobody has seen to the service, rolling stock and rail network have to be paid for somehow. Let’s face it, in this time of economic turmoil, nobody in their right mind would possibly damage the country’s economic powerhouse by taxing its workers unless they absolutely positively had to? Well, let’s just see how together we all are:

  Revenue (millions) Operating profit (millions) Earnings per share
FirstGroup 6,678.7 (6,416.7) 428.5 (456.7) 42.7p (20.0p)
Stagecoach 2,590.7 (2,398.8) 237.7 (240.2) 25.4p (23.8p)
National Express 934.1 (1,118.9) 105.5 (117.6) 12.6p (14.1p)
  • Figures in brackets are for 2011, the previous year
  • Figures are for full group, not just rail
  • All operator names link to their 2012 annual reports, the source of this data
  • Check the figures yourself just in case I babooned the typing

In case you didn’t know, Stagecoach owns 49% of Virgin Trains with Virgin owning the other 51%.

Hmm. I see. Clearly the shareholders will be cracking open the non-generic fizzy white wine. What about salaries? Well, the CEO of First Group, Tim O’Toole received a £846,000 salary with £134,000 pension allowance and some £75,000 of benefits in kind for 2012. The boss of Stagecoach, Sir Brian Souter, received, I am sure you’ll agree, a far more reasonable £581,000 with an insywinsy £187,000 cash bonus for performance and just £23,000 in benefits in kind. It’s clear that they really are suffering alongside us. Indeed, that’s the sort of financial suffering that forces one to fire one’s butler, restrict the helicopter to weekends and stop wiping one’s arse with the hopes and dreams of one’s customers.

The really, really galling part of this is the nature with which the country’s railways were privatised. Perhaps someone can explain to me how an exclusive franchising model rather than non-exclusive licensing model can possibly incentivise companies to provide a better service? All privatisation achieved, it would appear, is to go from a state monopoly to regional monopolies with the former at least pooling buying power, engineering and knowledge to gain a half-decent economy of scale rather than syphoning too much into their own back pockets. Furthermore, having your regional monopoly guaranteed for a generous chunk of years and with no real startup costs (trains are leased so just a smart, or in some cases, utterly shite, paint job will usually do it) it is rather challenging to see how market forces and customer choice can make even the slightest fuck of a difference. And I was using binoculars. Good ones. Railtrack (just look it up and weep and if you can’t be arsed, just view Private Eye’s covers on the subject) turned out to be, from a casual observer’s perspective, an exercise in mates cashing in and the likes of First Group and Stagecoach have pretty much helped themselves to the country’s money at its peoples’ expense. So thanks, Mr Roberts, for wheeling yourself onto TV and doing your disinterested Dr Evil impression to show us all how much those you represent are taking us for a ride, albeit probably not in a seat on an air-conditioned train.

“We pay lot of taxes; we pay them in the legally prescribed ways,” [Schmidt] told Bloomberg. “I am very proud of the structure that we set up. We did it based on the incentives that the governments offered us to operate. It’s called capitalism. We are proudly capitalistic. I’m not confused about this.”
Eric Schmidt, Google’s Executive Chairman, explains capitalism to us little people who are not in the luxurious position of running our earnings through offshore accounts for tax reasons

There are not that many people who’d pick up a wallet stuffed with a cash and take it to lost property. From that point of view – and that point of view alone – it’s possible to understand the operator’s side of things, even though as a passenger I have to be blind drunk to see it. They are, after all, doing exactly what they should do as businesses: looking after the stakeholders that matter. Given that the customers are handcuffed to the service, they can be safely ignored and the investment that would need to be applied in order to keep said customers in any ordinary situation where competition and market forces applied can go straight to the shareholders. Cha-ching, job’s a good’un. It would appear the only area of capitalism that they could polish up on for 2013 is the wholesale avoidance of paying corporation tax that our friends Starbucks, Google, Apple and Amazon are so jolly good at. In fact, the Ritz hotel has managed to avoid paying any corporation tax for 17 years! (but it’s all legal, so it’s ok, right? Way to drink the spirit of the tax law and leave us with the urine, chaps!)

Just how little a fuck is apparently given shows that the licences to print money that are issued by the government have, it would seem, virtually no passenger benefiting requirements or conditions whatsoever. Oh, and they come with a bonus ability of being able to simply walk away if it doesn’t turn out to be profitable enough (National Express, for example). I’d love to know who in the halls of power benefits from this arrangement to the extent that it is allowed to continue. Like so many commuters, I look forwards to lining the operators’ wallets with additional gold from January whilst the service collapses around me.

State of the art weekend trains preparing to zoom along the iron road to London.

The latest soap opera of festering pus is the argument over which flock of selfish baboons is going to run the country’s west coast mainline: the current thoroughly bailed out flexible promise makers, Virgin Trains, or the shareholder’s favourite cut-back kings First Group. Make no mistake, neither Branson – everyone’s favourite bearded hypocrite – nor Tim O’Toole at First Group give a flying flock of pigeons about delivering customer service or value for money to the taxpayers. They are fighting this battle to see whether evil tweedle dee or evil tweedle dum gets the chance to make a metric shit-load of cash over the coming 15 years with virtually no risk attached. It’s difficult to know who to back when it’s a choice between paying for a kick in the arse or a punch in the face. No competition and easy escape routes maketh a wonderful business opportunity. So far, that rolling car crash of incompetence by everyone involved has cost us, the taxpayers, 40 million but apparently, that’s the tip of the iceberg. In the meanwhile, Virgin, who said they’d run the service for free for a bit whilst this was sorted out, have stopped mentioning the ‘free’ bit now that they’ve secured a two year extension whilst this farce/disaster (delete as applicable, if applicable) is “resolved”. Wonderful! Virgin’s only redeeming gold star appears to be that if they’d not made their self-benefitting fuss in the first place, one wonders if any of this would have come to light at all.

First Capital Connect's 2012 service changes announcement

Last year’s announcement about 2012 service changes. Click for a slight embiggening. Commuters are at the edge of their seats with anticipation about what’s in store for 2013!

Even the most casual armchair general can make a good case to suggest that the railways are broken. Operators can simply make up promises to win the franchises, wring them dry and then walk away having failed to deliver what was a gargantuan task in pushing square pegs through round holes. Customers have no choice and that’s the way the operators like it: commuters have to take the train as they have no viable alternatives. There is neither an incentive nor a desire to run a top-quality customer focussed train service as the operators’ shareholders do not benefit. You’re going to get the train anyway, so why improve the service with new, faster trains? Hell, why even fix all the bits falling off the existing ones? They can dress up their investment in as many fancy clothes as they like but as the trains get older, the replacement bus service more extensive and the network falls down with increasing regularity, the theatre they put on becomes increasingly less plausible no matter how much one squints when looking at it. But the operators and their trade association are alright, though, eh? As Private Eye would no doubt say, if they haven’t already on several occasions, triples all round.

Minor update: of course, my second favourite web site, The Daily Mash, summed it all up so much better than I do when satirically addressing 2013’s unreasonable price rises. The commuters’ best mate Mr Roberts from ATOC, on the other hand, was available to point out that it was everyone else’s fault other than those he represented.
Also: Friend of mine found this which is worth a read for anyone travelling on First Capital Connect’s trains

Posted in Armchair general, Rants | Tagged , , | Comments Off on Duh duh duh. Duh duh duh. Duh duh duh

Top secret big nuts

For top secret work1 reasons I am learning a touch of C# at the moment. Normally, because it’s a Microsoft technology, you’d expect any knowledge you acquire to be transient due to their merciless and comprehensive deprecation strategy. This, as we all know, is a symptom of their chronic – and tragic – case of Shiny Box Syndrome. Shiny Box Syndrome is where the next great thing takes the current great thing out back and blows its brains out before leaving its decomposing body as a stark warning to those developers who’ve not yet had their knowledge and book collection wiped put before it even had a chance to gather dust. Still, long sentences aside, at least one can still shed tears of remembrance editing old Wikipedia articles. Oh, and the books, assuming that you’re stuck in the paper past2 like me, are great for propping up wobbly tables. You can also make a cracking set of stairs out of them for toddlers to climb onto tables, it turns out. Classic ASP, DirectX Reference and old Petzold books are all conveniently about step-size for little people.

A badly drawn giraffe, a book and a box!

Good grief. My artwork just gets worse and worse. Here is a book, a giraffe and a secret box containing secret things. Only the giraffe knows what’s in it and you don’t speak giraffe. Unlucky.

Shiny Box Syndrome occasionally spills through to the end-user with classics like everyone’s favourite, the Ribbon UI. With that, they made everything you knew about operating Microsoft products virtually worthless and at the same time introduced a UI that took so much of the average laptop’s screen height that you could barely fit “Dear Sir” into Microsoft Word before you needed to scroll the page. The coup de grâce, with Ribbon, though, was the way that it configured itself to move all the things you needed and wanted out of the way to places where they cannot be found. Ever. They called this “context sensitivity”. Genius.

Anyhoo, I digress and I am trying to have a more positive, cheery, up-beat attitude, despite the best efforts of the train, bus and telecommunications providers. C# seems to differ from a lot of Microsoft’s here-today-gone-tomorrow technologies in that it is actually a real standard and it’s used by all sorts of people! It’s also super-duper easy to learn for C++ programmers:

“Write C++ without pointers. If that doesn’t compile, replace ‘&’s with “ref” and check you’ve not put brackets on a property (e.g., myArray.Length() isn’t correct!) Still stuck? Simply ask Uncle Google to point you at the appropriate MSDN or Stack Overflow article that’ll correct your slight syntactical issue. Jobbus Dunnus.”

Despite the preconceptions I went in with, I quite like C# so far. It’s neat. Tidy. Safe. Not over-verbose. It’s like Java’s sexy sister who has Newton thoroughly puzzled. Oh, and it’s really quite a powerful programming language. However, the Internet, as we all know, contains too much material that’s even less useful than a Young Earth Creationalist’s account of human history. One tutorial, for example, contained so many “goto” statements in just one example function that I almost cried in despair. You need a licence to drive a car but having children and writing a tutorial for something you don’t fucking understand on the Internet are both free of restrictions. Great stuff. Thus, to help me when Stack Overflow is unavailable because my BT HomeHub has crashed again, I felt a damn good book was required. We all picked “C# 5.0: IN A NUTSHELL”. This book is huge. You can see it to scale with a poorly drawn giraffe and a container full of top-secret things above to get a feel for its size.

Coco de Mer

My goodness, it’s big enough to fit a C# book in, perhaps two!!

My friend and I were curious as to exactly what kind of nutshell this book was actually in having never seen a nut of sufficient magnitude before. Even more curiously, we were sober when we posed this question to ourselves. This book is, after all, big enough to beat people to death with and consists of well more than a thousand pages. And the font is small. Anyway, he used the internetamatubes and came up with the answer! Yes folks, it’s the Coco de Mer! Or, in a non-French version, the sea coconut. Wikipedia also claims it’s called a “love nut” but although I can see the resemblance with a heart if I squint, I’m sceptical that this isn’t just one of those “creative edits” we sometimes see and love. Also, of course, I simply can’t be bothered to do further research to confirm for sure, so we’ll share the mystery together.


Well, nut-fans, we’ll sign off with an exciting Coco de Mer fact care of our chums at Wikipedia: The largest one found was over 50 centimetres in diameter and weighed 42KG. This is large enough to contain several C# 5.0: IN A NUTSHELL books thus proving the title’s accuracy for at least a few more editions.


1 My work is, quite obviously, computer related. Someone I once worked for, who felt that paying things like “people” and “tax” are optional extras of being in business, apparently recently suggested I was in the potato slicing, chipping and serving business. His sources are awful and probably in jest. Mine, it appears, are now BBQ, tartare, tomato and vinegar.

2 In an ode to the 21st century, I finally purchased my first e-book the other day. I was talked into getting Hugh Howey’sI, Zombie”. Wool, his previous book, is perhaps one of the greatest science fiction books of the century. “I, Zombie” reflects this quality of writing by striking almost constant horror into depths of your brain you were not sure you had. Be warned.

Posted in Miscellaneous rubbish | Tagged , , , , , | 2 Comments

Rollin’ contracts rollin’… Until the END OF TIME ITSELF

O2, stealing my money, yesterday

O2, sneaking off with my money AGAIN, yesterday. And probably tomorrow.

We’ve all laughed and giggled at pictures of those people on TV queueing on launch day for some device or another. Well, back in May 2010, I was those people. At 7AM (and this was pre-baby cobra, so 7AM was an outrageous time in the morning) there I was waiting patiently in line for an iPad 1.

Apple were awesome: they walked the queues and asked everyone which device they wanted in order to assure everyone that they were not waiting in vain. Furthermore, they fed us croissants, pain au chocolats and water as well as taking pictures and encouraging a friendly, cheery atmosphere. They topped off the anticipation by letting us all touch and feel the fondle-slabs that we were about to purchase and showed off all the groovy things that they could do. For the walking dead, e.g., me, this was a welcome gift. In less than a Martian jiffy, everyone was socialising, chatting and generally soaking in what turned out to be a wonderfully memorable experience.

I picked the 32GB version with 3G. I picked 3G because I wanted it to work when travelling and those meanies at O2 didn’t allow tethering of my iPhone without jail breaking it and I wasn’t prepared to do that. Also, I liked the idea of being able to use it independently of a phone so talked myself into the 3G model. Because O2 hadn’t given me any real problems with the phone I thought, yeah, why not – I will get their rolling one month data contract. Saucesomeness!

And that was how it was until two years later. I enjoyed every little bit of the original iPad and today it still serves as a Spongebob Squarepants viewing device for the baby cobra, without which, I am sure Mrs Cobras and I would find parenting at least nine levels more difficult. This year, though, with the word processor on the iPad grinding to a halt and crashing all the time due to lack of memory I came to the conclusion that via the medium of software updates it had been upgraded to obsolescence. Having drooled over an iPad 3, or “New iPad” as they chose to call it for some baffling reason, I decided to take the plunge. Oh yeah, it was mine, all mine!

Wait, where’s my data gone?

I checked with my chums at O2 and they said “yes, just take the SIM out of the iPad 1 slide it into the new device and in three shakes of a baby rattlesnake’s tail you’ll be surfing the Internet like a teenager searching for pictures of boobs”. So I did, but without the boobs. And it sort of worked. But not quite. It kept cutting out with outstandingly inaccurate messages like “No data remaining” when I had over 3GB, or “Data roaming not enabled” when I was here in my house. I tried the usual jazz like taking the SIM card out, cleaning the contacts, putting it back and so forth but alas, a reliable data connection I could not get.

Eventually, I popped into the O2 store and they fed me some bollocks (from their poor man’s Genius Bar rip off, the O2 “gurus”) about the widget’s flux capacitor not being connected to the rear electron plasmasope which, somehow, meant I needed a new SIM. No worries, though, he could do that right now here at the store and all would be good. That, it turns out, was incorrect. According to the many, many hours of phone conversations I endured from April to August this year, one thing O2 and I can agree on: iPad rolling contracts cannot have a SIM transfer. A new SIM requires one contract to be cancelled and a new one to be started.

So, after a further couple of weeks of shenanigans a contract switcheroo was what I did back in the O2 store. I remember asking this question: “the accounts are an email address: will there be any issues if I use the same email address that I used for the previous account?”. “No”, he said, “that will be fine”. Of course, by “no” he meant “yes”. Everything was pretty much tits up from then in. Sometimes I had data, other times I did not. It always seemed to depend on the day, the place and the weather. I tried various APN settings and managed to establish that depending on my geographic location and the APN settings I may or may not be able to get some data services. In fact, it was ALMOST AS IF I HAD TWO ACCOUNTS, and the O2 data details and cell towers were accessing one or the other. If they accessed the old one, data would not work (for cancelled, it was) and if it accessed the new one data would work (for paying for it, I am). Of course, on the train to London, this was hilarious. I could just about keep a data connection going by changing the APN settings twenty or thirty times, but basically, the whole thing was fucked and it was time to bail out.

I spoke to O2 again. They said it was Apple’s fault.

I spoke to Apple. They did a complete device diagnostic for me there and then. No, they said, this device is in tip top condition. It’s O2.

So I rang O2 again and for the first time I spoke to someone who gave the impression of giving a rat’s arse. He called me back so I wasn’t paying for it and for the next hour or two we worked through everything. In the end we concluded that two unfortunate things were providing the foundations for these issues:

  1. the SIM transfer back in April and
  2. the reused account email

I said I would try a one month Three SIM to confirm the device was really fine and if that worked I would have to cancel the O2 account because that part seems unfixable. He was super sympathetic and said “no problems, I will make a note of all this on your account so that it can be promptly sorted for you and if you do have to cancel we will refund these months where you have not been able to use it”. I was grateful that, at last, someone competent had worked with me even though, all in, this had taken a good day of my life that I would never, ever get back.

Oh well, it was a good run, but time to cut loose

The Three SIM was fine, of course. I called O2 back. What? NO NOTE on my account, you say? How about on the previous account? Nope. Right, well… and I explained the whole sorry affair. The bloke I was speaking to was irritable, rude and generally treating me like a fuckwit of the highest order despite me being amazingly calm and polite given the pigeons’s bumstack that O2 had made of this so far. Part of the conversation went like this:

“I cannot cancel your account over the phone. You must do it on the device.”

“I can’t. The SIM card doesn’t work.”

“Look, just go to settings…”

“… sorry to interrupt, but I can’t. There isn’t an O2 SIM in the device. it’s a Three SIM.”

“Well, put the SIM card back in”

“I know you’re frustrated by me, but as I have explained, I can’t. The SIM card doesn’t work.”

After we had gone around and around he went to speak to his manager, take a smoke break or have a crap or whatever it was he did for a few minutes and came back with a completely new attitude. Perhaps he had discovered that his call was being recorded for training purposes or maybe he just had a change of heart and decided to push the boat out and provide some customer service. We’ll never know. Either way, he was mysteriously suddenly able to cancel the account after all and refunded me the money for the previous two months. He then apologised and said that he dearly hoped that the experience that I had had not tarnished my views on O2 too much. I thanked him for helping and said “well, I am happy with you guys on the iPhone, so it can’t be that bad, eh?”

So the whole sorry affair was over:

O2 refunds and charges

Awesome! Refunds for the two months, job done, case closed, Columbo can go home.

Uh oh, what’s that on my credit card bill at the end of July alongside the earlier refunds? Let’s take a little peek:

Just keep on charging, chaps!

They mostly charge at night. Mostly.

I was furious. British furious, but furious nonetheless. So I used my massive Twitter following of seven to vent my frustration. I also spoke to an online helper at O2‘s web site who worked through the problem and assured me that, this time, it was cancelled and the payment refunded. And, as you can see from the statement above, billed on the 4th, refunded on the 13th. O2 tweeted me back to see if all was good and I said that, so far, it was… but we’d see at the end of August.

The never-ending olympic billathon!

And guess what arrived in my mailbox the other day. Go on. You never will.


Billed again. I didn’t believe it. I actually had to check with the credit card company just to be sure. Don’t you love the bit where Martin Bould, and I paraphrase for brevity, says “just to say thank-you, I’ve given you some fucking data you can’t bloody use because your SIM card is broken which is why you’ve cancelled your account more than once recently.” I’ve gone from annoyed through fifty shades of angry to bloody furious. STOP STEALING MY MONEY.

So, O2, I do not know what to do. Each month from April you have effectively stolen a tenner of my money for a service I cannot get. I have been lied to, it would appear, by everyone. Even those that gave the impression of trying to sincerely help have achieved nothing. The refunds have long since got cancelled out by the costs of calling you on the phone and I am at least a day down dealing with this. How can I stop this? CAN I stop this?

Still, on the bright side, my ‘phone contract is up and Apple squeezed out the underwhelming iPhone 5 so if nothing else, I can – for once – do something un-British and actually vote with my feet and quit O2 entirely rather than just moaning about it… I just wonder how long they’ll keep billing me for that, too.

Every cloud? Grass? Greener?

It pains me to even consider moving to a network so cheesily named as Everything Everywhere with their bloody awful 1950s peanut style logo in order to sample the five square metres that one is going to be able to access 4G in this country, so maybe it’s time to think about returning to Vodafone. Perhaps a comforting bottle of castle nine popes will help. Honestly, it feels like choosing a franchisee for the West Coast Mainline, I’m going to lose regardless but what’s the worst that can happen?

I’ll keep you, my reader, updated on this rolling train wreck but I truly expect to – literally – be still be dealing with this at Christmas.

Help me, Internet Publicity Wan Kenobi, you’re my only hope.

Well, the credit card company for this card are awesome: they, it appears, are able to do what O2 can’t do. Let’s see! Oooooo, the excitement!

Posted in Rants | Tagged , , , , , , , | 2 Comments

Aliens… from Mars

“♫ So remember, when you’re feeling very small and insecure,
How amazingly unlikely is your birth, ♬
♪ And pray that there’s intelligent life somewhere up in space,
‘Cause there’s bugger all down here on Earth. ♬♩”
– Eric Idle, the Galaxy Song, from The Meaning of Life

The chances are that you’ve heard of SETI: Search for Extra-Terresterial Intelligence. It’s a poorly funded exercise in pointing radio telescopes of various kinds into the sky and seeing if there is any evidence of intelligent life. Not just life, which, frankly, is likely to be everywhere, but intelligent life.

Intelligence to human levels, where we’re able to adapt environments, develop language and wipe ourselves out, has only ever happened once in over 3.7 billion years of life on earth. That makes it quite special. We weren’t created, we weren’t engineered: the journey towards humanity was simply the result of a lot of false starts, shed-loads of time and some incredibly fortuitous situations. In our case, evolution won.

The sheer size of the universe means that the chance of humans existing as a lone beacon of intelligence is remote. As we’re getting smarter, we’re finding more and more planets of varying sizes in different configurations. If there’s one thing astronomers have learned in the last couple of decades, it’s this: the galaxy is swarming in planets. Our solar system is far from unique and indeed only covers a microscopic range of the possible configurations of planets. If there’s one thing astrobiologists have discovered in the last few decades it’s this: life is less fussy about where it appears than we thought. Life, it would seem, is an inevitable consequence of the “right conditions” and those conditions are wider and less strict than we imagined.

Alien Worlds found so far care of XKCD

For the full-scale version of this wonderful image from XKCD, click here. Honestly, you want to. It’s amazing.

Whilst our telescopes are not good enough to see enough of the right sort of alien worlds to actually visually (or chemically) detect evidence of life, they will be pretty soon so long as we don’t retreat into the middle ages in the meanwhile. Intelligent life, though, is harder to find. Let’s examine why.

Intelligent humans in homosapien form have been on Earth for about 250,000 years. That’s 0.0000676% of the time that life has existed on this planet or 0.00001701% of all of time so far since the universe began. Of that quarter of a million years, we’ve only been emitting detectable evidence of our existence as an intelligence for a hundred and fifty or so years; just 0.001% of our time on earth. We’ve done this in two obvious ways:

  1. We’ve screwed with the atmospheric composition. Should we all drop dead this afternoon, it’ll change pretty quickly. In the meanwhile, the fact that it’s changing at all as fast as it in the ways that is is would look “un-natural” to external observers scrutinising Earth from afar.
  2. We’ve been broadcasting our existence in the form of radio and the such. We’ve lit up the EM spectrum like a Christmas tree and this can be detected a long time ago from a galaxy far, far away.

The three eyed Leedle Loodle

The giraffe-like three-eyed Leedle Loodle of Loudlezzarr 5. Incredibly intelligent all-round nice aliens.

So that’s a 150 year window in 3.7 billion years that our existence as an intelligence has been something the three eyed Leedle Loodles from Loudlezzarr 5 have been able to detect us. There’s a catch though. What would Earth’s earliest radio receivers have made of modern transmissions? Encrypted, compressed, digital transmissions? Would they simply have looked like random noise? Probably. As our technology advances, the way we communicate changes beyond recognition from generation to generation. With future spookiness like quantum entanglement or some other thing with the word quantum involved, the window of simply pointing telescopes in the sky and detecting other civilisations from their electromagnetic radiation is probably only a couple of hundred years wide for every intelligent race. That broadens the odds considerably: we might be washed in potential evidence that we simply can’t recognise.

Of course, thanks to the incredible unfurling discovery that the Milky Way is full of planets, we now have increasing numbers of targets to specifically point at. This helps, but with a galaxy full of 200 year windows of opportunity floating around, most of which are probably mere ghosts of civilisations long lost, it’s still going to be a tough find. On top of this our own window is only 150 light-years or so across only the tiniest teensiest fraction of the stars we see would have the faintest idea that there’s even a potential for us to exist.

The Universe: I thought I saw eyes

There’s another possibility, of course, that aliens simply don’t want to be found. Through the eyes of an alien civilisation, we’re undeniably dangerous. We’re top of the food chain on our planet by a wide margin and concepts like “animal rights” exist only because we choose to provide them. As someone once said, you can bet your most valuable organs that if tigers or pandas suddenly gained the ability to invent, improve and use firearms that any animal rights they might enjoy right now would vanish pretty fast. Alien life may take the same view about us: we have taken our own planet from each other with incredible force and violence. Some of the crimes we have perpetrated against ourselves in the name of something or another are, to an outside observer, good examples of exactly why we are not and may never be ready to join a larger community. Is a pre-emptive strike by a more advanced civilisation a wise move simply as an insurance policy against their own long-term survival? You know, nothing personal dudes, but just keeping the neighbourhood clean of nasty infections? Perhaps prancing loudly around the open plains of the galaxy isn’t necessarily a good idea if it’s full of hungry, watching leopards. If this is the case then, of course, it explains rather neatly why we have not heard anything1: they don’t want to be heard and the first thing we’ll know about it, albeit briefly, is a swarm of asteroids the size of small countries approaching Earth at near light-speed. But still, excuses excuses. It’s really easy to overlay exaggerated versions of our own worst personality traits and general lack of table manners to other intelligences and fear the worst; plausibly, given that one doesn’t reach the top of the food chain gathering around a camp fire, making daisy chains and singing songs.

Under every rock…

It does seem that with all this in mind, finding ET is a little like searching for a single germ called Bob who’s wearing a disguise and could be anywhere in the Atlantic ocean. SETI, therefore, seems – on the surface – to be a global lottery with incredibly poor odds.

Bob the disguised germ

Bob the e-coli here, wearing this bullet-proof disguise, will never be found

But we should still look.

Why? Because finding signs of intelligence other than ourselves changes everything. It’s the lottery where if SETI win, we all win. It is exceptionally unlikely that we’re alone in the universe but the sheer physics of the situation along with the breadth of time involved makes it hard to imagine finding anything beyond just evidence of intelligence: we may see the ruins of long lost ET but it’s highly unlikely we’ll simply pick up the blower to them. But the magnitude of what it does to us, as human beings, to discover that we’re not unique or alone could have a sobering effect that just might assist us in a) not blowing ourselves up, b) not reverting to medieval beliefs and c) reminding us that the biggest most exciting developments in our history have come from exploration. We’re explorers, not sofa-sitters. Our curiousity is what has driven us to achieve all the wondrous things that have made our lives more privileged than ever. I think of the discovery of alien intelligence as a quick whizz through the Total Perspective Vortex. Suddenly, briefly, we’ll get a glimpse of our place in a universe of wonders we’ve yet to find.

The majority will always find excuses not to look around the next corner. It’s too expensive. It’s pointless. It’s risky. We’ll find nothing. These people are not the pioneers of our future. In and amongst our insignificant race of bipedal creatures there are those whose curiousity is enough to lift up every rock just in case. Finding the occasional rattlesnake is a risk worth taking. Oh, and rattlesnakes. So long as our society doesn’t simply defer everything we don’t understand away to “magic fairies for grown-ups” then we’ll keep looking. I can’t wait.

In the meanwhile, fingers crossed for Mars Curiosity – due to touch down on Mars on the 5th August 2012 US time (6th August, 6:31AM, UK time – a good half hour after the alarm daughter goes off, so I should be glued to the set!). You should tune in. It’s exploration and the human spirit in action: risky, exciting and pushing the boundaries of what we understand about ourselves and the universe around us. May the force be with you, NASA!

Update, 6th August: Mars Curiosity made it. Hope you had a chance to watch it live, it was incredible. Nice work to all those at NASA – hopefully a new era of understanding, exploration and knowledge just got kicked off. Oh, of course, there were the inevitable Martian casualties

Update 10th August: This is fun: Simulating the vapourising of Earth to help know what to look for in Earth like exoplanets: what happens to ’em when you do bad things! We’re getting really quite smart at this stuff.

1 This is Fermi’s paradox: the universe is a big place, why have we not seen evidence of intelligence?

Posted in Miscellaneous rubbish, Space | Tagged , , , , , , , | Leave a comment

Tea, Earl Grey, Hot

“What can be palpably more absurd and ridiculous than the prospect held out of locomotives travelling twice as fast as stagecoaches?”
– member of the public, early 19th century England

In 1823, Robert Stephenson and Company was formed with the purpose of constructing steam locomotives. It was a tough ride. Horse breeders, stagecoach manufacturers, land owners and those that thought that speeds exceeding 20mph were a “sin against nature” fought tooth and nail to shit in the wheels of progress and delay the inevitable as long as possible. Instead of changing their businesses and attitudes to work with the unfolding of new technologies they decided that the way they had always done business was the way that they should be allowed to do business forever. Needless to say, they ultimately failed. Of course, the only people to benefit from the iron road were absolutely bloody everyone else who had these benefits stalled, delayed and watered down for years by the minority self-interest brigade.

Germ Express: Stephenson's Rocket

An “artist’s” impression of Stephenson’s Rocket, still in use today pulling the First Capital “Connect” germ express from London to Cambridge, although it’ll terminate at Hitchen due to points failure.

If driving the wrong way down the motorway of development sounds familiar, it is because 1) the only thing we have learnt from history is that we learn nothing at all from history and 2) large chunks of the recording industry believes that the comfortable way they worked in the 50s and 60s should, by all rights, be bequeathed to them for all eternity. The digital age and then the Internet changed this forever and those changes are unstoppable, despite their best efforts. Instead of embracing the opportunity to discover new ways of doing business they decided to push square pegs into round holes in order to protect their artist-exploiting, creatively accounted backsides. Indeed, never before has a supposed moral high ground been so far below the sea level of public opinion.

Of course you can’t simply stop the tide from coming in by standing in its way and saying “no, you naughty ocean, stay back, I tell you, stay back!”. Now that the recording and movie industry has resorted to full-scale and staggeringly mis-proportioned legal attacks on their customers in order to protect the past you know that they’re screwed: you can’t push people off a cliff and sue them for falling off cliffs. The fuckwittery and self-destruction orchestrated by the likes of the MPAA and RIAA would be unbelievable if it wasn’t actually happening. The entertainment industry will look very different in a decade or two’s time and what’s left will be those that figured out how to embrace and flow with, rather than against, the world becoming a smaller place. The results will be great. At last! I’m pretty sure that the collateral damage will barely be a footnote in a Wikipedia article: I’ll eat my hat if the collective tears shed about the old way of doing things filled an egg-cup.

What’s that coming over the hill? Is it a printer?

I would humbly suggest that the next massive change in the way we live our lives will be 3D printers. They will transform so many aspects of pretty much everything we do, every day, that you’ll wonder how on earth we survived without them. The Internet is young and yet there are now two generations of people who simply can’t imagine how they’d function if it wasn’t there (good luck in the zombie apocalypse!). Furthermore, I’d assert that few people will see the revolution coming until it’s on top of them and then there will a period of twenty years or so when many businesses affected by 3D printers resort to litigation in order to protect themselves from what will ultimately be an absolute slaughtering.

So what is a 3D printer? Well, simply put, you feed it a data file describing a 3D shape and it prints that shape, layer by layer, out of some stuff. Let’s say you want a spare part for a machine, a goblin for a game of D&D or that missing part of Lego: print it. What if the stuff was chocolate or one of a bazillion other materials? What if they could print things made of several different materials in all sorts of colours? Right now, 3D printers are either fiddly, flimsy DIY jobs that have pioneered 3D printing for anyone with the patience to assemble the device or tremendously expensive industrial solutions. They have limitations on materials, complexity and performance. But they all have something in common: they’re amazingly awesome. Awesome. It is as close as we’ll get to having Star Trek teleporters and replicators without discovering a whole new branch of physics: you want something? Download the 3D model data and print it. Jobbus dunnus, as they didn’t say in Roman times.

Leaping into a future of 3D printer ubiquity is a little like extrapolating a Ryanair European wallet shakedown from the Wright Brother’s first wobbly flight. Like computers in the 70s, outside of business, it’s currently only the brave, patient, curious or rich that are able to use these devices. Rapid prototyping in industry will never be the same but, despite RepRaps and other such efforts, 3D printers are simply not ready for the consumer market. But they will be. At some point, someone Apple-like will make the user experience as smooth as the results of a freshly executed hot wax: material cartridges that plug and play, integrated 3D scanner, multiple nozzle heads and multi-material printing, bomb-proof user interface coupled with a wonderfully simple method of accessing models to print, etc. Prices are falling, new entrants to the market are making them look more accessible but it’ll be a while before the curtains to wide-spread adoption are able to be drawn back.

Protected with a wall of lawyers

You can probably imagine the destruction already. Anything that can easily be printed but is currently a stable of Business X or Business Y is at risk: and that includes everything from luxury chocolate Rabbit sellers through Airfix style plastic model makers all the way to the mega companies like Lego. Think about it for even the shortest while and you’ll realise just how many of the things you buy right now could simply be printed. Cups, cutlery, buttons, shot glasses, a complete chess set, coasters, ornaments, sex-toys (admit it, it crossed your mind, right?), plates, candles or, for you blokes that never wish to feel the touch of a woman as long as you live, extra scrabble ‘K’s for a game of Klingon Scrabble. 3D printers will become an appliance in your home: something you just take for granted, like an oven, telly, Internet connection, toaster or kettle.

The Cobra's 3D printer blue-prints

Blue-prints for the Cobramatic Süperbé Constructotron 2000: the 3D printer of the future

Those affected will have two solutions: 1) adapt or 2) die slowly in a rising sea of lawyers whilst their customers and revenue are stolen by others who understand that business models are generally transient properties of “now”. I predict a lot more “2” than “1” — and we’ll see the “2” losers cycle through the same, tedious anti-customer war that the entertainment industry has. DRM, for example. Shit schemes like Ultra Violet. Anti-piracy booklets and wrapping with everything that could be printed (the physical equivalent of the unskippable, soul-destroying rubbish that blights those of us that still buy DVDs and Blurays – as costed by Cliff Harris). We’ll endure deliberate “accidental” misinterpretations of laws to take down any web site offering 3D models for download that might look a bit like something someone has a copyright on if you squinted or slathered grease on your spectacles. Of course, there’ll be the hopeless efforts to convince you that you’re a criminal – even when you’re not – that gradually erode every possible avenue you have to live your life practically and still remain an honest customer. Finally, the “1”s tip the balance through innovative new business models, such as focussing on authenticity as a value added product extension, and the bright, new future demonstrates that survival of the fittest isn’t just confined to nature.

Then there are the new businesses that will be created. From the hardware to the materials to those supplying wonderful models of things you can print and all of the research and development that go into all of them. These are coupled with the business ideas that I simply can’t imagine at the moment that’ll be made possible with this technology. Those, though, will be for the entrepreneurs of tomorrow to discover.

3D printers are something special.

They’re a game-changer.

They’re coming. They’re coming in your lifetime.

Like the Internet, it’ll go from nerdspace to everyspace in the blink of an eye. Your children, who already think you lived in the era of the dinosaurs to have survived without mobile phones and Facebook, will be baffled as to how life took place without them.

Whilst you won’t be able to order a hot tea in the way Captain Picard did, there’s a generation of people around the corner who’ll grow up with technologies that are barely even science fiction today.

“Wine. Red. Room temperature.”

UPDATE: Oh my! Now THIS is what we’re talking about. Cubify: looks friendly, has cartridges for materials, easy to use. Found it today – the start of the revolution is now.

Posted in Cool stuff | Tagged , , , , , , | 9 Comments

Comfy sofa, STAT!

Celebreight is celebrating!

Celebreightions from the party eight!

You’d better sit down for this. Ok, here it is. I’m going to tell it to you straight, I owe you that. I won’t pussy-foot around, beat around the bush, procrastinate or generally dance around the issue. I am going to go in deep, now, and get to the point without any dilly dallying. Ok, here we go. Ready? Comfy? Could I get you a tea first? No? Right. Honestly, you’re not going to believe this. Set your face to stunned:

I have made some progress on my iPhone game.

Wooooaaah, there, careful, I did tell you to sit down. Not much progress, granted, but thanks to Baby Cobra sleep, a late train, being deserted by my train friends a couple of times (fine, they all had excuses, but I choose to feel deserted for dramatic effect) and an evening or two’s button pressing I have managed to fit in a staggering eight hours of progress. Yupperillo, that’s a day’s worth of achievement. The classic cobra-artist’s rendition of the Celebreight, to the right, is there to bang in just how magnificent this occasion is. It is, in fact, to a reasonable approximation, infinity times more progress than was made between May 2011 and the start of June 2012 so you can understand my excitement. Let’s run the numbers through the Progressatronic-6000 Deluxe Schedulometer and see what pops out:

Estimated total project duration: 4 months with a month’s contingency
Start date: March 2010
Total progress so far: Three weeks, 1 day
Total progress since last update: Eight hours!
Estimated completion date: Possibly inside my life-time!

I is lerrning fings

The progress has mainly been with the map editor. This is now pretty much finished. I had to make a lot of adjustments and I rewrote large chunks of it. It’s now slim, fast, reliable and is almost certainly in better health than I am. I learnt a lot, including:

  • OpenGL for the map editor was a poor choice. I used it because it got things going quickly: I had an OpenGL rendering engine for the game itself and it compiled and worked under OSX pretty much first time. I simply changed a few “UIxxx” classes to “NSxxx” and Bob’s my uncle. However, given I’m rendering some lines, circles, text and blocks in a non-performance sensitive 2D environment, OpenGL is massively over-complicated. It’s like ordering a fleet of taxis so that each of the items in my bag can be carried to the station separately. More on this in a bit.
  • C++ 11 is g-g-g-grrrrreat, but needs iOS 5 as a target. It’s amazing how quickly you get used to the little time-savers that C++ 11 offers you. I love the range based for-loops. I adore the little touches like auto (type inference) and scoped enums. std::initialiser_list makes me warm inside. The ability to delete the automatically generated things like copy constructors and what-nots from your classes to better help the compiler to help you not fuck things up by accident is sex on wheels. These features have seeped into my standard day-to-day programming and I feel naked (but not greased up) without them. Learning that I need to target my iPhone game at iOS 5 to use these features was a minor disappointment but won’t really have any impact given we’ll be on iOS 42.6 by the time I’m done.
  • If you need 0,0 at the top left, it’s easy. You need to do two things. One is add the one line of code I added in last month’s update and the other is to flip your NSImages that contain the stuff you’re rendering onto the NSView otherwise they render upside down. You do that like this:
    NSImage* blocksImage = [[NSImage alloc] initWithContentsOfFile:@"My_Awesome_Image"];	
    [blocksImage setFlipped:YES];

    This works in concert with NSView’s isFlipped { return YES; } jazzamatazz.

  • Sprite-sheets using NSImage are easy-peasy! Despite an uncharacteristically unhelpful answer on Stack Overflow1, it is easy to render sprites from an NSImage sprite sheet. Quite why anyone would even suggest cutting out the individual images perplexes me, but perhaps that individual enjoys making huge amounts of unnecessary work for themselves. Here’s some code that does it:
    // Target rect is the NSView screen position. Shrink 'targetBlockSize' to
    // do neat scaling:
    NSRect targetRect;
    targetRect.origin.x = x;
    targetRect.origin.y = y;
    targetRect.size.width = targetBlockSize;
    targetRect.size.height = targetBlockSize;
    // Source rect is on the sprite sheet. This assumes that the sheet is 8 x 8 of
    // 64 x 64 sprites. "blockIndex" is a 0 -> X index of which sprite we want.
    NSRect sourceRect;
    sourceRect.origin.x = (float)((blockIndex % 8) * 64);
    sourceRect.origin.y = (float)((blockIndex / 8) * 64);
    sourceRect.size.width = 64.0f;
    sourceRect.size.height = 64.0f;
    // Draw block and selection rectangle if required. *This* is the magic line:
    [blocksImage drawInRect:targetRect 
    if (blockIndex == (unsigned int)selectedBlockIndex)
    	// This just shows a yellow un-filled rectangle around the block that's the
    	// selected one:
    	[[NSColor yellowColor] setStroke];
    	targetRect.origin.x += 1.0f;
    	targetRect.origin.y += 1.0f;
    	targetRect.size.width -= 2.0f;
    	targetRect.size.height -= 2.0f;
    	[NSBezierPath strokeRect:targetRect];
    }	// if (this was the selected block)

    The magic there was done with NSImage’s drawInRect. You can also use this to scale the target – I use it in the editor to allow zoom and “small mode” for the map block choice. In a nutshell, it lets you take a rectangle of your choice out of your source NSImage and blit it to a target rectangle of your choice in your NSView. Nice, eh? Well, I thought it was.

  • Fat fingers are fat. Yeah, and that means yours too. When you press on the simulator, you do so with a mouse pointer. If you detect presses as being a touch down followed by a touch up with no dragging between the two, that code will work wonderfully in the simulator. On the device, however, your fingers are not as accurate. You need to have a threshold of movement that doesn’t count as a drag by still counts as a press. I realised this after friends trying my prototype on my iPhone had all sorts of difficulties. My “well, it works on the simulator” is not a helpful response and just leads to a conversation that ends with “are you saying my fingers are fat?”
  • Tags are great! If you have a whole stack of checkboxes, how do you tell them apart? Up until now I was either 1) linking an outlet to each control and doing the comparison to sender in a single IBAction or 2) have an IBAction for each button. On Win32, I’d have hidden an ID in GWL_USERDATA and avoided both of these pox riddled solutions. Turns out, of course, Cocoa has an equivalent but it’s called something different: the ‘tag’. You can set this in IB and read it in a single IBAction dispatcher with code like if (1 == [sender tag]) { yodel_continuously(); } I’m kicking myself for not knowing this before given how long I’ve been Cocoaing but better late than never.
  • Tool windows need to accept first mouse. The utility windows in the editor needed one click to activate and another to do something. This is an awful user experience in an editor, particularly with the block selection view. What I was missing was this little piece of code in the relevant views:
    -(BOOL)acceptsFirstMouse:(NSEvent *)theEvent
    	return (YES);

    With this, everything worked as I expected.

The net result of all this is something that looks pretty good. Here’s a poorly taken screenshot of a poorly designed level I was testing with recently:

Map Editor June 2012

I’m not quite ready to say what the game is all about or what it is called, but soon. Of course, with my two readers, it’s not as if I’m leaking anything substantial, it’s just a… thing.

Note the class-A program icon bottom left. I drew that. I’m so proud. EGADASI2 (pronounced ‘eggadassie’) as only I say after close to the LD50 of wine.

A cake was involved

The icing on the cake (oh, and I baked a cake. Not as good as this one but any cake is a win) with this update is that the levels in this editor can be now loaded and played in the game itself. The game code was a bit messy, which is not enormously surprising given how long ago the core of it was written and what I knew about Cocoa at the time, and I’ve had to spend some time chopping down the weeds before I can plant anything nice but they are playable. I’ve fixed some issues, tidied some bits and pieces and generally brushed away some code cobwebs in preparation for the remaining features.

What are the things left before I have an actual product I could possibly stick on the App Store? Quite a lot, unfortunately:

  • A whole stack of graphics. Mostly glue graphics: splash screens, menu panels, etc., but also some additional blocks and entities.
  • Some sound. I need some sound effects and perhaps the odd little jingle for start of level, end of level and the title screen.
  • Levels, lots of levels! I really need a good twenty levels to feel comfortable about having a first release. I have two so far. Yes, two. But at least I have a half decent editor now.
  • Some code. The engine needs bad guys code, parallax rejigging, game centre integration and a whole pile of little things. About three week’s worth of little things, in fact.

I don’t quite know how I’m going to get all this done given I can only really pay in roast dinners and wine these days. As delicious as they both are, they don’t pay people’s bills. I’m sure I’ll come up with something, though, and it does at least feel good to have made progress and to make an update that doesn’t involve a comprehensive package of excuses.


1 I must get around to creating an account there. Given how much time I spend on Stack Overflow and how important it has become it seems offish for me not to contribute on the rare occasion that I feel that I can.
2 Every Good Application Deserves A Splendid Icon

Posted in My iPhone game | Tagged , , , , , , , | Leave a comment

Which low hanging fruit are you?

Hungry low-hanging fruit eating snake

This fruit-eating snake is very hungry. He's also bone idle. Are your passwords low-hanging enough to fill his little snake tummy?

Unless you’re a hermit who lives in a pineapple under the sea, you’ve almost certainly read/heard about an unfortunate incident in recent days where hackers made off with over six million user accounts from Linked In. They broke in and copied the user account database. This database contains the hashed passwords. Linked In have contacted the FBI, but, hell, door-bolted-but-horse-left-years-ago. If you’re into this kind of stuff, then skip the next paragraph, otherwise for the benefit of nobody I shall briefly explain what things like hashing actually mean.

When you sign up for an account on a web service you will be asked for a password. What usually happens is that this password is ran through something called a “cryptographic hashing algorithm”. This is a one way process that converts your password into a fixed length “key” called a message digest or, more usually, a hash.

Here’s an example of the hash generated by the SHA-1 hashing algorithm for the password “snake”:


It is this, the hash, that is stored in the database. This means that your actual password is not stored anywhere, which is good. It is for this reason that most online services cannot tell you what your password is: the hashing process means that it is safe from prying eyes.

The problem is that people are generally outstandingly stupid when it comes to password selection. A disappointing percentage of people pick really, really shit passwords like “monkey”, “12345”, “password” or “password1234”. I did a couple of searches for the SHA-1 hashes of some common passwords and Uncle Google was typically turning out tens of thousands of results for each.

So if you were a hacker and you stole a database of SHA-1 password hashes you could hack a good 1 in 5 of them by simply searching against a list of pre-calculated hashes of the most common passwords. This is called a rainbow attack and there are rainbow databases consisting of hundreds of millions of hashes out there. Of course it also verifies quickly what sort of hash you’re dealing with.

The easiest way to defeat rainbow attacks is to salt the password before hashing it. This means that you prefix a magic string to the front of the user’s password after they’ve typed it in and before you hash it. Let’s say we had a salt of “CUTE_BOTTOMS”. The hash of our snake password now becomes:


It is completely different. It also means that if someone’s dictionary contains the word “snake” as a potential password, it won’t show up. Thus, salting a password is a fundamental part of basic security 101, i.e., it is standard practice.

(Update: It is worth noting, because I didn’t make it clear in the original text, that salting everyone’s password with the same salt is only a little bit helpful because once the salt is cracked through a brute force attack a rainbow table can be specifically generated which will be very fast at cracking a large majority of users with woefully poor passwords like these ones which were the top 25 used by Gawker users. Used correctly, every user’s salt will be different. With just one database-wide salt it’s like climbing a wall with a pile of ladders: the right tool for the job, but used laughably wrong)

An hour’s work on the train

Then there is the issue of computing power, or, rather, the wonderful fact that it has increased enormously. When algorithms like SHA-1 and another antique hashing system called MD5 were created computers were slow and the algorithms had not been mathematically analysed down to the fine details for possible weaknesses. In the time since their creation both MD5 then SHA-1 were revealed to have a variety of weaknesses that made them unsuitable for security purposes. MD5’s faults have been understood for nearly a decade and SHA-1 has been comprehensively broken for a few years. Furthermore, they’re damn quick to calculate. This opens the door to another way of cracking passwords: simply try every possible combination. Standard practice these days is to use salted SHA-2 hash varieties such as SHA-256, SHA-384 or SHA-512 (the numbers represent the digest size in binary digits; dividing by 4 will tell you how many characters the digest is represented with).

So whilst rattling through the countryside yesterday on a smooth, virtually silent, luxurious state-of-the-art British train1 I knocked out a quick program to exhaustively try every possible combination of password, hash it, and then compare it to a known hash and keep on trucking until it got a match. In a nutshell, my ancient three and a half year old MacBook Pro can crack pretty much any un-salted SHA-1 hashed six character password in the time it takes to get from Kings Cross to Hitchen, assuming none of the usual things go wrong with the journey. This is less than half an hour. It is worth noting that this software took less than an hour to write: it is utterly unoptimised. If I optimised it, I could easily double its performance. If I parallel processed it onto all available cores, then my dual core would double it again: instead of trying 1,400,000 combinations per second, that would mean I would be able to try over six million combinations per second. On a high-performance, quad-core modern computer with decent L1 caches we’re looking at an order of magnitude at least on top of that. The bottom line is that if your password 8 or fewer characters long, I can probably crack it in a few hours given the hash. So is it? Is there something you need to be doing right now?

$./CrackMyHash --hash-type sha1 --character-set lcalpha --crack-hash 
CrackMyHash 1.0 by Toby Simpson
(C) Copyright 2012 Toby Simpson, All Rights Reserved
For 'support', contact
Searching for [148627088915c721ccebb4c611b859031037e6ad], hashed using sha1
Using lower-case alpha character set (27 characters).
~1,318,965 attempts per second. 76,500,000 attempts so far, length is 5 characters

          Hash: [148627088915c721ccebb4c611b859031037e6ad]
     Hash type: sha1
Security grade: Pretty damn poor
      Attempts: 76,508,018
      Password: snake
    Time taken: 58 seconds

A bad news day

SHA-1 and MD5 are not recommended for use on any system and have not been for some time. It came as some surprise, therefore, to discover Linked In had used SHA-1. The real kicker, though, was that the silly noodles had not salted them. This is easy to verify: you simply search the stolen database for known SHA-1 hashes for words like “password”, “linked in”, “password1234”, “linkedin1234”, “qwertyuiop” and see if you get matches. If so, you’re in business. Rainbow the database to catch the common ones and then either employ the use of 10,000 computers you already own through malware or your mates to crack the others exhaustively. Remember: I wrote my little program in an hour, it’s crap, but it can still try over 1.3 million combinations per second. The software here by Benjamin Vernoux can try 200 million MD5 hashes per second by exploiting your graphics processor alongside the CPU with some nifty optimised code.

Let’s summarise what Linked In did wrong:

  1. Their security was lax enough to allow them to be broken into in the first place. Naughty, naughty. However, in their defence, the quantity and complexity of the software needed to run a service of Linked In’s magnitude is such that guaranteed security is simply impossible. Regardless of risk mitigation, occasionally, this will happen. However…
  2. They used an out-dated algorithm for hashing their passwords. SHA-1 is outdated, is vulnerable to various attacks and can be calculated fast enough to make brute force a valid attack technique
  3. They did not salt the passwords. Given that salting defeats a lot of user stupidity in password choice as well as knocking out rainbow attacks, this is a weird omission on their part

Others are not immune. Several other organisations managed to slide their bad news out at the same time to sneak under the clusterfuck that was Linked In’s piss-poor security practices. eHarmony, for example, and Last.FM (who, in a staggering celebration of the past, used MD5 hashes which are only marginally more secure than an open door) both announced that their user databases had been “borrowed” by hackers. The chances are reasonably high that whatever vulnerability was used to blow the doors down to Linked In also applies to other web sites using the same technology.

Then there are the O2s of this world. They store your password in plain text. And, if you forget it, they’ll simply email it to you. Email is so staggeringly insecure that it beggars belief. If you knew how many open machines your emails passed through on the way from A to B you’d probably be a lot more careful about what you said. That kind of fuckwittery is unforgivable, so expect to see their users trashed at some point in the near future.

So what?

Generally, people are lazy with passwords. They pick one or two short passwords and use them everywhere. By short, I mean anything shorter than 10 characters. Once the hackers have your password, they probably have the keys to your email, your Facebook account, your Twitter account and goodness knows what else. It is trivial to scam your friends or rob your PayPal or bank account after that. Because Linked In (and many others) use your e-mail address as your username, hackers don’t even need to get within telescope distance of Columbo to pillage their way across many people’s data and any assets that are exposed online.

What can you do to avoid this being a disaster for you in future? Should you cancel all your accounts with everyone, shut off the Internet and live in a tent in the middle of a field somewhere? Maybe, if that’s your thing, but it’s better to simply have realistic expectations of how good companies are at securing your personal data and follow some simple tips:

“Through 20 years of effort, we’ve successfully trained everyone to use passwords that are hard for humans to remember but easy for computers to guess.”
XKCD cartoon
  1. Use different passwords for all your major services
  2. Your email password should never be used for anything else. Ever
  3. Passwords should be either: at least ten characters long and include numbers and preferably symbols or a long passphrase that is meaningless to anyone but you. My password program can work a lot faster if I just say “hack alpha-numerical passwords” rather than “try every single character”
  4. Make any security question answers utter bollocks. It is trivial to find your mother’s maiden name, your birthday, your first pet, etc.
  5. Help yourself: don’t pick a password like r4%_gKU745@&, it’s just silly. Pick a phrase that means something to you and decorate it with numbers. “8 colonies of 400 e-colis on my desk” is a good example (as the caption to this XKCD cartoon says: “through 20 years of effort, we’ve successfully trained everyone to use passwords that are hard for humans to remember but easy for computers to guess”)
  6. Use the HTTPS (encrypted) gateway to your favourite services. Many sites support HTTPS but don’t enable it as default. Never log into Facebook anywhere other than Same for Twitter, HTTPS connections are encrypted

The bottom line is simply: “Don’t be a low hanging fruit”. If your password on Linked In was “Fisher folk are men who wear chunky jumpers” then a brute force hack would take more time than there is left in the universe for current hardware: hacking such a passphrase would require exploitation of faults in the SHA-1 algorithm. It’s also worth noting that my examples don’t contain numbers, punctuation or anything other than simple alphabetic characters. It’s still probably more secure than your password, eh? Remember: 26 letters in the alphabet x 2 = 52. +1 for the space = 53. 53 to the power of 45 (for the length of phrase) is a number much bigger than your shitty Casio scientific calculator can display.

Performance analysis

Raspberry Pi and Germs

Underneath the germs, weird plastic stuff, wires, hub and other assorted detritus is an actual Raspberry Pi

Out of curiousity, I ran my program on three computers: my ancient MacBook Pro, my friend’s nearly new MacBook Pro and his Raspberry Pi. Here are the rates at which we were able to attack a hash on all three platforms by hash type:

Platform SHA-1 SHA-256 SHA-512
Raspberry Pi 23,000 14,000 4,900
Old MacBook 1,400,000 900,000 680,000
New MacBook 2,050,000 1,230,000 900,000
We couldn’t figure out why the Pi version was so slow. It was probably a poorly configured compiler with no optimisation. It should really be faster than that, even with the lower specced hardware.

  • Rates are in attempts per second
  • No code is optimised other than compiler options
  • SHA-256 generates 64 character hash, SHA-512 generates 128 character hash
  • No code is operating in multi-threaded super-duper-parallelogramotastic mode

It’s worth a brief note about hacking rates. I touched on this above, but each and every character and character class you introduce into your password makes life a lot, lot harder for hackers. The below table shows how many attempts are required to crack 6, 8 or 10 character passwords depending on the variety of content making them up:

Mixture 6 character 8 character 10 character
Lower-case alphabetical (26) 308,915,776 208,827,064,576 141,167,095,653,376
Mixed-case alphabetical (52) 19,770,609,664 53,459,728,531,456 144,555,105,949,057,000
Mixed-case with numbers (62) 56,800,235,584 218,340,105,584,896 839,299,365,868,340,000
Alphanumeric with punctuation (> 96) 782,757,789,696 7,213,895,789,838,340 18,446,744,073,709,600,000

Make sure you take a long, long, hard look at the table above. The difference between brute forcing an 6 character and 8 character lower-case only password is the difference between 308 million and 208 billion attempts. Either way, they are small numbers in computing terms. However, that ten character alphanumeric with punctuation? That’s eighteen quintillion combinations. Make that twenty characters long and… well, you get the idea.

I made my program in three versions: Windows command line, OSX command line and Raspberry Pi Debian. If you fancy a copy due to morbid curiosity or whatever, drop me a line or leave a comment on this post along with your e-mail address and a good reason why you’re prepared to trust a perfect stranger’s code running on your machine and I’ll drop you an executable. The Pi one is a version behind (I’ve grooved up the Windows and OSX ones but my Pi hasn’t turned up yet2).

Obviously, if I send you my software, you use it at your own risk. To massage a quote from Frasier that is eminently suitable here, “at Cornell University they have an incredible piece of scientific equipment known as the Tunnelling Electron Microscope. Now, this microscope is so powerful that by firing electrons you can actually see images of the atom, the infinitesimally minute building blocks of our universe. If I were using that microscope right now, I still wouldn’t be able to locate the warranty that comes with this software.” If it works for you, that’s great! If it doesn’t, I’ll give you a full refund. I will, though, probably fix bugs that involve the software rather than the e-coli, salmonella and helicobacter pylori that seem to be infecting the Raspberry Pi.

Yey for germs!

1 And they say the art of sarcasm is lost
2 And when Mr Pi does turn up, I shall begin the adventure game assisted C++ tutorial. The first, code-free, design and discussion post is coming up soon!

PS: if you do get this code and try this and get a much better crack rate than me on SHA-1s, I’d be curious to know the results — please let me know!

Posted in Miscellaneous rubbish | Tagged , , , , , , , , , , | 2 Comments

The most anticipated post of 2012!

The tumbleweed of progress rolls on with determination

The tumbleweed of progress rolls on with determination and purpose

Yes, that’s right, let’s have a big hand for the iPhone game progress report! So, iPhone game, what have you been up to since we last had a non-excuse progress report over a year ago?

“Well, Mr Cobra, huge progress has been made. Whilst I don’t want to give away exactly what it is or how I did it, I’d like to show you the code that has been written in the last year”

Ok, well, this is exciting, actual code from the iPhone project itself and what’s more, a whole year’s worth! Let’s pull back the curtains of amazement and see what’s there:

- (BOOL)isFlipped
    return YES;

Incredible work, I’m sure you’ll agree. This masterpiece of programming ensures that the vertical scrollbar on the map editor isn’t upside down because I decided, for reasons that are known only to me, that I was going to treat the co-ordinate 0, 0 as top-left as opposed to bottom-left which is what the Mac really wants me to do. Still, nothing like pushing square pegs into round holes to make one’s life a smidgen more interesting.

So that’s another five minutes chopped off the overall schedule. Let’s see what that does to the scores on the doors since April 2011’s update:

Estimated total project duration: 4 months with a month’s contingency
Start date: March 2010
Total progress so far: Three weeks (15.0000000001%)
Total progress this year: Five minutes
Estimated completion date: Shortly after the Andromeda galaxy collides with our own Galaxy, the Milky Way, +/- π. (On the bright side, this could bring more customers!)

Since the last real update I did indeed engage an artist and I have indeed taken delivery of some graphics and they look stunning so some progress was made even if it wasn’t by me.

The current plan is to spend half an hour of train time and an hour of Baby-Cobra-Is-Asleep time in the evening each week for the next fortnight to see if I can get the map editor fully ship-shape: split view user interface, full loading and saving of the binary level file format, all the new graphics in it, ability to place the bad guys on each level and so forth. Honestly, it’s rapid progress like that which leads to the invention of teleporters, rocket packs and egg based nuclear fusion. Obviously Tesla’s Excuseomatic 4000 is idling away in the background ready to provide a really good reason why the above plan turns out to be a load of bollocks, but half the battle is deciding to do it and if I can decide to do it several times then all those halves should add up. Rock and roll, groovers, next stop the App Store where I plan on selling five, maybe SIX copies of my masterpiece!

Update: I’ve just realised that I’ve been “working” on this game for well over two years now. One line of actual code in half a year is bloody shoddy. By the time I finish it, it will be out of fashion and dated. So I’ll release it with tag lines like “classic gameplay” and “relive your gaming youth” which should do it, eh?

Posted in My iPhone game | Tagged , , , , | 1 Comment

P P P Pick up a patent (portfolio)

“If people had understood how patents would be granted when most of today’s ideas were invented, and had taken out patents, the industry would be at a complete standstill today.”
– Bill Gates, Challenges and Strategy Memo, 16 May 1991

“[…] It was a cold war, stockpiling patents instead of nuclear arms, and every company in the valley had a bunker full of them.”
Andy Baio, who sold to Yahoo!

Maybe you’ve heard about the whole Patent Troll thing. If not, allow me to illuminate you with a poor man’s abstract of what’s going down. I won’t name names just in case one of the leeches has a patent on “a method for naming names and then having a good old moan about those names”. A patent troll doesn’t actually invent anything. Instead, they buy up patents from other people, preferably broad obvious ones issued by the USPO, and then sue the fucking socks off anyone they can in courts that are particularly friendly to this kind of insidious lawsuit (east Texas, I’m looking at you). In many cases their ownership is obfuscated to prevent anyone from easily figuring out who’s ultimately pulling the strings and making the money and they’re a fantastic tax avoidance wheeze, apparently.

Patent Troll: artwork at its... strangest

A patent troll, yesterday: Acquire, weaponise, sue.
(Any resemblance to a Gruffalo is strictly coincidental)

The waters are muddied by the fact that many of these patents are wide-ranging, broad and “bloody obvious” rather than the specific, legitimate inventions that the patent system was created to protect. There are so many of them, particularly in software, that no human being – especially the little guys – can possibly hope to check the entire smorgasbord for potential infringements. It has got to the stage that regardless of intent, it is getting harder to innovate anywhere without accidentally infringing on someone’s so-called “invention”.

Here is how it worked in one recent case. You, a small individual developer are sued: defend in court or pay a fee to make the problem go away1. You cannot afford lawyers. Thus, you must cave wholesale because in the absence of being able to defend yourself adequately you may may end up losing whether you are right or wrong. The patent troll goes for hundreds of individuals knowing that most will surrender without a fight making the process a licence to print money. Each settlement comes with an NDA so the whole thing is neatly kept quiet. Larger companies will often simply settle because it is cheaper to do so than it is to defend, regardless of whether they believe that they have infringed or not. The patent isn’t tested and each person paying up just supports the process further. Without vast quantities of cash and superb lawyers, it is simply not worth defending because should you lose, you will have to pay the legal costs. They have expensive lawyers. Your life is now over. This is not about right or wrong. It is about one of the dark sides of capitalism, full-stop. It is sad that we tolerate this suffocation of ideas in our daily lives. Needless to say, I do not believe this to be a case of protecting innovation, it is simple legalised extortion.

“The only thing holding back this form of innovation is the billion dollar price of patents these days. This speaks miles to the power of getting the tools of innovation into the hands of many and the sad state of our current patent system. The only thing that holds back the next Steve Jobs is being sued by the company started by the late Steve Jobs.”
– Jim Zemlin

Other than holding innocent individuals upside down and shaking them until their pockets are empty, another terrifying development that is set to affect the future of all technology development is the lawsuit war that is in full swing in the smartphone market. These days, all I seem to read about is who is plotting injunctions against who over some broad bloody obvious patent that has more prior art than shitting and eating. Quite why the US patent office, in particular, seem to be asleep at the wheel whilst this patent land-grab is taking place is anyone’s guess but we will all be paying the price for decades to come for allowing corporations to engage in this global fight to the death. The front line is the cutting edge of innovation and the only winner is the legal profession who are collecting enough cash to sink five battleships before breakfast and then sink the breakfast, which is a shame, because it involved bacon and I like bacon.

An effective patent system is, I believe, a fundamental cornerstone of a free-market economy’s long-term viability and growth. Research is risky. It takes time and money and does not always deliver results. Without a mechanism for protecting the intellectual properties that result there is little incentive to invent and innovate and economic development is dragged to a snail’s pace. The key word, though, was effective. The granting of questionable patents and a new business model that revolves around accumulating and enforcing a portfolio of them is not what IP protection law was created to achieve. It was created to nurture an environment of invention and innovation over mere exploitation.

Still, none of this affects you, right? Firstly, it might in ways you cannot imagine: the guy or girl in their bedroom plotting something wonderful that could transform your life could very well have it murdered before it is born. But you will never know about that, so who cares? Storm in a teacup, eh? Well, I would have drawn a storm in a teacup so that you can see just how serious it can be but it’s much harder than simply talking about it. So I didn’t. But in the meanwhile, I urge you to read this. It is a work of fiction that could very well represent just how miserable our daily lives might become in a precious few years from now.

Alongside ambulance chasers, payday loan companies and First Capital Connect, there is a special place in hell reserved for the people perpetrating these fights. When the threat of lawsuits sucks the will to innovate, invent, discover and create out of the world then it will be a poorer place. The patent system is broken. It is being exploited five ways to Sunday for shady revenue generation. When we are spending more time litigating than innovating, our focus is clearly on the wrong ‘ting.

(Update: The patent trolls don’t always win. I found this TED talk after writing this article. It is super-fun to watch.)

1 It’s not dissimilar to the scam operated by some law firms going after possible file-sharers. Enjoy Bob Reid’s TED talk for a fine commentary on that particular situation.

Posted in Armchair general, Rants | Tagged , , , | 4 Comments