Tuesday, September 18, 2007

At Work

It's purest trivia, but Margaret Bamberger sent a few photos of me at work, shooting panoramas on the ranch. It's not a perspective I've ever had before, not least because, like anyone without prehensile eyes, I can't see the back of my own head, which may be its best side.

The panorama being shot above was a complete failure, due to a wind that just would not stay gone long enough to let me shoot the whole thing before it resumed waving the near-field trees back and forth. And I waited hours. I did, however, manage to shoot that scene successfully months later: Bamberger Ranch, Jacob's Ladder Tank, David's Overlook. If you've seen the book Water from Stone, that's the scene David and his dog would have seen from their location in the sketch on page 46. Except that those bloody trees hadn't grown large enough to be in the way, back then. It must have been a much better view without them.

The panorama I was on my way to shoot in the photo above, "Bamberger Ranch, West Slope Middle Grassland, no. 2", turned out very well, I think, and after only two takes. I had to be careful to walk out into the hip-high grass in such a way that my trail would not be visible in the pano, so I moved along the fence first, then zig-zagged my way into the scene.

That panorama will be one of the four that I'll have on display (and on sale) at the Lady Bird Johnson Wildflower Center, from October 6th to November 11th. I wish I'd been able to show more than four, but those 60" X 18" archival-grade canvas prints are expensive, and four was about all I could manage. If they sell well, I'll be able to print additional works for future shows. If not, ouch ... but the walls of my house have never looked better. By the way, all of Margaret's sketches from Water from Stone, and then some, will also be on display/sale, including the aforementioned item on page 46.

Friday, September 14, 2007

Exhibition goes Bamberger-free

I've just learned that our exhibition of Bamberger Ranch-related drawings and photographs, which opens October 6th, at the LBJ Widlflower Center, will be a Bamberger-free zone on opening day, even though the core of the show is Margaret Bamberger's drawings. Unfortunately, more pressing business, in the form of Margaret's cancer treatments, has undone our best laid plans.

Nuts.

(And good luck, Margaret.)

That misfortune notwithstanding, all of the planned works, Margaret's included, will be on display on day one (and available for purchase, by the way). so the show will go on.

Thursday, September 13, 2007

Country Lifestyle article

I received my complementary copies of the October issue of Country Lifestyle magazine this afternoon. The article on the Bamberger Ranch uses eight of my photos, including five panoramas. Several of the panos are used as page background, so you can't get a good look at them, but they're there.

For the record, the pictures that include people (the Bambergers, specifically) are not mine. Those were taken by the article's author, Susan M. Sander. So, the credit should actually read something more like "most photos by Chris Johnson". That's not ideal, but it is a big improvement over the magazine's web site, which initially gave credit for the article to someone named "Beverly Burmeier" and credit for the photos to a "Scott Vallance".

Anyway, it's a nice article, and the folks at the magazine did a good job with the layout, so I'm pleased with the result. The curious among you can find the magazine at some of the larger book stores like Barnes & Noble. However, the distribution may be regional, so this may not apply to folks outside the general vicinity of Texas.

Wednesday, September 12, 2007

That's Java internationalization? Really?

In an effort to knock-off one last, major item from Qwicap's "to do" list before version 1.4 is released, I've begun trying to internationalize it. As I currently conceive the problem, this mostly involves removing from the code the error messages that Qwicap automatically adds to a web application's XHTML pages. For example, there's the message that the various numeric input retrieval methods (Qwicap.getInt, Qwicap.getDouble, etc.) add to pages when input is outside of the application-defined valid range of values: "The number must be in the range 0 to 100 (inclusive). The number '900' is not in that range." Complicating matters a bit is a standard feature of Qwicap that automatically replaces phrases like "The number" in such messages with the label of the relevant form control, as found in the web page, if there is such a label in the page.

