Skritter!

This past year, I had the pleasure of advising a few students from my
alma mater, Oberlin College, as part of a new entrepreneurial program. Due to their hard work and keen business plan, they received a grant from the program to kick off their new venture: developing an application to help Chinese language learners learn to write the characters more efficiently. You can see this new application at skritter.com, and check out the Skritter blog for details of their development process. At the site, you can even try out parts of the product in order to help train their system and improve the recognition capabilities, which I encourage everyone to do. It's really exciting to see this all come together for them, and I wish them the best of luck as they push towards their 1.0 release.

The Situation of Bad Code

I've recently been enjoying the material on the Situationist Blog, which covers interesting articles and topics related to perception and how context influences our thinking. A recent post entitled "The Situation of Illusion", quotes from another book on how a magician performed his famous birdcage vanish:

. . when Blackstone did his famous
birdcage vanish (a cage with a live bird vanished from his bare hands) he would hold his arms outright in front of him, seemingly presenting
the cage to the audience for their inspection. . . . The cage was
specially designed to collapse on command. At the appropriate time, Blackstone would toss it forward, and the collapsed cage would be
pulled up his sleeve – bird and all. Savvy adults watching the show
might shake their heads and say, ‘Nah, it couldn’t go up his sleeve
because he wouldn’t want to injure the bird.’. . .

* * *

Actually, in many cases the bird was injured or killed. [Emphasis theirs]

In doing maintenance programming, this same effect appears. Often I look at a piece of code, read it over a few times to try to understand what it is doing and how it is attempting to accomplish that task and I say, "They can't possibly doing it that way. That would be ludicrous!" So I read it again and again trying to convince myself that I am missing something or that the task to be performed is more complicated than it seems. "Nah", I say to myself, "they woudn't use a linked list here, they need quick index-based access to the data". But looking at all those iterator functions that count up to a particular value, only one possibility is clear: they are injuring or killing the bird.

I want to believe that all programmers are good, and that if they might not choose the same method of attack that I would, they at least choose a sensible approach, but frankly, I think I'm giving a lot of coders too much credit. Whether it's because of tight deadlines, an ignorance of existing libraries, a limited knowledge of algorithms, or just not caring, a lot of bad code makes it into good systems. Accepting that you will encounter a lot of hideous suboptimal code actually makes your job easier. Instead of wasting time assuming that you must be missing a critical fact, you can focus on repairing and improving those terrible sections.

Trying out Tumblr

After a decent trial run, I've decided that the blogging feature in Drupal, at least as of the 5.x stream, is not especially conducive to the writing process. Partially for my own edification about the platform, and partially because I looks like fun, I've started a Tumblelog at dailyfix.tumblr.com. The idea is pretty simple: as often as I can, I will be posting a fix for some problem I've encountered, in the hopes that others will find them useful, and to track them for my future use since many of these problem recur and I have to dig up the previous fix from Google or from memory.

I will continue to post here occasionally, but will focus on essays more than blog posts since I find that format more natural. Enjoy!

Ensnaring a Good Programmer

On more than one occasion, I've been asked by a client to dig into an issue only to discover that either it appears that the feature or bug has already been implemented/fixed, or that 99% of what would be necessary to make it happen is already in place.  I pride myself on my honesty in these kinds of dealings, as in general, I find that making someone happy by saying "I only spent an hour on this, because it turns out someone has already fixed it" is worth 100 times what I might have gained by pretending to fix or refixing it in some alternate way just to bill a bunch of hours.  Not only is the customer pleased to get something more or less for free, but I gain their trust that I am not going to jerk them around in future dealings. This is critically important when you need to deliver bad news, such as when something that appeared to be straightforward will actually take much longer than expected.

