The Daily Parker

Politics, Weather, Photography, and the Dog

Border cases

Just a quick note about debugging. I just spent about 30 minutes tracking down a bug that caused a client to get invoiced for -18 hours of premium time and 1.12 days of regular time.

The basic problem is that an appointment can begin and end at any time, but from 6pm to 8am, an appointment costs more per hour than during business hours. This particular appointment started at 5pm and went until midnight, which should be 6 hours of premium and 1 hour of regular.

The bottom line: I had unit tests, which automatically tested a variety of start and end times across all time zones (to ensure that local time always prevailed over UTC), including:

  • Starts before close, finishes after close before midnight
  • Starts before close, finishes after midnight before opening
  • Starts before close, finishes after next opening
  • Starts after close, finishes before midnight
  • Starts after close, finishes after midnight before opening
  • Starts after close, finishes after next opening
  • ...

Notice that I never tested what happened when the appointment ended at midnight.

The fix was a single equals sign, as in:

- if (localEnd > midnight & local <= localOpenAtEnd)
+ if (localEnd >= midnight & local <= localOpenAtEnd)

Nicely done, Braverman. Nicely done.

Why shoot raw instead of JPEG?

At last night's performance, the venue used dim, magenta lighting on the stage that made poor Lauren O'Connell look like a pink ghost. Here's one image exactly as it came out of my camera:

Fortunately, I shoot raw photos, which take up lots of room (about 22 MB each) but with the benefit of lots of uncompressed image information. It's therefore relatively easy, using Adobe Lightroom, to correct for it. Magenta lights are pretty grim, though; the only reasonable correction was to make it black and white:

Had I shot these as JPEGs, the correction would have been almost impossible. The raw format stores light in four layers, much like physical film does. JPEG compression "develops" it all together.

Plus, I have my camera set to interpolate a black frame under an exposed frame when shooting above ISO 1600. (This photo was shot at ISO 12,800.) That gives the processing software even more information to help produce a usable image from horrible conditions.

Nataly Dawn in Chicago

The female half of Pomplamoose, Nataly Dawn Knutsen, played a venue four blocks from my house yesterday, so I just had to go.

She and her touring partners Lauren O'Connell and Ryan Lerman were as charming and talented in person as their music makes them seem. Dawn is also tall (178 cm in flats), which isn't readily apparent from her videos.

The tour moves east through April before going back to California at month's end. Also, Knutsen assured me that Pomplamoose will continue.

End of the drought

Illinois State Climatologist Jim Angel reports our 12-month drought has finally ended:

According to the US Drought Monitor, Illinois is now drought free for the first time since April 3, 2012. Most areas in Illinois have seen positive responses in soil moisture, stream flows, lake levels, and groundwater levels since the fall. A small area of northwest Illinois remains as abnormally dry due to some lingering concerns about subsoil moisture and groundwater levels in that area.

It was pretty grim for a while, with Lake Michigan levels falling to record lows and farmers losing crops downstate. So as squishy as this year has been, in a state whose principal economic products are still agricultural, the rain and snow has been very helpful.

Things I might have time to read this weekend

Too much going on:

Now, I will go back to drafting documentation while I wait for AT&T to reconfigure my DSL and kill my landline. I've had a POTS ("plain old telephone service") twisted-pair line longer than most people on earth have been alive. After today, no longer. I don't think I'll miss it, either. I only have it because I have a business-class DSL, which I don't need anymore, and the only people who call it want money from me.

Uh oh...

Via Sullivan, the European Union has given Cyprus the weekend to get itself put together...or else...

Cypriot negotiators have lots of perfectly sensible things they can tell the European purse-string holders about why this obsesssion with debt sustainability is silly. They can point to future natural-gas revenues, for instance, which give Cyprus the potential ability to pay of debts which seem huge right now. They can also point to the denominator here: if failure to reach a deal results in GDP collapsing, then the debt-to-GDP ratio will soar even if the debt level doesn’t rise at all. But the Europeans aren’t acting like impartial judges: by all indications, they’ve made up their mind.

