BRAxe to fall at Fort Monroe

satellite image of ft monroe

According to the Associated Press (via the Washington Post), the BRAC axe is finally falling on Fort Monroe, one of the country’s oldest military installations and the coolest one near my childhood home. Here’s my hometown paper’s take, together with some good photos of the fort, its moat, and a reminder of its Civil War past.

Construction on the fort started in 1819, the same year that the ground was broken in Albemarle County for the University of Virginia. According to the official history of the fort, the current fortifications succeeded a series of colonial era defenses on the site, called Point Comfort, including Fort Algernourne, which was built in 1609 by the original Jamestown settlers. The fort was made obsolete by the introduction of long range bombers and aircraft carriers, but survived until this last round of base closings as a training command.

I will always remember Fort Monroe for the community Fourth of July shows, which generally featured live musical entertainment (both jazz bands and military brass), culminating with a brass band performance of the 1812 Overture complete with field artillery and followed by fireworks.

The Unofficial Homepage has some good information about the base (and a lot of broken links). Map of Fort Monroe; satellite image from Google Maps; satellite image from TerraServer.

The History Channel, coming to a neighborhood park near you

Looks like our favorite Robbins Farm Park is going Hollywood. We got fliers yesterday announcing that “a History Channel production will be taking place” there today and tomorrow. I’m not used to getting these sorts of notices, so was amused by some of the text (emphasis mine):

…The documentary we are filming requires battle scene re-enactments. There will be yelling, campfires, and sword fighting.

Ah yes, the great Broadsword Battle of Menotomy! Good to know that the History Channel guys are plumping for authentic locations.</sarcasm> Anyway, I’ll see if I can get photos tonight or tomorrow.

Architectural cow skulls in Boston and Virginia

Adam at Universal Hub wrote about some cool architectural grotesques around Boston today. One that caught my eye was the cow skull on the Boston 5 Cents Savings Bank. As I wrote in the comments, this isn’t a gruesome ornament but a classical one, which also appears in Jefferson’s architecture at the University of Virginia:

The drawing that Jefferson prepared for Pavilion II carried the notation that the order was based on the Ionic of the Temple of the Fortuna Virilis in Rome, which was illustrated in plates in The Architecture of A. Palladio; in Four Books. One of the distinguishing features of this order is that the volutes of the capitals at the outer corners of the columns are positioned diagonally at the ends of the portico. The Temple of Fortuna Virilis has a frieze of ox skulls, putti, ribbons, and garlands festooned with fruit motifs, which were also used in Pavilion II.

I wonder what the thematic significance of the ox skull was originally.

Reinstalling again

Another morning lost to rebuilding the machine. I asked the IT guys at my office to allow me to upgrade to Windows XP from 2000, and they did—alas, something went awry and the install created an entirely new system directory. So I’m reinstalling services and trying to find installation disks, and basically just trying to get things back to normal. It is nice to be back on XP, though.

Transforming XML with XPath in SQL Server

Since the next version of SQL Server (2005, aka Yukon) is at least nominally coming out this year, it seems a bit late to write a tip about using the XML features in SQL Server 2000. However, better late than never.

As part of a project I’m working on, I needed to bring XML data into our production database for subsequent processing. The XML document that our partner’s application provides is what I would consider “loosely typed”—all the useful information about the data contained within is defined outside the actual schema. For an example, say the canonical sample XML document is written like this:


<ROOT>

<Customer CustomerID="VINET" ContactName="Paul Henriot">
 <Order CustomerID="VINET" EmployeeID="5" OrderDate="1996-07-04T00:00:00">
  <OrderDetail OrderID="10248" ProductID="11" Quantity="12"/>
  <OrderDetail OrderID="10248" ProductID="42" Quantity="10"/>
 </Order>
</Customer>
<Customer CustomerID="LILAS" ContactName="Carlos Gonzlez">
 <Order CustomerID="LILAS" EmployeeID="3" OrderDate="1996-08-16T00:00:00">
  <OrderDetail OrderID="10283" ProductID="72" Quantity="3"/>
 </Order>
</Customer>
</ROOT>

In the flavor of data description used by our partner, the same document would be written like this:


