Soapbox

Not-so-pop cultural references

Cartoons can be the most subversive of genres. The Simpsons has been serving acerbic social commentary from deep within the bowels of the reactionary Fox network for over 10 years, yet they manage to stay fresh when other, more edgy shows like Family Guys struggle for relevance.

One of the main characters in Futurama, Matt Groening’s other animated show, is named Turanga Leela, a transparent reference to Olivier Messiaen’s Turangalîla Symphonie. The number of people who have even heard of this fairly esoteric work is quite limited, and those who actually like it (as opposed to professing admiration for it out of conformity) can probably be counted on the fingers of one hand. Thus we have established that Groening or his staff are intimately familiar with 20th century classical music.

Last week’s episode of The Simpsons featured the US Army showing a recruitment commercial at the Simpson kids’ school. It starts with a rousing martial score. I have extracted a 4MB clip of the scene (Quicktime 7 required) for those who missed it.

The piece in question is from Prokofiev’s Alexander Nevsky cantata. The music was composed for the epnymous anti-german propaganda movie by Eisenstein (although, in a little known consequence of the Molotov-Ribbentrop pact, Stalin made Eisenstein produce Wagner’s Die Walküre for the Bolshoi in atonement for the newly inconvenient Nevsky). The lyrics heard can be translated in English as follows:

Arise, ye Russian people,
to glorious battle, to a battle to the death:
arise, ye free people,
to defend our beloved country!
All honour to the warriors who live,
and eternal glory to those slain!
For our native home, our Russian land,
arise, ye Russian people!

Needless to day, the delicious irony is unlikely to be mere coincidence.

Trimming the fat from JPEGs

I use Adobe Photoshop CS2 on my Mac as my primary photo editor. Adobe recently announced that the Intel native port of Photoshop would have to wait for the next release CS3, tentatively scheduled for Spring 2007. This ridiculously long delay is a serious sticking point for Photoshop users, specially those who jumped on the MacBook Pro to finally get an Apple laptop with decent performance, as Photoshop under Rosetta emulation will run at G4 speeds or lower on the new machines.

This nonchalance is not a very smart move on Adobe’s part, as it will certainly drive many to explore Apple’s Aperture as an alternative, or be more receptive to newcomers like LightZone. I know Aperture and Photoshop are not fully equivalent, but Aperture does take care of a significant proportion of a digital photographer’s needs, and combined with Apple’s recent $200 price reduction for release 1.1, and their liberal license terms (you can install it on multiple machines as long as you are the only user of those copies, so you only need to buy a single license even if like me you have both a desktop and a laptop).

There is a disaffection for Adobe among artists of late. Their anti-competitive merger with Macromedia is leading to complacency. Adobe’s CEO, Bruce Chizen, is also emphasizing corporate customers for the bloatware that is Acrobat as the focus for Adobe, and the demotion of graphics apps shows. Recent releases of Photoshop have been rather ho-hum, and it is starting to accrete the same kind of cruft as Acrobat (to paraphrase Borges, each release of it makes you regret the previous one). Hopefully Thomas Knoll can staunch this worrisome trend.

Adobe is touting its XMP metadata platform. XMP is derived from the obnoxious RDF format, a solution in search of a problem if there ever was one. RDF files are as far from human-readable as a XML-based format can get, and introduce considerable bloat. If Atom people had not taken the RDF cruft out of their syndication format, I would refuse to use it.

I always scan slides and negatives at maximal bit depth and resolution, back up the raw scans to a 1TB external disk array, then apply tonal corrections and spot dust. One bizarre side-effect of XMP is that if I take a 16-bit TIFF straight from the slide scanner, then apply curves and reduce it to 8 bits, somewhere in the XMP metadata that Photoshop “helpfully” embedded in the TIFF the bit depth is not updated and Bridge incorrectly shows the file as being 16-bit. The only way to find out is to open it (Photoshop will show the correct bit depth in the title bar) or look at the file size.

This bug is incredibly annoying, and the only work-around I have found so far is to run ImageMagick‘s convert utility with the -strip option to remove the offending XMP metadata. I did not pay the princely price for the full version of Photoshop to be required to use open-source software as a stop-gap in my workflow.

Photoshop will embed XMP metadata and other cruft in JPEG files if you use the “Save As…” command. In Photoshop 7, all that extra baggage actually triggered a bug in IE that would break its ability to display images. You have to use the “Save for Web…” command (actually a part of ImageReady) to save files in a usable form. Another example of poor fit-and-finish in Adobe’s software: “Save for Web” will not automatically convert images in AdobeRGB or other color profiles to the Web’s implied sRGB, so if you forget to do that as a previous step, the colors in the resulting image will be off.