Which leaves Cyprus in a very, very tough position. It can accept the idea of taxing bank deposits — or it can find itself tossed unceremoniously into the Mediterranean, left to fend for itself. Essentially, the EU is telling Cyprus that it can come up with any plan it likes, so long as the plan involves nothing but fiddling around with the Breakingviews deposit-tax calculator. You want to preserve all insured deposits? Fine, raise the tax on uninsured deposits to something over 15%.

In other words, the only real solution to this crisis is for the EU to go back in time and stop it from happening in the first place. And the next-best solution would be for the EU to stop being so self-defeatingly stubborn on debt ratios. But if that doesn’t happen, the Cypriot parliament is going to face an unbelievably tough vote at some point in the next few days. Will they essentially cede their sovereignty to unelected Eurocrats, and rubber-stamp a deal which looks very similar to the one they’ve already rejected once? Or, standing on principle, will they consign themselves to utter chaos and a very high probability of leaving the Eurozone altogether? Such decisions are not always made rationally.

Could Cyprus end the Euro? It's possible, and it could happen next week. Krugman has even more depressing analysis.

Yes, our cold spring is because of global warming

The WGN Weather Blog explains it:

The unseasonably chilly pattern which has descended on Chicago and the Midwest is being driven by a new round of atmospheric blocking in the arctic. The so-called Greenland block has returned and is predicted by global forecast models to dominate the closing weeks of March and spill over into early April....

Blocking patterns in the arctic, like the one now in place, occur when vast pools of warmer than normal air take up residence aloft. As the planet's arctic regions have warmed, these blocking patterns have occurred with increasing frequency and with a variety of impacts felt to the south in the mid-latitudes.

Climate researchers point to the growing volatility of mid-latitude weather as examples of the sorts of changes which may be expected to become more frequent in years and decades to come as additional warming takes place.

The vast reservoir of warmer than normal air aloft, which currently covers much of the arctic, extends from northern Russia across the North Pole and into Northeast Canada. Such pools of warmer than normal air act to dislodge the frigid air indigenous to the arctic, sending the chill cascading southward into portions of the Lower 48.

Yesterday Chicago got all the way up to -4°C, fully 33°C colder than the first day of spring last year. The arctic, however, is a little warmer. Climate-change deniers are therefore reminded, one hopes, of the difference between weather and climate.

Send to Kindle

Odd that I'm finding this out through the Chicago Tribune:

Amazon.com has introduced a way for users to quickly save and send news articles as well as other items to their Kindle devices for later, off-line reading.

The new feature can be added by users in a variety of ways. Amazon has made it possible for users to send items to their Kindles through Web browser extensions for Google Chrome and Firefox, as a feature that can be installed on Macs or PCs, from Google Android mobile devices, or from users' emails.

Cool. Look for the button to appear on The Daily Parker very soon.

Now that I can send directly to Kindle, and after having Instapaper crash frequently on my Android device, I might switch. Though this does underscore the risks start-ups take when they develop relatively simple ideas into software. Other, larger companies can kill you.

Negligible marginal utility

Yeah, I kind of saw this coming, but it still pisses me off:

The U.S. trustee overseeing American Airlines' bankruptcy has asked the carrier to justify its offer of $19.9 million in severance pay to Chief Executive Tom Horton, part of compensation linked to its merger with US Airways Group.

American spokesman Andy Backover said in a statement the carrier did not believe the objection filed by the U.S. Trustee's office had merit. The matter is scheduled to be considered by the U.S. Bankruptcy Court on March 27.

The company said the proposed employee arrangements were found to be reasonable by pay consultants retained by its unsecured creditors committee.

Let's review. Horton's contributions to American Airlines included:

Well, that's all I can see, and I've spent about 300 hours on their airplanes since he took the job. Seems like he's worth $20 million to me!

And those "pay consultants?" Three guesses who signed the checks. Any "pay consultant" who finds that the executive paying him is himself paid too much doesn't deserve the title.

Given events like these, it boggles the mind that people think corporate executives are thieves.