20161101

The Best Tool I Ever Wrote About, and Why

"No man but a blockhead ever wrote, except for money" —Abraham Lincoln

As you may know, I run a few websites. The most-used one is GGTracker, a website for Starcraft players to get better faster. It analyzes their game replays and tells them some things about their games.

Like many websites, it is powered by Amazon Web Services (AWS).

AWS provides a suite of services that you need if you're making a website. One of the simplest and most powerful services offered by AWS is S3, which is like an infinite-sized hard drive. It's awesome and reliable.

What's not awesome about it is that it's not terribly user-friendly. And it's kind of hard to get basic usage reports out of it.

Enter S3Stat. S3Stat sends me a weekly email report showing that I'm currently spending about $0.34 per week on S3. It's important for me to keep an eye on that number, because it could jump without warning to $10 or $100 for a week if someone decides to abuse my website. I could program AWS S3 to have some limits, but AWS is so hard to use that I'd rather not spend the hour or two to learn how to do that, and even if I did it I wouldn't be sure I had done it correctly. Easier to just use S3Stat and get the weekly email telling me that everything is normal.

The S3Stat email is enough, but if I want to see more detailed stats about usage it's all there.

So, why am I writing about S3Stat? I use all kinds of awesome tools and usually can't be bothered to write about them.

S3Stat are also marketing geniuses. They gave me a one month free trial of their service which was enough for me to see how it works. At the end of the month, they warned me in advance that they were going to start charging me (very nice and friendly, makes me like them) but that of course I could cancel if I wanted to. But that if I'm going to cancel, I should be sure to log in and delete my records from their system for my own security (fair and a good point, makes me like them).

When I log in, I notice that they offer a "Cheap Bastard Plan" which I like, I'm a cheap bastard, what's that? Well, the Cheap Bastard plan is that you write a blog post about their service, and then you get their service FREE, forever!

Not only am I writing a blog post, but then I'm gonna tweet and facebook about it, because it's interesting and these guys are geniuses and more people should do business like them.

Have you seen other people run their business like this? Tell me about it in the Comments below.

20141208

How to Get a Restaurant Reservation with only 57 lines of Code

The restaurant I wanted takes reservations six weeks in advance, every Monday at 10:30am.  So every Monday I would call a few times, and then give up. I don't have time for this nonsense!

Then I got mad and realized I could use Twilio.  Twilio is a neat system that provides programmatic access to the phone system — making calls, receiving calls, conference calls, recording calls and sending/receiving text messages.

Twilio was fun to learn. Once you get it working, you can make phone calls from the command line! I wrote a little script that would call any number, and if it was busy, hang up and try again right away. Once it gets through, then it adds them to a conference call, which I'm already in.

So this morning, the moment of truth came and we started dialing away.  Six minutes and seventy call attempts later, I was in!

Easy :)


20140909

Using AppleScript to block access to distracting websites at night

The goal: block access to timewaster websites at night so that they don't keep you up late.  My Superego program can kill your whole browser at night, but sometimes that's too severe and you just want certain sites to be blocked.

I chose AppleScript as the tool for the job.  I hadn't written AppleScript before, it was almost fun.


set t to (time of (current date))  
if (t < (6 * 60 * 60)) or (t > (22.25 * 60 * 60)) then   -- when it's after 10:15pm or before 6am
tell application "Google Chrome"
repeat with w in windows
repeat with t in tabs of w
repeat with badurl in {"reddit", "ycombinator", "twitch"}
if URL of t contains badurl then
close t
exit repeat
end if
end repeat
end repeat
end repeat
end tell
tell application "Safari"
repeat with w in windows
repeat with t in tabs of w
repeat with badurl in {"reddit", "ycombinator", "twitch"}
if URL of t contains badurl then
close t
exit repeat
end if
end repeat
end repeat
end repeat
end tell
tell application "System Events"
set processList to get the name of every process whose background only is false
if processList contains "Firefox" then
-- display dialog "Firefox is running"
tell application "Firefox"
activate
tell application "System Events"
keystroke "l" using {command down}
keystroke "c" using {command down}
set currenturl to the clipboard
repeat with badurl in {"reddit", "ycombinator", "twitch"}
if currenturl contains badurl then
keystroke "w" using {command down}
end if
end repeat
end tell
end tell
end if
end tell
end if


