Mostly Harmless

John Alderson's Blog
Wednesday Aug 13, 2008

In The Badlands

Disclaimer

I went for a walk around the lake this afternoon, to rest my eyes after accidentally pointing them at a perl program. Throughout I was observed by the heron, who seems rather fat and complacent these days. The water was conspicuously devoid of fish.

Because that hadn't taken long I pushed on into the undergrowth behind the Lake. I began to feel strangely exposed and self-conscious. Apart from a couple of people on the canteen patio, sipping cappuccinos and poring over spreadsheets, I was  quite alone. I think I began to imagine my colleagues congregating invisibly behind the huge office plate-glass windows, which reflected only sky in my direction. They would be murmuring to each other "What is he doing?" - "He has reached the birch copse!" - "Does he have enough oxygen to make it back safely?".

They would perhaps speculate that I was on some obscure mission - possibly religious. Maybe I was burying the secret of how to write a complete webserver in three lines of awk, for a future in which people would once again revere such things. When I finally disappeared from view they would disperse again to today's hot desks with furrowed brows and an inkling of disquiet.

What I did discover in the dark continent between the Lake and the Lost City of Building 4 was a very good blackberry bush. It always seems to be the smaller blackberries on the harder-to-reach bushes which taste the best.  


Friday Jun 06, 2008

Robo-Cropper

How many accidents are caused, or made worse, by a mis-ordered unconscious list of priorities?

You are standing on a new carpet in your neighbour's sitting room, holding a cup of hot coffee. Through the sitting room door you are horrified to see that an ambitious early toddler has managed to open a stairgate and is wobbling giddily on the top step of a long staircase. The right thing to do is to drop the coffee and skip up the stairs as fast as possible (mere shouting often destabilizes toddlers). But a significant minority of people will waste a precious half second attempting to put the coffee down carefully. Not spilling our drinks (especially if we are guests) is a habit of almost instinctive strength; overriding it takes conscious effort, or practice.

I've had a bad week for drivers (of both sexes) on four wheels attempting to run me over on my two. In today's sorry case I had made good eye contact with one bent on entering from a side road and I knew that she had seen me. But still she kept coming, so that I was pushed into the other lane (which, luckily, was empty) as she shouldered her way onto the road. I waved (in a manner of speaking) and was acknowledged. Then she continued - not especially quickly - on her way.

I've been pondering her state of mind at the point when she should have stopped but didn't and I think the story of the toddler on the staircase sheds some light on it. I don't think she bore me any ill will. I'd guess she was following the simple rule-of -thumb "don't get behind a cyclist". Probably she's never hit a cyclist but she's been miserably stuck behind one plenty of times.  The weight of experience unconsciously favoured her trying to squeeze in front of me, before she had time to consciously evaluate the safety aspects. Avoiding a known minor hazard (the coffee / the delay) seems to take priority over an obscure major one (the fall / the collision).

So, in the spirit of The Off-Bike I propose "Robo-Cropper". The Off-Bike attempted to safely familiarize cyclists with ghastly mechanical mishaps by conditioning their reflexes. Robo-Cropper uses the same approach with motorists. Robo-Cropper is a convincing humanoid form (say, one of those crash test dummies but with lycra, nostrils, headgear and good hair) mounted on a semi-autonomous bicycle powered by a discreet motor in the dummy's torso and a novel hidden transmission through the saddle and seat-post.

An operator behind a hedge steers and brakes the bike by remote control. The dummy can give signals, turn its head and wail pitifully, but is otherwise passive and of good temperament.

The operator repeatedly sends robo-cropper across the same junctions at busy periods. Robo-cropper cycles responsibly but does not take evasive action and is eventually mown down by a driver with a mis-ordered set of unconscious priorities (or maybe just by a vindictive swine - which is less interesting...) The hope (wishful) is that the shock of believing (if only for a moment) that they have actually caused injury will initiate a rewiring of complacent safety reflexes in the driver's mind.

