Tuesday, January 8, 2008

How not to check the argument count passed to a Perl script

Pulled this little gem from a piece of sample code a job candidate sent today:


#!/usr/bin/perl

my $numArg = scalar (@ARGV);
&usage() unless ($numArg =~ /^[1,2]$/);

Thought my fellow Perl programmers might appreciate this...

Sunday, January 6, 2008

HVR-950 audio now working under V4L

Looks like, as a result of Mauro's 6952 commit, audio on the HVR-950 appears to be working (assuming I run the following command while running tvtime):

sox -r 48000 -w -c 2 -t ossdsp /dev/dsp1 -t ossdsp /dev/dsp

It might be worth noting for anybody running Ubuntu 7.10 with the latest kernel updates that the em28xx-alsa driver does not load properly showing errors in dmesg output such as:

em28xx_audio: disagrees about version of symbol snd_pcm_new
em28xx_audio: Unknown symbol snd_pcm_new
em28xx_audio: disagrees about version of symbol snd_pcm_lib_ioctl
em28xx_audio: Unknown symbol snd_pcm_lib_ioctl
em28xx_audio: disagrees about version of symbol snd_pcm_set_ops
em28xx_audio: Unknown symbol snd_pcm_set_ops
....

This appears to be a problem with the way Ubuntu built the snd-pcm.ko in the latest linux-backports-modules-2.6.22-14.10 update. If you remove that package (which causes the kernel to use the snd-pcm.ko that ships with the 2.6.22 kernel instead of the one in /lib/modules/2.6.22-14-generic/updates, then the em28xx-alsa module will successfully load.

Making America safe from.... shoulder fired missiles?

They're going to starting testing an anti-missile system on U.S. passenger jets:

http://www.cnn.com/2008/TRAVEL/01/04/missile.tests/index.html

Aviation Week says it's going to cost about $11,000,000,000 to protect all US aircraft (yes, that's 11 billion but it's more obvious how staggering an amount of money that is when you type out the zeros). The cost would go to 40 billion over the next 20 years.

http://www.aviationweek.com/aw/generic/story_generic.jsp?channel=awst&id=news/aw091806p3.xml

Because, you know, there are so many U.S. domestic passenger planes being shot down by shoulder fired missiles.

47,000,000 Americans without health insurance in 2006.

10 Reasons To Hate Cellphone Carriers

Wired Magazine had a pretty good article summarizing why cellphone carriers suck.

http://blog.wired.com/gadgets/2007/10/10-reasons-to-h.html

No real surprises here, but it's nice to see it all in one concise list.

Saturday, January 5, 2008

Can You Count On These Machines?

At Friday lunch, we were talking about the issues with electronic voting. As it turns out, the New York Times just published an article (to appear in tomorrow's Times Magazine) that discusses the problems pretty well:

http://www.nytimes.com/2008/01/06/magazine/06Vote-t.html?_r=1&oref=slogin

It gives a pretty good overview of the problems, for those of you not in computers who may not be familiar with how screwed up the situation is.

Friday, January 4, 2008

Plugging along...

Finished Speaker for the Dead at about 2am this morning. Will probably starting reading Xenocide on the bus to Philly tonight.

Going to Philly for the weekend. Not much of a plan beyond that yet.

Finally getting around to some long-needed cleanup of some code at work that I've wanted to do for a while. Go refactoring!

Hoping to take a look at the open source lib_x264 this weekend, to see how extensible it is to hook into the Quicktime API for the encoding phase (to leverage the Turbo.264's hardware acceleration).

Tuesday, January 1, 2008

New Years Day

Had a quiet evening at home last night with Vikki to celebrate New Years. Went to Josie's for a nice dinner. Played some scrabble. Watched the Simpsons movie on DVD.

I finally broke down and bought an iPod Nano. I spent all day playing with HandBrake and toying with various H.264 encodings. I had wanted to play with the video features for a while, and see how I might be able to better integrate it with MythTV. All I can say is that transcoding is REALLY slow. I takes about 50% realtime to transcode DVD quality 720x480 video down to 320x240 H.264. In other words, it takes about an hour to copy a 2 hour movie from a DVD to my iPod.

May take a closer look at the Elgato Turbo.264, which is a USB device with an ASIC specifically designed to accelerate the encoding process. Looks pretty neat, but has no hooks into HandBrake or any other open source library I could find.

Learned about some of the deficiencies of the DAAP protocol. I would really like to have a central repository for all my iTunes content. Looks like DAAP is a read-only protocol though and you can't sync the shared content to your iPod using iTunes (or manage playlists, or add new content, or any other "write" operation). Kind of annoying. I guess I can use nfs/rsync, but I was hoping for a cleaner solution...