All-Out Class War

Alice is retiring from her esteemed career at the department of hypothetical cryptography. Whilst she wishes to concentrate on simpler things she would prefer to keep in touch with her colleague Bob with whom she shared many a meaningless – and variably authenticated – conversation. Having left her interest in asymmetric keys and MACs back with her job, Alice would prefer not to worry about constructing her messages to Bob herself, so she employs Charlie to handle their assembly for her. Charlie is skilled in the art of passing messages to Alice, but feels that actually constructing messages is outside of his responsibilities. With her agreement, Charlie decides to construct a message factory in Alice’s shed (which she affectionately named David). Thanks to Alice’s lucrative career, David is a rather magnificent expanding shed which will always have space to store more, with a hard upper limit defined by the size of Alice’s garden. Now, David the message factory is only really responsible for fulfilling requests for messages, so Charlie fills it with workers: Eve::Hello and Eve::SendMe100Pounds who will be responsible for constructing the messages themselves. Sadly, nothing is ever simple in the world of message writing; no two messages are ever the same and as such each requires a slightly different set of tools be available for its construction. Since the Eves would prefer to focus only on constructing messages, not collecting tools, each Eve is assigned an assistant Frank::Hello, Frank::SendMe100Pounds and so on. Of course, the Franks can’t be allowed to degrade the smooth running of the message factory whilst they gather tools for their respective Eves, so Alice purchases an additional magic shed to house the Franks: Gertrude, to be placed adjacent to David.

The message construction workflow is now perfect, but Alice still has concerns about security. She would like for her messages to be encrypted. Unfortunately, the Eves are not particularly knowledgeable when it comes to encrypting messages (though they may know a thing or two about decrypting them). Thankfully Alice is still in contact with her old colleague, Harriet, whom she asks to handle encryption of messages for her. Harriet agrees; she’s given a small work area near Gertrude and will encrypt any messages passed to her by the Eves so long as the messages are constructed according to a uniform interface which she can understand.

Finally Alice is able to send messages to Bob (or, at least, she is able have them constructed then send them with the help of her friends Ingrid, James, Katherine, Laura, Morgan::SimpleMessage, Morgan::MultiPacketMessage, Nathan and Oliver). Unfortunately she finds that, as the range of messages she wishes to send to Bob grows, so too must David and Gertrude – in order to house their Eves and Franks respectively. Alice’s garden quickly runs out of space for magical growing sheds and Alice is forced to come to an agreement with her neighbour to use their garden as extra shed space. Of course, the story doesn’t end here; David and Gertrude are sufficiently magical that they can grow infinitely so long as there is space to grow into. However, since they have been placed back to back, finding space for growth isn’t necessarily trivial. Each time one of them wants to grow they must move their entire contents to a new part of the garden first. Each time this happens, small collections of tools, temporary message storage cupboards – and, from time to time, factory workers who were accidentally erased from records and thus cannot be moved – are left behind. This miscellany of items left behind each time a factory grows means that previously-occupied regions of Alice’s garden are next to useless – ultimately, her additional garden space hasn’t increased her ability to produce a variety of messages all that much.

Resigning herself to a small set of trivial messages to send to Bob, Alice goes about utilising her message production line. What she finds is that, unfortunately, the throughput is far lower than she had expected. What she notices is that each time an Eve needs to encrypt a message, she has such a long walk to Harriet’s quarters that by the time she gets back to her own station within David she’s forgotten how to construct messages. Similarly, when they access the tools and message storage cupboards littered around the garden they experience the same effect. At first the Eves only need to quickly read the instructional text printed on their message construction equipment to re-acquaint themselves with the art of message construction. However, as the factories grow further and further away from Harriet’s desk the Eves are forced to look up parts of the process in large reference books and sometimes even require complete re-training.

Alice is furious. After months of effort she’s spent huge amounts of money developing a process which costs more per message produced than she hoped and doesn’t produce nearly as many messages as she had predicted or as fast as she’d have liked.
Alice asks Harriet if she can just encrypt some dictated messages. Harriet never wants to speak to Alice again. Alice is in debt to everyone within a three mile radius of her house. Bob has passed away.

(Separating) Dreams from Reality

