Friday, March 6, 2009

Difference between Puts and Print in Ruby

The difference between Puts and Print in ruby is, Puts appends a new line if it doesn't have at the end, while Print doesn't. Print outputs only what we have provided
print "Hello World", " by print\n"
puts "Hello World", " by puts"


//Output
Hello World by print
Hello World
by puts

Happy Programming

Thursday, February 5, 2009

SQL CE - NText, doesn't support more than 4000 characters

When using SQL CE and trying to insert data with NText type column that has more than 4000 characters I got this error
Type : System.InvalidOperationException, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Message : @TextContent : String truncation: max=4000, len=27811, value='In the email Content provide the following value,.
When i am looking into this issue, i came to know, that while dealing with NText, we need to add SQLCEParameter like this, to avoid the exception, Changing the command parameters as follows, resolve the issue.
SqlCeParameter textContent;
cmdEmail.Parameters.Add("@ID", ActivityDetails.Email.ID);


cmdEmail.Parameters.Add("@CCRecipients",ActivityDetails.Email.CCRecipients);

textContent = cmdEmail.Parameters.Add("@TextContent", SqlDbType.NText);

textContent.Value = ActivityDetails.Email.TextContent;

cmdEmail.ExecuteNonQuery();

Happy Programming

Wednesday, January 7, 2009

Black Day of Indian Market - Satyam Computers Conspiracy

The Indian stock market today Jan 07,witnessed one of the greatest fall, beacause of the Satyam scam, considered one of the biggest after Harshad Mehta and Ketan Parekh. This new has hammered the stock a lot, which touched a new 52 week low of 30.80, a leap drop of nearly 80%, cornering all those who have bought this share above 150 after Jan 01, to a sleepless night. Yeap, i am the one of those, who have been cornered.

Whom to blame? I thinks there is a consipiracy with the company auditors also, without their knowledge this cannot happen. What's the next step of SEBI, to guard the investors money from going into the hands of these culprits.

God sake, it is important to remember that Satyam doesn't make the entire Indian Software industry, still there are good reputed companies with honest managements in this country, and this scam is not going to represent India as a whole, it just represent a individual.

Hope the Black day for investors as well as the Indian IT industry will pass soon.