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...