Jul 212010

It seems that some people have problems following instructions.  Simple instructions.  Apparently, I’m one of those people.  I recently got directions to an arena where my sister was going to show off her skills at cutting.

Shouldn’t be too hard.  It wasn’t like it was “Turn left at the buffalo” – it looked pretty simple.  But I should have taken a clue from the fact that it seemed to be worded a bit oddly:

From Highway 2: Approximately 6 kms. East on Highway 567, 1 km. North.

Now written here it looks a bit odd, but when read on my iPhone, it was even better:

From Highway 2: Approximately 6 kms.
East on Highway 567, 1 km. North.

So I diligently drove 1km east on 567 and then headed North, expecting that the total drive form Highway 2 was going to be 6km.  I was wrong.  Once I had called for better instructions and actually arrived on site, I did some troubleshooting to see how I could have misread the instructions so completely.

I know that you believe that you understood what you think I said, but I’m not sure that you realize that what you heard is not what I meant.

I attribute it to punctuation and formatting.  The authors of the instructions (not my sister, she was just copying and pasting) had no idea how to correctly abbreviate kilometer or kilometers.  Ok, they were close, but km isn’t supposed to have a period after it unless its the end of a sentence and kms is a strange combination of distance and time.  The kms should have been a hint that I needed to change how I parsed the sentence and its punctuation.

Instructions are interesting beasts.  They typically make a lot of sense to the person who wrote them.  They’re perfectly clear, how could you possibly not understand them?  Ask computer programmers who spend their whole days writing instructions for computers to follow; there are times when computers refuse to follow the simplest instructions.

Three legs in the air

Three legs in the air

It’s best to ensure that if you’re writing important instructions that you get somebody who doesn’t know much about what you’re describing to try to follow them, before you publish the set of commands.

My sister’s cutting competition went reasonably well overall.  The cattle were able to follow her instructions, and if they didn’t, she was able to clarify rather quickly.

 Posted by at 7:07 pm
Jul 162010

I saw an ad on the side of a city bus the other day, which asserted

Lock it or lose it

Plus some details about how you should lock your doors to prevent crime.  This sort of thing is pretty common.  Nice people beware, criminals, do your worst... What does it say about our society?  What does it tell people who are prone to stealing things?

It reminds me of a conversation over a meal during a company Christmas party about ten years ago.  Somebody was talking about an acquaintance who was a real ‘computer security evangelist’.  This acquaintance would drive around town with his laptop looking for insecure wireless access points.  When he found one, he’d notify the owners that their system was insecure.  What alarmed me was that the person telling the story seemed to think this was a positive activity.  I asked him if he would consider it admirable for me to walk down the street trying doorknobs and when I found a door that was unlocked, go inside and tell the inhabitants that their house was insecure.  That started a lengthy debate  which promptly got off topic.

This is an interesting mentality.  I’ve seen signs and T-shirts with things like “Trespassers will be shot on sight”, or “Trespassers will be violated” on them, but these are typically intended as a sort of joke.    Instead, the serious signs are a warning to the honest folk that if they don’t lock their belongings away, or remove them, they might be stolen.  Does this play into the old line of “finders keepers”?  So if I go into some remote parking lot, and I check all the cars for cool stuff, can I feel better about myself for taking it because the previous owners should have known better, and this will teach them a lesson?

It’s probably no longer this way, but about 17 years ago I went to a conference in Japan.  While there, I met up with a friend who had been living there for a year or so.  He indicated that Japanese culture was really quite something compared to western culture.  The example he gave was that you could probably leave your brief case at the train station next to a bench and come back and get it the next day, complete with its original contents.  Wow.  In these days, if it hadn’t already been emptied of valuables, somebody would try to detonate it for fear of a terrorist attack.

 Posted by at 11:34 pm
Jun 022010

I was thinking the other day about how we’ve got the latest corruption of written language happening, where people sending SMS messages abbreviate and condense messages drastically.  There are many people who decry this as a disaster and a shame: kids these days can’t spell.

The Romans already had this happening…

Compare writing a full English message on a 12 button interface to writing it out with a pencil, or using a full keyboard:  there’s a serious time penalty for the 12 button interface.

Now compare chiseling information into a stone tablet to writing on parchment with a quill and ink.

Roman gravestones are a fantastic example of what happens when you have a serious penalty for each character you have to write.

