Monthly Archives: September 2004

UNIX® on the Game Boy Advance

Unix on the Gameboy Advance!UNIX® on the Game Boy Advance is an implementation of the 5th version of the Unix Operating System for the ARM chip inside the gameboy. To do this, it runs SIMH, a PDP-11 simulator which has been ported to a bunch of different systems. The original RK05 disk image is combined with the PDP-11 simulator to make a functioning 5th Edition workstation.

It’s… just… brilliant.

On the right, you can see a screendump. Notice that it is compiling a simple Hello World C program.

If you are into this stuff, you can get lots of different PDP-11 software off the net with a minimum of searching.

Relativity : the Special and General Theory by Albert Einstein

RelativityToday’s Gutenberg Gem is Albert Einstein’s Relativity : the Special and General Theory. The author himself describes it thusly in the Preface:

The present book is intended, as far as possible, to give an exact insight into the theory of Relativity to those readers who, from a general scientific and philosophical point of view, are interested in the theory, but who are not conversant with the mathematical apparatus of theoretical physics. The work presumes a standard of education corresponding to that of a university matriculation examination, and, despite the shortness of the book, a fair amount of patience and force of will on the part of the reader. The author has spared himself no pains in his endeavour to present the main ideas in the simplest and most intelligible form, and on the whole, in the sequence and connection in which they actually originated. In the interest of clearness, it appeared to me inevitable that I should repeat myself frequently, without paying the slightest attention to the elegance of the presentation. I adhered scrupulously to the precept of that brilliant theoretical physicist L. Boltzmann, according to whom matters of elegance ought to be left to the tailor and to the cobbler. I make no pretence of having withheld from the reader difficulties which are inherent to the subject. On the other hand, I have purposely treated the empirical physical foundations of the theory in a “step-motherly” fashion, so that readers unfamiliar with physics may not feel like the wanderer who was unable to see the forest for the trees. May the book bring some one a few happy hours of suggestive thought!

A. EINSTEIN

And indeed, I find his plain writing style to be remarkably easy to read. If you are interested in relativity, I also have a couple of dead tree books on my shelf. The most easily accessible book I have is Martin Gardner’s Relativity Simply Explained. What can I say: Gardner was one of my greatest influences as a young lad, and his Mathematical Games column did a great deal to fuel my interest in mathematics, an interest which continues to this day. The book I read as a grade school student as Bertrand Russell’s ABC’s of Relativity, which I remember being quite accessible, even while I was in my early teens. Both are good, and are highly recommended.

My Memories of the Game…

The drubbing of the Oakland A’s at the hands of the Boston Red Sox did two positive things: it reminded me that a great duel between Pedro Martinez and Tim Hudson is yet to come, and it reminded me of another terrific game which happened Labor Day weekend two years ago.

Retrosheet Boxscore: Oakland Athletics 12, Kansas City Royals 11 The A’s were trying for their record 20th victory in a row, and they started out strong, scoring six, one and four runs in the first three innings to jump out to an 11-0 lead. But the A’s would then go scoreless for five more innings, and the Royals came back to score five in the 4th and in the eighth to trail by only a single run. Going into the ninth, the Royals would tie the game, and it looked like extra innings. But with nobody on and one out, they pinch hit Scott Hatteberg for Eric Byrnes, and Hatteberg hits a walk off home run to win the game.

Now that’s baseball.

Another Zoo Pic

MeerkatHere is another picture from my weekend zoo excursion. Surprisingly, these little guys have proven to be very hard to photograph, largely because they blend into the background so my autofocus fails with disturbing regularity. This is probably the best of the batch that I took this weekend, but the focus is a teeny bit soft. Someday I’m going to have to trade in my Nikon 4300 for something different.

What I Cooked For Dinner…

I can’t really believe that I’ve been blogging for over two years, and I haven’t gotten around to posting about one of my passions in life: cooking (well, eating is the passion, cooking is the skill). The inspiration for tonight’s dinner was Ming Tsai’s Ginger Fuji-Apple Chutney. I first heard about the recipe while watching my usual dose of food porn on the Food Network, and it seemed just too intriguing to pass up.

