Category Archives: Uncategorized

Chirp Chirp Chirp

The woman who sits in the cube right outside my 'office' door is always cold. For a while, she tried using a desk lamp aimed at her head for heat. Then she got smart and bought a space heater, a 1500W space heater. She plugged it in, turned it on and blew the circuit breaker for her section of the building. Now there's a chorus of angry battery-backups chirping away. Luckily, I'm on a different circuit.

Chirp Chirp Chirp. Angry electric crickets.

Puzzling Europe

I consider myself passably good at geography. But this quiz was pretty tough. It's hard to place Lichtenstein, Andorra, and Macedonia accurately on a map if you can't see the borders of the surrounding countries. My first try: 250 sec.

Microsoft's JPEG rival

According to CNET News, MS is getting ready to release a new file format for images. It promises to have fewer compression "artifacts" than JPEG (you know, that blocky, grainy effect you get when JPGs are highly compressed), but with much smaller file sizes. So, this could be good for serious digital photographers. Curious, I went to MS's site and grabbed the specs for this new format, to see what it was all about.

Turns out, it looks a lot like the venerable "TIFF" format. TIFF is an old and extremely accommodating format; it was designed to be flexible and can hold almost any kind of image data you can imagine - images with arbitrary amounts of color data per channel, arbitrary number of channels per pixel, arbitrary compression schemes, color representations, ways to represent the pixel data values, etc.. That's a blessing if you want to store something special, but a curse if you want to be able to read and display any TIFF your application comes across, since handling all the options and flavors and twists TIFF allows is simply impractical. So, the fact that MS went ahead and made a new format insteat of using TIFF is a little surprising to me; since TIFF is already capable of supporting different compression methods, and if MS just wanted to push their compression scheme they could probably have found a way to make it work inside of TIFF. But, this is MS, and they're never happy with existing standards. So, the fact that they went ahead and invented a new format instead of leveraging an existing one isn't really surprising. Disappointing, but not surprising.

One thing that was surprising to me was the way they chose to represent the "pixel format" identifier inside the file - that's the part that tells the reader how the pixels are encoded, organized, packed, etc.: monochrome like a fax, 24-bit RGB (like a JPG), 8-bit (like a GIF), 32-bit RGBA (like a transparent PNG), and so on. Most formats would represent that with a single number in the 0-256 or 0-32767 range (like TIFF does), since the odds of having more than a few dozen different formats is pretty slim. A number in the 0-32767 (a.k.a. 216) range only takes two bytes, and more than adequately covers the range of possibilities. So, what did MS do? They used something called a "GUID" (aka, a Globally-Unique Identifier). That's a 16-byte value; or, a number in the range 0-2128 (or 7 x 1036). That's big. Really big. For comparison, it is estimated there are 1023 grains of sand in the entire world. So a GUID is large enough to count the grains of sand on 70,000,000,000,000 Earths. Why did MS think they needed such an incomprehensibly large range of values?

Imagine picking one grain of sand off a beach somewhere on one of those seventy quadrllion worlds, then putting it back exactly where you found it. Imagine another person is randomly placed on one of those planets, on a random spot on a random beach. What is the probability that person will pick your exact grain of sand? Well, the answer is, of course, 1 / 2128 - but for all practical purposes, it's zero. And likewise, as long as a new GUID is randomly chosen (and they always are), it is essentially guaranteed to be unique. That's why it's called a Globally Unique Identifier. They're very handy.

Now imagine you're a programmer and you've been asked to store some image data in this new file format, in a way that preserves some special characteristics of the data, and that no other pixel format you know fits the bill exactly, What do you do? You figure out how to store that data as you need it, then you grab a new GUID and proudly announce to the world "this is what pixel format blahblahblah does" (and nobody will care). But, you know how to read it, and you know that your GUID identifies it, and you know that nobody else will come along and try to read your file if they don't know what your pixel format is. So MS just made your job a little easier. You encode your image with your fancy new method, save it with a ".WMP" file extension, and move on to the next task. Handy. Clever.

Now, remember what I said way up above about TIFF and the complications of reading its many flavors and variations ? This new format has just superceeded that by a factor of potentially over 2100. So, based on that feature alone, it sounds like a great format for preserving arbitrary data, but a horrible format for ensuring compatibilty.

---

Note: all of this is based on a quick read of the WMP (Windows Media Photo) spec, which promises (err. which the MS marketing dept promises) to be a useful format. Could be. And hopefully, things won't get as bad as my little mathematical musing says they could. One way this could be prevented is if MS tries to act as an official registrar of pixel formats - if you needed a new format, you would have to 'register' it with MS, and MS would publish a list of approved formats and how to deal with them. That's how TIFF handles many of its options - anyone is free to come up with any hare-brained scheme they want, but they run the risk of causing mass confusion and consternation if they don't register their format with the owner of the TIFF spec, Adobe.

