Monday, April 21, 2008

Something You'll Never See Again

A little more fun with the Major College Major Sports in 2007-8: I found 239 teams which played both Division I Men's Basketball and either Division I (Bowl Subdivision) or Division I-A (Championship Division) football. The table below presents the wins, losses, and winning “percentage” for Football and Basketball. I then averaged the two percentages, to compute a “Combined Percentage,” and ranked the schools in order according to that. Fans of Kansas football (remember the slogan: “A Tradition Since September”) will note that this year was, indeed, special.

This table just shows the top 25. I've put the complete list elsewhere. Let me know which teams I've missed, there are probably several.

Rk School Football Basketball Comb.
      W     L       Pct.       W     L       Pct.     Pct.
1 Kansas 12 1 0.9231 30 3 0.9091 0.9161
2 Brigham Young 11 2 0.8462 27 7 0.7941 0.8201
3 Dayton 11 1 0.9167 21 10 0.6774 0.7970
4 Tennessee 10 4 0.7143 28 4 0.8750 0.7946
5 Texas 10 3 0.7692 27 6 0.8182 0.7937
6 Wisconsin 9 4 0.6923 29 4 0.8788 0.7855
7 West Virginia 11 2 0.8462 23 10 0.6970 0.7716
8 Boise State 10 3 0.7692 24 8 0.7500 0.7596
9 Memphis 7 6 0.5385 33 1 0.9706 0.7545
10 Southern California 11 2 0.8462 21 11 0.6562 0.7512
11 Northern Iowa 12 1 0.9231 17 14 0.5484 0.7357
12 Oklahoma 11 3 0.7857 22 11 0.6667 0.7262
13 Massachusetts 10 3 0.7692 21 10 0.6774 0.7233
14 New Mexico 9 4 0.6923 24 8 0.7500 0.7212
15 Connecticut 9 4 0.6923 24 8 0.7500 0.7212
16 Ohio State 11 2 0.8462 19 13 0.5938 0.7200
17 Appalachian State 13 2 0.8667 17 13 0.5667 0.7167
18 North Dakota State 10 1 0.9091 14 13 0.5185 0.7138
19 San Diego 9 2 0.8182 20 13 0.6061 0.7121
20 Drake 6 5 0.5455 26 4 0.8667 0.7061
21 Clemson 9 4 0.6923 23 9 0.7188 0.7055
22 Davidson 6 4 0.6000 25 6 0.8065 0.7032
23 Southern Illinois 12 2 0.8571 17 14 0.5484 0.7028
24 Western Kentucky 7 5 0.5833 25 6 0.8065 0.6949
25 Arizona State 10 3 0.7692 19 12 0.6129 0.6911

Monday, April 14, 2008

The X Files

An irritant of the Office 2007 era is that some people insist on sending you files in that $&#**$% program's default format: .docx, .xlsx, or .pptx. And these same people won't comply with your request to save the frakkin' thing in a reasonable format. (Like PDF. Nice, small, and I can't edit them to make you look completely ridiculous and send the result to all our friends. But that's a subject for another post.)

I've really been tempted to send my responses in Swahili. Transliterated into Urdu. Unfortunately, I don't speak Swahili, and my Acme translator's instruction book is in Hindi. So that's out.

Short of ending friendships and associations forever, it's now possible to read these files with version 2.3 or better of OpenOffice.org. You can't write in those formats, unless you want to do some minor hacking, but you can read them and convert them to a reasonable format.

Say as OpenDocument (.odt). Then send it back to them and when they complain, point out that it's an open standard, and Microsoft should be able to read it. (Not my idea.)

Wednesday, April 09, 2008

Baskeball Rule Changes I'd Like to See