For example, this funerary inscription in the Wikimedia commons is missing a lot of letters!  Being able to read Latin is not nearly sufficient to be able to make heads or tails of this – you actually need to know what letters they were going to leave out.

I still haven’t figured out how to read text messages from some people….

 Posted by at 10:26 pm
May 312010

So, we got hacked. It’s going to take a while to figure out all the things that got messed with. But I’ve now changed the permissions on the files on the servers so that they won’t be overwritten again.

One of the problems that’s lingering is that the text in the post composition window is white. While this probably doesn’t sound so bad, it makes it tricky to enter anything – because the background is also white!

Ok, so now I’ve resolved the background issue.  Not quite sure what caused that.

Anyway, it would appear that there are a few major security flaws in Word Press:

  1. All the files for the site are in the document tree for the web site
  2. they get installed as writable by the owner by default – tricky not to be otherwise you can’t upgrade
  3. there’s apparently some script that can be hijacked to overwrite a whole bunch of crap, and add stuff.  I found:
    1. multiple modified index.php files, with javascript tacked on the end
    2. all .js files had extra javascript tacked on the end
    3. a backup file that’s not even in the document tree for WP!

So this brings up an interesting point:  it’s cool and easy to use a hyper popular third party tool for stuff, but somebody out there knows all the weaknesses of the system.  If you write your own custom software, you really need to stick out to make it worthwhile for somebody to hack your site.  I’m 99% certain that this was an automatic hack-job, not somebody specifically targeting me.  If I’d written my own blogging tool, it wouldn’t necessarily be as easy to use and as slick (hey, I only have so many hours in a day) but it would be much less likely to get hacked by an automatic script.

Homogeneity across systems is a recipe for vulnerability – once a vulnerability is uncovered in one system, all others are vulnerable.

 Posted by at 9:57 pm
May 032010

DafodilsSo we just got back from an annual voyage to Germany.  It was nice.  It’s spring there, which means it’s getting warm.  Unlike Calgary, where spring means that it’s going to start snowing randomly and energetically.

On the flight over, I was struck by a few things in the airplane.  One was the backrest of my seat, the other a sign in the lavatory.

The backrest actually physically struck me, as the guy sitting behind me didn’t seem to realize that the thing in front of him was supporting me.  He apparently didn’t know that if you use somebody’s backrest as a prop to get out of your seat, and then let go quickly, that person gets catapulted out of their reclining position.  It turns out that the backrests are used for lots of different things.  They support tables, people getting up to go to the bathroom (which I’ll get to in a minute) and they also support touchscreens for the in-flight entertainment system.

Now, I’m sure it seemed like an obvious solution to somebody:  put touchscreen interfaces into the head-rests.  Brilliant, this way everybody gets to have a personalized entertainment experience.  This would be great if it wasn’t actually a head-rest.  In between getting catapulted out of my seat I was getting routinely boxed in the back of the head because the guy behind me kept fiddling with his screen.  Maybe they just need to turn up the sensitivity of the screens, but it seems to require an awful lot of force to get anything to register on those things.  Then they’re out of calibration, and the first attempt at hitting a button turns out to be wildly inaccurate and that has to be followed by a few more shots before the desired button is activated. I’ve even been on flights where it was impossible to use the touch interface because the mouse cursor was so far out of calibration that I simply couldn’t get to the button on the edge of the screen.

I haven’t looked into airplane entertainments systems enough, I guess, to understand the technical challenges.  Even the newest systems seem oddly primitive.  But this is probably easily explained by the fact that they’re in an airplane and there are 300 of them.  This means that the technology has to be sound enough to work for most people on the plane (though not necessarily for me), not too expensive and We respectfully close the eyes of the dead.  No less respectfully we should open the eyes of the living.probably the most complicated thing is that they have to be very very unlikely to light on fire or interfere with the communication or navigation systems for the plane.  For those of you who doubt that cellphones can cause problems with these systems, try plugging your iPhone into your auxiliary jack on your car stereo and then leave all cell phone towers behind as you drive into the mountains.  There’s a few minutes of plaintive ticking and burbling that feeds into the wire until the phone finally gives up making contact.  Now, consider 300 cell phones in symphony…

