Gene Simmons – Teacher or Rock Star?

Following the second episode of Rock School I speculated over the real Gene Simmons. Having seen the last two episodes of the series, I definitely think we saw much more of Gene Simmons teacher, as opposed to Gene Simmons arrogant rock star.

Over the last two episodes we again saw him going significantly out of his way with the troubled pupils, again going to see parents. We also saw him struggling with his potential rock band as they fought and argued. You also saw him calling in a number of favours from friends in the business to try and motivate the kids.

I have to say, that one of the sad themes underlying the whole of this series, and one which Gene himself expresses a number of time, is apparently how little ambition many of the children in Lowestoft seem to have. Of course I’m sure the editing has a lot to do with it, but certainly it is heart-warming to see the effect that the whole Rock School experience has had. For some it is the point where they decide what they want to do with their lives. For others it is almost like a Damascus Road experience, when they decide that they have to get out of Lowestoft. For others it is probably not the start of a glittering career, but rather something they can be proud of, to prove to themselves that they can do something. Certainly by putting together a group of young people, many of whom have problems with school, authority or whatever, rather than a group of well off, pretty privileged young people, it has produced an altogether more interesting series.

But what of Gene Simmons. I certainly get the impression that he has taken a lot more from this series too. He makes a number of interesting statements in the final minutes. Firstly he questions whether being a teacher or a rock star is more rewarding, and interestingly opts for the teacher, but adds that as a teacher he would get little thanks and acknowledgement for what he has done, certainly not compared to being a rock star. He also gives us a little of what is driving him in what he has been doing. He again comments on the lack of ambition that he believes the young people of Lowestoft have, but says that in the same way that somebody gave him a chance when he came to America, he has tried to give these young people a chance. I certainly think to some extent he has succeeded in that.

Of course the interesting question is whether Lowestoft is really as bad as is made out. I’m only too aware that editing ca make a big difference, but the question is whether if you went into a school in parts of Basingstoke or Reading, Bolton or Redruth, and took a similar group of young people, would you have exactly the same reactions and problems.

In all honesty I think you would – certainly Lowestoft is far from unique in having bored teenagers who feel disenfranchised by their lives and feel they have no future, and if there is one big negative to the show it is the fact that has come down heavily on Lowestoft when there are countless other places across the UK with similar problems. The big issue that has to be faced is that the vast majority of those places won’t be having Gene Simmons coming along to give their young people the opportunity to realise that they can change that.

You Know When You’ve Been Scobleized

It was quite amazing back in December, to see the effect of having my blog linked to by Robert Scoble, almost immediately there was a noticeable jump in my traffic that lasted for a good week or so. Scobleizer, like Slashdot, is one of these sites on which getting a mention can really boost your traffic, sometimes to unmanageable levels.

One example of this was the effect this week when Scoble posted about the Coding Horror blog. Now I’ve actually been reading Coding Horror for quite a while. Jeff Atwood writes a broad mix of articles, primarily about good programming practice, but broadening into all sorts of other areas.

For example, recent articles that have raised a smile include ‘Lotus Notes: Survival of the Unfittest‘ – both my current and previous employers have used this delight for e-mail, and after all those years and many updates it’s still no better – and ‘Revisiting Edit and Continue‘ that argues that the return of the ability to edit a running application in Visual Studio 2005 is actually a bad thing.

Anyway, now the results of the Scobleizing have died down, I’d definitely recommend that any .Net programmers go take a look at Coding Horror.

Memory Games

Quad Screen Application

So a few weeks ago when I handed in my resignation at work, I was expecting a pretty relaxed wind-down, as the application I had been working on over the past few months was only a couple of weeks off delivery, and after that all I needed to do was hand it over to another developer.

Such are the joys of software development is that it didn’t work out that way. The users had been testing for a couple of weeks, and tried some performance tests – one of the key requirements are some pretty tough loading times – but ended up getting a whole raft of out of memory errors, which became more frequent the more data they had loaded.

It has to be said that .NET Framework applications have a bit of a reputation for consuming vast amounts of memory, for example have a read of this article from SysInternals that compares two versions of Notepad. Having said that, it was pretty unexpected that we would be having problems with just 45 days worth of data. However, after a little investigation we found that it wasn’t simply data volume. We could always quite happily load well in excess of 45 days, however the problems came on a reload. A quick look at the application using the free Process Explorer found that despite regular garbage collections, the memory usage was only ever climbing – sounded like a classic case of memory leaking. Having had a search around for suitable tools, we grabbed a trial copy of the .Net Memory Profiler from SciTech Software. Although most of what the tool does can also be carried out with the Microsoft debuggers, the tool is a lot more straightforward to use.

