Tuesday, March 31, 2009

Game AI


The guys at Penny Arcade were referring to Wanted: Weapons of Fate when they created this comic, but it sadly applies to most game AIs.

My favourite example of this (and I don't mean that in a sarcastic way) are the mercenaries in Far Cry 2 who camp out by the gas (petrol) stations. One shot at a pump, and Oh the humanity!

Fedora upgrade problems solved?

Just to follow up from last week's post on my problems upgrading my x86_64 workstation to Fedora 10, I think I now have everything fully functional once again.

The booting/grub problems were definitely related to grub's attempted probing for a floppy drive (/var/log/messages will show kernel I/O errors associated with fd0), even though I've never had a floppy drive in the system and it had never caused a problem before. It appears this is not an uncommon problem, see e.g. here and here, but its not obvious why I'd only experience this now with Fedora 9 an 10.

The command line workaround (install grub to the MBR using the grub shell with "grub --no-floppy," setup (hd0,0), etc, instead of using grub-install) is not ideal as it appears that any kernel update (e.g. when updating the system after a DVD upgrade) will run grub-install itself and fall foul of the problem.

In the end I had to switch off floppy support completely in the BIOS (even though no floppy drive or any associated cabels were present in my system) to solve this problem.

Upgrading from Fedora 8 -> Fedora 9, and then Fedora 9 -> Fedora 10 using the x86_64 DVD install/upgrade disks ultimately worked, in a fashion, but displayed some annoying features that reminded me why I switched to the yum upgrade method before.

The problem is that after "upgrading" and rebooting I found many packages (indeed, the majority) had not been updated to Fedora 9. I presume the reason is that a fully up-to-date Federa 8 system has packages that are more recent, with higher version numbers, than the original Fedora 9 DVD distribution, and that the DVD upgrade process then does not replace the fc8 packages with the fc9 packages.

I had to run "yum update" at least twice (why twice? I don't know why it didn't pick up all the packages that needed updating the first time) before the older Fedora 8 packages were replaced with normal fc9 packages. Even with a fast internet connection updating > 1000 packages takes a full day or so. I then had the same problem with Fedora 9 -> Fedora 10, where the situation was so bad that after the basic DVD upgrade firefox and konqueror simply didn't work at all. Then yet another day waiting for "yum update" to complete.

I did discover some useful yum tips here, in particular how to force yum-fastestmirror to retest the mirror speeds without doing "yum clean all." (Important if you've just spent several hours downloading hundreds of packages, but they haven't yet been installed before the transaction check found a problem, and you need to download more but the once-fast mirror you were downloading from is now incredibly slow.)

The update process was exacerbated by some odd changes the DVD upgrade made to my networking setup that basically messed up /etc/resolv.conf and my DNS configuration. It took me a while to work out that the "Error: Cannot find a valid baseurl for repo: fedora" was basically a DNS/dhclient problem. I don't remember DVD upgrades messing with network settings before, so I'm not sure how or why this happened.

To add insult to injury my rsync backup scripts then no longer worked because the newly installed Gvfs (specificaly ~/.gvfs) breaks rsync. The work-around is to add .gvfs to the rsync excludefile, but what a pain!

All in all a very tiring upgrade process, and all the more annoying because the exact same upgrades for i386/i686 work fine on my other machines. I presume part of the problem, in particular with the DVD upgrade, was leaving the upgrade so late after Fedora 9 and Fedora 10 had come out, so I may upgrade the x86_64 workstation to Fedora 11 relatively soon after it comes out. But on the other hand I don't like to upgrade to a new Fedora version before some of the kinks in the new version are worked out...

Friday, March 27, 2009

Fedora upgrade problems

I've been having a lot of trouble with my main workstation this week, brought on by an attempted yum upgrade from Fedora 8 x86_64 to Fedora 10 x86_64, but probably complicated by hardware problems associated with the floppy drive (or lack of it, to be more precise) that then messed up (and continue to mess up) the grub bootloader.

I had to do a full system restore yesterday from my incremental rsync backups (which worked wonderfully), but I'm still struggling with the system and was forced to do a rpm database rebuild this morning. The DVD-based Fedora 9 upgrade I set running last night, although supposedly successful, in truth failed thanks to grub-install's (which seems to be run whenever you install a new kernel) insistence on probing for a floppy drive even when there isn't one present and even when the device.map correctly excludes fd0 (note that recent versions of grub-install do not have or honor a --no-floppy command line option, despite what people on the Internet seem to think). Attempts to run grub-install from the command line simply hang, and /var/log/messages starts showing kernel I/O errors associated with fd0 (which I'm pretty sure I dont have!).

