bitwix

Tangential comments about Software Development

Friday, January 27, 2006

Wheel Spire Dome Office Flat

Wheel Spire Dome Office Flat

These five buildings and structures rise above the South London streets. Each has its own story. Some have stayed the same, others have moved from one use to another.

First we have the "London Eye" also known as the Millennium Wheel. It is now iconic, but I remember sitting on the Embankment in September 1999 watching them fail to hoist it from its horizontal position, making it another national embarrassment.

Next is the spire of Christ Church and Upton Chapel, physical home of www.church.co.uk (now that's what I call a website address). There is the suggestion that the stars and stripes on its spire link to Abraham Lincoln's family who contributed to the original building.

Third is the dome of the Imperial War Museum, a radical transformation of a mental asylum. As a kid I just loved going there to see tanks and fighter planes up close. Now it's the human stories I go for, and I never come out laughing.

The Shell Centre comes next. This is the Upstream building and is still used as offices, unlike other parts of the complex which have become flats. The architects wanted a building nearly twice as high; I'm glad they weren't allowed. Its best moment is as a projection screen for events such as the poppy drop in November.

Last we have a block of flats, which got in the paper when someone asked £4,500,000 for a one bedroom flat. For me it isimportant to note that it used to be the headquarters of MI6, the British spies now relocated to a landmark building. This block was never interesting enough to feature in a James Bond movie.












Saturday, January 21, 2006

A Random Number Web Service - Keeping It Honest

Two things Microsoft have made easy for us these days. Writing a web service and producing random numbers. But do they work together?

Web services are new(ish) so it's no surprise that the authoring tools are getting easy to use. Visual Studio 2005 does get you from zero to hero in minutes. If you skip documentation paragraphs (as I do), then the only gotcha is that yes, you have to run WSDL from the VS2005 command line prompt.

Random number generators have been around for years. We've all used them for silly programs. Most of us have then noticed that to start with they actually gave us the same stream of "random" numbers, so we read up about seeding and then found a way that was random enough to seed the generator so that we never saw the same sequence twice.

We were therefore pleased that in the .Net Framework
Random r = new Random();
used a seed generated from the time. So we could just use that and *bingo* our numbers were never the same twice.

Put these two technologies together, and you have a random number generating web service.

Except you don't. Use the service twice on a page, and you get the same number.

The problem is that each call to the web service creates a new Random() class object, seeded with the current time. Call it quickly enough, and the next one will be seeded with the same time, and it's no longer random.

My solution was to pause for a tick before creating the Random object. I did this by holding the DateTime.Now.Ticks and then sleeping the thread for 1 millisecond.
using System.Threading;

public class RandomData
: System.Web.Services.WebService
{
Random m_r;
public RandomData ()
{
long tc = DateTime.Now.Ticks;
do
{
Thread.Sleep(1);
} while (tc == DateTime.Now.Ticks);
m_r = new Random();
}
You can then use m_r.Next() without fear.

Why do you want a random number web service? So that it can become a full random data web service, applying algorithms or reading databases of potential values. See www.bitwix.com/NorMad for more.

New / Change / Nouvel : Pun your own headline

Just East of St Paul's Cathedral is a red brick building, shortly to become a building site, then to become Britain's first building by Jean Nouvel.


It's an interesting test case of what constitutes a building worth keeping, and when the combination of a "starchitect" and a commercial property developer is likely to do the city any good.


My bias is that in 2002 I schlepped over to Switzerland for Expo.02. In the town of Morat, in the middle of the lake, was a massive iron cube. You queued to get on the boat out to this cube, and then had three panoramic experiences on three different levels. Stunning, and a credit to Monsieur Nouvel.


The red-brick New Change Buildings (built 1953-1960) by Victor Heal have their detractors. "Regrettable ... silly little semi-period balconies ... sculpture as retardataire as the architecture" says Nikolaus Pevsner in the 1962 edition of The Buildings of England : London.


Instead we get 220,000 sqft of "retail destination" which Land Securities promises us will "create a vibrant commercial hub for this important City community". The buildings are not high - six floors - but they are designed to get plenty of floorspace for shops and offices.


On balance, I'm content that the Heal building will go. I've watched the City being filled in with so many really bad blocks, this one might be a little better. We are told that there will be rooftop public space - I would appreciate that if it is more public than, say, the garden on Stirling's One Poultry.


I just don't expect a building of real quality. We won't get an Institut Monde Arabe.


Links
Land Securities press release
Jean Nouvel and the Morat Monolith

Saturday, January 14, 2006

The largest hidden gem in London

Stockwell Bus Garage

Of course you know it's there, it's just that you've never seen it. A stadium sized concrete structure hidden away in a back street, magnificently doing the job is was built to do.


Stockwell Bus Garage is a landmark building in London. Archictecturally perfect and completely unaffected by the heritage industry. A fair sprinkling of graffiti but that's no more offensive than the plethora of official signs forbidding unauthorised access.


It was a mediocre grey day when I walked over to the garage, stopping to photograph the blue plaque for Dan Leno. So the photo does not do it justice. If you want to see it, turn left out of Stockwell tube and take the second left turn. Better would be to use the 196 or P5 bus.


Links
Wikipedia article
Photos on LondonBusGarages.co.uk showing that it is always a grey day in Stockwell
Onionbagblog pictures - still no blue sky

Tuesday, January 10, 2006

Do all programmers speak Sanskrit?

The most commented-on post in 2005 on Scot Adams's blog was Do all programmers speak english?. I read this while setting up a Wiki for my company, thinking that Wiki was the first word of Hawaiian I had learned.


Which got me to thinking about the derivation of words we programmers use. They mostly fall into two groups - classic adaptations and clever neologisms. Where, I thought, are the words borrowed from other languages, adapted for use in computing?


By classic adaptations, I mean someone has gone for a Latin or Greek root and used it for a new purpose. Computer, to take an obvious one, comes from the Latin computare, to reckon. Program from the Greek programma a proclamation.


Some words have a root in other languages. Window is recorded in English in the early thirteenth century. Its first use in the sense of overlapping rectangles on a screen was in 1974. Whereas Menu as a computing term was used in 1967, a mere 130 years after its first recorded use in English (from the French).


The neologisms are where the fun starts. Bit as a contraction of Binary Digit, then Byte for eight bits, and so Nybble for half a Byte. My favourites are copyleft (as opposed to copyright), marketecture (design elements for marketing it, not for using it) and outernet (a.k.a. the real world).


But these words are inventions. Where are the borrowings? Where are the computing equivalents of boss (Dutch), tycoon (Japanese), guru (Sanskrit) or coach (Hungarian), all words we use but in the same sense as everyone else?


You could claim Algorithm, which traces back to al-Khowarazmi, Arabic for the man from Khwarazm, meaning one Abu Ja'far Mohammed Ben Musa, a mathematician whose work on Algebra influenced the use of the Arabic number system in Europe. Or Bot, a contraction of Robot, from a Czech word for forced labour, used by Karel Capek in his play R.U.R. (1920). But both of these had a life in English before computing adopted them.


One I can find is Kludge, which was first used in 1962 as "an ill-assorted collection of poorly-matching parts, forming a distressing whole", yet comes from the German word Kluge, originally meaning smart or witty, according to the Oxford English Dictionary (CD-Rom, 1992, still runs on my wife's computer, can't install it on my computer as I have no 3.5" floppy drive). Or, from the Scots kludge or kludgie for a common toilet, according to the Jargon Wiki.


The second, to go with boss, tycoon etc, is Kahuna, which is Hawaiian for shaman, and shows that Wiki was actually my second word in that language.


Any one got any more?


Meanwhile, I've found a word for the naming of classes by joining nouns together, such as TextBox or ToolBarButtonCollection. Henceforth, this is to be known as the Tatpurusha Class Naming Convention, borrowing the word Tatpurusha which comes from the Sanskrit for his servant and is therefore itself a tatpurusha word. Currently Googling for "tatpurusha class" returns no hits, but it is only a matter of time.


That's it. Forgive me for being such a geek (U.S Slang from 1916), an anorak (Greenland Eskimo, 1934) and a nerd (made up by Dr Seuss, 1950, probably).