(The Firefox code is different from the Safari/Chrome code because Firefox doesn't support the same AppleScript interaction.)

Then, I run this script by cron once per minute, using the osascript command.

20140523

Data-diving my way to a winning Gold-league PvZ build

PvZ has been my weak spot for a long time.  Very frustrating, and I felt like I had no idea what I was doing.

I finally buckled down and took a deep dive into the data, looking for a strat that would work for a Gold-league scrub like myself.  In particular, I was looking for a strat that would work from silver/gold up to gold/plat and didn't require an APM over 80.

My site GGTracker has millions of replays, and there are several thousands of PvZs in there played since the last patch (March 1st) and in my league range.  Zergs win ZvP in Gold/Plat about 55% of the time, since March 1st.

Then I split up the games by what time Protoss completes their natural expansion.  The majority of Protoss complete their Nexus at 6:00 or later (meaning they start it at 4:20 or later), and those players lose 60% of the time.

FlatlineSC2's 1 GateFE into 4 Gate Pressure into Immortal/Sentry All-In starts its Nexus at 3:50, finishing at 5:30.  That seemed like fun to me, and the PvZ winrate associated with that timing wasn't as bad.

In that build, the all-in immortal/sentry army moves out around 10:00, so I used that as a benchmark: 45+ workers, 6+ sentries, 2+ immortals.  Of course the GGTracker replays might be a biased sample, but in those 92 games, the Protoss wins 80% of the time.

I like those odds!

After practicing twice against the AI, I played the strat on ladder and...   I won!


I realize that "Immortal/Sentry" is nothing new.  What was new to me was:

  • confirming from data that it actually works in the Gold-league range (after all, some strats are solid but require too much multi-tasking or micro to work in Gold)
  • confirming that the win rate is relatively APM-independent (at APMs of 60 or above, there is no clear relationship between APM and win rate for this strat)
  • being able to watch a bunch of gold-league level replays of people playing this strat, to see exactly how they scouted, protected their expansion, how many gateways, and all the other little details.


In my particular game, the immortal/sentry push at 10:00 did a lot of economic damage, but due to my crappy micro and army positioning I wasn't able to finish the game right then and there.  After another so-so push at 21:00, some proxy zealots spied that he was going broods, so when his brood army showed up, I was ready with voids and stalkers and he had a bad time.

What do you think, is this strat actually viable or am I being fooled by these 92 games?

20140507

Superego


"You really do need a system"  —Leonard Shelby, Memento


Until a few months ago, a lot of my evenings went like this: after everyone else went to sleep, I'd fire up the computer, grab a sleeve of crackers and a fresh tub of Nutella, play video games, and read Facebook, Twitter and Hacker News.  I was rolling!  I'd roll straight through to one-thirty, two and beyond.


Basically this


The next day, I'd wake up bleary-eyed with a nasty grumpy brain fog.  Bad, bad, bad, I was mad at myself for being so stupid.  I did the math and on average, I was getting six hours' sleep, not really enough.  And in retrospect, the late nights weren't even that much fun.  Like eating a whole bag of potato chips in one sitting, in recollection, they don't seem so delicious.

I tried to be more responsible, many times, but nothing worked for long.  During the day I wanted to do better; but when night came, I wanted to stay up and play.  I started tracking my sleep with the Jawbone UP; that helped for about two weeks.


A device for measuring my failure


Three months ago, after yet another morning waking up tired and angry, I realized that simply wishing and wanting to do better was not enough.  I put on my thinking cap.  What was actually going to fix the problem for real?   Well, I'm a software programmer; I program things.  I can't program myself, but I can program my computer — to simply kick me off after a certain time of night.

So I built a system, called Superego, which does just that.  It works like this:

A) The Jawbone UP tracks my sleep.
B) Superego sets the day's Computer Curfew time based on how much sleep I've been getting lately.
C) At Computer Curfew time, Superego shuts off all web browsing and games until 6am the next morning.

Now I'm getting seven and a half hours of sleep a night.






Some common questions:


I need this!  Let me have it!

If you've got a Mac, sign up and go for it!



Can't you just work around Superego by using your computer's administrator password?

Yes, and that's why I hid my administrator password.  I made a new password and printed out five copies.  One is at work, one's in the cellar, another's in my wife's nightstand, and there's one in each of my kid's piggy banks.  During the day, I can easily get the password if I need it.  But at night, my wife is a light sleeper, so if I try to open her nightstand drawer, she'll catch me.  If I make the long trip down to the cellar, I'll come to my senses, give up and just go to bed.