I was kept awake last night by an image which has been etched into my head for the last few days. It’s an image of an impossible scenario in Minesweeper. Why this image refuses to leave my head I do not know, but I can at least take some solace in the fact that this image may at least be preferable to dreaming.
I don’t often remember what I’ve dreamt about, but I do know that I have a reoccurring nightmare. In this nightmare I am a JavaScript engine. Night after night I am forced to parse line after line of untidy, inefficient, inconsistent code. Many of the scripts are clearly multiple answers from Stack Overflow, crudely glued together in an last-ditch attempt to avoid having to do something properly.

I was going to lead into my default rant about JavaScript and the unsuitability of current web languages. I’m going to save that for another day.

Scum of the Earth Student

“Long day at the office, sir?”
“Not especially, I just think any day is a good day for steak.”
“And what is it you do, sir? If you don’t mind me asking.”
“I’m- err- still a student.”

Now, it would be unfair of me to claim that the butcher in this situation had not refrained from yelling: “Get out and don’t come back; we don’t want your type in here.” He instead continued making polite smalltalk whilst fetching the remainder of my meat. I was, nevertheless, mortified. Another legitimate Bristolian was now aware that I was not just another nice resident with a degree and a real job, but rather a scum-of-the-earth student. I feel sure that, at that moment, he pictured me drunkenly queueing to enter a loud night club, already missing most of what little clothing I bothered to put on, and having previously spent hours on end ‘pre-drinking’ Sainsbury’s Basics vodka in a damp, dirty room with my unwashed underwear strewn over the floor.

Unfortunately it would seem that a huge proportion of the population attending universities (for varying definitions of ‘university’) has side effects. Where before students were (I’m assured) hated by their neighbours, we’re now hated by everyone. And I can understand why. We cost the taxpayer obscene amounts of money so that we can get (so called) degrees – which ultimately offer many of us very little advantage when it comes to getting a job. We’re loud, make a mess, and ruin the local culture by making clubs and cheap pubs viable businesses. Then we go and cost the taxpayer even more when, decades after graduation, most of us have still failed to get good enough jobs to pay for tuition and have to have our loans written off.

Most of the time, when asked what I do, I stick with ‘Software Engineer’ – that way I feel less obliged to apologise for being a detriment to society.

Backup Gods

A couple of days ago I woke up and looked across the room to see a red light flashing above one of the disk bays of my NAS server. Drowsily I reach for my laptop, open an SSH session with the server and reboot it. It’s back up surprisingly quickly and the red light has turned green. Panic over; false alarm, go back to sleep. And that’s precisely when I wake up again to see the red light still taunting me from across the room.
I dream about a couple more best-case fixes for the faulty disk before actually getting up to investigate the problem. Still hoping for a quick fix so I can get on with my day, I pull the drive from its bay in the server and re-insert it; the drive spins up but does nothing after that. I check the available volumes on the server – three 3TB hard disks and one 3.86GB volume in the faulty disk’s bay. I head to Amazon and buy an exact replacement for the failed drive, but that’s not satisfied my curiosity. I grab a USB to TTL adapter and solder some crimp connectors to a pin header so that I can connect to the small serial port on the disk’s controller board. A quick Google search returns the drive’s serial port configuration and in a couple of minutes I’m greeted by an error message:
fail servo op=0100 resp=0003
A mechanical failure. How very dull.

Having used a number of different machines and a considerable amount of storage space for most of my life, I’ve encountered my fair share of disk failures. Normally there’s a SMART warning just before the disk starts refusing to work as a disk, or one day it starts making an odd noise. But at this moment I remember a failure which I could never get my head around:
At age 15 I booted my main desktop PC one day to find that the primary hard disk no longer showed up. I’d not moved the machine or done anything to provoke a mechanical failure, the disk was less than a year old and there were no other obvious faults with the PC to indicate a bigger problem. I’m well aware that this sort of failure is far from impossible, but I wasn’t satisfied. The disk would spin up (and sounded fine) but everything I tried connecting it to refused to acknowledge it as a SATA device. I tried swapping the controller with that of another hard disk of the same model, still no luck. I lost interest and put the disk in a box of old hardware.

Concluding that the NAS disk is a lost cause I locate the box which became the five year old disk’s resting place. I suspect that five years of being shoved around will have killed it off completely but I’m still a little curious. Searching the part number reveals that there was a known fault with the disk which the manufacturer – Seagate – had offered a data recovery service for a few years ago. A bit more searching points me in the direction of a fix I can carry out over the serial port, so I hook it up to the USB->TTL and connect to it. To my surprise it spins up and starts talking back to my serial terminal.
A few minutes later the disk is working and showing up as a three partitions in Windoze. The music and MSN Messenger chat logs which seemed so important five years ago are of little interest to me now, but the situation amuses me somewhat: the failure of this disk was what pushed me into using RAIDs to protect against hardware failures – the very reason my most recent failure cost me no more than the replacement cost of the hard disk. I feel the backup gods are recognising my progress. Or perhaps daring me to continue running my NAS volume in degraded mode.