“Save for Web” will also strip EXIF tags that are unnecessary baggage for web graphics (and can actually be a privacy threat). While researching the Fotonotes image annotation scheme, I opened one of my “Save for Web” JPEGs under a hex editor, and I was surprised to see literal strings like “Ducky” and “Adobe” (apparently the ImageReady developers have an obsession with rubber duckies). Photoshop is clearly still embedding some useless metadata in these files, even though it is not supposed to. The overhead corresponds to about 1-2%, which in most cases doesn’t require more disk space because files use entire disk blocks, whether they are fully filled or not, but this will lead to increased network bandwidth utilization because packets (which do not have the block size constraints of disks) will have to be bigger than necessary.

I wrote jpegstrip.c, a short C program to strip out Photoshop’s unnecessary tags, and other optional JPEG “markers” from JPEG files, like the optional “restart” markers that allow a JPEG decoder to recover if the data was corrupted — it’s not really a file format’s job to mitigate corruption, more TCP’s or the filesystem’s. The Independent JPEG Group’s jpegtran -copy none actually increased the size of the test file I gave it, so it wasn’t going to cut it. jpegstrip is crude and probably breaks in a number of situations (it is the result of a couple of hours’ hacking and reading the bare minimum of the JPEG specification required to get it working). The user interface is also pretty crude: it takes an input file over standard input, spits out the stripped JPEG over standard output and diagnostics on standard error (configurable at compile time).

ormag ~/Projects/jpegstrip>gcc -O3 -Wall -o jpegstrip jpegstrip.c
ormag ~/Projects/jpegstrip>./jpegstrip < test.jpg > test_strip.jpg
in=2822 bytes, skipped=35 bytes, out=2787 bytes, saved 1.24%
ormag ~/Projects/jpegstrip>jpegtran -copy none test.jpg > test_jpegtran.jpg
ormag ~/Projects/jpegstrip>jpegtran -restart 1 test.jpg > test_restart.jpg
ormag ~/Projects/jpegstrip>gcc -O3 -Wall -DDEBUG=2 -o jpegstrip jpegstrip.c
ormag ~/Projects/jpegstrip>./jpegstrip < test_restart.jpg > test_restrip.jpg
skipped marker 0xffdd (4 bytes)
skipped restart marker 0xffd0 (2 bytes)
skipped restart marker 0xffd1 (2 bytes)
skipped restart marker 0xffd2 (2 bytes)
skipped restart marker 0xffd3 (2 bytes)
skipped restart marker 0xffd4 (2 bytes)
skipped restart marker 0xffd5 (2 bytes)
skipped restart marker 0xffd6 (2 bytes)
skipped restart marker 0xffd7 (2 bytes)
skipped restart marker 0xffd0 (2 bytes)
in=3168 bytes, skipped=24 bytes, out=3144 bytes, saved 0.76%
ormag ~/Projects/jpegstrip>ls -l *.jpg
-rw-r--r--   1 majid  majid  2822 Apr 22 23:17 test.jpg
-rw-r--r--   1 majid  majid  3131 Apr 22 23:26 test_jpegtran.jpg
-rw-r--r--   1 majid  majid  3168 Apr 22 23:26 test_restart.jpg
-rw-r--r--   1 majid  majid  3144 Apr 22 23:27 test_restrip.jpg
-rw-r--r--   1 majid  majid  2787 Apr 22 23:26 test_strip.jpg

Update (2006-04-24):

Reader “Kam” reports jhead offers JPEG stripping with the -purejpg option, and much much more. Jhead offers an option to strip mostly useless preview thumbnails, but it does not strip out restart markers.

Shun till done

One of the benefits of having written my own feed aggregator, Temboz, is that I get to implement the functionality I want to make my life more productive. The most essential one is filtering out articles in subjects I am not interested. One of the first companies to make the cut of those I shun entirely was SCO. I consider them so despicable I don’t even want to hear about them, unlike the hyperventilating Slashdot crowd. Since then, a number of other companies have joined them, most recently Sony. And in the spirit of “a pox on both houses”, I now tune out anything related to either HD-DVD or Blu-Ray.

That said, this form of shunning could fairly be described as passive-aggressive, not constructive. The fact I will no longer entertain the idea of buying a Playstation 3, and probably many others like me, will probably have some effect on Sony’s sales, but their marketing people analyzing sales figures will almost certainly have no clue their contemptible attitude to DRM is costing them. Much of modern economics is grounded in information theory, specially how markets break down in the presence of asymmetric information. If you want your product choices to have real impact, you need to go further.

