Walt Mankowski

All glory to the hypnotoad

Academia in Fairyland

| Comments

My book club meets this Tuesday night. This month’s book is Catherynne Valente’s wonderful The Girl Who Circumnavigated Fairyland in a Ship of Her Own Making. Since I was the one who recommended it, I thought it would be a good idea to reread it this weekend so it would be fresh in my mind.

Even though I knew what was going to happen, I think I enjoyed it even more this time around. There are great passages on nearly every page, but I think my favorite is this one:

“Where are my friends?” she repeated icily.

“Oh, how should I know? We were only told to feed you up and send you into the woods. No one tells us anything unless it’s ‘Mix up Life-in-a-Flask for me, Citrinitas!’ ‘Bake me a Cake of Youth, Trinny!’ ‘Grade these papers!’ ‘Watch that beaker!’ ‘A monograph on the nature of goblins’ riddles, Ci-ci!’ I swear to you, I am finished with postdoctoral work!”

Academia, it appears, is much the same in Fairyland as it is in the human world…

Old School DST

| Comments

Today is the day we switched to daylight saving time in the United States. I see a lot of folks on the Internet saying that all their clocks these days switch to DST automatically. Not me. I have a lot of clocks and things with clocks, but almost none of them know about DST. (The latest is a new cordless phone I picked up a few months ago.)

Downside: I have to reset them all by hand twice a year. Upside: they don’t break every time some idiot in Congress decides to change the DST rules.

Overall I’d say it’s a win.

Two Types of Doctors

| Comments

At a Penn alumni event Saturday night, I was chatting with a woman whose father was a Penn professor. She said that when she was little, she used to ask her mother why Daddy was a doctor but didn’t treat sick people.

“Well, honey,” her mother explained, “there are two types of doctors: medical doctors and smart doctors. Your father is a smart doctor.”

New Monitor

| Comments

I bought a new monitor today to replace my old one, which was slowly dying. I knew that monitors had gotten a lot lighter and cheaper since I bought the old one 7 years ago. I hadn’t taken into consideration that, just like TV sets, they’d also changed their aspect ratio from 4:3 to 16:9. If you do the math, 1920x1080 is 8% more pixels than 1600x1200, but they’ve all moved from the bottom to the side!

This is going to take a little getting used to…

AI Winter, Session 1

| Comments

I had a great time tonight at the Comcast Center at the first session of AI Winter. We discussed Alan Turing’s fascinating 1950 paper “Computing machinery and intelligence”, where he first described the test for machine intelligence we now know as the Turing Test. We had a great group of people, the discussion was excellent, and there’s an awesome view of Philly at night from up on the 45th floor.

I’m looking forward to the next meeting in 2 weeks! Next time we’ll be reading “Fuzzy Sets”, Lotfi A. Zadeh’s seminal 1965 paper on the mathematics of fuzzy set theory.

Liverpool Wins a Tie

| Comments

This afternoon I checked the web for the results of Liverpool’s 3rd round FA Cup match against Mansfield Town. The story I found had an unusual headline:

FA Cup - Suarez wins Cup tie for Liverpool with handballed goal

Liverpool won the game 2-1, so I thought that the word “tie” must have been a typo. But when I checked another story to find out more about Suarez’s handball, I saw this caption underneath a photo:

No chance: Alan Marriott is helpless to prevent Suarez netting the Reds’ second of the tie

Clearly, then, the Brits are using the word “tie” to mean “match”. But why? True, they use “draw” to refer to a match that ends with both teams having the same score, while Americans use “tie”. But they commonly talk about “tied scores” during games, so it’s not like the word has a completely different meaning on our side of the pond. What’s going on?

I checked a few dictionaries but none of them had that usage in their definitions of “tie”. I decided to check the online edition of the Oxford English Dictionary, which I’m able to access via Drexel’s library. The OED, of course, had the answer.

But to understand the answer, we first need to understand how the FA Cup works. In most single-elimination tournaments Americans are familiar with, such as Wimbledon and March Madness, every participant is seeded and each match is laid out in a tree. When two participants meet in a match, the winner moves on and the loser is eliminated. Draws are impossible; there is always some sort of mechanism in place to break ties.

