Sunday, October 23, 2011

Kähler and Miscanthus sinensis ‘Zebrinus’

Kähler and Miscanthus sinensis
In today’s pots and plants series, Kähler meets Miscanthus sinensis ‘Variegata’. This Kähler vase we picked up a while back not knowing much about it, but the stylized leaves and glossy finish were, and still are, very appealing. For more on the history of Kähler, see this post: Kähler and Colchicum. The bottom is incised HAK and Danmark.

The zebra grass, Miscanthus sinensis ‘Variegata’ is been a favorite in the yard for years. Unfortunately, its position isn’t the greatest - north side of the house with limited sun - so it struggles a bit. Miscanthus is from the Greek mischos (“stalk”) and anthos (“flower”) referring to the spikelets [from Calfora.net]. The genus name refers to the fact that this grass is native to eastern Asia; sinesis is Latin for “of or from China”. The cultivar ‘Zebrinus’ refers to the conspicuous yellow spots on the leaves and stalks reminiscent of a zebra. An Asian grass with an African twist meets a Danish pot?

Kähler MarkingKähler and Miscanthus sinensis

Saturday, October 22, 2011

Curious Naturalists

Curious Naturalists Back CoverCurious Naturalists Front Cover
The Curious Naturalist is a book by Niko Tinbergen (1907 - 1988) that was first published in 1958. The edition discussed here is a reprint of the revised 1973 text. The book covers the time period from the late 1920s to the 1950s during which Tinbergen became an eminent Dutch ethologist (one who studies animal behavior) and ornithologist (one who studies birds). Tinbergen was a co-winner of the 1973 Nobel Prize in Physiology or Medicine. His prize speech of December 12, 1973 is interesting because in it, he credits observation - the central theme of Curious Naturalists and really of Tinbergen’s career - as a critical factor for winning the prize. The speech starts off talking about the “unconventional decision” to choose three men (Tinbergen, Konrad Lorenz, Karl von Frisch shared the prize) who were, in some sense, outside the field and whose work was that as “mere animal watchers”. He argues in the speech that observation can in fact bring a lot to bear in physiology (citing the then still relatively new ideas that became the Alexander Technique) and medicine (observations on autism). It’s not clear how the observations have held up in time.

So what is a naturalist? A naturalist conducts scientific research of plants and animals with observation being his main research tool. That doesn’t mean that the naturalist doesn’t experiment and test things, just that a strong emphasis is placed on observation. In fact in the book, the typical pattern of the research that Tinbergen presents starts with an observation period of an animal, followed by some rather simple, yet ingenious experiment or alteration to the animal’s environment, and further observation of the animal with the new environment. A typical example is the work he describes on the Beewolf, Philanthus triangulatum, in the first few chapters. At first, Philanthus is observed to understand the basics: each female Beewolf wasp has one burrow and returns with bees for the larvae inside. But how does Philanthus find its burrow entrance? Landmarks seem to be the key, so different aspects of Philanthus’s homing skills (finding their way back to their burrow) are tested by placing different objects (landmarks) around burrow entrances. The tests become more elaborate and the response of the insects is watched. In a few tests, all the natural landmarks near burrow entrances are move elsewhere to mislead the Beewolf and it works. Tinbergen writes “[a]t the end of such a series of tests I replaced the landmarks in their original position, and this finally enabled the wasp to return to her home. Thus the test always had a happy ending - for both of us. This was not pure altruism on my part - I could now use the wasp for another test if I wished.”

Some of the species discussed include:

- Beewolf wasp, Philanthus triangulatum, the spark that really got Tinbergen started.
- Sand wasp, Ammophila campestris
- Moths, Ennomos alniaria and Ennomos quercinaria
- Moths, Biston betularia betularia and the difference between morpha typica and carbonaria
- Grayling moth, Eumenis semele (Hipparchia semele)
- Black-headed Gull, Chroicocephalus ridibundus,
- (Black-legged) Kittiwake, Rissa brevirostris

