15 Oct 2008

Privacy? I've heard of it

eBay isn't so much fun any more since bidders' identities were hidden (except for winning bidders). The joy of snoopage has been drastically curtailed. Nevertheless, it is still possible to hit comedy gold.

Just an hour ago I got outbid on a couple of items. Outrageous! How dare you! So, what else has the rich winning bastard (whose nym reeks of the odious cult of the Great Western Railway) been buying?

it's PILE CREAM! YAY!

HA HA HA HA HA HA HA HA HA HA HA! (gasp) (gasp) HA HA HA HA HA HA HA!!!

And for more voyeuristic lulz, check out the other purchasers - and in particular, note the rather unfortunate nym that's first on the list!

These people have BUM GRAPES!

Dear fluidpharmacy - thank you, thank you, for not making this a private auction. You have made my day! Stuff privacy! I *love* the surveillance society!

9 Oct 2008

Feeding my inner geonerd

We interrupt this embarassing blogosilence with a post about openstreetmap.

Why the silence? Well, I was going to do a Photo Tutorial Part 3, about focus stacking, but attempts to produce a satisfactory focus-stacked photo using enfuse were unsatisfactory, whereas proprietary software, using the same images, produced much better results. Grrr! Sulk, sulk.

Anyway, recently there took place the Openstreetmap Bradford Mapping Party, a concerted attempt to survey and map the inner city of Bradford. Openstreetmap is a worldwide wiki-style project to produce detailed free-licensed mapping. So along I went. Unsurprisingly, the OSM posse turn out to be a well organised bunch of geeks armed with appropriate electronics, pencils, and, in some cases, bicyles. These fine people had been drawn to the unmapped, unlovable void of Bradford by nothing but altruism, enthusiasm, team spirit, love of a challenge, and rampant ignorance of what a shit hole modern Bradford really is. As it turned out, I was both the token local and the token newbie. The weather was astonishingly good, the sponsor's sandwiches were heartily useful (thanks!), my mentors Andy and Nick kindly transmitted their knowlege and enthusiasm, and, oddly, nobody got mugged.



On the Saturday, Nick showed me the ropes around the city centre and between Manchester Road and Little Horton Lane. This bloke got very agitated at the sight of my camera when he wandered into shot outside Tudor Court flats on Manchy Road. So here he is blown up and enhanced in all his Lucozade carrying glory. Go on mate, sue me like you threatened.



Nick and me were hugely amused by this pound shop in Broadway - well, what's left of Broadway - which is having a 50p closing down sale. Laughing apart, it really emphasises the current ruinous state of Bradford, which has somehow managed to fall to pieces during the ten year economic boom. God help us all when the forthcoming depression hits.



On the Sunday, my allotted patch was the old mostly industrial area at the bottom of Wakefield Road. I had a go with my newly-acquired Really Crap Old Camera, a Fuji MX-1200. The theory is that it is so awful that nobody will want to mug me for it, and even if they do, I won't mind handing it over.  It really is rubbish: grainy as hell, ghastly jpeg overcompression, fixed lens with dreadful barrel distortion and chromatic aberration, lousy obsolete "Smart Media" media.



So now, after a week and a half of editing and rendering, the central area of our fine city is quite well mapped, a vast improvement. It's going to be a long, slow job titivating it, but I'll be having a go, and I've even made a start on my own little patch, safely outside the ring road.

UPDATE -- Forgot to mention, while mapping "my own little patch", I've found a toroidal street (Willow Crescent) in which half the torus is numbered in the normal manner, odd on one side and even on the other, but the other half has even numbers on both sides of the street.

2 Aug 2008

Photo tutorial, part 2 - HDR Lite with enfuse

One of the frustrations of digital photography is the urge to grab shots in ever more marginal situations, and then when they turn out to be less than perfect you feel cheated. This is a particular problem with the sort of stuff I do; inevitably, here in Yorkshire, landscapes and buildings are dark, with a sky background that's often overcast cloud, and I'm not always willing or able to visit when the all-too-rare sun's at an ideal angle.

