Wednesday, September 16, 2009

Ayn Rand didn't like physics?

I've been very busy with work and other functional duties, but this is worth a link.

Jonathan Chait has an excellent essay on Ayn Rand and the irrational beliefs of her followers on the political right. There is much worthy of discussion, from her bizarre upbringing and even more outlandish cult-like cliques through to her and modern conservatism's absurdly anti-factual beliefs regarding worth, work and taxation, but I'd love to follow up on this snippet of information:
(she considered the entire field of physics "corrupt")
Maybe the library will get the biographies referred to in the essay, but I doubt I'll have the time to follow up on Rand's physics hatred. After all, some of us have real work to do.

Thursday, August 20, 2009

"Unix is the best screwdriver ever built"

Unix is now 40 years old, if measured from August 1969 when Ken Thompson decided to spend a month while his wife was away by writing the core of what became Unix.

The BBC has a nice article by Mark Ward on Unix's history, ending with a quote
"Unix is the best screwdriver ever built," said Dr Salus.
that echoes the theme of Neal Stephenson's "In the Beginning was the Command Line" that compared Unix to a Hole Hawg drill.

Tuesday, August 11, 2009

Amazon MP3 downloads from Linux: clamz

Amazon.com offers quite competitively priced full album DRM-free mp3 downloads. You can purchase and download individual mp3 songs without requiring additional software. But they do require you to install and use their Amazon MP3 Downloader software in order to purchase and download the albums, which are of course better value for money as long as you want most or all of the album.

To their credit they provide their software not only for MS Windows (XP and Vista) and Mac OSX (10.4 and higher), but also for Linux (Debian 4, Ubuntu 8.10, Fedora 9, OpenSUSE 11.0).

Sadly if you're using a version of Linux other than those supported you may have trouble: the Fedora 9 amazonmp3.rpm will not install under Fedora 11 (although vwbusguy provides a work-around for Fedora 10).

Luckily there is another option: a command line tool called clamz (vwbusguy has produced Fedora 11 RPMs of clamz). Attempt to purchase the mp3 album from amazon as normal and once it offers you the chance to open or save the .amz file choose "save to disk" instead. Then run clamz on the .amz file, e.g.
clamz -d ./ AmazonMP3-*.amz
If you don't use the official amazon downloader you do have to jump through some hoops to get the *.amz file that clamz uses:
  • Select the album you wish to purchase and click the "Buy MP3 album with 1-Click" button.
  • A page appears asking you to install the Amazon MP3 Downloader application, presenting links to Windows, OSX and Linux versions. At the bottom of this page is a small link saying that if you've already installed the application you need to enable it in your browser and offering a link to do so. Click that link.
  • You are redirected back to the web page for the album.
  • Click the "Buy MP3 album with 1-Click"button again.
  • A new window appears asking if you really want to purchase this album. Click OK.
  • A dialog window will appear offering options to "Open with" and "Save as". Save the *.amz file its offering you.
  • Go to the command line and run clamz on the amz file.
  • Note that you can only run clamz ONCE on any *.amz file.
One thing that is slightly worrying about this is what happens if the download fails? If Amazon thinks you've downloaded the album they wont let you download the files again.

[Updated 10/20/09.]

Tuesday, July 28, 2009

Coyne reviews Robert Wright's "The Evolution of God"

Jerry Coyne (author of "Why Evolution is True") has a lengthy review of Robert Wright's latest book "The Evolution of God" (Amazon link).

In short: Wright cherry picks examples in an attempt to demonstrate "moral" progress mediated by historical (supposedly evolutionary) changes in (monotheistic) religions, as his previous books attempted to show progress in biological evolution towards greater complexity (and hence mankind). In short this is a classic religious attempt to ascribe purpose and direction to the Universe.

Nevertheless Coyne's review itself is worth reading.

Sunday, July 26, 2009

Gemmel, Quist and Polar Shifts

Fans of British fantasy novels will no doubt remember David Gemmell as being one of the biggest names in fantasy writing between the mid-1980's and his untimely death from heart disease in 2006.

Gemmell's books were a breath of fresh air in the late 80's, washing away the stale Tolkien-imitation that seemed to dominate the field and replacing it with gritty tales of flawed heros, often hopeless odds, and major characters often dying. Sadly, the more books Gemmel wrote the more formulaic this style became.

One re-occurring theme Gemmell used to tie together the different series of his earlier books was of periodic catastrophes that shifted the Earth's rotation, drowning continents and emptying seas. At the time I read his books I assumed these ideas (absurd, but good fodder for fantasy) were Gemmell's own adaptation of Velikovsky's catastrophism, but most of the Polar Shift concepts used in Gemmell's work appear directly taken from Charles Hapgood's "Maps of the Ancient Sea Kings: Evidence of Advanced Civilization in the Ice Age."

The reason I now know this is John McKay's excellent post on Allan Quist's hilarious attempt to disprove global climate change by claiming that ancient maps show an ice-free Antarctica based on Hapgood's work.

Monday, July 6, 2009

numpy/scipy

The more I use numpy and scipy the more I like them. Matplotlib has some quirks, but all in all its easy to quickly write something powerful that just works.

Update (09 July 2009): That said, I am surprised at how simplistic the fitting routines (aka optimization, minimization, etc) are in scipy, and the lack of good generalized fitting packages in python. Its all very well if you want to use the routines provided in scipy.optimize and uncertainties in your data aren't a big issue but that's not at all the realm of data I experience daily.

It may be that scipy.optimize's routines can handle data uncertainties properly through some more complicated interface, but all the examples I've seen don't seem to suggest that as they all totally ignore data errors. Nor do they mention even simple fitting concepts like chi squared (I'd survive with chi squared, I don't need log likelihood all the time).

Update (10 July 2009): OK, you can handle data uncertainties using the scipy.optimize routines, you just make sure the function you want to minimize calculates chi squared or log likelihood, and you effectively have chi^2 fitting or Cash statistic fitting. I haven't yet worked out how to calculate the uncertainties on the fit parameters using scipy.optimize -- the most naive way is to use the covariance matrix (not robust, I know).

Space Telescope's stsci_python provides pytools.nmpfit (a numpy version of python mpfit, itself a version of IDL mpfit). This does Levenberg-Marquardt fitting and does provide estimates of the best-fit parameter uncertainties (using the covariance matrix). After giving it a spin I find it works just as well as scipy.optimize, although at the cost of having to install the entire stsci_python package. More interestingly (n)mpfit has a well developed interface for fixing (and unfixing) fit parameters as well as handling limits on the fit parameters. I ended up using this for the HST ACS data analysis routines I'm writing. Still, none of these approach the sophistication of xspec or sherpa. If it weren't for the huge size of these packages I'd try to link to these behemoths (well, sherpa anyway, as it has a python interface), but I'm trying to (a) use more generalized packages, (b) wean myself away from relying on the same software I've used for years and learn something new...

Sunday, July 5, 2009

This Cat is Awesome!

Pet Jungle Cat (NSFW).

[Original "Cat... is Awesome" from Zooillogix]