Shallow Thoughts : : Apr

Akkana's Musings on Open Source Computing and Technology, Science, and Nature.

Sat, 29 Apr 2006

The Hayward Fault -- Exposed!

Today was opening day for the Hayward fault!

Well, okay, the fault itself has been there a while, but it was opening day for the Hayward Fault: Exposed! exhibit in Fremont. They've dug a trench into the Hayward fault as part of the 1906 San Francisco Earthquake Centennial activities, so people can walk a stairway and stand right in a fault and see what it looks like.

I'm a volunteer docent for the exhibit: one of the people who help answer questions about the fault, the trench, and earthquakes in general, and who also help with details such as setup, safety, and getting people to sign the liability waiver as they enter the exhibit. (My photos and fault facts here.)

Opening day was a bit hectic even aside from the usual opening-day flutters because it was a big day in Fremont Central Park: there was a huge manga festival at the Teen Center right next to the fault trench, complete with live band all day, and over at Lake Elizabeth at the other end of the park was the annual "Splashdown" rubber ducky race.

We expected chaos. But we didn't get it: everything went surprisingly smoothly. We got lots of visitors who were there specifically to see the fault, not just spillover from the other events: apparently it had gotten press on the TV news and several newspapers. There may also have been word of mouth advertising: a surprising number of the visitors I talked to were CERT volunteers or otherwise actively involved in bay area disaster preparedness programs. They were already very well informed about seismic hazards and earthquakes, and eager to see the fault for themselves.

We ended up with about 600 visitors (perhaps a fourth to a third of them teens from the manga festival). Everyone was very well behaved, asked good questions and seemed to appreciate the exhibit. It's lovely to volunteer at exhibits where you spend all your time answering questions, chatting with people and explaining the exhibit, not worrying about policing people and enforcing rules.