In recent years people have turned to HDR (High Dynamic Range) techniques. They take photos "in RAW format" (a crass bit of misterminology we're sadly stuck with) and they fiddle about using various dodgy algorithms which "tone map" what the camera saw, compressing it into the far narrower range of light and dark that a screen can display. The end result is highly dependent on the taste and effort of the person who does the tone mapping. Unfortunately, most people are hopelessly lazy and have an over developed sense of their own arty-fartyness, and you get horrors like this - here's one I prepared myself using the relevant free software tool, qtpfsgui - a fine piece of software when in the hands of someone with copious time and good taste, but the net is full of dreck like this from people who have neither:



Well, bollocks to all that. There's a better way. It uses two of the new command line tools that come with recent versions of Hugin. (At the moment you need to compile them yourself but a proper release is on its way. I've prepared some SlackBuild scripts and will be submitting them to slackbuilds.org when the release happens.)

First, I use the camera's built in exposure bracketing - when I press the button it takes three successive snaps. The first is a supposedly correct exposure, the second is one stop overexposed to capture the dark details, and the third is one stop underexposed to capture the light details.



But these are successive separate photos, taken half a second or so apart, and movement can occur between them. So, back home, I use align_image_stack, one of the command line tools that comes with Hugin, to fine tune the alignment of the three images. Then I use enfuse, another of the Hugin command line tools, to merge the three aligned images. It works by estimating how authoritative is each region of each input image - a well-exposed region has lots of variation of brightness - and creates a single merged image using appropriate weighting. None of the hideously unnatural tone-mapping nonsense!



The workflow, including a quick final sharpness and colour tweak in the Gimp and save back into JPEG format, looks like this:


align_image_stack -a $TMPDIR/align dscf1234.jpg dscf1235.jpg dscf1236.jpg
enfuse -o dscf1234enf.tif $TMPDIR/align*
gimp dscf1234enf.tif
exiftool -TagsFromFile dscf1234.jpg dscf1234enf.jpg

Note that the final merged image (due to its brief detour into TIFF format) has no EXIF data. What I do is just copy the EXIF from the first of the three images using exiftool - the first image is the one with no exposure bias, so its shutter details are reasonably representative of the synthetic merged image.

The big problem with this technique is movement. The slightest rustling of wind in the foliage, or the presence of people, animals or vehicles, will produce ghostly effects like this:



However, if the movement is small enough, you can get away with it; you just get a slightly peculiar fluffy effect in the trees, and water comes out looking quite good.



At the end of the day, this is just another technique to use when the results are worthwhile. If you get back home and find that movement ruined the multiple exposure, or it's just too much bother for a casual snap, you can always just select whichever one of the three images is best exposed and tweak its contrast a bit.

28 Jul 2008

Photo tutorial, part 1 - Geotagging

With the one and only hugin edging towards a release, I thought it might be worth typing up a series of notes about the photo editing tools I've been using lately.

So the first bulletin is about Geotagging using Linux. There are quite a few tutorials out there, and they're all, quite frankly, rubbish. Here's what I do and how I do it. Three packages are required: exiftool, gpsbabel and gpscorrelate.

First, get yourself a sweet, cheap yellow eTrex and a data cable. I am SICK, SICK, SICK of all the morons on Panoramio, Geograph, Flickr etc who are incapable of pinpointing the correct location on a map. BUY A BLOODY GPS!

Just before you start photographing, turn the GPS on, get a fix, and change the display so that it shows the time of day, and take a photo of it. Carry the GPS with you, enjoy yourself, take nice photos.

Then come home and upload your photos to a nice clean new directory. First, we're going to use exiftool to adjust the EXIF date-time of all the photos according to the GPS date-time that was shown on your eTrex when you photographed it.

Look at the photo of your eTrex. For example, if the time in the EXIF data is 21 seconds earlier than the time shown on the GPS, you need to add 21 seconds to the EXIF data using the command

exiftool -AllDates+="0 0:0:21" .
This will correct the EXIF date-time of all the photos in the current directory (use your common sense - if the time in the EXIF data is one minute 18 seconds later than the time shown in the photo, use -AllDates-="0 0:1:18"). It'll create new copies of all the files; the originals will be renamed from *.jpg to *.jpg_original.

I mean, obviously, given the inevitable small discrepancy between your camera's time and the GPS's time, the GPS is the one that's right, right? So you want to fix all your photos, right? And you can do this all in one go with just one exiftool command, right? So why the bloody hell don't any of the bozotic so-called tutorials out there ever mention it?

