Wednesday, December 31, 2008

Upgrading to Ubuntu Intrepid

I'm finally getting around to updating my Linux machines to Ubuntu 8.10 (Intrepid Ibex). It's not a complicated process, but I wanted to catalog all the steps, for future reference:

  1. Back up anything on your machine you can't bear to lose. Don't assume that the upgrade will go painlessly, and none of your data will be lost. There is a technical name for people who believe that they don't need to back up data before updates: Fool.
  2. OTOH, you don't need to back up your /usr, /bin, /etc, /lib etc. directories, unless you've tweaked them, because even if you hose your installation, when you install a new distribution you'll get all of that back.
  3. Run sudo apt-get update and sudo apt-get upgrade from the command line to be sure everything is up to date on your current system.
  4. Since we're upgrading from Ubuntu 8.04, which has long term support, we need to explicitly tell the system that we want an update to a non-LTS release. Go to System ⇒ Administration ⇒ Software Sources, click on Update, and change the Release upgrade selection from Long term support releases only to Normal Releases.
  5. Kill any processes you've got running in your own space: browser, mail client, emacs, etc.
  6. Go to System ⇒ Administration ⇒ Update Manager. At the top of the window will be a button saying Upgrade. Ignore the Partial update warning messages.
  7. Hit it.
  8. The upgrade process takes some time. You need to check back once in a while, because there will be the occasional question to answer.
  9. It took about 45 minutes via FIOS to download all of the update software.
  10. Took about 5 hours to do all the updates on Hal. Probably way too much software installed. Next update I think I'll start from the CD and only install the software I really want.
  11. It took another 30 minutes or so to remove old packages.
  12. Glad I took the day off.
  13. At the end, you'll probably get a message to the effect that some of your software couldn't be updated. This is third party Unfree software, such as Acrobat, RealPlayer, GoogleEarth, etc. If you're running a truly Free system you probably won't see this message. If you're running Free, though, you're probably running Debian, so you're not reading this. To update your Unfree software, go back to Software Sources, click Third-Party Software and change any lines that say hardy to intrepid. Click the repositories you want to enable (medibuntu for sure, canonical possibly).
  14. Go back to the Update Manager and update your software. There will be updates, probably even if you aren't using the third-party software repositories. When that's done, before quiting, click Check, then update again if necessary. Repeat until your system is truly up-to-date.
  15. Rebuild any software that depends on obsolete libraries. For example, SoX, which I like to build from source to do proper conversions to MP3 format as well as away from MP3 format. This is a good time to get the latest version of these codes.

Sunday, December 28, 2008

A Year of FIOS

Well, in the language of a current TV show, we've been using FIOS for One year, nine days, and forty-six minutes, so it's time for our first annual performance review:

  • It works. Internet, Television, Telephone, all work.

  • The system has no trouble with Linux machines. The tech who installed the router had to use a Windows machine to initialize it, but I think that was more of a tech ability issue than an absolute requirement. I can certainly log into the router via the web interface from either of the Linux boxes, as well as the Macs and the windows machines. I think I've noted that the router won't let you listen to streaming RealPlayer output with a program other than RealPlayer, but that's a minor issue and I could probably call tech support to see how to set the router firewall permissions appropriately. Everything else works fine.
  • We haven't used the telephone that much, frankly. My wife prefers the sound on the copper-wire line we kept, and since I'm not here that much this year we don't often use the FIOS line. I don't notice any difference in sound quality, but you should know that I just found out that a Sonic Screwdriver makes a sound that I can't hear, but everyone else can.
  • TV reception is excellent. There haven't been a lot of the pixellation issues that we had with Comcast digital. The only thing better about Comcast was that they included Starz, Encore, etc., in the standard package. FIOS doesn't, but if you buy the Showtime package, you get all of that as well. (HBO is a separate package, alas.)
  • When FIOS switched to an all digital TV signal last summer, they sent me a free convert box that allows me to access all of the TV channels on my second TV. It doesn't have any fancy features, but it accesses all the FIOS channels.
  • All in all, the quality of service is slightly ahead of Comcast's. However, that has a lot to do with the quality of the connection between the street and the house, and Comcast was using an old cable. If we ever switch back to Comcast, they will hopefully install a newer, high-speed, connection.

So all in all, a positive experience. Knowing what I know now, would I sign up with FIOS again? Yes, absolutely. Next December our two-year commitment to FIOS ends. Will we keep it? It depends on the package Comcast has to offer.

30 Dec 2008: Things I forgot to add the first time:

  • Verizon gives you a measly 10 MB of personal web space, last I looked. I think Comcast gave you about 250 MB. So I had to move my personal web pages to a freebie website provider. Well, it was free except that I had to register my domain with them. Since that only costs $7/year, it's not a problem. But if you have a significant amount of junk content in your current ISP's personal web space, it won't fit into FIOS.
  • The DVR box that we rent from FIOS comes with some nifty widgets, allowing you to view weather, traffic, news, and sports results, along with community information, of which we've had none.

