<?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>Jowen Mei&#039;s Blog</title>
	<atom:link href="http://www.jowenmei.com/?feed=rss2" rel="self" type="application/rss+xml" />
	<link>http://www.jowenmei.com</link>
	<description>Note to self archive of a .Net programmer</description>
	<lastBuildDate>Wed, 01 Sep 2010 09:22:14 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>ConnectionString in Linq-to-Sql</title>
		<link>http://www.jowenmei.com/?p=605</link>
		<comments>http://www.jowenmei.com/?p=605#comments</comments>
		<pubDate>Mon, 30 Aug 2010 13:38:23 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[Linq]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=605</guid>
		<description><![CDATA[I noticed that the dbml file stores the connection string in a Settings file, stored in the same project. I use multiple projects to separate the entities from the ui, so this is unwanted behavior. I want it to read the connection string from the app.config. This can be easily achieved: Go to the Connection [...]]]></description>
			<content:encoded><![CDATA[<p>I noticed that the dbml file stores the connection string in a Settings file, stored in the same project.<br />
I use multiple projects to separate the entities from the ui, so this is unwanted behavior. I want it to read the connection string from the app.config.</p>
<p>This can be easily achieved:</p>
<ul>
<li>Go to the Connection properties of your dataContext</li>
<li>Set the <em>Connection</em> string to <strong>None</strong></li>
<li>Set <em>Application Setting</em> to <strong>False</strong></li>
</ul>
<p>This will prevent the generator to create a default constructor. This makes it possible to add your own, which will read the connection string from the config file.</p>
<pre class="brush: csharp; wrap-lines: false">
public YourDataContext()
   : base(ConfigurationManager.ConnectionStrings["connString"].ConnectionString, mappingSource)
{
}
</pre>
<p>Thanks go to <a href="http://ddkonline.blogspot.com/2008/02/set-connection-string-in-linq-dbml-file.html">David Klein</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=605</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>VS2010 Productivity Power Tools</title>
		<link>http://www.jowenmei.com/?p=602</link>
		<comments>http://www.jowenmei.com/?p=602#comments</comments>
		<pubDate>Tue, 24 Aug 2010 10:48:24 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[Tools]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=602</guid>
		<description><![CDATA[When you&#8217;re working with Visual Studio 2010, these tools are a must have! The name says it all, but I must emphasize there really is a lot of added value. I already work with CodeRush and Refactor Pro, so usually I&#8217;m not interested in all those new pluggins/tools. This free tool from Microsoft has some [...]]]></description>
			<content:encoded><![CDATA[<p>When you&#8217;re working with Visual Studio 2010, <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/d0d33361-18e2-46c0-8ff2-4adea1e34fef">these tools</a> are a must have!</p>
<p>The name says it all, but I must emphasize there really is a lot of added value. I already work with <a href="http://devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/">CodeRush and Refactor Pro</a>, so usually I&#8217;m not interested in all those new pluggins/tools.</p>
<p>This free tool from Microsoft has some cool new features, of which my favorites are:<br />
- Solution Navigator (nice!)<br />
- decent tab management<br />
- CTRL + Click to go to definition</p>
<p>Check them out!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=602</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Get the windows uptime</title>
		<link>http://www.jowenmei.com/?p=599</link>
		<comments>http://www.jowenmei.com/?p=599#comments</comments>
		<pubDate>Sat, 21 Aug 2010 09:31:25 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[Windows]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=599</guid>
		<description><![CDATA[A true note-to-self: How to get the windows uptime in short: execute the command net stats srv]]></description>
			<content:encoded><![CDATA[<p>A true note-to-self:</p>
<p>How to get the <a href="http://support.microsoft.com/kb/555737">windows uptime</a></p>
<p>in short: execute the command <strong>net stats srv</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=599</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Looping (and modifying) a collection</title>
		<link>http://www.jowenmei.com/?p=588</link>
		<comments>http://www.jowenmei.com/?p=588#comments</comments>
		<pubDate>Tue, 17 Aug 2010 13:00:26 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[.Net General]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=588</guid>
		<description><![CDATA[Ok, back to basics with this one. I have a collection of strings: List&#60;string&#62; someStrings = new List&#60;string&#62;() { "aaaaaaa", "bbb", "ccc", "dddddddd" }; And I want to remove the shorter items (with length &#60; 4), so there should remain two items left. My first (and amateuristic) attempt was this: foreach (string s in someStrings) [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, back to basics with this one.</p>
<p>I have a collection of strings:</p>
<pre class="brush: csharp; wrap-lines: true">List&lt;string&gt; someStrings = new List&lt;string&gt;() { "aaaaaaa", "bbb", "ccc", "dddddddd" };</pre>
<p>And I want to remove the shorter items (with length &lt; 4), so there should remain two items left.</p>
<p>My first (and amateuristic) attempt was this:</p>
<pre class="brush: csharp; wrap-lines: false">foreach (string s in someStrings)
{
   if (s.Length &lt; 4)
      someStrings.Remove(s);
}</pre>
<p>I always use the foreach loop, but it can&#8217;t be used when modifying the collection. (You CAN modify properties of the items in the loop, but not the item reference itself!).<br />
When you do try, you&#8217;ll get the &#8220;<em>InvalidOperationException: Collection was modified; enumeration operation may not execute.</em>&#8221;</p>
<p>Somewhere in my gray mass, I reminded to use the for-loop. My second (and dangerous) attempt was this:</p>
<pre class="brush: csharp; wrap-lines: false">for (int i = 0; i &lt; someStrings.Count; i++)
{
   if (someStrings[i].Length &lt; 4)
      someStrings.RemoveAt(i);
}</pre>
<p>No exceptions were thrown, but the outcome is not what you&#8217;d expect!! Due to the fact that <strong>someStrings.Count</strong> and <strong>i</strong> are out of sync, the item &#8220;<em>ccc</em>&#8221; is skipped.</p>
<p>So, here&#8217;s the correct code:</p>
<pre class="brush: csharp; wrap-lines: true">for (int i = someStrings.Count - 1; i &gt;= 0; i--)
{
    if(someStrings[i].Length &lt; 4)
        someStrings.RemoveAt(i);
}</pre>
<p>Conclusion: use the for-loop and iterate backwards! :p</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=588</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linq to Sql Profiler</title>
		<link>http://www.jowenmei.com/?p=581</link>
		<comments>http://www.jowenmei.com/?p=581#comments</comments>
		<pubDate>Wed, 04 Aug 2010 11:24:40 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[Linq]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=581</guid>
		<description><![CDATA[I just wanted to give a shot out to the Linq to Sql Profiler. It&#8217;s a simple but invaluable tool to watch what happens behind the scenes with linq to sql. It&#8217;s a realtime visual debugger, and gives immediate feedback about the sql statements and their performance. In linq to sql, you must always profile [...]]]></description>
			<content:encoded><![CDATA[<p>I just wanted to give a shot out to the <a href="http://l2sprof.com/">Linq to Sql Profiler</a>.</p>
<p>It&#8217;s a simple but invaluable tool to watch what happens behind the scenes with linq to sql.<br />
It&#8217;s a realtime visual debugger, and gives immediate feedback about the sql statements and their performance.</p>
<p>In linq to sql, you must always profile your stuff, and check what the consequences are of your code modifications.<br />
For instance, using compiled queries everywhere doesn&#8217;t always increase performance. </p>
<p>Check it out!</p>
<p>Note: if you&#8217;re using the MS Sql Profiler, turn on these two events:<br />
T-SQL: Sql-StmtCompleted<br />
Stored Procedures: RPC:Completed</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=581</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Generic and fast Detach() in Linq-to-Sql</title>
		<link>http://www.jowenmei.com/?p=555</link>
		<comments>http://www.jowenmei.com/?p=555#comments</comments>
		<pubDate>Thu, 29 Jul 2010 15:49:21 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[Linq]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=555</guid>
		<description><![CDATA[For the first time I&#8217;m experimenting with Linq-to-Sql (L2S). Microsoft targets L2S for the simpler scenario&#8217;s/architectures (if that scares you, just let me say that stackoverflow.com is running on L2S!). Because of this, a Detach() method is not supported. For these kind of scenario&#8217;s, Microsoft wants developers to use the Entity Framework. One could argue [...]]]></description>
			<content:encoded><![CDATA[<p>For the first time I&#8217;m experimenting with Linq-to-Sql (L2S).<br />
Microsoft targets L2S for the simpler scenario&#8217;s/architectures (if that scares you, just let me say that stackoverflow.com is running on L2S!).<br />
Because of this, a Detach() method is not supported. For these kind of scenario&#8217;s, Microsoft wants developers to use the Entity Framework.</p>
<p>One could argue if you should even use Detach() in the first place.<br />
<a href="http://www.west-wind.com/weblog/posts/162336.aspx">Here&#8217;s</a> a nice discussion between Rick Strahl and <a href="http://codebetter.com/blogs/ian_cooper/archive/tags/LINQ/default.aspx">Ian Cooper</a>, where the latter suggests you should be sending messages across boundaries, not objects.<br />
<a href="http://geekswithblogs.net/michelotti/archive/2007/12/27/118022.aspx">Steve Michelotti</a> suggests to exclude reference data from your context.<br />
I agree with the fact that you should be aware of what is contained in the dataContext. It&#8217;s not a garbage can, keep it small. The datacontext represents a unit of work.<br />
However, I think this is not a complete solution. It&#8217;s not transparant, and doesn&#8217;t work every time.</p>
<p>In my search for a generic Detach() method, I came across <a href="http://www.jstawski.com/archive/2008/07/09/linq-to-sql-generic-detach.aspx">this post</a> of Jonas Stawski. It&#8217;s a generic solution with excellent performance. </p>
<p>You only have to add this base class method:</p>
<pre class="brush: csharp; wrap-lines: false">
public void Detach()
{
   GetType().GetMethod("Initialize", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(this, null);
}
</pre>
<p>The method uses reflection to call the Initialize() method, which will reset all the assocation properties. It can now be added to another dataContext, which will not try to save the assocation properties.</p>
<p>Jonas comes with a huge warning that the OnCreated() method is called after Initialize(), which could lead to unwanted behavior. I fixed this problem modifying the T4 template from which the entities are generated.</p>
<p>Normally, the Initialize() method is only included if you have turned on serialization. (By setting the <a href="http://msdn.microsoft.com/en-us/library/bb546184.aspx#footerLink">Serialization Mode</a> to Unidirectional). I modified the template so that it always generates these Initialize() methods. </p>
<pre class="brush: csharp; wrap-lines: false">
#region Construction
public <#=class1.Name#>()
{
	Initialize();

<# if (class1.HasPrimaryKey) {#>
	OnCreated();
<# } #>
}

private void Initialize()
{
<# 		  foreach(Association association in class1.Associations) { #>
	<#=association.Storage#> = <#
	if (association.IsMany) {
		#>new EntitySet<<#=association.Type.Name#>>(attach_<#=association.Member#>, detach_<#=association.Member#>);
<#			} else {
		#>default(EntityRef<<#=association.Type.Name#>>);
<#			}
}
#>
}
#endregion
</pre>
<p>And I moved the call to OnCreated() to the constructor. Now, the code behaves exactly the same, and I&#8217;m able to call Detach() without any side effects! Nice&#8230;.</p>
<p>Btw, here&#8217;s a <a href="http://visualstudiogallery.msdn.microsoft.com/en-us/60297607-5fd4-4da4-97e1-3715e90c1a23">free T4 editor</a> if you need one.</p>
<p>I&#8217;ve seen other solutions that involved copying the entity properties using <a href="http://www.codeproject.com/KB/linq/linq_base_class.aspx">reflection</a> or using <a href="http://www.eggheadcafe.com/tutorials/aspnet/ad947ce6-cd3e-4647-b69c-94d2f3b1b265/datacontractserializer-ba.aspx">serialization</a>.<br />
They&#8217;re simply a lot slower. In my test, they both took around 60 ms. This Detach() method takes 0 ms! :p</p>
<p>Download my custom <a href='http://www.jowenmei.com/wp-content/uploads/2010/07/Model.txt'>T4 template</a>, which is based on this <a href="http://l2st4.codeplex.com/">Codeplex project</a>. You have to rename the file to Model.tt.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=555</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Intellisense broken in Visual Studio 2010</title>
		<link>http://www.jowenmei.com/?p=552</link>
		<comments>http://www.jowenmei.com/?p=552#comments</comments>
		<pubDate>Mon, 19 Jul 2010 09:05:17 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=552</guid>
		<description><![CDATA[I recently installed a new laptop with all the dev software. Most importantly, Visual Studio 2010 and the DevExpress productivity tools. At some point, intellisense was working strange. I didn&#8217;t give it much attention at the time. But after a while it really started to annoy me. At first, I thought it was some kind [...]]]></description>
			<content:encoded><![CDATA[<p>I recently installed a new laptop with all the dev software. Most importantly, Visual Studio 2010 and the <a href="http://devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/">DevExpress productivity tools</a>.</p>
<p>At some point, intellisense was working strange. I didn&#8217;t give it much attention at the time. But after a while it really started to annoy me.<br />
At first, I thought it was some kind of new feature of CodeRush. But it turns out to Visual Studio 2010 has different modes for intellisense. </p>
<p>The new Suggestion mode has lower impact. This mode was added to make intelliSense completion less aggressive in certain cases, most notably test-driven development scenarios. While in this mode, intelliSense will still show a completion list but will also show what you&#8217;re typing in a box at the top of the completion list.  It will not auto-complete unless you explicitly select an entry in the list.  </p>
<p>And you toggle between these modes with Ctrl + Alt + Space.  Ah! &#8230;&#8230;</p>
<p><a href="http://blog-mstechnology.blogspot.com/2009/11/new-features-in-vs-2010-intellisense.html">See it in action</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=552</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Timestamp and Rowversion columns</title>
		<link>http://www.jowenmei.com/?p=545</link>
		<comments>http://www.jowenmei.com/?p=545#comments</comments>
		<pubDate>Sat, 03 Jul 2010 21:35:45 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[Linq]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=545</guid>
		<description><![CDATA[To check concurrency violations, it&#8217;s common to have a Timestamp column. This column represents some kind of version of that row, and has nothing to do with the actual time. In fact, the information is stored as binary(8) when non-nullable, and varbinary(8) when nullable. Anyway, the value in this column is being used to check [...]]]></description>
			<content:encoded><![CDATA[<p>To check concurrency violations, it&#8217;s common to have a <a href="http://msdn.microsoft.com/en-us/library/aa260631(SQL.80).aspx">Timestamp</a> column. This column represents some kind of version of that row, and has nothing to do with the actual time. In fact, the information is stored as binary(8) when non-nullable, and varbinary(8) when nullable.</p>
<p>Anyway, the value in this column is being used to check if the row has been changed after it has been fetched.<br />
However, the timestamp column is deprecated and we should use the <a href="http://msdn.microsoft.com/en-us/library/ms182776.aspx">rowversion</a> column whenever possible.</p>
<p>The thing that really confused me was that this type is not available in the designer. So when you add a column with the version type, you must do it in script like this:</p>
<pre class="brush: csharp; wrap-lines: true">
CREATE TABLE Test (Id int PRIMARY KEY, Version rowversion);
</pre>
<p>I really don&#8217;t understand why it&#8217;s not there, but its pretty annoying. I created a script, and added the rowversion column. But after running the script, I had to manually add the FK&#8217;s again. Grrr&#8230;</p>
<p>I found this stuff after searching for performance optimizations for Linq to Sql.<br />
Normally, a query would check for concurrency violations using all the columns. With the rowversion column in place, only a single column is checked, which is a lot faster.</p>
<p>When you&#8217;ve added the rowversion column, and update the dbml, the following output has been generated automatically:<a href="http://www.jowenmei.com/wp-content/uploads/2010/07/rowversion_output.jpg"><img src="http://www.jowenmei.com/wp-content/uploads/2010/07/rowversion_output-270x300.jpg" alt="" title="rowversion_output" width="270" height="300" class="alignnone size-medium wp-image-546" /></a></p>
<p>So you don&#8217;t have to worry setting these properties manually.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=545</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Linebreak in a tooltip in xaml</title>
		<link>http://www.jowenmei.com/?p=535</link>
		<comments>http://www.jowenmei.com/?p=535#comments</comments>
		<pubDate>Tue, 15 Jun 2010 08:11:47 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[WPF]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=535</guid>
		<description><![CDATA[Here&#8217;s a quick tip how to show linebreaks in a tooltip in xaml. I wanted to show properties on multiple lines (in a multibinding): ' This results in the following tooltip (where the mouse hovers on the text &#8220;FTP&#8221;):]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick tip how to show linebreaks in a tooltip in xaml.</p>
<p>I wanted to show properties on multiple lines (in a multibinding):</p>
<pre class="brush: csharp; wrap-lines: false">'
<Label Content="{Binding Name}">
    <Label.ToolTip>
        <TextBlock>
            <TextBlock.Text>
                <MultiBinding StringFormat="{}Code: {0}&amp;#x0a;IP: {1}">
                    <Binding Path="Code" />
                    <Binding Path="IP" />
                </MultiBinding>
            </TextBlock.Text>
        </TextBlock>
    </Label.ToolTip>
</Label>
</pre>
<p>This results in the following tooltip (where the mouse hovers on the text &#8220;FTP&#8221;):<br />
<a href="http://www.jowenmei.com/wp-content/uploads/2010/06/screen.jpg"><img src="http://www.jowenmei.com/wp-content/uploads/2010/06/screen.jpg" alt="" title="tooltip" width="207" height="81" class="alignnone size-full wp-image-538" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=535</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DateTime comparisons in .Net</title>
		<link>http://www.jowenmei.com/?p=530</link>
		<comments>http://www.jowenmei.com/?p=530#comments</comments>
		<pubDate>Thu, 10 Jun 2010 12:45:12 +0000</pubDate>
		<dc:creator>Jowen</dc:creator>
				<category><![CDATA[.Net General]]></category>

		<guid isPermaLink="false">http://www.jowenmei.com/?p=530</guid>
		<description><![CDATA[Ok, in software it&#8217;s possible to bend time, like in the Matrix. This sounds pretty cool, but it&#8217;s only very frustrating! Here&#8217;s a simple scenario. I have a timer that elapses every second, and I want to check if it is equal to a specified DateTime variable (which has an accuracy of seconds). The first [...]]]></description>
			<content:encoded><![CDATA[<p>Ok, in software it&#8217;s possible to bend time, like in the Matrix.<br />
This sounds pretty cool, but it&#8217;s only very frustrating!</p>
<p>Here&#8217;s a simple scenario. I have a timer that elapses every second, and I want to check if it is equal to a specified DateTime variable (which has an accuracy of seconds).</p>
<p>The first thing that probably pops in your mind is this:</p>
<pre class="brush: csharp; wrap-lines: false">
if(DateTime.Now == specifiedDate)
</pre>
<p>But the chances of that working are very slim. Under the hood, a comparison is made where the milliseconds are taken into account.</p>
<p>No biggie. I just create an extension method that trims the milliseconds (and preserves the Kind property)</p>
<pre class="brush: csharp; wrap-lines: false">
public static DateTime TrimMilliSeconds(this DateTime dateTime)
{
    return new DateTime(dateTime.Ticks - (dateTime.Ticks % TimeSpan.TicksPerSecond), dateTime.Kind);
}
</pre>
<p>So now I have this comparison, which will leave out the milliseconds:</p>
<pre class="brush: csharp; wrap-lines: false">
if(DateTime.Now.TrimMilliSeconds() == specifiedDate)
</pre>
<p>This will work most of the time. Not always? &#8230;&#8230; no not always.</p>
<p>The reason is that the timer doesn&#8217;t elapse <strong>precisely</strong> every second. It might take 1005 milliseconds to the next interval.<br />
So in a worst case scenario you can have a check at 11:59:59.999, while the next interval will occur at 12:00:01:001. The 12:00:00 is &#8220;skipped&#8221;! </p>
<p>Now I check the difference, and allow a small margin of 100 milliseconds. </p>
<pre class="brush: csharp; wrap-lines: false">
TimeSpan precision = TimeSpan.FromMilliSeconds(1100);
bool areEqual = (x-y).Duration() < precision;
</pre>
<p>I hope I saved you some headaches over this.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.jowenmei.com/?feed=rss2&amp;p=530</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>