Obviously the more likely outcome is that all the cars will crash into each other leading to a national scandal similar to the one we'd get if some celebrity were injured exercising the more advanced options of the Off-Bike. Oh well...

Cycle safely and Noli nothis permittere te terere.


Tuesday Aug 14, 2007

Wrong Mystery Solved

Disclaimer

Another team meeting:

  • Our boss makes another sensational appearance on the video link. This time he is on a sheer rockface halfway up a Himalayan peak. He has dug in his crampons and ice-axe and balanced the webcam and satellite uplink on a ledge before adjusting his goggles and fixing us with a cracked and sunburnt grin. He is a trailblazer in the sport of extreme concalling.
  • My worst fears about Risto Kymmentäkivi and the shredder are confirmed.

The day Donna shredded the mysterious extra piece Risto was seen loitering around the printer area trying to look like someone who has been shocked or confused by something the photocopier has said. However, when no-one was looking he rummaged in the shredder bin. This had recently been emptied, so he was able to make a complete inventory of the surplus jigsaw piece we all thought we had seen the last of.

Such behaviour is already obsessive, but it turns out he has gone one huge step further by photographing and analyzing the many fragments in an attempt to reconstruct the whole piece and continue towards his original goal of determining if it is really surplus or has been displaced by some other more genuinely surplus piece. To this end he has ported some pattern recognition software to harness the formidable power of the SFW1000+8i and chosen our team meeting for a grand unveiling of the results...

We all cluster round the big screen and Algernon, halfway up his mountain, shades his eyes and squints at the portable LCD. Risto has the floor.

"I devised a q-parallel stochastic procedure to approximate best-fit," he says, "and converged using repeated runs of a classical genetic algorithm. This method could have been further optimized into q-space if the other 7 superposition engines were in the coherence group." He looks meaningfully at Donna, almost as if he suspects the fact that the best brains on the planet have not yet achieved 8-way q-bus superposition is all part of a global conspiracy to prevent verification of a true and complete Jackson Pollock jigsaw.

"Anyway, I'll show you the the final result. This is the definitive hi-resolution reconstruction of the query surplus piece. Further runs from this point do not improve signal to noise ratio at the interpolated-pixel level..."

"Just show us the goddamn picture Riz!" snaps Algernon, and Risto winces slightly.

It is a very high-quality image. We stare at it in admiration for a while; then someone says, "Ooh look, I can see a song thrush!"

"It's not a song thrush, it's a square dinnerplate with a pair of nail clippers in one corner."

"They're not nail clippers!"

"Is that David Beckham?"

"Hang on, hang on," says Arnie, "It's the wrong way round. Risto turn it 90 degrees clockwise. - - You see? There's the sky, and down here there's like a crowd of people. And that bit of dinner plate is the corner of a building. And here's a car with some guy waving."

"Oh yes! I see it now!"

"Amazing!" says Algernon, "That's John F. Kennedy in the car. And if I'm not mistaken the building behind is the Texas School Book Depository. Zoom in on the corner of the sixth floor."

We may have talked ourselves into this, but it does suddenly seem a highly detailed image. Zooming in on the corner window the shadowy figure of a man holding a bulky object becomes suddenly clear. There is a stupefied silence and then, moments later, pandemonium.

* * *

Some people were angry with Risto afterwards - but personally I don't think he was to blame. Of course, this may be another conspiracy, or another editorial lapse from the BBC, or it may be our first concrete glimpse of the dizzying weirdness of quantum reality - whatever. But according to the SFW1000's pattern recognition software the man standing at that fateful window was Terry Wogan, wearing a Pudsy Bear necktie and wielding a Spider Man 3 Super Soaker.

Tuesday Jul 24, 2007

Off-bike plugins

More training modules for the Off-bike.