This situation comes up in any circumstance where there is significant information disparity between customer and expert.  I belong to Angie's List, and the comments on many of the top-rated providers are of the form "I took my {furnace, car, stove, etc} to 10 repair people who all said that it would need to be totally replaced for $2000.  Then I heard about Super Repair, who came out to my house, took one look at it, hit it with a hammer, and now everything has been working perfectly! A+!"  The recurring theme is that true experts don't feel the need to earn their living by overcharging for full replacements and extra work; they would much rather solve the problem and move on to their steady stream of referrals.  This got me to thinking, if you are in the market for a high-quality contract developer, in the absence of a direct referral, could you plant such a bug or feature among your list of things to do in an effort to check the quality of the contractor?

The idea is fairly simple.  Just add a bug or feature to the list that you know has recently been resolved.  Make sure to point the contractor to the approximate section of the code where you know this fix to reside (since it's very possible in a large code base that even a very competent contractor could look elsewhere for a resolution and miss the fix).  There are a few possible outcomes:

  1. They come back to you and say "it looks like this is already there".  You know you've got a good contractor on your hands. 
  2. They end up billing a couple of days to it and saying nothing about it.  They are either lying or incompetent.  Steer clear.
  3. They bill some time to it, discover that it is already there, and say as much.  This can easily happen when someone starts with a different approach to solving the problem but then eventually finds themselves in the code that already has the fix.  This is the cost of this trick: billing on something that has already been fixed.  You probably still have a decent contractor.

It's also possible that they sniff out the set-up, but if they, like me, have seen this happen often due to simple communication problems on a team, that seems unlikely.  Overall, I would bet that it would be an effective and relatively low-cost way to quickly vet a prospective long-term contractor.  Has anyone out there actually tried this?

The World's Least Confusable Domain Name

I own a handful of domain names, some for corporate purposes, and I also have a personal domain that I use for my personal email. This domain name is sort of a pun on my last name, and it's a made-up word. Combined with a tricky orthography (there is an 'L' next to a 'T' which, when written lower case can look like a sloppy 'H'), I'm always hesitant to give it out in any form other than electronic since it will almost assuredly be mistranscribed at some point.

When I selected the domain name way back in '99, I never considered the "confusability" factor of the name. I'd love to select a new domain to use for personal purposes that is easily understood in non-electronic contexts, but I've had trouble selecting one that meets all the necessary criteria. Here are my basic constraints:

  • It must be easily understood when spoken, such as when given out over the phone.
  • It must be easily understood when written, either in upper or lower case letters.
  • It should be interesting enough to be memorable, but not goofy or unprofessional such that I would be embarrassed to write or speak it.
  • It must be available!

These constraints imply a lot of things, based on my experience.  To be understood in a spoken context, the name must:

  • Consist of dictionary words, preferably a small number - Non-dictionary words, especially cutesy ones that you find in a lot of domain names, almost always require a letter-by-letter spelling.  Negative bonus points for intentional slight mispellings of a common word (Flickr and other annoying Web 2.0 convention-followers, I'm looking at you).
  • Avoid homophones - People will invariably use the wrong version.  You will be surprised how many homophones there are when you start trying to come up with names that avoid them.
  • Avoid numbers - Unless you want to buy both mydomainone.com and mydomain1.com
  • Avoid sounds that run together and create sound-alike words - For instance, you probably don't want to go with MicePace.com

To be understood in a written context, the name must:

  • Avoid i, l unless in a totally unambiguous context - They will inevitably be transcribed alternately as each other, or as the number 1.
  • Avoid o, unless in a totally unambiguous context - It will inevitably be transcribed as a zero.

Finally, the trickiest one: something that is memorable, but not embarrassing must:

  • Use an odd combination of words, or be oddly related to the person or service using it.
  • Use hard consonants or alliteration to create a strong sound
  • Evoke a strong image in a person's mind.

So what domain names currently meet all these criteria?  One great example is amazon.com.  It consists of a dictionary word, does not have a homophone or other sound-alike element, has no numbers, uses 'o' in an unambiguous context, is oddly related to the product, and evokes a strong image.  Distancesoftware.com is not outstanding, as the ending 's' of Distance and the starting 's' of Software blend together in a spoken context, but overall I've been happy with it.  If you have other examples of either very good or very bad domain names from a confusability standpoint, please post in the comments.  I'll update when I select a new personal domain.

What Constitutes Rational Economic Behavior?

Psychology can be a tricky thing. Experimental results often seem to indicate very surprising things about human behavior, but the lack of context in an experimental setting can often obscure the data, or make it difficult to draw clear inferences. One area in which human behavior is especially hard to understand is that of financial reasoning. This article in the LA Times (hat tip: Freakonomics Blog) does a particularly poor job, in my opinion, of drawing conclusions from some experimental data in that domain. From the article:

Would you rather be A or B?

A is waiting in line at a movie theater. When he gets to the ticket window, he is told that as he is the 100,000th customer of the theater, he has just won $100.
B
is waiting in line at a different theater. The man in front of him wins $1,000 for being the 1-millionth customer of the theater. Mr. B wins $150.

Amazingly, most people said that they would prefer to be A. In other words, they would rather forgo $50 in order to alleviate the feeling of regret that comes with not winning the thousand bucks. Essentially, they were willing to pay $50 for regret therapy.

That seems like a fairly broad claim, but the article goes on to describe experiments with capuchin monkeys and a rather innovative "fruit-based" economy, which shows that, like with humans, losses are considered to be twice as bad as gains. All of this seems like reasonable research, but the author starts in on the theme of "can you believe how irrational we are?":

This research goes a long way toward debunking one of the biggest myths in all of psychology and economics, known as "Homo economicus."
This is the theory that "economic man" is rational, self-maximizing and
efficient in making choices. But why should this be so? Given what we
now know about how irrational and emotional people are in all other
aspects of life, why would we suddenly become rational and logical when
shopping or investing?

First of all, this author clearly knows very little about modern psychology, which would shudder at his equating of emotional and irrational, but the bigger transgression is his conclusion that this is irrational behavior in the first place. Whenever a result like this is uncovered, it immediately has to be squared with notions of fitness and evolution. Either this instinct serves some bigger purpose, or it is a holdover from a time when this instinct was valuable but is no longer (or there is a remote possibility that it has been genetically "bound" to another. more valuable trait, but that can be incredibly difficult to show). The author of the article makes no attempt to try to understand why we might have such a behavior, but I would guess that we simply have a default risk-tolerance profile that was evolved to be the 2:1 gain-loss ratio. Just because this can be triggered by other unusual circumstances doesn't mean that it isn't an overall good strategy. That would be like saying that the eye-closing reflex is "irrational" because it can be triggered by imagery in 3D movies.

Later in the article, it talks about one of my favorite, and to me, most misunderstood, pieces of psychology of economics research, the ultimatum game:

Consider one more experimental example to prove the point: the
ultimatum game. You are given $100 to split between yourself and your
game partner. Whatever division of the money you propose, if your
partner accepts it, you each get to keep your share. If, however, your
partner rejects it, neither of you gets any money.

How much
should you offer? Why not suggest a $90-$10 split? If your game partner
is a rational, self-interested money-maximizer -- the very embodiment
of Homo economicus -- he isn't going to turn down a free 10
bucks, is he? He is. Research shows that proposals that offer much less
than a $70-$30 split are usually rejected.

Why? Because they
aren't fair. Says who? Says the moral emotion of "reciprocal altruism,"
which evolved over the Paleolithic eons to demand fairness on the part
of our potential exchange partners. "I'll scratch your back if you'll
scratch mine" only works if I know you will respond with something
approaching parity. The moral sense of fairness is hard-wired into our
brains and is an emotion shared by most people and primates tested for
it, including people from non-Western cultures and those living close
to how our Paleolithic ancestors lived.

Has the author never attempted to conduct a deal? Try making a few deals where you leave money on the table, and you'll find out how quickly word gets around that you are an easy mark. People citing this type of research always wan't to tie it into a notion of fairness, but I don't think fairness is a factor at all. It's about reputation. The message that you won't make a bad deal is far more valuable in terms of future dealings than the small cash you might have pocketed up front. Just because the game as played has no consequences for the future doesn't mean that we can simply turn off the instinct that says "make a statement about how you are a tough negotiator, even at the expense of a few bucks".

The final statement of the article just makes it clear that the author has an axe to grind, and does not in fact have any understanding of modern psychology:

When it comes to money, as in most other aspects of life, reason and rationality are trumped by emotions and feelings.

Scientists spent decades making statements like the above, only to have it all debunked by current researchers who wanted to solve the riddle of how we could have possibly survived with such "terrible" insticts. Many things that were once believed to be evolutionary driftwood, like emotions, have turned out to be some of our most important processing machinery. It's critical to remember that any time we have experimental results that thumb their nose at the notion of evolutionary fitness, we need to stop and seriously consider what role that instinct may be serving in the current or past survival of the species. Failure to do so is simply bad science.

Fun with "Mystery Diagnosis"

I have taken to watching a show on, I believe the Discovery Channel or maybe Discovery Health?, called Mystery Diagnosis. The idea is simple: it tells the true story of someone with a disease for which they had trouble getting a correct diagnosis, but then eventually they either talk to the right person or get the right information to find out what the problem is. In many cases, they've needlessly endured a treatable illness or condition for years, and the resulting diagnosis and treatment is life-changing. It's a feel good program, but it raises a lot of critical issues.

I've noted a few recurring themes in the program:

  • Almost invariably, the sufferer is given a cursory diagnosis that, at least in hindsight, appears to match their observed symptoms extremely poorly. Often friends and family members are extremely frustrated by the failure to dig deeply into the illness, while the patient is often oddly satisfied by the explanation despite their ongoing suffering.
  • The "mystery" is often not very mysterious at all once a doctor cares to take a serious look at the problem. In one recent episode, the initial doctor repeatedly dismisses a man's massive adominal pain and horrific bleeding as "bad hemorrhoids". After the man switches insurance and is essentially forced to see a different doctor because of network coverage changes, he is immediately given a full colonoscopy which reveals stage III colon cancer. That's far from a "mystery" diagnosis and more like massive malpractice by the initial doctor.
  • The succesful doctor usually solves the mystery by using a combination of careful inspection of the patient conditions, listening and really trusting the patient's self-reported problems, targeted diagnostics, and reasoning about pathology. Once a careful catalog is made of the issues, history, and some simple bloodwork, the problem is almost always fairly obvious.

I can't help draw parallels to my experience diagnosing software failures. A mysterious problem often turns out to be fairly obvious when the symptoms are actually catalogued and investigated, and there are often one or more "experts" who have come up with a variety of hypotheses, none of which seem to match the available facts. In the world of medicine, certainly the stakes are much higher, but a serious software bug can still cost dozens of companies hundreds of hours in downtime or lost productivity. I wonder the same thing about both medicine and software: what will it take for the field to decide to get better at diagnosis?

Attack of the Spam Marketers

As I mentioned in an earlier post, I just moved into a new office space, and along with that, I set up new business service with Time Warner cable for internet and phone. I made one fatal mistake when setting it up, which was to fail to add the business line to the "do not call list" as fast as humanly possible.  My phone has been ringing off the hook with companies looking to sell me credit card processing, of all things.  Luckily, they are fairly easy to spot:

  1. They call from 800 numbers or out-of-state numbers that are not known clients.
  2. If I decide to pick up the phone, they invariably ask for the owner of "Dist Software", since somehow it got abbreviated in whatever registry they all get their information from.
  3. They all immediately ask "Do you currently accept credit cards?"

I will never buy anything from any of these companies.  I don't accept credit cards because I have no need to.  Most clients I deal with pay by check, and for my very occasional need for credit cards, I am happy to pay the Paypal fee.  I will never buy anything from a company that is so lazy that it can't learn my actual business name, has no idea of what I do for business and therefore whether or not I need their services, and who does not see the harm or waste in endlessly calling me to sell me a service I wouldn't use.  Someday, if/when I need credit card processing, I will ask around to my contacts in the industry to find out who they use and like, get actual salespeople on the phone, and look for the right combination of features and price.  Hopefully my do-not-call list registration will kick in this week and stop this ridiculousness.

The Digital "Dropsies"

Once every few months, I get a case of what I call "The Digital 'Dropsies'", named after the problem that can temporarily affect a previously sure-handed wide receiver. During this affliction, which usually lasts about 24 hours, every technical thing I try to accomplish seems to encounter unexpected hurdles, bizarre failures, simple mistakes that get magnified into serious issues, or all of the above. Nothing that happens is critical. It's not massive data loss or huge setbacks, just a serious of breakdowns that make me want to get away from technology for the rest of the day.

I had one of those days yesterday, and I'm just now recovering from the effects. Here are some of the highlights:

  • I was working on an AWS EC2 instance (a virtual server instance hosted with the Amazon Elastic Computing Cloud) and needed a non-standard port open. Instead of just looking up the right way to do it, I just tried figured I would use the usual tools on the Fedora Core 4 image I was connecting with. So I ran the firewall config tool, set the port to open and saved it. Somehow I managed to accidentally wind up with a machine will all ports filtered, so I lost my ability to connect with ssh, which apparently with an EC2 instance is equivalent to"bricking" it. There was not yet any critical data on that machine, but I was forced to get a new instance created and reupload and reconfigure a bunch of stuff.
  • I wanted to try out Ubuntu Gutsy, so I torrented and burned a copy of the live CD. I ran the live version, and then set it to install. Halfway through, I wound up with an I/O error, and so I ran a consistency check on the CD, which turned out to be invalid. I don't think I've ever had that happen before.
  • Instead I decided to install Fedora Core 8, so I kicked off a torrent download. About 10 minutes in it crashed my network. I restarted my router and it completed without issue.
  • I had the aforementioned problem with Windows Tablet edition getting locked up with some kind of DVD driver conflict. For those interested, I did resolve it, but only by running msconfig and disabling all startup items. I'm still not sure which of those processes is to blame, and I don't have time for a binary search right now.

Fortunately, it vanished as quickly as it came. Today I was able to fix the DVD problem, along with resolving a host of other nagging issues. Most importantly, Fedora Core 8 is excellent, even allowing my tablet to suspend/resume without issue out of the box, something no previous release could do. Combined with having my machine set up to effectively develop in two different environments (Linux + Eclipse/Windows + Visual Studio), it was actually worth all the trouble I went through yesterday.

How Far We've Come

I recently decided to upgrade to Fedora Core 8, and since I have been doing a lot of Windows development, I decided to back up my personal data, wipe the slate clean, repartition the disk and add my old version of Tablet XP back onto my laptop (the OS it shipped with).  It was an interesting experience, and it shows just how far Linux on the desktop has come. 

Windows Experience:

  • I used the Toshiba restore disks that I created when I originally got the machine.  The restore went fine, but of course there's no option like "preserve existing partitions" so I made sure to do the Windows installer first or I would have had to redo the Linux install.  At least it offered me the option of restoring to a partition instead of just assuming the whole disk and making me fiddle with the partitions afer the fact..
  • After getting it installed, I had to uninstall a dozen or so of the bloatware products that ship with it by default to make it usable.  My system tray took up practically half of the taskbar!
  • It gave me some warning about one of the DVD drivers needing to be disabled and that there should be no problem regardless of which one I left enabled.  Mind you, this is on a factory-fresh restore. Why would you ship a version of your system with a conflict built into it?
  • Of course, despite their assurances, I have somehow hosed the DVD drive, or so it seems.  When I insert the Visual Studio install DVD, and I get a random, unkillable process that sucks up 50% of my CPU, hangs explorer.exe, and will not let me logout, reboot, or shutdown.  Other than that, it's fine.

 Linux Experience

  • Install works like a charm.  It recognizes my windows partition and checks if I want to add that to the grub configuration.
  • All hardware seems to be working.  It certainly doesn't have any trouble opening the Visual Studio DVD.
  • As a bonus, I get the lovely Compiz experience.  It doesn't get much better than desktops on a cube.

All in all, my Linux installation was faster, user-friendlier, and had a better outcome.  Maybe I'll check again if Visual Studio will run under WINE...

Syndicate content