Perhaps I can suggest that Apple get involved in the Airplane entertainment systems market.   They could probably get their magical iPads to behave, you could play some games, as long as they don’t involve the accelerometers, watch videos, listen to audio… They could be mounted like the table top is, except they’d be able to pivot, so you could leave the screen up on the seat back in front of you for viewing, or you could swivel it down onto the table so that you can play a game of chess or something.  Probably have it lock into a few positions in between for reading or browsing the internet.  Presto.  The guy in front would get knocked around less than 50% as often!

Update Sept 20, 2011:  This just in, or at least I just noticed it in the news.  Qantas is going to trial iPads and WiFi streaming entertainment.  They won’t be anchored to anything as far as I can tell, so it’s not guaranteed to be comfortable to watch a movie.  So perhaps there’s going to be a market for iHangers to hang your iPad off the back of the seat in front of you so that you don’t have to hold onto it.

The bathroom issue on planes is a special one.  I’ve been in many airplane bathrooms, and generally they’re not bad if you’re the first one in.  After 7 hours of flying over the Atlantic however, they’re really nasty places.  What struck me about the lavatories this time was the sign that’s been in every airplane lavatory that I can ever remember:

May we suggest, as a courtesy to the next passenger, that you wipe the sink with your paper towel when you are finished.

Or something very much like that.  You know, I’ve never been bothered by a bit of water splashed on the sink, but perhaps some people make a lot of mess otherwise and since they follow the advice I’ve never seen the mess.  But what really struck me this time was that there’ s a sign missing.  I think there should be a sign that says:

As a courtesy to the rest of the passengers who’ll use this lavatory after you, please refrain from urinating all over the inside of the lavatory.

What is it about bathrooms that takes away from people the simplest courtesies, like leaving the place clean for the next person?  Now perhaps the lack of urinals and the presence of turbulence means that males with insufficient aim will have a hard time with things, and maybe that many people using bathrooms for 9 hours (here’s hoping you’re lucky and they actually cleaned the space before you embarked) is just a recipe for a sticky floor and a smell that makes me not want to stand in the place, never mind suggest that my 5 year old daughter should actually get close to the seat, but it feels wrong.

In Germany, and in fact in other parts of Europe I’ve been to, the bathrooms are often attended by somebody who at least pretends to keep them clean.  In some places it actually works.  It’s the one positive thing I can say about digging into your pocket and pulling out 50 cents – it appears to buy something.  Although I’m not sure it’s something that should have to be bought.

 Posted by at 9:40 pm
May 032010

Ah, at long last.  We got both the kids onto cross-country skis and headed out into the woods this winter.  It’s been an 8 year hiatus, really, and while we haven’t been back-country skiing, the world has moved past us.

The simple cross-country skiing was fun.  Vanja figured out how to move quite quickly on the flats, struggled a bit on the uphills, and did ok on the downhills as long as they weren’t too steep.  But this was all tracked skiing.  You don’t have to think too much about the direction your skis are pointing, as long as you don’t lift them too high!

We decided on a bit of adventure – back country skiing, with an overnight camp in a snow cave, or more precisely a quinzhee.  We went with Dan and Magda and Paul.

Despite the overall lack of snow at lower elevations, the trail up Mosquito Creek seemed to be well covered.   We got the kids light-weight gear, and since we already had boots that we’ve used for back country skiing for ever – we rented back country gear.

Back country gear appears to have changed.  You can see that Monika’s skis are about as wide as she is.  Turns out that works great if you have plastic boots.  Our leather boots are comfy and soft and just can’t dig the edges of these wide skis into hard packed trail.  On the way in – no problem.  On the way out – agony; snowplow to slow down?  not a chance.  Dig in an edge to turn?   No way – the skis stay flat on the snow and you simply go the direction of steepest descent.

The way in was fun.  It’s slightly uphill, which is where Vanja excels, Ronia packed it in and rode (and slept) in the pulk.

The pulks are fun too, basically a covered sled that’s strapped to your waist with two long bars.  The first time you go down a hill with one, you realize what the bars are for.  Side hills are exciting as Dan and Magda demonstrated, starting with and overturned pulk and ending up with both almost over their heads.  I couldn’t get the camera out in time to catch them at their most spectacular!

Dan and Magda dig out.

Once in camp, the quinzhees can actually be quite exhausting to build.  You have to understand that we’re basically standing on one to two meters of powder and you can’t just dig a snow cave.  You have to build it.