31 Dec 2008: Just one more thing: The FIOS tech can initialize your system without Windows. Just look at the last paragraph of this link. Wish I had known that last year. Oh, well, that was a long time ago, in (almost) another administration, and anyway, that Windows installation is dead.

Friday, December 26, 2008

Breaking Up MP3 Files

I have a small MP3 player that I take to the gym to keep me occupied while I'm working out. It's a hand little thing — except that it's little which means that the buttons are both few, and small.

In particular, the fast forward button is also the next track button — you press quickly to change tracks, and you hold it down to fast forward.

Which brings up a problem when you want to fast forward through a selection: if you are fast-forwarding and let up on the button ever so slightly, it skips to the next track. Which is a really bad thing when your tracks are two hour radio shows.

Yeah, it's bad design. But it's a lot cheaper than an iPod. So let's make do with the player we have, and note that CD players have this same problem with audio books. The audio book publishers have solved this by breaking up the selection, say a chapter, into smaller tracks, which take 3-4 minutes to read. If you need to scroll through a bunch of tracks, you can easily do so at 15-20 key presses per hour of audio.

There's a utility for doing this with MP3 tracks, called mp3splt, available via apt-get in Ubuntu, and presumably available for most Linux distributions, as well as Windows machines and Macs. It will break up an MP3 (or OGG) file into user specified segments. It's pretty flexible, in that you can specify the length of each segment, or break when the silence is longer than a predefined number of seconds, or into fixed-length segments, or, what I like best, into nearly fixed-length segments which are adjusted in length so that they begin and end during silent stretches.

It's a command line utility, and it works really well: except that it destroys about 90% of the ID3 tags, including all the ID3 version 2 information. I don't like that, as my MP3 player can be programmed to sort by title, album name, or performing artist, and I use this to determine the order I'll listen to programs such as Prairie Home Companion and Car Talk.

The canonical command line utility to label MP3 files is id3v2. I used this to write a rather small Perl script, splitmp3, which calls mp3splt to split an MP3 file into chunks which are each about five minutes long, preserving the ID3 labels of the original file, and including the appropriate track number. You can download the file from this link:
splitmp3

Let me know how it works for you, and feel free to add improvements.

Tuesday, December 23, 2008

Rationalizing Your Email

A. Friend recently discovered, yet again, that the Evolution mail client doesn't like it when your Inbox grows bigger than 2 GB. I've never had this problem myself, but a family member once found that Netscape had a similar limit. So let's come up with a few rules about how to keep your email rational. Some of these are written for Thunderbird, my client of choice, but most other mailers have similar options. In no particular order:

  • Don't store your messages at all: Gmail currently has a 7.1GB limit on all messages. And if you use their IMAP function, you can view all your messages in your favorite email client (even Outlook). You can even put the mail in folders, because IMAP interprets Gmail's labels as a client's folders. Of course, you can only read your email when you are connected to the net, but you can read it from anywhere that has a modern Internet browser.

    Note: Don't use Gmail for anything you'd like to be able to delete before the subpoena arrives.
  • Use Filters: I use Thunderbird's filter mechanism to sort email before I read it. All email from news sources goes into a News folder, email from family or friends goes to a folder named for that person, emails from companies I ordered from exactly once goes to /dev/null, etc. Thunderbird then highlights the folder name and tells me how many emails I have unread in that folder (except /dev/null, for some reason), so I never miss anything.

    A.F. wants to post-filter his email: after it's read, put it in an appropriate folder. There's an option for that in the Thunderbird filtering system, as well.
  • Delete stuff: Each one of us has a friend that sends us an attached video, sound bite, or photo album each and every day. Look at them and delete. If something is so funny/moving/outrageous/sexy that just have to keep it, use the Save As feature to save the attachment in its native format, outside of your mailbox. Why? Well, in your mailbox the attachment is stored as 128 bits to the byte ASCII. In native format it will be stored using 256 bits to the byte. Do the math. You can also gzip the saved attachment much more easily than you can a single email in a folder. (Though emacs's RMAIL mode would read gzipped mail easily. Text only, unfortunately.)
  • If you think you simply must keep it in email: Ask yourself two questions: 1) Would I want to get this in an email next year?, and 2) Have I already sent this to 20+ people? If the answer to 1) is No, delete it now. If the answer to 2) is Yes, delete it — one of those 20 will forward it back to you within the week.
  • Compact your folders: Thunderbird, at least, doesn't actually delete an email message when you hit delete. It merely marks the email as deleted, and keeps it in your Inbox. That's handy if you accidentally delete something, but fatal to keeping the size of your Inbox down. Every once in a while use the Compact Folder option.
  • Periodically Reorganize: My work email box keeps getting larger and larger every day, since I get a lot of emails that resist proper filtering. So at the end of every year, I move all of my Inbox into a new folder, this year's will be called 2008 Mail. Do a similar thing for your Sent Mail folder. If you routinely send/receive more than 2 GB of email in a year, and can't bear to part with any of it, the problem's not in your mail client.