<ROOT>
<Customer CustomerID="VINET" ContactName="Paul Henriot">
 <Order>
  <OrderAttribute rawname="EmployeeID">"5"</OrderAttribute>
  <OrderAttribute rawname="OrderDate=">"1996-07-04T00:00:00"</OrderAttribute>
   <OrderDetail>
    <OrderDetailAttribute rawname="OrderID">"10248"</OrderDetailAttribute>
    <OrderDetailAttribute rawname="ProductID">"11"</OrderDetailAttribute>
    <OrderDetailAttribute rawname="Quantity">"12"</OrderDetailAttribute>
   </OrderDetail>
...
<ROOT>

That’s only slightly unfortunate; after all, XML is meant to be transformed, and if you wanted to turn the sample into sensible row-and-column data for a relational database you could use the features provided in OPENXML to do so.

Ah, but it turns out the XPATH syntax needed to transform the data (using the ColPattern mapping in the OPENXML) is slightly nontrivial. To extract the text of the elements, you need the text() function, which must be called after the predicate specifier. That is, if your OPENXML statement looks at the /Root/Customer/Order/OrderDetail branch, rather than writing OrderDetailAttribute/text()[@rawname="Quantity"] to get the value of the quantity of the order, you need to write child::OrderDetailAttribute[@rawname="Quantity"]/text(). (Note: If you wanted to include details from both the order and orderdetail branch, you actually have to specify child:: rather than SQL Server’s shorthand, otherwise you get a crossproduct.) (see below)

Anyway, once you have the correct XPath sequence, the rest is relatively trivial. The stored procedure below accepts the XML document as a parameter (you need to do this, generally speaking, unless you know that the XML document will be smaller than 4000 characters in size, since SQL Server 2000 doesn’t let you use local variables of type TEXT) and transforms it into a rowset, ready to be inserted into the database or otherwise manipulated:


CREATE PROCEDURE dbo.import_xml
	@xmldoc text
as
	DECLARE @hdoc int

EXEC sp_xml_preparedocument @hdoc OUTPUT, @xmldoc

--let's peek at the rowset

SELECT * FROM 
OPENXML (@hdoc,'/Root/Customer/Order',1)
 WITH (CustomerID varchar(300) 
'../@CustomerID', EmployeeID varchar(30)
'OrderAttribute[@rawname="EmployeeID"]', OrderID varchar(300)
'OrderDetail/OrderDetailAttribute[@rawname="OrderID"]', ProductID varchar(30)
'OrderDetail/OrderDetailAttribute[@rawname="ProductID"]', Quantity varchar(30)
'OrderDetail/OrderDetailAttribute[@rawname="Quantity"]') exec sp_xml_removedocument @hdoc GO

which produces, for the sample file excerpted above,

CustomerID EmployeeID OrderID ProductID Quantity
VINET 5 10248 11 12

This is probably old hat to those of my readers who know what the hell I’m talking about, but it was eye opening and nonobvious to me.

Update: Corrected after some input from a reader who knew better than I what the hell I was talking about (thanks, Michael Rys). As it turns out, you don’t need the text() function; the XPath shown above will correctly pull the text in the node once you’ve written the predicate correctly. Nothing to see here; move along.

New music Tuesday: Spoon

Man. I wish the iTunes Music Store folks would get their acts together and consistently update the New Releases and Just Added pages. As a music addict, I generally await Tuesdays like I await my first cup of coffee in the morning, and I just can’t get going without my fix. So it’s a good thing that the store’s banner ads at least are up to date; they advised me that the new release from Spoon, Gimme Fiction, is available.

I was looking forward to the release because the lead single, “I Turn My Camera On,” was excellent—a bit like an indie white boy version of Prince, only more swagger-y. But after the disappointment with the new music listings, I thought, I wonder if it’s available at eMusic instead? Sure enough. And buying a fifty-song booster pack let me download the album, plus recordings by Ali Farka Toure, Gene Ammons, Red Garland, and Material for just a few dollars more than the Spoon album by itself would cost at the iTMS.

Also available, and according to Fury worth hearing, is the new recording of Pierre Boulez conducting his own Le Marteau Sans Maitre. (And thanks to Fury for hipping me to the Gurgling Cod, which just got added to my list of favorite Boston area blogs.)

Finally, I happened to be in our local indy record store (okay, chain) this weekend, and found a copy of Godspeed You Black Emperor’s F#, A#, (∞) on vinyl, about which the band’s official discography page says it best:

