Featured Post

Session on WPF for Chennai .NET UG

I’m planning to do a new session on Windows Presentation Foundation [WPF] this weekend. If you are interested register @ http://groups.msn.com/chennainetusergroup/july21stsessionregistration.msnw   Madhu [Solutions Architect from Polaris Labs] is doing session on Windows Communication Foundation...

Read More

Chennai .NET UG Community Launch

Posted by Logu Krishnan | Posted in .NET User Groups, MVP | Posted on 02-01-2006

Tags: ,

0

Chennai .NET User Group [ http://www.cnug.net ] is getting rejuvenated, and has announced the community launch of the Visual Studio 2005, SQL Server 2005 and Biztalk Server 2006. This event is 1 Full day stuffed with Technical Sessions + Fun on 8th Jan 2006 at “Tidel Park Auditorium”, Chennai

I’m speaking on this event on the title “C# 2.0 – Unleashed”, Interesting Topic to discuss :-) and also opportunity to meet lotsa people…

Interested ? Do Signup for the event at

http://groups.msn.com/chennainetusergroup/communitylaunchsignup1.msnw

Here is the Event Invitation with the detailed Agenda.

CNUG Launch

 

For more details check http://www.cnug.net

Let’s Rock Guyz ! See You There…

2005… Looking Back…

Posted by Logu Krishnan | Posted in Uncategorized | Posted on 01-01-2006

0

Should I say this was quite a eventful year! I don’t know… !!

But,

A Year Where I’ve met so many new faces across the world, from the sweetest of all to the scariest of all to the charismatic of all…

A Year filled with travel, almost every weekend or alternate I was traveling…

A Year where I’ve made more number of flop shows and more flunks…

A Year filled with new experiences, some of which, I Didn’t know how to play…

Some of which, I Never wanted to repeat, if it repeats, Now I Know How to play the game!

A Year which changed perceptions towards life…

 

A Year Where I learned Amateur Photography…

 

[I've compiled a list of photos at http://photos.logukrishnan.net/Shots2005 ]

Favourite Shots 2005

.

.

.

 

Welcome 2006…

x += x++; ?!

Posted by Logu Krishnan | Posted in C# | Posted on 29-12-2005

0

Let’s take this code as an example:


int
x = 3;
x += x++;

The first thing the compiler does whenever it sees something like z += y is to convert it to z = z + y. This is obviously true for +=, -=, *=, and /=.

 

Ok, this was easy. Now we have just to consider:

x= x + x++;

This, by the way, gives the same result as:

x = x + x;

This, by the way, gives a different result from:

x = x++ + x;

This, by the way gives the same result as:

x = x + ++x;

 

As maddening as this may seem, it actually makes sense (once you understand how it works). But first, what is the difference between x++ and ++x? x++ returns the value of x to the current expression and then increments x. ++x increments x and then return its value to the current expression. Given this factoid (and knowing that c# evaluates expressions left to right), we can then consider what happens in the following case:

 

int x = 3;

x = x + x++;

 

Here is how the compiler conceptually evaluates it:

  1. x = (x) + x++ -> the first x gets evaluated and returns 3, x = 3
  2. x = 3 + (x)++ -> x gets evaluated and returns 3, x = 3
  3. x = 3 + (x++) -> x++ gets evaluated and x is incremented (to 4), x = 4
  4. x = (3 + 3) -> 3 + 3 gets evaluated and returns 6, x = 4
  5. (x = 6) -> x is assigned to 6 (overriding the previous value of 4)

 

Now let’s see how this one works:

int x = 3;

x = x++ + x;

  1. x = (x)++ + x -> x gets evaluated and returns 3, x =3
  2. x = (x++) + x -> x++ gets evaluated and x is incremented, x=4
  3. x = 3 + (x) -> x gets evaluated and returns 4, x = 4
  4. x = 3 + 4 -> 3+4 gets evaluated and returns 7, x = 4
  5. (x=7) -> x is assigned to 7 (overriding the previous value of 4)

 

Now let’s get to this one:

int x = 3;

x = x + ++x;

  1. x = (x) + ++x -> x gets evaluated and returns 3, x=3
  2. x = 3 + (++x) -> ++x gets evaluated and x is incremented, x=4
  3. x = 3 + (x) -> x gets evaluated and returns 4, x=4
  4. x = 3 + 4 -> 3+4 gets evaluated and returns 7, x = 4
  5. (x=7) -> x is assigned to 7 (overriding the previous value of 4)

 

I hope this is clear.

By the way, in c++ the behavior for this expression is undefined…

 

But now… why did we make this legal? Why not err or warn at compilation time? Well…

  • We were wrong, we should have erred or warned, but now it is too late because if we change this we break code OR
  • It is quite complex to form a set of guidelines that the compiler can evaluate to be able to err just in the bizarre cases OR
  • We prefer to spend our time working on things people really care about instead of these corner-corner-corner cases

Found this Interesting Post by  Luca Bolognese Quite Interesting…

Is God Playing dice with the Universe…?! Eh… Question Everything…

Posted by Logu Krishnan | Posted in Personal, Ramblings | Posted on 06-12-2005

0

Happened to watch I.Q. again after a long time… Good Stress Buster :-)

Some dialogues of “Albert Einstein” & others…

   

“I, for one, will never believe

 That god plays dice with the universe…


But the uncertainty principle postulates…

A universe of chaos, where everything happens merely by a chance”

 

“Come on, what could happen? So you die a little…”

… 

“Look at it in an entirely different perspective…. Question Everything…”

 

Note: If you are bit more interested in lectures, you may find this interesting

http://www.hawking.org.uk/lectures/dice.html  

http://www.eequalsmcsquared.auckland.ac.nz/sites/emc2/tl/philosophy/dice.cfm

Delhi – South Asia MVP Summit 2005

Posted by Logu Krishnan | Posted in MVP, Microsoft | Posted on 28-11-2005

Tags: ,

0

Networking…Networking…probably this is the year I’ve met so many new people. Last week I was at Delhi-Gurgoan for the South Asia MVP Summit to meet all the new MVP’s and some interesting interactions with Ravi Venkatesan, Neelam Dhawan, Dilip Mistry and other Evangelism guys.

It Was quite an interesting event, with some sessions on the presentation skills, new Starter Edition of XP, Media Center PC et al… We also had a fun event named “Heritage Hunt” where we were asked to shoot a video using all our creativity[!], I was assigned to a team titled “India Gate” on topic “SQL Server 2005”.

Finally we shooted some pics and interestingly we won the “Best Product Video Award”, but the whole credit should go to Anjana, Chandu, Roji and Veerji for doing a night out to finalize the video… Interesting event…

 

Some Pics from the event…

Back From Redmond….

Posted by Logu Krishnan | Posted in MVP, Microsoft | Posted on 15-11-2005

Tags: , ,

0

Last week I came back from Redmond , after the MVP Summit 2005 held at the Microsoft Campus. Happened to be a quite interesting experience, and opportunity to meet and interact with lots of Energetic People and People who define directions to the rest of the world including Anders Heijlsberg – Father of C# , Dox Box et al…

Met some very interesting people right on the flight, during the long journey. Met Arun,Rajesh and Dhamay at the airport… On the way from Frankfurt to Seattle met Allen – A Marshall in U.S. Air Force and Greg Pidman – A scientist who had worked with IBM Research for 40 Yrs [Oh! My....] involved in lotsa interesting projects. Our interaction started when Allen shared his Cinnamon Mint, and he started narrating his experiences in Iraq . This man is very very proud of his country and his own achievements. Greg was involved in research of Semi-Conductor and AI Stuff… We happened to talk a lot about his experience in a robotics project which he was involved for 25 yrs in France . And he remembered some of his old friends from india, who had worked along with him long back…at one point we did have a differing opinion… he said “Most of the indians are good with theoritical knowledge, but lacks know-how in putting things to practice…”, I strongly denied but he still insisted it might take a couple of years… I just smiled and he switched and said these days he is travelling to meet his grand kids and now a farmer :-)

The MVP Summit was held at Microsoft Campus at Redmond . Being the first time visitor to the MSFT Campus, I should say, I was quite impressed with the Campus – Cool, Quite, Energetic, Fresh Greens, Trees…. a very peaceful environment.

The Summit kicked-off with a very energetic Keynote by Steve Ballmer – CEO of Microsoft, Boy… This man is stuffed with tons of energy and filled with optimism, and his slide on competitors in industry was quite a bold statement [Boy, I’m covered in NDA… so cannot reveal them ;-) ] Really Impressive. It was surprising to see STEVE BALLMER taking out notes in a paper on feedback of himself, his company and his people… and as u guessed there was an instant question, why isn’t he using a mobile device…he frankly admitted that the practical difficulties and said he has asked his device folks to come up with stuff very close to the habit of human writing… this was Followed by other keynote sessions, Jim Allchin was playing around with latest bits of Vista, and when he upgraded his RAM with just a USB Drive, there was a silence in the hall for a moment… This is called as “Superfetch” Technology in Vista . Superfetch adds the memory on the USB key to the system’s virtual memory, which in turn is used to preload applications and data which the user accesses frequently. The USB option offers the ability to upgrade the system’s memory even if there are no physical memory slots, allowing laptop users to increase system speed, according to Alchin…  Ah!Plug-n-Play RAM… also, he demoed other impressive stuff

 