Those are my suggestions. Add yours below:

Sunday, December 21, 2008

An Anonymous Duke Student's Comment on the Election

This appeared sometime in November, it was still there on Friday.

Saturday, December 13, 2008

Cleaning Out Cobwebs

I recently purchased an SVA 19" Widescreen TFT-LCD Monitor. Maximum resolution 1440x900, thin panel, internal speakers (but no manual volume control, yech), user's manual in something resembling English, and it was on sale for $99.95 at Staples. Works fine. Monitors are a commodity these days, anyway.

But that's now why I called you here today. The problem was that Hal, here, couldn't display the 1440x900 resolution of the monitor. Even though Hal's Formerly Evil Twin, running on an even bigger monitor down in Raleigh, had no trouble. All Hal could do was 1024x768, which tends to stretch out on a widescreen monitor.

It didn't take long to find the problem. Here's the relevant section of Hal's /etc/X11/xorg.conf file:

Section "Screen"
 Identifier "Default Screen"
 Device  "Intel Corporation 82845G/GL[Brookdale-G]/GE Chipset Integrated Graphics Device"
 Monitor  "ENVISION"
 DefaultDepth 16
 SubSection "Display"
  Depth  1
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  4
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  8
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  15
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  16
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
 SubSection "Display"
  Depth  24
  Modes  "1024x768" "800x600" "640x480"
 EndSubSection
EndSection

No resolution is above 1024x768. And ENVISION means that this was set up for a monitor I got rid of a year or so ago. In fact, this xorg.conf file might well go back to the days when I was running Fedora. so this might, just might, need a little modification.

To fix this in the olden days, say 2004, you'd track down all of the parameters for the current monitor, edit the file with the appropriate information, and hope all was well. Later there were scripts that did some of that, if the monitor was well known.

Now you just run

sudo dpkg-reconfigure -phigh xserver-xorg

This generates a default xorg.conf file, with the relevant section

Section "Screen"
        Identifier      "Default Screen"
        Monitor         "Configured Monitor"
        Device          "Configured Video Device"
EndSection

xorg itself then configures the monitor, device, etc., if you Ubuntu has all the drivers. This won't work for everything, and if you have a video card with proprietary drivers you're going to have to load them up, but it's a heck of a lot easier than back in the day.

Sunday, November 30, 2008

Chasing a File's Tail (In BASH)

My very first Unix experience involved the C shell (/bin/csh in your program), and I've always been partial to it, particularly for the ease of using aliases and tabbed file name completion — both available in other shells, of course, but I find this all easier in csh, or its modern descendant, tcsh.

However, when writing shell scripts, I tend to use Bash, mainly because our old AIX machines used the Korn shell (ksh), and Bash is the closest shell to Korn which is readily available on all systems. Besides which, csh programming is frequently considered harmful.

However, one thing that came much more easily to me in csh than in bash (or sh, or dash, or ksh), was the manipulation of file names. Thus, if I have a file named

/home/jhawk/chalmers/pot/dont.smoke

stored in a variable $foibles and just want the file name, not the directory, I write $foibles:t and get dont.smoke as the result. Of course you can do this in Bash as well, but I never remember how to do it. (Actually, I never remember in csh, either, but running foreach on a set of files and trying out $file:a, $file:b, ... , eventually gets me where I want to go.)

So here, as part of the original Linux Notebook function of this blog, is a table for file manipulation in Bash and csh. I've borrowed it from the Bash FAQ, question D3:

Assume

a=/a/b/c/d and b=b.xxx, that is:

$ echo $a $b /a/b/c/d b.xxx

Then

