Archive for January, 2009
Snow-bama
0Today was dominated by two events.
Locally, we woke up to find the ground covered with three inches of snow. Our girls have not experienced too many snow days… the few times it has snowed in recent years, we only got a light dusting. This time, we had enough to enjoy a snowball fight and some disc sledding in our back yard.
On a national scale, we enjoyed watching President Obama’s inauguration (and equally as important, the orderly end of the Bush regime). Our new president had some powerful words to mark the event. For me, the most memorable line of his speech was: “As for our common defense, we reject as false the choice between our safety and our ideals.” I welcome our new president, and I look forward to participating in a new America.
Nerds of a feather
0My first exposure to computers was in 1981, when my neighbor “Howdy” (Howard) Petree showed me his family’s TRS-80 Color Computer. His dad gave me some sage advice: “do whatever you want to… you’re not going to break it”. I wrote a simple game called “Al-Zap”, which led the player through a series of scenarios, each followed by three choices: “(1) Eat it, (2) Shoot it, (3) Run away”. I kept the program on three hand-written pages on a note pad, and I manually re-entered it when I wanted to work on it some more.
My interest in computers continued, but I could not go bug Howdy every time I had the urge to tinker. That’s when my friend Greg Reid told me that the public library in downtown Winston-Salem had a lab with four Apple II computers. So my early years of computing were primarily spent hacking on the Apple II’s. Eventually, my dad bought one for our family.
The rest, as they say, is history.
This week, Jeff Mercer from the Triangle Linux User Group offered a working Apple II computer to whoever would come and take it off of his hands. I took Jeff’s offer, and I hooked the old computer up so I could show the girls what “old school” computing was like.
Audrey and I did a little bit of tinkering with Applesoft BASIC, and then I gave her an assignment: to print out a multiplication table. She worked on her FOR/NEXT loops, and soon she had a very nice looking 10×10 table of numbers.
I am very proud of her accomplishment, and even more proud that she took such an interest in her daddy’s past.
Let the music play!
0My friend Tim told me about a music service called “Pandora“, which is an internet radio station that runs in a flash applet in a web browser. You can suggest songs or artists, and vote songs up or down. It uses the the Music Genome Project to categorize music, and to add similar music to your playlists. It’s a pretty cool project.
However, I encountered problems when I ran it on my Asus Eee PC 900. Pandora seems to run fine by itself, but it pauses and skips if you are browsing in another window. I think it has to do with a combination of Firefox’s “AwesomeBar” and the Eee PC’s flash disk.
The Awesomebar is Firefox3’s new address bar that searches for matches among your bookmarks and the titles and URL’s from every web site you have visited recently. Since the Eee PC uses a solid state flash disk, disk writes are pretty slow. So when you are browsing, every time open a new page, Firefox 3 writes some stuff to its sqlite database of user history. It then calls fflush(), which flushes all writes (not just its own) to the disk. During this time, all browser activity halts until the writes are complete. Other applications keep running fine, but the browser rendering stops — often “graying out”, turning back-and-white until it starts responding again. The problem is, flash applets also pause, and that includes Pandora.
I considered a few solutions:
- Run the Pandora applet in a different browser, and use Firefox for browsing.
- Run the Pandora applet in a stand-alone flash player.
- Run the Pandora applet on my server, while I browse on the Eee PC.
- Run a different application for audio, like “audacious” (an xmms clone).
Combining a couple of these ideas, I wondered if I could run some sort of console-based streaming audio application on my server. It would be cool to hook up some speakers to bender and listen to internet radio.
It turns out that mplayer will do just that. For example:
mplayer http://wunc.org/about/listen.pls
And now we’re listening to our local NPR station!
Note – you’ll also want to install a utility to set the volume. I use alsamixer.
Of course, this does not solve the original problem of Pandora pausing. And there seems to be quite a frenzy on the Firefox bug tracker about flushing the history database.
But streaming audio from a headless server is a pretty neat idea, and one that may become a permanent fixture in my home office.