Entries from September 1, 2009 - September 30, 2009

Wednesday
Sep162009

Chevron Moth

From back in the first half of the summer, what I now think is a chevron moth, Eulithis testata, (Lepidoptera: Geometridae).  Initially I thought it might be a (somewhat faded) barred yellow moth, Cidaria fulvata, but a search through ukmoths.org led me to a better match with the chevron.  The barred straw moth, Eulithis pyraliata, also looks similar, but holds its wings in a completely different way when at rest.  The colour of chevron moths apparently varies from a light yellow as above, to a quite dark brown as shown here at Scarborough Wildlife.

Photo taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2009-06-21.

Wednesday
Sep162009

More Snags in Beginning PHP6, Apache, MySQL Web Development

My progress in working my way through Beginning PHP6, Apache, MySQL Web Development by Timothy Boronczyk et al (Wiley, 2009) has slowed in the past week because I ran into three problems in Chapter 7 (Manipulating and Creating Images with PHP).  Two of these problems turned out to be due to bugs in the book, the other was the result of a dispute between the developers of the PHP GD library and the Debian Linux package maintainers (Ubuntu is based on Debian).  I will deal with the GD library problem first.

  • In the Working with the GD Library section (page 175), it is recommended that you use the version of the GD library the comes 'bundled' with all recent versions of PHP.  I assumed that this is what would be supplied in Ubuntu.  I did a quick check that gd_info() showed that GD was indeed installed and supported the required file formats (pages 176-177) and then moved on to the code examples.  However, in the Special Effects section (pages 192-202) I got an error stating "undefined function imagefilter()".  It turns out that there are two versions of the GD library, the original one which is included in PHP supplied with Debian and Ubuntu, and the 'bundled' version which is included in all other recent PHPs.  Only the 'bundled' version includes functions imagefilter (and imageantialias, imagecolormatch, imageconvolution, imagecreatefromxbm, imagecreatefromxpm, imagelayereffect, imagerotate, imagexbm).  What seems to have happened is that the PHP developers extended the GD library with some extra functions but did not feed these extension back into the main GD developement stream.  The Debian maintainers, for good software engineering reasons, refuse to maintain multiple branches of software packages, and so insist on including the original GD in the Debian (and hence Ubuntu) versions of PHP (see here for a good account of this affair).  This is all understandable, but it does make things awkward for the users.  I got round this problem by using the fix suggested here (most of the commands need 'sudo' in front of them though).  This fix was good enough to allow me to complete the examples in Chapter 7 but it might not be good enough for a production installation of PHP; see this comment for details.  All in all, a bit of a mess.  I don't think this would have happened with Python!

  • In the Adding Captions section (pages 202-209), if the image caption contains an apostrophe (eg "Tim's image") then, when an image with that caption is previewed, the apostrophe is preceded by a slash (eg: "Tim\'s image").  However, the slash is not present when the image is saved.  There seems to be some sort of implicit encoding and decoding involved in communication via the $_GET array, and the decoding is somehow being omitted in the image preview.  I fixed this by changing the "$_GET['capt']" on page 207 to "stripslashes($_GET['capt'])".

  • In the Creating Thumbnails section (pages 212-216), the thumbnail images are not being written to the thumbnails directory and consequently the full-scale images are being replaced by thumbnails and the thumbnails are not being displayed correctly.  The fix is to replace "imagejpeg($thumb, $dir" by "imagejpeg($thumb, $thumbdir" on pages 213 and 215.

You might think that the presence of errors in a book means that it is a bad book, but this is not necessarily so.  I got this book with the intention of learning about web development, and a lot of web development is tracking down and correcting errors in code.  Yes, it can be frustrating, especially if you are in a hurry, but if you have time and patience you can learn a lot from less than perfect books.

Tuesday
Sep152009

Chalcid Wasps

More photos of the blue chalcid wasps that I first noticed back in late August.  I have now identified these as Ormyrus sp. of the family Ormyridae (order Hymenoptera).  The Ormyridae is a small family with only 4 species recorded in the UK.  They are closely related to the Torymidae, the family that I originally thought these wasps belonged to.  Their most obvious distinguishing features are their metallic blue-green abdomens which look as of they have been embossed with a pattern.

The first two photos are of females walking across knopper galls on oak trees.  This figures because Ormyrus sp. lay their eggs on the larvae of Andricus quercuscalicis, the Cynipid wasp that causes knopper galls.

The following female seems to have a gold band at the front end ofthe abdomen.

And now a couple of males:

The above photo was taken on 2009-09-10, all the rest on 2009-09-05.  All were taken in Whiteknights Park, Reading University grounds, Reading, UK.

Monday
Sep142009

Dagger Fly

A dagger fly, probably Rhamphomyia variabilis, (Diptera: Empididae), on yarrow (Achillea millefolium).

Photos taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2009-09-05.

Sunday
Sep132009

Capsid Bug with Mite

From a few months back, Campyloneua virgula, a capsid bug (Hemiptera: Miridae).  The red lump under its shoulder is probably a parasitic mite.  See here and here for other photos of insects with mites.

Photo taken in Whiteknights Park, Reading University grounds, Reading, UK, on 2009-06-16.

Page 1 ... 2 3 4 5 6 ... 8 Next 5 Entries ยป