While watching the (fantastic) NCAA Men's Basketball tournament, I realized that there are a few rules I'd like to see changed. One I've mentioned before, but the others are new, at least for me.

  • As I mentioned before, eliminate the ability to call time out when you're about to loose the ball. In the Monday night game, during overtime, I think, there was a play where a half-dozen players were on the floor going after the ball. Someone tried to cradle the ball and call time. And we've all seen people call time as they're flying out of bounds. Why do we allow this? If you're trying to put the ball in play from out of bounds, you can't call time after the four second count. You can't call time after you've spent eight seconds in the back court. Yet you can call time as you catch an errant pass while you're flying out of bounds, if you can get your hands into a “T” before you touch down.

    In the timed cases mentioned above, the purpose of the rule is to forbid a team to call time out before a change of possession. Well, in the case in Monday's game, or the guy-flying-out, a change of possession is about to occur. So why can you call time?
  • Move the three-point line out another foot or so. Looks like this will happen in the fall.
  • Except in the case of injuries, a substitute has to stay in the game for two changes of possession: this eliminates the offense-defense substitutions you see at every whistle during the end game, which tends to slow things down immensely. I noticed this while watching taped games during the tournament. My DVR has a ten-second advance button. When I heard the substitution buzzer sound, I'd hit the advance once. I never missed a single second of play, or a free throw.
  • And here's the biggie: Eliminate the Hack-a-Shaq. Kansas won the game because they did something illegal: they fouled. Repeatedly. That Memphis didn't take advantage (and I'm glad they didn't) is the Tigers' fault, but the point is, KU took advantage of a bad rule. It gets worse, at least from my point of view: in the last ten seconds of regulation, Memphis was trying to foul someone, anyone, so that Kansas would get two free throws, rather than a chance to hit a three and tie the game. A Memphis foul, an illegal act, would most likely win them the game. OK, KU could have done the make-the-first, miss-the-second, trick, but then they'd have to get the rebound and put it back up with only five or six seconds left, at best.

    Not to mention, the endless trek to the foul line at the end of a close game is boring. It doesn't help your ratings, CBS, got that?

    So let's change the rule: let the team fouled in the last two minutes have its choice, assuming they're in the bonus:
    • On One&One fouls, if the team makes the first shot, they can either shoot the second shot or take the ball out of bounds.
    • On Two shot fouls, the team can take the both shots, or take one shot and then get the ball out of bounds.
    • On Three shot fouls, it's two shots plus ball.
    • Of course, on flagrant fouls, it's still two shots plus the ball.
    • You still only get one shot if you're fouled in the act of shooting and make the basket.
    • If you're not in the bonus yet, you get the ball out of bounds, same as now.
    This change would speed up the end-game considerably, as well as keeping a team from profiting while fouling. (Sorry, Memphis, it's not retroactive.)

Anybody else like any of these?

Note added in proof: I swear I did not read this until after I first posted the above.

Tuesday, April 08, 2008

The Game

KU 75, Memphis 68 (OT)

Thursday, April 03, 2008

pathlint

In my day job I spend a fair amount of time working on computers where I'm not the sysadmin. That's fine, as I'm glad not to have to administer a 90-node cluster, but it means that I have to put up with some things that I don't here on dear, old, slow, Hal. (Hey! Sorry.)

For example, different machines have different locations for the Fortran compiler and libraries, so the sysadmin helpfully locates them for you by adding the appropriate directories to your path. Typically, you'll be told to put a statement of the form

source /usr/sysadmin/cshrc

into your .cshrc or .bashrc file, where that file says something like:

setenv PATH $PATH:/opt/intel/bin

(in csh, of course) which adds the Intel directory to your path.

That's fine the first time you open up an xterm. But suppose you use your xterm file to launch another xterm? Now you've got two invocations of /opt/intel/bin in your path, one after another. Doesn't do too much harm, but it can be difficult to look at your path and decide which directories are there.

So I wrote a little Perl script called pathlint to take care of this:

#! /usr/bin/perl

# Learn about $ENV in "Learning Perl," 2nd ed., pp. 143-4
# split is on pp. 89-90:

# Sort routine from http://www.perl.com/doc/FAQs/FAQ/oldfaq-html/Q5.4.html:

# This could almost be made into a one-liner:

undef %saw;
@out = grep(!$saw{$_}++, split(/:/,$ENV{"PATH"}));

# The inverse of split is (Learning Perl, p. 90):

$newpath = join(":",@out);

# Note the lack of a newline, because we're going to use
#  this as the argument of a path command

print $newpath;

Note that this doesn't actually reset the path, which would require adding something like

# Reset the path:
# $ENV{"PATH"} = $newpath;

That's because the Perl script is a child process, and children can't reset the environment of their parents. Think about it: if you could, then a program like xine could switch your directory so that you would start looking at Aunt Tillie's porn directory – trust me, you don't want to go there.

So what pathlint does is to print out the current path, without any duplicate directory names, e.g.

$ echo $PATH
/bin:/usr/bin/:/opt/intel/bin:/opt/intel/bin

$ pathlint
/bin:/usr/bin/:/opt/intel/bin

without a newline. To actually change the path, just

$ setenv PATH `pathlint`

(those are backquotes) if you are using cshell or one of its derivatives, or

PATH=`pathlint`

from bash, dash, sh, ksh, etc. If you put the appropriate line at the bottom of your .cshrc or .bashrc file, opening up a new xterm will always start you with an unduplicated path.

Wednesday, April 02, 2008

The First Night

Of course, I got tickets to the official opening game at Nationals Park, watching the Braves play the Nationals on Sunday.

Those of you outside the DC area might not know that they built the park with very little parking. As a 20-game ticket holder, I could have gotten a parking pass for $20-$35 per game, but it's a difficult part of town to get in and out of, so I decided to use one of the other two options: Metro, or the National's unique shuttle service, where you park (for free) in a lot at old RFK Stadium, and then take a shuttle bus to the new park, all for free. Must cost the Lerners a bundle. Tonight, I decided to take the shuttle, which winds out of RFK, onto the Southeast-Southwest Freeway (I295/395), past the Marine Barracks, and dumps you about three blocks from the stadium. All in all it went pretty smoothly, but this was a Sunday night. How things will work during rush hour is anyone's guess.

Since I had tickets up (way up) above first base, when I got to the park

First View of Nationals Park

I headed for the first base entrance, where I found a rather long line:

The Line Outside Nationals Park

The problem, of course, was that Dubya was present, so we all had to go through metal detectors. That's fine, except the first base side only had four. After an hour or so, someone from the Nationals finally got a clue, and told us that in right center field there were twenty (count 'em, 20) gates, and small lines. Gee, thanks guys. There were dozens of Nats employees hanging around, saying “gee, look at the long lines” for an hour or more, and they finally say something at about 7:50, for an 8pm start.

