<?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/"
	>

<channel>
	<title>tewari &#187; code</title>
	<atom:link href="http://www.tewari.info/category/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tewari.info</link>
	<description>Professional Software Development by Ash Tewari</description>
	<lastBuildDate>Wed, 04 Jan 2012 03:03:39 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Solution to the fetch puzzle</title>
		<link>http://www.tewari.info/2012/01/03/solution-to-the-fetch-puzzle/</link>
		<comments>http://www.tewari.info/2012/01/03/solution-to-the-fetch-puzzle/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 03:00:38 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[github]]></category>
		<category><![CDATA[puzzle]]></category>
		<category><![CDATA[repo]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=330</guid>
		<description><![CDATA[	Here is a brute force solution to the fetch problem -
	Basically, at each step there are three possibilities :
	1. You can fill a bucket.
	2. You can transfer water from one bucket to the other one.
	3. You can dump out the water from a bucket.
	In this brute force solution, I try each one of these steps [...]]]></description>
			<content:encoded><![CDATA[	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Here is a brute force solution to the fetch problem -</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Basically, at each step there are three possibilities :</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">1. You can fill a bucket.</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">2. You can transfer water from one bucket to the other one.</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">3. You can dump out the water from a bucket.</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">In this brute force solution, I try each one of these steps and then try all three again after each one of the previous steps. And on</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">and on untill I get the required amount of water in one of the buckets.</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Check it out. Source code is on my github repo -</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">https://github.com/ashtewari/fetch</div>
	<p>Here is a brute force solution to the <a title="fetch-puzzle" href="http://www.tewari.info/2011/12/26/solve-puzzle-with-code/">fetch puzzle</a>. Basically, at each step there are three possibilities :</p>
	<ol>
	<li>You can fill a bucket.</li>
	<li>You can transfer water from one bucket to the other one.</li>
	<li>You can dump out the water from a bucket.</li>
	</ol>
	<p>In this brute force solution, I try each one of these steps and then try all three again after each one of the previous steps. And on and on until I get the required amount of water in one of the buckets.</p>
	<p>Check it out. Source code is on my github repo - <a title="github-repo-fetch" href="https://github.com/ashtewari/fetch">https://github.com/ashtewari/fetch</a><hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=330&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_330" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2012/01/03/solution-to-the-fetch-puzzle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Solve puzzle with code</title>
		<link>http://www.tewari.info/2011/12/26/solve-puzzle-with-code/</link>
		<comments>http://www.tewari.info/2011/12/26/solve-puzzle-with-code/#comments</comments>
		<pubDate>Tue, 27 Dec 2011 04:44:17 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[logic]]></category>
		<category><![CDATA[puzzle]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=322</guid>
		<description><![CDATA[	Here is a quite common programming interview puzzle &#8211; You have two buckets. A 3 gallon bucket and a 5 gallon bucket. Buckets are not marked or graduated. You are to fetch 4 gallon of water in a single trip to the river. How will you do it?
	Obviousy, this question is asked by changing the [...]]]></description>
			<content:encoded><![CDATA[	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Here is a quite common programming interview puzzle &#8211; You have two buckets. A 3 gallon bucket and a 5 gallon bucket. Buckets are not marked or graduated. You are to fetch 4 gallon of water in a single trip to the river. How will you do it?</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Obviousy, this question is asked by changing the capacities of the two buckets and the amount of water to be fetched.</div>
	<div id="_mcePaste" style="position: absolute; left: -10000px; top: 0px; width: 1px; height: 1px; overflow-x: hidden; overflow-y: hidden;">Your mission, should you choose to accept it, is to write a program to solve this puzzle in a generic way. Your program should take 3 inputs &#8211; capacities of the two buckets and the amount of water to be fetched. After solving the puzzle, your program must write out the solution step-by-step. You can use any programming language, any platform, any programming technique to write the program. Use whatever you like &#8211; C#, VB, C, C++, Java, Ruby, Python, F#, Boo, Javascript or any other language of your choice. Use design patterns, TDD, BDD, MVVM, Linq or whatever. Make it blazing fast, exploit multiple cores, use artificial intelligence. Go nuts! If you want to write the whole program in T-sql, powershell script or a batch script, go ahead. Heck ! you can even do it with regular expressions, if that your thing!</div>
	<div>Your mission, should you choose to accept it, is to write a program to solve this common programming interview puzzle in a generic way.</div>
	<div>The puzzle goes like this - You have two buckets. A 3 gallon bucket and a 5 gallon bucket. Buckets are not marked or graduated. You are to fetch 4 gallons of water in a single trip to the river. How will you do it?</div>
	<div><img class="alignnone size-medium wp-image-323" title="tommylees-flickr-buckets" src="http://www.tewari.info/wp-content/tommylees-flickr-buckets-300x225.jpg" alt="tommylees-flickr-buckets" width="600" height="450" /></div>
	<div><em>Photo Credit : http://www.flickr.com/photos/71256895@N00/3688461774/sizes/l/in/photostream/</em></div>
	<div><em><br />
</em></div>
	<div>Your program should take 3 inputs &#8211; capacities of the two buckets and the amount of water to be fetched. After solving the puzzle, your program must write out the solution step-by-step. You can use any language, any platform and any technique to write the program. Use whatever you like &#8211; C#, VB, C, C++, Java, Ruby, Python, F#, Boo, Javascript, powershell script or any other language of your choice. Use design patterns, TDD, BDD, MVVM, Linq or whatever. Make it blazing fast, exploit multiple cores, use artificial intelligence. Go nuts! If you want to write the whole program in T-sql, go ahead. Heck ! you can even do it with regular expressions, if that your thing!</div>
<hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=322&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_322" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2011/12/26/solve-puzzle-with-code/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>ChildWindow Positioning</title>
		<link>http://www.tewari.info/2011/06/07/childwindow-positioning/</link>
		<comments>http://www.tewari.info/2011/06/07/childwindow-positioning/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 11:23:52 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[silverlight ChildWindow ArrangeOverride]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=269</guid>
		<description><![CDATA[	Silverlight ChildWindow is centered over the parent control. I have extended ChildWindow to open it at a specific position.
	Here is a live demo : childwindow-positioning-demo
	And here is the code :
	public partial class ChildWindowEx : ChildWindow
{
	
    Point _pt = new Point(0,0);
	
    public ChildWindowEx()
    {
    [...]]]></description>
			<content:encoded><![CDATA[	<p>Silverlight <a title="MSDN_Silverlight_ChildWindow" href="http://msdn.microsoft.com/en-us/library/system.windows.controls.childwindow(v=vs.95).aspx" target="_self">ChildWindow</a> is centered over the parent control. I have extended ChildWindow to open it at a specific position.</p>
	<p><div class="wp-caption alignnone" style="width: 659px"><img title="Positioned ChildWindow" src="http://www.tewari.info/images/PositionedChildWindow-screenshot.png" alt="Positioned ChildWindow" width="649" height="391" /><p class="wp-caption-text">Positioned ChildWindow</p></div></p>
	<p>Here is a live demo : <a href="http://www.tewari.info/childwindow-positioning-demo/">childwindow-positioning-demo</a></p>
	<p>And here is the code :</p>
	<pre name="code" class="c-sharp">public partial class ChildWindowEx : ChildWindow
{
	
    Point _pt = new Point(0,0);
	
    public ChildWindowEx()
    {
        InitializeComponent();
    }
	
    public ChildWindowEx(Point pt) : this()
    {
        _pt = pt;
    }
	
    protected override Size ArrangeOverride(Size finalSize)
    {
        Grid grid = Utils.FindChild<Grid>(this, \"ContentRoot\");
	
        if (grid != null)
        {
            grid.Arrange(new Rect(_pt.X, _pt.Y, grid.DesiredSize.Width, grid.DesiredSize.Height));
            return finalSize;
        }
	
        return base.ArrangeOverride(finalSize);
    }
}</pre>
	<p>Visual Studio 2010 Solution : <a href="http://www.tewari.info/downloads/PositionedChildWindow.zip">download</a><hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=269&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_269" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2011/06/07/childwindow-positioning/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Started with MVVM</title>
		<link>http://www.tewari.info/2010/11/06/getting-started-with-mvvm/</link>
		<comments>http://www.tewari.info/2010/11/06/getting-started-with-mvvm/#comments</comments>
		<pubDate>Sat, 06 Nov 2010 16:29:24 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[CodeCamp]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=220</guid>
		<description><![CDATA[	I just finished presenting here at RDU Code Camp. It was a great crowd ! Here are the slides -
	Getting started with MVVM



View more presentations from ashtewari.

	Copyright &#169; 2012 tewari. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at [...]]]></description>
			<content:encoded><![CDATA[	<p>I just finished presenting here at <a href="http://codecamp.org/">RDU Code Camp</a>. It was a great crowd ! Here are the slides -</p>
	<div style="width:425px" id="__ss_5687145"><strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/ashtewari/getting-started-with-mvvm" title="Getting started with MVVM">Getting started with MVVM</a></strong><object id="__sse5687145" width="425" height="355"><br />
<param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gettingstartedwithmvvm-101106112559-phpapp01&#038;stripped_title=getting-started-with-mvvm&#038;userName=ashtewari" />
<param name="allowFullScreen" value="true"/>
<param name="allowScriptAccess" value="always"/><embed name="__sse5687145" src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=gettingstartedwithmvvm-101106112559-phpapp01&#038;stripped_title=getting-started-with-mvvm&#038;userName=ashtewari" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><br />
<div style="padding:5px 0 12px">View more <a href="http://www.slideshare.net/">presentations</a> from <a href="http://www.slideshare.net/ashtewari">ashtewari</a>.</div>
</div>
	<hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=220&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_220" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2010/11/06/getting-started-with-mvvm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Win Advanced MVVM Book</title>
		<link>http://www.tewari.info/2010/05/09/win-advanced-mvvm-book/</link>
		<comments>http://www.tewari.info/2010/05/09/win-advanced-mvvm-book/#comments</comments>
		<pubDate>Mon, 10 May 2010 03:33:06 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[CodeCamp]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[speaking]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=200</guid>
		<description><![CDATA[	I am presenting a session on Building WPF Application using MVVM (Model-View-ViewModel) on May 15th at the Carolina Code Camp 2010.
	I will dissect a Sample WPF MVVM application and then highlight the most important aspects of the MVVM by coding a brand new ViewModel and incorporating it into the application. You will learn about the [...]]]></description>
			<content:encoded><![CDATA[	<p><a href="../library/josh-smith/advanced-mvvm/"><img class="alignleft" title="Advanced MVVM Cover" src="http://www.tewari.info/wp-content/advancedmvvmcover.jpg" alt="Advanced MVVM Cover" width="246" height="320" /></a>I am presenting a session on Building WPF Application using MVVM (<a title="Wikipedia-MVVM" href="http://en.wikipedia.org/wiki/Model_View_ViewModel">Model-View-ViewModel</a>) on May 15th at the <a title="Carolina Code Camp 2010" href="http://codecamp.developersguild.org/">Carolina Code Camp</a> 2010.</p>
	<p>I will dissect a Sample WPF MVVM application and then highlight the most important aspects of the MVVM by coding a brand new ViewModel and incorporating it into the application. You will learn about the Roles of the MVVM triad, the advantages of using MVVM and Characteristics of the ViewModel.</p>
	<p>Attendees will be eligible to win <del datetime="2010-06-02T01:39:18+00:00">two copies</del> one copy (see below) of <a title="Josh Smith" href="http://joshsmithonwpf.wordpress.com/">Josh Smith&#8217;s</a> <a title="advanced-mvvm-book" href="http://joshsmithonwpf.wordpress.com/advanced-mvvm/">Advanced MVVM book</a> as well as a few other WPF Books.</p>
	<p><em>{ I will be giving away one hard copy version of the book instead of digital versions due to concerns about DRM protection and unclear gift guidelines at lulu.com }</em>.</p>
	<p>And the winner is &#8230; Mark Freeman !!! Congratulations Mark, your copy of &#8220;Advanced MVVM&#8221; is on its way. Thanks for attending the code camp and your feedback.<br />
<hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=200&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_200" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2010/05/09/win-advanced-mvvm-book/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using Model-View-ViewModel in WPF Applications</title>
		<link>http://www.tewari.info/2010/01/25/using-model-view-viewmodel-in-wpf-applications/</link>
		<comments>http://www.tewari.info/2010/01/25/using-model-view-viewmodel-in-wpf-applications/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 22:23:39 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[design pattern]]></category>
		<category><![CDATA[mvvm]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[socalcodecamp]]></category>

		<guid isPermaLink="false">http://www.tewari.info/?p=155</guid>
		<description><![CDATA[	I am presenting at SoCalCodeCamp this weekend (January 30th, 2010) - Advanced WPF &#8211; Using Model-View-ViewModel in WPF Applications.
	Agenda :
	1. Roles of the M-V-VM triad
	2. Why use M-V-VM ?
	3. Characteristics of the ViewModel
	4. Build a Sample WPF Application using M-V-VM
	
	Resources :
	
	MSDN Magazine Article and Sample Application Download
	Martin Fowler’s  description of the ‘Presentation Model ‘
	Jeremy [...]]]></description>
			<content:encoded><![CDATA[	<div class="mceTemp">I am presenting at <a title="socalcodecamp website" href="http://www.socalcodecamp.com/" target="_self">SoCalCodeCamp</a> this weekend (January 30th, 2010) -<a title="WPF MVVM Presntation " href="http://www.socalcodecamp.com/socalcodecamp/session.aspx?sid=0b2ee44f-595d-4f55-a5d6-2b1293f546d0" target="_self"> Advanced WPF &#8211; Using Model-View-ViewModel in WPF Applications</a>.</div>
	<p><div id="attachment_156" class="wp-caption alignnone" style="width: 460px"><img class="size-full wp-image-156" title="Sample WPF App - TaskList" src="http://www.tewari.info/wp-content/tasklist.png" alt="tasklist-mockup" width="450" height="256" /><p class="wp-caption-text">tasklist-mockup</p></div></p>
	<p>Agenda :</p>
	<div>1. Roles of the M-V-VM triad</div>
	<div>2. Why use M-V-VM ?</div>
	<div>3. Characteristics of the ViewModel</div>
	<div>4. Build a Sample WPF Application using M-V-VM</div>
	<p></br></br></p>
	<p>Resources :</p>
	<ol>
	<li><a title="MSDN Magazine Article" href="http://msdn.microsoft.com/en-us/magazine/dd419663.aspx">MSDN Magazine Article</a> and Sample Application <a title="Download Demo Application Code" href="http://code.msdn.microsoft.com/mag200902MVVM/Release/ProjectReleases.aspx">Download</a></li>
	<li><a title="MartinFowler.com" href="http://martinfowler.com/eaaDev/PresentationModel.html">Martin Fowler’s  description of the ‘Presentation Model ‘</a></li>
	<li><a title="Jeremy Miller's - Build Your CAB" href="http://codebetter.com/blogs/jeremy.miller/archive/2007/07/25/the-build-your-own-cab-series-table-of-contents.aspx">Jeremy Miller’s ‘Build Your Own CAB’ series</a></li>
	</ol>
<hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=155&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_155" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2010/01/25/using-model-view-viewmodel-in-wpf-applications/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ReSharper vs CodeRush + Refactor Pro</title>
		<link>http://www.tewari.info/2009/02/21/resharper-vs-coderush-refactor-pro/</link>
		<comments>http://www.tewari.info/2009/02/21/resharper-vs-coderush-refactor-pro/#comments</comments>
		<pubDate>Sat, 21 Feb 2009 17:43:03 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[tips]]></category>
		<category><![CDATA[coderush]]></category>
		<category><![CDATA[Comparison]]></category>
		<category><![CDATA[devexpress]]></category>
		<category><![CDATA[keyboard shortcuts]]></category>
		<category><![CDATA[refactoring]]></category>
		<category><![CDATA[resharper]]></category>
		<category><![CDATA[TDD]]></category>
		<category><![CDATA[tool]]></category>
		<category><![CDATA[visual studio]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2009/02/21/resharper-vs-coderush-refactor-pro/</guid>
		<description><![CDATA[	I have been playing with JetBrains ReSharper (version 4.1) and DevExpress CodeRush + Refactor! Pro (version 3.2.2) lately. I wanted to decide on which one to go with. Here are some notes -
	R# = ReSharper
CodeRush = CodeRush + Refactor! Pro
	
	R# seems to be better for      refactoring, because it does not assume [...]]]></description>
			<content:encoded><![CDATA[	<p class="MsoNormal" style="margin-bottom: 6pt">I have been playing with JetBrains <a href="http://www.jetbrains.com/resharper/">ReSharper </a>(version 4.1) and DevExpress <a href="http://devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/">CodeRush + Refactor! Pro</a> (version 3.2.2) lately. I wanted to decide on which one to go with. Here are some notes -</p>
	<p>R# = ReSharper<br />
CodeRush = CodeRush + Refactor! Pro</p>
	<ul type="disc">
	<li class="MsoNormal" style="margin-bottom: 6pt">R# seems to be better for      refactoring, because it does not assume that I follow a rigid work flow      when writing code. For example, I don&#8217;t always decide on the class      hierarchies upfront. I do discover them as I write code. So, when I      discover that I need to extract a base class from the class I am working      on, I can do so with R#. I couldn&#8217;t find a way to do extract a base/super class with CodeRush.</li>
	<li class="MsoNormal" style="margin-bottom: 6pt">In R#, I can create an      overloaded constructor using &#8220;Change Signature&#8221; refactoring      (Ctrl+R, S). I couldn&#8217;t find a way to do this in CodeRush. CodeRush does allow me to create overloaded methods.</li>
	</ul>
	<p class="MsoNormal" style="margin-bottom: 6pt; margin-left: 0.25in">However, comparisons that only focus on how many refactorings each tool can do are not very important to me. After all, it should be easy for the individual missing refactorings to be implemented in the subsequent releases of these tools. I want to know which one is a better investment in the long run. The investment is not just a couple of hundred dollars, it is going to be an investment of time too.</p>
	<ul type="disc">
	<li class="MsoNormal" style="margin-bottom: 6pt">R# &#8220;finds&#8221; Types as      you try to use them and adds references and &#8220;using&#8221; directives from      other projects in your solution. You will not believe how useful this is! You      don&#8217;t have to interrupt your train of thought to go add references and      &#8220;using&#8221; directives. CodeRush doesn&#8217;t do that.</li>
	<li class="MsoNormal" style="margin-bottom: 6pt">I found R# &#8220;<a href="http://www.jetbrains.com/resharper/features/code_generation.html#Create_from_Usage">Create      From Usage</a>&#8221; feature incredibly useful with <a title="TDD" href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank">TDD</a>. This feature will be available in <a title="Code Focused Development in VS 2010" href="http://blogs.msdn.com/somasegar/archive/2008/12/19/code-focused-development-in-vs-2010.aspx" target="_blank">Visual Studio 2010</a>.      They are calling it “Consume-First Development”.</li>
	<li class="MsoNormal" style="margin-bottom: 6pt">R# has keyboard shortcuts for      individual refactorings. All refactorings are accessible from ALT+ENTER or      ALT+R. Again, R# helps you keep focused on the code you are writing.       In CodeRush, individual refactorings don&#8217;t have keyboard shortcuts.</li>
	<li class="MsoNormal" style="margin-bottom: 6pt">R# allows me to specify      exactly what to include when doing ExtractXXX refactorings. CodeRush      doesn&#8217;t.</li>
	<li class="MsoNormal" style="margin-bottom: 6pt">R# seems to know what I want      to do. For example, when I discover that an existing class would be a good      starting point to write the class I am thinking about and copy-paste the      class and attempt to rename it, CodeRush renames both classes. R# renames      the one you intend to rename.</li>
	<li class="MsoNormal" style="margin-bottom: 6pt">R# introduces much less      friction when running unit tests. It is possible to add unit-testing      add-ins to Visual Studio and access similar functionality, but the way      unit-testing is integrated into R#, it is much more conducive to <a title="TDD" href="http://en.wikipedia.org/wiki/Test-driven_development" target="_blank">TDD</a>.</li>
	<li class="MsoNormal" style="margin-bottom: 6pt">Collapse a class region. Now      try to do a refactoring on this class, like “Rename file to match type”      etc. In CodeRush, you will not be able to do it because the three-dot      glyph will not be displayed when the class is collapsed.</li>
	<li class="MsoNormal" style="margin-bottom: 6pt">CodeRush keeps getting in my      way by automatically writing over as I type. It expands its “smart      templates” when you press space. Guess what! That is how I separate words      in my sentences &#8211; by pressing space. It gets quite annoying. I wish I      could turn it off.</li>
	</ul>
	<p class="MsoNormal" style="margin-bottom: 6pt">As you have probably guessed by now, I think ReSharper is a better fit for me.</p>
	<p class="MsoNormal" style="margin-bottom: 6pt">Here is a list of some other comparisons, covering aspects and features of these products I haven’t mentioned here that might be important to you. Some of these concluded in favor of CodeRush. Keep in mind that some of the following articles are a couple of years old.</p>
	<ul>
	<li><a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/05/05/resharper-4-0-vs-coderush-refactor-smack-down-results.aspx">Derik Whittaker</a> is keeping CodeRush but uninstalled Refactor Pro.</li>
	<li><a href="http://davidhayden.com/blog/dave/archive/2008/04/23/ReSharperCodeRushRefactorProInterestingDiscussion.aspx">David Hayden</a> is keeping an open mind.</li>
	<li><a href="http://www.hanselman.com/blog/ReSharperVsCodeRush.aspx">Scott Hanselman</a> likes CodeRush better.</li>
	<li><a href="http://ryangaraygay.com/blog/post/2008/04/Resharper-vs-CodeRush.aspx">Ryan Garagay</a> went with R#.</li>
	<li><a href="http://stackoverflow.com/questions/24216/resharper-vs-coderush">StackOverflow.com</a> has some useful comments and more links.</li>
	<li>There is some discussion on <a href="http://discuss.joelonsoftware.com/default.asp?joel.3.515309.7">JoelOnSoftware.com</a>.</li>
	<li>Ian decided to stick with <a href="http://ianolsen.com/2006/06/21/resharper-vs-coderush-part-1/">ReSharper</a>.</li>
	</ul>
<hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=44&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_44" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2009/02/21/resharper-vs-coderush-refactor-pro/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Using NHibernate With SQLite in DbUpdater</title>
		<link>http://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/</link>
		<comments>http://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/#comments</comments>
		<pubDate>Wed, 10 Sep 2008 04:46:39 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[code]]></category>
		<category><![CDATA[database]]></category>
		<category><![CDATA[opensource]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[DbUpdater]]></category>
		<category><![CDATA[sqlite NHibernate]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/</guid>
		<description><![CDATA[	DbUpdater (version 1.3 onwards) can be used with sqlite3.
	Review the files included in DbUpdater-sqlite3.zip
	1. DbUpdater.exe.config must be modified. Note changes to the following keys &#8211; exe-file, exe-args, dialect, driver_class, connetion_string.
2. SchemaVersion.hbm.xml must be modified. The &#8216;class&#8217; attributes value for the &#8216;generator&#8217; of &#8216;id&#8217; must be changed to &#8216;identity&#8217;. No other changes are needed here.
3. \SqlScripts\schema-version-table.sql [...]]]></description>
			<content:encoded><![CDATA[	<p><a href="http://www.tewari.info/dbupdater/">DbUpdater</a> (<a href="http://sourceforge.net/projects/dbupdater/">version 1.3</a> onwards) can be used with <a href="http://www.sqlite.org/">sqlite3</a>.</p>
	<p>Review the files included in<a href="http://www.tewari.info/downloads/DbUpdater-sqlite3.zip"> DbUpdater-sqlite3.zip</a></p>
	<p>1. DbUpdater.exe.config must be modified. Note changes to the following keys &#8211; exe-file, exe-args, dialect, driver_class, connetion_string.<br />
2. SchemaVersion.hbm.xml must be modified. The &#8216;class&#8217; attributes value for the &#8216;generator&#8217; of &#8216;id&#8217; must be changed to &#8216;identity&#8217;. No other changes are needed here.<br />
3. \SqlScripts\schema-version-table.sql is modified. Note that the datatypes of all columns are changed to TEXT, except for SchemaChangeId, which is changed to integer primary key. integer primary key is used for auto-incremented columns in sqlite.<br />
4. \SqlScripts\baseline.sql is modified. Note the use of current_timestamp function. The actual sql syntax in this file must conform to sqlite dialect.<br />
5. All other .sql scripts in \SqlScripts directory are also modified to conform to sqlite dialect.</p>
	<p>The following files are expected to be in DbUpdater.exe directory (as configured in the DbUpdater.exe.config file) -</p>
	<p>1. sqlite3.exe : <a href="http://www.sqlite.org/download.html">download</a>.<br />
2. System.Data.SQLite.dll : <a href="http://sqlite.phxsoftware.com/">download</a>.<br />
3. createdb.bat file : This file is included. This batch script will call sqlite3.exe to execute sql queries.</p>
	<p>Another very useful tool for working with sqlite database files is <a href="http://sqlitebrowser.sourceforge.net/">SQLite Database Browzer</a>.<a href="http://www.tewari.info/wp-content/sqlite-support.html" title="sqlite-support.html"> </a><hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=41&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_41" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2008/09/09/using-nhibernate-with-sqlite-in-dbupdater/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Dial Gauge is a ProgressBar</title>
		<link>http://www.tewari.info/2008/06/10/dial-gauge-is-a-progressbar/</link>
		<comments>http://www.tewari.info/2008/06/10/dial-gauge-is-a-progressbar/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 06:49:43 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[WPF]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[xaml]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Dial]]></category>
		<category><![CDATA[Gauge]]></category>
		<category><![CDATA[ProgressBar]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2008/06/10/dial-gauge-is-a-progressbar/</guid>
		<description><![CDATA[	I am not just being philosophical here. In WPF, ControlTemplates allow you to transform a control&#8217;s appearance. This is not the same as applying stylesheets. This is an entirely new level of customization. What you see in the screenshot below looks like a Dial but is actually a simple  ProgressBar control wearing a &#8220;Dial&#8221; [...]]]></description>
			<content:encoded><![CDATA[	<p>I am not just being philosophical here. In <a href="http://msdn.microsoft.com/en-us/netframework/aa663326.aspx" title="MSDN-WPF" target="_blank">WPF</a>, <a href="http://msdn.microsoft.com/en-us/magazine/cc163497.aspx" title="Using Templates to Customize WPF Controls" target="_blank">ControlTemplates </a>allow you to transform a control&#8217;s appearance. This is not the same as applying stylesheets. This is an entirely new level of customization. What you see in the screenshot below looks like a Dial but is actually a simple  ProgressBar control wearing a &#8220;Dial&#8221; template. The Dial template was created using <a href="http://www.microsoft.com/expression/products/Overview.aspx?key=blend" title="Microsoft-Expression-Blend" target="_blank">Microsoft Expression Blend</a> .</p>
	<p><img src="http://www.tewari.info/images/dial-is-a-progressbar.PNG" alt="dial-is-a-progressbar.PNG" height="483" width="566" /></p>
	<p>Include the ControlTemplate as a Window.Resource and then assign it to ProgressBar element&#8217;s Template attribute :</p>
	<pre name="code" class="xml">
        <ProgressBar x:Name=\"pBar\" Template=\"{StaticResource templateDial}\"
                     Minimum=\"0\" Maximum=\"270\" Margin=\"0\" />
</pre>
	<p>Of course that is not all. The ControlTemplate must define some named elements of  FrameworkElement type. Charles Petzold has explained it in detail : <a href="http://msdn.microsoft.com/en-us/magazine/cc163497.aspx" title="Charles-Petzold-Using Templates to Customize WPF Controls" target="_blank">MSDN Magazine Article</a>. So, I will not repeat it here.</p>
	<p>The sample code can be downloaded here : <a href="http://www.tewari.info/downloads/DialTest.zip" title="DialTest.zip" target="_blank">DialTest.zip</a><br />
License : <a href="http://creativecommons.org/licenses/by-nc-sa/3.0/us/" rel="license">Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.</a><hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=38&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_38" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2008/06/10/dial-gauge-is-a-progressbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PostSharp with SharpDevelop</title>
		<link>http://www.tewari.info/2008/04/28/postsharp-with-sharpdevelop/</link>
		<comments>http://www.tewari.info/2008/04/28/postsharp-with-sharpdevelop/#comments</comments>
		<pubDate>Tue, 29 Apr 2008 05:04:43 +0000</pubDate>
		<dc:creator>tewari</dc:creator>
				<category><![CDATA[AOP]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Aspect]]></category>
		<category><![CDATA[MSBuild]]></category>
		<category><![CDATA[PostSharp]]></category>
		<category><![CDATA[SharpDevelop]]></category>

		<guid isPermaLink="false">http://www.tewari.info/2008/04/28/postsharp-with-sharpdevelop/</guid>
		<description><![CDATA[	SharpDevelop3.0 uses MSBuild. Including PostSharp in your build process is transparent if you are doing a global install using PostSharp installer. If you are doing a per-project installation using &#8220;Binary &#8211; No Installer&#8221; download, you will need to import the PostSharp targets into your .csproj file -
	
	
    True

	C:\code\PostSharp-1.0.8.316-Binary\


	For more details, read the [...]]]></description>
			<content:encoded><![CDATA[	<p><a href="http://sharpdevelop.net/OpenSource/SD/Default.aspx" title="SharpDevelop HomePage" target="_blank">SharpDevelop3.0</a> uses <a href="http://en.wikipedia.org/wiki/MSBuild" title="MSBuild on wikipedia" target="_blank">MSBuild</a>. Including PostSharp in your build process is transparent if you are doing a global install using PostSharp installer. If you are doing a per-project installation using &#8220;Binary &#8211; No Installer&#8221; <a href="http://www.postsharp.org/download/" title="postsharp download" target="_blank">download</a>, you will need to import the PostSharp targets into your .csproj file -</p>
	<pre name="code" class="xml">
	<propertygroup>
    <dontimportpostsharp>True</dontimportpostsharp>
</propertygroup>
	<postsharpdirectory>C:\code\PostSharp-1.0.8.316-Binary\</postsharpdirectory>
<import project=\"$(MSBuildBinPath)\Microsoft.CSharp.targets\"></import>
<import project=\"$(PostSharpDirectory)PostSharp.targets\"></import></pre>
	<p>For more details, read the install instructions included in the PostSharp <a href="http://www.postsharp.org/download/" title="postsharp download" target="_blank">download </a>and <a href="http://www.postsharp.org/blog/2008/01/under-hood-of-msbuild-integration.html" title="under-hood-of-msbuild-integration" target="_blank">under-the-hood-of-msbuild-integration</a>.</p>
	<p>To use local PostSharp binaries (relative to your project) , modify your .csproj file as follows -</p>
	<pre name="code" class="xml">
  <PropertyGroup Condition=\" Exists('PostSharp\PostSharp.targets') \">
    <DontImportPostSharp>True</DontImportPostSharp>
    <PostSharpDirectory>$(MSBuildProjectDirectory)\PostSharp\</PostSharpDirectory>
  </PropertyGroup>
	
  <Import Project=\"$(MSBuildBinPath)\Microsoft.CSharp.targets\" />
	
  <Import Project=\"$(PostSharpDirectory)PostSharp.targets\"
  Condition=\" Exists('$(PostSharpDirectory)PostSharp.targets') \" />
</pre>
	<p>$(MSBuildProjectDirectory) is the directory containing your .csproj file.<br />
\PostSharp\ is the directory containing local PostSharp binaries.</p>
	<p>2. You will need to exclude the Aspect class itself from being woven.</p>
	<p>If you are following the <a href="http://www.postsharp.org/about/getting-started/" title="getting-started-sample" target="_blank">getting-started sample</a>, see the following example:</p>
	<pre name="code" class="csharp">
[Serializable]
[Trace( null, AttributeExclude = true )]
public sealed class TraceAttribute : OnMethodBoundaryAspect
{</pre>
	<p>3. Compile your project.<hr/>Copyright &copy; 2012 <strong><a href="http://www.tewari.info">tewari</a></strong>. This Feed is for personal non-commercial use only. If you are not reading this material in your news aggregator, the site you are looking at is guilty of copyright infringement. Please contact legal@tewari.info so we can take legal action immediately.<br/><span style="float: right;font-size: 7pt"><a href="http://blog.taragana.com/index.php/archive/wordpress-plugins-provided-by-taraganacom/">Plugin</a> by <a href="http://www.taragana.com/">Taragana</a></span>
</p>
<p class="akst_link"><a href="http://www.tewari.info/?p=35&amp;akst_action=share-this"  title="E-mail this, post to del.icio.us, etc." id="akst_link_35" class="akst_share_link" rel="nofollow">Share This</a>
</p>]]></content:encoded>
			<wfw:commentRss>http://www.tewari.info/2008/04/28/postsharp-with-sharpdevelop/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