Corporations are not monolithic entities, all carefully tailored appearances to the contrary notwithstanding. That’s why the New York Attorney-General, Eliot Spitzer is so effective against crooked Wall Street firms (like his predecessor Rudy Giuliani before him), corrupt record labels and the like. Even if a fine is small compared to a firm’s profits, it has to come out of somebody’s budget, and few careers survive that kind of blow. One fired employee, even a high-ranking one, is not much either compared to the typical large corporation’s staffing, but it will have a disproportionate effect on the remaining employees’ behavior. This has been very visible at IBM and now Microsoft after their anti-trust cases, even if in the latter case it seems to be more of a subconscious hesitancy to get anything done.

The average consumer does not have the punitive powers of a Spitzer at his disposal, but there is another way. Unless a corporation is terminally dysfunctional, it will have clear lines of accountability, all the way to the CEO reporting to the Board. The power we have is to dispel the cloud of obfuscation that some may use to to keep their upper management in the dark about the consequences of their actions.

Writing a letter to the CEO can be surprisingly effective. You have to keep in mind the average public company CEO works upwards of 70 hours per week. That lack of free time, combined with their affluence means they are usually out of touch with reality, and need to be reminded of it. This has to be a letter, preferably on good stationery, typewritten but hand-signed. Emails simply do not carry much weight in the worlds of politics or business, because they are so easily written and thus not evidence of commitment. Usually you want to skip flunkies and go straight to the top, but if the CEO is on record supporting the policies you object to, you will have to copy your letter to the president or the chairman of the Board.

Many companies have started monitoring blogs and forums for possible PR headaches (or subcontract this reputation monitoring work to specialized firms). Blogging about your experiences is another good way to get their attention.

There are limits to what an individual can accomplish. If a corporation is dead-set in its ways, collective action is required. In many ways, the American consumer movement has atrophied since the days of Ralph Nader’s crusade against Detroit, whereas the opposite trend holds true in Europe. There are many fine organizations like the EFF that are fighting for your rights, and sometimes even public officials, local or national.

Interesting factoids

Harper’s Magazine, a left-leaning (by American standards) literary gazette, is fairly insipid, but it publishes amusing tidbits in each issue known as Harper’s Index. In a similar vein, here are some surprising bits I have read recently.

  • All 9 members of China’s Politburo are engineers. Source: IEEE Spectrum
  • Western Europe has a population and GDP comparable to the United States, but it has 42% of the world’s WiFi hotspots, compared to 26% in the US. Source: Informa Telecoms and Media.
  • Medical Doctors’ median income in the US is $200,000. Often maligned, median malpractice insurance premiums are only $11,000. Source: Paul von Hippel, Ohio State University.
  • “Administrative costs” represent 19% to 24% of the cost of health care in the US, compared to about 10% in most OECD countries. Source: University of Maine.
  • The French universal medical coverage, despite being rife with abuse and fraud by people who would flunk the means-test for state coverage, costs about 1.4 billion euros per year, slightly under 0.1% of GDP, with approximately 5 million people covered, and health care in general represents about 9% of GDP. Of course, as health insurance is mandatory for all salaried workers, only the unemployed lack coverage in the first place, so the cost of universal coverage in the US would be higher as a proportion of GDP. The French medical system was rated first in the world for general health care by the WHO’s last survey in 2000, so it is not a question of skimping on the quality of care as in the UK.
  • The US spends 15% of its GDP on health care, if that were lowered by 10%, by bringing administrative costs in line with Europe or Canada, the savings would easily cover universal insurance for all Americans.
  • The Philippines and India are respectively ranked No. 4 and 5 destinations for international telephone calls from the US. India hardly registered in 1991. Source: Telegeography.

The real story behind the WSIS

There has been much speculation recently about a possible rift in Internet governance. Essentially, many countries resent the US government’s control over the Internet’s policy oversight. They advocate the transfer of those responsibilities to the International Telecommunications Union (ITU), a more multilateral venue. The big news is that the European Union, which previously sat on the fence, came out strongly in favor of this proposal. Unsurprisingly, the US government is hostile to it. More surprisingly, I agree with their unilateralist impulse, obviously for very different reasons. I was planning on writing up a technical explanation as most of the IT press has it completely wrong, as usual, but Eric Rescorla has beaten me to the punch with an excellent summary.

Many commentators have made much hay of the fact the ITU is under the umbrella of the United Nations. The Bush administration is clearly reticent, to say the least, towards the UN, but that is a fairly widespread sentiment among the American policy establishment, by no means limited to Republicans. For some reason, many Americans harbor the absurd fear that somehow the UN is plotting against US sovereignty. Of course, the reality is the UN cannot afford its parking tickets, let alone black helicopters. American hostility towards the UN is curious, as it was the brainchild of a US president, Franklin D. Roosevelt, its charter was signed in San Francisco (at Herbst Theatre, less than a mile from where I live), and it is headquartered in New York.

