Month: March 2006

Some new themes.

No, not display themes in my blog. I'm going to start some new themes on design and development issues. There's a few things that I felt I ought to give a systematic treatment to.  I've had a few conversations lately that brought my mind back to the issues of code generation and its related patterns. I've also been playing with generic algorithms in C# 2.0 for type introspection in my DBC system. It seemed natural for me to explore the idea of using generic algorithms at the heart of code generation frameworks since a generic algorithm would allow me to reuse my code generator regardless of the metadata format or the output stream.

Consider this:

public class CodeGenerator<DataSource, TemplateSource, CodeGenerationPolicy>{ 
// ... 
}   

 
using CodeGenerator<DatabaseModel, 
	DatabaseSqlCreationTemplate, 
	SingleFilePerTopLevelElementPolicy> SqlCreateTpl; 
SqlCreateTpl tpl = new SqlCreateTpl(GetModel(), 
Factory.GetTemplate(typeof(DatabaseSqlCreationTemplate)), 
	Factory.GetCodeGenPolicy()); 
tpl.Run(); 

Neat huh? I'd prefer to write code like that than write code that must explicitly acknowledge where the data comes from, what it's format is, and how it is to be disposed of in the code generator. Up until now, I have achieved design-reuse, but never code-reuse. From looking at other code generators, the problem abounds. Most systems I have worked with provide the code expansion part, and the template language part, but tend to stick to a single metadata source when it comes to generating code or other artifacts.  A case in point are the persistence-tier code generators that purport to be general purpose code generators but that only take data from a specific database API. These don't provide the degree of genericity required to share code between wildly different systems such as a DBC proxy class generator and an Object to Relational mapping system. In the first example our data comes from reflecting the metadata of a .NET assembly in the later it comes from reflecting the schema of a relational database (or both). We need a code generator that will work regardless of where it's data comes from, and how and where its output gets generated. We need to separate the algorithm of the code generation process from the structure of the metadata source, and they both need to be isolated from what happens to the stuff that the template system outputs.

The solution of these problems was the grail of the beautiful C++ Standard Template Library of Alex Stepanov. It is still a matter of debate whether something like the STL is possible in C#, but early work  is yielding possibilities that hold out hope. I propose to give code generation the STL treatment. In the process I will explore many related ideas that have been bugging me about my ORM and DBC systems. Chief amongst those is the matter of policy vs configuration and how you store them.

There's my manifesto for the weeks/months ahead! I have some holiday coming up, so I may even deliver on the promise. ;-)

Another Source of British Pride?

In a conversation I had with a colleague, it came to light that the British have another reason to be proud of their national heritage. As you may know, they were the nation that invented the queue. they take to the queue as ducks take to water, and queueticette is installed in their youth from the cradle. Not content with that, the British graduated in the 70s from simple linear queues to more complicated non-linear arrangements. It is arguable that modern operating systems would never had reached their current degree of multi-processing capabilities were it not for the British obsession for queueing.

We’re talking about the magic roundabout in Swindon. I have gone through the magic roundabout twice. Both times I went in accidentally and with trepidation, and came out elated and enthused. Perhaps that is the essence of many pieces of post-war British town planning. East Dumbarton is another example – I went in thinking I would get knifed and came out overjoyed about the fact that I didn’t.

I’m not sure such roundabouts would get built these days. The 70s in Britain were a time of regrowth and increased confidence, when we ‘never had it so good’. Filled with confidence, people knew it was OK to experiment and try new things – drugs, free-sex, rock-n-roll, roundabouts, whatever! Nowadays, such experimentation would never get off of the drawing-board. Not because of traffic flow analysis but because of the weaselly bean-counting tossers who are the secret police enforcing the modern day tyranny of the nanny-state. These people enforce a Maoist level of austerity on the British public in the name of ‘Health and Safety’, they are insurance brokers and health and safety officers.

FACT:You can’t have hanging baskets in public spaces any more, because they might fall on people’s heads!
FACT: A hanging basket has never actually fallen on anyones head in the UK. The premium increase is not founded on any actuarial analysis, therefore it must be based on a desire to remove hanging baskets from town centres.
CONCLUSION: Insurance Brokers and H&SE officers are effecting social change in a way that is gradual and hidden from view, and in a way that is profoundly negative.

In Britain we like to criticise the American’s for their litigious culture that turns ordinary professionals into timid cowards for fear of punitive legal measures. We have no reason to be conceited though – we are equally held to ransom by the insurance profession. They don’t take us to court, they raise our premiums. It deadens the spirit to even think about what levels of crawleyage have been perpetrated in the name of H&S.