Taking a look at the objects in memory at various points during the runs of our application, we did spot some areas that we could improve our code, however the big problems were actually somewhat outside of our control, being down to the Infragistics controls we were using for the user interface. Now it has to be said that the controls are not overly popular amongst our developers. Whilst when we kicked off our C# developments back in 2004 they seemed to be the best suite of controls, in use they have caused a good deal of frustration. Amongst a number of gems we’ve found with them, the most annoying is that certain of the controls raise and catch exceptions as part of their normal operation, something which is strongly advised against with .Net development because exceptions are just so slow! We’ve also realised that there are some pretty fundamental things that the chart control cannot do, for example placing an axis at anywhere other than the edge of a chart.

Anyway, the leak problem proved to be that the Infragistics grid control we were using was managing to hold on to references to parts of one of our data objects. Whilst in all the references in our code were correctly being disposed, with the reference from deep inside the grid, the .Net garbage collector was leaving the entire data structure sitting around. Even once we’d managed to code our way around that problem, there was still the issue of how much memory the grid itself was taking, thanks in part to the literally millions of ‘appearance’ objects that were being created.

Appearance objects are attached to all sorts of controls in Infragistics to hold details of the control’s colour, font and so on, however in the case of the grid each cell has one of these objects. More than that, there are appearance objects on each column and row too. You can see from the picture of the application running that this might be a bit of an issue – the potential number of cells on our grid could be as high as 432,000, so we had to find a way to reduce them. If you take a look at the picture, you’ll also notice that most of the cells actually look pretty similar, therefore it is a bit of a waste of time to have multiple appearance objects, all containing the same information. A bit of work by Rob worked out that in fact there were only 23 unique combinations of font and colour in use on the grid. As a result, Rob spent a lot of time this week working around the automatically created appearance objects. Essentially what he is doing is creating the 23 unique combinations as a library of appearance objects and then throwing away the automatically created objects and replacing them with a reference to one of our library of 23. This seems to work pretty well, and we now have just under 2000 appearance objects in total, even during the longest runs. Together with the other tweaks we have made, this has almost halved the memory footprint of our application, and as of Friday, the only problem we have left is that some objects are still being retained by the grid – so we need to do some more leak hunting.

All in all, I’ve been pretty disappointed with Infragistics, and certainly if I were in a situation where I was choosing a set of controls again, I’d probably steer away from them if I could. Whilst on paper the regular releases seem good, implying an active development team behind the suite, what the headline grabbing new features tend to hide is that there are some bugs that don’t seem to have ever got fixed, and there is also real problems like the memory leaks we’ve found over the past few weeks. A month or two ago they sent round a survey, to which I replied that I wished they would spend more time fixing the bugs and getting the existing features working efficiently rather than all these flashy new features. Not surprisingly, the impression I get looking at the examples they produce, that with the grid for example show off how they can hold millions of rows, is that they’ve been very carefully coded to avoid the issues. Maybe I’m being unfair, but when one of my colleagues e-mailed their support with another bug in the grid, the ‘solution’ they e-mailed back didn’t work – in fact it was even worse than the problem we were having.

On the positive side, what I have picked up from this whole experience is a much better and deeper understanding of what .Net is doing internally with my objects, and also a really good tool in the form of the SciTech .Net Memory Profiler.

Pick Up a Bargain

If you’re a cult movie fan, I’d recommend picking up a copy of the Sunday Times tomorrow.

Like a lot of newspapers they have been giving away movies on DVD with the newspaper recently, and whilst quite often they have been movies that would turn up in bargain bins, tomorrows is a bit different.

They are giving away a copy of Donnie Darko, which whilst the original 2001 version can be picked up pretty cheaply, they are giving away the distinctly superior 2004 director’s cut that includes 20 minutes of extra footage, and is altogether more comprehensible. Amazingly it was only released on DVD at all a year ago, so it’s a pretty quick turnaround to a freebie give-away!

If you’ve not come across the film before, it is well worth watching, but it is not your usual Hollywood action packed switch-off-your-brain popcorn effort. Although it revolves around a troubled teenager, it’s not a teen movie either. At it’s heart it’s really a ‘proper’ science fiction story, something you don’t see in a movie much at all.

The central character, Donnie Darko himself, is a brilliant, but troubled student living in Middlesex Virginia. In the middle of the night he is woken from his sleep by a strange voice, that leads him out onto the local golf course where he talks to what appears to be a giant, demonic looking rabbit called Frank, who tells him that the world is going to end in 28 days, 6 hours, 42 minutes and 12 seconds. After he wakes up on the golf course the next morning, Donnie returns home to find that a jet engine has fallen from the sky and crashed through his bedroom – had he been there he would have been killed. The film then follows Donnie over the next 28 days, as Frank continues to appear, and leading him to do increasingly strange things. Donnie also starts to see more strange things that he can’t explain. On the one hand it seems to be that he is suffering from a psychosis, however on the other hand what Frank asks him to do is very specific. On top of that Donnie is given a book called the Philosophy of Time Travel which appears to explain what he is seeing and experiencing. All the time the days click closer to the doomsday predicted by Frank.

If you get a chance to pick up a copy of the paper tomorrow, I’d highly recommend it. Of course if you don’t like the movie, you’ve not spent out much, and you’ve got a newspaper to read into the bargain!