Later we were separated based on our technology areas and me being C# MVP, we had sessions from the Language gurus themselves… Anders Heijlsberg spoke about the new “LINQ” feature in C# – Orcas Version, I Felt this adds lots of common sense to the language. The way he spoke was quite impressive, i.e. he never searched for words, or never thought… the whole stuff was within him, and just flowed out without thinking twice. And during the QA Session, before the questioner finishes and even before we understood the question he came out with the response… This man was just amazing… and later when I happened to speak to him in person, found he is quite humble and gentle than i ever thought, and when i expressed that LINQ adds lots common sense to the language and the language is evolving a lot,he replied – “We have just started this, we need to add more common sense to the language” :-) I would say, Meeting Anders wrapped my objective of attending the summit :)

Me with Anders

 

Later, We had whopping Don Box, who was in his full spirits and talked about “Indigo” in his own style, The Hall was filled with Laughter and he was quite great on explaining each of the topic in a very simplistic manner… [I Still remember his session on SOAP long back...] He didn’t have any fixed agenda, but created a Dynamic Agenda on what people wanted to hear from him…  and spoke everything on those topics… quite dynamic isn’t he ?!

 

There were other sessions, and another notable session was on DLINQ, by Dinesh Kulkarni – Remember this name when ObjectSpaces was announced 2 years back… yep… these guys are back in action with DLINQ which dinesh called it as Object Spaces 2.0. Good Responsive Speaker, heard lots of inputs…

 

