Monthly Archive for: ‘July, 2008’
Random Musings From a Week’s Vacation
Some thoughts that occurred to me during, or following, a week’s holiday in Cornwall:
- Cornwall is a long way from Leeds, especially with a toddler in the car. Stopping over half way was a good idea.
- Driving from Leeds to Bristol on a Friday night can cause a man to develop up a mighty craving for whisky.
- There is no booze to be found at the Days Inn at the M5 J19 Gordano services.
- Nor at the nearby petrol station.
- Holidaying with a 12 month-old is a totally different experience to holidaying as a couple.
- In years to come, when The Boy reflects on the newspaper covers from the day of his first birthday, he’ll either think "Wow, doesn’t Obama look young!?" or "Who the hell is that guy?"
- Seeing the number of cute young ladies in Newquay makes me begin to question why I spent so much of my twenties holidaying in bothies in the remotest regions of the Scottish Highlands.
- At £8.50 for approximately 20 minutes’ entertainment, the Blue Reef Aquarium in Newquay is pretty poor value. Fish fans and animal lovers get a better deal at the Scarborough Sea Life Centre, The Deep in Hull, Monterrey Bay Aquarium, the Haus des Meeres in Vienna, or even just Tropical World in dear old Leeds. Yeah, we sure visit the occasional animal house!
- Listening to the same CD of nursery rhymes too many times in succession can do strange things to the mind.
- KenKen appeals to my mindset much more than Sudoku ever did.
- Ben Elton’s latest paperback, Blind Faith, is a good read – especially for those of us who spend too much time exposing ourselves on the interweb.
- A SatNav really comes into its own when holidaying in an unfamiliar area…
- …but having updated maps loaded would have made it even more useful.
- Pervasive GPRS is great, but finding an HSDPA connection is better.
- Brocks Barn is a small but perfectly-formed barn conversion with all mod cons – highly recommended for couples or small families such as ours.
- Getting back into a work mentality after a relaxing week away is tough.
Booze Tech
I got home from work the other night and the wife said “Hey, Ian – watch this!” before proceeding to bash herself around the head with a bottle of wine.
“This,” I thought to myself, “must be a side-effect of staying home with a toddler all day,” as I began to consider how I would cope after she were inevitably sectioned.
But just as I was about to pick up the phone and call the nuthouse, I realised that the bottle was in fact plastic.
It turns out that those clever folk at Wolf Blass have begun shipping their “Green Label” plonk in lightweight recyclable PET bottles, to reduce shipping costs. Whatever next? I’d only just gotten used to screwtops.
Database Design – Still Important In These ORM-Obsessed Days
Tobin blogged earlier this week about how quality ORM tools like NHibernate make it easier to code to normalized schemas.
Here’s a corollary for you: The use of ORM tools doesn’t absolve the need to maintain good database design principles, and even NHibernate won’t save you from your own stupidity.
Following an application upgrade release last night, I’ve spent a disproportionate amount of today trying to debug the following exception, which appeared to originate in an area of the codebase which I personally had heavily modified:
NHibernate.HibernateException: More than one row with the given identifier was found: 42806, for class: Cmec.Core.Domain.Customer
at NHibernate.Loader.Entity.AbstractEntityLoader.Load(ISessionImplementor session, Object id, Object optionalObject, Object optionalId)
at NHibernate.Loader.Entity.AbstractEntityLoader.Load(Object id, Object optionalObject, ISessionImplementor session)
at NHibernate.Persister.Entity.AbstractEntityPersister.Load(Object id, Object optionalObject, LockMode lockMode, ISessionImplementor session)
at NHibernate.Impl.SessionImpl.DoLoad(Type theClass, Object id, Object optionalObject, LockMode lockMode, Boolean checkDeleted)
at NHibernate.Impl.SessionImpl.DoLoadByClass(Type clazz, Object id, Boolean checkDeleted, Boolean allowProxyCreation)
at NHibernate.Impl.SessionImpl.InternalLoad(Type clazz, Object id, Boolean eager, Boolean isNullable)
at NHibernate.Type.EntityType.ResolveIdentifier(Object id, ISessionImplementor session, Object owner)
at NHibernate.Impl.SessionImpl.InitializeEntity(Object obj)
at NHibernate.Loader.Loader.InitializeEntitiesAndCollections(IList hydratedObjects, Object resultSetId, ISessionImplementor session)
at NHibernate.Loader.Loader.DoQuery(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoQueryAndInitializeNonLazyCollections(ISessionImplementor session, QueryParameters queryParameters, Boolean returnProxies)
at NHibernate.Loader.Loader.DoList(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Loader.Loader.List(ISessionImplementor session, QueryParameters queryParameters, ISet querySpaces, IType[] resultTypes)
at NHibernate.Hql.Classic.QueryTranslator.List(ISessionImplementor session, QueryParameters queryParameters)
at NHibernate.Impl.SessionImpl.Find(String query, QueryParameters parameters, IList results)
at NHibernate.Impl.SessionImpl.Find[T](String query, QueryParameters parameters)
at NHibernate.Impl.QueryImpl.List[T]()
at Ventura.NHibernate.Data.DaoBase`2.GetByHql(String hql, String[] _params)
at Cmec.Data.CorrespondenceRequestDao.GetCorrespondenceExtractRequests()
at Cmec.Core.Tasks.CorrespondenceExtractCreationTask.TaskProcess()
at Cmec.Core.Tasks.BaseTask.PerformTask()
at CmecService.CmecService._timer_Tick(Object state)
Got that? NHibernate is telling me that it has found two customers on the database with the same surrogate primary key, which is obviously not the case.
Trusting NHibernate as I do, and not generally being the kind of coder who assumes that the technology is to blame, I then spent literally hours digging through my amended code, trying to figure out what nonsense I could be trying to pull that was confusing NHibernate so, but found nothing.
Too late in the day, I dusted down Occam’s trusty razor, and realised that whilst the main Customers table was correctly enforcing primary keys, I hadn’t checked the various child tables. Lo and behold, less than a minute later I found the following reference data in an innocuous looking table of referrers:

Removing the duplicated entry for "Other", which was incorrectly using the same ID as "Website", solved my problems instantly. And needless to say, I’ve made a note to go add a primary key to that table at the earliest opportunity.
The moral of this cautionary tale – using an ORM makes your life as an application developer easier, makes it faster to develop a DAL, and (to a large extent) decouples your application from your choice of database. What it doesn’t do is allow you to forget the tenets of good database design, in fact as Tobin points out it actually serves to encourage them.
Limited Connectivity BBC News
Further to my previous post about the problems of occasionally having limited connectivity:
One site that seems to deal with this brilliantly is BBC News, which serves up degraded JPEG images when I’m connected via GPRS. How do they know? Or is this functionality implemented by Vodafone’s proxy?
Either way, it’s very clever and much appreciated.
Limited Connectivity Mode
When my business laptop connects to the internet, the following events occur:
- Windows checks for updates and automatically begins downloading any important ones.
- Firefox checks for updates for itself and any installed extensions.
- FoxMarks synchronises my bookmarks.
- Google Talk connects, and checks for any new emails.
- AVG checks for anti-virus updates.
- Windows Defender checks for spyware updates.
- Adobe Updater checks for updates to installed Adobe products.
- Daemon Tools checks for updates for itself.
There are probably more, but you get the idea. Generally, this is a wonderful thing, but not when I happen to be sitting in my car in Cornwall, connecting to the internet via a GPRS connection, and simply trying to check my bank balance. The traffic from all of the above automated events makes this simple task take ages. I wish there were some kind of system-wide setting so that I could prohibit such events occurring if connection speed was below a certain level. Any ideas?
Portable Hard Drives
Oh dear. It looks like my trusty 80Gb Freecom FHD-2 Pro hard drive has bitten the dust, a day after I finally finished installing a VPC of Windows Server 2008 and SQL Server 2008 upon it (coincidence? I suspect not!). Now when I plug in the USB cable, the drive howls like a scalded kitty. Not good.
Apart from VPCs, I generally use my portable HD for convenience of transferring files between work, laptop and desktop, and for holding a selection of the most useful software installations and MSDN ISOs. There’s little on there that isn’t also on one of my PCs, save a few eBooks perhaps, so I haven’t actually lost too much data, thankfully.
I suppose I should think about buying a replacement. As you might expect, storage space has increased somewhat in the three years since I bought the FHD-2 Pro, it seems that 250Gb is the sweet spot for portable drives. Question is, do I go for the surprising cheap and cute Western Digital MyBook Passport, or pay slightly more for the Freecom ToughDrive..?
Old Shoe
I’m reading some of the fascinating case studies on the High Scalability site, and I stumble across this curious bullet point in the page on Amazon’s architecture:
"Don’t pay for performance. Give good perks and high pay, but keep it flat. Recognize exceptional work in other ways. Merit pay sounds good but is almost impossible to do fairly in large organizations. Use non-monetary awards, like an old shoe. It’s a way of saying thank you, somebody cared."
Emphasis mine. What on earth does this mean? Is it some phrase or saying I’m not familiar with? Surely Amazon don’t literally hand out old shoes to their best techies…?
Updated – OK, I just Googled and found some citations confirming that, yes indeed, Jeff Bezos did hand out stinky tennis shoes to Amazon’s high-achievers:
How bizarre…
Little Things That Annoy Me #3
Windows Mobile 6.1′s incessant "wireless network detected" notifications.
This is the summer of 2008. Half the homes in my village, and every business in Leeds has at least one wireless network, they’re no longer the novelty that they once were. Tell that to my Pocket PC, which insists of notifying me every time it spots one, no matter how many times I select "Dismiss" or "Don’t Show Me This Again". The resulting effect is akin to walking through town with a toddler who feels the need to cry out every time he/she sees a bus! Try as I might, I can’t find any option to turn off these notifications entirely.
The really annoying thing is that these notifications have a tendency to mask the other, more useful, things that Windows Mobile can notify you about. My Pocket PC and I have just had a touch-screen dialogue that went something like this:
PC: "Hey, look! A wireless network!"
Me: "I don’t care."
PC: "Over there! It’s another wireless network!"
Me: "I don’t care."
PC: "w00t! It’s another wireless network! Oh boy!"
Me: "Shut up about wireless networks already!"
PC: "Oh, by the way, your accountant phoned earlier. And you’re missing a meeting. And you forgot to submit your VAT return."
Me: "Gah! Why didn’t you tell me this sooner!?"
PC: "Hey, look! A wireless network! And this one is secured!"
[ sound of phone hitting desk... ]
Half-birthdays
Today’s random bit of weirdness – I just received a letter from an insurance company which quotes my "Age at next birthday" as being "32.5 years".
I look forward to receiving all my Happy Half-Birthday cards…
Little Things That Annoy Me #2
The installer for Window Live Writer.
I was intending to write a post moaning about something entirely different, but I’ve spent so long trying to install WLW that it has slipped my mind. Whatever it was can’t have been nearly as annoying as the ludicrous piece of software that seems designed to hinder a timely install of WLW in any way it can.
Why is this so hard? WLW is a simple, tiny, Windows application. Why can’t we just download an appropriately usable installer that just installs the app and gets out of our face, instead of offering a whole suite of other applications, searching the hard drive for something-or-other, and ultimately failing to do what was originally asked of it?
Gah!











