The Great Uniter

Finally, as US troops withdraw from Iraqi cities* we learn how influential George W. Bush was in bringing together people of vastly different ideologies.  From this morning’s Associated Press piece on the withdrawal:

“All of us are happy – Shi’ites, Sunnis, and Kurds – on this day,’’ Waleed al-Bahadili said as he celebrated at the park. “The Americans harmed and insulted us too much.’’

* Of course, “withdrawal” is used loosely here.  From the same article:

Despite today’s formal pullback, some US troops will remain in the cities to train and advise Iraqi forces. US forces will return to the cities only if asked. The US military will continue combat operations in rural areas and near the border, but only with the Iraqi government’s permission.

We’re Number One! Occasionally!

The public transportation system in the Boulder, Colorado area is the Regional Transportation District or RTD.

As in most cities, there is no competing public transit network.  Boston has the T, San Francisco has BART, and even New York has its subways and buses cooperating nicely as the MTA.  In Boulder, it’s RTD.

I therefore raised some obvious questions when I saw this banner on a visit to Colorado last year:

We're Number One... of One!

We're Number One... of One!

Chief among those questions: considering the complete lack of opposition, what exactly happened in  1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2006, and 2007?

In their defense, I lived in Colorado for quite a few years, including most of those in question, and I took the bus virtually everywhere.  (My parents would rightly challenge me if I said “everywhere,” having driven me and my friends to every conceivable neighboring city on more than a few occasions — thanks, Mom and Dad — but on balance I used RTD most often.)

I did endure Dick (his real name, as far as I ever learned) for my entire middle school career — the white-haired man who, despite an undying hatred for children and everything they stood for, picked up both the morning and evening runs most likely to have middle school children aboard every day.

But to compensate, I had a driver for much of high school who was fantastic, and whose name I have now completely forgotten.  The proper bus stop I used was about a block from the end of my street, but every single morning this driver would pull slowly up to my intersection and open the door, knowing in advance that I’d be sprinting breathlessly down the street to meet him.  (I always felt guilty about that, but less so when another kid did exactly the same thing at the next stop every morning.)

People like that should get medals.

Or, failing that, they should just hang a big banner on the side of the highway proclaiming that in three out of 13 years referenced, the agency beat itself to become number one.

Verizon LG Bluetooth

I learned today, as evidenced in my previous post, that I can easily transfer pictures from my LG phone to my iMac using Bluetooth.  Since this was not immediately obvious to me, I’ll now share the steps I took for the benefit of all mankind.

First, I made the phone discoverable (Settings > Bluetooth Menu > Options > Discovery Mode > On)

Next, on my iMac I opened the Bluetooth System Preferences pane and clicked the “+” button at the bottom of my list of devices.  After some searching, it discovered my phone and let me select it.  At some point I got to a screen that implied the only thing I could do with this phone was use its Internet connection.  False!

I ignored that screen entirely — in fact, I quit out of the setup wizard at that point — and went back to the Bluetooth System Preferences pane, which now included my phone in the list of devices.

Clicking the “gear” icon at the bottom of that list, I chose “Browse Device.”

There were my files!

It also looks like I could transfer new MIDI ringtones to my phone in that way, although like a civilized adult I want my phone to make a ringing sound when someone calls me.

iMac & Phone: Connected or Not?

Connected?

You can see that the iMac was somewhat conflicted about whether the phone was connected, but otherwise the whole thing went quite smoothly!

srouH erotS

I noticed this sign at the Verizon store in Cleveland Circle:

sruoH erotS

sruoH erotS

Here’s a tip: when posting your store hours, have the sign face outside the store.  Most of the people inside don’t need to know your hours, ’cause they’re already indoors.

Kingpin

Having loved Firefly so entirely that I’ve watched the entire fourteen-episode run about eight times in a row, I thought I’d try another highly-recommended seven-year-old show with a somewhat longer production run.  I’m speaking, of course, of the five season run of The Wire.

I’m only three episodes in and the jury’s still out, but I already love the star drug dealer’s tutorial on how to play chess:

Now look, check it, it’s simple, it’s simple. See this? This the kingpin. A’ight? And he the man. You get the other dude’s king, you got the game, but he trying to get your king too, so you gotta protect it. Now the king, he move one space any direction he damn choose, ’cause he’s the king. Like this, this, this, a’ight? But he ain’t got no hustle.

This the queen. She smart, she fierce. She move any way she want, as far as she want. And she is the “go get shit done” piece.

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.