I eventually got in, and up the the main concourse in time for the National Anthem

The Opening Ceremonies

and, thanks to the wonders of TV commercials, up to my seat (second row from the top, though our regular seats will be much closer to the field) in time for the first pitch

Just after first pitch at Nationals Park

Odalis Perez to Kelly Johnson, for a strike.

The Nats scored twice in the first inning, then made 24 straight outs before Ryan Zimmerman ended it with a walk-off homer with two out in the bottom of the ninth. During the game, I took a bit of a walk-about, and got this picture of the Anacostia waterfront, which looks a lot better at night than it does in the day.

Anacostia Waterfront from top of Nationals Park

All in all, the park looks to be a pretty good place to see a ball game. The main question is whether or not 40,000 people can get to it during a DC rush hour, or out of it after a day game. But as a place to watch baseball, it looks like it's going to be a winner.

Monday, March 31, 2008

Bill Self, University of Kansas Basketball Coach

(Photo from Sports Illustrated, motivational design from Motivator.)

I didn't watch all of the Davidson-KU game yesterday, because I was waiting in line for the Washington Nationals' Season/Home/Stadium opener – more about that in another post.

I did watch most of the first half, except for the ten or so minutes after the first TV timeout when I turned the TV off because my blood pressure was getting up to pre-medication levels.

KU was cold, nervous, and generally not playing up to its potential – if you have to rely on Sasha Kahn to save you, then you're in trouble. Fortunately they managed to “contain” Stephen Curry, holding him to 25 points – almost half of Davidson's total.

So next week we get to play Roy – the first time that Carolina and Kansas have played since the divorce. I don't know what to think. Did KU get its bad game out of its system, or is it really, truly, the fourth-best team in the Nation, just like they were seeded? At least if they are officially the underdog they will probably be a lot looser than they were on Sunday.