Operation csh bash result
File Path $a:h ${a%/*} /a/b/c
File Name $a:t ${a##*/} d
File Head $b:r ${b%.*} b
File Tail $b:e ${b##*.} xxx

Thursday, October 30, 2008

Choosing Default (or null) Applications

I've been ripping a lot of CDs lately, to play on the Focus's MP3 player while I'm making the five-hour drive between Durham and Bowie East. A CD full of MP3 files plays a lot longer than an audio CD. My preferred application for ripping is grip.

Ubuntu 8.04 (Hardy Heron) has some defaults built into its gnome desktop. In particular, if you insert an audio CD, it assumes you want to play it and brings up rhythmbox, even if you already have grip running!

Annoying. And, as has been noted by others, in Ubuntu 8.04 it’s surprisingly hard to change default applications to something of your liking.

What do I want to happen when I pop in a CD? Nothing. That's right, nada, nichts, zip, /dev/null, nothing. This is Linux, right? I'll decide which program I want to run, when I want to decide it.

The aforementioned post has one suggestion: going into /etc/gnome/defaults.list and editing the appropriate lines. So I did. Since I didn't want anything to automatically happen when I inserted a CD, I deleted the lines reading:

x-content/audio-cdda=rhythmbox.desktop
x-content/audio-dvd=rhythmbox.desktop
x-content/audio-player=rhythmbox.desktop

It worked, too. When I put in an audio CD, rhythmbox didn't appear. No, sound juicer, another CD ripping program, popped up, again in parallel with my already running copy of grip.

Now I've used sound juicer. I like sound juicer. Sound juicer is no John Kennedy, but it's a good program. I just like grip better. So what to do?

The solution, my friends, lies within nautilus, Gnome's file manager. Well, somewhere in there, I can never find the appropriate menu option. However, if you try to bring up nautilus from the command line and use file completion, you find:

nau
nautilus                  nautilus-connect-server
nautilus-autorun-software nautilus-file-management-properties
nautilus-cd-burner        nautilus-sendto
$ nautilus

nautilus-file-management-properties sounds promising, so let's run it. That brings up a box that looks like this:

nautilus preference box

Two options are apparent: If you click on the box next to CD Audio, you can select the option Do Nothing. Or, you can click the box that says Never prompt or start programs on media insertion. That's what I did. And, when I insert a CD into my computer ...

Absolutely nothing happens.

Until I want it to happen.

\

Note: This works in Gnome. KDE doesn't use nautilus, so there's another program, I don't know what, to do that. Other desktops, e.g. FVWM, don't usually try to impose default behavior. You have to ask to to something special. Also, this is probably a Ubuntu default, not a general Gnome default. So YMMV, but that's the wonderfulness of Linux.

Tuesday, October 21, 2008

Installing a Scanner

One of the nice things about being on a college campus is that you can occasionally get involved in marketing ploys promotions designed to hook you on a particular product let you know about certain nearly obsolete products.

Case in point, the Canon PIXMIA MP470 Multifunction Printer, which retails for around $100, and which the Duke Bookstore had on sale for $20. That's right, one Andy Jackson. Plus $4 for the USB2 cable.

It's not a industrial scale printer, and it's probably not a great printer for sending out lots of photos, since it's a two tank (one black, one cyan-magenta-yellow) system. But I need a printer here in North Carolina, and for $20 ...

Naturally, there were problems:

First, I couldn't get the thing to work. Something about the ink tanks not being detected by the printer. Canon technical support was fantastic (no, I am Not Making This Up). They responded to my emails within a few hours. First they sent replacement ink tanks, then they sent a replacement printer, and a UPS shipping label to return the old one. (Obviously they have learned the lesson of King Camp Gillette, who noted that it doesn't matter how much they pay for the razor, as long as they keep buying the blades. They want me to keep using this printer through lots of ink tanks.)

The new printer worked fine, with the supplied drivers, under Windows and on the Mac. Of course, that left Linux, drivers not supplied.

Fortunately we have CUPS, the Common Unix Printing System. The version of CUPS supplied with Ubuntu doesn't have a native driver for the MP470, but it does have one for the MP150, and that works. (The driver for the MP610 prints blank pages. I didn't try any of the others.)

But Wait! The MP470 isn't just a printer, it's a copier, and it's a scanner!!!! (Not, unfortunately, a dessert topping.) The scanner works fine, again with the supplied software, under Windows and on the Mac, but, again, what about Linux?

Naturally, there's software, from the SANE Project, but the version supplied with Ubuntu, 1.0.19, doesn't include the MP470. The newest version, 1.1.0, does, but it doesn't seem that it will be included in the next Ubuntu release, Intrepid (8.10).

So we're left with getting the source code for 1.1.0, and compiling it. I've done this kind of thing many times before, of course, but Nicolas has complete directions. The only change necessary for me was that I had no entry for a scanner under /etc/udev/rules.d/, so I just made one:

sudo cp tools/udev/libsane.rules /etc/udev/rules.d/71-libsane.rules

where 71 was not one of the numbers already in use in the rules.d directory. After installing the software, I had to give myself permission to use a scanner (System => Administration => Users and Groups => Properties => User Privileges) and I had to reboot – just restarting the USB services didn't work.

So now I have a scanner, as well as a printer and copier:

Scanner Test Image

Not to mention the extra tanks of Ink Canon sent me. For $24, + tax.

Saturday, October 11, 2008

Neil Gaiman at the National Book Festival

Neil Gaiman at the National Book Festival

A couple of weeks ago we went to the National Book Festival (the best thing the Bush Administration ever started) to listen to Neil Gaiman and to stand in line for three hours, getting alternately soaked and sunburned, waiting for him to sign The Graveyard Book and Neverwhere. It was worth the wait, Gaiman was extremely nice to us.

My wife says this is a really good picture, so I thought I'd share it.

Saturday, October 04, 2008

A Long Time Posting

It's been a while since I've posted here. As some of you know, I'm taking a year's Sabbatical at Duke University. You know, get away from the paperwork for awhile, and start a new line of research.