Most important, if I do somehow circumvent the system and stay up late, the next day I will do what it takes to prevent a recurrence — for example, hide the passwords in places even more remote.


How is the Computer Curfew time set?

The Computer Curfew time adjusts every day based on how much sleep I'm getting lately.

It's like how you hit a target with a bow and arrow on a windy day.  You aim and shoot; if the arrow falls a little to the left, you aim your next shot a little further to the right.  With the Computer Curfew, the target is seven and half hour sleep.  When I get less sleep than the target, the next day's Curfew is earlier; if more, later.

For example, last night was a good night — eight hours, sixteen minutes, more sleep than I need — so tonight's curfew is 10:25pm, fourteen minutes later than the previous night.

The actual math is nothing too fancy; a weighted average to compute recent sleep, and another to compute the recent curfew.  If recent average sleep is ten minutes more than the target, then tonight's curfew will be ten minutes later than the recent average curfew.


Can't you just stay up late watching TV or reading instead?

For whatever reason, late-night TV and reading are not a problem for me; I don't like TV, and when I read at night, I fall asleep pretty fast.


This would never work for me, my problems are different.

Indeed, people have all kinds of different sleep-related issues.  If you think a modified version of this system could help you, let me know.  I love doing this kind of self-improvement stuff.




Why so much effort and nonsense, why don't you just go to sleep at a reasonable time?

Ha!  If you are one of those "willpower" people who can just decide to do something and then actually do it, good for you.  The rest of us aren't so lucky.




I have more questions!

Please ask away!  I'll add the common ones to this article.






20131001

First Peek at My Sleep Data

Last night I attended the New York Quantified Self Meetup.  It was nice to finally meet a bunch of my kind of nerds.

Inspired by the sleep talk, I downloaded my Jawbone Up data and tried to replicate the speaker's finding that deep sleep % is correlated to previous night's sleep duration.  In my case there does not appear to be such a correlation:


Also interesting, the amount of deep sleep seems somewhat unrelated to the amount of total sleep — ~4 hours of deep sleep regardless of whether I'm sleeping 6, 7 or 8 hours:


To put it another way, % Deep Sleep declines somewhat as my # of hours of Total Sleep increases:


Next step is to correlate my sleep to my performance in StarCraft and Chess.  :)

Also, I'm now highly motivated to do a better job of recording my sleep data accurately.  Some of the really short sleep durations are not accurate, and are due to me forgetting to hit the button on the Jawbone UP before going to sleep, or to me forgetting to keep it charged.

20130814

Thoughts on "The Riddle of the Gun"

My friend Matthew read about my exercise wager where the penalty is an NRA donation.


He wrote:

On the topic of firearms, however, I've become an unlikely late-in-life convert.  Flies in the face of my positions on virtually everything else, on which I've become increasingly liberal with age.
I think the best summation of my thoughts on the subject is this Sam Harris article.   Sam Harris continues to annoy me by being able to describe my own thoughts more completely and eloquently than me in a number of realms: 
http://www.samharris.org/blog/item/the-riddle-of-the-gun

So go read the Sam Harris piece!  It is super interesting.

Then come back and let me know what you think.

Here's my take.


First of all, it's very refreshing to engage with a rational mind on an issue that seems only to attract the crazies.

I suppose the good news is that gun deaths are such a small part of preventable death in Amerika.  I wish Sam had tried to grapple with the puzzle of why American gun deaths are so much higher than in other places.

He's an excellent writer, so it was only on the second reading that I noticed him sneaking back and forth between the ideal and the practical as it suited his argument.  It was most noticeable when he pointed out that it's impossible to prevent bad guys from doing bad things by taking their guns away, because there are just so many guns in America.  On the other hand, the only thing keeping us from putting an armed guard in front of every school is "entirely a question of money".

Is it not likewise a question of money (and political will, as with armed guards) to reduce the level of gun ownership among bad guys to whatever level we deem desirable?


However, my interest in achieving a satisfactory resolution to the gun debate pales in comparison to my interest in putting the gun debate in proper perspective among the other national debates.  It ranks about #100 on the list, well below another strong libertarian concern that happens to enjoy strong agreement among anti-fascist citizens of both the red and blue variety: namely, the extent to which our government should be allowed to unaccountably spy on us.