I pretty much took the idea he presented and just improvised my own version. I also made about half the amount he did. I began by sweating a diced white onion in a tiny bit of canola oil, and then added two large Fuji apples, diced and a couple of tablespoons of fresh peeled and grated ginger. A pinch of kosher salt and a couple of grinds of black pepper, and I let them warm together, then added 1 cup of cider vinegar (his recipe called for rice wine vinegar, but I didn’t have enough, so I used cider vinegar) and a cup of apple juice, and let that bubble down for 45 minutes, until all the flavors are melded. Taste it, it’s good stuff, with a great bright flavor.

Ming has great sounding potsticker recipe that mixes this chutney with ground pork and soy to make the filling for some of my favorite dumplings, but tonight I decided to use them as a topping for some thick pork chops that I had on hand. I brined them for 4 hours in a mixture of 4 cups water, 1/2 cup kosher salt and 1/2 cup sugar, and them dusted them with flour and browned them 5 minutes on a side over medium high heat. My chops were pretty thick, so they were still a bit underdone, so I put them in a 350 degree oven for 10 more minutes to finish. In the mean time I took 1 cup of water to deglaze the pan, and then mixed in 1 cup of the chutney. Ming used white wine to deglaze, but I normally don’t keep it on hand (I’m no longer much of a drinker). Ming served his with mashed sweet potatoes with maple syrup, which would have been good, but I served them with fresh corn on the cob and a side salad. Drop your yummy chop on the plate and cover it with the chutney mix. It was very good. I’m writing this recipe down into my list of culinary successes.

It’s not a mystery why it is good: apples and pork are two tastes that go terrific together, and with the hint of ginger and onion, the mix is just really delicious. Eating delicious food is a good cure to having to count your calories.

Zoo Excursion

Female Lion at the Oakland ZooSpent the other day at the Oakland Zoo. I finally got some decent pictures of one of the female lions using my Nikon 4300 and zooming in. The photo on the right is cropped from the resulting 3.8 megapixel picture, and has its saturation boosted to make the image a bit more colorful.

Why I’m Not Proud To Be a Democrat…

I’m sitting in my living room on a Sunday morning, and the urge to yap about something political has just become too strong to ignore. This week has given me another political realization: the realization that I’m really not proud to be a Democrat.

Don’t get me wrong: I’m not going to go all Zell Miller on you. The prospect of turning my families future over to the Bush administration frankly sends cold chills down my spine. The prospect of seeing Bush, Cheney and Ashcroft rape the national character and coffers for another four years sends me to the Internet to scan housing prices in Alberta. But again, I’m not proud to be a Democrat.

I don’t believe that the Democrats are the tax-and-spend boogeymen, or that they are pursuing an evil and immoral social agenda to promote homosexuality in the schools. It’s not that they fund the Maplethorpe while taxing poor small businessmen. It’s not that they will hand the keys for the country over to terrorism.

Quite frankly, it’s just their bold incompetence in handing the keys of the country over to Bush.

Honestly, have they given America any reason to vote for Kerry? Certainly Bush has. The economy is pitifully weak. It’s entirely possible that during the administration of both Presidents Bush, not a single net job will have been created for Americans. We’ve alienated many of our key allies, and tried to fight a war in Iraq on the cheap by cutting benefits to military personnel to fatten the wallets of energy producers and defense contractors, nominally to save us from the threat of WMDs which do not exist.

And in the light of all of these revelations: Kerry now trails Bush in most polls.

The DNC have got themselves all knotted up in responding to the Swift Boat Veterens for Truth, perhaps one of the most ironically named groups of all times. The DNC tried to shame Bush into admitting that they were authorized by key Bush campaigners and to denounce their statements, but they forgot: you can’t shame someone without shame. Bush stayed the course, pretending that he wasn’t involved, but not renouncing their tactics either, and the net result: a win for the Republicans, despite the absolute transparency of the the lies.