You start with stamping down an area of snow that’s roughly the size you want the cave to be inside plus a meter on either side.  Then you start piling snow on top of that.  You don’t have to pack too much.  In about an hour, the snow will have refrozen into a fairly rigid mass, by morning, you’ll have to work hard to move it.

So once you’ve refreshed yourself with some soup, and let the snow set up, you start digging.

Dan digging in for the night.

Dan digging in for the night.

Dan got stuck doing all the digging himself which explains the lack of photographs from his camera.  I on the other hand had a team that managed to stay fresh enough to do the digging for me.  I just needed to move the snow away from the door as fast as I could!

Vanja digging in

Vanja digging in

Anyway, Vanja says we can do it again next year.  The skiing wasn’t so good he said, but making the snow cave was fantastic!


 Posted by at 7:42 pm
Mar 192010

Data hiding and abstraction;  two of the great benefits of object oriented programming.  Sometimes, however, they need to be left behind because you actually need to know what’s going on.

Take for example an image object I wrote that somebody was trying to access pixel by pixel.  It’s a c++ class with a COM interface so that it can be easily used in lots of other places.    There probably wouldn’t have been any problems if the images were small, say 640×480 pixels.  But we’re talking about 4000×4000 pixels, and 16 bits per pixel.

The offending code was something like:

myVal = myImage.PixelArray(x, y);

This looks innocent enough.  But why does the code apparently hang when you loop through the entire image?   Well, it’s because PixelArray returns a SAFEARRAY that the image object creates to give to the caller so that they can do whatever they want with their own copy image data, in a format that they’re familiar with.  That’s a 32MB copy.  Then for some reason the programmer takes one value out of that array and then throws the rest away.  It’s like calling up a dump truck full of gravel and then just taking one shovel full out and then sending the truck away…and doing that 32 million times.

Another exciting one involving large objects is garbage collection.  It’s so nice – you just throw things over your shoulder and the run time environment looks after cleaning up.  Works great until you start working with objects that the run time environment doesn’t understand (like a COM image object in .NET) so it can’t tell whether there’s a lot of stuff in the garbage bin.  We had an application that would run out of memory in under a minute.  We spent quite a bit of time searching for the leak and then discovered that we had to prod the automatic garbage collection frequently.   I guess this shouldn’t be so surprising: if you renovate your house you should probably order up a large bin rather than relying on the weekly collection.

Well, I’m not the first to talk about this sort of stuff;  Joel Spolsky’s article on the Law of Leaky Abstractions went into some more detail.

 Posted by at 11:36 pm
Feb 082010

Recently, at my place of work, I’ve been reviewing lots of drawings and mechanical designs.  Along the way, I’ve questioned a lot of things.  In particular, we have specified split ring lock washers in some places.  In other places in the assembly we don’t have lock washers, but have specified thread locker, typically Loctite.   In other cases we’ve got neither lock washers nor a thread-locker.

Now putting a thread-locker on a screw makes sense (if you don’t want it to come undone by mistake), except in places where you might worry that the stuff might not cure soon enough and might contaminate things.

So what about the split ring lock washer?  I decided to try to find out whether they actually lock anything, and whether they would still work reliably if used with a flat washer.  The answer should be easy, right?  After all, they’re called lock washers.

It turns out that the answer isn’t quite so easy, although some people think it is.   There are numerous articles and fora (that’s just two) on the subject.  There are at least a few simple articles that indicate that split ring lock washers help keep screws, nut or bolts from coming undone.  It seems people are confused, perhaps as confused as I am.

There’s a NASA Fastener Design Manual that asserts:

The lockwasher serves as a spring while the bolt is being tightened.  However, the washer is normally flat by the time the bolt is fully torqued. At this time it is equivalent to a solid flat washer, and its locking ability is nonexistent.  In summary, a lockwasher of this type is useless for locking.

Well, that’s pretty damning, and widely quoted on the internet.  It seems odd to me, though.  How does compressing a spring down 100% suddenly cause it to stop being a spring?  That doesn’t seem quite right.  Unfortunately, the author doesn’t indicate which of the 22 references in the bibliography give him the confidence to write this brazen statement.

