Archive for January 2007

Riding the BART back to SFO

26 January 2007
Categories: Transportation

I like the BART, even if the grungy upholstered seats do creep me out a little. There are several details to aid passengers that show that some good thought was put into it…

  • Computer-generated voices tell not only what kind of train is boarding, but also how long the wait will be until the next several trains arrive.
  • The voice is female for platform 1 (southbound) and male for platform 2 (northbound)—so once you’ve heard one announcement, for every one thereafter you instantly know as the announcement begins whether the info will be pertinent for your direction of travel.
  • Tactile warning strip along the edge of the platform, for the benefit of the visually impaired, changes colour and pattern (parallel bumps rather than diagonal, like the difference between the stars on 48- and 50-star flags) at the places where the doors of the train will be—and some of these have additional washboard strips further in from the edge, but only in the places where a 2-car train, the minimal length, will stop. That way those 4 door locations are always guaranteed to have a door.

Oddly, there are a number of things here that you don’t see on the CTA:

  • Prominent signs for fire extinguishers
  • Posted explanations for how to manually override the doors
  • A station sign showing the location of the emergency third rail cut-off

I’m sure all these things exist on the CTA (well, not sure about the extinguishers, but the door overrides and power cut-offs definitely do), but attention is not called to them—it would only serve as an invitation to tamper with them. Don’t know how many times I’ve seen some jerk pull the (unmarked) red ball to get off just a few seconds sooner than everyone else, or to make up for (nearly) missing their stop. Yet in San Francisco, knowledge of these items is boldly promulgated, and the public is trusted to use that information appropriately. Go figure.

Later, aboard the plane, I got to wondering… Why should the overwing doors not be used in the event of a water landing? And, if the bag dangling from the oxygen mask does not inflate, what’s it there for?

Minor tweak, major improvement

3 January 2007
Categories: Self-referential

On Tuesday, 2 January 2007, I made a minor update to my Blues Brothers map that both improved its function and reduced the number of extraneous image GETs.

The long of it… Previously, when clicking on a marker, the popup balloon would be undersized for the content. Part of the screen capture image and any text below it would be superimposed on the map rather than on a nice clean white background, making it hard to read. Clicking on the marker a second time would redraw the balloon in a proper size, but each click sends another GET command for the image (even though the subsequent clicks usually result in a “304 – not modified” response).

I was stuck on thinking that a fix would require some complicated and obscure tweaking of the Google Maps API, but the actual solution is mindlessly simple. My sudden realisation may be considered a dope-slap epiphany. When the balloon is first drawn, the image has not yet been downloaded, so the browser doesn’t know how big it is. It assumes that the image is 0 pixels high, and draws the balloon accordingly. (This seems like a silly assumption, but I suppose it’s better than assuming it’s 1000 pixels high.) Then the image is downloaded, and since it’s much more than 0 pixels high, it overshoots the bottom of the balloon. Follow-up clicks redraw the balloon, and now since the browser knows the image size in advance, the balloon is drawn in a proper size.

To fix it, all I needed to do was include the height of the image in its tag, thus giving the browser advance warning. I added another variable to the data set: iheight. The elegant part of this is that with only a few exceptions, all of the images are 100 pixels high. Therefore the iheight declaration only needs to be included in the exceptional entries. The code now checks for iheight==null, and if so automatically sets the value to 100. All the code to accomplish this only increased the total download size by 207 bytes. This margin is more than absorbed by a reduced need to click twice on each marker.

By early Wednesday morning, the logs were showing success. A visitor arrived and viewed nearly every marker on the map—yet only clicked once on each.