It’s interesting to note that Tinbergen didn’t title the book Curious Naturalist, singular, and instead used the plural, Naturalists. I think it points to his desire that this book isn’t so much about him, singularly, but about us, plural, and that we could all benefit from being a curious naturalist. And upon reading this book, it would strike me as odd if you didn’t approach observation of your surroundings - be they an urban lot or deep-woods - a little differently and with a little more respect. But, I suppose if you pick up this book, you are already bent this way and Tinbergen just pushes you a bit more.

One fun aspects of the book are the many photos and illustrations. The photos aren’t glamourized, just naturalists poking around in the field. The illustrations often involve some form of abstracted field observation, observation setup, or results and are engaging to look at. Here is an example where two of Tinbergen’s students study the homing behavior of the sand wasp, Ammophila campestris, which climbs shrubs or small trees, takes a survey, and then jumps in the direction of her nest with prey (a caterpillar) in its grasp. The illustration below shows paths home for one wasp and that a strong learned “long” path.

Curious Naturalists Illustration for Sand Wasp Homing

 

Connections

I decided to read the Curious Naturalists after reading an excerpt of it in The Oxford Book of Modern Science Writing (2008) edited by Richard Dawkins, who incidentally was a student of Tinbergen. While reading the Naturalists I kept thinking of a bike ride on the Waterland route from Amsterdam to Marken we took in 2004. I remember being struck by the beauty of the polders, waterways, farms, and wooden houses. The route is across Zuider Zee where, on the south end (in Hulshorst) Tinbergen studied Philanthus.

Another point of connection is that I started the Curious Naturalists before taking a trip on the Wainwright Coast to Coast Walk and finished it when I returned. Chapters 7 - 9 are set in Ravenglass, in Cumbria. Ravenglass is just a few kilometers south from St. Bees where we started our walk.

After I finished the book it struck me how much room for improvement I have for making good observations. I went on the Wainwright walk with the goal of identifying plants (one a day) and while I was able to do that (see western botanical guide and eastern botanical guide), there were many cases that I didn’t do basic things like count petals, examine leaves, make notes on the surroundings and, in general, just take the time to observe.

On a related note, while on the Wainwright walk I saw many rabbits that succumbed to myxomatosis. Tinbergen mentions the disease in Chapter 7 in regard to the vegetation of the dunes of Ravenglass which seemed to be recovering because of the reduced rabbit (“undiscriminating vegetarian”) population - killed by myxomatosis.

Sunday, October 9, 2011

Kähler and Yucca gloriosa ‘Variegata’

Kähler Vase and Yucca gloriosa ‘Variegata’Kähler Vase and Yucca gloriosa ‘Variegata’
In today’s pots and plants series we have Kähler meets Yucca gloriosa ‘Variegata’. We’ve had these three yucca in the ground for about 15 years now. Each year we trim off the bottom leaves and over time the yucca are now a foot or two off the ground and the trunks are visible. Yucca gloriosa has the common name of Spanish Dagger. If you ever have worked around these plants, you’ll know that dagger is apt. While trimming the leaves shown above, we got pierced several times. The daggers are sharp and quick, like a needle – when they pierce your skin. Another common name for this plan is Moundlily because it grows in mounds along the sand dunes along the coast and barrier islands of the southeastern USA (distribution map). In some of the pictures here bloom spikes can be seen.

This year’s trimmed off leaves are shown in - we believe - a Kähler pot created some time in the first half of the 20th century. (Someday, we are going to buy a book that tells us what the true dates are…) The vase has is mostly tan with a green leaf motif. It has a mark that looks like HAK, but the mark is hard to make out. For more on Kähler, see Kähler and Colchicum.

Kähler Vase and Yucca gloriosa ‘Variegata’Kähler Vase and Yucca gloriosa ‘Variegata’

Yucca gloriosa ‘variegata’ – SeattleYucca gloriosa 'variegata'

Java, Apache Ant and Hello World