So one author thinks it’s the spring component that’s supposed to do the trick, other people are convinced that you need the diagonal cut in the lock washer and hardened spring steel so that the washer bites into the opposing surfaces.  If that’s the case then maybe our NASA guy has it right:  once it’s completely compressed, there’s no way it could bite until things loosen off a bit.   And then it’s loose and you didn’t want that.  Bolt Science has some nifty videos showing how poorly a split-ring lock washer performs under transverse vibration.  The nut under test just unscrews.  Apparently sometimes even more quickly than just a nut, with no washer at all!

Ok.  So what’s going on?  Some people swear by them and some swear at them.  In many cases people seem to simply be expressing opinion, often quite vehemently, with only a bit of evidence.  Now, they’ve been used for years, and there’s enough experience apparently out there that they make a difference.

Perhaps one of the most convincing arguments for them is in the Handbook of Bolts and Bolted Joints (page 242).  Here they’re also referred to as helical spring lock washers. This argument is well thought-out, even referencing tests.  The author indicates that the washer shouldn’t really help much more than a flat washer because not only is it flat when compressed, but the spring force it supplies is significantly less than that supplied by the bolt itself.  A properly designed joint involves putting enough tension on the bolt or screw that it deforms under the load.  It stretches.  In doing so, it is supposed to keep the joint tight under a variety of conditions.  Even a flat washer can help in such a joint because it increases the effective length of the bolt, thereby giving a little more stretch.  In the case of the helical spring lock washer, apparently there is something much more devious afoot.  The washer, in cross section isn’t rectangular, it’s trapezoidal.  This apparently causes the washer to deform in a way that’s beyond the simple flat compression.  The trapezoid rolls somewhat and the ring opens.  The force required to do this, and the amount of movement involved is apparently significant.   The example given is that of a 7/16″ diameter fastener.  The spring component of the lock washer adds about .72″ to the effective length of the bolt, not including the thickness of the washer itself!  This length makes the joint a little more springy, which may seem like a bad thing, but 100% rigid joints are also risky, simply due to stress concentration.

This sentiment is also mentioned in An introduction to the design and behavior of bolted joints.  These books are long, so I’m rather thankful that Google has digitized them – they would be impossible to search in reasonable time otherwise!  On page 561, we get some more details on the research and testing of helical spring lock washers, referencing the same research as the previous book.   However by the top of the next page, there’s a table that gives a different picture.  The relative effectiveness of such a lock washer is about 5 times more than that of a plain nut, with or without a tooth-type lock washer.  But that’s not all that bad, especially if you consider that a Castellated nut with a lock wire (not to be confused with a cotter key or a spring pin)  is only 8 times better, at least under vibration.  Apparently, however this relative effectiveness is provided by a manufacturer of such locking schemes.  The author wisely indicates that you should do your own testing.

And testing is probably where it’s at.  This applies all over the place, whether I’m sourcing sealants or plastic tubing, the manufacturers’ spec sheets all end with a statement that indicates that you should do your own testing to make sure the product is suitable for your purpose.

 Posted by at 9:23 pm
Jan 242010

Back in December, I went tobogganing with the kids.  It was -20°C, and windy.  No problem, just don’t face the wind.

Me on a sled

Me on a sled

Today I went tobogganing again.  It’s -5°C and windy.   I got cold.   OK, maybe I wasn’t dressed as well as I should have been, and I probably was dressed correctly back when it was -20°C.  But this makes me wonder about the claims we make about high humidity making it feel colder.   Alberta has this ‘dry cold’ which doesn’t feel as bad, supposedly.  I know that when I go to Germany in winter it feels much colder than I expect it to be.

So how could this work?  Here are some hypotheses:

  1. the extra mass of water in the air causes an increase in cooling rate
  2. the water infiltrates clothing and decreases the insulation value
  3. it should actually feel warmer, since the higher the humidity, the less heat you lose from evaporation
  4. some other mechanism.

OK, lets start with the first option.  Well, sorry, it doesn’t seem to work.  At a dew point of -5°C, there’s not much water in the air.   This is the dew point you would have at 100% humidity and a temperature of -5°C.   We’re talking about 2g of water per kg of air, which is about 1m3 of air.   It seems unlikely that this little bit of water in the air would actually drain so much more energy as it gets warmed by our skin.

Vanja Disappearing

Vanja Disappearing