Anyway, rant over. Hats off to the town planners of Swindon who had the courage to strike out against the lowest common denominator, to forge a path to the non-linear via the nirvana of roundabout confusion! The Swindon magic roundabout is a mandala, a traffic koan, a map charting the path to enlightenment and heaven on the highway of life.

The Wandering Glitch is Moving

The Wandering Glitch is moving to wordpress.com.

I finally grew irritated with not being able to categorise my blog entries. So I’ve moved over to WordPress, which in some ways is not as good as Blogger (esp the WYSIWYG editing) but blogger broke down the other day, and precipitated this fickle blogger to jump ship. Doubtless I’ll be back, but in the meantime I’ll be found at http://aabs.wordpress.com/ and if you are Web2.0 savvy (and lets face it – who isn’t these days, I mean, HELLO-O?) my RSS feed will be at http://aabs.wordpress.com/feed/. Of course if you are only interested in one category (like photography) then you can access its feed on http://aabs.wordpress.com/tag/photography/feed. Cool Huh? Yeah, that’s why I changed.

Of course flickr can still publish to wordpress, so you’ll still be able to check out selected blogged photos. If you want the photo-firehose just connect to the feed on my flickr account: http://www.flickr.com/services/feeds/photos_public.gne?id=81359372@N00&format=rss_200 And beware – several hundred new photos are gonna be uploaded any day now. I shall have braodband by the end of the day (with any luck up to 1MB/s) so I may decide to archive the entire 3GB of photos to a private set on flickr…

Podcast rant – the Dilbert Principle as revealed by the signal to noise ratio of IT podcasts

There are many press releases on the web discussing the wonderful (or terrible, depending on your point of view) development of academic lectures being distributed to the world at large as podcasts. I fall firmly in the camp of those who think such a development is a mark of progress and a step towards realising the dream of free access to high quality ideas and well-thought-out commentary that will support the growth of civilisation in this increasingly dark age that we inhabit. So, you will not be surprised to learn, I went in search of the aforementioned podcasts to feed my yearnings for something substantial from my web trawling. Imagine my disappointment when I went to several podcast directories to find those golden podcasts [that are worth listening to] only to discover that there are literally millions of the blasted things that purport to cover science (or whatever discipline you want) but which are actually low-bandwidth channels for the diseased ramblings and insane imaginings of their loopy hosts. For example, under Philosophy one is more likely to find fundamentalist born-again christian, muslim, buddhist or fruitarian podcasts than rational argument on the nature of reality. My personal favourite is “MessiahCast“. As with academic journals, moderators and peer reviews are essential for the medium to be of any worth. After all, why would I be interested in exposing myself to mongrel strains of the virulent memes of total strangers? Anyway, I did find offerings from Stanford, Harvard and Bath universities. That is a pretty poor showing considering that Apple cliams to have a whole branch of iTunes devoted to university podcast hosting.

WHERE IS IT?

I gotta git me some of this!

The mind boggles at the possibilities of shapelock!

It is a ‘Ultra-High Molecular Weight Low Temperature Thermoplastic ‘ which is to say – a form of modelling plastic that can be made plyable at just above room temperature, and can be moulded to almost any shape, but which when it cools is hard as steel. Now I have my shed, (well I share it with Cockroaches and Huntsmen spiders and moths the size of mice, but I call it mine) and a double garage (not pronounced like Mirage but like Forage) I also have the opportunity (but not the leasure time) to get more ‘practical’. I seem to be spend a lot of my spare time working on my software projects. It leaves me wanting to produce something tangible and useful, rather than something intellectually satisfying. The problem with intellectual pursuits is that once you have gotten your head around a problem, no matter how difficult it seems at the outset, you are left thinking that the problem was actually quite simple. Which brings to mind Steven Wolfram’s assertion that there is really only one level of complexity – our perception of higher levels of complexity is really only an awareness of our lack of insight into the problem.

Anyway, I want to produce lasting, and useful little gadgets for a change – the kind of things that buzz and flicker. To inspire me I have been visiting the Maker site, which is where I found out about shapelock.
What I want from YOU is ideas for the above little doohickeys. What would be cool to make.     

 

The Hidden War

