Fazal Majid's low-intensity blog

Sporadic pontification

Fazal

M8, a missed opportunity

Last Saturday, I became the proud owner of a Leica M8. Then, a not-so-proud owner. As of yesterday, an ex-owner…

I returned it and sprung for an Epson R-D1 instead, saving almost 50% in the process. I had already previewed one at MacWorld SF two years ago.

R-D1

Most people interested in a M8 know by now about its problems with sensitivity to near infrared, which manifests itself as a magenta cast in certain situations. There is a work-around (buy costly Heliopan or B+W IR filters for your lenses, although there are rumors Leica will provide two free filters), but many are legitimately angry at Leica for having rushed the M8 launch despite such a fairly obvious flaw. It’s not an ideal situation but I could deal with it, as long as Leica stood behind its product and committed to a free upgrade to the corrected model once a definitive fix becomes available.

The straw that broke this particular camel’s back was quality control, however, or the lack thereof. My M8 exhibited almost an entire column of dead pixels (the bottom 3/4 at x=2888). If you must, see this jpeg or the original DNG. This kind of flaw would be unacceptable in a sub-$1000 Canon or Nikon, it is simply outrageous in a camera as expensive as the M8.

The magenta cast is not an edge condition visible in limited conditions, by the way (Leica claims it only affects black synthetics under tungsten light), the photos I took last Sunday indoors in available light are completely unsalvageable, with a strong magenta cast everywhere that cannot be corrected by any amount of custom white balancing. Here is an example: JPEG, DNG.

Last, but not least, noise levels are excessive at ISO 1250, let alone 2500, with smearing in rows where bright highlights are present. Essentially, this camera as it stands today is utterly useless outside broad daylight conditions (I don’t have an IR filter, so I can’t comment on how effective they are). Of course, pretty much all cameras do reasonably well in daylight, even cheap and nasty point-and-shoots with too many megapixels crammed in a sensor too small. Rangefinders give you a two stop advantage due to the absence of mirror slap, but even with a Noctilux, the M8 has no edge over a Canon DSLR because of the noisy sensor. Then again, it is one of my rules of photographic thumb that Kodak stands for poor quality, and since they make the sensor in the M8, I should have expected the worst.

It’s interesting to note how the reviews published so far managed not to mention any of these problems, which are completely obvious, even with the most cursory of inspections. In at least one case (Michael Reichmann of The Luminous Landscape), the reviewer found out about the IR issue, informed Leica about it but neglected to mention it in the review. This confirms me in my belief Phil Askey’s reviews at DPReview are the only reliable online reviews of digital cameras.

Leicaphiles seem to be mostly in denial, or minimize the extent of the problem. I am as big a fan as any of Leica’s optics and their rangefinder cameras, but the flaws in my M8 were so glaring I can’t even begin to fathom the levels of cognitive dissonance required to sustain a positive opinion of this train wreck in the making.

All the reviews I have read so far have been raising hallelujahs and claiming the M8 feels like a real Leica M. It most certainly does not:

  • The body feels much thicker than the MP, and is just as thick as the R-D1, in fact, despite not having a flippable LCD like the R-D1.
  • The lightweight magnesium body does not have the same level of robustness as the R-D1, let alone a MP, and feels more like a CM. It’s not even to the same grade as the original Digilux.
  • The lens mount lock does not snap positively and reassuringly as it should, and the release button feels cheap compared to my MP or M6TTL.
  • The shutter release is mushy and unpleasant. The shutter sound itself is a loud thunk followed by a noisy motorized re-cocking.
  • Setting ISO is buried in a menu and you need even more keystrokes to change it than on a Rebel XT (the R-D1, in comparison, has a genuine knob to set it quickly with direct feedback).
  • The rangefinder on mine was slightly misaligned vertically, something one can tolerate in a $300 Bessa, but certainly not in a M (to be fair, rangefinder patch vertical alignment is an endemic problem with the R-D1 as well).
  • In another sign of sloppiness and poor quality control, the copy of Capture One LE included in the box was missing the serial number required to activate the program.