And also look around a bit. I've taken bunches of pictures, way too many to put in this blog. For those of you that are interested, go over to my home page and look at

Duke University — Part One

Hopefully more pictorials will follow.

Tuesday, July 29, 2008

Skype

I just set up Skype for Linux here on Hal's Formerly Evil Twin.*

I downloaded the deb file, did the sudo dpkg -i thing, plugged in a Logitech USB headset, and fired up Skype. Voila! I logged in easily, I set up Skype to use the headset to talk and listen, and made the test call, which worked fine — except that it about blasted out my ear.

Since I didn't change the default sound system, which is still alsa, none of the standard volume controls would turn down the sound. I looked around the web, and finally found the answer here. You have to explicitly tell your system to turn down the volume on the USB device. For my system it's dsp1, but your mileage may vary. To get volume control for dsp1, open up a terminal window, and run

alsamixer -c 1

This will bring up an interface where you can adjust the volume — with the arrow keys, not the mouse, it's a text window after all.

It apparently works, though I'll have to wait for my ears to stop ringing to be absolutely sure.

*Do not give me a hard time about using unfree software. This is a work related project, and I have to make compromises if I want to keep getting a paycheck.

Thursday, July 17, 2008

Web Pages, Torrents, and Files (Oh My)

I usually don't post twice in the same day (or the same week, anymore), but here's something I wanted to bookmark, courtesy Debian Package of the Day:

aria2: high speed command line download utility

Just what it says. It's akin to wget, except that you can apparently link to a torrent as well. I, uh, ahem, haven't tried it out yet, so no review on how well it works.

Unfortunately, it doesn't seem to be able to download an entire http directory tree.

Oh yeah: even though the package is called aria2, the utility itself is aria2c.

Locksley Would Be Proud

From the University of Nottingham, via the Beeb and Science in the News:

The Periodic Table of Videos

a collection of YouTube videos showing the elements of the periodic table. That is, if you click on Palladium, you get a video of a couple of Merry Men telling you about its properties and commercial uses, and showing you a bit of palladium wire. Other vidoes have Lithium in water, Neon lights, etc. Could be a bit more like Mythbusters, but it is interesting.

Plus there's some really great hair.

Sunday, July 13, 2008

Wireless Ubuntu

You may remember that Hal's Evil Twin runs Linux as well as XP. Well, I'm going to take HsET on a long trip with me, and I wanted it set up to run Linux properly. So I downloaded a copy of the latest Ubuntu Hardy Spin and installed it.

Worked perfectly, if I used an ethernet connection.

Then it was time to try the wireless. Previously this had been painful.

And this time it looked to be the same:

Verizon FIOS gives you a router using WEP encryption. We're rather isolate out in East Bowie, so I've never bothered to change it. So to set up the network, you go to System => Network, unlock it (i.e., sudo), click on the wireless connection, edit properties to have the correct SSID, password, etc., give the configuration a name, save it, and you're off to the races, right?

Wrong. It just wouldn't work.

Until I rebooted.

Now, mind, THIS SHOULD NOT BE NECESSARY. network-manager, bless its heart, should start and stop the wireless whenever you ask. No documentation mentions the need to reboot.

But, indeed, I had to reboot. Was it HsET? Was it me? Was it Ubuntu being crazy? I don't know.

At least it works, for now.

Note that HsET still runs XP as well, so it will keep the Evil Twin moniker, at least for a while.

Saturday, July 05, 2008

Heresy

We just bought the New Graduate a new computer (Dell Inspiron 530, 3GB memory, 250 GB disk, 19 inch wide screen monitor), and being in the nature of things, it came with Vista Home Premium. I wasn't particularly happy with that, but NG wants Photoshop (gotten cheap from Creation Engine), as part of the graduation package, and I'm not going to argue with an artist about tools.

So here comes the computer with the evil Windows Vista attached. I hesitated, but then bit the bullet and set it up.

You know what? It doesn't suck.

OK, we're running on a dual-core chip, with lots of memory, but it didn't suck. It actually found the appropriate drives and software for our printer and camera. I suspect it might have even found the driver for our drawing tablet, but I beat it to the punch and got the driver (which works better than the XP one) myself.

  • Babylon V episodes from Hulu played flawlessly, widescreen and at high definition, over a wireless connection.
  • I was able to transfer files (mostly) from the old computer to the new, again over the same wireless network. Not properly transfered were the settings from Thunderbird and Firefox (go figure), but I was able to get that fixed without too much trouble. It would have been hard for a newbe, though.
  • I got a pop-up window asking me if I wanted to permit some action every time I wanted to install some software, but it wasn't particularly obnoxious, and I'm used to it from using apt-get and Mac OS X all these years. In fact, it really needs to ask for a password, just like sudo apt-get and the OS X software installation system.

