All D’s Are Diesel!

Zipcar stands out as one of the few companies willing to use plain language to communicate with its customers. Even in a list of rules, they explain their policies the way I’d expect one member to explain them to another:

Can I park in a commercial zone during my reservation?

Nope. Even if your Zipcar happens to be carrying commercial plates (as they do in some cities) you’ll still be a sweet target for those meter maids.

Thus, when I see a very specific warning about a particular type of car, I have to believe it’s not there because a lawyer demanded it, but because it’s been a genuine source of confusion for members.  This one frightens me a little:

Scion xD

automatic transmission
5-door—4 doors, 5 seatbelts

The “D” in xD does NOT stand for Diesel. The xD takes regular unleaded fuel!

Lines of Code? We Don’t Need No Stinking Lines of Code

Let’s look at an old application my department started in 2001 and developed sporadically until finally launching it in 2007:

[me@desktop old]$ find . | grep -E '(php|js)$' | xargs wc -l | tail -n 1
53063 total
[me@desktop old]$ find . | grep -E '(html|css)$' | xargs wc -l | tail -n 1
9726 total

Now let’s switch over to the replacement application I started in January, 2009 and launched in May, 2009:

[me@desktop new]$ find . | grep -E '(php|js)$' | xargs wc -l | tail -n 1
5955 total
[me@desktop new]$ find . | grep -E '(html|css)$' | xargs wc -l | tail -n 1
2302 total

For those unfamiliar with find, grep, regular expressions, xargs, or tail, that means the old application took 53,063 lines of PHP and JavaScript to do what I did in 5,955.  The old used 9,726 lines of HTML and CSS; I used only 2,302.

So, basically I had fewer total lines of content in the entire rewritten application than its predecessor had merely of markup and styles.  That’s fantastic!

Of course, some of you are thinking that’s just because I write much longer lines of code, right?  And you naturally want me to compute the average number of characters per line used in each application to compare, right?  And you demand — demand — that it be done with a single command chain in UNIX?  As you wish!

[me@desktop old]$ (find . | grep -E '(html|css|php|js)$' | tee temp | xargs wc -l | tail -n 1 | awk '{print $1}' ; cat temp | xargs wc -c | tail -n 1 | awk '{print $1}') | sed 'N;s/\n/ /' | awk '{print $2 " / " $1 " = " $2 / $1}'
1523405 / 51063 = 29.8338

[me@desktop new]$ (find . | grep -E '(html|css|php|js)$' | tee temp | xargs wc -l | tail -n 1 | awk '{print $1}' ; cat temp | xargs wc -c | tail -n 1 | awk '{print $1}') | sed 'N;s/\n/ /' | awk '{print $2 " / " $1 " = " $2 / $1}'
252837 / 8257 = 30.6209

See?  I used only one extra character per line!  On the other hand, I spent a good 30 minutes writing that command: 1 minute composing what I put there and the other 29 trying to figure out a way to do it without either running the find twice or writing anything to a temp file.  (You’ll notice I gave up and threw in a tee halfway through.)

UPDATE: I was too focused on the chaining problem to recognize that I could just have wc calculate the number of characters and lines at the same time.  This would have worked just as well, with no temp file, and with far less complexity:

find . | grep -E '(php|js|html|css)$' | xargs wc -l -c | tail -n 1 | awk '{print $2 " / " $1 " = " $2/$1}'

Thanks, But No Thanks

I habitually thank MBTA operators whenever I pass them on my way off a train or bus.  I say, “thank you,” and if they respond it’s generally with “you’re welcome” or “have a nice day.”

I’ve done this every day for three years in Boston, and before that every day for probably seven years on Colorado’s buses.  Until today, I’ve never given the matter any thought at all; those are just the good manners one exhibits in polite society.

Tonight, when I stepped off the train, the exchange went like this (all quite clearly enunciated, so I’m sure I heard correctly):

Me: Thank you.
Motorperson:
(with extreme annoyance) Thank yourself!

Is this like how “bad” was used to mean “good” for a while in the 1990s?  Did I just insult someone’s mother inadvertently?

I Could Kill You With My Brain

I listened attentively every time someone recommended that I watch Firefly, and then practiced the fine art of procrastination in never watching it. The series ended over six years ago, but I’ve finally caught up now.

Wow!

Among my favorite quotes from the entire fourteen-episode run:

If you take sexual advantage of her, you’re going to burn in a very special level of hell — a level they reserve for child molesters and people who talk at the theater.

A close second, from the same episode:

My days of not taking you seriously are sure coming to a middle.

I found Serenity (the followup movie) somewhat underwhelming.  It seemed to seek a plot great enough to commit to the big screen, when the episodic plots of the television show were a far better fit for the characters.

But even if Serenity were entirely lifeless (which it’s not), Firefly would still have been fantastic enough to compensate.  I will now immediately buy my own set of DVDs, and if only someone made a Firefly tee shirt I’d buy that too.

Radiation is Your Friend

The Associated Press reported this morning on the value of new radiation detectors the federal government is purchasing.

The monitors now in use can detect the presence of radiation, but they cannot distinguish between threatening and nonthreatening material.

Radioactive material can be found naturally in ceramics and kitty litter, but would be of no use in making a bomb, for instance.

That’s not really as comforting as I imagine they wanted it to be.

Oh

I happened to open our Parking Enforcement database this afternoon, and the notes field for the first record that came up read, in its entirety (and with quote marks as shown):

“Why can’t I just get a warning?”
“You were [parked illegally here] on 2 separate occasions”
“No I wasn’t”
“I placed them on your car myself”
“Oh.”

It’s like a great short story.

Zip Lines Are the New Zipcars

A couple years ago, I went with a friend to Wildcat Mountain in New Hampshire, which offers visitors the unusual opportunity to leap from a mountaintop, suspended from a zip line, soar through thin air (and in my case, a stiff breeze) down the mountain, and then bounce off a tension spring at the bottom.  Staff at the time said everyone reaching the bottom laughs aloud upon hitting that spring, and we were no exception.

I notice, however, that the residents of Los Pinos, Columbia aren’t laughing when they invoke a similar zip line suspended 1,200 feet over a river as part of their daily commute.

(via Kottke)

Vote Vote Voter Vote Voter

I enjoyed this query listing permits for a new application called, generically, “vote.”

[bobbojones@production aeacus] > SELECT * FROM permit WHERE application='vote';
+-------------+------------+-----------+----------------------+----------------+
| application | privilege  | principal | principal_type       | subapplication |
+-------------+------------+-----------+----------------------+----------------+
| vote        | vote       | voter     | vote:voter           |                |
+-------------+------------+-----------+----------------------+----------------+

I’m reminded first of when xkcd’s blag depicted “Wikipedia’s entry on blogs, with everything that is not the word ‘blog’ (or a derivative thereof) removed.”

I’m then reminded of a line of my own code from about five years ago that went something like:

$param = $this->_params[$params['param']];

(In my defense, I saw the absurdity immediately and renamed some variables, so the verbatim line is now lost to us, but its spirit remains.)

Browser of the Lost

About 45 minutes ago, I opened a new browser window to see if any cheap tickets are available for my trip this summer.  Let’s examine what tabs are open in that window now (click the image to see the full-size, unedited screen capture):

My Browser Tabs

To review, those tabs are:

  1. Kayak, where I began my search
  2. My 2009 Budget, which I opened to confirm how much I’d originally planned to spend
  3. American Airlines’ article on Wikipedia, which there’s no reasonable explanation for my having opened, since I will not be flying American
  4. An unremarkable photograph of an American Airlines plane
  5. The article on the Douglas DC-3, which came up in the airline’s history history
  6. The article on the Boeing 787
  7. The article on the Airbus A380
  8. The article on Economy class (of course there’s such an article)
  9. A photograph of economy class in an Airbus A320
  10. A photograph of the Airbus A380 cockpit

I seem to have wandered off a bit there, like in the classic xkcd comic on the subject.  Moreover, upon returning to the Kayak tab after all that, I see that I never even entered my search terms, so I still have no idea how much airfare will be, and now I really have to get back to work.

Transulcent 3D Pie Charts: The Future of Design

Since I’m currently working on a new application for our help desk, we’ve been evaluating features in other, existing applications.  We considered, among others, a hosted solution called “Service Now.”

Immediately after logging into the demo site, we saw this traumatizing departure from any known laws of graphic design:

Pie Chart à la Awful

Pie Chart à la Awful

Someone has evidently decided that since 3D pie charts are known to distort human perception of data, what will really make them useful is a layer of translucency.