Prakash C Jha's Blog

Sunday, March 26, 2006

Peter Bromberg's UnBlog: "There's a BUG in ...." vs User Stupidity and Blanket Statements about .NET

"However, the point is, don't accept everything you read as "The Gospel". Test, and verify."
-Peter Bromberg

Wow, what should i say, i completely agree with that comment. i have learnt this hardway. I was just trying to generate XPaths and i thought i should use the StringBuilder rather than String. But to my surprise this is what is found.As far as the pre-intialization is concerned, i guess that's a tricky issue and may not suit for all the cases.

StringBuilder vs String in .Net

I was just trying to generate an XPath, for all the nodes in an XML file. First, i just used the string variable to append the Xpath's and i was fortunate to get the XPath's for all the Elements in the file.
Later, i thought, what am i doing..? I should instead use a StringBuilder, as it would give me a better throughput compared to the normal string variable. Atleast, this is what the MSDN documentation says..?
To my surprise, the latter approach was a disaster. It choked my system!!
Then, i thought, i should dive into the details and get to know myself what's what..?
Just have a look at the following code snippet..!

string temp2 = string.Empty;
for (int i = 0; i < 30; ++i)
{
string temp1 = temp2 + i.ToString();
temp2 += temp1;
Console.WriteLine("{0}",temp2.Length.ToString());
}
This code is not doing much..and at the first glance we might think, it should just be fine..and we should be able to see the console with all the ouputs.
But what should i say, just give it a try..! It Chokes the System!!!
And so does this code snippet:
StringBuilder sb1 = new StringBuilder();
string temp1 = string.Empty;
for(int i=0;i<50;++i)
{
temp1 = sb1.ToString() + i.ToString();
sb1.Append(temp1);
Console.WriteLine("{0}",sb1.ToString().Length.ToString());
}

I would appreciate if some one can still explain to me how StringBuilder is much better than String.

Here are some snapshots that i managed to capture when my system was literally choking!!





Fig.1 & 2: Snapshots for String.





Fig.3 & 4: Snapshots for StringBuilder.

Saturday, January 21, 2006

Biztalk Server Interview Questions & Answers

Check this out to get a hang of the interview questions for biztalk posted by Stephen W. Thomas. Well here are the answers..! And if you are like me who wanted more elaborate answers as well, Gustavo Echeverry just gives us what we want.

Monday, January 09, 2006

BIA - The BizTalk Intelligence Agency: Easier way to add a DLL to the GAC

Thursday, November 24, 2005

Free Phone using WebEx

Go here !!!!
 
U Would see a button for "Register for free/trial"
 
Enter the details asked…. It won't take much time. Now u will receive the password in u r mail box.
 
Follow the link in the inbox.
 
Now click on the host a meeting. It will expand and select Instant Meeting.
 
Now it wud ask u to enter the user name and password (Enter the one which u got through the mail)
 
Now another window will come asking u to enter some more details…
 
Asking for meeting password and all those stuffs… don't need to enter any thing there..!!
 
But select the radio button NONE for TELECONFERENCE
 
Then click on start
 
Now since it is the first time u will be using it, you have to download before you get started..!!
 
U will get a window of WebEx Meeting Manager with the email id of urs ……
 
Now click on Communicate in the window and select join Teleconference
 
Now u will get another window and just click ok for that also…..
 
Now click on Participant and select invite and there by phone….
 
There u go now u r ready for teleconference
 
Enter the details mentioned there...
 
The Area/City code should be in this format “011xx" --- xx is the country code
 
And enter the number u wish to dial with out "0" in the beginning.
 
And click on call. Make sure that u type some name in the name field before calling. .
 
Now once that call is connected click on the conference and enters the details of the other person u wish to call…
 
For example if u need to call some one first call urself and then join the conference. And now call the second person ….
 
That’s it!!! There you go…!!! J

It’s free for first 14 days … so make sure that u call as many calls as possible …. !
 
Enjoy talking to your dearest ones…!!!!

Tuesday, October 04, 2005

Handy BizTalk Tools

Wednesday, September 14, 2005

LINQ[Language INtegrated Query]

What is LINQ..?

LINQ...is a set of extensions to the .Net Framework which would help developers like us..to Query Objects,relational data and Hierarchical(XML data) using a single API.Basically, it integrates the different Query Languages like SQL, XQUERY with and additional feature to Query Objects too.

Would it be worth it...?

From the perspective of the Business, sure..it would be worth in a sense that it would improve the "Time to Market"of the s/w's.

And to some extent even for a developer, it would make life a little easy..!It would bring down the "Context switching" that is required for switching between different Paradigms.

But again, does this mean that people who are well-versed in the other Paradigms like SQL or XQUERY have to learn this new stuff due to market compulsion...?Well..may be its too early to talk about this one..!!But i guess..no SQL/DB developer wants to learn this stuff..!

Apart from the aforementioned things, i am sure we all would be interested to know how good it delivers different features like:

1.Flexibility:
How flexible it would be in terms of usage...i am sure it would be difficult to achieve and i doubt how this would appeal to developers from different sections.

2.Extensibility:
Hope there would be hooks which we can use to extend the existing functionality..Something that the Provider Model does it!

3.Performance:
This would be the most important feature that we all would be looking for..!Would they be really as powerful and as faster as an XQUERY or SQL ..?

But nonetheless, it is just yet another exciting feature that we all would be looking for..!!

Saturday, September 10, 2005

my experiments with "BizTalk 2004"

umm..its been a helluva of experience with BizTalk 2004.

I would be posting them all in the days to come!

For now, all I can say is BizTalk is indeed "FLEXIBLE", not becuase it has the solutions for all the problems we have, but just by providing the necessary "HOOKS", which we can use to fit in our "customized solutions" that meets our purpose.

happy Coding!!