Back to gnome
Well, 8 hours using wmii was enough for me. Too many apps didn’t quite work right. So I’m back to plain-old-boring-but-familiar Gnome.
Well, 8 hours using wmii was enough for me. Too many apps didn’t quite work right. So I’m back to plain-old-boring-but-familiar Gnome.
In no particular order, here’s what I’ve been studying lately:
After a month of using the Dual XHD7714, during which my family and I took a 4000 mile road trip, I have to say it’s a pretty nice system. We used it almost exclusively as an MP3 player, rather than an HD Radio or a CD player. I loaded 800 songs from our home music collection onto an 8GB memory stick. It was great introducing my kids to some new music. By the end of the trip their favorite songs were Shock the Monkey and The Magical Mr. Mistoffelees.
Some problems specific to the Dual XHD7714:
Bluetooth issues:
USB MP3 player issues:
Still, even with all these flaws, I’m quite happy with the radio. We really enjoyed being able to conveniently listen to so many different songs during our trip.
I’ve just had a chance to use a Nehalem HP Z600 workstation with 2 Xeon E5520 CPUs. The machine has 8 cores, 16 hardware threads, and an absurd 12 GB of RAM.
It’s very fast. It’s about 2.5 times as fast (when building the Android sources) as the previously fastest machine I’d used, which was an HP xw6600 with a single Xeon E5420 CPU.
The machine’s relatively small, no larger than an ordinary ATX tower. One way that HP kept the case small is by making the motherboard an odd shape: it is “C” shaped, with a cutout that leaves room for the DVD drive.
The other day my wife said to me, “Jack, we’re going on a road trip soon. Is there any way we could hook up our MP3 player to the car stereo, so that the kids could listen to their favorite songs during the trip?”
Twenty hours of web research and $250 later we’ve got a new car stereo. It’s a Dual XHD7714 from Crutchfield. I’m getting it installed by Best Buy tomorrow. Let’s hope their AV installers do a good job!
First, why did I get a new stereo at all? Well, all I wanted to do was hook up an MP3 player. But there was no easy way to do that. My 2005 minivan came with a factory installed stereo that didn’t have an auxiliary input. There are cheap FM transmitter systems that work with any radio, but they look clunky and the sound quality is supposed to be poor. A lot of web searching turned up some aftermarket accessories that allow hooking up either an audio input jack ($75
Why this particular model? It was well reviewed and relatively inexpensive. The features I was interested in were:
General thoughts on the car stereo market
I frequently switch between Mac and Linux, and it’s been troublesome to remember to type Command-whatever on the Mac, but Control-whatever on Linux. (For copy-and paste, for example.)
I did a quick web search and found out that it’s easy to make Ubuntu Linux recognize the Command keys as an extra set of control keys:
Choose menu: System : Preferences : Keyboard
Select the Layouts tab
Choose "Layout Options"
Open the "Alt / Win Key Behaviour" tab
Check the "Control is mapped to the Win-keys" checkbox.
I just threw in the towel on the ICFP 2009 Programming Contest.
The problem this year was a set of 4 sub- problems related to orbital mechanics, plus a virtual machine spec. The virtual machine was used to enable the problems to be specified exactly, without worrying about differences in the order of math operations.
Implementing the virtual machine was easy and fun. Unfortunately, actually solving the final sub-problem required learning too much math and physics. I was able to solve problems 1 and 2, and make an entry for the lightning round. And I brute-forced a solution for problem 3. But now, 56 hours into the contest, I am giving up on problem 4.
I can see the general outline of how to solve it, but it would take sharper tools than I have now. For example, I’d like a way of solving Lambert’s equations, but I’m having trouble deriving the code on my own, and the best example I’ve found while searching the web is a 30-year-old NASA Space Shuttle Fortran program. Also, I’m pretty tired, and this is affecting my judgment. I don’t think it’s worth going on at this point.
Some fun things I did during the contest:
Highlights of the contest:
Low-lights of the contest:
My advice to (future) contest organizers:
Advice to myself for future contests:
I used Python and C. I actually completed the lightning round in pure Python.
Benefits of Python
Drawbacks of Python
Benefits of C
I wanted to explain how my VM implementation worked, because I think it probably ran faster than most other VMs.
I wrote a Python-based VM as a reference. Then I wrote a VM generator that would read a VM spec and generate hard-coded C to implement that specific spec. I used a “comparer” VM to compare the output of the two VMs to make sure that there were no bugs in the generated C version.
The hard-coded C VM was really hard coded to each problem. All the VM instruction interpretation overhead was removed. In addition, because the VM didn’t have any indirection, the “mem” array was replaced by hundreds of individual local variables. This allowed the C compiler to do a very good job of optimizing the code, because it could easily tell there was no aliasing.
I included a simple interactive shell in each generated hard-coded C program. The console let you set inputs, run “n” simulation steps, and read the outputs. This made it easy for me to control the simulation from Python. It also made it easy to hand-test the C simulation.
One feature I meant to add, but ran out of time/energy for, was to save and restore the state of the simulation. This would have been very helpful in solving problem 4.
Problem 1: Wrote Python VM. Implemented Hohmann transfers as described in a Wikipedia article.
Problem 2: Calculated the correct time to start the Hohmann transfer analytically. (I read about how to do this in a textbook I found through Google books.) Added simple brute-force docking code to match orbits exactly. No fancy “S” curves for me. (And wasted about an hour wondering why I didn’t score, because early versions of the contest problem spec didn’t say you had to turn off your engine for 900 seconds. I finally figured this out by disassembling the VM to see why the score wasn’t being set properly.)
Problem 3: Used my fast VM to compute a table of where the satellites would be over time, then wrote a set of nested for loops that tried various Hohmann transfers at various times looking for a solution. The precomputed tables meant I could just look up where the target satellite would be for any time in the future, rather than having to do complex elliptical math.
Problem 4: Only got as far as simulating and visualizing this one (boy the orbits are pretty!) Too tired to continue. I was planning on using a variation of the brute-force approach that solved problem 3, with save-and-restore of the simulator state, because I would have to recompute the table of locations for my rocket each time its orbit changed.
Upon reflection, I think that this particular contest, especially problems 3 and 4, is best suited to a C/C++ solution. This is due to the heavy reliance on numerical methods to calculate the optimal trajectories.
I liked that there were multiple versions of each problem. It made it easier to tell if we were making progress, and also allowed whole-program-level parallelization to make use of muticore machines to solve the problems in parallel.
While I expect the ultimate contest winners will code in a mutable- state static-type-checked compiled language like C/C++, I predict Haskell will do fairly well in the contest, due to its speed and the ease with which it handles math. However, the winners will probably have a good grasp of orbital mechanics, and it seems that someone who knows the math is more likely to be using C-like-languages.
Well that’s it, now I’m looking forward to next year!
P.S. Here’s a Wiki with other team writeups:
This weekend I wrote a JavaScript version of my old Atari 800 game Dandy.
Check it out: Web Dandy
It was my first JavaScript application. It was about as easy as writing the Python version. I have only tested it in two browsers so far (Firefox 3.0 and Chrome), and only on one platform, OSX. I have already run into differences between the two browsers: Firefox 3.0 for OSX seems to double-post keydown events.
No sound or multiplayer yet. Oh, and I use the CANVAS tag, so I think older browsers (like IE 7) won’t work.
Android system-level development can be done on either Linux or OSX. For the past few years I’ve been using OSX, but recently I’ve switched over to using Linux.
Why? Mostly for the higher performance. The full Android system build takes about 30% less time under Ubuntu 8.04 LTS than it does on OSX 10.5 on the same hardware. Not to mention that it’s much cheaper to buy a generic PC workstation than the equivalent Mac Pro.
I have had some early troubles:
It took me a while to get used to typing the “Ctrl” key instead of the “Command” key, and the ugly Linux fonts bothered me for a few days.
But since I’m mostly using the exact same programs on Linux as I was on OSX (FireFox, Eclipse, Android), after a few days everything clicked, and I think that I’m just as productive as I was before. And the faster builds and file system stuff (like grep) are wonderful.
It helped a lot to install the Blubuntu theme and some nice wallpaper to get away from the awful Ubuntu brown/orange color scheme.
Oh, and I’m using Chromium for Linux, which works pretty well, except that it doesn’t support Flash. I still fire up Firefox occasionally to watch Flash videos.
A few years ago I tried Ubuntu and predicted it would become a serious challenger to Windows, in about 18 months.
Well, it’s about 18 months later, was I right?
Not exactly. Ubuntu seems to have stood still, if not actually gone backwards. In particular, the newer releases have much worse sound and video performance on my hardware (Intel CPU/GPU Mac Minis) than earlier releases.
The sound driver issue is because Linux, in its typical decentralized fashion, is trying to figure out how to provide a standard audio subsystem, and has two or three competing standards that are duking it out. Since they all suck it seems odd that people defend them so much. Just pick one already.
The video driver issue is because Intel decided to take several years to rewrite their Linux video driver stack, and Ubuntu decided to ship the new broken drivers rather than continue to use the old unbroken drivers. Very very lame on both Intel and especially Ubuntu’s part.
And Phoronix’s performance tests show that the performance of Ubuntu has gone downhill slightly over the last few releases. (With no offsetting user-visible feature improvements.) So we see the problem’s larger than just sound and video drivers.
It’s almost as if the Linux community doesn’t want to be successful.
Microsoft must be laughing all the way to the bank on this one.