Wednesday, December 31, 2008

Attenborough interview


Ed Yong has an interesting interview with Sir David Attenborough, which worth a read if you enjoy his nature documentaries (and what discerning mind doesn't?).

The version of the Planet Earth documentary series available through Netflix here in the US differs from the version aired here by the Discovery Channel in 2007. The Netflix version has Attenborough narrating, and although the lines are probably identical to those said by Sigourney Weaver in the Discovery Channel version, the Attenborough version seems much serious and informative to me.

Nevertheless, on rewatching it I still consider Planet Earth to inferior to Attenborough's "Life" series of documentaries, or the Blue Planet series made by the people who later did Planet Earth. Planet Earth, despite some great footage, never seems to me to have the same level of focus or information content of these other series. The rapid changes in shots and scenes in Planet Earth make it seem like it was put together by someone with an attention deficit disorder, or that it was aimed at an audience whose attention span is measured in tens of seconds. But perhaps their is a niche for a wildlife documentary aimed at non-documentary watchers?

Anyway, Attenborough never ceases to amaze me. At the release of this years "Life in Cold Blood" series he was 82 years old and was still jaunting around the world into all sorts of inhostipatable environments. This year he is behind one of the BBC's Darwin "The Genius of Evolution" season (marking the 200th anniversary of the birth of Charles Darwin).

Monday, December 29, 2008

More Mac installing...

Spent some of the day setting up the new work Macbook. Firefox 3 instead of Safari. iTerm as an alternative to the Terminal. More importantly. I installed Xcode 3.1.2 from the Apple Developer Connection, gfortran direct from GNU itself, fink 0.9.0 from http://www.finkproject.org/, and then a whole bunch of fink packages installed tetex using FinkCommander.

For now I've decided against installing MacTex, despite it being a more up-to-date Texlive-based tex/latex distrbution than fink's tetex.

It looks like getting scipy installed will take some work (or at least more work than installing it on Fedora, "yum -y install scipy python-matplotlib ipython"), as its not available by default in fink.

Anyway, the most important set of software installation is now over with compilers on the system and access to installable unix tools through fink, so I should be able to continue at a more relaxed pace while starting to do actual work (at the very least, paper writing) on the laptop.

Sunday, December 28, 2008

Progress on setting the Mac up properly...

Enabled a root account:

In versions prior to 10.5 this could be done with NetInfo (part of the Apps/Utilities folder). Now this is done graphically using Directory Manager (not System Preferences/Accounts, as you might have assumed). Selected Edit->Enable Root User and enter a password.

Set up the locate database for the the locate command:

Become root or use sudo to execute the following command:
/usr/libexec/locate.updatedb

Ignore the warning about this being a security risk. Control over which directories to scan should be set in /etc/locate_rc, although Apple does not provide one by default. TODO: By default the locate database is only updated once a week. This should be changed to once a day. See the /etc/periodic/weekly directory.

Setting a fixed machine name:

The main ComputerName can be set/reset in System Preferences/Sharing. However this is not the same as the node name as you'd see executing "uname -n". As far I can determine the best way to set the machine name(s) is to use "scutil --set" to set the ComputerName, LocalHostName and HostName.

scutil --set ComputerName azathoth
scutil --set LocalHostName azathoth
scutil --set HostName azathoth

These changes are retained between successive boots of the machine.

Making Terminal and X11 appear by default in the dock:

Start either app the normal way from Finder. Their icon will appear in the dock. Right-click on their icon (if you have set up right click, otherwise control-click on the icon) and select "Keep in Dock" and/or "Open at Login".

Switch off xterm beeping:

Failure!

xset b off doesn't seem to work by default as /usr/X11/bin is not in the default path. Doing /usr/X11/bin/xset b off does work within the invoking xterm, but so far I have failed in preventing beeps on an automatic and system-wide basis.

Trying to create a user-specific .xinitrc, even one that invokes quartz-wm, does not work for me. In most cases X doesn't even start successfully, and if it does then the xterm it starts still invokes the bell. I am beginning to suspect that I may have to set it to use visual bell. Copying the system xinitrc from/usr/X11/lib/X11/xinitrc and modifying that doesn't seem to work either.

Focus Follows Mouse:

It appears to be impossible to get full focus follows mouse behaviour under OSX, which is incredibly backwards. However a very limited form of it is possible just for Terminal windows (and possibly xterms) by executing the following in a Terminal:

defaults write com.apple.Terminal FocusFollowsMouse -string yes

This works (after a small delay) in giving limited FFM in just the Terminal.

For xterms the following is claimed to work:

defaults write com.apple.x11 wm_ffm true

But this does not appear to work on my Macbook, with or without a -bool between the wm_ffm and the true. As I don't really intend to use a vanilla xterm for real work anyway I'm hoping this (and the copy/paste difficulties between X11 and OSX) limitation won't end up driving me crazy.

Friday, December 26, 2008

OS X, Fedora 10, KDE 4.1.2, XFCE

Still playing around with the new Macbook and OS X 10.5.6, getting used to the odd Mac key and the associated keyboard shortcuts.

Overall I'm quite impressed at the speed and slickness of the basic OS, as much as I try to avoid being impressed with eye-candy. The lack of "focus follows mouse" is a major pain, and copy/paste seems broken or tricky between X11 and non-X11 apps. The Terminal program is OK, less fancy than I was expecting based on word-of-mouth, although nicer than the lowest-common-denominator of the basic X11 xterm.

I was going to say the OS X Terminal is less capable than the KDE Konsole, but then I was rudely reminded last week that the KDE4 Konsole is less capable, and less configurable, than the KDE3 Konsole. Currently I'd say the OS X Terminal and KDE4's Konsole appear pretty comparable in capability and available configuration options at present.

I've complained before about KDE4 on Fedora 9, but had noted some progress and had hoped the version Fedora 10 shipped with would be further improved. Last week I upgraded my work back-up machine to Fedora 10, largely as a test, and experienced many of the same problems...

The Konsole no longer has a login shell "--ls" command line option. Transparency is still not available. Add an application laucher to the Plasma-based panel and dare to change the "Icon Settings" and its icon will be replaced with a question mark. Worse still, the changes you've made to the panel launcher have been propagated back to the main KDE menu, so don't make a mistake! As for trying to move icons around on the panel... it didn't appear to be possible at all (no right click, "Move" option anymore) and its seems other are as confused by this as I am, although here is the non-intuitive way to do it.

And its slowwwww. The price we pay for KDE trying to implement desktop graphical effects similar to OSX, I suppose.

Any, sick of the fuss, I ditched KDE4 on the Fedora 10 machine and switched to XFCE, and managed to quickly configure my desktop into looking something like KDE3.5 with nicely transparent terminals in less time that it took me to get the KDE4 Konsole to use a login shell.

One step forward and one step backwards, I suppose... Ah well.

Saturday, December 20, 2008

Bérubé reviews Sokal's "BEYOND THE HOAX: Science, Philosophy and Culture"

Michael Bérubé has an interesting review, dare we say critique, at the American Scientist of Alan Sokal's latest book "BEYOND THE HOAX: Science, Philosophy and Culture" (Amazon.com link)

Here is a snippet of the review to whet your appetite:
When some people hear the term Western science, they think first of Hiroshima, Agent Orange and the Union Carbide plant in Bhopal—and not, say, of the discovery of neutrino oscillation. This mordant skepticism about the benefits of Western science is then underlined by a dogmatic conviction that the Enlightenment was little more than a stalking horse for imperialism. As for why postmodern intellectuals would champion “local knowledges” and the “heterogeneity of language games” against the universalist aspirations of the Enlightenment, my sense is that when academic leftists in the humanities speak glowingly about “local knowledges,” they’re thinking of all the warm and fuzzy feelings we lefties have about “the local”—from our local independent bookstore to our local independent food co-op. These are good things by every measure (local and universal), but they seem to have obscured the fact that many of the world’s “local knowledges” are parochial, reactionary and/or theocratic. Likewise, the defense of the “heterogeneity of language games” has proceeded as if it is the moral equivalent of a defense of species diversity—when, in fact, it is morally neutral, agnostic with regard to the question of whether the language games of charlatans or fascists should be preserved alongside the language games of the indigenous peoples of the Americas.
However, while there is much that is good about Sokal's book, it is not all good. Bérubé does a good job of explaining to lay-people like me where Sokal (and Sam Harris, before him) has gone wrong.

[Update 12/26/08: Hopefully have corrected the weird font problems.]

Friday, December 19, 2008

New Macbook! (and Fallout 3)

My new work laptop arrived yesterday - a 13" 2.4 GHz Macbook. This is my first Mac ever, something of an experiment for me, so lets hope it goes well. So far I'm quite pleased with it, especially now that I've worked out how to right click using the touch pad and found how to add a terminal to the dock.

My old Lenovo Thinkpad X60, dual boot Fedora 8 and Windows XP, was (and still is) a good software development machine but was imperfect at its primary role of conference/travel laptop. On Windows the separate Lenovo and Windows wifi managers would often conflict with one another, although it worked once you'd found and killed one or the other. I'd bought the thing based on the fact that people at ThinkWiki had the wireless hardware working under Linux, but for whatever reason it would only work intermittently and often would disconnect from a wireless network it had managed to connect to. It even did this when I swapped the Intel a/b/g wireless internal card for an Atheros-based one that was supposed to work even better under linux. I spent a lot of time getting into old-school kernel patching and micro-code nonsense, before giving up trying to make wireless work robustly under linux. This was a pain at conferences, where wired ethernet connections are rarely provided.

And I never got sound working under Linux - a failure that rankles me considering I managed to hack sound into working on linux on every laptop I've ever had until the Thinkpad came along two years ago.

I'd originally chosen a dual-boot Windows/Linux combo (as opposed to pure Linux, which is what I did on previous laptops) because conferences had stopped letting you hook your own laptop up to the projector to give your presentation (which used to work fine under linux with OpenOffice for me and still does for departmental Seminars, apart from one memorable incident at a conference in the Canary Islands...).

Now all conferences have adopted a policy of transferring all talks to one of two-conference computers, usually one Windows and one Mac. This initially lead to font problems with talks saved in powerpoint format from OpenOffice Impress, although installing and using Microsoft web fonts under linux solves that problem. I added Windows to the Thinkpad X60 so I can load the ppt in powerpoint to check it. All good so far. This is almost foolproof, except when conference organizers put your powerpoint talk from a XP machine onto a Mac running powerpoint (or vice versa), at which point all hell breaks loose. This has happened to me only a few times, but it happens to some poor soul at every conference I go to.

So, sick of powerpoint's inability to work properly on both XP and Mac, and having to reboot out of a working environment (linux) to get into XP to check the presentation, I have decided to do all future talks in Keynote. Hence the Mac. And once I've unixified the Mac I should be able to do some decent work on the thing at the same time, no rebooting required. Wish me luck.

PS: Fallout 3 did not disappoint. An awesome game, with only minor flaws of an overly-low level cap and a rather abrupt termination to the main quest.

Friday, December 12, 2008

Unix Semaphores - A finite resource!

One of the things about unix-like operating systems is that you never learn them all - there is always something more that you didn't know about that some other unix-user will tell you about that you'd never heard of but is cool and/or useful nonetheless.

I've been using *nixes pretty much full time since 1994, and sys-adminning my own Linux boxes since 1996, and yet yesterday I learned something completely new.I was messing around stress-testing some Message Passing parallel code using MPICH on a shared memory system (couldn't be bother to mess around with going across the network and set up ssh keys for a simple test, OK), only to discover after some weird errors, that the ch_shmem system of MPICH relies on System V-style inter process communication, which in terms uses semaphores, of which each user is only allocated a small number (32 arrays or something silly). Interestingly, nothing else on my system appears to be using semaphores or message arrays.

If MPI crashes while running it fails to clean up the semaphore(s), and if you do this too many times you end up not being able to run anything that relies on semaphores, which causes much confusion if you didn't know about this stuff. Hence you need to run ipcs -s to see your semaphores (hopefully none, if your MPI program has finished running), and ipcrm -s to delete any improperly terminated semaphores. I'd never heard of these commands before, but they solved my problems.