Thanks are due to the helpful commentator who supplied the following suggestions:

  • A car door opening unexpectedly
  • A dog - particularly one attached to one of those stretchy-but-almost-invisible-cable-driven leads stretched across the cycle path (hilarity ensues)
  • Riding a SWB recumbent bike and trying to do virtually anything at very low speed.

These are all good - although I have passed them on to the simulator arm of the Off-bike Project (possibly to be coupled with the haptic jacket of VR fable).

Some I have thought of since, which could reasonably be added to the bike itself, are:

  • A sudden very loud noise (from a generous catalogue of loud noises)
  • Brake failure - but I think this is a distinct competence
  • Catastophic flat
  • Seizure of the rear wheel (an option to seize the front wheel could attract high insurance premiums and get us on to the wrong sort of chat-shows etc.)
  • Exploding goggles (simulates flying grit). Actually all it needs is a blanking mechanism over one or both eyes synchronized with a suitable sound effect from the loud-noise generator.
  • Wasp-o-matic helmet or bike-cap (the de-luxe version will administer a mild sting-like electric shock while buzzing like crazy)

It would seem quite easy to build these in.

I was once startled by a truck driver who thought it was a neat idea to play the sound of a horse whinnying at extreme volume as he went past. I have a recurring fantasy of his trying this out on a real horse and pleading most pitiably with his insurance company after the horse has demolished his cab. (I didn't fall off but I failed to respond appropriately: i.e. to catch up long enough to read his licence plate).

I was once thrown off when my front tyre went bang while I was whizzing down a hill. I don't know if one can learn to cope with this as I have never repeated the experiment. I do now know that it is possible to bounce more than once on your knees...

Monday Jul 23, 2007

Fun with Webcams

Disclaimer

The student interns are up to something. It's easy to tell because they haven't yet learned to control the smirking reflex. Cracking them was just a formality, although it was easy partly because I'm a cyclist.

The interns have taken agin the speed humps (sleeping policemen) which limit the speed of traffic around the lake. It's not that they have a perverse desire to increase the danger of our environment (at least, I hope not!) but more that they feel that push-bikes are disproportionately affected by these inverse pot-holes.

You'd think that as students they'd be hard-up but that doesn't seem to preclude owning some fairly high-tech bikes. They don't want to go down in a cloud of carbon nanotubes when their sleek machine buckles or tips negotiating the jump. Site Planning And Maintenance point out that the sidewalks are also for cycles. However, since July 1st in this land the sidewalks have become too dangerous, peopled as they are by glaze-eyed zombies hurrying to the smoking areas in the car-parks. These poor indigents only appear to have seen you. In reality they have paused mid-stride just to check (again) that they have everything they need, and will soon forge ahead without warning and on an unpredictable bearing.

Anyway, it turns out that the students' revenge is so inventive that it's worth describing in detail:

A couple of days ago they formed a sociable crowd around a lamp-post near one of the speed humps. While the outer students chatted the inner members of this crowd removed the maintenance plate from the lamp-post and inserted a small wireless PC, webcam and powerful integrated amp and speaker. This was all patched in to the lamp's power cable and the cover replaced with minor modifications for the camera and speaker (a few carefully positioned holes).

They contacted the PC from the office and checked that the camera images were good. Next a neural network was trained to recognize certain cars as they approached the hump. This job was facilitated enormously by Donna's SFW1000 which eats that kind of problem for breakfast. The student's included one of their own cars as a test and then tuned the tracking between visual match and arrival of the wheels at the hump.

The result is that when certain cars (and only those) traverse the hump the noise of a loud squeaky toy emanates from the lamp-post. Some of the resulting camera footage is absolutely classic. I would prise it away from the students but I think they are planning to sell it online to recover the funds they lost by buying smart bikes and mini wireless PCs.

In one sequence the victim stops, reverses and tries again. Again the squeak. He gets out of his car and waits for someone to go around him. No squeak. He scratches his head and inspects the tough plastic speed hump - and then actually begins to jump up and down on it to see if he can elicit the squeak! He gets in again and reverses with such violence that he nearly takes out a would-be smoker who has stopped briefly in the road to check his pockets. He drives forward again gingerly - squeak! - he stops and can still just be seen in the camera hunched over the wheel and staring wild-eyed from side to side before making for the nearest parking space.

With another victim we see the same reversing strategy, but then the guy gets out and starts rummaging in his boot (trunk - whatever). At length he pulls out a dog's squeaky bone toy and deposits it in the nearest bin.

I don't think this anarchy will achieve any useful result - but full marks for imagination!

Thursday Jul 19, 2007

printf() - the immortal debugger

Disclaimer

Caramba! Gone are the nights of "clubbin'" and the days of backchat and nose-powdering. In between hiding webcams in Project Central and stealing Ursula's entire library of O'Reillys Donna has succeeded in booting the SFW1000+8i! She is the first non-Sumover Futures employee to attain this level of magery. The engineers at Sumover wanted to send her a wee plaque in recognition but a "suit" intervened. The more credible this product looks the more snappy dressers with visitor's badges haunt the corridors.

True, she hasn't managed to entangle all 8 Superposition Engines for more than a picosecond yet but seems unperturbed by this and only smiles coyly when people inquire about her progress. In any case, even one working engine has Risto salivating. He limbered up with a couple of Travelling Salesman problems involving 100 cities and then launched into a project of his own. No-one knows what this is. Risto doesn't do "coy", he leans more towards the blunt end of things, with statements like "If I explained it to you you wouldn't understand anyway."

We have encountered new and fantastical difficulties when debugging quantum programs. Traditional debugging with breakpoints just won't work. There is an obvious and a less-obvious reason for this:

The obvious reason is that as soon as it hits a breakpoint the running program displays this fact on your terminal so that you can decide what to do next. This is equivalent to getting an eyeful of Schroedinger's Cat. The program will have gone irretrievably classical so there is no meaningful way it can be resumed.

So, you might say, at least we can do a post-mortem on the breakpointed program? Not necessarily... This brings us to the less-obvious problem: A breakpoint may sit on one of several code-paths and be missed by the others. In a classical program a breakpoint which is not visited has no effect on the execution of the program - but in a quantum program the mere possibility of visiting the breakpoint influences program execution even if the breakpoint is not visited.

In QM terms the breakpoint is a potential "observation". It's effect on a system even when the observation is not made is sometimes termed "counterfactual". I believe the idea of something which only might have happened influencing something that did was one of the paradoxes first raised by Einstein, Podolsky and Rosen in a thought experiment involving bomb fuses which could be triggered by a single photon.

So, anyway, trad breakpoints are a no-no. We've gone back to using printf() - but to a tiny qRAM filesystem which runs entangled with the program image. It's funny to think that messages may be written (sort of) to that filesystem which are no longer there when the burly programmer finally gets to look at the file. Still - our output is now coherent, even if not complete ;-)