The messed up Fedora 9 install also seem to have messed up rpm, as on booting I found that even simple rpm queries would hang and /var/lib/rpm/ had the classic __db* files.

Still, looking on the bright side it has been a good test of my linux sysadmin knowledge.

My rsync backup method (based on Mike Rubel's incremental rsync backup with hard links method described here, see also Kevin Korb's page on rsync backups) works well and restore's easily. Note that the method's Rubel and Korb describe don't quite work on my system as rsync can't handle the number of files of my system in one go - I basically run the method by script separately on each of /boot /bin /etc /home /var etc etc).

I still remember how to use the grub command line to find files and boot, even if grub.conf is totally messed up, and I've learnt (the hard way) that grub-install can't quite be trusted and that its better to use the grub shell to install grub to the MBR (Remember to use "grub --no-floppy" to prevent probing for a floppy, even if you dont have on).

The annoying rpm stale locks and corrupted rpm database thing can be fixed ... "rpm -vv -rebuilddb" worked, thankfully.

I'm still surprised that the basic yum upgrade failed, as I've done yum upgrades from Fedora 8 directly to Fedora 10 successfully before, although only with i686 systems and not an x86_64 system. Based on the error messages I experienced it seems that /usr/lib64/libc.so.6 is the problem child in the jump from Fedora 8 to Fedora 10. I really should have done Fedora 8 -> Fedora 9 -> Fedora 10, or burnt myself an upgrade DVD and done a DVD-based upgrade.

That the DVD upgrade from my recovered Fedora 8 system to Fedora 9 also failed (because of the grub/fd0 problem) does suggest that a classic DVD upgrade, and not doing a yum upgrade would not have prevented me from experiencing problems (although it might have saved me a full days work). However I do find it hard to believe two separate problems, one software and one hardware related, would appear simultaneously.

I'm still waiting for the Fedora 9 yum update to finish before I shutdown and go poking inside the machine to see if I can find out what is causing my floppy drive problems. Without solving that issue there is no point attempting to upgrade to Fedora 10...

Anyway, time will tell whether I can get the system safely upgraded to Fedora 10.

Thursday, March 26, 2009

Dyson


The NYT magazine covers Freeman Dyson in a multi-page article by Nicholas Dawidoff: "The Civil Heretic." Sadly the elderly Dyson is now more famous for his current climate change contrarianism than his more interesting earlier work, or even the fun but speculative stuff like Dyson Spheres or Project Orion.

This prompted Andrew Revkin to produce a somewhat more nuanced discussion of Dyson on his Dot Earth blog: "Some Inconvenient Thinkers", although it annoyingly stops short of actually discussing why Dyson is wrong, and instead pretty falls into modern journalism's classic statement of false objectivity: "He might be right, he might be wrong. What do you think?"

Climate Progress (who really seem to dislike Revkin despite the fact he's generally does a decent job of covering science and climate change - he's certainly infinitely better than Tierney) then produced a rather uncivil blog article pointing out how Dyson has been far from civil when discussing actual qualified climate scientists. Although uncivil, it at least has some discussion of why Dyson's beliefs are simply absurd, and links to Only In It For The Gold's calmer explanation of Dyson's mistakes.

Ultimately I think Dyson's contrarianism is not as harmful as many of the other climate change contrarians, largely because Dyson's rejection of climate change are not driven by political or economic biases, but rather a mistaken belief in his scientific ability. Its somewhat sad to see once great scientists go off the deep end when they get old. Some, like Fred Hoyle, go off the deep end even before they get old.

