escutcheon

Ursa Major: The Oldest Story in the World

Since at least the early 1900s it has been recognized that there is a curious similarity between Eurasian and North American myths associated with the seven major stars of what is generally referred to as The Big Dipper. The most common motif involves a bear, which is of course the theme of Ursa Major, “The Great Bear”, the constellation of which the Big Dipper makes up the most significant portion.

Ursa Major

Ursa Major

In all likelihood, the story derives from a common source in Asia that spread through migration across the Bering land bridge. This is a rather staggering conclusion. If the linguistic and genetic trees derived by L.L. Cavalli-Sforza can act as a guide, the common ancestor of this myth may go back well over 20,000 years.

Its stars seem to have been called the Bear over nearly the whole of our continent when the first Europeans, of whom we have knowledge, arrived. They were known as far north as Point Barrow, as far east as Nova Scotia, as far west as the Pacific Coast, and as far south as the Pueblos.

- Stansbury Hagar, “The Celestial Bear”, The Journal of American Folklore (JAF), Apr.-Jun., 1900

Occasional local names notwithstanding, the possibility of the bear as Ursa Major having originated independently is inconceivable. Classical Old World mythology is replete with the bear in its role as Ursa Major. Ancient Greek, Hebrew, and Arabic all contain references to this motif.

- William B. Gibbon, “Asiatic Parallels in North American Star Lore: Ursa Major”, JAF, Jul.-Sep., 1964.

The power of the bear motif can be seen in the very word “bear” itself, which is derived from an Old Germanic word meaning “the brown one.”

Linguists hypothesize that in old common Germanic, the true name of the bear was under a taboo — not to be spoken directly. The exact details of the taboo are not known. Did it apply to hunters who were hunting the bear and did not want to warn it? Or to hunters hunting other animals and did not wanting to rile up the bear and have it steal their prey? Or did it apply to anyone who did not want to summon the bear by its name and perhaps become its prey? Whatever the details, the taboo worked so well that no trace of the original *rkto- word remains in Germanic languages, except as borrowed historically in learned words from Greek or Latin.

» Posted: Sunday, December 17, 2006 | Comments (8) | Permanent Link
fleuron

A Switch on String Idiom for Java

There is no way to perform a true switch on a String in Java. This seemingly trivial bit of functionality is common to many other languages, but has been frustratingly absent (to some) from Java. Various techniques have been offered that involve hashing, Maps, etc., but they are all overly complicated and generally not worth the trouble. With the advent of JDK 5.0 and its implementation of enum, a reasonably close approximation of this can be done using the following idiom. Create an enum using the default integer-based mapping, e.g.:

public enum Day
{
    SUNDAY, MONDAY, TUESDAY, WEDNESDAY, 
    THURSDAY, FRIDAY, SATURDAY; 
}

Given this enum, the following switch statement could be used:

switch (Day.valueOf(str))
{
    case SATURDAY:              
    case SUNDAY:
        // weekend processing ...
        break;
    default:
        // weekday processing ...
}

Enum.valueOf() matches the given String to the actual enum name using the same basic hashcode() matching technique that earlier proposals have suggested; but with this idiom, all of that machinery is generated by the compiler and Enum implementation. The set of possible String values is also maintained in a more structured way when held in an enum.

Of course, the above suffers from the serious drawback that Enum.valueof() can throw an unchecked IllegalArgumentException or NullPointerException. The only real way to get around this issue is to create a new static method that absorbs these Exceptions and instead returns some default value:

public enum Day
{
    SUNDAY, MONDAY, TUESDAY, WEDNESDAY, 
    THURSDAY, FRIDAY, SATURDAY,
    NOVALUE;

    public static Day toDay(String str)
    {
        try {
            return valueOf(str);
        } 
        catch (Exception ex) {
            return NOVALUE;
        }
    }   
}

Then the switch can be written to include a default clause that handles unexpected String values:

switch (Day.toDay(str))
{
    case SUNDAY:                
    case MONDAY:
    case TUESDAY:
        // etc ...
    default:
        // any non-Day value
}

While not quite as compact as the first technique, this is more robust and offers the possibility of performing case-insensitive switching also by calling, for example, toUpperCase() in the convert method after first checking the passed-in String for null.

» Posted: Friday, December 8, 2006 | Comments (67) | Permanent Link
fleuron

Plain Vanilla

An exerpt from the book Fast Food Nation by Eric Schlosser originally appeared in the Atlantic Monthly under the title “Why McDonald’s Fries Taste so Good”. While the entire piece was eye-opening, one particular aspect of it sparked a memory of another article, this one on ingredient fraud, which was remarkable in its own right.

Vanillin

The Vanillin Molecule

As Scholsser points out in his piece, the specific molecules that make up particular food flavorings are exactly the same whether they are labeled “natural” or “artificial”. The only difference between them is the ultimate source of the molecule itself. Those derived from natural sources are “natural”; those that are man-made are “artificial” even though they are precisely the same:

“A natural flavor,” says Terry Acree, a professor of food science at Cornell University, “is a flavor that’s been derived with an out-of-date technology.” Natural flavors and artificial flavors sometimes contain exactly the same chemicals, produced through different methods. Amyl acetate, for example, provides the dominant note of banana flavor. When it is distilled from bananas with a solvent, amyl acetate is a natural flavor. When it is produced by mixing vinegar with amyl alcohol and adding sulfuric acid as a catalyst, amyl acetate is an artificial flavor. Either way it smells and tastes the same.

In Roald Hoffmann’s article “Fraudulant Molecules” in the Summer 1997 issue of American Scientist, he described the remarkable lengths to which some counterfeiters will go in order to secure the “natural” label. Quoting from an article in New Scientist:

[The] French food industry would need ten times as many vanilla pods as it actually imports to account for all the “‘natural” vanilla that companies claim is in milk products alone.

Clearly artificial vanilla was being fraudulently sold as natural vanilla; since the natural variety commands 200 times the price, it’s easy to understand the motivation behind the fraud. As there is no difference in the vanillin (the key molecule in vanilla) at the molecular level, methods of detection that exploit anomalies in constituent atomic isotopes have been devised. Of course, the counterfeiters responded with ever-more esoteric techniques to avoid detection.

  1. The first method involved detecting the ratio of naturally occurring radioactive carbon, 14C, which is continuously created in the upper atmosphere and absorbed by living material. Non-living material sees its level of 14C decay to 13C with a half-life of 5,730 years. (This is the process exploited by radio-carbon dating). The forgers responded by loading extra 14C to their petroleum-based precursors.
  2. Scientists then turned to the subtle differences in the ration of 13C and 12C which is it slightly lowered by the process of photosynthesis occurring in the vanilla plant. Once again, the forgers responded by applying appropriate amounts of 13C.
  3. Since it turned out to be most economical of add the additional 13C at a particular location on the vanillin molecule, its overabundance at that location could be detected using a technique called SNIF-NMR, that is, site-specific natural isotope fractionation by nuclear magnetic resonance.

At some level this has become almost comical. Humans cannot detect any difference in taste, and the split between the labels “natural” and “artificial” has become almost as artificial as the “fake” molecules themselves.

» Posted: Saturday, December 2, 2006 | Comments (1) | Permanent Link