We automated the initialisaton of the qRAM-FS:

/*
 * Hello world - "Q-safe"
 */
#include <qstdio.h>

main()
{
    fprintf(qstdout, "Hello, World!");
}

[NB: For anyone who feels in danger of losing the thread of Lake Guillemont a handy list of episodes is provided on the side-bar (most recent first)]

Friday Jul 13, 2007

The Missing Piece

Disclaimer

Someone around here is one piece short of a jigsaw puzzle.

It is a curious fact of human nature that how we feel about a crime is not primarily dictated by the size of the injury - the amount stolen or the severity of the violence. When it comes to sentencing, size matters; but as social beings we are often swayed more by the motivations of the perpetrator and what the crime says about their trustworthiness, or simple worthiness.

So when we read about someone up on a charge of GBH for confronting a burglar with perhaps more than reasonable force our sympathies tend to go with the householder rather than the burglar - even though most people would rate violence as worse than theft. If I see someone deliberately drop an empty crisp packet on the street I'm emotionally ready to rescue the litter and incorporate it into the litterer's body in some painful configuration. Yes a crisp packet is tiny, but the void in the head of the person who dropped it is the size of a parking lot.

By the same token I imagine spammers are probably frightened of being identified in crowded places (if they ever leave the house, that is).

Someone in Lake Guillemont probably thought it was an amusing practical joke to pinch a piece from the completed Jackson Pollock jigsaw in Project Central. I imagine them thinking "They were a piece up, now they can try being a piece down...". Well, mean-spiritedness is revealed in the smallest actions probably more clearly than in the largest. If you want to join the ranks of street litterer's, spammers and others who should know better, then hang on to that piece. Otherwise replace it and we'll say no more about it.