The FA Cup, however, doesn’t work like that. First, there is no tournament tree. The pairings for each round are chosen at random, along with which team will play at home. Second, if a game ends in a draw, they don’t try to settle the match with extra time or a penalty kick shootout until they get to the semifinal and final rounds. Instead, the two teams play each other again, this time at the home field of the team which was the visitor in the first leg.

The OED says that this rematch used to be called a “cup-tie”. For example, in 1895 the Daily News reported, “The Wednesday men are noted cup-tie fighters.” (The “Wednesday men” refers to Sheffield Wednesday, a very famous and old English soccer club that won the FA Cup in 1896.) By 1905 this had begun to be shortened to simply “tie”:

Probably the Cup-‘tie’ has been evolved from the phrase ‘shooting off’ or ‘playing off a tie’ after two competitors have ‘tied’. The match between those who stand on a level gradually gets regarded as itself the ‘tie’.

As we’ve seen from the Liverpool headlines, these days “tie” is used to refer to the first leg FA Cup matches as well.

Interestingly, when “cup-tied” is used as an adjective, it means something completely different. It’s used to describe a player who’s ineligible to play in cup-ties for his current team because he’s already played in cup matches for another team earlier in the competition. Some examples: “Wakeling, being cup-tied after playing for Corinthian-Casuals, will be missed in midfield, and Richards will probably replace him” and “Jimmy Greenhoff, Manchester United’s £120,000 buy from Stoke City, is cup-tied and will not be eligible to play against Everton.”

Corinthian-Casuals, with their chocolate and pink uniforms, are my new favorite English soccer team.

Walt, Start a Holy War

| Comments

In October I started a new job working as a postdoc at a lab in Drexel’s ECE department. We inherited our lab from a retiring professor who had a distinguished career studying microwaves and lasers. The other day he stopped by the lab and remarked on how quiet we are. “We used to have a dozen physics grad students in here,” he said. “They used to argue all the time. But all you guys ever do is stare at your computer screens!”

Well, I wasn’t about to ignore the challenge. I called over to one of the grad students in the lab. “Hey Eric,” I asked, “vi or emacs?” (Emacs, of course, is the One True Editor.)

“Emacs!” he replied immediately.

Damn.

“Java or C++?” asked Eric.

“C++, of course!” I replied. Again we were in agreement. It was time to break out the heavy artillery.

“Perl or python?” I asked. Surely this would start a holy war. Nobody in academia likes Perl.

“Well,” said Eric, “to tell you the truth, I haven’t used either language very much.”

“Huh. OK, how about Apple or Microsoft?”

I should point out that my lab is a Windows shop. Each of us has an enormous, maxxed-out Windows box that we use to analyze stem cell videos. Eric’s the biggest Windows fan in our group, and installed Windows 8 when it was still in beta. Meanwhile I used Macs all through grad school, and I still keep my MacBook on the corner of my desk to use for email and iTunes.

“Linux!” replied Eric, surprising the hell out of me.

“I like Linux too,” I said. “But what if you had to choose between Windows or OS X?”

“Windows.”

“But OS X is Unix!”

“Do you think we could do what we do here on Apple machines?”

“No,” I admitted. “But we probably could on Linux.”

“Linux doesn’t have a driver for the 3D card I’m using.”

“Oh, good point. Guess we’re stuck with Windows then.”

And thus we agreed to agree. This business of starting holy wars is harder than I thought. I’ll have to step up my game next time.

Beer Cooties

| Comments

Ah, the joys of trying to buy beer in the great Commonwealth of Pennsylvania. I stopped by Wegmans yesterday. I bought a 6 pack of beer, paid for it in their special area, put it in my cart, and then did the rest of my grocery shopping. When I went to checkout, I asked the kid if he could put the beer into one of my reusable bags.

“Sorry,” he said. “I’m not allowed to touch the beer.”