In other news, my buddy failed to exercise enough last week, so I've made my first-ever contribution to the NRA, in his honor, $25.

A Symbol of My Commitment to Personal Excellence

TypeRacer.com scorecard for user dsjoerg

20130811

Three Big Mistakes That Make Your Accounts Insecure, and one easy way to fix it

My childhood friend Betsy asked me about how to keep accounts secure on the Internet:
I ask because I believe it's way too easy for anyone who has access to a few basic sites to crack passwords based on finding common password patterns for the user. If you've thought about this, I wonder if you'd share with me what you do to ensure your own password security... I'd like to learn to be a better fortress.
She's right!  Here are the mistakes I see friends making:

1. Using the same password for all their accounts, including important ones like banking and email.
2. Writing down their passwords in a place everyone can see, like on a post-it note stuck to their monitor
3. Choosing short passwords that are easily guessed by a bad guy with a computer.  Most people's intuition about which passwords are good is exactly backwards.


To fix all three problems at once, I use LastPass.  My hacker buddy Marian turned me on to it.  LastPass makes it easy enough to have a different password for every account.  It keeps track of all your passwords on all the different sites you use.  So you only have to remember one master password  - the password to your LastPass account.  Their software can be installed on your computer, into your browser, and on your phone -- I do all three.

LastPass has a neat "generate password" feature that will generate a super-crazy strong password for you and keep a record of it.  They also will keep track of your credit card details if you like, and fill in forms for you on the web.  I use both of these a lot and it's a time saver.

I was a little scared at first about the idea of entrusting all my passwords to LastPass.  After researching them a bit and thinking about it, I realized that all the reasonable alternatives to LastPass are considerably less secure.  What other ways are there?

  • keep your own file with all your passwords - how are you securing that file?
  • use the same password on every site - hope none of those sites are run by crooks
  • remember all your different passwords - good luck!
  • keep your passwords on paper - what could possibly go wrong?

What do you think?  Do you have a password system you like?


ps. I should have mentioned one other thing you can do to lock down your important accounts.  It's a simple neat trick with a stupid name -- "two factor authentication".  What it means is that to get into your account, you need two things, for example both your password and your phone may be needed to log in to your email account.  That way, if the bad guy gets your password but not your phone, he's out of luck!  Gmail offers two-factor authentication, as do many banking sites.  Do it!

20130726

A Fitness Regimen That Works

I used to be fit enough that when I was applying for a new job with some old colleagues, one of them remarked "You look really fit!"  Of course my first thought was "can you say something like that in a job interview?!"  And then later I thought "wow I guess I'm really fit".

Back then, my workout was simple.  Every morning before my shower, I'd do a bunch of push-ups and sit-ups.  That was it!

Now that I'm 40 (argh) and now that one of our Fire Island neighbors is a ridiculously fit and good-looking man, and now that several of my friends of similar age have health problems related to their lack of exercise, it's time to GET FIT.

But how?  As with sleep discipline, the main thing is finding designing a routine that is especially chosen to be attractive to you, habit-forming, and easier to do than to avoid.

That means:
  • I do some form of exercise every day.  This rule is important because then my day feels incomplete unless I've done some exercise.  It is designed to trigger my mild OCD - a day without exercise ain't right!
  • The day's exercise always comes before the day's shower.  Taking two showers a day is a waste of time that horrifies me to the point that I'd avoid exercise with the rationalization that the second shower consumes time I can't afford to lose.  It's a stupid rationalization but I've done it plenty of times.  So exercise must precede the day's shower.
  • To complement the previous rule, it's completely good and acceptable if that exercise is the 7-minute workout.  Usually, anything I learn from the New York Times is considered false until proven otherwise by other sources.  But in this case, the content of the workout closely resembles what my expensive NYSC trainer used to do with me for two years of workouts, so I consider it quite likely to be good.
  • There is a wonderful interactive guide/timer for the 7-minute workout: http://7-min.com.  Check it out!  With this guide, it's easier to do it right than to do it wrong.  Just follow the damn instructions.
  • I must get at least 90 minutes of exercise per week.  I log all my exercise using the RunKeeper app.  I love to run, which is how I found the app in the first place.  With two 30-minute runs and five 7-minute workouts, I get over the 90 minute mark.  I can easily track how I'm doing towards my 90 minutes on my RunKeeper report page here (I had to upgrade to Elite to get this, $20/year).
