Tuesday
Jan042005

the brown computer store lost my powerbook

Oh, dear.
On December 18, I finally brought my mac into the Brown Computer Store. I already had a dispatch number from apple -- that is, apple had heard all about my powerbook's problem, agreed that it was covered by applecare, and told me to bring it in to a licensed apple reseller to be sent back to apple. So I did. I got a receipt, and a salesman's assurance that they would mail it to apple straightaway. Every few days since then, I've been checking my repair status on the mac support system... but it doesn't turn up. Tonight I called Apple, and talked to someone in dispatch, who said that they hadn't received my computer. Um. This is not so good.
Yes, I had backups. Backups like mad.Go me.
She said, though, that if Brown has indeed lost it, that they will somehow make it right with me -- either give me a replacement, or a refund. Can anyone say "Sascha wants a 12" iBook G4"? In fact, a 12" iBook G4 would probably be a better machine than my 15" 667 Mhz powerbook g4.

Still, sigh. The brown computer store people are rather idiotic. I tried to buy my mac from them two years ago, and they just couldn't get it right. I ended up driving to a store in Palo Alto and buying one off the shelf. No, I didn't drive to Palo Alto from Providence. Don't be silly.

My mac has been borked since... sometime this summer. I flew with it out to Microsoft, and at the airport where I changed planes, I noticed that it took >20 minutes to reboot. That's not so good. From there on it's been downhill. Luckily, my job keeps me supplied with fast tasty computers. If that mac was my only machine, I would be so screwed by now.

Is borked a word, or just something I glommed onto from my brother's typo in an iChat window?

Monday
Jan032005

excellent nytimes photo/info piece

The New York Times' amazing photo-essay on the tsunami's impact is the best web content I've seen, possibly ever. It's dignified and respectful and powerful, informative and readable. Beautiful and horrible.

Friday
Dec312004

most obfuscated code I've ever seen

I'm porting something from java to C#. I'm pretty sure what I'm trying to figure out at the moment is the Bresenham line drawing algorithm, which tells you how to draw a line on a bitmap. But then I get to this line, where it actually sets the pixel value in the buffer:



int rand8 = Shade3D.nextRandom8Bit();

pbuf[offset] = (n > nMid?(rand8 < 85?argb1Dn:(rand8 > 170?argb1Up:argb1)):(rand8 < 85?argb2Dn:(rand8 > 170?argb2Up:argb2)));



So first it gets a random 8 bit integer, if the method name can be trusted, and then

it decides what value to put in the pixel by whether the random is less than 85, less than 170, or greater than 170.



Okay, wait -- I might actually understand this. This might actually be antialiasing. Or it might be utter witchcraft.



This section also includes code that shifts bits left and right, and a lot of code that pays a lot of attention to 8 bit vs 16 bit vs 32 bit integers. As a rule, something is harder to port the closer it is to hardware. Bit-shifts and paying attention to the bit-width of types is rather close to the hardware, for my taste.



So have I just spent two day's on a fool's errand? Perhaps. I'm probably going to have to throw away the last two days of work, and re-start the port with another approach. Damn it. At least I get to keep the lessons learned.



And yes, it is new year's eve and I'm programming. It's not exactly fun, but it's what makes my life better.

Wednesday
Dec292004

weather

This is just an idea; it might be horrible in some ways.

This year we had the worst hurricane season ever. Last year was the coldest winter in ages, and the year before I think was the snowiest winter in ages. Significant portions of the Antarctic Ice Shelf are falling off and melting into the sea. I'm talking about rapid global climate change. I think it's real, and it's here, and it's just going to get worse.

Eleven countries around the rim of the Indian Ocean are suffering the worst natural disaster ever because of one tsunami: the waters rose quickly, then receded. A tectonic shift caused the earthquate which caused the tsunami, but think about this: the flood waters receded this time. What's going to happen when the water rises, and rises, and doesn't recede for hundreds of thousands of years? It won't be sudden; there will be time to plan for it, but it will be permanent. People won't just be homeless; the actual land they live on will disappear.

Let's use this disaster as a preview of the coming floods. Let's encourage the nations to rebuild at higher elevations, and leave the lowlands for the sea's inevitable encroachment. Most of all, let's use these horrible images to keep up the fight against global warming. A tsunami early warning system won't save us from global warming; we've already got a global warming detection system, and the alarms have been ringing off the hook for twenty years. We ignore them at our peril.

Monday
Dec272004

"significant enhancements"

I've been working on migrating Jmol to Microsoft Visual J# so that I can use it in a C# program. I ran into a problem with the javax.vecmath library -- it falls into the set of "technologies with no automatic migration." The Moving Java Applications to .NET instructions include this ridiculous bit of "it's not a bug it's a feature" and generally everything that's wrong with Microsoft's worldview when it comes to Java:

To finish the migration, you replace the unmigrated Java technology with comparable .NET technology. Because .NET provides a richer set of classes than what is available in Java, often you can make some significant enhancements when performing the technology replacement.



*splutters* But I don't want to re-work Jmol to use .NET's vector math library. There's already a perfectly good java vector library that I want to use.



What this *actually* means is that if I want to use vecmath, I have to "upgrade" it to J#. I think it will be worth it for Jmol though -- the whole point of using Jmol is to save me from having to write a complete molecule viewer in Direct3D/C#.



...arg. It turns out to be rather difficult to sane-ify the output of the "upgrade" wizard. And in fact, it seems to upgrade to C# rather than J#. I know C#, so I don't mind that.



I'm still in love with open source. Very much in love.