And, way back in about 1990, a Kansas coach who had never been to the Final Four led his team to a victory over Dean Smith in the semifinals. I think it's about full-circle time.

Kansas by five.

Saturday, March 29, 2008

Yet Another Reason To Hate Duke

Even though I'll probably be spending a year there:

CoachK.com

The photo just says “Snake Oil Salesman,” doesn't it?

Wednesday, March 26, 2008

Defusing the Democratic Dilemma

I know people dump on the Electoral College all the time, but it does make it possible to change the rules of an election on the fly, as it were (see Florida, 2000, or the 1876 election). So I offer a modest proposal to scuttle the upcoming Clinton-Obama convention debacle:

Let the both run in November.

Here's how it works:

  • The Democratic party puts up a slate of electors in each state. All 538 of them are pledged to support the Democratic candidate, whether it be Barack or Hillary.
  • If the Democratic slate gets 270 or more electors, then the Democratic party immediately funds a “run-off” election, between Obama and Clinton — they can afford to do it, they're going to run the White House and probably Congress for four years. This election is open to everyone, Democrat, Republican, Independent, or Naderite. (I'd restrict this to true Democrats, but how can you tell? These days it isn't just Democrats that react to a picture of Bush like Dracula does to a crucifix.)
  • The winner of this runoff gets the 270+ electors, and becomes President. The runner up gets to be VP, unless (s)he is so disgusted by the process (s)he decides to emigrate to Canada.
  • Thus until Nov. 4, H&B run against McCain. If they win, then they get, let's say, two weeks to attack each other. We'll have the runoff on Nov. 18, and the electors can gather in December to fill in the blank.

Neat, huh? No laws need to be changed, no convention fight, just a massive redo.

Assuming, of course, that John McCain doesn't win it all.

Sunday, March 23, 2008

A Programmable Audio Recorder

You might remember that I like to listen to A Prairie Home Companion at the gym. That link shows you how to take the Real Audio stream from the PHC Archive and turn it into an mp3 or ogg file.

And that works, everywhere except with Verizon FIOS, which for some reason only lets streams in RTSP be played by a real RealPlayer client. Probably a firewall issue. I've tried tracking it down, but haven't gotten up the energy to try to talk my way up the FIOS help staff to find someone who would tell me how to fix it.

But, as someone once said, “there's more than one way to do it.” For example, I could use Realplayer to play the file through the speakers, and then record the output either by invoking SoX as rec, using gnome-sound-recorder, or using Audacity (which I can't get to work in this mode). Any of these methods, of course, ties up the speakers for two hours, not very desirable.

Alternatively, one could stumble upon the fact that Minnesota Public Radio (MPR) plays as an http (port 80) continuous stream on the web, that Prairie Home Companion airs for two hours starting at 5pm Central Time (6pm Eastern) every Saturday Night, and that FIOS allows mplayer to listen to that stream. Oh, and that MPR puts on a 15-20 second advertisement when you start the download.

With that information, we construct this little script, which you should save in a directory that the /bin/sh shell can find. We'll call it mpr_record, and we thank Penguin Pete for the hint on how to put all of this in a box:

#! /bin/bash

# Get to the correct directory

cd $HOME/audio/podcasts/prairie_home_companion

# get year month date

year=`date +%y`
month=`date +%m`
day=`date +%d`

# Print out what we want to do:

echo Recording to phc_$year$month$day.flac

# Record for 122 minutes:  One minute before the official start,
# and one minute after the official end, just in case our clocks
# are off, and to account for the initial MPR ad.

# You don't have to use the flac format,
# Using .wav will end up giving you a smaller .mp3 file
# with a loss of quality that won't show up at the gym.

# You might not need the two-step process, just save directly
# to .mp3 or .ogg, but my notes say this isn't very efficient
# in terms of final file size.

# The 1> /dev/null makes sure all of the streaming information that
# mplayer continuously spits out doesn't make it into the final
# output.

# http://www.prairiehome.org/play/128.pls is linked to the MPR stream.