Doug ThackerAfter using the R-D1 for a few hours, the superiority of the design over the M8 is readily apparent (with the sole exception of the taller body and short rangefinder base length):

  • The R-D1 has perfectly acceptable ISO 800 and 1600, unlike the M8, making it suitable for available light shooting.
  • The LCD screen pivots and can be turned around to protect it from scratches (or resist the temptation of chimping).
  • The viewfinder has an honest to goodness magnification of 1.0x like the original M3, not one that panders to jaded wide-angle junkies (I never shoot wider than 50mm and my MP is a 0.85x mag, so yes, I am biased)
  • The power supply is a manageable size and even has a cord, unlike the bloated wall-wart type Leica supplies with the M8.
  • The shutter speed dial goes in the traditional direction, not the M6TTL/M7 direction…

One bright light in this fiasco: Doug Thacker at Calumet Photo San Francisco (above) went well above the call of duty to help me with my purchases, all with unfailing good humor (he once sent me an email at 11PM to let me know of the IR sensitivity problem before they started receiving theirs). He even set one M8 aside for me even though I had cancelled my initial pre-order (they are in short supply and are reportedly going for over $6000 on eBay right now, so the opportunity costs are considerable). I think I will switch from B&H to Calumet for the bulk of my photo purchases in the future.

Update (2007-08-25):

I must be a glutton for punishment, as after reading Phil Askey’s M8 review, remarkably thorough as usual, I decided to give it another chance and get one for my birthday. The first one I ordered (from Amazon) had a severely misaligned rangefinder – points at infinity would not coincide at all when the lens was at infinity focus. It had a low serial number, suggesting an early model with teething problems. Presumably Amazon does not sell that many, so I returned it and ordered another one from a place with much higher turnover, B&H. That one was a recent vintage (they have an orange sticker on the body cap), but its rangefinder was also misaligned, if not as severely.

In frustration, I went to my local Calumet and finally found one that focuses correctly. Wonder of wonders, it even seems like there are no dead pixels or highlight streaks. Conclusion: Leica’s M8 quality control is still spotty, your best bet is to buy locally and test the rangefinder in the store itself.

Inserting graphviz diagrams in a CVStrac wiki

CVStrac is an amazing productivity booster for any software development group. This simple tool, built around a SQLite database (indeed, by the author of SQLite) combines a bug-tracking database, a CVS browser and a wiki. The three components are fully cross-referenced and build off the strengths of each other. You can handle almost all aspects of the software development process in it, and since it is built on an open database with a radically simple schema, it is trivial to extend. I use CVStrac for Temboz to track bugs, but also to trace changes in the code base to requirements or to bugs, and last but not least, the wiki makes documentation a snap.

For historical reasons, my company uses TWiki for its wiki needs. We configured Apache with mod_rewrite so that the wiki links from CVStrac lead to the corresponding TWiki entry instead of the one in CVStrac itself, which is unused. TWiki is very messy (not surprising, as it is written in Perl), but it has a number of good features like excellent search (it even handles stemming) and a directed graph plug-in that makes it easy to design complex graphs using Bell Labs’ graphviz, without having to deal with the tedious pixel-pushing of GUI tools like Visio or OmniGraffle. The plug-in makes it easy to document UML or E-R graphs, document software dependencies, map process flows and the like.

CVStrac 2.0 introduced extensibility in the wiki syntax via external programs. This allowed me to implement similar functionality in the CVStrac native wiki. To use it, you need to:

  1. Download the Python script dot.py and install it somewhere in your path. The sole dependency is graphviz itself, as well as either pysqlite2 or the built-in version bundled with Python 2.5
  2. create a custom wiki markup in the CVStrac setup, of type “Program Block”, with the formatter command-line:
    path/dot.py –db CVStrac_database_file –name ‘%m’
    • Insert the graphs using standard dot syntax, bracketed between CVStrac {dot} and {enddot} tags.