In fact - I'll even offer an inducement. Return the piece and I'll blog one entry on the subject of your choice (at my discretion) - a reward made possible by the anonymous-coward technology of the internet.

P.S. You'd best wait till no-one's about. Donna thinks she knows who you are and I wouldn't want to be on the receiving end of her wrath. She handles that shredder like a pro these days.

Monday Jul 09, 2007

The "Off-bike"

Yesterday I was half-way up Whitchurch Hill (Reading, RG8) in a bit of a dream and accidentally changed up instead of down. As my small store of momentum dribbled away I rather savagely changed down again and knocked the chain off. This presented my cerebellum with a set of circumstances it had hitherto not encountered and I promptly fell over.

I always come up laughing from toe-clip-related accidents because they are such good slapstick - but my right knee is not laughing with me. These things are all over-and-done-with before the conscious mind can intervene sensibly (at least, at my age...) but low-level management (the cerebellum) seems to have to learn about them on a case-by-case basis.

I think my legs assumed I had discovered some new and most excellently low gear and they pedaled heartily while I was, in fact, moving gently backwards.

Hence this modest proposal:

The Off-bike

Related to the bolt-on skid pan favoured by advanced driving schools I propose a training bike with built-in radio controlled sabotage:

  1. A device which disengages the cranks - simulating a chain outage
  2. A spring-bolt which suddenly liberates the handlebars
  3. An "unstabilizer" which can be silently primed to actuate next time the rider brakes hard and which causes the bike to tilt in the rider's non-preferred direction. This tilt could be generated by a third wheel which juts out to order.
  4. ...other suggestions...

The trainee rides around a traffic-free circuit (with hills) while the operator remotely triggers random disasters giving the rider ample opportunity to train his or her reflexes in a safe environment (with kneepads). I'd be particularly impressed with someone who learns to stop gracefully when the handlebar option is triggered without warning. I guess you could build a bike simulator for this but it wouldn't be half as much fun - and "no pain, no gain" is not an empty mantra for these particular feedback loops. I remember the first time I successfully, unconsciously, yanked my right foot out in time when I was tipping the wrong way. There was, immediately to my right, a large and chilly-looking puddle...

Friday Apr 27, 2007

The best of the Two Tribes problems - Part 2

Continued from here.

You point to one of the paths and say:

    "If I were to ask you if this path leads to the village would you say pish?"
This solution follows the normal pattern for this type of problem - but the pish/tush confusion is a novel twist. In our hut in Devon none of us (I and my brothers) succeeded in arriving at this solution but I do remember working out why this still works even when you don't know whether pish means yes or no (Mr Gardner left that part as a teaser).

I remember sitting at a trestle table and making a little grid out of knives and forks. I labelled the columns and rows with other domestic items and then filled in the grid with the answers given by the native. Salt meant pish and pepper meant tush. The resulting pattern was as follows:

Path goes to village Path does NOT go to village
Pish means YES
Pish means NO

From this I could see that if the native answers pish then the road goes to the village - regardless of whether pish means yes or no. In the general case, if the native uses the same word in the answer that you used in the question then the path leads to the village.