(Well, maybe there was a little bit of chaos. The band at the manga festival included karaoke. It's not every day that one gets the opportunity to try to explain paleoseismology and radiocarbon dating while someone a few feet away is belting out "Bohemian Rhapsody" over a loudspeaker but forgetting the words.)

We were pleased to see that everyone spent a lot of time around the (excellent) poster displays from the USGS, which cover everything from earthquake preparedness to stratigraphy of this particular trench to geologic maps of the Hayward fault and the bay area. Most people missed the parking lot displays on the way in (a sign pointing to cracks in the pavement and an offset curb, highlighted with orange spray paint), but we told them what to look for so they could catch them on the way out.

The exhibit will get more press tonight: two or three different TV channels showed up today and interviewed Heidi Stenner, the USGS geologist organizing the exhibit, as well as some of the visitors. So with any luck we'll continue to get good turnouts. The trench will be open through the end of June.

Most of the other docents are either seismologists or seismology graduate students. It wasn't a problem: the questions most people were asking were straightforward questions I could answer easily. But it was fun listening to the other docents and learning from them, and when someone asks a tricky question, you sure can't beat being able to turn to the researcher who did the original study on this trench in 1987 (Jim Lienkaemper) and get the straight scoop! (He also developed the USGS Virtual Tour of the Hayward Fault web site).

The Hayward fault last let go in 1868, a magnitude-6.9 event called "The Great San Francisco Quake" until the 1906 earthquake on the San Andreas took over that title. Trench studies like Lienkaemper's have shown that historically this fault has a large earthquake every 130 to 150 years. Our visitors didn't need a calculator to do the math.

Tags: ,
[ 23:46 Apr 29, 2006    More science/geology | permalink to this entry | ]

Tue, 25 Apr 2006

Firefox for Presentations: Hiding the URLbar

I've long been an advocate of making presentations in HTML rather than using more complex presentation software such as PowerPoint, Open Office Presenter, etc. For one thing, those presentation apps are rather heavyweight for my poor slow laptop. For another, you can put an HTML presentation on the web and everyone can see it right away, without needing to download the whole presentation and fire up extra software to see it.

The problem is that Mozilla's fullscreen mode doesn't give you an easy way to get rid of the URL/navigation bar, so your presentations look like you're showing web pages in a browser. That's fine for some audiences, but in some cases it looks a bit unpolished.

In the old Mozilla suite, I solved the problem by having a separate profile which I used only for presentations, in which I customized my browser to show no urlbar. But having separate profiles means you always have to specify one when you start up, and you can't quickly switch into presentation mode from a running browser. Surely there was a better way.

After some fruitless poking in the source, I decided to ask around on IRC, and Derek Pomery (nemo) came up with a wonderful CSS hack to do it. Just add one line to your chrome/userChrome.css file.

In Firefox:

#toolbar-menubar[moz-collapsed=true] + #nav-bar { display: none !important; }

In Seamonkey:

#main-menubar[moz-collapsed=true] + #nav-bar { display: none !important; }

This uses a nice CSS trick I hadn't seen before, adjacent sibling selectors, to set the visibility of one item based on the state of a sibling which appears earlier in the DOM tree.

(A tip for using the DOM Inspector to find out the names of items in fullscreen mode: since the menus are no longer visible, use Ctrl-Shift-I to bring up the DOM Inspector window. Then File->Inspect a Window and select the main content window, which gets you the chrome of the window, not just the content. Then you can explore the XUL hierarchy.)

This one-line CSS hack turns either Firefox or Seamonkey into an excellent presentation tool. If you haven't tried using HTML for presentations, I encourage you to try it. You may find that it has a lot of advantages over dedicated presentation software.

Addendum: I probably should have mentioned that View->Toolbars->Navigation Controls turns off the toolbar if you just need it for a one-time presentation or can't modify userChrome.css. You have to do it before you flip to fullscreen, of course, since the menus won't be there afterward, and then again when you flip back. I wasn't happy with this solution myself because of the two extra steps required every time, particularly because the steps are awkward since they require using the laptop's trackpad.

Tags: , , ,
[ 17:59 Apr 25, 2006    More tech/web | permalink to this entry | ]

Sun, 23 Apr 2006

Easy Duplex Printing

Firefox' print system doesn't know how to print just even or just odd pages of a document, so when I need to print out a web page and want it double sided, I've been doing the Duplex Dance: hover over the printer ready to grab each page as it comes out the front so that I can quickly flip it and feed it back into the top of the printer fast enough that the printer doesn't time out with "Out of Paper".

Of course, more often I just sigh and let it print single sided because that's just way too much hassle. But today is Earth Day, so I decided it was time to find a better solution. The solution, obviously, begins with telling the browser to print to a Postscript file. Then the challenge is to find a way to print only the odd pages of the Postscript file, put the pages back in the printer, then print only the even pages.

First I tried to use mpage, which claims to be able to do this. It looked like this command should do it:

mpage -j 1%2 file.ps | lpr
But it didn't work -- it said it was spooling something to the printer, but nothing ever came out. Upon saving the mpage output to a file, I found that gv couldn't show it, citing postscript errors.

But it turns out there's a much easier way: the CUPS lp program has an option called page-set precisely for this purpose, and it's smart about detecting postscript input. This command did the trick:

lp -o page-set=odd file.ps
Then flip the sheets, insert back into the printer, and repeat with even instead of odd. Lovely!

This is documented in http://localhost:631/help/options.html?QUERY=odd#PAGESET -- and the CUPS in-browser help has a search function that took me right to it, I'm happy to note.

Other programs which may to be able to split postscript files into odd and even pages include psselect and perhaps dviduplex.

With a smarter print dialog (one that allowed specifying a custom print command, like Mozilla's used to) you could even define several custom printers, one that printed even pages and one that printed odd. Alas, Firefox' print dialog doesn't allow such things, or even allow defining extra printers. (The Mozilla bug asking for odd/even printing is bug 35228).

From a quick search of about:config, it looks like you might be able to set up something by hand using the print.printer_CUPS/printername.print_command preference (by default mine was set to lpr ${MOZ_PRINTER_NAME:+'-P'}${MOZ_PRINTER_NAME}) but I notice something even more interesting: two variables called print.printer_CUPS/printername.print_evenpages and print.printer_CUPS/printername.print_oddpages (both set to true by default). Also interesting are plex.0.name and plex.count. Might be an easy way to get duplex printing straight from the browser, after doing a little hand-editing to try and persuade Firefox that there's more than one printer. I'll try it next time I need to print something. (It seems wrong to spend Earth Day printing more pages than I actually need.)

Tags: ,
[ 20:21 Apr 23, 2006    More linux | permalink to this entry | ]

Tue, 18 Apr 2006

Mr. Sid Meets Linux

Every now and then I search for a map (usually a geologic map) and end up at a USGS page like this one.

The web viewer is impossible, so that link over on the left -- Download Image Now (16M) -- looks awfully tempting, and I always go for it.

What they don't tell you is what sort of image you're getting; after you download that 16M, you end up with a file called something like q250_1388a_us_c.sid, which no image viewer I've ever found considers to be an image file. Even ImageMagick, which can handle almost anything, is baffled by .sid files.

It turns out that .sid stands for "Mr. Sid", a file format for very large raster images. The format is controlled by a company called LizardTech, and it's apparently so scary that no one has ever managed to reverse engineer it. The only way to read a Mr. Sid file is to use one of the programs (available in binary form only) from LizardTech.

Fortunately LizardTech does provide at least one of their programs, mrsisddecode, as a Linux binary. Get it from their download page. Then you can type a command like mrsiddecode -i q250_1388a_us_c.sid -o q250_1388a_us_c.jpg to convert the file into some other image format (which will be quite large -- this particular map is 17170 x 9525).

(Apparently there's an SDK which is also available for Linux, available here. The gdal toolkit used by MapServer and certain other GIS applications make use of this SDK. I hear it's somewhat picky about GCC version, but otherwise works.)

I'm happy that I've found something that will convert MrSid files to a format I can use, but it's a little discouraging that the USGS is restricting its public maps to a format that can be read only with software from a single company. I wonder if the USGS has a contingency plan concerning all these Mr. Sid maps in case anything ever happens to LizardTech? Aren't open formats safer in the long run?

Tags: ,
[ 22:50 Apr 18, 2006    More science/geology | permalink to this entry | ]

Sat, 15 Apr 2006

Peregrine Cam Only Available to High Bandwidth Microsoft Users

Today's SF Chronicle had a story about the nesting peregrine falcons on a building in San Francisco. In past years, they've had a "Peregrine Cam" allowing people to watch the falcons as they raised their chicks.

Well, this year the Peregrine Cam is back -- only now it's streaming video that requires a fast broadband connection and Microsoft's Windows Media Player.

If you just want to see the falcons, you're out of luck if your connection isn't up to streaming a full video feed, or if you're on a platform like Linux where Windows Media Player isn't offered.

Linux does have several video player applications which can play WMV format, but that's not enough. When I visited the page, what I got was a streamed video advertisement for the company that provides the streaming technology (in stuttering jerks that left no doubt that their bandwidth requirement is higher than the wimpy DSL available in this part of San Jose can provide). But that was all; the video ended after the ad, with no glimpse of falcons.

(I suppose I should be grateful that their Viewing FAQ even mentions Linux, if only to say "Linux users can't view the Peregrine Cam because it needs WMP." Other folks who can't use the camera are people with earlier versions of WMP, Mac users using Safari or Opera or who don't have Stuffit, and people behind corporate firewalls.)

The site doesn't have a Contact or Feedback link, where one might be able to ask "Could you possibly consider posting an photos, for those of us who would love to see the falcons but can't use your whizzy Microsoft-dependant streaming video technology?" Not everyone even wants high-bandwidth streaming video. Alas, the closest they offer is the 2006 Diary, updated irregularly and only with 200x200 thumbnail images.

Update: mplayer users with the appropriate codec can view the camera with the following command:

mplayer "http://powerhost.live.powerstream.net/00000113_live1?MSWMExt=.asf"
Thanks to Guillermo Romero for poking through the source to find a URL that works.

Tags: ,
[ 12:25 Apr 15, 2006    More nature/birds | permalink to this entry | ]

Fri, 14 Apr 2006

Glancing Through Web Stats

I'm not very consistent about looking at the statistics on my web site. Every now and then I think of it, and take a look at who's been visiting, why, and with what, and it's always entertaining.

The first thing I do is take the apache log and run webalizer on it, to give me a breakdown of some of the "top" lists.

Of course, I'm extremely interested in the user agent list: which browsers are being used most often? As of last month, the Shallowsky list still has MSIE 6.0 in the lead ... but it's not as big a lead as it used to be, at 56.04%. Mozilla 5.0 (which includes all Gecko- based browsers, as far as I know, including Mozilla, Firefox, Netscape 6 and 7, Camino, etc.) is second with 20.31%. Next are four search engine 'bots, and then we're into the single digit percentages with a couple of old IE versions and Opera.

AvantGo (they're still around?) is number 11 with 0.37% -- interesting. It looks like they're grabbing the Hitchhiker's Guide to the Moon; then there are a bunch of lines like:

sync37.avantgo.com - - [05/Apr/2006:14:29:25 -0700] "GET / HTTP/1.0" 200 4549 "http://www.nineplanets.org/" "Mozilla/4.0 (compatible; AvantGo 6.0; FreeBSD)"
and I'm not sure how to read that (nineplanets.org is The Nine Planets, Bill Arnett's excellent and justifiably popular planetary site, and he and I have cross-links, but I'm not sure what that has to do with avantgo and my site). Not that it's a problem: of course, anyone is welcome to read my site on a PDA, via AvantGo or otherwise. I'm just curious.

Amusingly, the last user agent in the top fifteen is GIMP Layers, syndicating this blog.

Another interesting list is the search queries: what search terms did people use which led them to my site? Sometimes that's more interesting than other times: around Christmas, people were searching for "griffith park light show" and ending up at my lame collection of photos from a previous year's light show. I felt so sorry for them: Griffith Park never puts any information on the web so it's impossible to find out what hours and dates the light show will be open, so I know perfectly well why they were googling, and they certainly weren't getting any help from me. I would have put the information there if I'd known -- but I tried to find out and couldn't find it either.

But this month, no one is searching on anything unusual. The top searches leading to my site for the past two months are terms like birds, gimp plugins, linux powerpoint, mini laptops, debian chkconfig, san andreas fault, pandora, hummingbird pictures, fiat x1/9, jupiter's features, linux photo, and a rather large assortment of dirt bike queries. (I have very little dirt bike content on my site, but people must be desperate to find web pages on dirt bikes because those always show up very prominently in the search string list.)

Most popular pages are this blog (maybe just because of RSS readers), the Hitchhiker's Guide to the Moon, and bird photos, with an assortment of other pages covering software, linux tips, assorted photo collections, and, of course, dirt bikes.

That's most of what I can get from webalizer. Now it's time to look at the apache error logs. I have quite a few 404s (missing files). I can clean up some of the obvious ones, and others are coming from external sites I can't do anything about that for some reason link to filenames I deleted seven years ago; but how can I get a list of all the broken internal links on my site, so at least I can fix the errors that are my own fault?

Kathryn on Linuxchix pointed me to dead-links.com, a rather cool site. But it turns out it only looks for broken external links, not internal ones. That's useful, too, just not what I was after this time. Warning: if you try to save the page from firefox, it will start running all over again. You have to copy the content and paste it into a file if you want to save it.

But Kathryn and Val opined that wget was probably the way to go for finding internal links. Turns out wget has an option to delete each file after downloading it, so you can wget a whole site but not actually need to use the local space to duplicate the site. Use this command:

wget --recursive -nd -nv --delete-after --domains=domain.com http://domain.com/ | tee wget.out 2>&1

Now open the resulting file in an editor and search repeatedly for ERROR to find all the broken links. Unfortunately the errors are on a separate line from the filenames they reference, so you can't just use a grep. wget also gets some things wrong: for instance, it tries to download the .class file of a Java applet inside a .jar, then reports an error when the class doesn't exist. (--reject .class might help that.) Still, it's not hard to skip past these errors, and wget does seem to be a fairly good way of finding broken internal links.

There's one more check left to do in the access log. But that's a longer story, and a posting for another day.

Tags: ,
[ 21:43 Apr 14, 2006    More tech/web | permalink to this entry | ]

Wed, 12 Apr 2006

Dream Jobs and Mars Rocks

Driving home from dinner, watching the alpenglow fade from the gleaming domes of Lick Observatory, I found myself thinking about the talk last night: a wonderful geology seminar by Michael Carr of the USGS on the subject of "Water on Mars".

I had a chance to chat briefly with the speaker before the meeting. We got to talking about the moon. It turns out that he spent some of his early career at Lick, working with a few colleagues to make a geologic map of the moon. How? By sketching the terminator every night from the eyepiece of the 36" refractor, and trying to deduce the geology from the topography they sketched. Talk about dream jobs!

It was interesting to compare Carr's talk to the SJAA talk on the same subject earlier this year by Jeff Moore of NASA/Ames (always one of my favorite SJAA speakers). Carr's talk was quite a bit more detailed and heavier on the geologic details, not surprising since he was speaking to a room full of geologists and geology students. He even showed a stratigraphic column of the Burns Cliff area that the Opportunity rover investigated near Meridiani.

I learned quite a bit that I can apply toward my "Mars Rock" collection. I have a set of rocks that are similar to the various interesting rocks on the moon (I finally found some anorthosite a few months ago). I use them when I give presentations on the moon. It goes over very well: I think people get a better idea of what the moon is made of and how its surface looks when they get a chance to handle the rocks and look at them up close.

I have a start on a similar collection for Mars, but of course the most interesting Mars-like rocks to show people aren't the boring black and red basalts; they're the ones the Rovers have been discovering that point to a history of water. So those are the rocks I'm most interested in adding: the sulfates and other evaporites, sandstones made of evaporite sediments, hematite "blueberries" (Moqui Marbles, on Earth), and jarosite.

I'd never heard of jarosite before, but from a bit of web research the day after the talk, it turns out to be one of the minerals implicated in the controversy that was in the news last year about modern-day generation of methane on Mars. Some people attributed the extra methane to the presence of biological organisms, though others were quick to point out that there are plenty of non-biological ways to release methane.

Interestingly, one of the audience members at the talk commented that in the Sierras jarosite is a weak biological indicator (because the biological organisms prevent formation of carbonates, if I understood him correctly). So it's a pretty interesting mineral even for someone who doesn't hold out much hope for finding life on Mars.

Here's a good summary of the rocks found in the Burns Cliffs.

Tags: ,
[ 22:27 Apr 12, 2006    More science/geology | permalink to this entry | ]

Thu, 06 Apr 2006

Squirrel Territory Skirmishes

We were travelling for a week, so we left the squirrels with plenty of nuts to bury. (I'm sure our backyard will be a maze of walnut and hazelnut sprouts once the spring weather arrives.)

On our return, we found Nonotchka nursing an injury, limping on her left rear leg and sporting two wounds on that haunch. We're guessing she had a close encounter with a cat or similar predator.

(Dave saw Notch face off with a cat just a few days ago. Notch was crossing the street back to the place where we think she has her nest, when a cat came out of someone's yard. Notch stopped and sat up in the middle of the street, facing the cat. The cat stopped, too, and they sized each other up. Finally Notch turned and casually sauntered off the way she'd been going, obviously having decided she had enough escape options and wouldn't have trouble outrunning the cat. The cat turned and stalked off the other way: "Oh, I wasn't hungry ayway.")

Since our return Nonotchka has gotten steadily gotten better. She seemed very hot for a few days, constantly running off to flop onto the cold concrete in the shade, and the soles of her paws were hot when she came over to take nuts. We suspect she was fighting an infection. But her temperature is better now, and the fur is growing back over the wounded area. She's walking better every day, and it's hard to see that anything is wrong, until she jumps. She can't jump as high as before, and climbing the fence is harder. With any luck it's just stiffness, and she'll get over that in a few days.

We've made a special effort to make sure she gets plenty of nuts, despite Notch's frequent presence. But today they had an encounter that makes me wonder if we need to worry about that any more. I was feeding Notch some breakfast nuts when Nonotchka appeared on the fence. Normally Nonotchka would stay there, or retreat across the street, when Notch is around; but today she causually walked down the fencepost and sniffed around under the deck where we often leave nuts.

Notch stopped eating and turned to look. They eyed each other for a bit. Eventually Notch rushed Nonotchka, who retreated back under the deck -- but not very far. Notch hopped a few feet over to the grass under the orange tree and began to roll, dig, and pull herself through the grass (to leave her smell there?) After about a minute, Nonotchka appeared from under the deck and began rolling/digging/pulling herself through a patch of grass under the guava tree, not more than four feet away from Notch. Notch tolerated it for maybe half a minute, then it got to be too much and she rushed Nonotchka again with a little bark. Nonotchka retreated again, but still not very far, and they spent the next few minutes eying each other, circling slowly around the yard, in a slow chase that ended with them exiting into the cedar in the front yard, where I lost sight of them.

Five minutes later Nonotchka showed up at the office door to take a nut I'd left there, but she took it up to the fence and wouldn't come back to eat anything more.

I guess squirrel territory isn't immutable. It's nice to see Nonotchka asserting herself a little.

Tags: , ,
[ 12:36 Apr 06, 2006    More nature/squirrels | permalink to this entry | ]

Sat, 01 Apr 2006

Silly, Pictures Aren't Executable!

When I plug in my camera (or flash card reader) to upload photos, they always upload as executable. I knew there must be an easy way to fix it, and finally got around to it.

I'm sure you are fully capable of reading man pages and figuring this out, just like I was. (Hint: the solution is in man mount.) But wouldn't you rather have it just spoon-fed to you? (I know I would have.) So here it is: you need the fmask option to mount. It's a mask, so you set it to the bits you don't want set when you mount the filesystem (on top of your normal umask).

My /etc/fstab entry for my camera or other flash card device now looks like this:

/dev/sda1  /pix  vfat  rw,user,fmask=111,noauto  0 0
(On the laptop it's sdb1 because the built-in memory stick reader always grabs sda.)

Tags: ,
[ 22:39 Apr 01, 2006    More linux | permalink to this entry | ]