“Huh,” I replied, not entirely shocked by this. Purchasing alcohol in Pennsylvania presents some unique challenges. “OK, then could you at least leave some space in one of the bags, and then I’ll put the beer into the bag myself?”

“Umm…”

“OK, forget I even asked.”

Life Changing, History Making Career Opportunity

| Comments

Actual email I just received from a recruiter via LinkedIn:

I have a very interesting AI project that I have been ask to seek out very special people on and I think you may just be that. If you would like a chance to talk about this life changing, history making career opportunity and see if maybe you would be interested then please let me know, and we can talk further. Trust me you won’t be disappointed.

Somehow I get the feeling this “opportunity” involves selling herbal viagra for her clients in Nigeria.

How to Run a Cron Job on the 4th Monday of the Month

| Comments

While I was going to grad school at Drexel I commuted into the city from my condo in the suburbs on Septa’s regional rail system. I could save 10% by ordering my monthly train pass through Drexel, and since a pass for my zone is currently $155, that’s a fair amount of money.

The only catch was that I had to remember to reorder a new pass each month by 5 PM on the 4th Monday of the month. After missing a few deadlines during my first year, I decided I needed to setup an automatic reminder system. It worked really well and I never again forgot to place my order. I never got around to turning it off and, today being the 4th Monday of August, I just got my reminder:

Date: 27 Aug 2012 12:00:01 -0000
From: "order_trailpass.pl" <waltman@mawode.com>
To: Walt Mankowski <waltman@mawode.com>
Subject: Order new trailpass
   
Today is the last day to order your October Trailpass.  The
deadline is 5 PM!

Hugs,
order_trailpass.pl

Before I disable it, I thought I’d share how it works.

The tricky part is setting up the cron job. Cron lets you run a job on a specific day of the month. It also lets you run a job on a specific day of the week. It does not, however, let you combine them. Here’s what you have to do instead:

0 8 22-28 * *   if [ `date +\%a` = Mon ]; then /home/waltman/bin/order_trailpass.pl; fi

That tells cron to run the job at 8 AM on any day that could possibly be the 4th Monday of the month, namely the 22nd through the 28th. If that day turns out to actually be a Monday, then it goes and runs my reminder script. Otherwise it does nothing.

I was worried that I might miss a single reminder. For example, I might be off at a conference in a different time zone and be asleep when I got the reminder. So I set it up to bug me every 4 hours all day long:

# run at midnight then every 4 hours on the 4th Monday of the month
0 0-23/4 22-28 * *   if [ `date +\%a` = Mon ]; then /home/waltman/bin/order_trailpass.pl; fi

The order_trailpass.pl script is pretty straightforward:

order_trailpass.pl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#!/usr/local/bin/perl -w
use strict;

my ($sec,$min,$hour,$mday,$mon,$year,$wday,$yday,$isdst) =
    localtime(time);

my @month = qw(
    January February March
    April May June
    July August September
    October November December
);

my $next_month = $month[($mon + 2) % 12];

open QMAIL, "|/var/qmail/bin/qmail-inject"
    or die "Can't fork for qmail: $!\n";

print QMAIL <<"EOF";
From: order_trailpass.pl <waltman\@mawode.com>
To: Walt Mankowski <waltman>
Subject: Order new trailpass

Today is the last day to order your $next_month Trailpass.  The
deadline is 5 PM!

Hugs,
order_trailpass.pl

EOF

close QMAIL
    or die "sendmail didn't close nicely";

The only really tricky part is that you have to order the passes a month ahead of time. In other words, if I were to place an order today, I’d be ordering an October pass. But because the script for the October pass runs in August, I needed to add 2 to the current month. That’s what the math on line 14 does. I put that in so that if I knew I was going to be traveling that month, I could save a little money and buy weekly passes instead. The % 12 makes sure it wraps around from December to January correctly.

Oh, and obviously this script assumes you’ve got qmail installed. If you don’t, well, there are dozens of ways to send email from Perl. For something as simple as this — a plain text email and local deliver — chances are they’ll all work fine. But if I were writing this today, I would consider using rjbs’s excellent Email::Sender::Simple module.