The Daily Parker

Politics, Weather, Photography, and the Dog

Dowd on bloggers

I read every word in her column today, and I still have no idea what Maureen Dowd thinks of bloggers (sub.req.):

If I had to be relegated to the Dustbin of History, I'm glad it was in Vegas.
I, Old Media, came here to attend a New Media convention of progressive political bloggers aiming for a technological revolution that would dispatch mainstream media to the tumbrels. It was the journalistic equivalent of mingling with your own pod replicant in "Invasion of the Body Snatchers."

Bemused, perhaps? I truy can't tell.

Rin tin tin?

My father has posted his very first eBay listing: 50 decorative tea tins, mint condition. I'm so proud of him.

By the way, if you need any tea tins—perhaps for a school project, or an art installation—you have until next Thursday to bid on them.

Bloggers now protected by journalist shield laws in California

The California Court of Appeal, Sixth District, has reversed a lower-court order that blogger Jason O'Grady had to turn over his sources for a story he wrote about Apple Computer:

Online writers are protected by the state's shield law for reporters as well as by the 1st Amendment, the state Court of Appeal in San Jose ruled, reversing a lower court decision.
Apple subpoenaed the e-mail provider of Jason O'Grady, publisher of O'Grady's PowerPage, an Internet site that posted information in 2004 about an unreleased Apple product.
The ruling establishes that Web reporters have the same right to protect the confidentially of sources as other reporters, according to the Electronic Frontier Foundation.

Cool.

The case is O'Grady v. Superior Court of Santa Clara County (184 kB, PDF).

Leaving Nashua

I'll be away from the blog for a couple of days while I return to Chicago. I've enjoyed Nashua, and I'm sure I'll come back to visit. Everyone here was friendly; for example, my unexpected dinner companion, Max:

Back Monday. Enjoy the weekend.

Microsoft to Contractors: Take a (short) hike

Microsoft has suspended at least 1,000 contracts with developers for a week, just like (*snap*) that:

Microsoft spokesman Lou Gellos said Monday that Microsoft told vendors who supply the contractors that about 1,000 workers globally would not be needed this week. The vendors, whose workers do software development for Microsoft, also were told to schedule two other days off, Gellos said.
Gellos also said the decision was unrelated to a move, announced late last week, to offer new perks to its Redmond employees such as enhanced child-care benefits, access to dry cleaning and grocery delivery services, and better cafeteria food.

Now, it's well known in the industry that Microsoft uses contractors as their primary workforce. This demonstrates one of the reasons. You can't lay off 1,000 employees for a week; it winds up costing more than you save. But contractors? No such restrictions.

It works both ways, however. Contractors rarely have the long-term interests of the company in mind. (I hope the companies that have contracted for my services feel I'm in the minority.) Over the past few years I've gotten increasingly distressed seeing the quality of work that many contractors produce. The simple solution, I think, is to have long-term employees supervise the contractors better on the one hand, and to create a workable system of warranties on the other. If contractors had to maintain their own code, I guarantee you they'd write better stuff.

Those topics will have to wait, however, while I go back to fulfilling the last day of my current contract.

Judge allows AT&T documents in EFF case

In the ongoing, and now expanded, case the Electronic Frontier Foundation has brought against AT&T for its role in aiding the National Security Agency's efforts to spy on us, U.S. District Court Judge Vaughan Walker will allow confidential AT&T documents into the case:

The evidence at issue was filed as support for EFF's motion for a preliminary injunction against AT&T, seeking to stop the company's ongoing violations of the law and the privacy of its customers.
AT&T had requested that the evidence be returned to AT&T, and not used in the case. Wednesday, Judge Walker denied that request. Although the allegedly proprietary documents will remain under seal, Judge Walker instructed AT&T to work with EFF to narrowly redact any confidential material from EFF's brief and supporting declarations so that they can be made public as soon as possible.

Salon (reg.req.) reports that the documents came from retired AT&T technician Mark Klein, who "was motivated to blow the whistle in 2004 'when it became clear to me that AT&T, at the behest of the National Security Agency, had illegally installed secret computer gear designed to spy on Internet traffic.'"

Pop quiz: Why does this code fail?

Here's some code I discovered while tracking a bug this morning:

const string DATE_FORMAT = "M/d/yyyy";

string dateString = 
   ConfigSettings.GetString("Some setting", DateTime.Now.ToString(DATE_FORMAT));

DateTime someDate = 
   DateTime.ParseExact(dateString, DATE_FORMAT, CultureInfo.InvariantCulture);

The DateTime.ParseExact method throws a FormatException if the string (dateString) doesn't exactly match the format string. I mean, exactly. So when dateString comes back from the configuration settings class as "5-12-2006" (instead of "5/12/2006"), guess what happens.

My correction:

DateTime someDate = DateTime.Parse(dateString, CultureInfo.InvariantCulture);

The DateTime.Parse method takes any legal input and attempts to parse it, freeing the developer from having to know what formats may occur. The DateTime.ParseExact method has some specific applications, but when you don't know what you're getting, it's risky—especially when you don't actually catch the FormatException anywhere.

Of course, the DateTime.Parse method could also throw a FormatException. In the code I'm debugging, since the date isn't really coming from a configuration set that we control and is, in fact, coming from an unknown third party[1], I'm actually going to go with an even more forgiving option:

string dateString = ConfigSettings.GetString("Some setting", string.Empty);

DateTime someDate;
if (DateTime.TryParse(dateString, someDate) == false)
   someDate = DateTime.Now;

Moral: Never assume anything about inputs you don't directly control.

[1] You could tell all that from the name of the class, right? I mean, if you see something called "ConfigSettings" you kind of assume that the class has something to do with configuration settings, and doesn't have anything to do with talking to computers in Ohio, right? I'm not making this up: the method call in question may go to Ohio for its data. This highlights the importance of naming your classes correctly so that people trying to use your code don't curse your name unto the generations.

New, improved El cars coming

The Chicago Tribune reports today that the Chicago Transit Authority has agreed to buy 406 new El cars for the Blue and Pink lines. The cars will have aisle-facing seating rather than the mixed seating arrangement currently in use (see the Tribune graphic). This is a long-overdue improvement on the Blue line, whose trains go to O'Hare. Struggling with luggage on the current trains causes pain; the new arrangement will alleviate it.

The CTA expects the cars to roll by 2009, shortly after we have a new President (984 days from now).