initially limited to 500 numbered copies, then repressed. hand-made jacket, with one of three actual photographs glued on to the front. comes with a bag of goodies, including a penny flattened by a train. each track fills a side, and is made up of different pieces. side b runs out into a locked groove.

It is not a knock against the recording to say that last night, in a somewhat exhausted state, it took me about ten minutes to realize that the album runs out into a locked groove; the musical effect is quite consistent with the rest of that side. F#, A#, ∞, indeed. But what a cool album (even without the bag of goodies). And apparently, the only way to get the experience is on vinyl, since the band remastered and re-recorded portions for the 1998 CD release. (See the aforementioned discography page for some MP3 samples of the CD version.)

Mother’s Day … for peace?

The Reverend Dr. Nancy Taylor pointed out from the pulpit of Old South Church on Sunday that Mother’s Day has deep ties to Boston, and to progressive thought. Julia Ward Howe, the author of the words to the “Battle Hymn of the Republic,” called for the first Mother’s Day in 1870 as a day for peace, a protest against the carnage of war. (It was to take another 37 years to get an actual observance of the day, by which point it had morphed into a memorial day for mothers.) Here is Howe’s actual proclamation from 1870:

Arise, then, women of this day! Arise all women who have hearts,
whether our baptism be that of water or of fears!

Say firmly: “We will not have great questions decided by
irrelevant agencies. Our husbands shall not come to us, reeking
with carnage, for caresses and applause. Our sons shall not be
taken from us to unlearn all that we have been able to teach
them of charity, mercy and patience.”

We women of one country will be too tender of those of another
country to allow our sons to be trained to injure theirs. From
the bosom of the devastated earth a voice goes up with our own.
It says “Disarm, Disarm! The sword of murder is not the balance
of justice.”

Blood does not wipe our dishonor nor violence indicate possession.
As men have often forsaken the plow and the anvil at the summons
of war, let women now leave all that may be left of home for a
great and earnest day of counsel. Let them meet first, as women,
to bewail and commemorate the dead.

Let them then solemnly take counsel with each other as to the
means whereby the great human family can live in peace, each
bearing after their own time the sacred impress, not of Caesar,
but of God.

In the name of womanhood and of humanity, I earnestly ask that a
general congress of women without limit of nationality may be
appointed and held at some place deemed most convenient and at
the earliest period consistent with its objects, to promote the
alliance of the different nationalities, the amicable settlement
of international questions, the great and general interests of
peace.

Interesting that somehow in the intervening 135 years between the first proclamation and today, Mother’s Day became about flowers, candy, and lunch out… Dr. Taylor’s sermon on the topic was thought-provoking; hopefully it will get posted soon. (I really need to talk to her about blogging.)

(I’m about two days behind on my blogging; I was thinking about writing this on Sunday but didn’t quite get there.)

Stumps and saws and prybars

Lisa spent the weekend in our front yard doing “structural landscape improvements” (meaning pulling nasty hedges out by the roots), while I helped uproot some of the stumps while reversing the last bit of damage done to the house when we moved the fridge in.

First, the hedges: with such a small front yard, we decided it didn’t make sense to devote a lot of it to hedges—particularly to hedges that grow like weeds and lose all their leaves in a spectacularly ugly fashion in winter. So last weekend Lisa took a variety of pruning tools to them and cut them down to a few inches above the ground. This was a weekend’s worth of work in itself, particularly the part where we had to bag all the cuttings. Then on Friday Lisa took a day off and started digging the roots out. Almost all the hedges had taproots that were a foot long or more and several inches in diameter, which were impossible to dig out with shovels and very difficult to sever. Fortunately our neighbors stopped by and said, “We have a crowbar that might help you out.” Thanks, said Lisa, but we already have one. “Not like this you don’t,” said our neighbor, and came back with a five-foot-long solid iron bar that had to be about seventy years old. It was cylindrical at one end, but tapered to a rectangular form at the other end with a pyramidal tip. I had never heard of using a prybar for gardening, but it’s apparently a standard item in Roger Cook’s toolkit. I’ll upload a picture later.

With the prybar in hand, Lisa was able to lever out all the taproots unaided, leaving nothing but a few smaller, easily-extractable roots behind. I helped with some of the bigger root balls and did disposal work, but all in all the job went extraordinarily smoothly, which was good because I had other tasks to do.

