Tuesday, February 24, 2009

I wish I had a transparent skull...


...just like the barreleyes fish (Macropinna microstoma).

Not sure what I'd do with such an arrangement, but it'd still be pretty cool.

Full reference: Robison BH, Reisenbichler KR (2008) Macropinna microstoma and the Paradox of Its Tubular Eyes. Copeia 2008(4):780-784.

Friday, February 20, 2009

Unprecedented investment opportunity!

I met with my financial advisor yesterday for the first time in about three months. He looked tired, as he'd probably been dealing every client asking him the same question I did: "Tell me why I shouldn't take all my investments out and hide it in my mattress before it loses another 35% of its value..."

He did a reasonable job of explaining that the current value of the shares is not what is important if you're planning on using the money for retirement in 25 years, that buying cheap and continuing to buy cheap should in the long run pay off as those shares regain their value at some point in the future. That getting out now and then trying to get back in when things appear to get better would also directly translate into a significant loss, worse than staying in and not messing with them.

All well and good. "Think of it as an unprecendented investment opportunity." he said. "When are you ever going to be able to buy shares this cheaply?" I certainly appreciated the valiant attempt at optimism, even if I didn't quite feel it myself.

"The market is going to come back, eventually... The only way it won't increase beyond its former levels is if you think the World's already achieved maximum productivity and maximum growth." A decent enough point, although I immediately thought "Oh oh. Peak Oil. Global Climate Change."

So how long is it going to take? The wall of his conference room had a log-linear graph of the return on $1 invested in 1920 in various different ways, stock market, federal bonds, bank savings account (maybe). The Great Depression was visible as an order of magnitude drop in value that took about a decade to recover to its former value (and that only really associated with the economic growth associated with the US's waging of WWII). Paul Krugman had an editorial yesterday (2/19/09) that again argues that demand will ultimately drive recovery, but not before 2011 and maybe in 5 to 10 years.

Rational reasons to believe it will ultimately get better eventually are perhaps all we ask for now.

pdffonts, updmap, epstopdf and ps2pdf

The occasion of the U.S. National Academy of Sciences "Astro2010" Decadal Survey of Astronomy and Astrophysics has forced me to (re)confront the issue of font embedding in PDF documents produced with LaTeX.

The last time I did this was about five years ago for various NASA ROSES proposals (ATP, the now defunct LTSA, etc) and it was something of a messy process. Which font package to use, what dvips command line options to use to make the postscript file, and then what ps2pdf command line options to use, etc etc.

Nowadays its much easier to produce high quality PDFs from latex source, thanks to pdflatex, and I'd assumed all fonts ended up being embedded properly automatically now. But in writing my Astro2010 White Paper I ended up discovering the very useful pdffonts tool, which in turn informed me that all my fonts where not being embedded. In the process of solving that I got to learn about updmap (not actually the source of the problem, as its correctly set up in Fedora 8 and 10) before realizing the problem was with my figures.

I still produce and include EPS figures, relying on the latex epstopdf package to automatically convert the figures to PDF for pdflatex. Turns out epstopdf (the command line tool used by the epstopdf latex package) does not correctly embed the fonts when coverting the EPS files, so thats where the problem was. The command line ps2pdf tool does embed the fonts, but only when you use the -dPDFX command line option (-dEmbedAllFonts does not work!).

Anyway, all this is now documented on my Unix tips and tricks site.

Tuesday, February 3, 2009

Things fall apart (latex2html, tth, webalizer)

Things fall apart; the centre cannot hold;
Mere anarchy is loosed upon the world,
Yeats -- The Second Coming

Much too busy to spend much time posting except on this (now cold) coffee break, but this line from Yeats summarizes my current feelings about software.

I have recently had sudden need to covert a LaTeX document to HTML, only to discover that the old standard latex2html hasn't been maintained or updated for many years. It used to work well... but my current pdflatex-friendly documents cause latex2html to fail spectacularly. It seems to reserve special hate for \newcommand (which I now use a lot in place of the older \def). Even removing all the \newcommands results in half of the equations being totally mangled.

A desperate search for a equation-friendly replacement did yield a fully acceptable solution either. The best of the bunch seems to be TtH, but even that doesn't handle my document's fairely pedestrian equations properly, nor does it handle images properly given that I'm using the epstopdf package. Argh!

After hours of pulling my hair out over the weekend I decided to forget about HTML completely and just post a link to a PDF. In the process of doing that I discovered that my Apache was not playing nice with webalizer anymore (I want to easily see who accesses the document, you see), despite the configs supposedly allowing me to view the webalizer output. It used to work... Sigh. No time to hunt down and fix the problem either.