The Roads Less Travelled …

.NET Developer’s Journal

Posted in Uncategorized by sriyansa on September 30th, 2004

.NET Developer’s Journal: “erformance tuning for real-world applications often involves activities geared towards finding bottlenecks: in code, in the network transport layer, and at transaction boundaries. However, these techniques alone cannot solve the dreaded problem of uniformly slow code, which surfaces when large bottlenecks have been resolved but the code still exhibits inadequate performance. This is code that has been written without attention to correct usage, often by junior programmers, in the”

Harry Potter vs Amulet of Samarkand

Posted in Books, Literature by sriyansa on September 29th, 2004

After trying to get it for close to two months, I just finished reading Jonathan Stroud's Amulet of Samarkand(AoS). A one line description of the book (for dummies) probably will be "Harry Potter meets Jason Bourne".

Well the Potter part is easily explained. Nathaniel is a eleven year old magician - more correctly an apprentice, who is learning his trade in his masters' house. As regards the Jason Bourne part, the protagonist and the Djinni Bartimeus, whom he invokes, have the knack of turning up at the right place in the right time and taking all the right turns to save their bums just in time, ekdum Japanese style.

I would say for one, HP is much more dark and definitely much more fatalist at its core. Harry loses his parents in his childhood, endures eleven years of misery at the Dursleys' and till now five years of danger at Hogwarts. There is an impending sense of doom, a sword of Damocles hanging over his head. Rowling does not do readers any good by finishing off characters in a jiffy. No wonder a lot of people out there think that Harry might not live to see the end of his seven years at Hogwarts. The unanswered questions about his past life and the mysteries buried therein do no good either. In AoS, Nathaniel falls into the traps, gets enmeshed in his own hate and goes as close to death as Harry ever has been but as a reader I never felt, "Now he is doomed …".

Another major difference between both the books, is the way they portray the non-magic folk. HP books at least the first three approach the story as if Harry is just another boy, albeit with some extra powers. Also Rowling puts in a huge effort to get the magical world in context with our own i.e. that of the Muggles (The last is now a word in the Oxford English Dictionary). Characters like Mr. Weasley almost border on belabouring the issue. As a result the magical world which though not as rich or varied as Tolkien's universe becomes a extension of our own and consequently the characterisations become much more rich and situations more definable. Stroud however makes no attempt to etch out the normal world as it exists. To be fair to him it is a trilogy and in latter parts we would probably hear about the Resistance and other aspects of the common man's views of the magical world. But what really peeved me was the fact that the representation of the commoners is as of now dimensionless. Do they like magic? Or not ? Maybe some do and some don't. Why ?? Was Simon Lovelace quest for power was for powers' sake or towards the exposition of some specific ideology? Some of the answers to these questions, I reckon could have come in this volume.

However, the writing of the book is generally more mature than the HP canon. For starters, the blinding hate of Nathaniel at eleven years was somewhat experienced by Harry only in the fifth book. While Harry's maturity might be questionable Nathaniel's is not. It therefore gives the author a platform to build on this story in manners that Rowling cannot imagine for Harry. Hope Jonathan Stroud is upto the task.

Literary pastiche …

Posted in Books, Literature by sriyansa on September 24th, 2004

Last few days have seen quite a upsurge in my reading activities. In the last 7 days I have finished 3 books, the long pending 'Baltasar and Blimunda' by Jose Saramago, 'Haroun and the Sea of stories' by Salman Rushdie and 'The curious incident of the dog at the nighttime' by Mark Haddon.

'Baltasar and Blimunda' (B&B) was the book which first brought Saramago to the notice of the English speaking world, and it is not difficult to fathom why. As is usual it is not one story, but a multitude of tales each with its own characters and plots and yet twined together to form a narrative that is both coherent and compelling. Unambiguously the story teller of his stories Saramago pays lip service to those stories which cannot be incorporated in the current tale, a technique he continued to follow in his later works as well.

Couple of things which struck me about this tale.

  • The similarity of the characters of Blimunda and the 'lady who did not go blind' in Blindness and the gift of vision in both.
  • How clearly Saramago shows that history is nothing but a palimspset, where various tales of individuals once existed.

Rushdie's 'Haroun and the Sea of stories' (HaSoS) was read in a single sitting. It is a enticing tale of adventure and fantasy, Rushdie's magical realms are now truly magical without the fetters of any notion of reality. Higtened also is his talent for attributing common place objects and events with supernatural qualities. A rather easy read till nevertheless is exciting and entertaining in its own right. And at the end you of course have P2C2E to take with you.

The last book's title is clearly a tribute to Sherlock Holmes, being one of his enigmatic lines (Silver Blaze), and that is what made me pick up the book in the first case. At very crude level one can call it a cross between 'Sound and Fury' (no I am not comparing both) and the movie 'Rainman'. The story starts with how a Rainmanish Christopher discovers the dead body of their neighbour's dog and then proceeds to solve the murder mystery and then write a book on the same. Again an easy read but well written.

[Football] - On the recurring woes of Manchester United and Real Madrid

Posted in Soccer by sriyansa on September 20th, 2004

