Thursday, 25 June 2009

By the Silver Moonlight

A little bird told me ...

You will hear a lot about Microsoft's Silverlight over the next couple of weeks (due out on July 10th).

There is a version for Linux, which runs on Mono, called Moonlight 2.

Not a lot of people know that.

(Now Alina tells me she has been testing the thing for the past year).


In the meantime should you require any training in Silverlight, QA offer the following courses:

Developing Rich Internet Applications Using Microsoft Silverlight 4


Developing Silverlight Applications with Visual Studio 2010 and Expression Blend 4

See you soon

Phil Stirpé
"I don't do average!"

Bank Holiday Accident (One for the Lancet!)

Both a cautionary tale and an unbelievable one.

You will NOT believe it.

It is not technical and in no way relates to my job.

By the way, this tale is not for the squeamish.

No. It really isn't.

"But surely the bank holiday was weeks ago. Why wait until now to tell us ?"

Well my ability and inclination to use a keyboard were affected by the accident I shall tell you about.

Now for those who are squeamish, could I suggest that you go elsewhere? Perhaps you could check out one of my colleagues' blogs?

Still here? Well you have been warned!

So there I was looking forward to a nice relaxing bank holiday after having just recovered from a nasty bout of gastroenteritis courtesy of my stay at the Hilton Pyramids hotel, Cairo. I reckon it was the buffet. Well it certainly wasn't Mr Heineken and his good friend Amstel!

The sun was shining and I thought I would start with the mowing. I fired up the petrol mower and hit the lawn. I had just completed two lengths of the garden when it was clear to me that the outlet to the basket had become blocked due to the damp grass.

So what do you imagine I did?

Now I don't want to come across as arrogant but I do like to think of myself as both intelligent and full of wisdom gained by a rich 46 years of life's experiences.

So naturally I put my hand into the basket and started scooping out the damp grass that was blocking the outlet.

It didn't take long for me to reach far enough in for the blade to cut through my fingertip.

Yes of course the mower was still running!

Now, being the workaholic that I am, I was far too busy chastising myself for wiping out a weekend's chores that it took my mind off the mess that was my right index finger.

30 minutes later I was walking into Burnley Accident and Emergency. My mistake; Urgent Care centre. We have been downsized.

Vita, my lovely nurse told me everything I needed to know about our forthcoming holiday to Florida while patching up my finger which REALLY hurt. Actually, when I said 'our' I meant the Stirpe family, not Vita and I!

Went home for a lie down and lots of painkillers.

So that week was interesting. I delivered a Core Web Technologies course in Leeds to a sympathetic group who overlooked the many accidents in Visual Studio 2008 due to my having to click with my middle finger. Don't get me started on my typing ability!

By weekend, the pain was almost gone but I was starting with an eye infection.

GP's don't "do weekends" so I had to wait until the Monday to get an appointment.

Actually I got in to see the practice nurse. Eye infections don't justify an appointment with the GP.

She told me that I had an eye infection and prescribed some drops.

I told her that I had a lot of pain in my left eye as if there were something lodged there.

She didn't take a look as she "didn't do eyes". She squirmed as she said this. She suggested that I try the drops for a few days as they would probably clear it up.

I headed to London for a four day Silverlight course armed with my drops.

As the week went on, the infection started to settle in my right eye but there was still something in my left eye.

I managed to get through the week until I could get to my local opticians on Saturday.

I was pretty sure that they "did eyes".

They did and within minutes he had spotted an object lodged in the centre of my cornea that had now been there for 13 days.

He kindly rang the eye ward at Burnley General (we still have one of those).

I got a lift there and within minutes the doctor was busy with his tweezers.

Just let me pause for a minute. My eyes are watering at the moment.

OK. I'm good.

When he's finished, he tells me that instead of a foreign body being embedded in my cornea, it was in fact a flap of the cornea that had been sliced open.

He removed it.

So here's the theory ..

When the blade cut through my fingernail, a piece pushed the laws of physics and probability to the limit and flew up to slice through my cornea.

Now you might think we have reached the unbelievable bit. No. That was just the improbable bit. The unbelievable bit will be along any second.

So immediate was the relief from pain that I felt positively frisky and I elected to walk home via the town centre as I felt that a drink at my local Wetherspoons was called for.

Furthermore, I was able to go to the 7th annual Northern Dressage Ball that evening and had a great time. The only problem was that I thought I had taken the wrong glasses.

I have two pairs. My readers and my distance glasses. Most of the night my vision was a bit blurred and so I assumed that I had brought my readers.

