The Daily Parker

Politics, Weather, Photography, and the Dog

Tribune news roundup

The Chicago Tribune had several stories of interest this morning.

Meterologist Tom Skilling noticed more daylight, possibly because he reads my blog. Unfortunately, he got the number of minutes more daylight a little wrong, because he only looked at half the equation, and even still didn't subtract correctly. First, the difference between 4:23 and 4:50 is 27 minutes, not 28; second, sunrises got later before getting earlier, so we actually have 9 hours 35 minutes of daylight now, which is 26 minutes longer than December 21st's 9 hours 9 minutes.

Technology writer Steve Johnson has a primer on starting a blog, which wasn't any more or less than expected except it had a notice about the Chicago Blogger Meetup on February 21st. (Of course, http://www.chicagobloggers.com/ has nothing about the meetup, and Meetup.com mentions it for February 15th. I've emailed the author about the discrepancy.)

Finally a news item about a high-schooler expelled for a doodle, showing that McHenry County schools exemplify the Peter Principle in action:

The drawing is of a cross, with a spider web on one side and a crown at the top. In the middle of the cross are the initials "D.L.K." The teen, whose full name is Derek Leon Kelly, said the initials are his. School officials have alleged that they could stand for "Disciples Latin King," his mother said. The Latin Kings and Latin Disciples are rival gangs.

Forgetting Occam's Razor for a moment, I must ask, what's going on here? Even if he was drawing gang symbols, that's not the same as being in a gang--which is actually irrelevant, because freedom to assemble is in the same amendment as freedom of speech. Sure, expel him if he brings a weapon to school, or gets into an actual gang fight. But for drawing? That's just stupid.

Update, 11:26 CST/17:26 UTC: Steve Johnson replied as follows:

Suspect what you saw may have been an earlier, tentative date (or maybe a different meeting, but I don't think so).
Hey, if you blog about my piece (and I hope you'll take into account the severe restrictions of a 100-line limit), maybe I'll blog about the blogging. And so on, until the whole Internet crashes under the strain of extreme self-reference.

So, to clarify, any implicit criticism of his column I may have had should be directed rather at Tribune Co. for imposing an unrealistic size restriction on it, rather than at the writer, who did a good job with the space he had.

Let's hope the Internet can keep up with us...

Second thoughts about framework classes

The Inner Drive Extensible Architecture™ contains a very useful namespace called Quantitative that contains classes and interfaces to use in measuring things. Essentially, there is a trio of interfaces, IQuantity, IUnit, and IPhenomenon, that allow you to create and convert any kind of measurements. The principal implementation of IQuantity is the Numeric structure.

To convert feet to meters, you do this:

IQuantity feet = new Numeric(100, new Foot());
IQuantity meters = quantity.ConvertTo(new Meter());

Even though that looks simple, it has always troubled me. I've realized in the last couple of days that I got the abstractions wrong.

In any object model, you want to work with the most convenient abstractions. It helps if the resulting code looks like English (or whatever your native language is). Quantity, Unit, and Phenomenon are, indeed, abstractions, but they're not the right ones. Here's how I know.

First, the following compiles fine, but throws an InvalidOperationException when executed:

Numeric feet = new Numeric(100, new Foot());
Numeric fahrenheit = new Numeric(100, new Fahrenheit());
Numeric hotFeet = feet + fahrenheit;

Numeric is too abstract, you see.

Also, getting feet to display as, say, kilometers becomes very annoying:

Numeric feet = new Numeric(10000, new Foot());
Numeric meters = (Numeric)feet.ConvertTo(new Meter());
Console.WriteLine(meters.ToString());
// "3048 m" displayed

// Numeric.Unit exposes a Unit which may or may not be metric
IExponential exponent = (IExponential)meters.Unit;
exponent.Exponent = MetricExponent.Kilo;

Console.WriteLine(meters.ToString());
// "3.048 km" displayed

The Numeric structure doesn't care about the metric exponent of its Unit member. Why should it? It contains a value and a unit, and if you add two Numeric objects that use the same Unit, you get exactly what you'd expect.

But why should the Unit care what its exponent is? Now, when converting to or from other Units, it has to take that extra piece of information into account, or the conversions will be off by orders of magnitude.

There are many other problems and annoyances with the Quantitative namespace, which took me months to tease out. But this morning, on the El, I cracked the code (as my dad would say).

Tell me, doesn't this make a lot more sense?

Length meters = new Length(3000, new Meter());
// Alternate syntax using the implicit operator:
// Length meters = 30;
Console.WriteLine(feet.ToString());
// "3000 m" displayed

Length feet = meters.ConvertTo(new Foot());
Console.WriteLine(feet.ToString());
// "9842.52 ft." displayed

Console.WriteLine(feet.ToString(MetricExponent.Kilo));
// "9842.52 ft." displayed; no exception; simply ignored the exponent
Console.WriteLine(meters.ToString(MetricExponent.Kilo));
// "3 km" displayed

And, of course, our earlier example wouldn't even compile:

Length meters = 30;
Temperature fahrenheit = meters.ConvertTo(new Fahrenheit());
// Won't compile

I'll be refactoring this soon. Everything else I'm building depends on it. Watch this blog for a link to the new demo.

Cross your fingers: the new Webcam works

A while ago we at Inner Drive attempted to install a new Webcam which, in short order, stopped working. Logitech promptly sent a replacement, which so far works fine.

So the Inner Drive Webcam is now much sharper, and less prone to falling, than it used to be:

The only disadvantage is that it doesn't work in Terminal Server mode, so if the server kicks over unexpectedly, the Webcam will be static until we can get to a terminal and fix it. (We'll experiment with that later on.)

Also: The camera, a Logitech QuickCam Orbit MP, is adjustible--so it will change angles every so often.

We are very happy.

Write to sell

Hired Wrist, one of my clients, has a new Craigslist post:

Write to Sell
"Writing is easy; all you do is sit staring at a blank sheet of paper until the drops of blood form on your forehead."—Gene Fowler
Take it from someone who knows. I've been bleeding professionally for years.
If you are writing (or even thinking of writing) a screenplay, teleplay or novel, I can now offer you professional strength one-on-one consultation, analysis, guidance and instruction designed to dramatically and significantly improve the quality of your work. With over thirty years of remarkably successful professional writing experience, I will personally guide you through the complicated and often unforgiving landscape of the writer's world. If you want to write to sell, if you want to write better or even if you’ve never written before and have a burning desire to do so, let me help you get started. Together we can stop the bleeding.
Check out my qualifications, credits, achievements, awards and fees at http://www.hiredwrist.com

Share and enjoy.

Welcome to Broadband; and Borowitz is funny today

First, I'd like to welcome my mom to broadband. She's been on dial-up since she got her first home computer (in, I think 2001), but she finally got a cable modem. I clocked the thing at 9.1 Mbps downstream, which is about 160 times faster than her 56.6k analog modem.

I mention this because yesterday she asked me to pick up a copy of Turbo Tax at the store. I pointed out that, with a super-fast Internet connection, she could simply download the product and save a tree.

In an unrelated train of thought, Borowitz was funnier than usual today:

[O]ne day after published reports alleged that author James Frey had fabricated sections of his bestselling memoir, A Million Little Pieces, Mr. Frey was named chief spokesman for the U.S. Defense Department.

Finally, the new Webcam arrived from Logitech. I'll be testing it in the lab for a few days before replacing the main one—assuming the replacement works as hoped.

Why consulting is secondary to me

WinXP News today looks at the problem of getting things fast, cheap, and right. The adage in engineering is you can only have two. The adage in consulting is you can sell all three.

This is exemplified by a tongue-in-cheek conversation I had on the elevator this morning with the head of Q.A. for one of my clients:

QA Guy: I can't believe it's only Wednesday. I want it to be Saturday. You're a consultant; can you do something about that?

David: Sure, I can whip something up. Give me three days, and I'll have a Saturday for you.

He: Can you do any better than that?

I: Sure. I'm working on a faster process, which should be in production in about two days. I can get it to you about 18 hours after that.

He: Can't you off-shore the development?

I: As a matter of fact, our Fiji facility can get the job done 18 hours faster. They will probably finish in less than two days from right now. But I'll have to go to Fiji, which won't be cheap.

Comment problems?

I've heard that people are having trouble leaving comments on the blog. Please let me know if you try to leave a comment and get an error message. I have an idea why this is happening—Das Blog has some defects in the way it handles multiple time zones—and I need more data.

Thank you.

Pop goes the hard drive

This morning I've been working in the Inner Drive Technology Comprehensive Testing Facility, trying to read an ancient hard drive I discovered a while ago. I've tried many methods to read this old 130 MB disk. It has two files on it, a "readme" file dated 23 February 1995, and a Doublespace volume with the same date. In other words, this hard drive is a snapshot of what I was doing 11 years ago.

In order to read a Doublespace volume, you need MS DOS 6.22, Windows 95, or Windows 98. I haven't had a Windows 98 computer in years, but Inner Drive does have MSDN Universal—and the IDTCTF. So last week I built a Windows 98 installation out of a computer that was, in 1997, my Web server, but has since 2001 collected dust somewhere. Too much dust, apparently.

It turns out that this computer has a bad disk controller. So, Plan B, I plugged the Windows 98 hard drive and the ancient Doublespace drive into a different computer, reconnected the power cord, and got a spark, a pop, and a wisp of smoke from the 11-year-old drive.

There are very few things less common or more totally destructive inside a computer than an electrical arc followed by smoke. (Fortunately the disk cage was outside the box at the time, and the two drives were more than 5 cm (2 in) apart, so the damage was localized.) I can therefore report, with unusual certainty, that the oldest hard disk in my possession is now a large paperweight. (I'll have a memorial photo up tonight or tomorrow.)

Goodbye, "WinSwap." I hardly new ye.