For examples of the plugin at work, here is the graph corresponding to this markup:
{dot}
digraph sw_dependencies {
style=bold;
dpi=72;

temboz [fontcolor=white,style=filled,shape=box,fillcolor=red];
python [fontcolor=white,style=filled,fillcolor=blue];
cheetah [fontcolor=white,style=filled,fillcolor=blue];
sqlite [fontcolor=white,style=filled,fillcolor=blue];

temboz -> cheetah -> python;
temboz -> python -> sqlite -> gawk;
temboz -> cvstrac -> sqlite;
python -> readline;
python -> db4;
python -> openssl;
python -> tk -> tcl;

cvstrac -> "dot.py" -> graphviz -> tk;
"dot.py" -> python;
"dot.py" -> sqlite;
graphviz -> gdpng;
graphviz -> fontconfig -> freetype2;
fontconfig -> expat;
graphviz -> perl;
graphviz -> python;
gdpng -> libpng -> zlib;
gdpng -> freetype2;
}
{enddot}
Dot

Another useful plug-in for CVStrac I wrote is one that highlights source code in the CVS browser using the Pygments library. Simply download pygmentize.py, install it Setup/Diff & Filter Programs/File Filter, using the string path_to/pygmentize.py %F. Here is an example of Pygment applied to pygmentize.py itself:

#!/usr/bin/env python
# $Log: pygmentize.py,v $
# Revision 1.3  2007/07/04 19:54:26  majid
# cope with Unicode characters in source
#
# Revision 1.2  2006/12/23 03:51:03  majid
# import pygments.lexers and pygments.formatters explicitly due to Pygments 0.6
#
# Revision 1.1  2006/12/05 20:19:57  majid
# Initial revision
#
"""
CVStrac plugin to Pygmentize source code
"""
import sys, pygments, pygments.lexers, pygments.formatters

def main():
  assert len(sys.argv) == 2
  block = sys.stdin.read()
  try:
    lexer = pygments.lexers.get_lexer_for_filename(sys.argv[1])
    out = pygments.highlight
    block = pygments.highlight(
      block, lexer, pygments.formatters.HtmlFormatter(
      style='colorful', linenos=True, full=True))
  except ValueError:
    pass
  print unicode(block).encode('ascii', 'xmlcharrefreplace')

if __name__ == '__main__':
  main()

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.

iTunes 7, one step forward, one step back

I upgraded to iTunes 7 yesterday. This new version adds a feature opera and classical fans were clamoring for, gapless playback. Often, two or more consecutive tracks must be played without interruption. CD players do that effortlessly, surprisingly few MP3 players can. A pause, however slight in the middle of an aria can be incredibly jarring. Apple took its sweet time, but they eventually delivered (although it is not clear if all older iPod models will support this beyond the 5G video-capable iPod). You have to explicitly flag albums that must be played without gaps by selecting the “gapless album” option.

I still have to get used to the cosmetic changes in the new version. I liked the green musical note icon better than the new blue one. The new style looks a little flat and one-dimensional, just like many Windows XP applications have a flat web page inspired look compared to the beveled buttons and controls of the CUA-based Windows 2000 interface.

iTunes 7 is also markedly different in behavior from previous versions in how it handles albums. To keep the user interface easily understandable for the general public, all tracks are shown as a single flat database, but behind the scenes, iTunes implicitly normalizes this into something that looks like the following relational data model:

old iTunes ER model

iTunes 7 added a few new fields, including “Album Artist”, which seems to be of dubious utility. I described in a previous article my coding conventions to work around the fact iTunes was obviously designed by people with absolutely no clue about classical music. Unfortunately, iTunes 7 does not rectify this situation, but what’s worse, they also changed the key for the album to include both Artist and Album Artist:

iTunes 7 ER model

I can understand why they did this – if you have several alternative versions of the same work by the same composer, but by different artists, they would be played in intermingled order, which is why I append (2), (3) and so on to multiple interpretations of the same work (by decreasing order of preference).