By dessert I realised my mistake. I hadn't brought the wrong glasses.

I simply didn't need them anymore.

My sight was better without my glasses than with them.

For the past couple of weeks, I have carried my glasses around with me everywhere. However, apart from perhaps the first hour after waking, I can simply see better without them.

Now that's unbelievable!

So shoving your hand in a lawn mower is a lot cheaper than laser eye surgery but perhaps carries a lower chance of success.

By the way. The finger is healing nicely now.

See you soon

Phil Stirpé
"I don't do average!"

How do you solve a AG_E_PARSER_ BAD_TYPE error in Silverlight

For those developing Silverlight applications, you might be familiar with the error 'AG_E_PARSER_ BAD_TYPE'. This can occur both at design time or run time. It is one of those error messages that covers a multitude of sins and therefore proves hard to track down.

I recently got this error whilst developing a demo application to show off data binding in Silverlight 2. As is often the case, I had no idea why I was getting the error. In fact, I spent several hours on the net looking for the answer.

Many developers will identify with the '5 hours spent on a single error' experience.

Every post that I found described a different scenario and not one of them related to my situation. It was getting late and the Heineken family and I were getting pretty fed up with the whole thing.

In the end, I did what I always do when I hit a brick wall; I did something else to calm down. As this was to be a demo application and therefore viewed by many critical developers I set about tidying up the code.

Half an hour later I was ready to shut down and have a night cap when I hit F5 by reflex and "Crikey !" it worked.

So now I had the task of figuring out what I had done to make the error go away. I could have just left it alone but I was likely to see the error again one day and wanted to be prepared.

Luckily, the Heinekens were still around to keep me company and 10 minutes later I had the answer. Any longer and I would have had to call room service!

Now, I knew that the error was data related. This was a data binding demo application after all.

My error turned out to be related to my namespaces.

I had a namespace called SilverlightData and another nested within it called SilverlightData.DataClasses.

At different stages, I was using a class from one of these namepaces. And in the same way that I would happily leave multiple usings or imports at the top of a code file, I didn't see a problem with my namespace declarations in the xaml file.


During my tidy up, I removed the namespace declaration for SilverlightData as I was no longer using a class from there.

Hey presto ! Problem solved.

Now I am not sure if that was because there were no classes in SilverlightData in use in the current xaml file or that I was simply allowed one clr namespace. Neither sounds convincing. Perhaps you cannot declare nested namespaces ?

Either way, it was late by this point and dawn was close at hand.

I went to bed.

So if you encounter a AG_E_PARSER_ BAD_TYPE error in your Silverlight application and trawl the net in search of a solution, perhaps you will hit this page. Who knows, maybe this will help you solve the problem.

Then again it could be something else entirely.

Happy coding.


Should you require any training in Silverlight, QA offer the following courses:

Developing Rich Internet Applications Using Microsoft Silverlight 4

Developing Silverlight Applications with Visual Studio 2010 and Expression Blend 4

See you soon

Phil Stirpé
"I don't do average!"

When do you blog?

I first started posting to this blog in May 2008. The hope back then was for trainers to post interesting items that may or may not relate to their area of expertise.

In addition to being of potential use to the reader, it also helped raise the profile of QA as it led to more hits.

Initially I was worried that I would have nothing to say but in time ideas would usually present themselves. Occasionally it would simply be a rant but the rest of the time they would probably be interesting.

One evening in March this year I sat down in my hotel room and began typing when it struck me that I was sat in a dark room typing a post when everyone else was on the terrace drinking beer.

Was I missing a trick here? Should I be blogging by day by snatching a few minutes here and there throughout the day rather than spending leisure time doing it. After all, time spent blogging is time NOT spent bouncing on the trampoline with the kids, painting toy soldiers or sitting on the terrace drinking beer.

And so, I tried an experiment. I would not blog when not at work.

Here is me NOT blogging the day before my Silverlight course in Dubai (bank holiday Monday).


After three months dear reader, I can tell you that I haven't blogged once. Not for lack of ideas you understand. In fact, I often have an idea and jot it in a pad for reworking later. However, there is always something to do when I am not actually training. For example prepping, writing demo applications etc.

So I have a theory about the many prolific bloggers out there. Unless blogging constitutes part of their official workload, they either don't have much to do at work or the don't have a trampoline !

Aha! So what am I doing now? Surely I am blogging during the day?

Correct. And when I am late submitting my expenses this month, I'll have a good excuse!

See you soon

Phil Stirpé
"I don't do average!"