But more than that, let’s review the wisdom of running someone who has tried to portray himself as a war hero and as a war protestor at the same time with both messages. Particularly a candidate that the opposition will like to portray as someone who “flip flips”. Does that sound like a good idea to you?

Frankly, the Democrats are not just incompetent: they are out of ideas. They simply don’t know how to win. It isn’t the media bias, or the fact that the country’s political ideas have shifted to the right: it’s that they simply don’t have any message. The Republicans do: they want you to be scared. They want you to fear terrorism, to fear socialized medicine, to fear change. Don’t change captains in the middle of the voyage. Don’t rock the boat. Take off your shoes so that we can check you for bombs. Don’t worry about those people in Abu Ghraib or at Guantanamo. If they weren’t bad, they wouldn’t be there.

In the face of this crap, the DNC is out of ideas. It is simply tragic.

DVD Experiments, with a recipe…

Well, I’ve burned a few DVD blanks today just to see what I can do. For source material, I decided to go to the feature film section of archive.org. They have a bunch of films available in MPEG2 format, all fairly good quality and ready for download with minimal transcoding. For my experiments, I chose Max Fleischer’s Gulliver’s Travels, first released in 1939. I didn’t have a copy in my collection, and I thought it would make a good addition.

The first thing I found was that these films aren’t quite ready for inclusion on DVD: they lack space to insert a VOBU, whatever the heck that is. But a few minutes with some commonly available utilities will change that. I ran:

mpgdemux -b gulliver gullivers_travels.mpeg
mplex -f 8 -o gulliver.mpg gulliver-0.m2v gulliver-0.mp2

These commands split the original mpeg2 into sound and video, and then remultiplex them for DVDs. Then all I had to do was use dvdauthor to build a directory that contained the final DVD image and built a table of contents.

dvdauthor -o gulliver_dvd -a en gulliver.mpg
dvdauthor -o gulliver_dvd -T

This creates a new directory called gulliver_dvd, and copies in the resulting mpeg as a VOB file. I then use growisofs to burn the directory onto a DVD blank:

growisofs -Z /dev/cd0c -dvd-video gulliver_dvd

And voila! It works. Well, almost. I’ve had difficulty using DVD-R media in my HP laptop, but DVD+RW media seems to work just fine, and is eraseable to boot. You need to format DVD+RW media first, using the command:

dvd+rw-format /dev/cd0c

Then you can use it with the growisofs command above. I haven’t tried DVD+R media yet, but I suspect it will work just fine in my laptop. Both kinds of media work in the Sylvania TV+DVD player I have upstairs, but neither appears to work properly in my ancient Apex 500 DVD player I have downstairs. I’m not sure what the deal is, it just might be too old to be really compatible.

New Gadget — A DVD Burner

DVDWell, I finally caved in. DVD burners and blanks are now cheap enough that burning CD-Rs seemed like a waste of time, so I went ahead and picked up an inexpensive Toshiba model while at Fry’s yesterday. A quick bit of surgery and it was neatly installed in my server box, and I then set out to back up my entire website onto a DVD. Strangely enough, I’ve now got about 2.2gb of data stuffed away in my /usr/local/www directory, so saving it on CDs was becoming painful and required some thought. Most of the storage is actually in the form of a couple of thousand digital pictures that I’ve taken in the past year or so: now that I have them backed up, I can work on beginning to clean them and retaining only the ones that I think are useful.

I got this thing mostly as a backup device, but will probably also work on using it to develop a couple of short video DVDs. I’ve used tools like mjpegtools and vcdimager to generate VCD images before, apparently now the application of choice is dvdauthor, which can be used to stitch together dvd images and growisofs: a front end to mkisofs which is smart enough to also burn DVDs. I’ll have to give it a try, as soon as I can think of something fun to do with it.

Scientific American Supplement, May 23, 1891