On the other hand, the new behavior means that if you assigned different artists to tracks in an album (in a classical piece or an opera, you seldom have all the tracks played by the same artists), iTunes mistakenly thinks you have several albums, one for each possible value for artist, and this breaks libraries that worked with previous versions. iTunes 6 and earlier would not care and play them all in the order implied by the Track# field. iTunes 7 will see them as different albums and you will get a nasty surprise when you play the album in shuffle mode, as it will skip to a completely different album halfway through.

Let me illustrate with the album I first encountered the problem with. The last two tracks have Peter Seiffert credited, whereas the first two do not. The list view shows the albums sorted properly, like previous versions of iTunes:

iTunes 7 list view

The album view makes it clear what iTunes thinks is happening:

iTunes 7 album view

The only work-around this today is to force all tracks in an album to have the same Artist field. I will need to write an AppleScript to identify all tracks that need to be normalized thus, even if this means a loss of information. A further quirk is that the implicit normalization is apparently done at iTunes startup, so you need to restart iTunes for the changes to have an effect.

Update (2006-11-03):

I auto-updated to 7.0.2 today and finally figured out something that has been puzzling me for a couple of weeks now. My copy of Poulenc’s Stabat Mater (Battle/Ozawa/Boston/Tanglewood) would not play as a single album, even though it is displayed as such in the album view. I have “shuffle by album” activated, and it would skip from any track in that specific album to a completely unrelated one. Even if I pinned it down by entering “poulenc stabat” in the search box so no other album could be selected, iTunes would skip from track 1 to a completely random track, instead of moving on to track two.

Apparently iTunes shuffles using a different algorithm than the album grouping. I have another album that has the exact same title “Stabat Mater”, albeit one by Pergolesi, not Poulenc (and four others by Dvořak, Szymanowski and Vivaldi, but the opus or RV number differentiates the album titles). Having two albums with the same title seems to confuse iTunes no end. I don’t want to mangle my album names just to appease iTunes 7, but I found a work-around: just change the mostly useless “Disc Number M out of N” field so the two albums with conflicting titles have different disc numbers, and they will collide no more. Better yet, use the CD number field to uniquely identify each CD in your collection, instead of just within a boxed set. Once again, you need to restart iTunes for this to kick in.

Troubleshooting Windows remotely

Unpaid computer tech support for relatives is not a popular topic among geeks. It is very much a reality, however, specially in Indian communities with extensive extended families like mine. Some of the griping is churlish considering all the favors your family cheerfully does for you, and we probably have it better than MDs who are constantly bombarded with requests for free medical consultations.

At first sight, I would be better off if my relatives had the good sense to ditch Windows and get a Mac instead, but that would in fact compound the problem because I would get even more calls for help from people who are having a hard time dealing with very basic issues on an unfamiliar platform. Mac OS X may be better integrated and secure than Windows, but contrary to popular opinion it is not that much less crash-prone. All computers are unnecessarily hard to use in the first place. I doubt very much the computer industry will mend its ways and put human-centered design first, more likely than not the problem will be “solved” by the progressive eclipse of generations born before widespread computing, the rest of us having perforce adapted to these flawed tools.

A big part of the problem is doing “blind” support over the phone where you don’t see what is going on, and often the person in front of the screen is not technical enough to know what is significant and how to give you a useful and actionable description of what is on screen.

To its credit, Microsoft added remote assistance functionality in Windows XP. Explaining to users how to activate it is a challenge in itself, however, and in any case you need another Windows XP machine to provide the support. I still run Windows 2000 in the sole PC I have (used exclusively for games nowadays) and it makes such a racket I am almost viscerally reluctant to boot it up.

The best solution is to use virtual network computing (VNC), a free, cross-platform remote control protocol originally invented by the former Olivetti-Oracle-AT&T labs in Cambridge, UK. I often use VNC to take control of my home Mac from my office PC or my MacBook Pro. Indeed, VNC is integral to Apple Remote Desktop, Apple’s official remote management product for large Mac installations. There are even VNC clients available for PalmOS and Windows CE so you could remote control your home computer from a Treo. Having VNC running on the ailing PC would allow me to troubleshoot it efficiently from the comfort of my Mac.

