Sunday
Jun272010

Hoverflies

A female hoverfly, Volucella pellucens (Diptera: Syrphidae).  In this species the scutellum apparently varies from brown to black; see here for some photos of a brown-scutellum specimen.

This is male (the eyes are in contact on top of the head):

Photo taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2010-06-23 (the female) and 2010-06-20 (the male).

Saturday
Jun262010

Thistle Gall Flies

Yet another species of picture-winged fly, this time on thistles (Cirsium sp): probably Xyphosia miliaria (Diptera: Tephritidae).  Similar to the Terellia tussilaginis that I saw on burdock last year, but the wings don't have the faint yellow bands.

The flies in these three images appear to all be males.

Photos taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2010-06-23.

Friday
Jun252010

Gitignore Files disappearing from CodeIgniter Captcha Directory

I am using Git to manage the development and deployment of a website built using CodeIgniter and Tank Auth. In order to prevent git status from flagging captcha image files created during testing, I have placed a .gitignore file into the captcha directory. This file contains the single line:

  *.jpg

However, the captcha plugin supplied with CodeIgniter is a bit overzealous when it comes to cleaning up expired captcha image files: it also deletes the .gitignore file. This happens even when the web-server does not have write access to the .gitignore file. On Linux (I don't know about Windows) to delete a file from a directory you only need write access to the directory, not to the file itself.

[See the update at the foot of this post for a much simpler fix than this one.]

My fix for this was to change the Codeigniter captcha plugin so it only deletes *.jpg files. In file system/captcha_pi.php I changed:

  while($filename = @readdir($current_dir))
{
if ($filename != "." and $filename != ".." and $filename != "index.html")
{
$name = str_replace(".jpg", "", $filename);

if (($name + $expiration) < $now)
{
@unlink($img_path.$filename);
}
}
}

to:

  while($filename = @readdir($current_dir))
{
$name = str_replace(".jpg", "", $filename, $count);

if ($count and ($name + $expiration) < $now)
{
@unlink($img_path.$filename);
}
}

I do not currently have the CodeIgniter cache or logging functions enabled, so I don't know if .gitignore files in the system/cache and system/logs directories will also suffer such deletions.

Friday
Jun252010

Falconry for the Hard-Up

See here.

Friday
Jun252010

Cornflower

Cornflower (Centaurea cyanus).  In an area of grassland that appears to have been deliberately sown with the the seeds of flowers selected to attract insects.  From the side it looks like this:

The leaves are narrow and slightly hairy:

Photos taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2010-06-15.