I remember the dawning sense of triumph I got from from examining this boolean decoration. Mum was less impressed: "That doesn't quite count as setting the table..."

Thursday Apr 26, 2007

Donna's Pet Project

Disclaimer

Donna is building a quantum computer!

This has arrived in kit form from Sumover Futures Inc (I bet the stock analysts love that name) who are a startup specializing in qbit-logic workstations. Some marketing guy there (probably only half a marketing guy) decided it would be funky to use complex numbers for their branding - so this beast is an SFW 1000+8i. It looks like an ordinary workstation at the moment - because that's what it is - but then there's this big rack hanging off the back with some major cooling plant on 3-phase.

The rack, once you've fought your way inside it, can take up to 8 "superposition engines". Each one of these can maintain a goodly pile of quantum "dots" in a state of quantum coherency for a respectable number of seconds. The actual number of seconds achieved is a matter of luck, of course, the only guideline we have is an MTBF of about 4.5.

In use it's supposed to be a bit like programming an FPGA. The host OS on the workstation (our bit) allows you to build qbit processing logic into one or more engines and then release them, hoping they don't go classical before they spit out an answer. There's supposed to be a photonic crossbar linking the 8 units so they can exchange "data" without loss of coherence. This would effectively increase the number of coherent dots eightfold. The cost would be a substantially reduced MTBF but at that level of, er, simultaneity who cares if you only get it for a second? Unfortunately the cross-bar isn't supported yet. You need correction codes to allow you to ignore photons which have accidentally bounced off something, and Sumover haven't got them working yet. Donna claims to have some ideas about that - I hope none of them involves the shredder.

Tuesday Apr 24, 2007

The best of the Two Tribes problems - Part 1

We were on holiday in a hut in a remote spot in Devon when I was eleven or twelve years old. On sunny days we walked down to the beach (about two miles away) and played all day, returning at night with as much driftwood as we could carry. On rainy days we burnt the driftwood on the hut's hearth which was backed by a fat black pipe thrown into folds like the body of a prone python. The water heated in the pipe rose by convection to a half-buried tank some way up the hill behind the hut.

Most of a rainy day was spent indoors reading books from the hut's ample stock of paperbacks and it may have been there that we discovered the first collection of Mathematical Games made from Martin Gardner's long-running column in Scientific American and published by Pelican - or we might have brought it with us. At any rate, it was there that we read his round-up of "Two Tribes" problems, the pinnacle of which went something like this:

    You are an anthropologist visiting a remote island inhabited by two tribes. Members of one tribe always tell the truth, members of the other always lie. Apart from this detail they are indistinguishable from each other and happily coexist in a prosperous village some distance inland.

    To reduce disturbance from visiting anthropologists the natives have built a fork in the one road leading inland from the shore. One path of the fork leads to the village where travelers can be assured of safety and hospitality; the other leads to a dangerous swamp where they will be instantly devoured by voracious giant land-snails.

    However, the natives are not unsporting and there is always one of their number stationed at the fork to provide assistance. By ancient tradition you are permitted to ask him or her ONE question which will be answered yes or no. Unfortunately you have lost your Remote Islandese dictionary in the rough sea crossing and, though you have a working knowledge of the language, you cannot remember the words for "yes" and "no". That is to say, you know the words are "pish" and "tush" but you can't remember which is which.

    Your problem is to construct one question that you can ask the native at the fork in the road, the answer to which will guarantee that you know which path leads to the comfort and safety of the village and avoids the ravages of the snails.

(As before, I have disabled comments on this entry to prevent spoilers.)

(PS: I may have made up the bit about the snails...)

Makeovers

Disclaimer

One of the interns has hold of a large, shiny nut and bolt - which probably should be fastened through some critical component in the lab. He idly spins the nut up and down the bolt while he he sits at his desk and it makes an agreeable jingling sound to accompany his surfing industrious typing.