The final component of the system involves a horrifying penalty that raises the specter of mass armed anarchy, an endless cycle of escalating gun violence, children running armed through the street.  It's really quite neat.

My friend Todd and I have an ongoing bet.  If either one of us gets less than 90 minutes of exercise in a given week, then a donation is made to the National Rifle Association in the name of the person who didn't get enough exercise.  The first donation will be $25, and it will double each time.  If sending $25 to Wayne isn't enough to make you exercise, how about $50?  Or $100 or $200?

That's an anti-charity, a concept I first heard about from a wonderful site called Stickk, which was founded by the brilliant Prof Dean Karlan who does groundbreaking work in behavioral economics.


(For those of you who think the NRA does good work, please don't be offended but rather be pleased that your cause can only stand to gain from this setup.)

So, do you think it will work?  Care to take a bet?  :)  How do you enforce exercise discipline?

20130725

Sleep Discipline

As I noted two and a half years ago, I often find myself awake at 1:00am for no good reason.  I don't want to go to sleep, because sleep is death and I'd rather be reading reddit or playing chess online.

My new plan for a better life goes like this.  I will trick myself into heading towards bed!

At 10pm, it's time to plan my next day.  Preferably on paper, so that I'm not looking at a screen.  The planning is done totally from memory.  The point is to identify things I want to accomplish, which will be a useful reference for tomorrow.  It will get any worries or concerns out of my head and onto the paper.  It also will create an awareness of things I would like to get done, which of course I can't get done very well if I go without the sleep I need.

Next step is to get into bed and read a book.  Arek recommended REAMDE recently.  It's huge and interesting but not so interesting that I won't set it aside and pass out once I'm warm, and in bed, and my sleepiness takes over.

Objectively, I like this going-to-sleep plan way better than my previous one.  My previous one was, in retrospect, a little naive.  Every night at 11pm, my calendar is programmed to put a pop-up onto my screen that say "You MUST go to sleep now, or read this!"  There was some attached hellfire-and-brimstone text I was supposed to read if I thought I should stay up later.

In practice, I would just dismiss the warning and rumble on into stay-up-late disaster.

I expect this plan has better chances because it is intrinsically interesting to me to plan my next day.  There is great leverage in planning what someone else will do, even your future self.  I get a dopamine shot from the power of planning.

Enough theorizing.  I'll let you know how it went.

20130724

No really, how am I going to learn to program?

Here is one very good way: JFDI.

http://blog.jenniferdewalt.com/post/56319597560/im-learning-to-code-by-building-180-websites-in-180

20130723

What (Programming) Language Should I Learn?

People who want to learn programming often ask me what programming language they should learn.

Great question!  Check out this answer from the Programming Is Terrible blog.

The right answer is usually Javascript or Python.

Javascript is great because you can make interactive web pages using Javascript.  You can make really simple and even useful things and share them with your friends and family.

Another good choice would be Python.  Python has an attractive mix of qualities:

  • it's easy to get started
  • it's easy to build big, powerful, well-structured pieces of software with it
  • there is a big, growing community around it with a positive attitude
  • it's well-documented
  • it's clear and consistent

Ruby is fine.  The Ruby community is full of self-important weenies who think that making a video is a good form of documentation.  But there's nothing wrong with Ruby itself.

Definitely not PHP.  Why not?  It's not because PHP is an inherently bad language.  PHP has a bad reputation that it no longer deserves.  The reason not to learn PHP is the same reason that you shouldn't learn Russian.  Don't get me wrong!  Russian is a wonderful language; I studied it in high school.  There is some fantastic literature written in Russian, and millions of people speak it.

There's nothing wrong with learning Russian.  But you would be better off learning English, Mandarin, or Spanish instead.  Those languages are growing in terms of the number of people who speak them, and the places in the world they give you access to.

PHP programmers are unfairly seen as second-class citizens in the programming world.  Why mark yourself as a second-class citizen if you don't have to?  There's no advantage in PHP that makes up for that disadvantage.  So unless you have some other compelling reason to choose PHP, you shouldn't.

Definitely not C or Objective-C or Java.  They are fine languages, and are the right choice for certain projects, but it's harder to get started; learn them later.

--

Hey, I hope this is helpful.  Let me know what you think!  Questions are great too.