Hello World with Java and Ant, Build File
This post discusses the following tasks:

  • Task 1: How to create a simple Hello World Java application and run it from the command line
  • Task 2: How to build a JAR and use the JAR to run the Hello World application
  • Task 3: How to use Apache Ant to create a build file for the Hello World application
  • Task 4: How to build a Hello World application, using an external library (log4j), at the command line
  • Task 5: How to create an Apache Ant build file for a Hello World application that uses an external library
  • Task 6: How to pass arguments into the Hello World application using the build file

We must say that scarcely 4 months ago, this was all Greek to us. And through a recent job change, I was plunged into the world of Ant and Java. We are mostly documenting this because it was amazing how long it took to get these basics straightened out and we want a place to come back to and use as a cheat sheet!

(Once we saw a boat called Hello World in Shilshole Bay Marina. When we asked the owners if they were programmers one said yes, mentioning that not many people get the name.)

So Java is a popular programming language. And Ant is, from the Apache Ant Project site: “…a Java library and command-line tool whose mission is to drive processes described in build files as targets and extension points dependent upon each other. The main known usage of Ant is the build of Java applications.” Using Ant to build a Java application is what we show here. The tasks shown here take their cue from the Hello World with Apache Ant instructions on the Apache Ant web site. We created this post because we felt there was more room for clarification.

Testing environment for this post:

  • Windows 7
  • Java 1.7 for x64 (download)
  • Apache Ant (binaries, install instructions)
  • Environment variables set as follows:
    • JAVA_HOME=C:\Program Files\Java\jdk1.7.0
    • JRE_HOME=C:\Program Files\Java\jdk1.7.0\jre
    • ANT_HOME=C:\tools\apache-ant-1.8.2
    • Path={your full path};C:\tools\apache-ant-1.8.2\bin;C:\Program Files\Java\jdk1.7.0\bin

After you have everything set up, you should be able to you open a command prompt and type

    ant –help

to get the help for Ant.

Task 1: How to create a simple Hello World Java application and run it from the command line

1. Create the following directory structure (where [basedir] is some directory you choose).

[basedir]\src\packagename
[basedir]\build\classes
[basedir]\build\jar

2. Create a file HelloWorld.java and put the following inside of [basedir]\src\packagename directory.

package packagename;
public class HelloWorld {
public static void main(String[] args) {
System.out.println("Hello World");
}
}


3. Compile and run the application using the following commands. Run the commands while in [basedir].

javac -d build\classes src\packagename\HelloWorld.java
java -classpath build\classes packagename.HelloWorld


The second statement runs the application by calling the class file. If you get an "Unsupported major.minor version" check that your java.exe and javac.exe are the same versions. For example, check "java -version" and "javac -version".



Task 2: How to build a JAR and use the JAR to run the Hello World application



It’s more realistic to build a Java Archive (JAR) file which makes it easily to distribute your awesome Hello World application.

1. Create a manifest file. The command below assumes you create the manifest file in [basedir].

    echo Main-Class: packagename.HelloWorld>myManifest

2. Create the JAR. (Don’t miss the “dot” at the end of the command.)

    jar cfm build\jar\HelloWorld.jar myManifest -C build\classes .

3. Run the application using the JAR.

    java -jar build\jar\HelloWorld.jar


Task 3: How to use Apache Ant to create a build file for the Hello World application



The following XML file is a build file. Copy the text below and put into a file called build.xml at the root of the HelloWorld application ([basedidr]). To invoke the build file, type “ant” at the command line. This runs the main target in the build file. A target in the build file is a container for tasks. To run other targets in the build file type “ant targetname” like “ant compile” to compile. Note that the project tag defines the default task as main. The main task in turn depends on the clean and run task. The run task in turns depends on the jar task. Finally, the jar task depends on the compile task. So the cascade of dependencies catches all the targets.

<project name="HelloWorld" basedir="." default="main">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="main-class" value="packagename.HelloWorld"/>

<target name="clean">
<delete dir="${build.dir}"/>
</target>

<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}"/>
</target>

<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>