Non-Tweetle Beetle Battle


Nicholas Wade at the NYT has a nice article about the often extravagant results of sexual selection, which as accompanied by a beautiful slide show of beetle horns. Worth a look!

Why am I reading the NYT science section during work hours? Because I have to do something educational while I wait for my full system restore on my workstation to complete (recovering from a tragically failed upgrade to Fedora 10 x86_64 from Fedora 8).

Thursday, March 19, 2009

Cephalopods, Old and New

PZ Myers at Pharyngula discusses some spectacularly preserved 95 million year old fossil octupuses from Lebanon. Although superficially similar to modern octopuses in external appearance (8 tentacles and all that stuff) the structure of the their gladius (the remnant of the molluscan shell) is intermediate between older cephalopods and modern octopuses.


Ed Yong at Not Exactly Rocket Science discusses what the stomach contents of Sperm Whales can tell us about large deep-sea squid (including Giant Squid) and octupuses. 13C to 12C isotope ratios in the undigested squid/octopus beaks tell you about the depth at which the animals live, while 15N to 14N ratios tell you its position on the food chain.

[Image of scientists examining whale stomach contents from a whale that stranded itself come from Karen Evans's web page.]

Tuesday, March 17, 2009

Why subsidizing Solar power makes sense

George Musser defends himself against claims that he is a "freeloader" for installing state-subsidized Solar panels on his home over at SciAm.

I wonder if the reader who accused him of being a freeloader also calls farmers, or the coal and oil industry, freeloaders as they are also very heavily subsidized by the taxpayer?

Tuesday, March 10, 2009

Sustainability


SciAm has a short but interesting article by Michael Lemonick on the "Top 10 Myths about Sustainability":
  • Myth 1: Nobody knows what sustainability really means.
  • Myth 2: Sustainability is all about the environment.
  • Myth 3: “Sustainable” is a synonym for “green.”
  • Myth 4: It’s all about recycling.
  • Myth 5: Sustainability is too expensive.
  • Myth 6: Sustainability means lowering our standard of living.
  • Myth 7: Consumer choices and grassroots activism, not government intervention, offer the fastest, most efficient routes to sustainability.
  • Myth 8: New technology is always the answer.
  • Myth 9: Sustainability is ultimately a population problem.
  • Myth 10: Once you understand the concept, living sustainably is a breeze to figure out.
[Trash image from: http://farm1.static.flickr.com/129/319298351_724779cb39_b.jpg]

Saturday, March 7, 2009

Please go Galt.

Hilzoy at Obsidian Wings urges conservatives to do what they've started threatening to do: go Galt. I wish they would.

Hilzoy expresses (mock) puzzlement that none of them seem to have acted on the beliefs they're so eager insist are correct, rational and "objective". Its pretty obvious why they only threaten to go Galt, but never do so.

If they all did go Galt society would continue as well if not better than before, so the glorious social experiment would only serve to demolish the sophomoric fantasy they use to justify their greed and lack of compassion.

Friday, March 6, 2009

OSX Leopard: What is the /home directory for?

What is the /home directory in OSX 10.5 for? It appears to be:
  1. Empty.
  2. Created or last modified when the machine last booted up, with user.group of root.wheel (this differs from /Users which is root.admin).
  3. Impossible to copy to, even as root. You just get "Input/output error".

I was trying to change the default user home directory location on my Macbook from /Users/<username> to /home/<username>, so as match Linux and simply rsyncing between my linux boxes and the macbook, using one of the following methods described on macosxhints (1 , 2 ). (They were not trying to use /home but move the home directories to a separate volume.)

I can't find any mention of "/home" and OSX anywhere on the web, and leaving off the / just gives articles talking about /Users/. BSD seems to use /home (just like a sensible *nix), so I doubt its a BSD versus Linux thing.

Macports?

I see scipy is available under Macports. Doubt is setting in. Maybe I shouldn't have gone with fink.