But don't attempt to compensate for time zone differences at this stage. You'll want your photos to have the correct local time in the EXIF data (since you're about to write some additional tags that contain lat/long and UTC.)

Next, plug in your eTrex with your data cable. Turn on the eTrex, make sure that SETUP -> INTERFACE has I/O FORMAT set to GARMIN, and use gpsbabel to grab a copy of the active track log. (My data cable is serial and plugged into ttyS0; YMMV.)
gpsbabel -t -i garmin -f /dev/ttyS0 -o gpx -F tracklog-$(date '+%Y-%m-%d:%T').gpx
And now fire up gpscorrelate-gui.



Click the 'Add...' button and select all your photos. Click the 'Choose...' button and select your track log. Now set 'Max gap time' to something like 300 seconds, and set your time zone (negative is west of the prime meridian) - it'll remember these two values, so you won't need to set them every time. Don't tinker with the Photo Offset! Leave it at 0! And finally, just click 'Correlate Photos' and watch the miracle of geotagging unfold in the blink of an eye.

Easy, innit?

25 Jul 2008

Architectural Backblog

It's been far too long since I posted anything here so let's do some unfocussed moaning about old buildings.

The local newspaper has noticed the dismal state of Wapping Road School (Historic school being left to rot), which I wrote about on 8th December last year. Apparently the planning impasse that was holding up redevelopment is now almost at an end, but a huge amount of damage has been done, and one can't help wondering how much more intentional damage will be done in the name of redevelopment. Yeah, more flats. Indeed, with the current economic downturn the question is when or whether work will actually start, and how much more deterioration will occur meanwhile.



My attention was originally drawn to the school by a report on the urbex forum 28dayslater. Well, 28dayslater went into a self-imposed sulky freeze for a while, but now it's back - hoorah! - and the brave explorer of Wapping Road School, converse1, has just posted a report on another of my minor obsessions, the Grade II listed chapel in Bowling Cemetery. Shipley43 on flickr passed this way too recently and refers to the 2003 grumble from Bradford Building Preservation Trust about this and three other cemetery chapels. Needless to say, no progress is made, the building is getting worse year by year, set ablaze and torn apart by vandals, with no realistic prospect of being saved.



The hot online mapping news is that Microsoft's Live Search Maps has just rolled out detailed oblique angled aerial photography data (which it strangely calls 'birds eye').  It's quite high resolution and seems to date from 2007.  The official announcement stated Calderdale was the only place to get this in the whole of Britain, but in fact Bradford is also included.  By contrast, Google's coverage is stuck back in 2002 and Microsoft's vertical data, purportedly copyright 2007, is even older than Google's (see, eg, Bolton Woods quarry).  However this is historically quite interesting because 2002 predates the disastrous mass demolition of Forster Square and Broadway.  Compare below to see the extent of the damage.  And now this week we are informed that the current flurry of work on the Forster Square site is just a blip (strangely coincidental with the council elections) and the site will sink back into inactivity until more tenants are signed up.  Pity poor Bradford.



4 May 2008

Bus Porn





Edited 28/7/2008 for new links

4 Apr 2008

Look what I found!

The two quarry faces at Wrose Hill are a designated Regionally Important Geological Site (RIGS). "The upper quarry exposes mudstones and siltstones coarsening upward into the sandstone of the 48 Yard Rock. This sandstone may be interpreted as deposition in a mouth bar", according to wyorksgeologytrust.org.

 

The write-up continues: "A rock fall in 2004 has revealed many well preserved plant fossils together with the sand filled burrows referred to as Arenicolites carbonarius." The rock falls have continued, and here's a boulder with several fossil log impressions -

 
 

And here's a boulder showing the Arenicolites burrows, a wonderfully preserved section of beach from 315 million years ago -



And finally, here's a boulder with a superb beach ripple pattern -

21 Mar 2008

234 years ago today

The first stretch of the Leeds & Liverpool Canal (from Skipton to Thackley) was opened 234 years ago today, on the 21st March 1774, when five laden boats descended the Bingley Five Rise locks watched by thousands of people. The Leeds Intelligencer described the occasion thus: "From Bingley to about 3 miles downwards the noblest works of the kind are exhibited viz: A five fold, a three fold and a single lock, making together a fall of 120 feet; a large aqueduct bridge of seven arches over the River Aire and an aqueduct and banking over the Shipley valley. This joyful and much wished for event was welcomed with the ringing of Bingley bells, a band of music, the firing of guns by the neighbouring Militia, the shouts of spectators, and all the marks of satisfaction that so important an acquisition merits". Here are some photos, mostly taken today, of the "noblest works" mentioned above.

Bingley Five Rise Locks


Bingley Three Rise Locks


Dowley Gap locks - the 'Leeds Intelligencer' got this detail wrong, this is a two rise staircase


Seven Arches Aqueduct, Dowley Gap


The embankment at Shipley near its crossing of Bradford Beck


The bicentenary commemorative plaque at Bingley Five Rise Locks


(Lots more Leeds and Liverpool Canal photos in my Picasa album)

14 Mar 2008

Quotes of the Month

Yes, it's only the 14th, but how could these two be bettered?

Re: MOG: SCO to cleave in twain
Msg: 59007 of 59222 3/11/2008 5:51:02 PM
Author: CDBaric
In response to msg 58983 by _Arthur
Recs: 37

"It looks, however, like there’s gonna be two entities once SCO’s out of
Chapter 11: one that pursues the myriad litigation (what the plan calls
the SCO Group) and the other that minds the Unix store (what the plan
calls Reorganized SCO)."


What an excellent idea!

Just think if Exxon had thought of such a thing. Exxon could have divided
itself into two entities, (1) Drunken Shipping, and (2) Everything Else.
It is of course to be expected that the Drunken Shipping division wouldn't
have much in the way of assets, just a broken boat and some oil
(unfortunately distributed all over some rugged coastline).


I think MOG has truly devined the next big thing in corporate deniability.

Amazing!

Bar

Re: Microsoft Predicts Computing Trends for late 1900's
Msg: 59182 of 59222 3/13/2008 1:08:46 PM
Author: karl_w_lewis
In response to msg 59181 by peredurabefrog
Recs: 14

>> Microsoft have loads of applications that use all the power of modern
computers and more (if the performance of my wife's laptop is to be
believed). Their problem is in trying to do something useful with it
rather than using it to power a bloated user interface. <<


Well, that is a novel solution to the old issue... Power, you see, can be
used for Good, or for Evil, or, (as it turns out), for the User Interface,
which obviates the whole Good Vs. Evil quandary.


KWL

12 Mar 2008

Lulz Redux

So, it finally happened: nearly two years after the relevant events, the news broke [SMH, BBC] about Jeff Merkey's wikipayola. The only problem is whether this notorious kook and fantasist actually paid any money, or is merely off in his separate reality pretending he did. The wikinerds, who previously banned those who warned them that Merkey's word was not to be trusted, are now to be observed wailing exactly that to a largely indifferent world - whilst maintaining, even now, that Merkey's a good guy [JzG] and the Y!SCOX crowd are trolls [JzG, SirFozzie]. And meanwhile, an anonymous IP keeps whitewashing the Merkey article and discussion: interestingly, a traceroute goes via 166.70.235.16, aka a node named jmerkey.fttp.xmission.com... Sometimes, connecting the dots is just too easy.

In other news, the heroic Patent Troll Tracker is being sued into silence: "Just this morning we were lamenting the fact that the formerly anonymous Patent Troll Tracker had shut down his blog, but now we know why. It appears that two patent attorneys in East Texas have sued him and Cisco for defamation. One of the attorneys happens to also be the son of the judge who helped make Marshall, Texas famous as a favorite for patent holders..."

And in other other news, the redaction to SCO's Motion for Judgment on the Pleadings is just in. They say, get this, that if Novell didn't approve the SCOSource swindle, then Novell isn't entitled to the swag...

22 Feb 2008

Another Friday Memebog

It's back! A superb example of web publishing at its best, Lost Railways of West Yorkshire disappeared from the net for a while, but now it's back, with quite a lot of new material. Even the links page is a delight: foremost amongst which are Forgotten Relics of an Enterprising Age and Bradford Villages. These are all sites that do what I would love to do, but do it better than I ever could.

Google have announced a new static Google Maps API. Similar in spirit to the Charts API that I've been using to graph my diabetes monitoring, it would have done nicely for the map of Bradford's SSSIs in my prior post. An equally interesting alternative is Ordnance Survey Openspace, announced earlier this year. Currently in 'alpha', it will be interesting to see how it develops. Currently it has 1:50000 and street-level mapping. However, the latter is bereft of any terrain or footpath features, and the 1:.25000 maps are apparently still considered too valuable. The ideal tool would combine layers for historic mapping, aerial/satellite photography, geotagged images and the OS 1:25000 data; interestingly, some of that exists already at ponies.me.uk.

15 Feb 2008

Friday Memebog

Years ago, before Reddit and Digg and their ilk, there was memepool. Alas, the pool has dried up like the Aral Sea. But in an act of tribute here is the first ever Friday Memebog - notable outwash from this week's Intertube effluent. This week: a 100% Copyfight Edition.

Patry casts out the folk devils

Here is the man who Wrote The Book (seven volumes) on copyright, laying into the cretinous meme we see so often in the UK, that knockoffs support organised crime and terrorism: "There are some notable omissions from this list, like Hamas, Al Qaeda, the Shining Path, and the Tamil Tigers. It is heartening to know that some terrorists draw the line at copying Western fashions. Perhaps there is hope that they, like Anakin Skywalker, can be turned from the Dark Side. It is less clear whether our legal system can be. [...] All I want, and I think most people want, is to be able to go to Target to get reasonably priced, safe clothes for our kids without having to worry about supporting child prostitution rings and terrorists. I don't think we are, and it is a sad day when a bill to benefit the tiniest fraction of an industry will be used to destroy the rest of it."

A lovely matching pair of stories about slatternly rightsholders having their bacon saved


First, the story of the restoration of the only live performance recording of Woodie Guthrie. It has just won a Grammy award. But only Techdirt had the guts to point out the multiple layers of hypocrisy and irony: (1) this originated as a bootleg recording; (2) Woody Guthrie's attitude was "This song is Copyrighted in U.S., under Seal of Copyright # 154085, for a period of 28 years [only 28!], and anybody caught singin it without our permission, will be mighty good friends of ourn, cause we don't give a dern. Publish it. Write it. Sing it. Swing to it. Yodel it. We wrote it, that's all we wanted to do"; and (3) the Guthrie estate has 'previous' for copyright evilness in the 2004 JibJab controversy.

Second, the story of Pan Yan Pickle from a couple of weeks ago. The manufacturer lost the only copy of the secret recipe in a warehouse fire. No offsite backup! So they resort to reverse engineering. Of course, recipes are not copyrightable, so anyone could legally do that, but only Premier Foods has the shamanistic Power Of Brand Name. And then we learn: "There's no one in this company who has any idea what this pickle looks like or tastes like. I would ask for anyone who has a first-hand experience of Pan Yan Pickle to contact Premier Foods". A searing example of corporate amnesia: all the expertise that the trademark should connote has gone in just six short years. This is exactly what mergers and acquisitions, downsizing and outsourcing does to an organisation. But they don't teach reality on MBA courses.

Last but not least: SCO has found another seam of money

Out, sadly, will go Darl McBride, in whose downfall I am proud to have paid a tiny part by uncovering the pseudonymous postings of 'his wife' (yeah, whatever) on Yahoo Finance. And in will come our new chum Stephen Norris (no, not Shagger Norris - this one founded the notorious Carlyle Group) and possibly a deniable Saudi presence with a private A380 on order and a diamond studded Mercedes, or maybe it's just Microsoft as usual. But just look who these guys hang out with! Such an improvement on Darl and Ralphie!

14 Feb 2008

Bingley South Bog

The Bradford district has four Sites of Special Scientific Interest (SSSIs).


View Larger Map

South Pennine Moors - several huge areas, "part of the Southern Pennines lying between Ilkley in the north and the Peak District National Park boundary in the south. The majority of the site is within West Yorkshire but it also covers areas of Lancashire, Greater Manchester and North Yorkshire. The largest moorland blocks are Ilkley Moor, the Haworth Moors [both Bradford], Rishworth Moor and Moss Moor. [...] Extensive areas of blanket bog occur on the upland plateaux and are punctuated by species rich acidic flushes and mires. There are also wet and dry heaths and acid grasslands. Three habitat types which occur on the site are rare enough within Europe to be listed on Annex 1 of the EC habitats and Species Directive (92/43) EEC. [...] This mosaic of habitats supports a moorland breeding bird assemblage which, because of the range of species and number of breeding birds it contains, is of regional and national importance. The large numbers of breeding merlin , golden plover and twite are of international importance." Almost all of Bradford's share is assessed as 'Unfavourable', the causes being Air pollution, Inappropriate weed control, Overgrazing, Vehicles, Forestry and woodland management, Inappropriate stock-feeding, Drainage, Moor burning, and the disastrous Ilkley Moor fire of 2006. Besides all that, the ring ouzel is apparently dying out due to climate change. However, some areas are said to be recovering.

Trench Meadows at the bottom of Shipley Glen: "The meadows are of special interest for their neutral grassland, which occurs with smaller areas of acid grassland and rush pasture. [...] Unimproved speciesrich lowland grassland of this type is now a nationally rare habitat." But the site's state at the last assessment in 2003 was "Unfavourable declining": "The grazing tenants finished in November 2002 after 30 years therefore the site has not been grazed since then. New tenants will have to be found as soon as possible or the site will continue to deteriorate. "

Yeadon Brickworks And Railway Cutting - a geological site, shared with Leeds: "The rock exposures within this site provide a most important cross-section through shales and sandstones of the Namurian Series, originally formed about 350 million years ago during the Carboniferous Period of geological history. [...] This site has been proposed as the standard for one of the major subdivisions of the Carboniferous Period, named the Yeadonian Stage." Thankfully there's not much that can be done to wreck such a site, though the most recent assessment notes of the Leeds side: "An increasing amount of fly-tipping at base of slope including a burnt out car, ideally all of which should be removed." Lovely.

Which brings us to the star of tonight's exposition:

Bingley South Bog "This small mire occupies a peat-filled hollow in undulating ground between the Leeds-Liverpool Canal and the River Aire, at Bingley, north of Bradford. Despite drainage and hydroseral succession, the surviving wetland provides a transition from fen to dam neutral grassland, maintained in a species-rich condition, probably by grazing." There are a profusion of relatively rare plants, including the marsh cinquefoil (Potentilla palustris).



A new road, the A650 Bingley Relief Road, was built right across this site. There's no denying that a new road was desperately needed. It opened at the end of 2003, and won the 2004 Prime Minister's Award for Better Public Building. A special low level elevated section was built to cross the SSSI ("Particular features of the solution included: innovative jetty-style precast integral structure over Bingley South Bog SSSI", in Arup's PHB-speak. They also boast of "effective public relations and exhibitions dealing with sensitive ecology and environment in a busy, semi urban context".) A press release gloats: "South Bog Viaduct is an excellent example of what can be achieved in a design-and-build context, using innovative thinking throughout the team. The design, which had started life as a steel concept, was radically rethought, making extensive use of precast concrete to achieve an elegant, practical, and low-cost solution. Many aspects of the design were driven by environmental issues, which were difficult to reconcile. The triumph of this structure lay behind how these were overcome to result in a simple structural form that complements its surroundings and absolutely minimised any short- or long-term effects on the natural habitat."

So what happened next?

"04 Jan 2005 Destroyed The strip of land beneath the new road bridge is now devoid of vegetation therefore the habitats that were there previously have been destroyed."

26 Jan 2008

Bug: Glew and Mesa Glut

There is a macro definition clash between Glew's glew.h and Mesa Glut's glut.h on Unix. Any program using Glew fails to compile. The problem does NOT occur with other Glut implementations (freeglut, Kilgard glut).

I am using Slackware Linux 12.0, Mesa 6.5.2 and Glew 1.5.0. However, the problem is present in all recent versions of Glew, including svn, and all recent versions of Mesa Glut, including git.

Other people have had the same problem:
http://www.nabble.com/glew-header-trashes-glut-header-tc7610932.html
http://groups.google.fr/group/linux.debian.bugs.rc/browse_thread...

I first encountered this problem when trying to compile enblend, but even the following trivial test program is sufficient to demonstrate the problem (thanks Philippe Després). It doesn't compile.

#include <GL/glew.h>
#include <GL/glut.h>
int main()
{
return 0;
}
  • First, the application #includes glew.h
  • glew.h #defines GLAPIENTRY -- for Unix this is line 209 of glew.h, and GLAPIENTRY is defined to be empty
  • Then glew.h #includes glu.h at line 1137
  • Then glu.h #includes gl.h which redefines GLAPIENTRY (consistently with glew.h)
  • Then glew.h uses GLAPIENTRY (successfully), and eventually #undefs GLAPIENTRY at line 10767
  • Then the application #includes glut.h
  • Then glut.h #includes glu.h at line 11
  • But glu.h has already been included, so glu.h does nothing (it checks __glu_h__ in the usual way)
  • Then glut.h uses GLAPIENTRY at line 196
    # define GLUTAPIENTRY GLAPIENTRY
    In other words, glut.h expects to get GLAPIENTRY from glu.h, but glew.h undefined it.
  • So GLUTAPIENTRY now contains the string "GLAPIENTRY" instead of being empty. This causes compilation errors throughout the rest of glut.h, starting on line 531
    GLUTAPI void GLUTAPIENTRY glutInit(int *argcp, char **argv);
    which produces these errors
    /usr/include/GL/glut.h:531: error: expected initializer before 'glutInit'
    /usr/include/GL/glut.h:539: error: expected initializer before 'glutInitDisplayMode'
    /usr/include/GL/glut.h:541: error: expected initializer before 'glutInitDisplayString'
    /usr/include/GL/glut.h:543: error: expected initializer before 'glutInitWindowPosition'
    /usr/include/GL/glut.h:544: error: expected initializer before 'glutInitWindowSize'

    etc etc...

The obvious solution is to delete the #undef at line 10767 of glew.h. Here's the trivial patch:
--- glew-1.5.0/include/GL/glew.h        2007-12-28 03:09:49.000000000 +0000
+++ glew-patched/include/GL/glew.h 2008-01-26 11:45:27.000000000 +0000
@@ -10764,7 +10764,6 @@
#ifdef GLEW_APIENTRY_DEFINED
#undef GLEW_APIENTRY_DEFINED
#undef APIENTRY
-#undef GLAPIENTRY
#endif

#ifdef GLEW_CALLBACK_DEFINED

9 Jan 2008

Musical Maxtor

Well it's been a typical Christmas and New Year. Phone line down (rainwater in cable splice), one bereavement, one separation, and four PCs worked on at friends and family rate (ie, £nil and intolerable working conditions).

One of the PCs had been reported to me as 'playing a ringtone when you turn it on'. This wasn't 'Für Elise' (which some bioses play on low voltage or failed CPU fan). It was a nine-note quick beep pattern, consisting of a rising tritone repeated three times.

On opening the case, it became apparent that the beeping was coming from the disk drive (*boggle!*), a notorious Maxtor 6Y120L0 Diamondmax 9. Uhh?! A beeping disk drive! And it was being detected, but it wasn't spinning up. So, it deserved Punishment. Power was applied and I gave it a good clonk, and Lo! It was Healed!

The next step was to get a replacement. The household I was visiting is a desolate unwired backwater in the wasteland of South Wales, so the only recourse was to pick a local PC emporium from the yellow pages. There was but one, which turned out to be a slightly seedy repair biz above a betting shop, but they did have a Hitachi 160Gb Deathstar. Took it back, booted Knoppix from CD and dd'ed the whole of the old disk to the new. Worked perfectly (fsvo, this being Win XP on NTFS).

Back home, I researched the musical Maxtor phenomenon. There's nothing on the official site about beep codes, and in particular the so-called troubleshooter admits no possibility of beeps or failure to spin up. No. Can't possibly happen. What a bunch of useless lying corporatist bastards. There are even some old forum posts out there citing an official denial that Maxtor drives ever beep, and pig headed dismissiveness at the risibly misnamed Experts Exchange (motto: pay dollars, read bollocks!) Nevertheless, there are plenty of other folk reporting exactly the same experience - that a triple-tritone beep from a Maxtor Diamondmax drive means spin-up failure. It's not a fantasy, it's real.