Several years ago, I worked on a contract in Central London (That’s in Great Britain, an island off the coast of America) and I used to commute to work by train (that’s a bit like a long chauffeur-driven car on rails). Every few weeks or so, people used to commit suicide by hurling themselves under the trains. Generally, these terminal events took place in or around the Crawley or Hayward’s Heath areas. It just so happens that this area was a single line stretch of track and there was no easy way to go around the affected area. The net effect was always massive tailbacks and confusion in the rail network that spread out from the terminals (Hmmm, no pun intended, but weird huh?) affected in London to cover the whole region. This butterfly effect always happened during rush hours and always on weekdays.

I used to curse the departing souls of the selfish imolators to hell, blindly assuming that there was a continual stream of people killing themselves all over the country, and I had just been unfortunate enough to be affected by one of them at random. Now I realise that the imolators were guaranteed their place in heaven (with 72 virgins to cater to their every need, and presumably a free rail-pass for good behaviour). You see, I have penetrated the veil of happenstance to see the evil designs of a master-criminal at work. This spider-like Moriarty figure would never be so crude as to send people to blow up trains and buses (note the public transport links here. I’m not kidding) were he not trying to draw attention away from a more subtle and insidious gambit. One which is – I exaggerate only slightly – equivalent to Hitler, Stalin, Mao, Amin and Pol Pot combined in its cumulative horror.

You see, it all stems from Utilitarianism. As any morally sophisticated person can tell you, in a sentence, utilitarianism is that branch of ethics that seeks to do good by maximising the greatest good for the greatest number of the population. There is an implied calculus of pain in this statement that is being exploited by our criminal mastermind for the punishment and/or education of us infidels. It is easy to deduce the coefficients of this calculus as well. We can see from Newton’s laws that for every action there is an equal and opposite reaction. One man (or woman)’s death in Haywards heath is roughly equivalent to frustration and irritation for about 50,000 people for about 2 hours. To standardise, we shall call that unit the ‘crawley’ and it’s equal to roughly 100,000 grumble/hours.

We know that around 2 million people attended the march against war in Hyde park, London in Feb 2003. They were in attendance for about 5 hours, giving a total of 10 million grumble hours or 100 crawleys. That is – Osama bin Laden did the equivalent of 1.7 London Bombings without even having to get out of his seat. Multiply this by all of the demonstrations across the globe since then against the war and we have several times the devastation of the twin towers, and all he has to do is sit there, nice and cozy, in his dialysis machine in his cave there in Afghanistan, without moving a muscle. Add to that the huge dissatisfaction of the world with George W. Bush. Lets face it, how many people in the world have not spent at least an hour a week complaining about the wickedness of his regime and the general blindness of the Americans for not noticing, or caring.

It all adds up. If all the people in the world grumbled for just one hour – that would be equivalent to 20 times the September 11 attacks. Doubtless they have done a lot more than that! You’re not including areas of highly crawleyage such as the middle east, and amongst the poor. There’s a few more thousand crawleys for you. I find it shuddersome how this architect of woe has turned the very principle of a just and sane society, the very root and branch of liberal democracy, against us. Is it any wonder that this man has not been found, he needs to hide, to best achieve his nefarious ends. In fact he could achieve them even if he were dead. He’s a lot like Jesus Christ in that respect, a man who he must respect for the countless giga-crawleys of misery he has spread posthumously across the world.

Any relation to any persons past or present is wholely coincidental. Please don’t burn my effigy in the streets.

Adding my microchunks to the collective attentionstream – about bubbles.

Tony says he’s had a hard time persuading Portals to ‘get’ the advantages of Web2.0. I guess the portals would get Web2.0 from a usability perspective. It makes sense for them not to divert a little effort to it – most of Web2.0 can be built for very little cost on top of existing functionality (it’s not rocket science after all!) But then – some of them have been around long enough to want to try to fall into the ‘bank’ category – i.e. safe, well established, not fly-by-night, hands rather than vapour-ware selling, hysterical, flipperty-gibbets that sound cool but are actually teflon to users. Perhaps by being conservative the portals are hoping avoid the share-price re-adjustment (collapse) that will inevitably come after web2.0 gets exposed as a minor technical fusion rather than the major technological quantum leap that all of it’s evangelists would have us believe!

I can’t personally stand expending my web-time on a site with only one concept – the signal-to-noise ratio is too low. I prefer web2.0 sites like wikipedia where there is content worth reading rather than the banal opinions of strangers.

I enjoyed venting these opinions so much I decided to blog them ;-) Perhaps that’s the appeal of blogging – it’s cathartic. Maybe it’s like undressing in a remote place – there’s always the thrill that you might get caught by someone.