Chiding Your Hopefuls

The [Alabama] Montgomery Advertiser has a little story about two men and their dream of serving their country, and how some are working to keep them down:

    Alabama's Democratic Party is distancing itself from two Democratic candidates for state office who think all illegal immigrants must leave or be killed.

    Party officials described the platforms of candidates Larry Darby and Harry Lyon as ridiculous, unconstitutional and offensive. Darby is running for attorney general, and Lyon is a gubernatorial candidate.

    Both agree the influx of illegal immigration into Alabama must be stopped, either through public hangings or martial law.

    The party didn't know the men's views before they qualified, said Jim Spearman, the party's executive director. Spearman learned of Lyon's views from the Montgomery Advertiser.

    ...

    Lyon said if elected, he would sponsor a law to get all illegal immigrants out of the state within 90 days, or be hanged in public.

    "It would only take five or 10 getting killed and broadcast on CNN for it to send a clear message to not set foot in Alabama," said Lyon, a Pelham lawyer. "Anybody that breaks into my home is a threat to my life. I remember the Alamo."

    Spearman called Lyon's proposal ridiculous and unconstitutional.

    "I think you get some candidates who want to get name (recognition) by issuing outlandish statements sometimes," he said.

    Darby, though, said he would support Lyon in his election bid.

    "If he's willing to have public hangings of Mexicans, that sounds like he's the right man for the job," Darby said.

Err. Wow. But, the fun doesn't stop there! Oh no. These guys have other ideas, too. Go read the rest!

(via World O' Crap)

How I solved my music problem

I had a problem. All of my digital music lived upstairs on my computer. My wife's computer had music she's purchased from iTunes, plus any CDs she's ripped; and her computer was reading the songs off my computer, too. So, we can play songs from our computers, which is nice since we spend a lot of time in front of them. But, our stereo is downstairs. It serves as speakers to the TV in the living room, and there are speakers in kitchen and on the porch. And, the stereo can't talk to either of the computers, so our digital music collection is essentially off-limits to the stereo unless we burn a CD, or bring my iPod and dock downstairs. That is not ideal.

I searched all over for a simple and effective way to stream music from a computer to a stereo. There are a number of products which claim to do this: everything from FM-transmitter things (no thanks); to dedicated 'music library appliances' that act as file servers, with RCA jacks for stereo output, and little LED-screen interfaces on them them that allow you to choose songs - none of them can handle iTunes music, though. And, they all take control of your music, organize it, manage it, etc. This would probably infuriate iTunes. So, I was stuck.

Until last week... I bought a "Network Attached Storage" device - that's a big external hard drive (or array of hard drives) with an ethernet jack on it. So I can plug it into my router, and all the computers in the house can see it. Ah ha: a plan takes shape. So, first I put all my music and my wife's music onto this server. Then I pointed our individual copies of iTunes to the server. Now she can see the music that used to live on my computer even when my computer is off. Yay. As a bonus, because this server is a "RAID 5" server, even if one of the hard drives in the server dies, I don't lose any data - I just swap out the dead drive, and the server fixes everything - somehow. Another yay. And, now I can take my WiFi laptop, install iTunes on it, point iTunes at that server and it can play music from anywhere within 100 feet of my router. Specifically, it can run iTunes, pulling music off the NAS server, while sitting right next to the stereo downstairs with a cable connecting the audio-out jack to the Aux channel of my stereo.

Problem solved.

The only drawbacks so far are that iTunes doesn't automatically update itself when new files appear in its 'music folder', so we have to update each copy of iTunes individually, when anything new gets added to the server. And now I've pretty much dedicated my laptop to being a music server, and moved it away from where I work. If only these things were cheaper.

blah blah HITLER! yada yada

There are few hot political issues right now that interest me less than immigration. It feels like a completely manufactured issue to me - red meat for the radical, reactionary, isolationist, right. And I got no respect for those folks. But, that doesn't mean I can't get a chuckle out of the way some approach the immigration issue. For example, this article at WorldNetDaily demonstrates how a writer can utterly annihilate his own argument with an absurdly inappropriate analogy:

    And he [George Bush, a.k.a. "Jorge"] will be lying, again [in his speech tonight], just as he lied when he said: "Massive deportation of the people here is unrealistic – it's just not going to work."

    Not only will it work, but one can easily estimate how long it would take. If it took the Germans less than four years to rid themselves of 6 million Jews, many of whom spoke German and were fully integrated into German society, it couldn't possibly take more than eight years to deport 12 million illegal aliens, many of whom don't speak English and are not integrated into American society.

No, that's not satire. That's Vox Day: !

Yes, Hitler's treatment of the Jews is a good example of what's possible when a country really pulls together and decides to get something done !