mplayer -endpos 2:02:00 -vc null -vo null -ao pcm:fast -ao pcm:file=phc_$year$month$day.flac http://www.prairiehome.org/play/128.pls 1> /dev/null

# Convert to mp3
# ogg produces a smaller file, but my player doesn't do ogg.

echo Converting to phc_$year$month$day.mp3

# Note that SoX must be recompiled to support MP3s, if that's
# what you want here.  Actually, that link doesn't work on Ubuntu,
# I had to recompile from source.  Someday I'll write that up.

sox phc_$year$month$day.flac phc_$year$month$day.mp3

# Of course, ffmpeg would work just as well:

# ffmpeg -i phc_$year$month$day.wav phc_$year$month$day.mp3

# Edit id3 info.  This adds both id3v1 and id3v2 data.
# My labeling scheme is designed to overcome the limits of my
# player.  You might want to label yours differently.  See
# 'man id3v2' for all the options.

echo Labeling phc_$year$month$day.mp3

id3v2 -t $year$month$day -g 100 -y 20$year -A NPR -a "Prairie Home Companion" -T 1 phc_$year$month$day.mp3


So, if you've read all the comments, you'll see that this records from MPR for two hours and two minutes. Now we just need to make sure this starts one minute before 6pm (Eastern US), every Saturday. If you've been following along this blog, you know this is a job for cron. The crontab entry we need is

59 17 * * 6 mpr_record > $HOME/audio/podcasts/prairie_home_companion/mpr.errors 2>&1

which starts the recording at 17:59 (5:59pm) local time (Eastern, here), on the sixth day of the week, running the program mpr_record and putting all of its output into an error file, just in case we need to track things down.

Of course, what we've done is turned the machine into the Internet Audio version of a programmable VCR. This can be used for any regularly scheduled broadcast the mplayer can play.

Thursday, March 20, 2008

Junior Madness

Back online again. It's been a while, I know.

While the Big Dance gets started, I just want to mention there's a smaller version going on simultaneously: The National Junior College Basketball Championship. This has been in Hutchinson, Kansas, for as long as I can remember, and in Kansas, it's a very big thing, at least if the Hutchinson News has anything to say about it. Sixteen teams, one week, and twenty-six games – you play four games or until you lose twice, whichever comes first. When I was a kid our coaches used to take us to the early round daytime games: back then it probably cost $2.00 each to see four games. Only a few big-college teams went to the NCAA tournament, so there were a lot of out-of-competition Division I coaches there, looking for some help for the next season. There was also a certain lack of defense, so the games were all fun to watch – remember, this was back before the shot clock and the three-point line, so a team that wanted could really slow things down. Not in Hutch, because you can't impress a D-I coach with your ability to dribble the ball at half-court.

Unfortunately it's on neither ESPN, nor Fox Sports, nor national radio, though you can buy radio rights for $150/game. It's a shame, since a lot of these kids will be playing for the Big Boys next year. I know, it conflicts with the upset round of the Dance, but still, you think there would be a market...

Monday, February 18, 2008

The Bookshelf

Happy Washington's Birthday, everyone.