Rest of the other time was fully allocated for interaction with the Microsoft Product team, where they spoke about how MSFT builds software, and most of them were chalk-talk sessions, where every single feature of the language and IDE was analyzed and noted down inputs on feature by feature including keyboard shortcuts to Compiler improvements. It was surprising to see so much of attenention and importance was given to the MVP’s. I Think Mattias Sojourn is the person who have lotsa feedback, and his discussion on Good Vs Evil was interesting.

 

Also met Christian Nagel, Julie Ray and other people from around the world…

 

And the campus was very beautiful and as the Fall season has begun trees have started changing its colors and there was lots of Maple Trees…Spent around 3 Hrs walking all alone around the campus, still couldn’t cover up the whole area. But loved that 3 Hr Walk…

 

Another interesting person was a chauffer, actually Me and Anand returned on a early morning flight, and Anand booked the flight, when i came out early morning from the hotel, there was a Limousine for us and while going towards the airport, the chauffer started…

Chauffer : Which Country are you from, Sir ?

Me : {Enjoying Limo Ride, and Half – dozed off in morning sleep}

Anand : We are from India …

Chauffer: Oh! Do you know Infosys ?!

{Me & Anand looked at each other… A Chauffer in America asking about Infy !!}

Anand : Yes

Chauffer: Do you know Narayana Murthy ?

{Me… Whaat?! }

Anand: Of course, Yes

Chauffer: I know him very well [Me...{Whaaat.... ?}]

Chauffer: I was driving Narayana Murthy and Sudha Murthy for 5 days in this same car… When he came to Bill Gates at Microsoft…

{Me & Anand gave a look to each other… }

Chauffer: Nice Couple, He infact invited me to India …

Me: Ah… So, what do you think about this man…

Chauffer: Wonderful Person, Very Amazing…. and they are a very nice couple…perfect pair…perfect pair…

{Me… and Anand smiled and got off at the airport, Somehow I remembered Gred Pidman whom I met earlier on the flight…}

 

All in all it was quite good experience.

 

Only in Very few moments of life, I encounter with people who has the power to define the world and can set a direction for the rest of the world…SteveB, Anders, DonB are definitely one among them… and only very few things has the power to change your perceptions, attitudes and only in very few places the whole galactic energy gets within me and pushes me hard above the limits… this is definitely one such place…

 

A quite refreshing change and definitely a good memory…

 

Here are some photos from the event… http://photos.logukrishnan.net/redmond/
Pics from Redmond

The Infamous “Multiple Events” Problem in FileSystemWatcher Class

Posted by Logu Krishnan | Posted in Uncategorized | Posted on 02-11-2005

0

Whoever, tries the FileSystemWatcher Class for first time, immedietly starts complaining about multiple event notifications and after a brief moment complains, that .NET is buggy and concludes that as a bug. Had heard this many times, and again recently came up with this issue…

Actually, the real root cause of this problem is the File System, NTFS. for e.g.: when a file modification operation occurs NTFS gives out 2 notifications,