Would I get a Vista box for myself, unforced by work requirements? Nope, not on your life. But I can see that given a brand new computer, with drivers set up properly by the OEM, Vista can be a reasonable OS.

Now mind you, it still has problems:

  • The Command window is still the same as it was in Win95, 25 lines, 80 characters, and no hope of doing anything useful. I hope you can still install the Cygwin package, if you're stuck with a Windows machine and need to do real command-line work.
  • You can't just say
    $ apt-get install ...
    to install a new piece of software. No, you've got to go to the originator's site and get the software, clicking on all those boxes that no one ever reads that say that Adobe gets your first grandchild or whatever. (If someone would make an ad-supported software aggregator site that mimicked synaptic and handled all the Windows installation details, they'd get rich. Overnight.)
  • It's still Windows, so doing any heavy customization work requires you search all over the place, to, say, have a rotating background.

But it don't suck. So why is Vista so universally hated? Well, for one thing it won't run on most computers in existence, at least not well. It's a resource hog. You need a modern high-power computer to run it right. Something like a Cray YMP just ain't powerful enough.

And it's not XP. There are significant interface differences. Now that doesn't bother someone coming from Linux, and it doesn't bother New Grad, who was heard to say I'll just click around to figure it out. But it does seem to bother many people. I'm not sure why. A backed-up computer is one of the few things in the world you can break with complete and absolute assurance that you can restore it to its previous health. But playing with software seems to scare many people. Learning something new scares them even more.

But Vista doesn't suck. It's still not Open Source, and it's probably not all that secure, and it doesn't give you all the options that a good Linux system does, but it's not as bad as you may have heard – especially from XP fans.

And here ends the heresy.

Sunday, June 22, 2008

Obsfucating email

One of the annoying things about some jobs is that random people need to be able to email you, meaning that your email needs to be out on the web — No, not me, but you'll note I have my email address on the sidebar anyway.

This almost automatically generates a lot of spam, as harvester programs search your HTML source and look for the mailto: links.

There are ways to hide email addresses from programs, as a look at the source code for this page will show. Depending on how secure you want to try to be, I've found three levels code that might help reduce spam to your email address. Of course, it doesn't protect you from spam generated because a virus or spyware code got your email from someone's address book, but it should help keep the spam down a bit. Note that all require Javascript:

Note that I've not labeled any of these best, and I don't claim they will work against every possible harvester, but it should help. You'll probably also be better off starting with a brand-new email address. And, of course, making sure that everyone who puts your email in his address book uses Linux.

Sunday, June 08, 2008

The Annoyances of Upgrades III: I Want My Music Programs

Yet another annoyance in the upgrade to Hardly-a-Heron: the distribution no longer includes XMMS, one of the better light-weight music players. It includes something called XMMS2, but after a few minutes of playing with it I couldn't figure out how to get it to play one song, you, know, like:

xmms2 House_of_the_Rising_Sun.mp3

something that's simple in xmms. Fortunately, there are not one, but at least two sites that take you through the process of installing the original xmms from source, including all the development packages you need to install.

And Heron still doesn't have an MP3-enabled SoX. Fortunately, once you've installed all the development packages mentioned above, the installation of sox is pretty straightforward.

I have to admit, I'm getting Grumpy, I'm getting Grumpy, all the time.

Saturday, June 07, 2008

The Annoyances of Upgrades II: Things You Put in the Cup Holder

More stuff that annoys me about the Gnome Upgrade: when I put a CD or DVD into the cupholder, I most likely don't want to listen to music or watch a movie just then. Yet under Ubuntu Hardy Heron and Gnome 2.22.2 (when you don't know who to blame, blame everybody) a music player automatically pops up.

Of course, this is Linux, so there's gotta be a way to fix this, and there is. It took a while to find, but it's in the Nautilus File Manager. Once you know that, click on Edit => Preferences or run nautilus-file-management-properties from the command line, and click the Media tab. Then edit the various options as desired. Regrettably you don't seem to have a lot of choices. You have Gnome's default program, and “Ask what to do” option, “Open a Folder” and “do nothing.” No option to change e.g. the Camera program from F-Spot to gThumb, though you can do that using gnome-volume-properties.

Gee, you'd think an advanced desktop environment would put all of these things in one nicely labeled place, wouldn't you? Apparently only if the environment is sufficiently advanced.

Grump, Grump

Saturday, May 31, 2008

The Annoyances of Upgrades: Gnome Default Camera Program

Last week I finally updated to Ubuntu 8.04 (Hardy Heron). Today I tried to download pictures off my camera. I'd previously set the default camera program to gThumb, but, in either Ubuntu or Gnome's infinite wisdom, the default camera handling program had been reset to F-Spot.

Now I'm sure that F-Spot is a nice program, full featured, and wonderful to use. However, it's not something I want to deal with on a Saturday morning when I'm getting ready to take Prom Pictures.

This is what I get for using software-for-the-masses, I know. (Somewhere, Penguin Pete is laughing at me.)

