<?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>Naveen&#039;s Weblog</title>
	<atom:link href="http://codingsense.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://codingsense.wordpress.com</link>
	<description>Bridge to future</description>
	<lastBuildDate>Sat, 31 Dec 2011 07:35:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='codingsense.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/c1d3004683ca980c0b0a5bd8910a456a?s=96&#038;d=http%3A%2F%2Fs2.wp.com%2Fi%2Fbuttonw-com.png</url>
		<title>Naveen&#039;s Weblog</title>
		<link>http://codingsense.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://codingsense.wordpress.com/osd.xml" title="Naveen&#039;s Weblog" />
	<atom:link rel='hub' href='http://codingsense.wordpress.com/?pushpress=hub'/>
		<item>
		<title>2010 in review</title>
		<link>http://codingsense.wordpress.com/2011/01/02/2010-in-review/</link>
		<comments>http://codingsense.wordpress.com/2011/01/02/2010-in-review/#comments</comments>
		<pubDate>Sun, 02 Jan 2011 16:35:35 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
		
		<guid isPermaLink="false">http://codingsense.wordpress.com/?p=500</guid>
		<description><![CDATA[The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here&#8217;s a high level summary of its overall blog health: The Blog-Health-o-Meter™ reads Wow. Crunchy numbers About 3 million people visit the Taj Mahal every year. This blog was viewed about 52,000 times in 2010. If it were the Taj [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=500&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The stats helper monkeys at WordPress.com mulled over how this blog did in 2010, and here&#8217;s a high level summary of its overall blog health:</p>
<p><img style="border:1px solid #ddd;background:#f5f5f5;padding:20px;" src="http://s0.wp.com/i/annual-recap/meter-healthy5.gif" alt="Healthy blog!" width="250" height="183" /></p>
<p>The <em>Blog-Health-o-Meter™</em> reads Wow.</p>
<h2>Crunchy numbers</h2>
<p><a href="http://codingsense.files.wordpress.com/2009/03/rightjoinlinq2.jpg"><img style="max-height:230px;float:right;border:1px solid #ddd;background:#fff;margin:0 0 1em 1em;padding:6px;" src="http://codingsense.files.wordpress.com/2009/03/rightjoinlinq2.jpg?w=288" alt="Featured image" /></a></p>
<p>About 3 million people visit the Taj Mahal every year.  This blog was viewed about <strong>52,000</strong> times in 2010.  If it were the Taj Mahal, it would take about 6 days for that many people to see it.</p>
<p>&nbsp;</p>
<p>In 2010, there were <strong>15</strong> new posts, growing the total archive of this blog to 63 posts. There were <strong>10</strong> pictures uploaded, taking up a total of 166kb. That&#8217;s about a picture per month.</p>
<p>The busiest day of the year was December 14th with <strong>282</strong> views. The most popular post that day was <a style="color:#08c;" href="http://codingsense.wordpress.com/2009/03/08/left-join-right-join-using-linq/">Left Join, Right Join Using LINQ</a>.</p>
<p>&nbsp;</p>
<h2>Where did they come from?</h2>
<p>The top referring sites in 2010 were <strong>google.com</strong>, <strong>google.co.in</strong>, <strong>codeproject.com</strong>, <strong>yandex.ru</strong>, and <strong>social.msdn.microsoft.com</strong>.</p>
<p>Some visitors came searching, mostly for <strong>linq left join</strong>, <strong>left join linq</strong>, <strong>linq join</strong>, <strong>left join in linq</strong>, and <strong>linq join example</strong>.</p>
<div style="clear:both;"></div>
<h2>Attractions in 2010</h2>
<p>These are the posts and pages that got the most views in 2010.</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">1</div>
<p><a style="margin-right:10px;" href="http://codingsense.wordpress.com/2009/03/08/left-join-right-join-using-linq/">Left Join, Right Join Using LINQ</a> <span style="color:#999;font-size:8pt;">March 2009</span><br />
16 comments</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">2</div>
<p><a style="margin-right:10px;" href="http://codingsense.wordpress.com/2010/02/01/customize-a-slider-in-wpf-step-by-step-tutorial/">Customize a slider in WPF, Step by Step Tutorial</a> <span style="color:#999;font-size:8pt;">February 2010</span><br />
1 comment</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">3</div>
<p><a style="margin-right:10px;" href="http://codingsense.wordpress.com/2008/09/16/differnce-between-select-and-selectmany-in-linq/">Difference between Select and SelectMany in LINQ</a> <span style="color:#999;font-size:8pt;">September 2008</span><br />
7 comments</p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">4</div>
<p><a style="margin-right:10px;" href="http://codingsense.wordpress.com/2008/12/31/mssql-output-in-xml-using-for-xml/">MSSQL Output in XML using For XML</a> <span style="color:#999;font-size:8pt;">December 2008</span></p>
<div style="clear:left;float:left;font-size:24pt;line-height:1em;margin:-5px 10px 20px 0;">5</div>
<p><a style="margin-right:10px;" href="http://codingsense.wordpress.com/2008/12/23/bulk-insert-and-update-mssql/">Bulk Insert and Update MSSQL</a> <span style="color:#999;font-size:8pt;">December 2008</span><br />
14 comments</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/500/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/500/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/500/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=500&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2011/01/02/2010-in-review/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>

		<media:content url="http://s0.wp.com/i/annual-recap/meter-healthy5.gif" medium="image">
			<media:title type="html">Healthy blog!</media:title>
		</media:content>

		<media:content url="http://codingsense.files.wordpress.com/2009/03/rightjoinlinq2.jpg?w=288" medium="image">
			<media:title type="html">Featured image</media:title>
		</media:content>
	</item>
		<item>
		<title>The designer cannot process the code at line</title>
		<link>http://codingsense.wordpress.com/2010/12/05/the-designer-cannot-process-the-code-at-line/</link>
		<comments>http://codingsense.wordpress.com/2010/12/05/the-designer-cannot-process-the-code-at-line/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 10:26:52 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
		
		<guid isPermaLink="false">http://codingsense.wordpress.com/2010/12/05/the-designer-cannot-process-the-code-at-line/</guid>
		<description><![CDATA[From somedays back I was getting a weird problem while opening the design of windows form. The error message looked like the below one The designer cannot process the code at line 37: this.comboBox1.Items.AddRange(new []{ &#8220;one&#8221;, &#8220;two&#8221;, &#8220;three&#8221;, &#8220;four&#8221;}); The code within the method &#8216;InitializeComponent&#8217; is generated by the designer and should not be manually [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=499&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana,Arial,Helvetica,sans-serif" size="2">From somedays back I was getting a weird problem while opening the design of windows form. The error message looked like the below one</p>
<p><b><font size="3">The designer cannot process the code at line 37: this.comboBox1.Items.AddRange(new []{ &#8220;one&#8221;, &#8220;two&#8221;, &#8220;three&#8221;, &#8220;four&#8221;}); The code within the method &#8216;InitializeComponent&#8217; is generated by the designer and should not be manually modified. Please remove any changes and try opening the designer again. </font></b></p>
<p>If I commented the AddRange line it was working fine or It was pointing at the next line those had AddRange method. I quickly googled for the solution and found many but none of the fix was useful. By careful observation I found that something was missing the line. See if you can observe what&#8217;s missing the below line <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p> &nbsp;<font color="#0000FF" size="2">this</font><font size="2">.comboBox1.Items.AddRange(</font><font color="#0000FF" size="2">new</font><font size="2"> []{</font><br />
<font color="#A31515" size="2">&#8220;one&#8221;</font><font size="2">,</font><br />
<font color="#A31515" size="2">&#8220;two&#8221;</font><font size="2">,</font><br />
<font color="#A31515" size="2">&#8220;three&#8221;</font><font size="2">,</font><br />
<font color="#A31515" size="2">&#8220;four&#8221;</font><font size="2">});</font></p>
<p>Just adding the type of the array that I was creating solved my problem, for above problem I added <font color="#0000FF" size="2">new <font color="#0000FF" size="2">object</font></font><font size="2">[]</font> and then all worked fine.</p>
<p><font color="#0000FF" size="2">this</font><font size="2">.comboBox1.Items.AddRange(</font><font color="#0000FF" size="2">new <font color="#0000FF" size="2">object</font></font><font size="2">[]{</font><br />
<font color="#A31515" size="2">&#8220;one&#8221;</font><font size="2">,</font><br />
<font color="#A31515" size="2">&#8220;two&#8221;</font><font size="2">,</font><br />
<font color="#A31515" size="2">&#8220;three&#8221;</font><font size="2">,</font><br />
<font color="#A31515" size="2">&#8220;four&#8221;</font><font size="2">});</font></p>
<p>After fixing the issue I started searching for the person who had removed it, I wanted to show him the issue so that he will not do the same next time. After searching for hours I found that it was Mr. ReSharper who had removed the type. From then I started carefully using Resharper instead of just clicking on what it suggests.</p>
<p>Happy coding <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Codingsense<br />
</font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/499/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/499/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/499/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/499/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/499/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/499/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/499/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/499/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/499/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/499/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/499/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/499/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/499/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/499/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=499&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2010/12/05/the-designer-cannot-process-the-code-at-line/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>
	</item>
		<item>
		<title>Zip/Unzip using System.IO.Package in .Net</title>
		<link>http://codingsense.wordpress.com/2010/12/05/zipunzip-using-system-io-package-in-net/</link>
		<comments>http://codingsense.wordpress.com/2010/12/05/zipunzip-using-system-io-package-in-net/#comments</comments>
		<pubDate>Sun, 05 Dec 2010 09:54:53 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://codingsense.wordpress.com/2010/12/05/zipunzip-using-system-io-package-in-net/</guid>
		<description><![CDATA[I was working on a project where it was required to zip and unzip files, these days we were using Cabarc.exe and all was working fine. Now we planned to give unicode support and booom!! cabarc.exe failed to zip the folder, since it does not support unicode characters. I found that there are many open [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=493&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana,Arial,Helvetica,sans-serif" size="2">I was working on a project where it was required to zip and unzip files, these days we were using Cabarc.exe and all was working fine. Now we planned to give unicode support and booom!! cabarc.exe failed to zip the folder, since it does not support unicode characters. I found that there are many open source projects like SharpZipLib, DotNetZip etc. But we did not wanted to use the available open source projects to implement it. So I decided to search for some other option and what I found is System.IO.Package in WindowsBase.dll. It exposes a class called Package which will help to pack and unpack files and folders. </p>
<p><a href="http://www.box.net/shared/9putv34xcg" title="http://www.box.net/shared/9putv34xcg">Download Source code (13 Kb)</a></p>
<p>I have made a separate dll (CustomPackage.dll) that you can use for zipping and unzipping of folders. I have also created a dummy project PackageWrapper to help you understand how to make calls to the dll.</p>
<p><a href="http://codingsense.files.wordpress.com/2010/12/package.png"><img src="http://codingsense.files.wordpress.com/2010/12/package.png" alt="" title="Package" width="532" height="243" class="alignnone size-full wp-image-494" /></a></p>
<p><b>Features:</b></p>
<ul>
<li>The project supports Unicode characters in folder or files (Limitation with Cabarc.exe)</li>
<li>Zipping is done also for all sub directories . While unzipping the same directory structure will be maintained.
</li>
</ul>
<p><b>Improvements for you to do:</b><br />
I have used Mime Type as <font color="#2B91AF" size="2">MediaTypeNames</font><font size="2">.</font><font color="#2B91AF" size="2">Application</font><font size="2">.Octet</font> to make it generic and support all kind of files and have used the compression option <font color="#2B91AF" size="2">CompressionOption</font><font size="2">.NotCompressed</font> since the mime type will not compress. If you know that you will have only similar type of files to zip or unzip then you can select proper Mime type and compression option as <font color="#2B91AF" size="2">CompressionOption</font><font size="2">.Maximum</font> to compress the files to maximum extent.</p>
<p>For any kind of improvements or clarifications please feel free to comment.</p>
<p>Happy Coding <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Codingsense</p>
<p> </font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/493/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/493/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/493/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=493&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2010/12/05/zipunzip-using-system-io-package-in-net/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>

		<media:content url="http://codingsense.files.wordpress.com/2010/12/package.png" medium="image">
			<media:title type="html">Package</media:title>
		</media:content>
	</item>
		<item>
		<title>Get all controls on a windows form without recursion</title>
		<link>http://codingsense.wordpress.com/2010/07/22/get-all-controls-on-a-windows-form-without-recursion/</link>
		<comments>http://codingsense.wordpress.com/2010/07/22/get-all-controls-on-a-windows-form-without-recursion/#comments</comments>
		<pubDate>Thu, 22 Jul 2010 17:05:56 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://codingsense.wordpress.com/2010/07/22/get-all-controls-on-a-windows-form-without-recursion/</guid>
		<description><![CDATA[Hi, Its given in microsoft patterns and practices to consider replacing recursion with looping because each recursive call adds data to the stack. Examine your code and see if your recursive calls can be converted to a looping equivalent. I was wondering if all the solutions that uses recursion can be replaced without using recursion. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=483&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana,Arial,Helvetica,sans-serif" size="2">Hi,</p>
<p>Its given in  <a href="http://msdn.microsoft.com/en-us/library/ms998547.aspx">microsoft patterns and practices</a> to consider replacing recursion with looping because each recursive call adds data to the stack. Examine your code and see if your recursive calls can be converted to a looping equivalent. </p>
<p>I was wondering if all the solutions that uses recursion can be replaced without using recursion.<br />
So I took the first step in looking into my project and found a piece of code that was using recursion, a function that would give me all the controls on a windows form. So I decided trying to convert that code without the use of recursive call.</p>
<p>Here is what I came up with,</p>
<pre style="overflow:auto;width:95%;color:#000000;line-height:14px;border:#999999 1px dashed;font-size:15px;padding:5px;">

<font color="#0000FF" size="2">static </font><font color="#2B91AF" size="2">IList</font><font size="2"> getControls(</font><font color="#2B91AF" size="2">Control</font><font size="2"> ParentControl)
{</font>
<font color="#2B91AF" size="2">List</font><font size="2">&lt;</font><font color="#2B91AF" size="2">Control</font><font size="2">&gt; ListOfControls = </font><font color="#0000FF" size="2">new </font><font color="#2B91AF" size="2">List</font><font size="2">&lt;</font><font color="#2B91AF" size="2">Control</font><font size="2">&gt;();</font>
<font color="#2B91AF" size="2">List</font><font size="2">&lt;</font><font color="#2B91AF" size="2">Control</font><font size="2">&gt; ContainerControls = </font><font color="#0000FF" size="2">new </font><font color="#2B91AF" size="2">List</font><font size="2">&lt;</font><font color="#2B91AF" size="2">Control</font><font size="2">&gt;();
ContainerControls.Add(ParentControl);</font>

<font color="#0000FF" size="2">while</font><font size="2"> (ContainerControls.Count &gt; 0)
{</font>
<font color="#0000FF" size="2">foreach</font><font size="2"> (</font><font color="#2B91AF" size="2">Control</font><font size="2"> control </font><font color="#0000FF" size="2">in</font><font size="2"> ContainerControls[0].Controls)
{</font>
<font color="#0000FF" size="2">if</font><font size="2"> (control.Controls.Count &gt; 0)
{
ContainerControls.Add(control);
}
ListOfControls.Add(control);
}
ContainerControls.Remove(ContainerControls[0]);
}</font>
<font color="#0000FF" size="2">return</font><font size="2"> ListOfControls;
}</font>
</pre>
<p>Great, the method gave me proper result as compared with the recursive function, what next I wanted to see how it has increased in performance and I used stopwatch to determine the time taken by both of the methods on the same form which was heavily loaded with controls and containers, it had 82 controls on it. The time taken by recursive function was double the time taken by the new method. </p>
<p>So I concluded that replacing recursive method with looping will enhance performance and also helps in consuming less memory.</p>
<p>If you get a better way to overcome recursion then please feel free to comment, till then I will continue my search for more recursive calls in my code. </p>
<p>Happy Learning <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
Codingsense<br />
</font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/483/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/483/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/483/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=483&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2010/07/22/get-all-controls-on-a-windows-form-without-recursion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>
	</item>
		<item>
		<title>The module &#8220;D:\..\support files\..\abc.dll&#8221; was loaded but the call to DllRegisterServer failed with error code 0&#215;80020009.</title>
		<link>http://codingsense.wordpress.com/2010/07/01/the-module-d-support-files-abc-dll-was-loaded-but-the-call-to-dllregisterserver-failed-with-error-code-0x80020009/</link>
		<comments>http://codingsense.wordpress.com/2010/07/01/the-module-d-support-files-abc-dll-was-loaded-but-the-call-to-dllregisterserver-failed-with-error-code-0x80020009/#comments</comments>
		<pubDate>Thu, 01 Jul 2010 17:19:16 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
				<category><![CDATA[Errors]]></category>

		<guid isPermaLink="false">http://codingsense.wordpress.com/2010/07/01/the-module-d-support-files-abc-dll-was-loaded-but-the-call-to-dllregisterserver-failed-with-error-code-0x80020009/</guid>
		<description><![CDATA[Hi, While registering a com dll using RegSvr32 I encountered the following problem in Windows 7 Problem: The moduleThe module &#8220;D:\..\support files\..\abc.dll&#8221; was loaded but the call to DllRegisterServer failed with error code 0&#215;80020009. For more information about this problem, search online using the error code as a search term. Solution: 1) I opened command [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=480&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana,Arial,Helvetica,sans-serif" size="2"><br />
Hi,</p>
<p>While registering a com dll using RegSvr32 I encountered the following problem in Windows 7</p>
<p><b>Problem:</b><br />
The moduleThe module &#8220;D:\..\support files\..\abc.dll&#8221; was loaded but the call to DllRegisterServer failed with error code 0&#215;80020009.<br />
For more information about this problem, search online using the error code as a search term.</p>
<p><b>Solution:</b><br />
1) I opened command prompt in <b>administrator mode</b>. ( Always open the cmd.exe in administrator mode while registring a dll in Vista or Win 7, Steps &#8211; Type cmd in search box, when cmd is listed in the above list, right click it and click open as administrator)<br />
2) The folder &#8220;Support files&#8221; was having a space so it failed to locate it. I navigated to the support files and then used regsvr32 command and all worked fine <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Happy Learning,<br />
CodingSense </p>
<p></font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/480/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/480/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/480/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=480&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2010/07/01/the-module-d-support-files-abc-dll-was-loaded-but-the-call-to-dllregisterserver-failed-with-error-code-0x80020009/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>
	</item>
		<item>
		<title>Writing Custom FxCop Rules</title>
		<link>http://codingsense.wordpress.com/2010/05/23/writing-custom-fxcop-rules/</link>
		<comments>http://codingsense.wordpress.com/2010/05/23/writing-custom-fxcop-rules/#comments</comments>
		<pubDate>Sun, 23 May 2010 15:58:02 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://codingsense.wordpress.com/2010/05/23/writing-custom-fxcop-rules/</guid>
		<description><![CDATA[FxCop is a static analysis tool that you can use to write custom rules those need to be followed by the developers. Writing custom rules in FxCop is very easy, in the beginning you will feel it bit complex since there are no much help available on web but once if you have written a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=467&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana,Arial,Helvetica,sans-serif" size="2">FxCop is a static analysis tool that you can use to write custom rules those need to be followed by the developers. Writing custom rules in FxCop is very easy, in the beginning you will feel it bit complex since there are no much help available on web but once if you have written a rule you will be preety much confident that you can write any rule you desire. </p>
<p><a href="http://www.microsoft.com/downloads/details.aspx?FamilyID=9aeaa970-f281-4fb0-aba1-d59d7ed09772&amp;displaylang=en">Download FxCop</a></p>
<p>SInce FxCop analyses IL code from your assemblies, we should know about some of the keywords of IL to write complex rules. Use <a href="http://msdn.microsoft.com/en-us/library/system.reflection.emit.opcodes_members.aspx">this</a> sheet as a reference while seeing your IL code through ILDASM.</p>
<p>I have created a template project for Custom FxCop Rules for you which you can use and add your rules. So that you can concentrate more on Custom Rules rather than creating the project. </p>
<p><a href="http://www.box.net/shared/ivhi1enc78">Download CustomFxCopRules template</a></p>
<p>If you want to add any new rule you have to follow these steps using the above template.</p>
<ol>
<li>Create a class and name it with the rule.</li>
<li>Create a new node of that of the classname (not necessary but only for easier reference) in CustomRules.xml with desired settings</li>
<li>Create a constant with the same name and value in Constants.resx file</li>
<li>Write your logic in that class </li>
</ol>
<p>And to debug the rules that you have written here is a post<br />
<a href="http://social.msdn.microsoft.com/forums/en-US/vstscode/thread/b92a0416-bf20-40c1-88a0-8fcff07133dc/">http://social.msdn.microsoft.com/forums/en-US/vstscode/thread/b92a0416-bf20-40c1-88a0-8fcff07133dc/</a></p>
<p><b>More References:</b><br />
<a href="http://www.binarycoder.net/fxcop/pdf/fxcop.pdf">http://www.binarycoder.net/fxcop/pdf/fxcop.pdfhttp://www.binarycoder.net/fxcop/pdf/fxcop.pdf</a><br />
<a href="http://www.nmentor.com/Blog/Tutorials/1.%20How%20to%20Write%20Custom%20FxCop%20Rule.pdf">http://www.nmentor.com/Blog/Tutorials/1.%20How%20to%20Write%20Custom%20FxCop%20Rule.pdf</a></p>
<p>I will put some of the custom rules in coming post which willl cover all the required topics to make you understand FxCop better. If you want any specific rule, then feel free to post a comment to me and I will help you out <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Happy Learning<br />
Codingsense <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p></font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/467/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/467/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/467/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=467&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2010/05/23/writing-custom-fxcop-rules/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>
	</item>
		<item>
		<title>Why and how use comments effectively</title>
		<link>http://codingsense.wordpress.com/2010/05/22/why-and-how-use-comments-effectively/</link>
		<comments>http://codingsense.wordpress.com/2010/05/22/why-and-how-use-comments-effectively/#comments</comments>
		<pubDate>Sat, 22 May 2010 09:23:25 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
				<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Maintenance]]></category>

		<guid isPermaLink="false">http://codingsense.wordpress.com/2010/05/22/why-and-how-use-comments-effectively/</guid>
		<description><![CDATA[A code is said to be good by the quality of comments it contains. A code with good quality of comments will save a lot of time and help to understand the code quick and better and while maintaining software and avoid regression bugs. Many products and companies do not strictly follow writing of comments [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=463&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana,Arial,Helvetica,sans-serif" size="2">A code is said to be good by the quality of comments it contains. A code with good quality of comments will save a lot of time and help to understand the code quick and better and while maintaining software and avoid regression bugs. Many products and companies do not strictly follow writing of comments in the product. So if your product has no comments or little then start writing the proper comments.</p>
<p>We should have Comments for</p>
<ol>
<li><b>Classes</b></li>
<ul>
<li>What does the class do? </li>
<li>Which other classes are used by it?</li>
</ul>
<li><b>Methods</b></li>
<ul>
<li>What does the method do? </li>
<li>What are the inputs and return type? </li>
<li>What changes to the system is done by that method (if it is updating a database or xml file or a static variable of some other class etc)</li>
</ul>
<li><b>Comment Complex lines</b></li>
<ul>
<li>Emphasis more on why the below line is required than what the below line does (e.g. assume the scenario in which we are iterating a list and we are incrementing the List index by one, instead of writing the obvious &#8220;Increment the index by one&#8221; write &#8220;move to the next element in the list by incrementing the index by one&#8221;)</li>
<li>Write comments to only the lines which are not obvious. Comments will be required majorly for algorithms or if it&#8217;s changing the behavior of a system.</li>
</ul>
<li><b>Give appropriate names to variables and </b>Methods</li>
<ul>
<li>Giving proper names to variables and methods for what it does help to understand the obvious lines much better, avoid comments for such lines. Like if I have a variable named hasOperationFailed, by just looking it I can be sure that it&#8217;s a Boolean fields and while checking the conditions like If(hasOperationFailed) makes me understand what condition am I checking.</li>
</ul>
<li><b>Read the comment twice after writing</b></li>
<ul>
<li>This may seem to waste time but trust me, after reading the written comment again we tend to re write the lines many times. Since the value of comments can only be said by the reader who uses it. So if the lines are simple to understand and appropriate then your efforts will be considered.</li>
</ul>
</ol>
<p>There are software&#8217;s that fetches the comments from your code and gives the output in different formats so that you can verify your comments and it can be used as a guide for what your classes and methods does.<br />
Here are the list of some</p>
<ul>
<li><a href="http://blogs.msdn.com/sandcastle/" title="http://blogs.msdn.com/sandcastle/">SandCastle</a></li>
<li><a href="http://ndoc.sourceforge.net/" title="http://ndoc.sourceforge.net/">NDoc</a></li>
</ul>
<p><b>Other references:</b><br />
<a href="http://www.codeproject.com/KB/XML/csharpcodedocumentation.aspx?msg=1679454">http://www.codeproject.com/KB/XML/csharpcodedocumentation.aspx?msg=1679454</a></p>
<p>Happy learning,<br />
Codingsense <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p></font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/463/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/463/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/463/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=463&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2010/05/22/why-and-how-use-comments-effectively/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>
	</item>
		<item>
		<title>Steps to improve maintainability of your code</title>
		<link>http://codingsense.wordpress.com/2010/05/13/steps-to-improve-maintainability-of-your-code/</link>
		<comments>http://codingsense.wordpress.com/2010/05/13/steps-to-improve-maintainability-of-your-code/#comments</comments>
		<pubDate>Thu, 13 May 2010 16:32:54 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[Solutions]]></category>
		<category><![CDATA[Maintenance]]></category>
		<category><![CDATA[Tips and Tricks]]></category>

		<guid isPermaLink="false">http://codingsense.wordpress.com/?p=444</guid>
		<description><![CDATA[Hi, I have seen people always telling that maintaining a product is harder. All people want to go into the product or module where its building from the scratch and pass the older code to our juniors. Why?? Is it that we want to learn new things or we don&#8217;t want to waste time in [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=444&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">Hi,</span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">I have seen people always telling that maintaining a product is harder. All people want to go into the product or module where its building from the scratch and pass the older code to our juniors. <strong>Why??</strong> Is it that we want to learn new things or we don&#8217;t want to waste time in the product where we have put lots of effort to ruin it or are we afraid??</span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">Is there any easy way to convert bad code to good code. Its not like moving a magic wand and all code is straight. First of all we should accept that its our mistake, unless we accept our mistake we keep giving hundreds of reasons to run away from it. We should have interest in making it good, plan properly and execute with determination. Here&#8217;s my story wherein I have gone through phases from good to bad and bad to good. </span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">Two years back in Feb 2008 I started a product and was playing a role of tech lead. There were lots of eyes and concerns on that product that it will be a game changer for our company. There was a long list of feature given by our functional team, plan to combine 2 existing product functionality into one, easy navigation, and the old saying was repeated &#8220;URGENT REQUIREMENT&#8221; we were given 1 year for the first product release. So it began, planning of modules, prioritizing the features, coding standards was revisited, right features were assigned to right persons etc etc. Full team was motivated to work in the upcoming successful product.</span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">Days passed&#8230; somewhere after 6 months an internal release was planned for the functional team and for the stakeholders. Great all were happy, I and my team got many awards, good recognition in the company and got some suggestions (also known as changes) in the software. All changes were incorporated successfully with the new features parallel development. </span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">All was going great, until after some 5 months (1 month left for delivery) some expert gave (very late) a very good suggestion to the management for future perspective. When we received the document of changes they were huge, major changes had to be done in many of the key classes. All teammates were sort of disappointed that their feature which was done with lot of hard work and interest would be corrupted. They started blaming the management, for such changes. But all cooperated since we were the experts and it would be shame to go against the changes expected. </span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">Now started the actual impact, changes were planned, one change would affects other flow, dependency between the classes was more, poor commented code,  testers started doing stress testing on the bug tracking tool by putting more and more bugs in it.All team was under stress, daily pig meetings were started to know the status. Day by day the deadlines were nearing and the features and bugs were poured more on us.</span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">Finally we ended up not giving the full product in the expected deadline. The days of the awards and recognition were gone. For next week I and some senior members were very busy in answering what went wrong and why we dint reach the target. Since there was intense pressure from the marketing team the product was shipped to the customers who were waiting for it. There were still more changes pitching in and we were very much tensed how to incorporate those without creating regression bugs in our product. Many bugs were reported by the customer and fixing them was a huge task for us.</span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">On one evening was not feeling to go home so stayed till night I thougth that I and my team were responsible for the bad code and we are the one going to fix those and show our potential. I started recollecting all the mistakes that were done by me and my team and started documenting it, further found some tips across the web and added those. After analyzing the entire problem I found angle of deviation that we had been from our actual goal and plans and listed all the faults that we had done. Made up my mind to speak to the management in the early morning regarding it and get some time to refactor and restructure the code. The following steps were planned to be executed with intense care.</span></p>
<ul> <span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;"></p>
<li><a href="http://codingsense.wordpress.com/2010/05/22/why-and-how-use-comments-effectively/">Put proper comments</a></li>
<li>Fix coding standards and project conventions</li>
<li>Remove unnecessary code</li>
<li>Identifying and breaking up big classes</li>
<li>Breaking up big methods</li>
<li>Refactor existing code</li>
<li>Remove memory leaks</li>
<li>Restructuring</li>
<li>Write automated unit tests</li>
<p></span></ul>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">After following each step properly with collecting the daily status from the team, sharing the problems and discussing some new solutions, finally it took around 7 months to complete the product.<br />
Even though we were late by 8 months we had reached the goal properly and were ready to accept any further changes. From last year the product was sent to the market and there was very good response from our customers and the days of awards had begun again.<br />
From next posts I am planning to go in depth of execution of each of the steps followed.</span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">For any clarification please revert back.</span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;">Happy Coding<br />
Naveen Prabhu <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </span></p>
<p><span style="font-family:Verdana,Arial,Helvetica,sans-serif;font-size:small;"> </span></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/444/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/444/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/444/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=444&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2010/05/13/steps-to-improve-maintainability-of-your-code/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>
	</item>
		<item>
		<title>Why Avoid Exception</title>
		<link>http://codingsense.wordpress.com/2010/03/16/why-avoid-exception/</link>
		<comments>http://codingsense.wordpress.com/2010/03/16/why-avoid-exception/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 09:56:43 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://codingsense.wordpress.com/2010/03/16/why-avoid-exception/</guid>
		<description><![CDATA[Hi, Last week I was optimizing a module, as I was working I found that if exceptions are avoided then we can save lot of fruitful time. So made the below sample to see how much time we can save by avoiding an exception. In below sample a method just iterates and another method throws [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=437&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana,Arial,Helvetica,sans-serif" size="2">Hi,</p>
<p>Last week I was optimizing a module, as I was working I found that if exceptions are avoided then we can save lot of fruitful time. So made the below sample to see how much time we can save by avoiding an exception.</p>
<p>In below sample a method just iterates and another method throws an exception.</p>
<pre style="overflow:auto;width:95%;color:#000000;line-height:14px;border:#999999 1px dashed;font-size:15px;padding:5px;">

<font color="#0000FF" size="2">using</font><font size="2"> System;</font>

<font color="#0000FF" size="2">namespace</font><font size="2"> ConsoleApplication1
{</font>
<font color="#0000FF" size="2">class </font><font color="#2B91AF" size="2">Program&nbsp;&nbsp;&nbsp;&nbsp;</font>
<font size="2">{</font>
<font color="#0000FF" size="2">static <font color="#0000FF" size="2">void</font></font><font size="2"> Main(</font><font color="#0000FF" size="2">string</font><font size="2">[] args)
{
System.Diagnostics.</font><font color="#2B91AF" size="2">Stopwatch</font><font size="2"> sw = </font><font color="#0000FF" size="2">new</font><font size="2"> System.Diagnostics.</font><font color="#2B91AF" size="2">Stopwatch</font><font size="2">();

sw.Start();
loopProper();
sw.Stop();</font>
<font color="#2B91AF" size="2">Console</font><font size="2">.WriteLine(</font><font color="#A31515" size="2">"Looping Time : "</font><font size="2"> + sw.ElapsedMilliseconds);

sw.Reset();
sw.Start();
ThrowException();
sw.Stop();</font>
<font color="#2B91AF" size="2">Console</font><font size="2">.WriteLine(</font><font color="#A31515" size="2">"Exception not hanlded Time : "</font><font size="2"> + sw.ElapsedMilliseconds);</font>

<font color="#2B91AF" size="2">Console</font><font size="2">.Read();
}</font>

<font color="#0000FF" size="2">static <font color="#0000FF" size="2">void</font></font><font size="2"> loopProper()
{</font>
<font color="#0000FF" size="2">for</font><font size="2"> (</font><font color="#0000FF" size="2">long</font><font size="2"> Index = 0; Index &lt; 350000; Index++)
{

}
}</font>

<font color="#0000FF" size="2">static <font color="#0000FF" size="2">void</font></font><font size="2"> ThrowException()
{</font>
<font color="#0000FF" size="2">long</font><font size="2"> Temp = 0;</font>
<font color="#0000FF" size="2">long</font><font size="2"> Zero = 0;</font>

<font color="#0000FF" size="2">try&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
<font size="2">{
Temp = Temp / Zero;
}</font>
<font color="#0000FF" size="2">catch</font><font size="2"> (</font><font color="#2B91AF" size="2">ArithmeticException</font><font size="2"> ex)
{

}
}
}
}</font>
</pre>
<p>After running the above sample we can find that an time taken by just one exception is approx around time taken by 3,50,000 iterations. So if we can avoid exceptions then we can do more fruitful work in the same time.</p>
<p>I dont mean that exception handling should not be used, but try to avoid it to maximum. If you can use some <b>if conditions</b> where you know the line might give an exception, and see how the performance increases.</p>
<p>Any about my output, the module had a algorithm that would take<b> 80-85 sec</b> to complete and after optimization its taking<b> 2 sec</b> to complete. Changes in logic of the algorithm and exception handling increased the performance drastically. </p>
<p>Happy learning,<br />
Codingsense <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p></font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/437/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/437/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/437/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=437&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2010/03/16/why-avoid-exception/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>
	</item>
		<item>
		<title>Aborting a suspended thread</title>
		<link>http://codingsense.wordpress.com/2010/03/16/aborting-a-suspended-thread/</link>
		<comments>http://codingsense.wordpress.com/2010/03/16/aborting-a-suspended-thread/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 09:17:46 +0000</pubDate>
		<dc:creator>codingsense</dc:creator>
				<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://codingsense.wordpress.com/2010/03/16/aborting-a-suspended-thread/</guid>
		<description><![CDATA[Hi, I was working on a multithreading application and found an interesting thing on resuming a thread, so planned to share with you. When a thread is running if we abort it, it gets stopped. But if a suspended thread is aborted then it gives an exception &#8220;Thread is suspended; attempting to abort&#8221;. The below [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=435&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><font face="Verdana,Arial,Helvetica,sans-serif" size="2">Hi,</p>
<p>I was working on a multithreading application and found an interesting thing on resuming a thread, so planned to share with you. </p>
<p>When a thread is running if we abort it, it gets stopped. But if a suspended thread is aborted then it gives an exception &#8220;Thread is suspended; attempting to abort&#8221;. </p>
<p>The below sample demonstrates it, first the thread is started, then suspended and then aborted. Run the application and check the error.</p>
<pre style="overflow:auto;width:95%;color:#000000;line-height:14px;border:#999999 1px dashed;font-size:15px;padding:5px;">

<font color="#0000FF" size="2">using</font><font size="2"> System;</font>
<font color="#0000FF" size="2">using</font><font size="2"> System.Threading;</font>

<font color="#0000FF" size="2">namespace</font><font size="2"> ConsoleApplication1
{</font>
<font color="#0000FF" size="2">class </font><font color="#2B91AF" size="2">Program&nbsp;&nbsp;&nbsp;&nbsp;</font>
<font size="2">{</font>
<font color="#0000FF" size="2">static <font color="#0000FF" size="2">void</font></font><font size="2"> Main(</font><font color="#0000FF" size="2">string</font><font size="2">[] args)
{</font>
<font color="#2B91AF" size="2">Thread</font><font size="2"> thread = </font><font color="#0000FF" size="2">new </font><font color="#2B91AF" size="2">Thread</font><font size="2">(</font><font color="#0000FF" size="2">new </font><font color="#2B91AF" size="2">ThreadStart</font><font size="2">(DoSomething));
thread.Start();</font>

<font color="#0000FF" size="2">for</font><font size="2"> (</font><font color="#0000FF" size="2">int</font><font size="2"> Index = 0; Index &lt; 10; Index++)
{</font>
<font color="#0000FF" size="2">switch</font><font size="2"> (Index)
{</font>
<font color="#0000FF" size="2">case</font><font size="2"> 4:
thread.Suspend();</font>
<font color="#2B91AF" size="2">Console</font><font size="2">.WriteLine(</font><font color="#A31515" size="2">"Thread suspended"</font><font size="2">);</font>
<font color="#0000FF" size="2">break</font><font size="2">;</font>

<font color="#0000FF" size="2">case</font><font size="2"> 6:
thread.Abort();</font>
<font color="#2B91AF" size="2">Console</font><font size="2">.WriteLine(</font><font color="#A31515" size="2">"Thread aborted"</font><font size="2">);</font>
<font color="#0000FF" size="2">break</font><font size="2">;

}</font>

<font color="#008000" size="2">//Main Thread is made to sleep&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
<font color="#2B91AF" size="2">Thread</font><font size="2">.Sleep(300);
}</font>

<font color="#2B91AF" size="2">Console</font><font size="2">.Read();
}</font>

<font color="#0000FF" size="2">private <font color="#0000FF" size="2">static <font color="#0000FF" size="2">void</font></font></font><font size="2"> DoSomething()
{</font>
<font color="#0000FF" size="2">while</font><font size="2"> (</font><font color="#0000FF" size="2">true</font><font size="2">)
{</font>
<font color="#2B91AF" size="2">Thread</font><font size="2">.Sleep(300);</font>
<font color="#2B91AF" size="2">Console</font><font size="2">.WriteLine(</font><font color="#A31515" size="2">"I am busy doing work"</font><font size="2">);
}
}
}
}</font>
</pre>
<p>To overcome this exception we can use Resume to invoke the suspended thread and then abort.<br />
Replace the case 6 with below code snippet.</p>
<pre style="overflow:auto;width:95%;color:#000000;line-height:14px;border:#999999 1px dashed;font-size:15px;padding:5px;">

<font color="#0000FF" size="2">case</font><font size="2"> 6:</font>
<font color="#0000FF" size="2">try&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</font>
<font size="2">{
thread.Abort();
}</font>
<font color="#0000FF" size="2">catch</font><font size="2"> (</font><font color="#2B91AF" size="2">ThreadStateException</font><font size="2">)
{
thread.Resume();
}</font>
<font color="#2B91AF" size="2">Console</font><font size="2">.WriteLine(</font><font color="#A31515" size="2">"Thread aborted"</font><font size="2">);</font>
<font color="#0000FF" size="2">break</font><font size="2">;</font>
</pre>
<p>now running the application aborts the thread as expected.<br />
From this sample we can learn that if we use resume on a suspended thread then it starts again, but if we have signalled for abort on that thread and try resume then it will stop the thread in proper manner.</p>
<p>Happy Learning<br />
Codingsense <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p></font></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/codingsense.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/codingsense.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/codingsense.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/codingsense.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/codingsense.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/codingsense.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/codingsense.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/codingsense.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/codingsense.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/codingsense.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/codingsense.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/codingsense.wordpress.com/435/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/codingsense.wordpress.com/435/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/codingsense.wordpress.com/435/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=codingsense.wordpress.com&amp;blog=4772007&amp;post=435&amp;subd=codingsense&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://codingsense.wordpress.com/2010/03/16/aborting-a-suspended-thread/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/d20441c41ac915f8275cf7a5904cb4ba?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">codingsense</media:title>
		</media:content>
	</item>
	</channel>
</rss>