Paris ObservatoryToday’s Gutenberg Gem is The Project Gutenberg eBook of Scientific American Supplement, May 23, 1891. It includes some nice illustrations of an unusual equatorial telescope, various dogs, moths, and some mathematical illustrations on the conic sections. I’m always on the lookout for illustrations of telescopes, so I thought it was pretty cool. The telescope was a 24″ refractor constructed by Jean Paul Gautier for the Paris Observatory. It was placed in an equatorial elbow arrangement which resulted in a stationary eyepiece. Good stuff, at least if you are a telescope geek like myself.

Musings re: iPod and Audioblogging

iPod ProgrammingWell, my week long vacation is slowly slipping away, and it appears that I’ll do relatively little programming during the 11 consecutive days that I have off. Still, I’ve worked my way through a couple of niggly tasks that have been nagging me for a long time, so my time isn’t entirely wasted.

Today I spent about half an hour investigating the possibility of trying to write my own version of Adam Curry’s iBlogger script. The idea is to check RSS feeds for enclosures (which are a particular chunk of XML used to indicate large media payloads), download them automatically, and then automatically add them to your iTunes playlist so that the next time you sync your trusty white companion, you get all the downloaded mp3 files available for your next convenient listening opportunity. That doesn’t sound too hard, and in fact, the first two bits are remarkably easy. In just a couple of minutes, I wrote an eight line Python script that used Mark Pilgrim’s feedparser library to open Adam’s feed, find all the enclosures, then use wget to grab the named mp3 file. It wouldn’t be hard to not use wget: I just like it’s automatic bandwidth limiting capability, which keeps downloads from swamping my wimpy cable modem.

As I said, a piece of cake.

Well, except for getting it to talk to iTunes. If I was on a Macintosh, it would be relatively simple to use Applescript to do it, but I use Windows XP on my laptop and FreeBSD and Linux on my two desktop machines. I normally synch my iPod using iTunes on my laptop, but frankly, I wasn’t averse to trying other ideas, so I downloaded gnupod, a set of perl scripts that can talk to my iPod and installed them on fishtank, my trusty FreeBSD box. I then plugged in my iPod and….

Promptly got screen fulls of fwohci: phy intr messages from FreeBSD. Frown.

Then, I remembered that I had never actually tried hooking a firewire device to this box, and I had some difficulty installing the confusing header blocks to the front mounted panel I added to my box. Instead of supplying a nice solid 2×6 block header, they had 11 separate little pins that each had to be wired to the right location. Bleh. I didn’t feel like sorting this out, so I found the normal rear panel header, shut down my computer, disconnected the front panel, hooked up the rear panels and thirty seconds later rebooted.

Voila! The machine responded with the expected:

da0 at sbp0 bus 0 target 0 lun 0
da0:  Removable Simplified Direct Access SCSI-2 device
da0: 50.000MB/s transfers, Tagged Queueing Enabled
da0: 19073MB (39063024 512 byte sectors: 255H 63S/T 2431C)

A simple addition to /etc/fstab, and I mounted the disk and could begin to search around. I could even use mplayer to play some of the audio files that I found nestled in the subdirectories.

Okay, so next I installed gnupod and followed their instructions. But this too failed. When I attempted to run gnupod_INIT.pl, it complained about a compilation error. Harumph. Then I remembered that the version of perl installed in /usr/bin by FreeBSD is actually an early version of perl5. The version installed by the ports is more recent. Could this be the problem? A bit of scurrying around, and I managed to get the port installed and set it as the default.

And voila! It worked. I could use the gnupod_addsong.pl to add .mp3 files, and then run mktunes.pl to update the database, unmounted the disk, used camcontrol eject da0 and I had a bunch of new mp3 files on my iPod.

This isn’t probably the ideal solution for anyone, even me, but it is a solution that I can understand. I’ve also downloaded Apple’s SDK information about using COM objects to program iTunes, but I must admit that I’ve never done anything like that before, so it’s probably more work than I would like at the moment. An afternoon’s work with Python and gnupod will probably get me to a fairly painless solution. I should have some time tomorrow to goof around. Stay tuned.