Unfortunately, there is still a chicken-and-egg effect. I once tried to get an uncle to set up UltraVNC on his PC and do a reverse SSH forwarding so I could bypass his firewall. It took the better part of an hour, and barely worked. Surely, there has to be a better solution.

One such solution is Copilot, a service from Fog Creek software that repackages VNC in a form that’s easier to use. It is somewhat expensive, however (although that can be seen as a feature if the people calling for help have to pay for it and thus have an incentive to moderate their requests).

Another one that shows some promise is UltraVNC SC, a simplified version of UltraVNC that is designed for help desks (here is a more friendly walkthrough). Unfortunately, it shows a very clunky dialog that makes sense in a corporate help desk setting, but is too confusing for a novice user, and it uses UltraVNC extensions that are not compatible with most other VNC clients like the one I use most, Chicken of the VNC.

In the end, what I ended up doing was to take the source code for the full-featured UltraVNC server, rip out all the user interface and registry settings from it, and hardcode it to open an outgoing connection to my home server alamut.majid.org on TCP port 5500. There isn’t anything on the server listening on port 5500 by default, but I can open a SSH connection to it from anywhere in the world and use SSH reverse port forwarding to connect port 5500 to wherever I am. This neatly sidesteps the problem of firewalls that block incoming connections.

The resulting executable is larger than SC, but still manageable at 500K (vs. 950K for the full version), and requires no input from the user beyond downloading it and running it, thus triggering all sorts of warnings. It’s not good practice to teach users to download and run executables, but presumably they trust me. After the VNC session is finished, the program simply exits (as evidenced by the disappearance of the UltraVNC eye icon from the toolbar

If you want to use a setup like mine, it’s easy enough for a technically inclined person:

  1. You could download my executable at majid.org/help, open it in a hex editor (or even Emacs), search for the string alamut.majid.org and overwrite it with the name of the machine you want to use instead (I left plenty of null bytes as padding just in case). Make sure you are overwriting, not inserting new bytes or shrinking the string, as the executable won’t work correctly otherwise.
  2. Or you could download the modified source code I used (UltraVNC is a GPL open-source project, so I am bound by the license to release my mods). Edit the string host in winvnc/winvnc/winvnc.cpp (you can also change the reverse VNC port from its default of 5500 if you want), and recompile using the free (as in beer) Visual C++ 2005 Express Edition and the Platform SDK. My Windows programming skills are close to nil, so if I could do it, you probably can as well.

To use the tool, put it up on a website, and when you get a request for help, SSH into the server. On UNIX (including OS X), you would need to issue the command:

ssh -R5500:127.0.0.1:5500 your.server.name.com

Please note I explicitly use 127.0.0.1 rather than localhost, as the former is always an IPv4 address, but on some systems, localhost could bind to the IPv6 equivalent ::1 instead.

On Windows, you will need to set the reverse port forwarding options in PuTTY (or just replace ssh with plink in the command-line above). After that start your VNC client in listen mode (where the VNC client awaits a connection from the server on port 5500 instead of connecting to the server on port 5900). You can then tell the user to download the executable and run it to establish the connection.

Some caveats:

  1. The leg of the connection between the PC and the server it is connecting to is not encrypted
  2. Depending on XP firewall settings, Windows may ask the user to authorize the program to open a connection
  3. At many companies, running a program like this is grounds for dismissal, so make sure whoever is calling you is asking for help on a machine they are authorized to open to the outside.

I hesitated to make this widely available due to the potential for mischief, but crackers have had similar tools like Back Orifice for a very long time, so I am not exactly enhancing their capabilities. On the other hand, this makes life so much easier it’s worth sharing. Helping family deal with Windows will still be a chore, but hopefully a less excruciating one.

Update (2007-03-23):

You can make a customized download of the executable targeting your machine using the form below. Replace example.com with whatever hostname or IP address you have. If you do not have a static IP address, you will need to use a dynamic DNS service like DynDNS or No-IP to map a host name to your dynamic IP address.