05/21/2003: A Simple Extensible Command-Line Interpreter in Java
I’ve found command-line interpreters are useful tools. Especially interpreter’s that can read commands from both files and keyboard. I’ve used such interpreter’s for printer manipulation, database and object creation, and other tasks. I can hear someone saying, ‘Use Ant’, but creating Ant tasks can be a daunting proposition at first. So the class presented here is simple, simple, simple so that beginning java developers can use it.
This simple command-line interpreter is extensible and easy-to-use as shown in test code below. The source code for the command line class is about 500 lines and is available at http://www.codebits.com/java/CommandLine.java.
CommandLineTest.java
package com.affy.utils.cmdline; import java.io.BufferedReader; import java.io.FileNotFoundException; import java.io.FileReader; import java.io.InputStreamReader; import java.io.Reader; import java.io.StreamTokenizer; import java.util.Vector; /** * This class shows how the CommandLine class * can be used. It initialized a CommandLine object * and defines a FOO command. Notice that this class * (CommandLineTest) acts as both test harness and * command executor. When run, you'll be presented with * a command-line prompt. Type 'foo bar baz' and you'll * see the output from the doIt() method. Type 'aaa aaa aaa' * and you'll see an error message. Command-line parameters * with spaces need to be quoted. * * @author medined * Created on May 20, 2003 */ public class CommandLineTest implements CommandLine.ICommand { /** * Shows how to use the CommandLine class. * @param args The command-line parameters * @throws FileNotFoundException */ public static void main(String[] args) throws FileNotFoundException { // This technique of reading from either // a script file or // from the console was 'borrowed' from BeanShell. Reader inputSrc = null; if ( args.length > 0 ) { inputSrc = new BufferedReader( new FileReader(args[0]) ); } else { inputSrc = new InputStreamReader(System.in); } // initialize the command line object. CommandLine jr = new CommandLine(); jr.setCommandLinePrompt("Command> "); jr.setCommandLineVersion("Command Line v.01"); jr.assignClassToCommnd("foo", "com.affy.utils.cmdline.CommandLineTest"); jr.init(); if ( args.length > 0 ) { jr.setIsInteractive(false); } // parse and execute commands. jr.parseStream(new StreamTokenizer(inputSrc)); System.out.println("\nDone."); } /** * This method is invoked when the FOO command is * used. */ public boolean doIt(Vector v) { System.out.println( "Inside CommandLineTest.doIt(); v=" + v ); return true; } }
05/10/2003: Bordeaux Trip
In 2003, I spend a great week wine-tasting in Bordeaux, France. This is the tale of my trip. I was 40 years old and between jobs having left the imploded Cordiem just three months prior. Armed with the address of the United States Embassy, I journeyed alone.
The following is not great prose just a travelogue.
2003 May 10
4pm EST - I’ve arrived at the Hotel de Normandie (7 cours du 30 Juillet, 33000, Bordeaux, France) with 240 Euros. The trip was extremely smooth. On the trip from Dulles to Paris, I sat with a bright teenager who creates ASP websites. His mom works in bioinformatics.
1am EST - I took two walking excursions to eat time waiting to catch up to Paris time - walking for about three hours total. I plan to sleep in about an hour (about 8pm local time). Right next to the hotel is a ferris wheel, a flower shop, and an antique show. The show had many sandwich shops and a couple of wineries. I bought two small bottles for 3 euroes each. I found a 2000 port that I’ll probably buy and the same wine shop has a case of 1994 Fonseca port. One shop had carved wooden elephants that my daughter would love.
2003 May 11
The tub has no shower curtain, yet there is a spray nozzle. How do I use it without spraying the whole room? 205 euros left. Largest purchase was 10 euroes for a french dictionary and phrase book. Only one person was even midely rude to me. Ironically enough it was the proprietor of an internet cafe which caused me not to spend money to sent an “Hello From France” email to my wife. On the other extreme, one of the vineyard booths was so nice. A nine-year old boy spoke a few words of English and so did his father.
I like having the window open for fresh air and to hear the sounds of the city - voices, cars, and bicycles.
I rented a GSM phone at Dulles for $20/week. Incoming calls to France are free and my wife was able to reach me last night.
11:30 EST (5:30 pm local) The leadership of the group, Lauri Ann, just arrived. We’ll be meeting in the lobby at 7:30pm. I will be very hungry by then.
2003 May 12
First day of wine tasting. We all loaded onto a bus for the 45 minutes drive to the Libornais. My first impressions were that the vines are very short - less than three feet high. And there is usually just one or two buildings on the property. There are over 9,000 chateaus in France, so its hard to learn about all of them. The wines that we are visiting do not encourage guests - just a few tour operators and people in the wine business.
2003 May 13
Interestingly enough, I preferred the barrel tasting of Le Mission Haut Brion more than Haut Brion because it was more drinkable now. I can see buying a case then drinking a bottle every two or three years to see how it ages. The Haut Brion wine is more powerful (tannic) and balanced - but its price is high. Le Saprien was excellent - wide table and the view encompassed quiet vineyards so it was a restful place. The first coure of dinner was asparagus with mushrooms in filo dough. The La Mission vineyard had immaculate ground and intricate bushes.
Chateau d’Yquem is truly unique. Standing on the edge of the vineyard looking down at seven other chateau’s show why d’Yquem has its own classification. It’s on the highest point in Sauternes. The morning fog, from the river, the afternoon sun and wind combine to form perfect climatic conditions. Every year is suspenseful because of the risks they take to pick the grapes. The picking is always done by hand. One year they picked eleven times whereas a normal harvest is three to five times. The wine always blows away the competition with its explosive fruit and honey flavors.
Dinner was at one-star Jean Ramet restaurant. It was excellent. One of our group did not finish the appetizer of aspargus (rolled in breadcrumbs with a great sauce). The lady in charge asked me to finish the plate so the chef would not be upset. There was a vegetable pizza with garlic ice cream. Sounded strange to my American ears but it was yummy.
Christopher, the owner and winemaker at Chateau Acapella in St Emilion, is one of the most passionate people I have met. He bought a two hectacre plot and is breaking many traditions. He used special vats that are wider than talll and maserates by hand (punching the cap). He doesn’t have a cellar so he used a fish tank device (inserted ito each barrel) to control temperatures. He’ll make 6,000 bottles to be sold for 20 euros. Quite nice. The wine won’t be on the market for two years and we might never see any in the U.S.
Considering the price range of the wine we are tasting (normally over $100 per bottle), this tour is a great value. I’m very impressed by its price in relation to the food and wine.
NOTE: d’Yquem always releases 110,000 bottles per year and they have a lot of inventory in their caves.
2003 May 14
The village of St Emillion has some very steep hills and lots of wine shops. I don’t understand how the shops stay in business since they sell most the same wine. There are a few craft shops. I picked up a little gift for my wife. We tested five(!) wines at Chateau Conan Le Gaffaliere - from 90% yo 45% merlot. My preference was the more approachable (less tannic) wines since I need something to drink while waiting for the superior wines to age. Lunch was great. I was introduced to Kir which is sweet white wine mixed with black currant. The La Gaffaliere winery was just getting started and used new technologies with the wine. The vat room and cellar gave the impression of newness.
Chateau Belair was a magnificient place to visit. They have 25 acres of vines and thirty acres of tunnels on several levels. The wine barrels are stored in the tunnels creating a sense of oldness as one walks underground - even though I knew the barrels were less than 18 months old.
We were told tales about people hiding in the caves during World War I and World War II. It’s easy to imagine people hiding in empty wine barrels in a pinch.
During the maseration process solids float on top of the wine. About four times a day, the wine is poured through the wine so that it takes the essences of the fruit pulp.
Lunch was guinea hen, strange mushrooms, and potatoes
Dinner was sardines and a small quiche from Champion Market.
1999 Chateau Belair, Dubous-Challon, Premier Grand Cru Classic - very good, needs at least ten years in bottle to mature.
2003 May 15
The museum was small but wonderful. All items had some connection to wine. Two items that stood out for me (we had only 15 minutes to look) were ivory about 24” high carved with satyrs and vines. The other piece was a green jade teapot about seven inches high. I was suprised to learn that Mouton-Rothchild produces 300,000 bottles per year. We tested 2002 of all three Chateaus and they were good but probably way out of my price range. There was a lovely dank cellar with very old bottles. I learned they sell bigger sizes of bottles - Nebuchanezzer and Jerobow. Also they trade with other chateaus for cellaring.
Lunch was a lemon-dill smoked salmon. Also beef with a sweet pepper sauce and dessert was a light chocolate cake.
Then to Chateau Cos D’estournal (Cos S, 33180 Saint-Estèphe, France) with its unusual architecture built in 1830 reflecting Indian, Chinese, and Arabic influences. The 2002 used 3% CabFranc with happens once every 10 years. The 2nd wine was Les Pagodas de Cos.
Chateau Margeux had 100,000 1st wine bottles and 200,000 2nd wine bottles. Tasted the 1997 (at 149 euros!) - not a great year but well-balanced.
Side Note - copying my notes in 2017 (14 years after the trip) it’s amazing to see the Chateaus using Google Maps.
Chateau Poujeux
- 1998 - Chateau La Salle de Poujeaux - 2nd wine
- 1999 - Moulis-en-medoc
- 1997 - recommended!
- 1982 - perfectly fine to drink.
Wines at dinner
- 1999 - Chateau Peynon - Bordeaux Blanc
- 1998 - Chateau Larriuet-Haut-Brion - Pessac-Leogna
- 1998 - Chateau Pichon Longe Vale Contesse de LaRande
- 1998 - 2nd wine - Pauillac Reserve de la Comtesse
2003 May 16
Visited a wine store - http://www.chateauclassic.com - They had some very old windws - 1883 Y’quem and 1900 port - They had 1963 and 1977 Barao de Vilar. Also saw a Chateau Pichon Longueville.
In St Julien, we visited Chateau Langon Barton. They had a large garden and big roses.
- 2002 - floral, dark, soft tannins
- 2002 - Chateau Leoville Barton - soft round tannins
Lunch
- 1998 Chateau Petite Bocq from St Estephe
Chateau LaTour - has most technology, produces 300,000 bottles per year
- 2002 - Paulillac Eschantillo, 50/50 cab/merlot, good in four years
- 2002 - LaFoits DaLatour
- 2002 - good balance, structure, nice finish, dark purple
Chateau Palmer - uses barrells for only three years. Replaces 1/3 each year.
- 2001 - Eschtillon Peleve - wow!
- 1996 - yummy! 100 euros
- 1994 - not tasted - 84 euros