Archive for December 2006

Chess Champ Banned for Bluetooth-in-the-Ear During a Tournament

According to InformationWeek, Umakant Sharma, seeded 2nd in a tournament in New Delhi, was caught with a Bluetooth headset stitched into a cap that he wore “pulled down over his ears” during competition. According to the All India Chess Federation, accomplices fed him moves from a chess program. He’s been banned by FIDE for 10 years.

This reminds me of something I’ve discussed before — during Gary Kasparov’s famous 1997 battle with Deep Blue, he demanded that the program’s code be escrowed because Kasparov was of the belief that no computer could generate such play and that a human or humans must be feeding the machine moves. That response — an expert in his domain asserting that computer behavior “must be from a human” – always struck me as more important than the ability of the computer to ultimately grind down the world’s best chess player. The response was the first, and to date, closest thing to a triumph in the Turing test.

I have to admit it also reminds me of my own scandalous behavior in 3rd grade, when as a Cub Scout I made a pinewood derby car into which I could slip a fishing weight after the official weighing. I was caught because my car didn’t just win the race, it ran down the ramp about twice as fast as anything else (objects of different mass might fall in a vacuum at equal speed; objects with wire axles running through a wood block, not so much). Needless to say, that was the end of my time in scouting. (Although, to be fair, they actually wanted to have some kind of disciplinary thing and then let me continue. Somehow I never made it over to the Brennan’s house for that meeting.)

My Sister Bought Me A C++ GUI Programming Guide!

Well, more or less…

There’s really no way to program XNA, even in 2D modes, without learning HLSL.

Envy Code R Programming Font Preview Release (Oh, and iTunes sucks)

Damien Guard has released a preview of Envy Code R , a good-looking programming font. At the moment, I think it looks best at higher font-sizes: I would definitely consider this for use in presentations.

Incidentally, the image is from some utility programs I’ve been writing for iTunes. I got an iPod for Christmas, something I asked for in part because I was under the impression that the iTunes software, being as dominant in the world of music management as Office is in the world of spreadsheets, must be reasonably competent.

iTunes sucks. It must have crashed twenty times in the past five days. And not just crashed, but hung processes, minutes-long freezes, cryptic memory-error messages: an entire litany of bad program behavior. The only thing I like about it is that it unlocked my DRM-ed music and figuring out how to “Convert to MP3″ was the work of a few seconds.

After a year or so of relying on Pandora and KEXP, the “Party Shuffle” in iTunes seems just absurd. The only other thing I like about iTunes is that it has a COM interface, which implies that I can unlock a couple facilities. First up, I’m going to see if I can write a program that cleans up “genre” tags so that they provide a more relevant personal view. For instance, I have a lot of what most people would simply call “punk rock,” but for me, I need to divvy that up maybe 5-6 sub-genres. On the other hand, even though there are many genres of hip-hop, I’d only need maybe 2 or 3. I’ve got an algorithm in mind…

Mandelbrot Shader: Holy Effing Crap!

Absolute times to calculate a fixed range of the Mandelbrot set:

Machine Concurrency Language Time
Dual-Opteron Singlethreaded C# ~0.81
Dual-Opteron Multithreaded C# ~0.45
Dual-Opteron Singlethreaded C++ ~0.50
Dual-Opteron Multithreaded C++ ~0.38
XBox 360 Singlethreaded C# ~4.4
XBox 360 Multithreaded C# ~2.1
XBox 360
GPU Shader
HLSL
~0.05

This isn’t even fair because the non-GPU timings are strictly timings of the calculation loop. The GPU timing is actually derived from my frame-rate.

I’m having some trouble getting my shader to run on my desktop (ATI All-In-Wonder with Radeon X800), but will post that number when I can.

XNA Multithreading: Must Set Processor Affinity Manually

Ah, that’s more like it. This is a graph of duration (in seconds) versus the number of threads during a calculation of a Mandelbrot set using the XNA Framework on the XBox 360 (Neil: The previous graph was normalized speed, as you suspected. For more on labeling the Axis in Office 12, see the next post.)

In order to have the XNA Framework distribute processing, you must explicitly set the “thread affinity.” This must be done within the worker thread (presumably early in the ThreadStart delegate) and, on the XBox 360, you must not use the values 0 or 2, which are reserved. Thus, I use code like this:

 

struct ThreadWorker
{
    int processorAffinity;
    static int processorAffinityIterator = 0;
    internal ThreadWorker()
    {
        switch (processorAffinityIterator)
        {
            case 0  :
                processorAffinity = 1;
                break;
            case 1 :
                processorAffinity = 3;
                break;
            case 2 :
                processorAffinity = 4;
                break;
            case 3 :
                processorAffinity = 5;
                break;
            default :
                processorAffinity = 1;
                break;
        }
        if (++processorAffinityIterator == 4) { processorAffinityIterator = 0; }
    }
   internal void ThreadRun()
   {
   Thread.CurrentThread.SetProcessorAffinity(processorAffinity);
   ... begin work ...

Office 12 Excel Graphing Bug: Axis Label Not Copied On Cut-And-Paste

Properly chastised by Neil Bartlett for not labeling my Y Axis on a graph, I added such a title to my next attempt. I then cut-and-pasted that image, which resulted in this being pasted into my blog editor:

 

 

And yet, I had already typed the Axis Title, as this screen capture of my Excel chart shows:

Now if only I could also figure out how to add a title for the X axis! Thank God for the Ribbonbar!

XNA Multithreading: Built On A Throne of Lies?

UPDATE: See this new post It looks like XNA does not distribute processing across the multiple cores of the 360:

This is identical code (a Mandelbrot calculation of a fixed size) running with multiple threads. While my desktop machine speeds up with more threads (peaking at 3), the XBox 360 running XNA runs at almost exactly the same speed.

Incidentally, the graphic shows normalized speeds. The actual performance of the XBox 360 is 1/5 – 1/9 that of my desktop (4.43 seconds as opposed to ~.8 seconds single-threaded or ~.47 with 3 threads).

My First XNA Program: Up And Running on the 360

Sweet. Stay tuned for performance benchmarks, concurrency and GPGPU programming experiments on the 360, and maybe even some games…Maybe even a domain-specific language for writing board games.

19-Year-Old Creates ANTLR Studio For Eclipse: I Think We’ll Be Hearing From This Kid

As far as I can tell, the only mistake he made is charging way too little ($19.99) and admitting his age. Other than that, ANTLR Studio for Eclipse looks professional as all get-out.

Microsoft Robotic Studio RTMs

Microsoft has released-to-manufacture Microsoft Robotics Studio (via Dan Fernandez).

We got a Roomba as an early Christmas present and I gotta’ tell you, it’s won over my extremely-skeptical wife. My least favorite chore is sweeping our long, steep driveway and I’m very tempted to get another and mod it for the task (put a plow on the front for the leaves and stones, desensitize or shut off the bump sensor, maybe turn off the brushes altogether. I looked at the Roomba API and it seems straightforward.). 

Man. If I had a robotic driveway cleaner and an autonomous frog-killing blimp? That would be totally sweet. Totally.

div>