Arguably the two biggest clubs on this planet, ManU and Real Madrid both are in deep waters following a run of poor shows at both home and CL.

ManU first. They lost their opening match of the EPL to title contenders Chelsea. It was a away defeat and one ManU need not be ashamed of. But the episodes after that day continued the story in the same vein though the opposition scarcely measured up to Mourinho's men. They hung on to a 2-1 victory against promoted Norwich, drew nil-nil against Everton and luckily drew 2-2 with Bolton. What more they were losing 2-0 away to Lyon in their first match when RVN saved the day with two neat strikes for another draw.

Now ManU is at least drawing their matches. Real is losing them. In the last week they lost twice, 3-0 to Bayer Leverkusen in Cl and 1-0 to Espanyol in the Primera liga. Camacho's gesticulations at the touchlines in contrast to the serene Queiroz and the signing of two quality defenders, Samuel and Woodgate, notwithstanding Real's poor form does not seem to be deserting them.

Both these sides have one thing in common. They have quality all over the pitch. Except in one place. Bang in the middle of the pitch. Both of them lack a Steven Gerrard, Patrick Viera, Xabi Alonso or even a Fabregas. A player who can play full 90 minutes at full throttle, putting in crucial tackles at the edge of his box one moment and then delivering a killer pass at the end of the oppositions' D in the other.

And who covers this position. Eric Djemba Djemba (I think he confuses tackling with tripping), Duncan Fletcher (I am sure he is ardent fan of Gandhi, the way he shirks from physical contact) and John O'Shea (he is a left back for christ sake) do the job for United. Inept Beckham and the constantly shifting Helguera do the job for Real. None of whom like playing there or are plain 'just not good enough'.

And what should ManU do (Real I do not care. They will buy off someone like Viera or Gerrard for some obscene amount of money) ?? ManU as of now should shift to an standard 4-4-2 with Roy Keane and Scholes playing in the centre of the field more or less like a flattened diamond and Rooney and RVN in the attack as first choice.

svchost, RPC service and 99% CPU usage

Posted in Rants, Opinions & Whatever else is in my head by sriyansa on September 3rd, 2004

Three days ago, my machine decided it had enough of me. It made its intentions clear by showing the dreaded windows blue screen (for uninitiated my computer crashed) just as I was giving finishing touches to a small enhancement which needed changes in three source files.

That I had lost my unsaved changes in the files was immediately evident since Visual Studio IDE as of yet does not support a recovery mechanism. But more was in store for me. When I booted in after a power switch-off switch-on, and loaded my project, I see to my infinite horror that not only had the inevitable happened but two of the source files were completely overwritten by the content of the third unsaved file. Luckily for me there was backup of the files (though a week old version) and I had to spend only a day in rewriting the lost code.

Much was however still to come. Immediately after this incident, I noticed to my chagrin that the machine is extremely slow. Something as simple as switching windows was taking the bulk of my time. A quick glance in the processes tab of the windows task manager immediately showed that the process, svchost.exe, was the culprit, happily consuming 99% of my CPU time. Initial reactions screamed "Virus !!!, Worm !!!!, Trojan !!!", but a complete scan with the latest virus definitions revealed my hard disk to be spick and span. What then was the problem??

Further research on the Internet revealed that courtesy a bug in DCOM, some services, specifically those involved in network activities, tend to cause a buffer overflow. The same problem was exploited by the Blaster worm that ravaged the Internet sometime back. And the recommended solution - go to the service control manager, turn each service off and check if the errant svchost process has vanished. In my case the deviant service was found to be the Remote Procedure Call service. Though, unknown to me at that point, this is one of the most fundamental services running on a Windows operating system and numerous services depend on it. Also it cannot be explicitly shut down.

Therefore, I changed the startup status of the RPC process from "Automatic" to "Manual" and rebooted my comp. The service started automatically, how I do not know but my problem was solved, svchost showed 00% usage. Elated at my mastering the unknown I started to work on my rejuvenated machine. But alas! Little did I know how inane was I in my reading of the situation?

Around 36 hours after my magical fix and a couple of reboots later, I tried to open the MS dev environment after switching on the machine. The machine responded saying "Unknown error". The empire had struck back. Now not only were a couple of programs not working, I even could not do basic tasks like copy-paste. Cognizant of the fact that the RPC service might be causing some problem, I went to the SCM only to see that RPC service status was set to "Disabled". An initial enquiry revealed that the only solution was to reinstall the OS.

Luckily, Internet came to my rescue again. Armed with the Win2K server installation cd, I decided to put in one last-ditch effort. And loo and behold turned up in the domain of Black Viper who seems to know everything there is to know about windows services. I followed his advice, and much to my relief when I rebooted the dreaded message "One or more services could not be started" did not appear. Guessing that everything was fine I logged in and everything, I mean everything, was working fine.

However, I had not yet fixed anything. So I followed Black Viper's recommendation again for protecting your machine from the svchost problem and installed the requisite patches as well as running a scan on my machine. Things as of now seem to be working fine.

Have I got the better of the machine? Yet …