<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>My experiences with .NET</title>
	<atom:link href="http://sachinanddotnet.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://sachinanddotnet.wordpress.com</link>
	<description></description>
	<lastBuildDate>Wed, 28 Dec 2011 15:40:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='sachinanddotnet.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>My experiences with .NET</title>
		<link>http://sachinanddotnet.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://sachinanddotnet.wordpress.com/osd.xml" title="My experiences with .NET" />
	<atom:link rel='hub' href='http://sachinanddotnet.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Even numbers in Fibonacci series</title>
		<link>http://sachinanddotnet.wordpress.com/2011/12/28/even-numbers-in-fibonacci-series/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/12/28/even-numbers-in-fibonacci-series/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 20:58:46 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[Algorithms]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=184</guid>
		<description><![CDATA[I was solving a problem from http://projecteuler.net/. The problem asked to find sum of all even numbers in fibonacci series less than 4 million. Fibonacci series is 1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,&#8230;. Brute force way is to generate each number in the series check if it is an even number or not. If it is an even number then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=184&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I was solving a problem from <a href="http://projecteuler.net/" title="http://projecteuler.net/">http://projecteuler.net/</a>. The problem asked to find sum of all even numbers in fibonacci series less than 4 million.<br />
Fibonacci series is 1,2,3,5,8,13,21,34,55,89,144,233,377,610,987,1597,2584,&#8230;.</p>
<p>Brute force way is to generate each number in the series check if it is an even number or not. If it is an even number then add it up in some variable which will give the sum in the end.</p>
<p>A close observation of the series reveals that for every 2 odd numbers there is an even number. No wonder as<br />
even + odd = odd<br />
odd  + odd = even</p>
<p>Further more an even number in the series is 4 times the previous even number added with previous to previous even number.<br />
Even Number in Fibonacci Series = 4 * Previous even number in the series + Previous to previous even number in the series</p>
<p>ie 8 = 4 * 2 + 0<br />
  34 = 4 * 8 + 2<br />
 144 = 4 * 34 + 8<br />
 610 = 4 * 144 + 34<br />
2584 = 4 * 610 + 144</p>
<p>Thus instead of generating every number in the series, we can directly generate the even numbers in the fibonacci series reducing the iterations of a loop that generates these numbers by a factor of 3<br />
Happy Coding <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />   </p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/184/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/184/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/184/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=184&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/12/28/even-numbers-in-fibonacci-series/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>
	</item>
		<item>
		<title>Time Complexity Analysis</title>
		<link>http://sachinanddotnet.wordpress.com/2011/10/05/time-complexity-analysis/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/10/05/time-complexity-analysis/#comments</comments>
		<pubDate>Wed, 05 Oct 2011 02:00:38 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[Algorithms]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=177</guid>
		<description><![CDATA[What is the complexity of the following code and why? k = 0; for i1 = 1 to n for i2 = 1  to i1 for i3 = 1 to i2 &#8230;. &#8230;.. &#8230;. for im = 1 to im-1 k = k + 1 &#160; If you don&#8217;t remember or know Big-Oh notation, alternately [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=177&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What is the complexity of the following code and why?</p>
<p>k = 0;<br />
for i1 = 1 to n<br />
    for i2 = 1  to i1<br />
        for i3 = 1 to i2<br />
         &#8230;.<br />
         &#8230;..<br />
         &#8230;.<br />
            for i<span style="font-size:xx-small;">m</span> = 1 to i<span style="font-size:xx-small;">m-1</span><br />
             k = k + 1</p>
<p>&nbsp;</p>
<p>If you don&#8217;t remember or know Big-Oh notation, alternately what is the value of k?</p>
<p>Can you write a function which accepts n and m and outputs k?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/177/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/177/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/177/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=177&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/10/05/time-complexity-analysis/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>
	</item>
		<item>
		<title>Google Code Jam 2011</title>
		<link>http://sachinanddotnet.wordpress.com/2011/05/08/google-code-jam-2011/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/05/08/google-code-jam-2011/#comments</comments>
		<pubDate>Sun, 08 May 2011 06:24:09 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[C#.NET]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=173</guid>
		<description><![CDATA[Yesterday whole day I spent solving problems for Google Code Jam 2011 Qualification round. Happy to have qualified for the online round now. My (bad) code can be found at http://code.google.com/codejam/contest/scoreboard?c=975485#vf=1&#38;sp=5301 The problems can be found at http://code.google.com/codejam/contest/dashboard?c=975485# Most elegant and small solutions are coded by top performers in C++ Happy coding !<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=173&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Yesterday whole day I spent solving problems for Google Code Jam 2011 Qualification round.</p>
<p>Happy to have qualified for the online round now.</p>
<p>My (bad) code can be found at</p>
<p><a title="http://code.google.com/codejam/contest/scoreboard?c=975485#vf=1&amp;sp=5301" href="http://code.google.com/codejam/contest/scoreboard?c=975485#vf=1&amp;sp=5301" target="_blank">http://code.google.com/codejam/contest/scoreboard?c=975485#vf=1&amp;sp=5301</a></p>
<p>The problems can be found at</p>
<p><a title="http://code.google.com/codejam/contest/dashboard?c=975485#" href="http://code.google.com/codejam/contest/dashboard?c=975485#" target="_blank">http://code.google.com/codejam/contest/dashboard?c=975485#</a></p>
<p>Most elegant and small solutions are coded by top performers in C++</p>
<p>Happy coding !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=173&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/05/08/google-code-jam-2011/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>
	</item>
		<item>
		<title>Worst Algorithm to sort numbers</title>
		<link>http://sachinanddotnet.wordpress.com/2011/03/06/worst-algorithm-to-sort-numbers/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/03/06/worst-algorithm-to-sort-numbers/#comments</comments>
		<pubDate>Sun, 06 Mar 2011 03:58:41 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[Algorithms]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=169</guid>
		<description><![CDATA[Until now I have been asked (during interviews / vivas) too many times best sorting algorithms. We all know bubble sort, insertion sort, selection sort, merge sort, quick sort etc etc. These algorithms have time complexities ranging from O(n^2) to O(n lg n). If n is range bound you can also sort the numbers in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=169&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Until now I have been asked (during interviews / vivas) too many times best sorting algorithms.</p>
<p>We all know bubble sort, insertion sort, selection sort, merge sort, quick sort etc etc.</p>
<p>These algorithms have time complexities ranging from O(n^2) to O(n lg n). If n is range bound you can also sort the numbers in O(n) by indexing the numbers in an another array.</p>
<p>However once I was asked for a worst algorithm to sort the numbers.</p>
<p>Worst algorithm to sort the numbers has exponential time complexity. The algorithm is to find all the permutations of the given n numbers.  Assuming n numbers to be { a1, a2,&#8230;an) there would be a permutation of these numbers such that</p>
<p>a1&lt;a2&lt;a3&#8230;&lt;an</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/169/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/169/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/169/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=169&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/03/06/worst-algorithm-to-sort-numbers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>
	</item>
		<item>
		<title>So called initialization in C#</title>
		<link>http://sachinanddotnet.wordpress.com/2011/03/05/so-called-initialization-in-c/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/03/05/so-called-initialization-in-c/#comments</comments>
		<pubDate>Sat, 05 Mar 2011 09:31:22 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[C#.NET]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=164</guid>
		<description><![CDATA[The initialization statements are placed at the beginning of the constructor of the class containing the member before any of the other constructor statements. &#160; Following program outputs 10 using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Text; namespace ConsoleApplication1 { class Program { public readonly int myNumber = 5; public Program() [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=164&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The initialization statements are placed at the beginning of the constructor of the class containing the member before any of the other constructor statements.</p>
<p>&nbsp;</p>
<p>Following program outputs 10</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Reflection;<br />
using System.Runtime.InteropServices;<br />
using System.Text;</p>
<p>namespace ConsoleApplication1<br />
{<br />
class Program<br />
{<br />
public readonly int myNumber = 5;</p>
<p>public Program()<br />
{<br />
myNumber = 10;<br />
}</p>
<p>static void Main(string[] args)<br />
{<br />
Program p = new Program();<br />
Console.WriteLine(p.myNumber);</p>
<p>}<br />
}</p>
<p>}</p>
<p>&nbsp;</p>
<p>Here is the release mode optimized IL code which confirms the same.  I was surprised to see the compiler has not optimized the code to have only one assignment of 10. Instead you can find IL code for both assignments of 5 and 10</p>
<p>&nbsp;</p>
<p>.method public hidebysig specialname rtspecialname<br />
instance void  .ctor() cil managed<br />
{<br />
// Code size       25 (0&#215;19)<br />
.maxstack  8<br />
IL_0000:  ldarg.0<br />
IL_0001:  ldc.i4.5<br />
IL_0002:  stfld      int32 ConsoleApplication1.Program::myNumber<br />
IL_0007:  ldarg.0<br />
IL_0008:  call       instance void [mscorlib]System.Object::.ctor()<br />
IL_000d:  nop<br />
IL_000e:  nop<br />
IL_000f:  ldarg.0<br />
IL_0010:  ldc.i4.s   10<br />
IL_0012:  stfld      int32 ConsoleApplication1.Program::myNumber<br />
IL_0017:  nop<br />
IL_0018:  ret<br />
} // end of method Program::.ctor</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=164&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/03/05/so-called-initialization-in-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing Readonly field using reflection</title>
		<link>http://sachinanddotnet.wordpress.com/2011/01/10/changing-readonly-field-using-reflection/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/01/10/changing-readonly-field-using-reflection/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 18:52:02 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[C#.NET]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=160</guid>
		<description><![CDATA[In C# a readonly field can only be assigned a value in a constructor. However CLR can not stop a readonly field being modified using reflection. Using reflection a readonly field can be modified. An Example using System; using System.Collections.Generic; using System.Linq; using System.Reflection; using System.Runtime.InteropServices; using System.Text; namespace ConsoleApplication1 { class Program { public [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=160&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="color:#000000;"><span style="font-family:Georgia,&quot;">In C# a readonly field can only be assigned a value in a constructor.</span></span></p>
<p><span style="color:#000000;"><span style="font-family:Georgia,&quot;">However CLR can not stop a readonly field being modified using reflection. Using reflection a readonly field can be modified.</span></span></p>
<p><span style="color:#000000;"><span style="font-family:Georgia,&quot;">An Example</span></span></p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Reflection;<br />
using System.Runtime.InteropServices;<br />
using System.Text;</p>
<p>namespace ConsoleApplication1<br />
{<br />
class Program<br />
{<br />
public readonly int myNumber;</p>
<p>public Program()<br />
{<br />
myNumber = 10;<br />
}</p>
<p>static void Main(string[] args)<br />
{<br />
Program p = new Program();<br />
Console.WriteLine(p.myNumber);  // Writes 10<br />
FieldInfo field = p.GetType().GetFields()[0];<br />
field.SetValue(p, 12);<br />
Console.WriteLine(p.myNumber); // Writes 12<br />
}<br />
}</p>
<p>}</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/160/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/160/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/160/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=160&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/01/10/changing-readonly-field-using-reflection/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>
	</item>
		<item>
		<title>C# Vs C++</title>
		<link>http://sachinanddotnet.wordpress.com/2011/01/09/c-vs-c/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/01/09/c-vs-c/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 05:26:39 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[C#.NET]]></category>
		<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=138</guid>
		<description><![CDATA[A point where I think C++ is better than C# is treatment of Value Type (getting allocated on thread stack) and Reference Type( getting allocated on Heap or Managed Heap in case of .NET) In C++, code decides where the allocation happens. TypeA a = new TypeA(); always comes from Heap in C++ and TypeA [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=138&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>A point where I think C++ is better than C# is treatment of Value Type (getting allocated on thread stack) and Reference Type( getting allocated on Heap or Managed Heap in case of .NET)</p>
<p>In C++, code decides where the allocation happens.</p>
<p>TypeA a = new TypeA(); always comes from Heap in C++ and</p>
<p>TypeA a; always comes from thread&#8217;s stack in C++</p>
<p>However in C#</p>
<p>TypeA a = new TypeA(); can come from Managed Heap or Thread&#8217;s stack based on if  TypeA is a value type or is a reference type.</p>
<p>So in C# one always needs to know if a type is defined as a value type or as a reference type because the treatment of the two by the CLR differs and can result in unexpected behaviors.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/138/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/138/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/138/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=138&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/01/09/c-vs-c/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>
	</item>
		<item>
		<title>C++ Copy Constructor and Copy Assignment why a const reference ?</title>
		<link>http://sachinanddotnet.wordpress.com/2011/01/09/c-copy-constructor-and-copy-assignment-why-a-const-reference/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/01/09/c-copy-constructor-and-copy-assignment-why-a-const-reference/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 05:22:01 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[C++]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=140</guid>
		<description><![CDATA[As a young C++ developer, I was reading through C++ books. I read a line I use a reference argument for the copy constructor because I must. It took a while for me to understand the must in the above line ( dumb me !) In case you are also wondering about the must, then [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=140&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>As a young C++ developer, I was reading through C++ books. I read a line</p>
<p><strong><em>I use a reference argument for the copy constructor because I must.</em></strong></p>
<p>It took a while for me to understand the must in the above line ( dumb me !)</p>
<p>In case you are also wondering about the must, then it is a must because</p>
<p><strong><em>The copy constructor defines what copying means – including what copying an argument means.</em></strong></p>
<p>If it is still not clear, then lets take an example</p>
<p>Class A</p>
<p>{</p>
<p>public :</p>
<p>A() { }</p>
<p>A(const A&amp; a) { } // why reference &amp; const ?</p>
<p>}</p>
<p>Imagine what happens when I write code</p>
<p>A objA;</p>
<p>A newObjA(objA);</p>
<p>In the first line an object of type A called objA gets created using the constructor A().</p>
<p>In the second line, I want a newObjA of type A to be created from an existing object objA of the same type.</p>
<p>A copy of objA will be created and will be pushed on the executing thread&#8217;s stack as constructor call is ultimately a function call.  But how can a copy of objA be created ? By calling the copy constructor.</p>
<p>Let&#8217;s say I call the copy which needs to be pushed on the stack as copyOfObjAToPushOnStack.</p>
<p>The code for it will look like</p>
<p>A copyOfObjAToPushOnStack = new A(objA);</p>
<p>Aaah ! And we return to the same case as A newObjA(objA); only difference being instead of newObjA it is copyOfObjAToPushOnStack</p>
<p>So unless we pass a reference of objA, it is going to result in an infinite recursion.</p>
<p>This is the reason why a reference is a must in copy constructor.</p>
<p>The const part is to ensure at compile time that during the object construction, the object from which new object constructed does not get modified.</p>
<p>Same reasoning also applies to copy assignment.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/140/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/140/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/140/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=140&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/01/09/c-copy-constructor-and-copy-assignment-why-a-const-reference/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>
	</item>
		<item>
		<title>A runtime error which could have been better at compile time</title>
		<link>http://sachinanddotnet.wordpress.com/2011/01/09/a-runtime-error-which-could-have-been-better-at-compile-time/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/01/09/a-runtime-error-which-could-have-been-better-at-compile-time/#comments</comments>
		<pubDate>Sun, 09 Jan 2011 05:18:13 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[C#.NET]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=143</guid>
		<description><![CDATA[I read in one of the books It is illegal to define a type in which a reference type and a value type overlap. I was curious how this illegality was addressed. I thought it would have been at compile time. But to my surprise it is at run time ! An example using System; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=143&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I read in one of the books</p>
<p><em><strong>It is illegal to define a type in which a reference type and a value type overlap.</strong></em></p>
<p>I was curious how this illegality was addressed. I thought it would have been at compile time. But to my surprise it is at run time !</p>
<p>An example</p>
<p>using System;<br />
using System.Collections.Generic;<br />
using System.Linq;<br />
using System.Text;<br />
using System.Runtime.InteropServices;</p>
<p>namespace ConsoleApplication1<br />
{<br />
class Program<br />
{<br />
static void Main(string[] args)<br />
{<br />
MyStruct myStruct;<br />
}<br />
}</p>
<p>[StructLayout(LayoutKind.Explicit)]<br />
struct MyStruct<br />
{<br />
[FieldOffset(0)]<br />
public int a;</p>
<p>[FieldOffset(0)]<br />
public MyClass c;<br />
}</p>
<p>class MyClass<br />
{        }<br />
}</p>
<p>If you compile above program, it compiles without any error.</p>
<p>If you run it you will get an exception as</p>
<p><a href="http://sachinanddotnet.files.wordpress.com/2011/01/exception.png"><img class="alignnone size-full wp-image-144" title="Exception" src="http://sachinanddotnet.files.wordpress.com/2011/01/exception.png?w=600" alt=""   /></a></p>
<p>I wonder why this was not a compile time error, when compiler knew that the field c was of a reference type which overlapped with a value type field.</p>
<p>If anyone knows do let me know !</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/143/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/143/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/143/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=143&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/01/09/a-runtime-error-which-could-have-been-better-at-compile-time/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>

		<media:content url="http://sachinanddotnet.files.wordpress.com/2011/01/exception.png" medium="image">
			<media:title type="html">Exception</media:title>
		</media:content>
	</item>
		<item>
		<title>Enabling a server side disabled check box using javascript on the client side</title>
		<link>http://sachinanddotnet.wordpress.com/2011/01/04/enabling-a-server-side-disabled-check-box-using-javascript-on-the-client-side/</link>
		<comments>http://sachinanddotnet.wordpress.com/2011/01/04/enabling-a-server-side-disabled-check-box-using-javascript-on-the-client-side/#comments</comments>
		<pubDate>Tue, 04 Jan 2011 09:15:44 +0000</pubDate>
		<dc:creator>sachin kulkarni</dc:creator>
				<category><![CDATA[ASP.NET]]></category>

		<guid isPermaLink="false">http://sachinanddotnet.wordpress.com/?p=121</guid>
		<description><![CDATA[This is another case of non standard behavior of browsers. Javascript code for enabling a check box, which was disabled on the server works in Mozilla but fails in IE. Lets take a look at an example. Here is an aspx page. Here is the code behind.  In Mozilla both the check boxes chk2 &#38; [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=121&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is another case of non standard behavior of browsers. Javascript code for enabling a check box, which was disabled on the server works in Mozilla but fails in IE.</p>
<p>Lets take a look at an example.</p>
<p>Here is an aspx page.</p>
<p><a href="http://sachinanddotnet.files.wordpress.com/2011/01/aspx-page1.jpg"><img class="alignnone size-full wp-image-135" title="Aspx Page" src="http://sachinanddotnet.files.wordpress.com/2011/01/aspx-page1.jpg?w=600" alt=""   /></a></p>
<p><a href="http://sachinanddotnet.files.wordpress.com/2011/01/aspx-page.jpg"></a></p>
<p><a href="http://sachinanddotnet.files.wordpress.com/2011/01/code-behind.jpg"></a></p>
<p>Here is the code behind.</p>
<p><a href="http://sachinanddotnet.files.wordpress.com/2011/01/code-behind2.jpg"><img class="alignnone size-full wp-image-131" title="Code Behind" src="http://sachinanddotnet.files.wordpress.com/2011/01/code-behind2.jpg?w=600" alt=""   /></a></p>
<p> In Mozilla both the check boxes chk2 &amp; chk3 get enabled / disabled using the javascript.</p>
<p>However in IE, check box, chk3 does not respond to javascript.</p>
<p>The reason for it is the way the tags are rendered</p>
<p> &lt;input id=&#8221;chk1&#8243; type=&#8221;checkbox&#8221; name=&#8221;chk1&#8243; onclick=&#8221;javascript:Toggle(this);&#8221; /&gt;<br />
       <br />
&lt;input id=&#8221;chk2&#8243; type=&#8221;checkbox&#8221; name=&#8221;chk2&#8243; disabled=&#8221;disabled&#8221; /&gt;<br />
       <br />
&lt;span disabled=&#8221;disabled&#8221;&gt;&lt;input id=&#8221;chk3&#8243; type=&#8221;checkbox&#8221; name=&#8221;chk3&#8243; disabled=&#8221;disabled&#8221; /&gt;&lt;/span&gt;</p>
<p>The asp.net check box disabled on the server gets rendered as</p>
<p>&lt;span disabled=&#8221;disabled&#8221;&gt;&#8230;.</p>
<p><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"> </span></span></span></span></span><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"> </span></span></span></span></span> So even when the check box is enabled using javascript, it does not get enabled in IE. However Mozila deals with it fine and enables the check box.</p>
<p>The source code for the example can be found <a title="Code" href="http://www.codeproject.com/KB/aspnet/Technical.aspx" target="_blank">here</a></p>
<p><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"> </span></span></span></span></span></p>
<p><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"><span style="font-size:x-small;"> </span></span></span></span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/sachinanddotnet.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/sachinanddotnet.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/sachinanddotnet.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/sachinanddotnet.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/sachinanddotnet.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/sachinanddotnet.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/sachinanddotnet.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/sachinanddotnet.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/sachinanddotnet.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/sachinanddotnet.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/sachinanddotnet.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/sachinanddotnet.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/sachinanddotnet.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/sachinanddotnet.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=sachinanddotnet.wordpress.com&amp;blog=13255358&amp;post=121&amp;subd=sachinanddotnet&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://sachinanddotnet.wordpress.com/2011/01/04/enabling-a-server-side-disabled-check-box-using-javascript-on-the-client-side/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/0a3132b49ca2cb9500d022e7f4d3f121?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">sachinku</media:title>
		</media:content>

		<media:content url="http://sachinanddotnet.files.wordpress.com/2011/01/aspx-page1.jpg" medium="image">
			<media:title type="html">Aspx Page</media:title>
		</media:content>

		<media:content url="http://sachinanddotnet.files.wordpress.com/2011/01/code-behind2.jpg" medium="image">
			<media:title type="html">Code Behind</media:title>
		</media:content>
	</item>
	</channel>
</rss>