"Agreeable", that is, for about a minute. After that time it becomes monotonous. Then it begins to remind me of an animal in a cage too small, pacing up and down. At about this time Arnie Shepherd's leg starts up. I believe I mentioned way back that the office is earthquake proof; one consequence of this is that the floor vibrates like the skin of a drum. A good leg-twitch can transmit itself up every seatpost in a twenty metre radius. Confined to the office for a few generations we would probably acquire the ability to communicate with infrasaound, like elephants.

So I now have jingling from one direction and steady tremors from another. Output from a coredump seems to crawl around my screen and become disassociated from all meaning. What are these figures? 0xdeadbeef - what on earth does that mean?

- Thud thud thud, jingle jingle ... Brrrr thud thud, jingle jingle...

The caged animal must have a bell on it's collar. It seems to be eyeing me from behind the dense foliage of a SCSI packet structure. I try to move my mouse pointer but I have no idea what I am going to do with it when it arrives at its destination. The jingle is now as loud as the sound made by a convention of 500 chainsaw-wielding zombies on a luxury liner.

Suddenly in the corner of my eye I spot Ursula Resplandor heading purposefully towards the intern. Halleluja, I am not alone! However, I have watched this scene before. She will falter in the advance and make some angry but significantly oddball remark which will fail to move the intern. He will laugh, his fellow minions will laugh too, Ursula will retreat in disarray and the jingling will resume on a cosmic scale.

But as she passes me I am conscious of a scent of some hitherto unnoticed perfume - and around her eyes are distinct traces of makeup, applied with skill and economy. She goes right up to the intern and fixes him with a cold stare. The forehead is barely puckered, the eyes barely narrowed, but the effect is devastating. The intern's neck and head change colour from the bottom up like some funky GUI histogram warning of imminent memory exhaustion. Ursula holds out her hand and, receiving the nut and bolt without a single word, proceeds serenely labwards.

"Arnie, quit the leg!" I cry and, turning, I catch Donna watching after Ursula with an approving smile. Donna has taken to wearing rather chic glasses, the better to absorb Ursula's weighty copy of "The Compleat Cryptographer". She has also asked to take my Knuth home with her and I worry lest I will be separated from it forever.

Saturday Apr 21, 2007

Minutes

Disclaimer

Algernon spent most of the meeting showing off his yacht and extolling the virtues of his satellite network hardware - which he got from these guys.

Donna was declared winner in the question of who-put-the-last-piece-in-the-puzzle. Algernon cracked up and said "I like your style baby". (You have to cringe carefully in brave new webcam world or it may be held against you.) Donna will now get a project of her own to manage. Ursula barely batted an eyelid - curiouser and curiouser...

The next puzzle is to be a Mark Rothko. Algernon is going to try to get one to cover the whole East wall. Arnie Shepherd says "Me bagsie the middle bit".

Donna has had a note from Human Resources instructing her to remove the large pendant bearing a likeness of Alex Turner which she proudly wears at work. Algernon says "Don't worry, I'll take it up with them". Donna says "Arctic Monkey is, like, my religion!" "That could be a good angle..." says Algernon.

Tuesday Apr 03, 2007

D'you want -r with that?

Some vintage (thankfully) goofs in no particular order and not all by me. There is nothing like the curious abdominal tingle which accompanies the dawning realisation that an rm command has broken free of its moorings...

1. All C'ed up

    This is my favourite, probably because it is another class of unconscious assumption.

    I had just commented a large number of C source files and then moved on from that to edit a Bourne shell script to be run as root. One of the lines I added was:

      rm /tmp/scratch$$.*       /* Clean up scratch files */
      
    This was such a narrow escape! There are almost no interesting regular files in "/". The main thing to put back on that machine was the symlink from /bin to /usr/bin, without which all of the shell scripts beginning "#!/bin/sh" cannot work.

    Still, the error message rm: Clean: no such file or directory was enough to kick off the old rm frissance.