This leaves me with two options: I can learn how to make F-Spot do what I want it to do, or I can change the preferences for Gnome so that it knows to use gThumb when a camera's connected.

If you picked (1), you don't know me very well. I prefer to sticking-with-what-I-know until what-I-know becomes so unwieldy that I throw up by arms in disgust. Unfortunately, that happened a year or so ago when I decided that FVWM was just too ugly, and it was easier to start using Gnome than to really work at prettying up FVWM. There are lots of things about Gnome that I don't really know yet. In particular, how to change the default camera application. Yes, I'd done it once, but I'd forgotten to write it down.

That's what this blog is for: to write things down that I'd otherwise forget (except I forget to write it down). So after a brief web search, I found the answer: the way to set the camera options is not, as you might think, in Preferred Applications (gnome-default-applications-properties from the command line), but Removable Drives and Media Preferences (gnome-volume-properties). From there changing the default is easy.

Not that an upgrade should change my default.

Grump

Sunday, May 18, 2008

Extracting $$!#**^% .mht files from email

Everyone once in a while someone sends me an attachment in Microsoft's MHT format, which is apparently how Internet explorer archives web pages and the associated images. I've read that Thunderbird will read these files, but that's apparently not true under Linux, at least I've been unable to open the file.

On one hand you can save the file to disk, use a utility such as munpack to pull out the files (it's just a MIME attachment), find the HTML file, and edit the heck out of it so it displays nicely on your display.

On the other hand, you can email your correspondent and say “Your tanj file won't open. Send it to me in an open format, frak it!” This is counterproductive if you and your correspondent are, say, on a Pastoral Nominating Committee (though if you want to get off of the committee this may be the way to go).

On the gripping hand we can look for a utility that will do all the work for us. These turn out to be surprisingly few and far between. The only one I've been able to find is kmhtConvert, a (duh) KDE app that can either extract the files from the archive into a new directory, convert the archive to KDE's WAR format (whatever happened to .tar.gz?), or display the file directly. I haven't tried the latter two, but it does extract the files from the archive, and you can read the HTML using a standard browser.

There really ought to be a command-line utility for this, or at least a Thunderbird plug-in for Linux, but I haven't found it yet. Anyone?

Thursday, April 24, 2008

And You Thought Steam Punk Was Dead

150-Year-Old Computer Brought to Life (Scientific American).

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.

Thursday, January 31, 2008

doc2pdf

We all know that there are lots and lots of reasons to use the command line. But sometimes, believe it or not, there's a GUI program that does something that's not available as a command line utility.

Yet you want a command line utility, because you've got to do this thing 20-30 times, and sitting there clicking with the mouse is just boring.

So what'dya do? You hack the GUI program to do what you want it to do from the command line.

Let's back up a bit: Baen Books, the SF publishing house, has a long history of giving away its books. There's the online Baen Free Library, and every once in a while they'll put a CD full of old titles in the back of a book. You can copy this, give it to friends, use the copies for Frisbees at a warez convention, whatever, just so long as you don't sell them. The disks have several recent books, and, though I'll never claim that Baen's writers are in the class of Lois McMaster Bujold (well, she does have one book in the library) or Terry Pratchett, there's a satisfying bunch of science fiction and fantasy mind-candy that can be downloaded onto a computer and read on the plane or in one of those cheap hotel rooms that physicists crash in when we're at a meeting.

Baen puts the books out in all sorts of formats: HTML, DOC, RTF, Palm, Kindle, etc.

Everything except PDF.

Why, I don't know. PDF is compact, can be read on every computer of every kind, leaves the text exactly the way you want it. It just makes sense to distribute electronic books that include images in PDF format.* Yet Baen doesn't.

So last week I got hold of the disk in the back of Eric Flint and David Weber's% 1634-The Baltic War (the online version is only the first few chapters, alas). The disk has maybe 30 novels, some of which I actually want to read, some of which I'll read in a pinch, and all of them in the aforementioned everything-except-pdf formats.

The question before the house is how to convert all this mind-numbing SF into PDF files. The obvious way is to take the Word (.doc) or RTF version of the file, load it into OpenOffice.org, and hit the Export PDF button. A GUI solution, no doubt.

Given that it takes a few minutes to convert each novel, that's a really boring task. So let's look around for a command line solution. A look at the web shows that there aren't too many — make that there aren't any, in the sense that there is no open source, standalone, Linux command line program which takes a Word file and converts it into PDF.

There is, however, a way to do it. OpenOffice.org has a powerful Macro/scripting program included, and ways to call the scripts from the command line. All you need is the script.

Hey, don't look at me. I borrow, mostly, and point you to where I've done the borrowing. In this case, it's Convert MS/Word to PDF, posted by Graham Williams. He gives complete instructions for setting up the Macros and writing a short shell program to call them.

The only caveat is to heed Williams when he tells you that doc2pdf calls OpenOffice.org and then quits: it takes 5-10 minutes to convert one of Baen's novels to PDF, so if you want to do a batch job you need to put a long sleep time between calls of the shell command. Best to start the thing off at night and check it in the morning — just what you want a batch job to do, anyway.

So add one more command line tool into your kit, and good reading.

* It makes sense to distribute text without pictures as an ASCII file, but Baen doesn't do that, either. Well, I wasn't expecting the Moon, you know.

% I'm not a big fan of Weber's style of writing. Here's why. For some reason I keep going back to check the books out of the library, though. If I found myself paying for them I'd be really upset with me.

The RTF and DOC files are bitwise identical. This says something about someone. I'm not sure what, or who, though.

Capturing Sound – or – a Case of Daemonic Possession

The long-time reader will remember that occasionally I record onto the computer. Usually using Audacity, but for many purposes gnome-sound-recorder does well enough.

Except when it doesn't. So I've been sitting here for the last two hours trying to figure out why, when I plug the tape deck into the line-in jack, start the tape, and press record, I don't get anything to record, even though I can hear the sound coming out of the computer's speakers, and even though things have worked in the past.

So after much searching, playing with JACK, tearing out my hair, yelling at the cats, etc., I finally found an appropriate post in Ubuntu forums. Note particularly the phrase “I had the Capture volume down.” Turns out I haven't done any sound recording since I upgraded to 7.10. Does Ubuntu automagically reset defaults when you upgrade? Anyway, following this post, I opened up the gnome-volume-control, clicked on Edit=>Preferences, clicked on line-in capture, and hit record.

Nothing.

OK, go back to the preferences menu. Look down. See an unchecked box labeled Capture. Click that.

Nada.

Sigh. But now the main gnome-volume-control panel has a tab on it that says “Recording.” Click on that. Up pops a panel that says “Capture,” with the Microphone symbol muted. Click that. Bring the capture volume up to full. Record.

It works.

HOW DID THIS HAPPEN? I had it all working before, you know, which meant that all those appropriate boxes were checked and buttons were pushed. AGGGH! Are there little elves running around my computer arbitrarily turning things on and off?

Well, anyway, I got it working, and this here post will remind me of it the next time it happens.

Tuesday, January 29, 2008

Economic Theory

So the House, at least, has agreed with the President to give each and every one of us a big gob of money.

When I heard this, for some reason I was compelled to look up the following (thanks, Google Books) and type it in:

“Since we decided a few weeks ago to adopt the leaf as legal tender, we have, of course, all become immensely rich.”

Ford stared in disbelief at the crowd who were murmuring appreciatively at this and greedily fingering the wads of leaves with which their track suits were stuffed.

“But we have also,” continued the Management Consultant, “run into a small inflation problem on account of the high level of leaf availability, which means that, I gather, the current going rate has something like three deciduous forests buying one ship's peanut.”

Murmurs of alarm came from the crowd. The Management Consultant waved them down.

“So in order to obviate this problem,” he continued, “and effectively revaluate the leaf, we are about to embark on a massive defoliation campaign, and ... er, burn down the forests. I think you'll all agree that's a sensible move under the circumstances.”

— Douglas Adams, The Restaurant at the end of the Universe

Sunday, January 27, 2008

The Changing Tag Line

By now all three of you have probably realized that I like things to change every once in a while: random wallpaper in GNOME or FVWM, random quotations in the Blog, etc. Heck, if I can figure out how to do it, eventually this blog will have a rotating template as well.

The latest bout with randomness is the tagline at the top of the blog. It was inspired by this hack from St├ęphane Hamel. I couldn't get that version to run here, possibly because Blogger has changed a bit since the beta version, but I was able to lift Blog U's random quote generator to get the same effect.

So here's the final version of the hack:

  • Log onto the Blogger Dashboard
  • Select Layout => Template => Edit HTML
  • Download the full template: Because you will frak it up.
  • Click the box that says “Expand Widget Templates”
  • Look for the second invocation of the string <data:description> — at least that's what I had to do.
  • Replace the line
    <p class='description'><span><data:description/></span></p>
    by the following
    <p class='description'>
    <script language='JavaScript'>
    //store the quotations in arrays
    quotes = new Array(5);
    quotes[0] = &quot;First Quote&quot;;
    quotes[1] = &quot;Second Quote&quot;;
    quotes[2] = &quot;And So On&quot;;
    quotes[3] = &quot;Changing the number in Array to match the number of quotes&quot;;
    quotes[4] = &quot;and noticing that the array starts with [0]&quot;;
    //calculate a random index
    index = Math.floor(Math.random() * quotes.length);
    //display the quotation
    document.write(&quot;\n&quot;);
    document.write(quotes[index]);
    //done
    </script>
    <noscript><data:description/></noscript>
    </p>
  • Save everything

Note that I've never been able to get this script to accept more that 10 quotations. If someone can tell me why, or how to get around that, I'd be grateful.