The UN is ineffective and corrupt, but that is because the powers on the Security Council want it that way. The UN does not have its own army and depends on its member nations, specially those on the Security Council to perform its missions. It is hardly fair to lay the blame for failure in Somalia on the UN’s doorstep. As for corruption, mostly in the form of patronage, it was the way the US and the USSR greased the wheels of diplomacy during the Cold War, buying the votes of tin-pot nations by granting cushy UN jobs to the nephews of their kleptocrats.

A more damning condemnation of the UN is the fact the body does not embody any kind of global democratic representation. The principle is one country, one vote. Just as residents of Wyoming have 60 times more power per capita in the US Senate than Californians, India’s billion inhabitants have as many votes in the General Assembly as those of the tiny Grand Duchy of Liechtenstein. The real action is in the Security Council anyways, but they are not fully represented there either. Had Americans not had a soft spot for Chiang Kai-Shek, China, with its own billion souls, would not have a seat at that table either. That said, the Internet population is spread unevenly across the globe, and the Security Council is probably more representative of it.

In any case, the ITU was established in 1865, long before the UN, and its institutional memory is much different. It is also based in Geneva, like most international organizations, geographically and culturally a world away from New York. In other words, even though it is formally an arm of the UN, the ITU is in practice completely autonomous. The members of the Security Council do not enjoy veto rights in the ITU, and the appointment of its secretary general, while a relatively technocratic and unpoliticized affair, is not subject to US approval, or at least acquiescence, the way the UN secretary-general’s is, or that of more sensitive organizations like the IAEA.

My primary objections to the ITU are not about its political structure, governance or democratic legitimacy, but about its competence, or more precisely the lack of it. The ITU is basically the forum where government PTT monopolies meet incumbent telcos to devise big standards and blow big amounts of hot air. Well into the nineties, they were pushing for a bloated network architecture called OSI, as an alternative to the Internet’s elegant TCP/IP protocol suite. I was not surprised — I used to work at France Télécom’s R&D labs, and had plenty of opportunity to gauge the “caliber” of the incompetent parasites who would go on ITU junkets. Truth be said, those people’s chief competency is bureaucratic wrangling, and like rats leaving a ship, they have since decamped to the greener pastures of the IETF, whose immune system could not prevent a dramatic drop in the quality of its output. The ITU’s institutional bias is towards complex solutions that enshrine the role of legacy telcos, managed scarcity and self-proclaimed intelligent networks that are architected to prevent disruptive change by users on the edge.

When people hyperventilate about Internet governance, they tend to focus on the Domain Name System, even though the real scandal is IPv4 address allocation, like the fact Stanford and MIT each have more IP addresses allocated to them than all of China. Many other hot-button items like the fight against child pornography or pedophiles more properly belongs in criminal-justice organizations like Interpol. But let us humor the pundits and focus on the DNS.

First of all, the country-specific top-level domains like .fr, .cn or the new kid on the block, .eu, are for all practical purposes already under decentralized control. Any government that is afraid the US might tamper with its own country domain (for some reason Brazil is often mentioned in this context) can easily take measures to prevent disruption of domestic traffic by requiring its ISPs to point their DNS servers to authoritative servers under its control for that zone. Thus, the area of contention is really the international generic top-level domains (gTLDs), chief of all .com, the only one that really matters.

What is the threat model for a country that is distrustful of US intentions? The possibility that the US government might delete or redirect a domain it does not like, say, al-qaeda.org? Actually, this happens all the time, not due to the malevolence of the US government, but to the active incompetence of Network Solutions (NSI). You may recall NSI, now a division of Verisign, is the entrenched monopoly that manages the .com top-level domain, and which has so far successfully browbeaten ICANN into prolonging its monopoly, one of its most outrageous claims being that it has intellectual property rights to the .com database. Their security measures, on the other hand, owe more to Keystone Kops, and they routinely allow domain names like sex.com to be hijacked. Breaking the NSI monopoly would be a worthwhile policy objective, but it does not require a change in governance, just the political will to confront Verisign (which, granted, may be more easily found outside the US).

This leads me to believe the root cause for all the hue and cry, apart from the ITU angling for relevance, may well be the question of how the proceeds from domain registration fees are apportioned. Many of the policy decisions concerning the domain name system pertain to the creation of new TLDs like .museum or, more controversially, .xxx. The fact is, nobody wakes up in the middle of the night thinking: “I wish there were a top-level domain .aero so I could reserve a name under it instead of my lame .com domain!”. All these alternative TLDs are at best poor substitutes for .com. Registrars, on the other hand, who provide most of the funding for ICANN, have a vested interest in the proliferation of TLDs, as that gives them more opportunities to collect registration fees.