<target name="run" depends="jar">
<java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
</target>

<target name="clean-build" depends="clean,jar"/>
<target name="main" depends="clean,run"/>

</project>



Task 4: How to build a Hello World application that takes an input argument and uses an external library (log4j), at the command line



Now let’s jump back to doing everything by hand and let’s suppose we want to introduce an external library, log4j. Log4j is a library that provides a flexible logging framework.


1. Modify the Hello World application as follows:  

package packagename;
import org.apache.log4j.BasicConfigurator;
import org.apache.log4j.Logger;

public class HelloWorld {
public static Logger log = Logger.getLogger(HelloWorld.class);
public static void main(String[] args) {
BasicConfigurator.configure();
log.debug("hi there from the logger");
System.out.println("hello world " + args[0]);
}
}

2. Add the log4j-1.2.16.jar (or whatever version you are using) to the \lib folder.

3. Compile and run the application using the following commands.

    javac -d build\classes src\packagename\HelloWorld.java
    Error. We need to specify the path to the log4j JAR.

    javac -classpath lib\* -d build\classes src\packagename\HelloWorld.java
    Successful compile.

    java -classpath build\classes packagename.HelloWorld
    Error. Again, we need to specify the path to the log4j library.

    java -classpath build\classes;lib\* packagename.HelloWorld tester
    Successful run.

The output is "hello world tester" and a logging message "hi there from the logger". Details about the command options for the java and the javac commands are on the Oracle Tool Doc site.


4. The directory should look like this after successful compilation.



[basedir]\build
[basedir]\build\classes
[basedir]\build\classes\packagename
[basedir]\build\classes\packagename\HelloWorld.class
[basedir]\build\jar\HelloWorld.jar
[basedir]\lib\log4j-1.2.16.jar
[basedir]\src
[basedir]\src\packagname
[basedir]\src\packagename\HelloWorld.java

5. Let’s now continue and suppose, like we did in Task 2, that we want to run the program using the .jar. In Task 2 it was easy since we had no external libraries. In this task we do and it adds a wrinkle. As discussed here mindprod.com, if we use "-jar" when using java.exe to invoke the jar,
the -classpath is ignored. In order to run the program using the jar we need to put a Class-Path entry in the manifest file. The Class-Path entry points to the external jar (log4j in this case).



a. Add the Class-Path line to the manifest file. You can reuse the manifest file from Task 2.  Note the “>>” in the echo command below which mean append the line to the manifest file.

echo Class-Path: ../../lib/log4j-1.2.15.jar>>myManifest

b. Create the JAR. (Don’t miss the “dot” at the end of the command.)


jar cfm build\jar\HelloWorld.jar myManifest -C build\classes .


c. Run the application using the JAR. (Don’t forget the input argument!)

java -jar build\jar\HelloWorld.jar tester


Task 5: How to create an Apache Ant build file for a Hello World application that uses an external library


The next tasks is how to modify the Apache Ant build file for the external library we added.

Changes from above:



  • add property name lib.dir


  • add path element for classpath to include jars in lib.dir


  • in the compile target add classpathref to use the classpath which points to the extnernal library JAR. This corresponds to Successful compile above.


  • modify run task (and this is the crux of the matter) so that it refers to both the main-class and finds the project jar and uses the classpath with the JARs in the library. This is very different than just a simple jar with no external libraries.This corresponds to Successful run above.


The revised build file:

<project name="HelloWorld2" basedir="." default="main">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="lib.dir" value="lib"/>
<property name="main-class" value="packagename.HelloWorld"/>

<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<target name="clean">
<delete dir="${build.dir}"/>
</target>
<target name="compile">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
<target name="run" depends="jar">
<java classname="${main-class}">
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
</java>
</target>
<target name="clean-build" depends="clean,jar"/>
<target name="main" depends="clean,run"/>
</project>



Details on the Java task page in the Ant documentation. Compare, just a project JAR run task:

<target name="run" depends="jar">
<java jar="${jar.dir}/${ant.project.name}.jar" fork="true"/>
</target>



