Nature’s flawed programming

I came upon this interesting tidbit in my Artificial Intelligence readings.

A sphex (a kind of wasp) will, in the process of building a nest, dig a burrow, find an insect and sting it, drag it to the burrow, enter the burrow again to inspect the nest, drag the insect inside, and lay its eggs. That, as we shall soon see, is the sphex’s built-in program for constructing a nest.

If someone (an experimenter, or some nosy kid) picks up the paralyzed insect and moves it a few inches away, the sphex’s program gets reset. The sphex now drags the insect to the burrow, and is compelled to re-enter the burrow to inspect the nest _again_, even though it has just checked. It does this even if the insect is moved away repeatedly, without the sphex ever realizing what is going on. The sphex is unable to learn that it’s program is failing, and will not change it.

“… the beetle continues on and pantomimes plugging the nest with the nonexistent ball of dung!”

Even more amusing is the dung beetle, which goes off to fetch a ball of dung to plug its nest entrance. If the ball of dung is removed from its grasp _en route_, the beetle continues on and pantomimes plugging the nest with the nonexistent ball of dung! Nature (or evolution, depending on your opinion) has built in a pretty rigid program into the beetle’s behavior.

It is interesting to discover lifeforms as large as a sphex or dung beetle that don’t have the capability of learning, of going beyond its genetically programmed behavior. Makes the _Home Sapiens_ and the thinking species (dolphins, whales, primates) all the more intriguing.

Dealing with colors

Several tools to help the web developer in color scheming and color management.

  • Iconico’s Color Picker is a free Windows application that helps you pick colors and save them to your swatch. Very good for picking colors from sites and pictures. My only grouse is that it doesn’t allow you to save your swatch.
  • Color Schemer helps to create a color scheme when given a particular color. The resulting schemes don’t always work though.
  • Color Blender does as its name suggests - it blends 2 colors into 1. The results can surprise you - you may just find your new favorite color with some experimentation.
  • ColorChip is a PHP class that, given a single color, produces the complementary color, nearby hues, a light to dark version of the color, and more. You have to try it to be impressed.

Genetic Algorithms links 2

More GA links. For archival purposes.

DHTML Lemmings

This is nostalgic - DHTML Lemmings. I still haven’t figured out how he did it (he says it’s “all written in JavaScript” - pretty amazing!), but it plays just like the classic Lemmings.

Two thumbs up, for the spectacular use of JavaScript, and also just because it’s Lemmings.

Tracking entry referrers with PHP in MT

I’ve always wanted to track referrers for each entry and at the same time be able to tell which entries are the more popular ones by keeping track of each entry’s hit count.

So I did the smart thing first by Googling to see if anyone else had done it. I found the AWStatsReferers MT plugin at the MT Plugin Directory but it requires your host to have AWStats installed. My host doesn’t, and I wasn’t going to get them to install AWStats just so I can track referrers for my blog. Refer is a referrer tracking script that turned up - it actually seems like it could do what I wanted with a little tweaking, but a look at the code left me thinking there should be a simpler way to achieve my more specific goals (i.e. track referers and, consequently, hit count for each entry).

So, hey, I decided to whip up a simple hack of sorts using PHP and a database table to store the referrers.

Read the rest of this entry »