2. Dotty

    The need to remove several large source trees accessible only by superuser and sitting below directories with names like: .old .070996 .arch etc, led me (one fateful evening) to type:
      rm -rf .*
      
    just above them. I feel clammy just thinking about it.

    The trees were very large so it did not concern me that this command had not returned after some minutes - but slowly I became aware that all was not well... It didn't help that this machine was in a kind of cluster with several others - each of which shared its entire filesystem via amd mountpoints with root allow privs.

    It was a long night...

3. Cron only too HTH

    A customer complained that his machine had hung and then corrupted huge chunks of /usr when he forced a panic. He submitted a manifest of what was left in /usr as evidence.

    We already had an idea that there was some rm-ery afoot and asked him to check what the machine had been doing at the time. Following a hunch I took the source of rm and made a modified version which output file names instead of unlinking them and ran it on a local system with the same Solaris release.

    The rationale was that rm's file walk removes files and descends directories in directory entry order. Since most of the files in /usr are put there during installation and never subsequently deleted this file walk will tend to be the same on machines installed with the same release. I split the output of my "neutered" rm at ld.so.1, whose removal probably hung the machine. The remaining list of files was an almost exact match with the manifest supplied by the customer...

    ... who, in the meantime, had found a root cronjob which did something like:

      cd $SCRATCHDIR
      rm -rf *
      
    This is a well known danger spot. One should guard against the possibilities of $SCRATCHDIR being either null or not something that one could cd to.

4. Death by wrapper

    Many years ago a friend of mine became so concerned by his propensity for causing collateral damage with rm that he aliased it to rm -i. I have since encountered whole sites where this lunacy is standard practice.

    The funny thing in the case of my friend was the speed with which the inevitable disaster overtook him. I think it was mere days before he typed rm * on some machine or other, expecting the friendly dialogue but getting only a prompt and a directory more echoey than he had intended.

    Thurber in The Bear Who Could Let It Alone concludes "It is better to fall flat on your face than lean too far backward".

Tuesday Mar 27, 2007

Matters Arising

Disclaimer

The Boss is on the hoof.

He is not abandoning us, merely relocating. Around here it is often feasible for a team member to move to a different country, or even hemisphere, and still remain in the same team - although it does feel a bit odd when that team member is the manager. The other odd thing is that he does not appear to have yet finalized where he is moving to.

We had a team meeting (conference call) yesterday which underlined this situation. Algernon (the manager) decided to make it a video conference. We did not succeed in booking Brighton - the biggest and swishest meeting room - or even Filey, so we're all crammed into a broom-cupboard of an office with no windows and going by the name of Mother Iveys. There is a jumble of windows on the screen: us - looking like a submarine crew discussing whether to drop the ballast and cry Mayday, the guys from France, a couple of webcams and a blank window where Algernon is conspicuously absent.

Risto I-am-not-a-Finn Kymmentäkivi and Arnie Shepherd (scourge of EPROMs and inventor of the WiFi deep fryer) unmute the phone to float a pre-meeting proposal about the reintroduction of doughnut days. Donna and Ursula, who have become oddly inseparable over the last couple of weeks, are not prompted to comment. Donna has her nose in a book entitled "Additive Cellular Automata, Volume 1", but she breaks off between chapters to refresh her lippie. The atmosphere is becoming oppressive when, at last, Algernon's window crackles into life.

"Team! Glad to see [puff] you could all [puff] make it!"

There is a confusing whirl of colour in the window, caused mainly by camera shake. Then it steadies and Algernon's face comes into view. He is looking bronzed and healthy and sporting surfer's sun-block on nose and lips. As he speaks he is rigging a spinnaker on the deck of a roomy-looking yacht which is coursing swiftly over a glittering sea beneath a sky which is blue from horizon to horizon...


Calendar
Search my blog
Lake Guillemont
Feeds
Links
Referrers