I spent Saturday sanding the first coat of joint compound I had previously applied over the bare frame and drywall of our kitchen doorway, then applying a second skim coat. I was worried about making a mess with the sanding, but I found a useful ShopVac attachment that kept the dust from getting out of hand. I primed most of the new wall surface on Sunday, but I need to go back and make one more pass on one side where the compound didn’t smooth out the tape. Fixing the doorway left just one problem—the ceiling over the fridge.

Over the last few months we’ve kept looking at the gaping holes in the ceiling over the fridge (regular readers will remember we discovered them when I pulled down a cabinet to make room for the fridge). We had thought about putting up a patch, but after the pain of working with the backing board on the doorway we started contemplating other approaches. Late last week Lisa asked, “Why don’t we just re-mount the cabinet?” and I had to admit it seemed like the best approach. Unfortunately I needed to make the cabinet about an inch shorter, and I only had about 5/8ths of an inch extra trim above the top and below the bottom of the cabinet. So out came the Sawzall, which I used to trim a half inch from the top and the bottom of the cabinet. It was tight—in one or two places I accidentally planed a little off the top of the cabinet—but in the end it got it done. Then Lisa and I put the cabinet on a dolly and rolled it up and into the kitchen via our porch. The last step was the hardest, essentially a clean-and-jerk from the dolly straight up to the top of the fridge, but the cabinet made it and is now resting up there until I can re-secure it to the studs.

I dream of having a kitchen in which the Sawzall has no place. I think it will be a while before we’re there.

iChat issues in Tiger

The iChat issues I wrote about persist, despite the now-total absence of Virex from my machine. These threads on the Apple discussion board suggests that it is a fairly widespread problem. I’ve read every suggestion, from the mundane (do routine system maintenance and try again) to the exotic (delete some entries in the iChat plist file, make sure your correspondents apply all system updates), to the just plain superstitious (make sure you start iChat before you start any other application).

Me? I think this smells like insufficient testing on Apple’s part, and I’m looking forward to seeing the first post-Tiger iChat update.

Can you IM me now? Good!

Boing Boing: Space Needle to be converted to WiFi antenna. According to this KOMO TV story, Speakeasy (and two other firms) are teaming up to create a city-wide WiMax network that will eventually be available to individuals as well as businesses. Though I disagree with Boing Boing’s assertion that the Space Needle is a “white elephant” (the only other places with an equally cool Seattle views are Pike Place Market and Anthony’s Pier 66, and both of those have bay views rather than the incredibly cool Lake Union views), I can’t argue with the following:

Quinn Norton first observed that looking at some big weird chunk of metal (say, a Stanford radio-telescope) and saying “That would make a great WiFi antenna” is the twenty-first century equivalent of pointing at every hollow object and opining “that would make a great bong.”

Whither Mac anti-virus protection?

I’m starting to wonder a little about what I will do on my Mac for virus protection since Virex 7.5.x isn’t Tiger compatible. I’m apparently not alone in wondering. MrBarrett.com neatly summarizes the current Mac antivirus marketplace, and points out a few contenders I hadn’t considered, including Sophos (which is apparently only available to business customers) and ClamAV, which may be the only option to fill the gap between now and the vaporous release of Virex 7.7.

Solving ASP.NET application problems

I have been working with a partner of ours to get an ASP.NET web application running on my Windows 2000 computer at the office. We had no joy for several hours last night trying to figure out why none of the .aspx pages in the application could be contacted. We were getting an interesting error message:


Server Error in '/BogusAppname' Application.
----------------------------------------------------

The resource cannot be found.
Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

Requested Url: /BogusAppname/login.aspx

----------------------------------------------------
Version Information: Microsoft .NET Framework Version:1.1.4322.2032; ASP.NET Version:1.1.4322.2032

I had to give up with the guy from our partner company at 8 PM my time last night. This morning, I did some Googling and found an all-too-simple-sounding solution: the application wasn’t correctly registered as a virtual directory. I went to the IIS manager, created a new virtual directory with the same name as the directory I was trying to hit, and lo and behold the application started working.

The difference was only apparent in the properties dialog on the application directory. The virtual directories on the server had “Virtual Directory” as the first tab on the properties dialog, but our application directory had “Directory”.

Perhaps this will save someone’s thinning hair.