Notification 1 : for Data Stream
Notification 2 : for Metadata

Hence 2 Notifications… Poor FSW Class, just handles this and does it’s job properly. Only possible way is to ignore the 2nd Notification.

else, we can use WMI and specify the polling interval, which should read something like the below,
“SELECT * FROM __InstanceModificationEvent WITHIN 10 …..”

Absolutely, nothing wrong in .NET…

Cindrella Man…

Posted by Logu Krishnan | Posted in Ramblings | Posted on 28-10-2005

Tags: ,

0

Cinderella ManTrue Story … Ahem?!

You Call it barbarism… I Call it Life…
You Call it Life… I Call it Endurance…
You Call it Endurance… I Call it Destiny…
You Call it Destiny… I Call it Love…

Note: For the first time in recent past i heard a applause in the cinema hall at the end of the movie…a big applause…

Packing Up….

Posted by Logu Krishnan | Posted in Personal | Posted on 25-10-2005

0

Couple of Days Back…

<Tring><Tring>
<Me>Halo…</Me>
<Mom>This is your Mom… We are still alive here in this part of the world…<ding> </Mom>
Phone Disconnected…
<Me_2_Me> Puzzled…Oh! Boy Better go home… otherwise she might disown you !! :-)  </Me_2_Me>

and Today Afternoon….
<Tring><Tring>
<Me>Halo…</Me>
<Dad>When are you coming ? Come back home Now</Dad>
<Me>{Blinking}</Me>
<Me>Tonite</Me>
<ding> Phone Disconnected…

<Me> Okay, I better go home now…else I’ll be disowned by whole of my family :-) </Me>

Now, Packing up…Off to Coimbatore….Fresh Air…

Windows Vista: TxF – Transactional NTFS

Posted by Logu Krishnan | Posted in Microsoft | Posted on 23-10-2005

Tags: ,

0

Got the Windows Vista Beta 1 DVD’s Yday, somehow thought I shall not blog about those so-called cosmetic changes which people call as face-lift. I’m least bothered if there is a sidebar, or a glistening sparkling flashing window themes et al…  Instead I would blog on some real niche features of the OS, starting from File System, Kernel, Shells to the New Presentation, Communication Frameworks available.

 

Let us start with the changes in NTFS File System in Vista . Okay, How many times have your system crashed after installation of new software, hardware, updates, service packs, hand-tweaks…? How many times did you ever try to repair them…? How many times you just decided to re-format instead of fixing the problem…? How many times you’ve used those bloating memory hogging software’s that promise clean installations and un-installations…? Or if you write a installer software how do you handle clean installation and uninstallation, custom algorithms? What if u have to write a robot to do automatic renames and what if robot fails that takes your website down for a day? How many times you forgot to use enable system restore point, and have forgotten to set a restore point before a crucial upgrade…?

 

Have you ever thought how can this be solved? One obvious answer given was… live with it…

Have you ever thought how could these problems be solved ? If you are a software developer did you ever questioned why can’t I do something like database transactions in my file system?

And how about ability for programmers to do this programmatically ?

 

You got it, and we have a answer, Now NTFS Supports this quite neat feature called “TxF – Transactional NTFS”, to define this officially from MSDN,

<snip>

            Transactional NTFS (TxF) integrates transactions into the NTFS file system, which makes it easier for application developers and administrators to gracefully handle errors and preserve data integrity. TxF can participate in distributed transactions that the Distributed Transaction Coordinator (DTC) coordinates, which allows you to use TxF for the following:

  • Transactions that span multiple data stores, for example, a single transaction for file and SQL operations
  • Transactions that span multiple computers, for example, a single transaction for file updates on multiple computers

</snip>

 

Okay, but dosen’t this leads to the same old classic problem in databased, “Concurrent Updates” ? The answer is isolation. Also, TxF does Multi-Machine Updates. And has other predictable stuff like locking et al

 

Okay, being a programmer how should I use this ?  for basic, simple transaction management all you have to do is call “CreateTransaction” and “SetCurrentTransaction” Methods of Kernel Transaction Manager [KTM]

 

Windows Vista architecture has 2 Transaction managers

1. LightWeight Transaction Manager

2.Kernel Transaction Manager

 

 

Also, You get a managed namespace, System.Transaction Namespace, which directly supports KTM and TxF, [This is one of the key namespaces for Indigo, as this namespace can help you in transactions like OLE Transactions or WS-AtomicTransaction protocol]

 

I’m still yet to configure my system fully, and install other sdk stuff, so couldn’t write a program… let me post some simple code snippets on TxF soon…