Fruit Lord

Sometimes I get bored. Sometimes I get really bored. Today was a case of the latter.

My lectures for today were over by 3pm so I took the opportunity to do my shopping for the week. And by that I mean I spent 20 minutes wandering around M&S trying not to let anyone notice that I was piling every bag of fruit sherbets I could find into my basket. After that I was able to set off on what seemed like a long walk home due to the 6kg of fruit sherbets I was carrying in addition to a week’s food.

You might be wondering just why I want so many fruit sherbets. Well, not so long ago I bought a bag of fruit sherbets with my weekly shopping. The next week I bought two. The week after that I bought four bags. Now I know that there’s an infinite number of functions I could map to the series 1,2,4, but I decided that I would buy 2^n bags of fruit sherbets each week, where n is the number of weeks since I started.
Yes, I know what you’re thinking: “But Jack, by the time you graduate the cost of your weekly fruit sherbet purchase will exceed the total amount of money in the world.”
Yeah. I’ll cross that bridge when I come to it. As it stands, I’m unable to find enough bags of fruit sherbets in a single shop to cover my week’s purchase.

Back to my narrative. An hour after getting home I had a flight case full of fruit sherbets sorted by colour. Two hours later, I own www.fruitlord.com.

DSC03955

This is beginning to remind me of the time I bought 218 bags of Skittles, sorted out the purple ones, and gave the rest away – just because I didn’t want to revise for my AS level exams.

Antisocial

I hate it when I’m walking home and someone starts following me around with a weak gamma emitter.
I hate it when I’m sitting in a lecture and someone just decides to force me to consume an entire bottle of vodka.
I hate it when I’m cooking and someone decides to replace my food with a large serving of red meat because they just know that it’ll bring my daily average above the recommended 70g and increase my risk of bowel cancer.

Yeah. None of those things have ever happened to me. Why? Because they’re all really stupid things which no one would ever do. But you know what does happen?

Not so long ago, I was walking to a lecture and walked past a rather slimy looking gentleman. As I passed him he exhaled – filling the air with smoke. I hate smoke.
‘Enjoy that’ his sub-70-IQ-face said to me, as I tried to hold my breath and hurry away from him.

That’s not a one-off thing; that happens several times a day in Bristol. Personally I find being in the presence of a smoker quite uncomfortable. That makes me wonder quite how anyone is able to force themself to smoke for long enough to actually develop an addiction to breathing in smoke – an activity which would usually indicate that you were about to burn to death and should probably run away. To me, it doesn’t seem dissimilar to repeatedly burning your hand for such a long time that you eventually can’t go 15 minutes without causing yourself third degree burns. Only at least that wouldn’t harm passers-by who didn’t want to fill their lungs with pollutant.

If you’re a smoker, please stop exhaling near me. You know who you are.

Essential Singularity

Upon arriving at my house for this year I found myself faced with a serious issue: the sofa covers were slightly dirty. After a lengthy adventure in IKEA (a place I’d never before visited and never plan to visit again) I returned home with pristine new sofa covers in hand. But there was a problem. You see, the new sofa covers matched the walls in colour… exactly. Now, some people might have given up, packed up and left, but not me. No.

10 meters of RGB LED strips, a few drops of solder and a number of burns to the kitchen table later and the sofas were transformed. With the sofa down-lighting allowing any of more colours than I could possibly imagine, the room was transformed from a dull white to something… Something completely different.

Now, I know what you’re thinking: “But Jack, why would I ever want remote controllable RGB sofa lighting?”
Well, have you ever sat down and thought to yourself “You know, I wish my feet were just a bit more illuminated, maybe alternating between seven different colours”?
I know I have! And now that’s possible.

With the addition of a Raspberry Pi and some RF control (which I can’t take credit for) our sofas could be controlled over the internet, using bookmarklets. This opened up a whole world of new possibilities such as lighting up the stairs with a warm glow, or communicating with people outside our windows at night using Morse code.

leds3

Those headphones look like bin lids