With a run task using an external library:

<target name="run" depends="jar">
<java classname="${main-class}">
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
</java>
</target>



Task 6: How to pass arguments into the Hello World application using the build file




Suppose we change the HelloWorld program output line to include a passed in argument:

System.out.println("hello world :" + args[0]);


Compiling and running by the command line:

    javac -classpath lib\* -d build\classes src\packagename\HelloWorld.java
    Success.

    java -classpath build\classes;lib\* packagename.HelloWorld
    Error. We didn’t pass in an argument or catch the exception.

   
java -classpath build\classes;lib\* packagename.HelloWorld "travelmarx"
    Success. We passed in an expected string “travelmarx” to give a value to args[0].

With the build file, we only need to change the run task and add an arg element.

<target name="run" depends="jar">
<java classname="${main-class}" >
<classpath>
<path refid="classpath"/>
<path location="${jar.dir}/${ant.project.name}.jar"/>
</classpath>
<arg value="travelmarx"/>
</java>
</target>


Passing parameters from the the command line to a build file is mentioned in the FAQ on the Apache Ant site.

Sunday, October 2, 2011

TugBoat Annie

TugBoat Annie Front CoverTugBoat Annie Back Cover
This post is about the book Tugboat Annie by Norman Reilly Raine, a Dell Book copyright 1932, 1933, and 1934 and Dell 192. The book was loaned to us from a descendent of the real life inspiration for Tugboat Annie, Thea Christiansen Foss (1857 – 1927), the founder of Foss Maritime.

The Tugboat Annie Dell book is just a few stories from the series that was authored by Norman Reilly Raine (1894 – 1971). He wrote 60 Tugboat Annie stories which appeared serialized in the Saturday Evening Post starting on July 7, 1931 and continuing for a span of 30 years. (The essay that appears in The Pacific Northwest Forum, Vol.5, Number 2 says that there were 75 stories and the first story appeared on July 11, 1931.) Raine is also known for the 1937 biographical film The Life of Emile Zola (1937) and as the screenwriter for the 1938 film The Adventures of Robin Hood (1938). Speaking of film, Tugboat Annie (1933) was a film based on the series. The movie was followed by Tugboat Annie Sails Again (1940) with Jane Wyman and Ronald Reagan, Captain Tugboat Annie (1945), and Tugboat Annie (1957) a Canadian TV Series. Who knew that public’s appetite for a “magnificent, blowsy, canny, raucous, hard-boiled, and heart-warming skipper” was so big? Tugboat Annie had quite a run, from the Great Depression and almost up to the hippies. We can see it now, Tugboat Annie Meets Timothy Leary: “ye furry-headed sprat!”

The Stories

The book contains six “Exciting” stories: No Cure, No Pay, Ol Mefoozelem, A Man of Few Words, When Greek Meets, Greek, The Last Laugh, and Iron John. Each story is between 20 and 30 pages. The two main characters we meet in these six stories are:

- Tugboat Annie Brennan, “blowsy, raucous, hard-boiled” senior captain at the Secoma Deep-Sea Towing and Salvage Company. Her tug is the Narcissus. Captain Terry Brennan is the deceased husband of Annie. She keeps a picture of him in a “plush-and-gold oval frame” above her bunk. She talks to the picture when she needs inspiration in her hijinks to outsmart Bullwinkle. Annie is “large of frame and solidly built, with rugged features and shrewd blue eyes under beetle brows. Her elephantine energy is galvanic, her language is sulphurous, her ways are tough – but her heart is as warm and as soft as butter.”

- Captain Horatio Bullwinkle, Annie’s rival. He is the captain of the Salamander. All the stories revolve around Annie’s successful attempts to beat back Bullwinkle’s tricks for taking business away from her. “He is a self-confident, swaggering, contemptuous, and scheming” man.

