October 2008

« September 2008 | Main Index | Archives | November 2008 »

16
Oct

WiTFi

  • 9:31 PM

My apartment is long and thin. Living areas at one end. Study at the other. Kitchen is in the middle. Thick walls and white goods seem happy to soak up any signal I try to pass from one end of the apartment to the other. On top of that, overlooking the city seems to mean being bombarded by everybody's radio interference.

The upshot of all this, getting WiFi to cover my entire apartment has been a constant battle, one that I've had to solve with no less than five different wireless devices creating three different networks, two in the 2.4GHz band and one up in heady 5GHz-land. Even with all these electromagnetic waves slowly frying Donna’s and my brains, the signal is still pretty dodgy on occasion.

Tonight we were walking home across the harbour bridge and Donna challenged me to look up the origin of the term “Dorothy Dixer”, Australian political slang for a pre-arranged softball question from one minister to another from the same party. I pulled out my iPhone, and had got the answer from Google before I thought “Hey, wait a minute. Why does the phone say I'm on WiFi when I should be on 3G?”

Lo and behold, I checked my settings and I was connected to one of my own 802.11g networks. A few more metres walking down the bridge and I was back on 3G, the magical line-of-sight to my router broken by the Western corner of my apartment block.

wifi-signal-wtf.jpg

So, in summary:

Places my WiFi signal can not reach: five metres away at the other end of my own apartment.

Places my WiFi signal can reach: three quarters of the way across the sodding harbour bridge.

Zombie Attack

  • 3:45 PM

Here is my belt.

  1. Where I’ve spent much of the last three years
  2. Where I’ve more frequently been slipping to
  3. Where I am now
  4. Where I will be in a week or two

Before you tell me, yes I know diets don’t work. You’ll quickly put back on everything you lost (and then some) after the diet is over. The only thing that really works is changing to a more healthy lifestyle.

This is both true, and missing the bigger picture.

Left to my own devices, I will consume more calories than my body requires and thus over the course of time gain weight. Whether this is caused by habit or is wired into my physiology is a moot point: the evidence shows that in the absence of other forces, that’s what I will do. My solution, the only one that has ever worked for me, is to create a second force that works to tip the balance the other way.

Creating that force is pretty easy: develop an awareness of how much you are consuming1, track your weight over the same time period, and feed those two variables back into your routine. This is the principle behind pretty much every diet out there not of the “eat only brazil nuts and beef jerky” variety, and while your mileage may vary, it’s what works for me. So long as the feedback is in place I can manage my weight. In its absence I revert to form.

What's really dumb is how I forgot this. I had everything nicely under control for a while, then somewhere in the middle of moving across to the other side of the country I fell out of my system and back into habit. Combine that with a couple of bouts of depression that I probably should have sought treatment for, and that left me feeling largely apathetic about my own existence for most of two years, and there was really no incentive for me to pick it all up again.

Somehow, I managed to convince myself that this meant the accepted wisdom was right and that diets don’t work, rather than reaching the obvious conclusion that if you stop caring about something, of course you'll fall back into old habits. Then there was the whole “You’ve turned 30 now, your metabolism has started to slow down, it’ll be so much harder now…” self-deception.

Which was all rubbish. I’d convinced myself it was hard, so it was hard. Once I got over that mental hurdle, so far it hasn't been that hard at all.

1 The first time I did this I went the whole calorie-counting route. Now I just rank each meal/snack between 0 points (a piece of fruit) and 3 (an all-night beer bender). This seems to work fine and it's a hell of a lot easier to remember when I sober up.

To begin with, a website. Customers sign up with their name, work address and credit card number. Periodically but randomly, the site will mail empty cardboard boxes of various shapes, sizes and livery to the customer, care of their office.

The customer gets the joy of having a package delivered (and an excuse to get up from their desk and chat with the receptionist) without the expense or hassle of actually buying anything.

Later you can introduce a letter service, mailing out hand-written lorem ipsum. Outsource the penmanship through Etsy.

(Kipling)

…and from that day to this, Best Beloved, three proper Men out of five will always throw things at a Cat whenever they meet him, and all proper Dogs will chase him up a tree. But the Cat keeps his side of the bargain too. He will kill mice and he will be kind to Babies when he is in the house, just as long as they do not pull his tail too hard. But when he has done that, and between times, and when the moon gets up and night comes, he is the Cat that walks by himself, and all places are alike to him. Then he goes out to the Wet Wild Woods or up the Wet Wild Trees or on the Wet Wild Roofs, waving his wild tail and walking by his wild lone.

It was really trivial code. A wrapper around a HashMap (dictionary) to temporarily cache some values that were getting too expensive to calculate every time. While writing it, I pretty much convinced myself that this code was so simple there was really no point writing unit tests, but as I got close to checking the code in I realised that the first thing my code-reviewer would ask was “where’s the test?”

So I wrote a test. And it failed. It failed because I'd made a really dumb typo in the constructor of one of the nested classes I was using as cache keys, writing this.username = (user == null) ? null : username instead of this.username = (user == null) ? null : user.getName(). This simple mistake meant my cache would be at best useless, and far more often entirely inaccurate.

Lessons for the day, there are two:

  1. Nothing is too trivial to test
  2. Even the mere threat of a code-review leads to better code