Lesser Scaup

January 9th, 2007

Lesser Scaup

Lafreniere Park, Jefferson Parish, Louisiana, 2006-12-27

MacWorld Keynote: First Reactions

January 9th, 2007

The AppleTV is underwhelming. You mean I have to pay $300 for yet another box to balance on my already crowded dresser along with the cable box, VCR, DVR, and DVD player? All so I can buy movies from iTunes and network movies with my Mac? Sorry, that’s not nearly enough value for the money. For $300, it would have to replace at least one, preferably all, of my existing boxes. I’d actually be more interested if it ran the other direction. That is, if it let me broadcast my TV signal to the computer. That would let me ditch one cable box (the one hooked up to my computer).

The iPhone is cool, and I was almost ready to buy one until I noticed it required a 2-year Cingular contract (and wouldn’t be available till June). I guess the rumors that Apple would sell it unbundled and unlocked were false. The UI may well be a quantum leap over everything else on the market, but the business model is the same consumer-hostile crap we’ve been seeing for years. I expected better of Apple.

No new Macs. No new software. I guess new PowerMacs, Minis, and MacBooks will trickle out over the next few months when they’re ready. No new iLife. No new iWork. No new Leopard. (Maybe that will arrive at WWDC.) Will anything else be announced by Apple at the show? I hope so. So far, I’m feeling let down.

Perl and Multiple Line Ending Characters

January 6th, 2007

Perl uses \n (the linefeed) as its default end of line character (record separator). You can change this with -0 option on the command line to be \r (carriage return), \r\n (carriage return linefeed pair) or something else. For example, this command sets the record separator to \r before replacing every occurence of the string foo with the string bar:

$ perl –pi -e -00d ‘s/foo/bar/g’ test.html

However my files are a weird mix of Unix, Mac, and Windows conventions. A few files may even use several line ending conventions in one file. Most modern text editors can autodetect and deal with this without any problem, as can XML parsers. However as near as I can figure, Perl cannot. It expects me to know in advance what kind of file I’m feeding it.

Is there any simple way around this? There’s more than one way to do it, but is there more than one $/?

All Dollars are Equal: A Common Economic Fallacy

January 4th, 2007

Here’s an example of an all-too common fallacy in assessing the rationality of economic actors. It comes from Daniel Kahneman and Jonathan Renshon in Foreign Policy in an otherwise interesting article:

Imagine, for example, the choice between:

Option A: A sure loss of $890

Option B: A 90 percent chance to lose $1,000 and a 10 percent chance to lose nothing.

In this situation, a large majority of decision makers will prefer the gamble in Option B, even though the other choice is statistically superior. People prefer to avoid a certain loss in favor of a potential loss, even if they risk losing significantly more.

Kahneman and Renshon believe Option A to be the rational choice, but in fact Option B should be preferred by most people, most of the time. Do you see why?
Read the rest of this entry »

Security by Stupidity

December 30th, 2006

Yesterday I went through the airport security lines for the second time since the new no liquids, no gels rules were imposed; and I learned something new. Not only can you go through with four 3.5 oz bottles of liquid but not one 12 ounce bottle. It doesn’t actually matter how much liquid is in the bottle, only what it says on the side of the bottle.

You can walk right through with six ounces of liquid in a bottle that’s labeled as three ounces, but Lord help you if you try to go through with a half full, four ounce bottle. Furthermore you can still buy 20oz bottles of water and Diet Coke on the other side of the checkpoint so someone is able to get cases of liquids through. Yeah, this makes so much sense.

A Real Christmas Bird Count in Metairie

December 28th, 2006

Christmas morning I decided to do a little unofficial bird counting before most of my family woke up for the usual festivities. I didn’t go anywhere special, just made a loop through my Old Metairie neighborhood. My family swears there’s nothing to see out there, just House Sparrows, Blue Jays, and Mockingbirds; but they really aren’t paying attention. There’s a lot more when you look.

I have a regular three mile circle route that takes me up Homestead Ave. to Metairie Playground, around the playground, up the railroad tracks to the 17th Street Canal, down the Canal to where it meets the Canal Street canal; down Canal Street to the I-10 service road, and down the service road back to Homestead Ave. It takes about two hours to follow, and takes me through as varied a habitat as you can expect in suburbia.

One thing that always surprises me when I do this is how few other people are doing it too. Nobody in this town walks anywhere. Getting from the far end of the Lakeside Shopping Center parking lot to Dillard’s is considered a major hike. Yesterday I passed two joggers and no one else on the entire three-mile, two hour excursion. Yes, it was early on Christmas morning, but that’s about par for the course even on a beautiful Spring afternoon.

My goal was to find at least one species I had not previously seen in the neighborhood. That proved a little too unambitious since in the first half block between my parents’ house and Homer Street I found two: Ring-billed Gull and Yellow-rumped Warbler. I also ticked off some of the usuals: Blue Jay, Northern Cardinal, and Northern Mockingbird.
Read the rest of this entry »

Currently Reading