The supporting cast: Alec Severn, president of Annie’s company; Big Sam, engineer on the Narcissus; Old Mefoozelem, a crusty old land-locked captain; Murdoch McArdle, a shrewd lumber dealer; Captain Esau Leroy, Annie’s old friend who loves a good brawl; Mr. Levanway, a bland, scheming first officer of a large ship; and Iron John McGinnes, Annie’s old and diminutive friend who always gets the last word.

The Language

Annie is the master of mixed-metaphors and colorful one-liners often directed at Bullwinkle, her rival. He often is just as clever in the comebacks.

The comebacks and one-liners reminded us of the The Snark Handbook, Insult Edition: Comebacks, Taunts, and Effronteries by Lawrence Dorfman. Annie’s dialogue would fit in with the samples in the short chapter Smarts (Or Lack Thereof). For example:

“Does this rag smell like chloroform to you?”

“She doesn’t know the meaning of the word ‘fear’, but then again, she doesn’t know the meaning of most words.”

“The twinkle in his eyes is actually the sun shining between his ears.”

Anyway, here are some samples from this TugBoat Annie book:

p. 10 The first meeting between Bullwinkle and Annie as they are racing their tugs.

“Think ye’ll know me again, horse face?” Tugboat Annie bawled, when she found she could not eye him down.

He nodded. “Once seen, never forgot, worse luck Anyways, I’ve seen ye before.”

“Where?” demanded Annie.

“In the Frisco’ zoo.” He grinned again, and added, charitably, “Though it might ha’ been only a near relation.”

p. 15 Annie, talking to her boss Alec Severn:

“That Bullwinkle carbuncle!” she exploded. “He’s takin’ jobs from us, right and left and hindways.”

p. 18 Annie to Bullwinkle on what he should do.

“Me? I’d recommend a faddom o’rope and a rafter, and I’m willin’ to kick away the chair!”

p. 22 Annie to Bullwinkle.

“When I look at you … I know why barmaids eats their young.”

p. 48 Morning greeting between Bullwinkle and Annie.

“How are ye this morning, Annie?”

“I was feelin’ swell up to a second ago,” Annie told him. “But now I got a nasty black spot afore me eyes.”

“You ain’t eggzackly a pick-me-up-yerself, Annie.”

p. 73 Annie passing Bullwinkle on a street in Secoma.

“Hi, there, Annie!” saluted the detested voice of Mr. Horatio Bullwinkle. “What are doin’ – trottin’ some o’ your fat off?”

“Seein’ you reminds me – I’m goin’ up to buy some dog biscuit!” she snapped.

“Doctor’s orders?” asked Mr. Bullwinkle with a grin. “We got a nice beef bone down on the Salamander. If it’s any good to ye, just bark!”

p. 87 Annie to Bullwinkle.

“Don’t drop over the side,” Annie told him. “Ye’d spile the sound for fishin’.”

p. 94 Annie to Murdoch McArdle a horse-faced lumber dealer after he threatens her.

“Sticks and stones butters no parsnips, McArdle. Ye’d best be civil.”

p. 99 Annie to herself.

“My goodness, I’m that hungry I could eat a horse and chase the driver…”

p. 102 Annie talking about a friend, Captain Esau Leroy.

“Trouble with Esau is, he’ll fight at the drop of a hat – and he ain’t so pa’tickler about the hat.”


Happy Days are Here Again

Annie’s “theme” song seems to be Happy Days are Here Again, written (or at least copyrighted) in 1929 by Milton Ager (music) and Jack Yellen (lyrics). The lyrics go like this: “Happy days are here again. They skies above are clear again. So let’s sing a song of cheer again. Happy days are here again.” Tugboat Annie’s version is: “Oh, happy days are here some more…. And, she roars it inharmoniously.

First Page of Tugboat Annie

The Thea Foss, A Motor Yacht.
The Thea Foss

The Bashing of Bullwinkle by Harold Von Schmidt [ref]
The Bashing of Bullwinkle by Harold Von Schmidt

Tugboat Annie by Anton Otto Fischer – March 13, 1939 Saturday Evening Post [ref]