20130718

I Read Some Books

I decided that in order to attain Thought Leadership, I must Read Books.  So I read Moneyball and The Art of Learning.

I will summarize each of these books in 140 characters, in my own private shorthand.

Moneyball: Ideas can take a long time to find an effective vessel. It took 10-15 years for Bill James' ideas to be picked up by a baseball GM.

The Art of Learning: Mental <-> emotional health, discipline, insight and resilience are first-order determinants in chess, tai chi and probably everything else.

Of course there's so much more to these books, but the above lines summarize what I found most surprising and unique about them that can be concisely put.  If I had another 140 for Moneyball I would try and express what a great writer Bill James was.  Lewis is generous to quote James at all, because the bits of James he quotes are so much better than anything Lewis can string together.

James speaks of numbers "taking on the power of language" and I wish I had a better gut feeling for what he means by that.  I understand the concept in some abstract way but I don't grok it.

20120407

why was it not a gg?


After playing this game:


Me: gg
WrathofKane: it was not you suck i just sent my stuff to attack you... or you lose
Me: thats odd
why was it not a gg?
WrathofKane: cause i dint win
Me: :)
WrathofKane: you can call gg if you lose but it is not unless i win
Me: sweet
WrathofKane: and you saying it after i left means you are a cunt

20120323

buying an apartment in nyc


A friend asked me for advice about buying an apartment in NYC.

I wrote:

Buying a house means buying a job – as a property owner and manager.

Transaction costs are about 9% round trip.

Streeteasy, propertshark, ACRIS and Curbed are really important resources that you should be intimately familiar with pre-transaction.  Think of them collectively as your Bloomberg terminal. Also interesting are the Case-Shiller city indexes.  Millersamuel.com used to have great data available free – timeseries going back 15-20 years on co-op and condo sales -- and now it’s all behind a paywall.

New York Times has the best buy vs rent calculator.  http://www.nytimes.com/interactive/business/buy-rent-calculator.html

Check out its ADVANCED SETTINGS.  You’ll see that how long you own the place is really important to the buy-vs-rent calculus.  Also important is the rate of return you could be earning on the downpayment if you hadn’t bought a house.  That’s also in the ADVANCED SETTINGS.

Adverse selection is alive and well in the real estate market.  Places will have problems that are not apparent at first look.  Some of this can be mitigated, some of it can’t.  For example, if you do plan to fix it up, you could pick the general contractor first, and then have them survey the place before you buy it, and even make a binding bid to fix it up before you buy it.

It is entirely possible to construct a good estimate of construction costs in advance, but it will take some arm-twisting to get this to happen before you’ve bought the place.  The seller and the contractor will both fight to prevent this from happening.

Most of the fun things that you might want to do with a bought property could maybe also be done with a rented one?  If you shop for a rental with that feature in mind.

Since you brought up schools – the NYC school situation is changing rapidly.  Currently in Manhattan, there is a severe supply/demand problem between parents and schools.  I see the imbalance being resolved mostly by parents choosing to move out, as we did to Park Slope.  Not sure how that affects the Manhattan real estate situation.

Before buying any place, I recommend becoming intimately familiar with its local school dynamics, not because you personally will care, but because the next buyer might. For example, PS 3 and PS 41 have been threatening to change their service boundaries for a few years, which is driving people nuts in the affected areas.   Something similar is happening in Park Slope around 5th Avenue.

20120309

Rails is driving me mad, part 2

In django/python, in development, whenever I change any source file it's automagically reloaded.

In RoR, this is true for some source files, but notably not the source files in my lib directory.

There's a way to fix that:
http://stackoverflow.com/questions/2129458/automatically-reload-rails-module/2138935#2138935

But why is this in an obscure SO question/answer, and why doesnt Rails automagically do the right thing?  And why does Rails permit you to do it wrong, for example by using require instead of require_dependency?

20120306

Rails is driving me mad, part 1

In django, if a robot is spidering through your site and hitting non-existent links, you can suppress the email warnings about 404s with a simple configuration change, as explained here.

So how does one do this in Rails?

After a half-hour of fruitless searching I stumbled across this blog post and this piece of software.  The software does a lot more than I want, in particular it takes over the exception notification mechanism.  So I followed the instructions in the blog post, copy-pasting the code into my app, and so far it seems to be working OK.

This is not the magical experience I was promised!