Ok what about option 2.  Well, unless we actually have 100% humidity, the water from the atmosphere isn’t going to condense in our clothes.  But the vapour that continuously leaves our skin at our body temperature of around 37°C will raise the humidity in our clothes far above the saturation level, especially if the air is already humid.  This will then not leave the fabric but will condense.  This makes the clothing damp and more likely to conduct heat rather than to insulate.  This seems like a reasonable candidate.

What about the third option?  It’s a myth.  We all know that hot humid climates can be uncomfortable – we perspire in order to cool off, but the water fails to evaporate so we drip and don’t get cooled.   So even at -5°C, if the relative humidity is 100% then moisture won’t evaporate, so we won’t cool!

Ok, so option one seems a little sketchy, option two seems to have some foundation in physics.  Option 3 does as well – it’s just a matter of whether 2 outweighs 3 or vice-versa.  It seems likely that both 2 and three happen at the same time, and given the number of people who assert that damp cold weather is more uncomfortable than dry cold weather it would appear that it’s likely that option 2 outweighs option 3; evaporative cooling decreases, causing our clothing to get damp instead.  Damp clothing conducts heat better, so we feel cold.

It would be nice to find some scientific evidence to this effect.  What I have come across is somebody who’s confused about how evaporative cooling works in cold weather claiming that you notice the evaporation more when it’s cold and humid. I’ve also come across a few answers on one page.

Well, there’s still option 4. I don’t have any other ideas. Anybody else?

It seems that it should be reasonably easy to prove scientifically what the humidity does to your comfort level:  set up a temperature controlled object that has a porous surface.   Keep its surface temperature at say 35C, and pump moist (ie 100% RH a t 35C) air through it at a constant rate.   Now change the temperature and relative humidity of the room and monitor how much power needs to put into the system to maintain the temperature.  Try with putting clothing on the object, etc.  Somebody must have done this already.

 Posted by at 10:09 pm
Dec 142009

So a while ago I was thinking of a clever noise abatement system for highways.   You could turn all that noise into electrical energy, maybe use it to power street lights.  Then I realized that it’s not completely free, I mean apart from all the hardware and transmission lines etc that you’d need to make it work.  There’s a risk that you’d actually reduce the fuel efficiency of the cars on the road.  I think there’s a risk that all the noise abatement systems in place already do that.   If you hem in a car with walls, then the air around the car is not as free to move, so the pressure must be higher.  And remember you can’t have it both ways:  it can’t be an insignificant loss if there’s a significant gain.

Then I read about somebody trying to harvest energy from crowds.  Now, imagine how tired you’d be when you got home after spending an afternoon in a shopping mall.   The energy would be sucked out of the bounce in your step.   This energy was meant to propel you forward, but a small bit of it got converted into light.  Is that free energy?  Not sure.  In order to produce that little spurt of power, you needed to eat something.  That food likely took an enormous amount of energy to produce.  It may be cheaper to rely on fossil fuel directly, or, heaven forbid, tile the enormous roof of that mall with solar panels interspersed with sky lights.  You could use solar energy to power huge moving walkways that would allow people to rest while shopping, they already have those in airports (although not solar powered that I know of).  Of course, we’re supposed to exercise, and burn off energy, but walking through an airport or a shopping mall is not usually considered an exercise regimen.  Now if they harnessed all the energy put into running tracks and weight lifting that might be a good idea.  But then we might need to subsidize the athletes’ food bills.   At least somebody would get a free lunch!

Now I hear of somebody who wants to use the turbulent wake of your car to charge your cell phone.  I can’t help but think that this is going to introduce drag and be less efficient than just using the power generated by the alternator that’s attached to the engine.  Heck, why not mould a solar panel into the body of your car and use that to charge your cell phone?  That could even charge your phone when you’re not moving, or charge your hybrid’s battery while you work.

Now piezoelectric cells that run off wind power might be a great idea in other places.  Like when I ride my bike to work, burning off all that expensive food.  There are invariably bits of my clothing that flap in the wind, at least they could help keep my mp3 player running, or power my lights.  Or if you happen to live in a windy place, perhaps this could lead to more compact wind power generation, stuff that doesn’t involve erecting a 60 foot mast next to your house.

Of course just because the application that drives somebody to develop a new technology is impractical, this doesn’t mean that the resulting technology is silly.

 Posted by at 11:47 pm