Apr 132014

Over the years, I’ve had the opportunity to read a few contracts.  Some of them I was expected to agree to and sign, others I just happened to read to see what commitments we had made to customers.

Now there are certainly some contracts that I don’t bother reading because it probably isn’t worth my time.  These are things like iTunes agreements which are 70 pages long, and most software licensing agreements.  But some are more exciting, like customer service contracts and employee agreements.

And it’s amazing what gets put into these things.  Really amazing.  And clearly nobody reads them, or if they do, they misread them.  here are examples of some of the stuff I’ve come across (paraphrased):

  1. Any wrong-doing by the Corporation is cause for dismissal of the Employee.
  2. We warrant that the product does not meet our published specifications.
  3. None of the above shall restrict the Employee from purchasing the generally available shares in any public company, provided said public company competes with the Company and provided Employee and Employee’s family do not control, in aggregate, more than 3% of the shares of said public company.

In each of these, the logic is backwards to what one expects.  In fact when many people read them, they also immediately read what the clause was supposed to mean, not what’s actually written down.  This doesn’t mean that you’d want to agree to it.  Of course, if you’re desperate for a job, you might not want to rock the boat too much.

But how does this stuff happen?  I can imagine in some cases that a contract has been around for a few years, and every once in a while, somebody edits the current corporate contract.  In some cases the person doing the editing doesn’t understand why a clause was in place and when they notice something that looks like it may be bad for the company, they turn the logic around.  Either that, or somebody is adding a sub clause to add some new restriction, or to specifically remove some implied restriction but they just get the logic wrong (1, 2, 3).

This sounds exactly like software development.  Without adequate controls on software, programmers will fix features and add bugs all the time.  At one company, we specifically implemented a process that required the programmer to write a proposal for fixing a bug or adding a feature, and this would be reviewed by a senior developer.  This was in response to programmers removing features (usually security or privacy related) because somebody reported them as bugs!  The success of this depended, of course, on the senior developer knowing what the software was supposed to do.

Some of the latest techniques for avoiding this are things like design by contract and test driven development.  These effectively give you a reference against which to check the code.  The idea would be that hopefully you didn’t get the logic wrong twice, so once you’ve got software that passes your tests or satisfies your contract you’ve got a good place to start from for next time you want to make changes.  The tests, in particular, should still pass even if you make changes to the code to add new features.  If they don’t, then you need to go fix what you just broke.

I wonder whether companies should always have a lay-speak version of their contracts maintained with the contracts that describes the intent of each clause and sub clause.  This way someone can read two versions of the same clause and if they clearly don’t agree, then something needs to be fixed.  Somewhere the intent needs to be documented so that random edits don’t expose the employee to lawsuits for patent infringement!  One could also imagine that this second document could include test cases like: ” Employee’s wife owns controlling shares in a Filberts Dairy Farms, a public company with shares traded on the TSE.  This ownership MUST be permitted by the agreement.”  (clause (3) would fail this test if the Company was an Oil company, because the Farms do not compete with the oil company!).  But can this be automated?

 Posted by at 12:29 pm
Dec 212012

Ok, perhaps the people who keep trying to sell stuff on my blog are hyper-intelligent pan-dimensional beings, but I’ll just have to deal with their projections into the two dimensional world of my blog, and they’re clearly morons.

Since they insist on trying to post and trying to create accounts, I’ve now turned off creating comments and accounts.

What a waste of energy.

 Posted by at 11:51 pm
Jul 182011

The other day, I opened a corrugated cardboard box containing some expensive electronic equipment.  The equipment was made by a large, reputable Korean firm.  It was sealed in a plastic/foil pouch.  Outside this pouch, was a bit of foam padding and about 6 grams of desiccant – silica gel.

Most of us wouldn’t think twice about this – the silica gel is there to keep the stuff inside dry.  But does it work? If it does work, how long will it work?

A desiccant is pretty much any substance that will adsorb moisture more aggressively than items it’s packaged with.  Wikipedia defines desiccant as a hygroscopic substance that induces or sustains a state of dryness (desiccation) in its local vicinity in a moderately well-sealed container.

Desiccants are used in all sorts of amazing applications for some really specialized tasks (check out the Wikipedia entry for more information).   They’re also used in basic packaging.  And they’re sold by the barrel.

