Macintosh: It’s a User Thing

January 17th, 2005

It’s been my experience that about half the techies and journalists commenting on the new Mac Mini “get it”, and about half don’t. This contrasts favorably with the track record for the iPod Mini, where almost nobody, including me, “got it” up front. A typical example of the commentators who don’t get it is Michael Kanellos at c|net. First read his latest column and spot the elementary math error. Someone needs a refresher course in high school geometry.

Read the rest of this entry »

Sharecroppers and Serfs

January 5th, 2005

I just took a quick peek at the new, so-called user-friendly installer for the next release of Debian. It’s pretty obvious these folks don’t have a clue about talking to real users. I doubt they’ve done any end-user testing. For instance, after I’ve selected “English” as my primary language, maybe it would make sense to move the English keyboard layouts to the top of the list? And do they really expect end users to understand or care about messages like “Loading module ‘plix’ for ‘Intel Corporation 82371AB/EB/MB PIIX4”? I asked for English in the install. Would it be too much to ask that the installer speak it? And I’m sorry, but “SCSI1 (0,0,0) (sda) – 4.3 GB VMware, VMware, Vi” is not a sensible name for a disk. How I am supposed to choose between “Primary” and “logical” partitions? I could continue, but I’ll stop here. Haven’t any of these people ever used a Mac? In many ways, Linux is an extremely modern operating system, which makes it all the more frustrating that its user interface is still stuck in 1982.

Read the rest of this entry »

Overloading int considered harmful: part 2

December 19th, 2004

After writing Overloading int considered harmful, three concerns were raised:

  • How does this affect object serialization?
  • What about ClassLoaders?
  • How about the new enum keyword in Java 1.5?

I’d like to address those now.

Read the rest of this entry »

HTML Labeled Components

December 14th, 2004

One of the coolest yet little known features of the Java Foundation Classes (aka Swing) is the ability to label components with HTML. For example, let’s suppose you want a button that contains both bold and non-bold text on separate lines like this:

Button text: Damn the Torpedoes! Full speed ahead!

This is quite complex to implement in Java code. You have to subclass JButton, override paint(), and perform many detailed calculations with FontMetrics objects just to decide where to draw the different text strings. On the other hand, it’s straight-forward code this in HTML:

Read the rest of this entry »

A Brief Introduction to XInclude

December 8th, 2004

It’s often convenient to divide long XML documents into multiple files. The classic example is a book, customarily divided in chapters. Each chapter may be further subdivided into sections. Traditionally this has implemented via external entity references. For example,

<?xml version="1.0"?>
<!DOCTYPE book SYSTEM "book.dtd"[
  <!ENTITY chapter1 SYSTEM "malapropisms.xml">
  <!ENTITY chapter2 SYSTEM "mispronunciations.xml">
  <!ENTITY chapter3 SYSTEM "madeupwords.xml">
]>
<book>
  <title>The Wit and Wisdom of George W. Bush</title>
  &chapter1;
  &chapter2;
  &chapter3;
</book>

However, external entity references have a number of limitations. Among them:

The individual component files cannot be treated in isolation. They often aren’t themselves full, well-formed XML documents. They cannot have document type declarations.

  • The document must have a DTD, and the parser must read the DTD. Not all parsers do.

  • If any of the pieces are missing, then the entire document is malformed. There’s no option for error recovery.

  • Only entire files can be included. You can’t include just one paragraph from a document.

  • There’s no way to include unparsed text such as an example Java program or XML document in a technical book. Only well-formed XML can be included, and all such XML is parsed. (SGML actually had this ability, but it was one of the features XML removed in the process of simplification.)

XInclude is an emerging specification from the W3C that endeavors to create a mechanism for building large XML documents out of their component parts which does not have these limitations. XInclude can combine multiple documents and parts thereof independently of validation. Each piece can be a complete XML document, a part of an XML document, or a non-XML text document like a Java program or an e-mail message.

Read the rest of this entry »