Though it’s something of a cliché, music is something I truly love. I consider myself an audiophile, though a number of people might disagree with my giving myself such a title. I personally spend about eight hours in a typical day listening to music, though it’s likely to be more like 14 hours if I don’t have lectures to go to. With that in mind, I think it’s understandable that I find it frustrating that, in recent years, appreciating music has been reduced to a fashion statement.

Years ago I was sitting in school, a pair of headphones sitting on the desk in front of me (Sennheiser HD250-II linear, to be precise).
“Those headphones look like bin lids, I bet they’re not as good as my skull candies and they look stupid.”
I could only manage a tired sigh in response to this. Those familiar with the now-discontinued HD250s will know that they can easily outperform a pair of £30 ‘cool’ headphones designed to look good when worn around the neck.

A few years later I find myself being informed that my HD25-1 IIs are inferior to a pair of ‘Beats by Dre’ headphones. Whilst I enjoy picturing Dr. Dre hunched over a soldering iron and a set of precision screwdrivers in pursuit of perfect audio, I have a reasonable grasp on reality.
“Oh, Beats are the headphones used to mix in every major studio* are they? You’ve never been in a recording studio, have you?”
As doubtful of their quality as I was, I had to confirm that Beats headphones were only good as fashion statements. I located a pair of Beats headphones in an Apple store and was able to listen to them for all of 20 seconds before the terrible sound became too traumatic.
It troubles me that people buy these things thinking they’re paying for an improved audio experience; whilst the massive bias toward the low-end may prove temporarily pleasing to some, anyone who knows anything about mastering will appreciate that applying a massive bass-boost during sound reproduction does not produce ‘the sound the artist wanted you to hear.’

It seems that enjoying music has been reduced to walking around with a pair of cheap headphones around one’s neck. I’m not sure if it’s coincidence or a reflection upon modern music, which seems to have been reduced to dancing on stage and ‘singing’ a few words at the same time.

Written whilst listening to lossless audio through massive stupid looking headphones which don’t even have a completely non-linear response.

 

* This is genuinely a claim made by the product page for ‘Beats Pro’ headphones

Bristol Ice Rink

Earlier this week, someone described this blog as being ‘full of anger’.
Whilst, in this case, it seemed to be a positive remark, I don’t want people reading to get the impression that I’m in some sort of perpetual state of rage. So, allow me to present a post marginally different to the sort of thing I usually write:

Anyone who has ever observed me standing on one leg, my other leg resting on a window sill behind me, phone in one hand, morning coffee in the other, will know that I’ve got some sort of interest in figure skating. (That or they’ll just think I have an odd way of standing.)
Having never lived less than about an hour from an ice rink, I looked forward to having a rink nearby when I moved to Bristol. Sadly, the Bristol rink closed barely a month after I moved. Upon arrival I had but time for a few brief skates before the rink closed for good – after many years, it was to be turned into student accommodation.

Fast forward a year and a bit to earlier this week. I find myself in a multi-story car park, a few levels up, and look out over the city to see this:
Demolition of the Bristol ice rink

Those who have been there in the past will recognise the remains of the ice rink on Frogmore Street, Bristol. This sight was one which I found somewhat saddening – thought my visits to this particular rink were infrequent, I spent many an hour in this building, waiting to skate for a few minutes then travel home. It plays venue in a number of memories, and I know I’m not only one who’ll miss having a rink in Bristol.

Yes the ceiling was mouldy, yes the ice was brittle, but, farewell Bristol Ice Rink, you’ll be missed.

I guess this post was sort of about anger…

#NekturalSelection

I don’t drink at all often, and when I do it’s Cognac or wine, so it’s a good thing I’m not the type to be involved in this ‘neck nomination’ thing. That said, if I did choose to ‘neck’ a bottle of Cognac, I’d be disappointed if I were branded anything better than a fool.

A ‘hash tag’ would appear to be the only difference between a reckless criminal drunkenly getting them self killed, and a tragedy where peer pressure leads to the death of an innocent victim.
Perhaps I’m being insensitive here, but I don’t understand why we’re forced to pretend that anyone is a ‘victim’ of a craze where people choose to drink an irresponsible amount of alcohol purely because they were told to by a friend using a social network. And yet, Facebook’s morally superior (read ‘Facebook users’) are crying out to put an end to this terror.

As with many things the media likes, ‘NekNomination’ would appear to merely be a symptom of a more serious problem. In this case that problem is irresponsibility. If someone suggests you drink poison for fun, let’s not pretend it’s anyone’s fault but your own if you do it.