I knew that there were internationalization features somewhere in Java (I'm using Java 1.5, by the way), but that's almost all that I knew. (I haven't made a serious effort to internationalize anything since my Macintosh programming days.) So, I worked my way through my colleagues until I found one who knew more than me on this subject, and doing some follow-on Google searches and related reading, I learned that the basic facility in Java for abstracting language-specific text from one's code is the ResourceBundle, and, typically, the PropertyResourceBundle subclass, which loads language/nation-specific text from a hierarchy of "properties" files.

So I now understood that, for a start, I needed to setup a properly named and formatted "properties" file for PropertyResourceBundle to discover and load. And the documentation for the PropertyResourceBundle class promptly referred me to the Properties class for information about character encoding issues. The main issue, it turns-out, is that the Properties class only supports one character set, ISO-8859-1. Therefore, if you need to represent any non-Latin characters, a cumbersome Unicode escape sequence must be used for each and every one of them. I find an internationalization "feature" designed without direct support for non-Latin characters tough to take seriously, and in a language like Java, which uses Unicode natively, such a design beggars belief. Of course, we all having things in our past that we wish we could go back and do differently. Maybe this is one such thing for the Java platform.

Fortunately, Java 1.5 added to the Properties class a method for loading "properties" from XML files, and XML can be represented in any character set, since the XML declaration (for example: <?xml version="1.0" encoding="UTF-8"?>) can tell an XML parser how its characters were encoded. It appeared that the problem was solved.

Of course, the problem wasn't really solved, because it turns-out that the PropertyResourceBundle class does not support XML "properties" files. The solution to that problem seemed to be creating a subclass of ResourceBundle that does support them. And creating that subclass looked straightforward at first glance - just create appropriate implementations of the abstract methods handleGetObject and getKeys, then declare victory. Unfortunately, doing so is nearly useless, because the static ResourceBundle.getBundle methods that implement the hierarchical search for language- and/or nation-specific resource bundles, and which then instantiate the list of appropriate ResourceBundle subclasses that are necessary to represent the hierarchy of potentially applicable resource bundles, have their choice of subclasses hard-coded into them. So, they can instantiate the built-in ListResourceBundle and PropertyResourceBundle classes, and nothing else.

Having come that far, I couldn't admit defeat, however, so I took the time to completely re-implement the ResourceBundle.getBundle(String, Locale, ClassLoader) method in my subclass. I thought that that would finally do the trick, but, I was wrong again, because I'd forgotten that static methods can't be overridden, they can only be hidden. Which meant that the lesser implementations of ResourceBundle.getBundle (getBundle(String) and getBundle(String, Locale)) were still invoking the original implementation of getBundle(String, Locale, ClassLoader), rather than mine. That left me feeling dumb, but creating my own implementations of those lesser getBundle methods would be a piece of a cake, and, with all of the original implementations hidden, I would finally have a subclass of ResourceBundle that looked and acted just like a normal ResourceBundle, but which supported XML "properties" files. So that's what I did (mistaking the light that was drawing ever nearer for the daylight at the end of the tunnel).

At this point, it should go without saying that that didn't work, which it didn't. My IDE almost immediately pointed-out something that I hadn't noticed in the API documenation: the two lesser getBundle methods are marked final, and therefore can't even be hidden by the methods of a subclass. For some reason the primary getBundle method isn't final, but the two little convenience methods that front-end for it, are final. Like so many other aspects of my day's dalliance with internationalization, that seems utterly pointless to me, but there it is.

The only good news at that stage was that hiding those two methods didn't really matter, since I was only going to use my subclass of ResourceBundle internally, and I know to use my implementation of the getBundle method when instantiating it. In fact, having already re-written all of the hard parts of the ResourceBundle class well enough for my purposes, I didn't even need to subclass ResourceBundle anymore; I could pretty much just remove the "extends ResourceBundle" phrase from my class' declaration and be done with it.

On the other hand, the main reasons for not implementing my own resource scheme from scratch at the beginning were (1) the belief that by using the familiar mechanism represented by the ResourceBundle class, other developers would have an easier time understanding my code, if the need ever arose, and (2) the hope that somewhere under all that rubbish lay a core of undiscovered, but wonderful, internationalization functionality, from which my code would benefit. There's some sense to the former concern, but the latter appears to be utterly groundless; if there is anything wonderful below, I haven't found it, and I don't see anywhere left for it to hide.

The niftiest feature associated with using "properties" files for internationalization that I'm aware of, is that the internationalized text can contain MessageFormat patterns. However, that feature is orthogonal to the Properties and ResourceBundle classes, which make no use of MessageFormat, and therefore leave it as an exercise to the developer to make his/her MessageFormat patterns do anything.

By the way, the documentation for the Properties class says of its loadFromXML method and the XML files that it loads: "the system URI (http://java.sun.com/dtd/properties.dtd) is not accessed when exporting or importing properties; it merely serves as a string to uniquely identify the DTD". This turns out to be somewhere between "misleading" and "wrong"; either that DTD really is accessed, or a local copy of it is used instead, because the rules in that DTD are enforced when loadFromXML reads XML. Which makes the XML support in the Properties class useless for my purpose, because the strings that Qwicap needs to make internationalizable frequently contain elements of XHTML markup. Those XHTML elements are well-formed (in the simple sense that any start tags are matched by corresponding end tags), so they would pose no problems for an XML parser that wasn't trying to enforce the rules in a DTD, but, sadly, that is not the case here.

Qwicap's XML engine made implementing my own support for XML "properties" files a trivial matter, but the end result of doing so was that, of the three Java classes that appear to be the cornerstones of Java of internationalization (ResourceBundle, Properties, and MessageFormat), I had to re-implement two of them to get an internationalization capability that was useful to my application.

Maybe my requirements are unusual, but they boil down to nothing more than supporting encodings other than the obviously limited ISO-8859-1 for my application's internationalized text, and needing to include XML (specifically XHTML) elements within some of that text. Neither requirement strikes me as remarkable individually, or in combination.

I'm new to Java internationalization, so it's easy to believe I'm missing something. Please set me straight if I am. If I'm not, put me down as lightly stunned by the substantially roll-your-own character of the Java platform's internationalization "solution".

Friday, September 7, 2007

Shooting Perseids in Armadillo Central

I went out to the Bamberger Ranch to do a bit of Perseid watching—and, with luck, photography—shortly after midnight on August 12th. Unfortunately, the peak of the shower was a day later, but on the plus side, the conditions were perfect when I went out, and the conditions for the peak were forecast to be partly cloudy.

Wanting a picturesque old windmill to include in the photos, and reasoning that the highest point on the ranch had to be a good vantage point, I headed-up to the area of the ranch known as the "red pens". As I bumped along the gravel road leading up there, I was surprised to be delayed by traffic. It was dark, squat, short, and moving at about one mile per hour. I could only see its back end. As it walked, there were flashes of light alternating right and left as the headlights reflected off of the light-colored pads of its feet. I couldn't figure-out what it was, but it plainly didn't consider pickup trucks to be among its natural enemies, and deference was due, since I was the one trespassing on its home (the approvals for my visit from the ranch staff, notwithstanding). Our encounter lasted several minutes before the critter veered off onto a trail through the several-foot-tall grass alongside the road. As it turned and vanished into the grass, I finally realized what I'd encountered: a porcupine. Somewhere in the back of my head I knew that they lived in these parts, but this was the first time I'd ever seen one.

Once the traffic let-up, I completed my journey to the windmill and began setting up my gear: camera, cable release, tripod, and a cheap, folding lounge chair that I'd acquired earlier in the day. I'd chosen a spot out in the grass that silhouetted the windmill against a slightly illuminated patch of sky, just to make sure that it showed-up clearly in the photos. With an f1.8, 20mm lens focused on infinity, and the camera set for 30 second, ISO 400 exposures, I locked-down the shutter release button on my cable release, and let the camera take back-to-back raw exposures for the next three hours, when the battery finally gave-out.

During that time, I laid out flat on the cheap lounge chair, relaxed, and did my best to watch the whole sky for meteors. The night was splendidly quiet, in a way that is still a little surprising to this city boy. But I hadn't picked that spot for its quiet, I had picked that spot (leaving aside the windmill for a moment) in the hope that the population of rio grande leopard frogs living in the circular concrete watering trough nearby would sing while I counted meteors. As I occasionally walked back to my truck for one thing or another, I could see them piled-up on the rebar cage that protects the float valve which is the center of their world, both literally and figuratively. I could also see them scattered here and there on the concrete lip of the trough, and floating at the surface of the water. I worried at first that I might frighten them all back into the water, but most of them just went about their regular business of sitting very still and staring at things. That regular business should also have included mating, and the prelude to that should have been singing, but apart from one tentative grunt, they were a complete disappointment. Maybe that bunch of frogs never does much singing; when your world is only about six feet in diameter, you may not need to sing in order to find a mate; you may not need to do anything at all.

One of those Rio Grande Leopard Frogs from a previous visit to the windmill

Though the frogs were a let-down, something out in the thick grass around me was making sounds from time to time, and it wasn't the crickets. No, this was something that made a sort of muted snort from time to time, a bit like something clearing its nose. The snorts always came from different locations, yet there was no sound of movement through the grass in-between snorts. It was a pleasant little mystery as I counted meteors and the camera clicked away the hours. In time, however, there was a snort from only about three feet away to one side, near where my camera bag sat, and the tripod was setup. That, I thought, ought to be something I can investigate, and ought to investigate before it blunders into the camera equipment. With a red-light flashlight, I illuminated the grass over on that side and saw nothing, but I soon noticed that at the foot of my lounge chair, there was a large armadillo nosing its way through the thick grass. Amazingly, to me, its progress through the grass was silent. Apart from the occasional snorts that I'd been listening to all night, it didn't make a sound. My armored acquaintance gave my chair a quick sniff, decided it was neither friend, nor foe, nor dinner, and continued on its way, seemingly completely indifferent to my presence. Apart from wishing that I'd had the foresight to stop at the grocery store and pickup a box of armadillo treats before heading out to the ranch, I was enormously pleased to have not just seen, but more-or-less met an armadillo – a species that most of my fellow Texans and I encounter exclusively as road kill.

It must be armadillo central up there, because variations on that encounter continued. In one case, I found an armadillo working the grass under the lounge chair I was laying on; in the red light of my flashlight, I saw it through the cheap, transparent vinyl of the chair. It looked up, gave the vinyl a sniff, then silently sauntered away into the grass. Before I gave up meteor watching that night, there were a total of four armadillo visitations.

But what of the meteors? I counted about 80 in the three plus hours before the camera's battery finally gave-out. I was dead tired by that time, but might have changed the battery and continued, had I not found that the lens had completely fogged-up with dew over the course of the previous hours. Fortunately, it turned out that the dew only ruined the last hour of photos, and I did catch a few meteors in the preceding time. I have yet to take my definitive meteor picture, but I did add one more photo to my tiny collection of almost-acceptable meteor shots, as you can see below. Click to see the larger version of the image; theses almost-acceptable meteors don't put on enough of a show to look good in thumbnails.

Friday, August 31, 2007

Going Pro - Come and See

No postings in quite a while. There's been the traditional, higher-ed process of bracing everything for the start of the fall semester, riding out that tidal wave, assessing the damage, and beginning the rescue and recovery operations. There was also the usual end-of-the-fiscal-year, use-it-or-lose-it vacation problem. The two problems overlap, of course, just to keep it interesting.

Vacation, and whatever spare moments I've had since then, have been devoted to photography. For one thing, I took the time to recompute all of my panoramas in order to bring them all in line with my current standards. For another, it seems that I'm going pro. A selection of my photos of the Bamberger Ranch will be appearing in the upcoming issue of Country Lifestyle magazine. I provided a collection of photos for them to choose from, and I remain uncertain just what has been chosen, or how they'll be used, so there're elements of suspense and apprehension in that matter. More significant than that, in terms of outlays of my own time, money and labor, are the preparations for the first official showing of my work. It will be running from October 6th to November 11th at the Lady Bird Johnson Wildflower Center's McDermot Learning Center. The show is dedicated to the Bamberger Ranch, and Margaret Bamberger's drawings are the focus of the show, but Kathleen Marie and I will be joining Margaret with a selection of our works from the famous ranch, since there's much more to those 5,500 acres than any one of us (or all of us put together) can capture.

The show opens in the morning, a few hours before the start of the fall, members-only, native plant sale. You don't have to be a member of the Wildflower Center to attend the show's opening, but if you want to proceed to the plant sale when that starts, you'll have to be (or become) a member. Somehow, I'd always imagined an art show's opening as a fancier affair, in the evening, with a bit of wine and food thrown in. Well, we ain't that fancy. The closest we'll get to making an event of this is at 10:30 AM on October 12th when David Bamberger will be giving a presentation about his 40 years of land and habitat restoration work at the ranch. There will also be a book signing for Water from Stone. The author, Jeffrey Greene, won't be there, but his subject matter (the Bambergers) will be; they'll be the ones doing the signing. Unfortunately, that's a Friday, so it's far from convenient for most of us who have to work for a living. As usual, my expectations fail me.

Preparing for this show has been a learning experience, and an expensive one. (And I'm sure there'll be other expensive lessons to come.) The immediate problem is having works to show. The only time one of my panoramas has been printed is as a bookmark that the Bamberger's give out when they're at events like the aforementioned book signing. Now, I suddenly need prints suitable for gallery display and sale. I've elected to use a process that prints on canvas, and which, in principle, could print my panoramas almost 13 feet long, and 3½ feet high. The prints I'm having made for the show will be of more mild-mannered proportions: 5 feet by 1½ feet. Darn big, but minor compared to what could be arranged for a sufficiently deep-pocketed client. (Hint, hint.) The inks, canvas, and coatings are all archival grade - I looked up the test data a while back, and, if memory serves, they're expected to last about 100 years before any noticeable fading begins, assuming appropriate handling, of course. That's as good as, or slightly better than, the best photographic paper I've dealt with. Printing on canvas has several other qualities that are more immediately appreciated: the prints have the texture one expects from paintings, but not photographs. The weight of the inks and coatings that are used adds to the painting-like quality of the final product. So, while everything about the images says "photograph", everything about the prints says "painting". The ambiguity is interesting and tends to draw viewers in for a close look. And the level of detail in these panoramas rewards close looks. More practical features of this process are that the works do not require the enormous weight or expense of framing - they are mounted on stretcher boards, just like a painting, and are immediately ready for hanging.

Yesterday, I picked-up the first two prints from the Kirchman Gallery in Johnson City. Seeing them for the first time, and seeing them properly lit and hanging in a gallery, was a bit of a shock. I've spent so many days working with each of these images that I know them like the back of my hand, but only from their appearance on computer displays. I had expected them to look good in the real world, but ... well ... wow. And the lack of a frame turns out to have another virtue that I hadn't suspected - works of this size are framed by the wall they hang on; no mere picture frame can enclose them visually. They don't accent a wall; they take possession of it. My advice to anyone who ends-up owning one of them is to paint the wall to accent the print. The bucket of paint costs nothing compared to the print, and you'll see what I mean about the wall serving the print, rather than vice versa.

Seeing the prints was a pleasant shock, but then came the painful part - paying for them. I have no doubt that I'm getting my money's worth, but if these prints don't sell, their divot is going to persist in my savings for some time. There are two practical effects of this that will be noticeable at the show: First, I will only be displaying four works. (Of course, they'll collectively cover 30 square feet of wall space, which is nothing to sneeze at.) And, second, while final prices haven't been set, I think they'll have to be priced in the neighborhood of $1,300 a piece. If that makes it sound like I'll be making a healthy profit, rest assured that you are mistaken. Ignore all of my equipment costs. Ignore the years spent learning this craft (not that the learning has stopped). Ignore the time spent finding and shooting the scenes. Ignore the days (sometimes many days) of work required to pick the right take, transform its eighteen separate images into a single panorama, and then to work with it, over and over again, to bring out the best in the scene. No practical price for these works can begin to make a dent in any of those expenses, unless, by some miracle, they sell in startling quantities. Just forget all of that. The immediate problem is avoiding ending-up out-of-pocket on any print that sells. With galleries normally taking 40-50% off the top, and the expense of the prints, the sale price of any work doesn't let me cover the cost of printing with enough left over to print a replacement image for the next show. I'll have to dig into my savings again to do that, albeit not quite as deeply as this first time around.

The experienced artists I've spoken to in recent months confirm that this situation is typical. The main prerequisite for artistic endeavors, it seems, is a good day job.

•  •  •

Not that I'd want to give-up my day job in any case; The University of Texas is an institution I'm proud to be a part of, and, although no-one outside the trade knows it (and no one inside the trade can agree about how it should be judged) software development is also an art - one that I have no intention of giving up.

(Which reminds me: the new version of Qwicap is almost, but not quite, finished, as is a related blog entry about character set handling in web applications and browsers. I really must find the time to get that new version wrapped-up and into developers' hands.)

Tuesday, July 3, 2007

Twenty 42s

My recent work on Qwicap has concentrated on character set issues, first concerning the loading of XML/XHTML markup, and now concerning receiving input from browsers. I've learned a lot. For instance, unlike output sent to a client, input sent from the client in HTTP includes no provision for identifying the character set. You can, of course, add an "accept-charset" attribute to the "form" elements in your web application's pages, but there's no guarantee that the client will support the character set you specify, unless you confine yourself to ISO-8859-1. You could try inferring the client's supported character sets from the "accept-charset" headers of its HTTP requests, but then you would almost always be lied to, because most browsers throw in a wildcard that means that they accept all official character sets. Since there are currently 254 of those, what do you suppose the chances are that a browser sending that wildcard really supports them all? Zilch, in my tests.

The icing on this particular cake is that a Java application server is required to provide your web application with the client's input in the form of Java String objects, via the ServletRequest class. How can the application server reliably translate the input bytes it receives into the Unicode characters that will populate those String objects? Not knowing the character set used to encode the characters represented by those bytes, it can't, but the API requires that it blunder ahead with String creation regardless.

Twenty 42s

All of these character set torments led me to take a close look at the first 65,536 characters of Unicode, you know, for fun. Did you know that among those characters there are twenty ways to represent the number, just to pick one arbitrarily, forty-two? There are. And that's assuming that you don't mix-and-match amongst languages. If you do, there are 400 representations. Specifically, in those first 65,536 Unicode characters, there are twenty discrete groups of characters for representing decimal digits. Your browser probably doesn't even have a font containing glyphs for all of them, but here are those twenty forty-twos, along with their character codes expressed in hexadecimal:

420xFF14 and 0xFF12
᠔᠒0x1814 and 0x1812
៤២0x17E4 and 0x17E2
፬፪0x136C and 0x136A
၄၂0x1044 and 0x1042
༤༢0x0F24 and 0x0F22
໔໒0x0ED4 and 0x0ED2
๔๒0x0E54 and 0x0E52
൪൨0x0D6A and 0x0D68
೪೨0x0CEA and 0x0CE8
౪౨0x0C6A and 0x0C68
௪௨0x0BEA and 0x0BE8
୪୨0x0B6A and 0x0B68
૪૨0x0AEA and 0x0AE8
੪੨0x0A6A and 0x0A68
৪২0x09EA and 0x09E8
४२0x096A and 0x0968
۴۲0x06F4 and 0x06F2
٤٢0x0664 and 0x0662
420x0034 and 0x0032

By the way, the Java methods for converting from strings to binary numeric values, like Integer.parseInt, accept all of those character sequences as valid inputs, as well as all of the cross-language mixes. Worth thinking about if you have a web application that accepts numeric inputs. And the fun doesn't stop with decimal digits; for instance, you can find a replication of most of ASCII between 0xFF00 and 0xFF60.

What's the point? Nothing in particular, except to reinforce the general warning that one is ignorant of character encoding issues at one's peril. (Before you ask, no, neither my software's handling, nor my understanding, of these issues is perfect; that's why I know a little something about the "peril" part.)