Every once in a while (OK, once before) I like to give mini-reviews of the books sitting beside my bed. This time it's all science fiction:

  • Radio Freefall, by Matthew Jarpe: A first novel. It's got sex (a bit). Drugs (a bit more). Rock and Roll (lots). It's also somewhat cyberpunky, since everyone and everything is connected to the web. And, finally, it pays tribute to Heinlein, what with a moon colony that's revolting.

    Despite all that, the novel most reminds me of George R. R. Martin's The Armageddon Rag, what with a mysterious old rocker called Aqualung raising and obscure band to world-wide fame, with potential world-wide catastrophe looming.

    As a first novel it's not bad, though it does require the Evil Villain to be Phenomenally Stupid at just the right moment. Worth looking at, and looking for the next Jarpe novel.

  • Rainbows End by Vernor Vinge. You think of Vinge as a hard SF writer, but he does often does something that resembles cyberpunk. This one takes place around 2030, and it's pretty much believable that we'll be as connected as he says here. It's also pretty much believable that the geezers at that time (meaning us) will be pretty much out of it. Great plotting. A little confusing at the end, and I never did figure out who Rabbit was. But worthy of the Hugo it won.

  • Jonathan Strange & Mr. Norrell by Susanna Clarke. Another first novel, and another Hugo winner. Set in the Napoleonic era, it's the story of the magician Mr. Norrell and his partner/apprentice/rival Jonathan Strange. It's definitely not cyberpunk. To me it reads like Vanity Fair, but it's probably technically Georgian, it's just that I'm lot more familiar with the Victorian era. The paperback copy is over 1,000 pages long, and I'm only half finished, but it's worth looking at.

  • Cyril Kornbluth is probably best known for the short story The Marching Morons and his collaborations with Frederik Pohl. His Share of Glory has all of the short fiction written solely by Kornbluth, either under his own name or a pseudonym.

    I want to like this book. I really do. But the stories are dated, sexist, racist (see The Education of Tigress McCardle, which manages to be both), and just not fun. It would have been nice to see if Kornbluth could have grown in the 1960s, as Asimov, Pohl, Anderson and Heinlein at least tried to do (though they started from a far higher level), or if his output would have just slowly wound down into total hackdom. Unfortunately he died young, so we'll never find out. Recommended only if you really like 40s and 50s SF, and then you'll want to take it in small doses.

Sunday, February 10, 2008

Steppin' On Out

Last night we got to hear the Capitol Steps over at South River High School. If you have the least bit of interest in politics, half a sense of humor, and a bit of tolerance, you want to hear these guys. You can get a good sampling of their work from the year end reviews, which, though in Real Player format, can actually be downloaded and converted to your favorite format with ffmpeg.

In other political satirist news, Mark Russell is back at the Shoreham Hotel in DC. I never went there to see him on his first go-round there, which overlapped my time in the Washington area for about 15 years. Maybe this time I'll make it.

Tuesday, February 05, 2008

From Our Credit-Where-Credit-Is-Due Department

FactCheck.org draws similar conclusions to yesterday's article. They've also earned a (coveted?) spot on the right-hand side.

P.S. Y'all who clicked in from an email notification: Please feel free to comment. I don't bite, usually.

Monday, February 04, 2008

13,417 Reasons to Actually Read What You Wrote

All over the web, and in my inbox, is a message which says that there were 13,417 military deaths in the Clinton administration, and “only” 9,016 deaths during the George W Bush administration. The email then goes on to claim that this is a media coverup of the greatest proportion. (I'm not going to repeat, or directly link to, the email here, look it up yourself and follow the comments, they are instructive.)

Helpfully, the unknown author then provides a link to the document providing the original data:

http://www.fas.org/sgp/crs/natsec/RL32492.pdf (a PDF file)

Careful reading of which shows that the numbers said author used are wrong, and his/her conclusion bogus.

I could go on to say that this shows that some people see only what they want to see, and don't even bother to look at what is in front of their noses — but that would be wrong, and anyway I've already done it in email.

Instead I present a graph of a couple of columns from the above reference: the total number of deaths among active duty military from 1980 to 2006, and the total number of deaths due to hostile action. The military is about 50% smaller now than it was when Reagan was President, so we'll look at the rates. The numbers are normalized to 10,000 “FTE” military personnel, where the Full Time Equivalent includes Reserve and Guard troops on active duty. That is, “Total” is the number of deaths per 10,000 military in a given year, and “Hostile” is the number of deaths per 10,000 military due to hostile action.

Obviously, if you were in the military in the Clinton years you had a much better chance of surviving than during the rest of the survey.

The military is a dangerous profession. Let's not trivialize the danger by trying to make cheap political points with bad data.

And read the report before you comment.

Note: since the paper gives data by year, the graph above assumes that a President takes office on January 1, 1980 + 4*n (n = 0, 1, 2, 3, 4, 5, 6), not January 20 of the same year. That's an unavoidable error at the level of this study, but I doubt it makes much difference in the final results. If you have the number of casualties those days, let me know and I'll redo the graph.