So what’s the lie?

Well, suppose that a gram of silica gel can adsorb 20% of its mass in water – 10g of silica gel could then capture 2g of water.  Now I can’t find a water vapour transmission rate (WVTR) for cardboard, but I can give an example of a material which many people would think is impermeable:  Low density polyethylene (LDPE).  You’ve seen it everywhere, milk bottles plastic bags, etc.  A film of 5mil thickness (.005″ or .125mm) has an estimated WVTR of .28 g/100in2 in 24 hours (nice mix of metric and imperial).  Well, 100in2 is about the size of a piece of paper.  This device was in a box that’s  20″x20″x10″ – the surface area is 1500in2, and we won’t get started about all the gaps around the tape.  So even if this box was lined with plastic sheet, we’d see about 15 x .28 = 4.2g of water going through it in 24 hours (with external humidity at 90%, temperature at 100F).  Ok, so maybe the conditions are a bit extreme, but you get the idea.  Basically, by the time the box has shipped out of the Korean factory, the desiccant will be equivalent to sand.  Well, not quite.  We opened a box like this in Calgary in February, when the relative humidity is about 10% or less.  The silica gel probably dried out significantly in the process.

And the desiccant manufacturers are happy to sell more!

I’m not dissing desiccant out-right, there are many appropriate uses, but it’s not magic – you need to use it appropriately, or you’re just wasting your money.  In the case of the device we were looking at, the foil/plastic laminate pouch would have saved the device from moisture quite well, at least for a while.  Those pouches often have WVTR down around 5mg/100in2 in 24 hours.   The desiccant, on the other hand, was just there for not eating.

References: http://www.cttgroup.com/ralston/transfer.aspx?type=2&file=Water_Vapour_Transmission_Rates_en.pdf


 Posted by at 9:56 pm
Apr 092011

A budding designer in China has invented a new parasitic power generator!   Called the T-BOX, this thing is supposed to sit between the ties on a high-speed rail line and generate power from the wind.

So we use coal to make electricity to get a train to move to make wind and then use that wind to make electricity again!  This strikes me as an extremely expensive way to generate a little bit of power at the cost of reducing the energy efficiency of passing trains.

I’ve got a better idea:  make sure that the rail bed is as smooth as possible, or let’s say as aerodynamic as possible to minimize the drag on the train, and cover it with photovoltaics  so that it generates electricity when the train isn’t there.  That means that 99% of the day time at least, you’ll generate power, not just the 1% of the time that a train happens to come by.

But if he’s got a clever turbine design, then you could mount the thing with the axis vertically in urban locations to generate power from the wind blasting between buildings.

 Posted by at 7:46 am
Mar 022011

So I’ve been walking to work lately more often than riding.  I guess it’s a combination of windchill and icy roads that have kept me off my bike.

So I walk for about an hour to get to work instead of cycling for 20 minutes.  This probably burns something like 700 calories.

But now it’s -20C, which might change the caloric output required.  But which way does it change it?  A brief internet search brings up a whole bunch of conflicting information from various sources.  Ok, there are 3 opinions, the third one is that nothing changes.

Here are the basic arguments:

1) You burn less calories when exercising in the cold because your body has much less work to do in keeping you cool.  70% of the energy created when your muscles work is waste heat, and in warm weather, your heart needs to pump a lot more blood around, specifically to your skin in order to cool things down. (http://www.drmirkin.com/public/Ezine030605.html)

2) Colder weather forces the body to work harder to stay warm, so backpacking in summer might burn 3500 to 4500 calories per day, but winter backpacking can burn 4500 to more than 5000 calories per day (http://www.livestrong.com/article/292221-calories-burned-in-cold-weather/)

Wow.  Ok so apparently the world is not clear on this.  And just what is cold weather?  Perhaps some of these people are thinking about exercising in +25C weather vs +10C weather, what about -20C or -40C?

There are a lot of mechanisms at work, I suspect and there’s probably even a break-even point, where eventually your metabolism kicks up a notch to keep you warmer – I know that I’ve kicked my metabolism very hard with spending too much time at -35C (without much exercise and with insufficient clothing) and thereafter found sleeping in a house was stifling for a couple of months.  But that wasn’t exercising – I wasn’t trying to dump excess heat, I was just above shivering for many hours at a time ( at -35C in a sleeping bag rated for -15C).

Certainly, riding in snow or walking through deep snow burns more calories than walking on pavement, and one tends to wear more clothing in the winter, which could increase the weight that you transport as well as frictional losses.  That does impact me somewhat, as there are long stretches of snowy grass on my walk, my clothing, on the other hand is pretty optimal for the energy output – I would not survive the night sitting still in the clothing I walk in.  Maybe I need to wear less than enough to stay warm in order to burn extra calories.

Snowshoeing is crazy for burning calories because you can’t coast on the downhills, unlike Ronia in this possibly-too-long-shot-on-an-iPhone-while-cross-country-skiing film from last weekend at Ribbon Creek. Keep in mind she climbed all the hills to get to this point, you can hear her whooping with joy at various points:

 Posted by at 11:39 pm
Jan 282011

So I’ve written about hiding information before.  But now let’s consider the grocer who gives responses that instead of being empty and devoid of assistance actually send you in the wrong direction.  Have you any potatoes?  “Oh yeah, there’s heaps of them ’round back”.

I’ve just dealt with this again while writing some code.  First the app says “Out of Memory”.  But I’m wise enough to that to know that some COM library is old and is missing a few methods I’m trying to use.  Next, I’m trying to do a ping, by calling IcmpSendEcho.  The error code resolves to “Invalid QOS provider specific buffer”.  WTF.

I’m just trying to ping a device on the network to make sure it’s on and connected.  What does this have to do with a QOS provider?  I didn’t even make a buffer for this provider.

Turns out, after 40 minutes of searching Google, and by the way finding absolutely nothing useful, that the problem was that the IP address wasn’t properly initialized and I was using an empty string.  Was equivalent to ping

So why the obscure error code?

 Posted by at 12:19 am
Dec 012010

I remember when Microsoft came out with the idea of only showing menu items that you had used before.  It was great – if you had never printed a document in Word before, you would have to hunt around before you could find the ‘Print’ option in a menu.   I might be giving Microsoft a bad rap here of course, this was the first place I saw the behaviour, but it might not have been invented there.  The same joy happens with context sensitive behaviour – you can’t save an 8-bit image in JPEG format, so we won’t show you that option.

I think that the clutter free approach of not showing all the menu options if you didn’t normally use them was well meant but really silly.   My support calls for computer questions took on a new atmosphere: “Click on ‘Print'” – “I don’t see a ‘Print'”.  It was an interesting idea to reduce how much stuff you had to read to find the stuff you normally did – but that really is backwards:  for the stuff you normally do, you know where to find the option.  For the stuff you rarely do, you’ll now have to hunt harder than you used to.  It was the first option I turned off when I started using Office 2000 – once I found where to turn it off.

Context sensitive UI, where buttons and options disappear or appear depending on the context are also extremely frustrating for the user.  For the programmer, it’s a great way of avoiding work; none of that pesky writing meaningful and helpful error messages when somebody tries to do something that really can’t be done right now.  You just make it impossible for them to do it and don’t show them the option and off you go.

For the user of the software, on the other hand it can be intensely painful.  You question your sanity as you recall using this tool just yesterday and now you can’t even find it.   Or you find the tool, but when you try to use it, it ignores you.  I came across this in Apple’s iMovie just last weekend.  I was helping my dad with some old super-8 movies that he’d had put onto DVD, and we wanted to add some text commentary.  We added a title to a part of the movie – easy.  We tried to add one to another part of the movie.  Seemed reasonable, we tried to do it, but the software flat out ignored us.  Drop a title someplace and although we could go through the motions, NOTHING happened.  It just wouldn’t stick.  Turns out that you can only add one title to a clip, and since the entire movie was one clip (the clips were fused together some 40 years ago), nothing was going to happen, and it wasn’t going to suggest a better option.

Now suppose you go to the grocery store and ask somebody who works there where the potatoes are.  But it turns out that they’re out of potatoes so the guy just completely ignores you.  Would you be at least slightly surprised by this?  In fact you’d probably hunt down the guy’s manager.  So why do software developers think it’s a good idea? I suppose the grocer could also specifically avoid you so that you can’t ask him the question – does that make good sense?  Is it good customer service?

So this might bring back memories of Clippy, the helpful animated character that came up in MS Office in the mid 90s.  Some people say it was one of the few things from Microsoft’s research labs to make it out into the real world!  Clippy might have provided good customer service if it hadn’t been so annoying.   It would be like the grocer who runs up and offers cooking advice whenever you look at a vegetable; it wouldn’t be long before you’d want to punch the helpful fellow.  But oddly, it’s the sort of thing that might help, but perhaps they’d need to find a way to make the offer of help less obtrusive  and not as distracting – I think the animators got a little carried away with the various helpers that would invariable hang around, make noise, and be a nuisance.

 Posted by at 8:46 pm
Nov 222010

Freakonomics is an interesting book. It brought back a lot of memories of projects I’ve worked on and papers and presentations I’ve seen. Some of the special bits for me are the surprising statistical results. Like: Car seats haven’t done much to save kids’ lives, but they’ve made some

Filtering Water

companies a lot of money. I’d love to have the time to sit and look for this sort of stuff, it sounds cool. And I was just vaguely citing something like this a couple of weeks ago when camping: I didn’t bother to bring my water filter. I thought about it and figured that:

  1. Parks organizations feel they need to warn people about giardia (‘Beaver Fever’) so that they don’t get sued
  2. Water filter manufacturers warn people about it so that they can make money.

The kids and I drank unfiltered water from the Ghost River all weekend with no ill effects.

But mining statistics is a funny one. Working in digital radiography and developing image processing algorithms made me think a bit differently. Radiologists are looking for unusual things in images, not necessarily the standard things; hey, look two lungs! Patients come in with all sorts of deformities, like missing fingers, legs, you name it. So an image segmentation algorithm that looks for a hand in an image by trying to identify the 5 digits may be a bit unreliable; you don’t always get to see 5 digits on an ER radiograph of a hand! And when you do – they might not present themselves in a sensible set of straight lines. Crushing trauma does a lot of crazy stuff to the phalanges. Then you have X-ray images with metal plates and other implants – but these aren’t necessarily the norm, so you need to make sure that your algorithms can deal with stuff that isn’t normal, and most of the stuff you see isn’t normal. After all, that’s why these people are getting X-rays taken!  What about the few dead pixels in a CCD that you might encounter.   Suppose it’s 5 out of 16 million pixels that are bad.  Statistically insignificant.  But important because they distract the reader from the real pathology – a human eye will pick out the flaw immediately.

Similarly, if I had been the one who got sick with beaver fever after drinking water from the Ghost River, I probably wouldn’t care so much about how unlikely it was.

 Posted by at 10:27 pm


 Insights  Comments Off on Obsolescence
Nov 222010

So I took on a contract to do some web development. Lots of fun. And lots of hard work. I haven’t actively looked for this sort of work in about 7 years. I was happy to find that so many browsers these days support enough javascript and CSS to make these inventions useful! Woohoo, the world has come a long way. It was amazing to see fairly consistent behaviour too, although there are still some confusing things.

Then I discovered that a good 18% or so of my customer’s customers use Internet Explorer 6.0. Wow. Back to the Bat Cave – IE 6 is really old, and while it has support for AJAX, it doesn’t do it in the same way as the newer browsers do. I’m pretty sure I got it to work, but that was not fun.

Anyway, if you’re in need of some catering for a business lunch in Calgary, check out Portionality.ca.  Browsers may get outdated, but good food never does!

 Posted by at 10:24 pm
Nov 222010

I saw a sign the other day in Midland Ont. that read “radar speed controlled”.   I’m almost certain that this is what the sign had written on it; I’ve seen it twice now. While almost technically accurate; radar signals travel at the speed of light, I’m not sure that the sign accurately communicated the message intended.

Then as I got close to the airport in Toronto another one said “yield to oncoming traffic”. I was on a on-ramp which made me really nervous, ’cause I was sure I was going the right way!

That ranks right up there with the on-road painted signs that are written upside down, like AHEAD STOP.  Which reminds me of an XKCD comic.

 Posted by at 10:18 pm