<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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: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>Comments for Dot Net Thoughts</title>
	<atom:link href="http://dotnetthoughts.wordpress.com/comments/feed/" rel="self" type="application/rss+xml" />
	<link>http://dotnetthoughts.wordpress.com</link>
	<description>Random thoughts and observations from Mike Weier</description>
	<lastBuildDate>Thu, 26 Nov 2009 16:55:34 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>Comment on The Linq Jukebox &#8211; Part 2 (LINQ Joins) by deakejext</title>
		<link>http://dotnetthoughts.wordpress.com/2007/12/14/the-linq-jukebox-part-2-linq-joins/#comment-152</link>
		<dc:creator>deakejext</dc:creator>
		<pubDate>Thu, 26 Nov 2009 16:55:34 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2007/12/14/the-linq-jukebox-part-2-linq-joins/#comment-152</guid>
		<description>Authentic words, some authentic words man. Made my day.</description>
		<content:encoded><![CDATA[<p>Authentic words, some authentic words man. Made my day.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Error Handling &#8211; Best Practices by sahithi</title>
		<link>http://dotnetthoughts.wordpress.com/2007/09/22/error-handling-best-practices/#comment-151</link>
		<dc:creator>sahithi</dc:creator>
		<pubDate>Thu, 12 Nov 2009 16:18:29 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2007/09/22/error-handling-best-practices/#comment-151</guid>
		<description>this._Slno=Slno;
        this._MSl3no=MSl3no;
        this._PartCode=PartCode;
        this._PartDescription=PartDesc;
        this.__Qty=Qty;
         this._UOM=UOM;
}

     
  public int Slno
        {
            get { return _Slno; }
            set { this._Slno = value; }
        }

        public int MSl3no
        {
            get { return _MSl3no; }
         set { this._MSl3no = value; }
}

public string PartCode
{
    get{return _PartCode;}
    set{thiss._PartCode=value;}
}


public string PartDesc
{
    get{return _PartDescription;}
    set{thiss._PartDescription=value;}
}

public float Qty
{
    get{return __Qty;}
    set{thiss.__Qty=value;}
}

public UOM Uom
{
    get{return _UOM;}
    set{thiss._UOM=value;}
}
}what error in this?</description>
		<content:encoded><![CDATA[<p>this._Slno=Slno;<br />
        this._MSl3no=MSl3no;<br />
        this._PartCode=PartCode;<br />
        this._PartDescription=PartDesc;<br />
        this.__Qty=Qty;<br />
         this._UOM=UOM;<br />
}</p>
<p>  public int Slno<br />
        {<br />
            get { return _Slno; }<br />
            set { this._Slno = value; }<br />
        }</p>
<p>        public int MSl3no<br />
        {<br />
            get { return _MSl3no; }<br />
         set { this._MSl3no = value; }<br />
}</p>
<p>public string PartCode<br />
{<br />
    get{return _PartCode;}<br />
    set{thiss._PartCode=value;}<br />
}</p>
<p>public string PartDesc<br />
{<br />
    get{return _PartDescription;}<br />
    set{thiss._PartDescription=value;}<br />
}</p>
<p>public float Qty<br />
{<br />
    get{return __Qty;}<br />
    set{thiss.__Qty=value;}<br />
}</p>
<p>public UOM Uom<br />
{<br />
    get{return _UOM;}<br />
    set{thiss._UOM=value;}<br />
}<br />
}what error in this?</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Error Handling &#8211; Best Practices by Java s*cks! (but you already knew that) &#171; mmlacak</title>
		<link>http://dotnetthoughts.wordpress.com/2007/09/22/error-handling-best-practices/#comment-150</link>
		<dc:creator>Java s*cks! (but you already knew that) &#171; mmlacak</dc:creator>
		<pubDate>Sun, 01 Mar 2009 12:03:54 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2007/09/22/error-handling-best-practices/#comment-150</guid>
		<description>[...] in a Java itself, increasing burden on VM already strangled to death. As you already know, exceptions are costly, very costly, regardless of a programming language, platform or anything else, and best avoided, if [...]</description>
		<content:encoded><![CDATA[<p>[...] in a Java itself, increasing burden on VM already strangled to death. As you already know, exceptions are costly, very costly, regardless of a programming language, platform or anything else, and best avoided, if [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Persisting the Doubly Linked List by Never modifying data: Are pointers a good solution? - dBforums</title>
		<link>http://dotnetthoughts.wordpress.com/2008/01/01/persisting-the-doubly-linked-list/#comment-149</link>
		<dc:creator>Never modifying data: Are pointers a good solution? - dBforums</dc:creator>
		<pubDate>Sun, 15 Feb 2009 07:05:58 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2008/01/01/persisting-the-doubly-linked-list/#comment-149</guid>
		<description>[...] like most of the guys here, so I couldn&#039;t give an advice based on my experience, but the following article is by a bloke who seems to know what he is doing.  The only problem I think is that when done this [...]</description>
		<content:encoded><![CDATA[<p>[...] like most of the guys here, so I couldn&#8217;t give an advice based on my experience, but the following article is by a bloke who seems to know what he is doing.  The only problem I think is that when done this [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Where Did My Exception Occur? by Me</title>
		<link>http://dotnetthoughts.wordpress.com/2007/10/27/where-did-my-exception-occur/#comment-148</link>
		<dc:creator>Me</dc:creator>
		<pubDate>Tue, 13 Jan 2009 21:35:57 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2007/10/27/where-did-my-exception-occur/#comment-148</guid>
		<description>When debugging sometimes the stacktrace does not contain the line number, I dont know why, it shows me the method the started the whole mess (onpacketrecieved), Other times the ex shows me everyting I need to know.  I&#039;m clueless why sometimes when I degub the app I get all the info, and other times the stack trace lacks the line number in the same try catch block.  I solve this by adding a few more try catches to isolate which section is causing the problem.  Maybe this will help someone else.</description>
		<content:encoded><![CDATA[<p>When debugging sometimes the stacktrace does not contain the line number, I dont know why, it shows me the method the started the whole mess (onpacketrecieved), Other times the ex shows me everyting I need to know.  I&#8217;m clueless why sometimes when I degub the app I get all the info, and other times the stack trace lacks the line number in the same try catch block.  I solve this by adding a few more try catches to isolate which section is causing the problem.  Maybe this will help someone else.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Doubles, Decimals, and Dividing by Zero by dotnetthoughts</title>
		<link>http://dotnetthoughts.wordpress.com/2007/10/20/doubles-decimals-and-dividing-by-zero/#comment-146</link>
		<dc:creator>dotnetthoughts</dc:creator>
		<pubDate>Thu, 11 Dec 2008 15:56:13 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2007/10/20/doubles-decimals-and-dividing-by-zero/#comment-146</guid>
		<description>Sriharsha--

I&#039;m not a VB.Net guru, but it looks like this is a difference in the way the VB compiler and the C# compiler treat code.

I wrote two simple programs and opened them up in ILDASM.

C#

        static void Main(string[] args)
        {
            int n1 = 5;
            int n2 = 0;
            int result = n1 / n2;
        }


VB.Net

    Sub Main()
        Dim n1 As Integer = 5
        Dim n2 As Integer = 0
        Dim result As Integer = n1 / n2
    End Sub

They appear to do the same thing, but under the covers, they don&#039;t. When I run ILDasm against C#, I get this as a partial result.

.method private hidebysig static void  Main(string[] args) cil managed
{
  .entrypoint
  // Code size       10 (0xa)
  .maxstack  2
  .locals init ([0] int32 n1,
           [1] int32 n2,
           [2] int32 result)
  IL_0000:  nop
  IL_0001:  ldc.i4.5
  IL_0002:  stloc.0
  IL_0003:  ldc.i4.0
  IL_0004:  stloc.1
  IL_0005:  ldloc.0
  IL_0006:  ldloc.1
  IL_0007:  div
  IL_0008:  stloc.2
  IL_0009:  ret
} // end of method Program::Main

The both parameters are loaded as integers, and the division is returned as an integer.

In VB.Net, however, the code disassembles to this:

.method public static void  Main() cil managed
{
  .entrypoint
  .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() = ( 01 00 00 00 ) 
  // Code size       19 (0x13)
  .maxstack  2
  .locals init ([0] int32 n1,
           [1] int32 n2,
           [2] int32 result)
  IL_0000:  nop
  IL_0001:  ldc.i4.5
  IL_0002:  stloc.0
  IL_0003:  ldc.i4.0
  IL_0004:  stloc.1
  IL_0005:  ldloc.0
  IL_0006:  conv.r8
  IL_0007:  ldloc.1
  IL_0008:  conv.r8
  IL_0009:  div
  IL_000a:  call       float64 [mscorlib]System.Math::Round(float64)
  IL_000f:  conv.ovf.i4
  IL_0010:  stloc.2
  IL_0011:  nop
  IL_0012:  ret
} // end of method Module1::Main

See the conv.r8s in there, and also the call to System.Math that is rounding to a float64? For whatever reason, VB.Net has decided that divisions should be done with floats. I&#039;ve stated in other posts that C# and VB.Net are not as equivalent as Microsoft says they are, and this is another great example.

An erie twist on this is the errors that are raised. Because of the way these variables are treated, C# (correctly) returns a divide by zero error, while VB.Net throws an arithmatic overflow!</description>
		<content:encoded><![CDATA[<p>Sriharsha&#8211;</p>
<p>I&#8217;m not a VB.Net guru, but it looks like this is a difference in the way the VB compiler and the C# compiler treat code.</p>
<p>I wrote two simple programs and opened them up in ILDASM.</p>
<p>C#</p>
<p>        static void Main(string[] args)<br />
        {<br />
            int n1 = 5;<br />
            int n2 = 0;<br />
            int result = n1 / n2;<br />
        }</p>
<p>VB.Net</p>
<p>    Sub Main()<br />
        Dim n1 As Integer = 5<br />
        Dim n2 As Integer = 0<br />
        Dim result As Integer = n1 / n2<br />
    End Sub</p>
<p>They appear to do the same thing, but under the covers, they don&#8217;t. When I run ILDasm against C#, I get this as a partial result.</p>
<p>.method private hidebysig static void  Main(string[] args) cil managed<br />
{<br />
  .entrypoint<br />
  // Code size       10 (0xa)<br />
  .maxstack  2<br />
  .locals init ([0] int32 n1,<br />
           [1] int32 n2,<br />
           [2] int32 result)<br />
  IL_0000:  nop<br />
  IL_0001:  ldc.i4.5<br />
  IL_0002:  stloc.0<br />
  IL_0003:  ldc.i4.0<br />
  IL_0004:  stloc.1<br />
  IL_0005:  ldloc.0<br />
  IL_0006:  ldloc.1<br />
  IL_0007:  div<br />
  IL_0008:  stloc.2<br />
  IL_0009:  ret<br />
} // end of method Program::Main</p>
<p>The both parameters are loaded as integers, and the division is returned as an integer.</p>
<p>In VB.Net, however, the code disassembles to this:</p>
<p>.method public static void  Main() cil managed<br />
{<br />
  .entrypoint<br />
  .custom instance void [mscorlib]System.STAThreadAttribute::.ctor() = ( 01 00 00 00 )<br />
  // Code size       19 (0&#215;13)<br />
  .maxstack  2<br />
  .locals init ([0] int32 n1,<br />
           [1] int32 n2,<br />
           [2] int32 result)<br />
  IL_0000:  nop<br />
  IL_0001:  ldc.i4.5<br />
  IL_0002:  stloc.0<br />
  IL_0003:  ldc.i4.0<br />
  IL_0004:  stloc.1<br />
  IL_0005:  ldloc.0<br />
  IL_0006:  conv.r8<br />
  IL_0007:  ldloc.1<br />
  IL_0008:  conv.r8<br />
  IL_0009:  div<br />
  IL_000a:  call       float64 [mscorlib]System.Math::Round(float64)<br />
  IL_000f:  conv.ovf.i4<br />
  IL_0010:  stloc.2<br />
  IL_0011:  nop<br />
  IL_0012:  ret<br />
} // end of method Module1::Main</p>
<p>See the conv.r8s in there, and also the call to System.Math that is rounding to a float64? For whatever reason, VB.Net has decided that divisions should be done with floats. I&#8217;ve stated in other posts that C# and VB.Net are not as equivalent as Microsoft says they are, and this is another great example.</p>
<p>An erie twist on this is the errors that are raised. Because of the way these variables are treated, C# (correctly) returns a divide by zero error, while VB.Net throws an arithmatic overflow!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Doubles, Decimals, and Dividing by Zero by Sriharsha</title>
		<link>http://dotnetthoughts.wordpress.com/2007/10/20/doubles-decimals-and-dividing-by-zero/#comment-145</link>
		<dc:creator>Sriharsha</dc:creator>
		<pubDate>Thu, 11 Dec 2008 01:10:33 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2007/10/20/doubles-decimals-and-dividing-by-zero/#comment-145</guid>
		<description>Module divzero
    Sub Main()
        Dim n1, n2 As Integer
        Dim op As Char

        Console.WriteLine(&quot;Enter the two numbers and the operator&quot;)

        n1 = Console.ReadLine
        n2 = Console.ReadLine
        op = Console.ReadLine

        Console.WriteLine(&quot;Division ------&gt;&quot; &amp; (n1 / n2))
        Console.ReadLine()
    End Sub
End Module

#########################################################

I am beginner in .net programming. I am facing the same problem here. You said that using &quot;double&quot; gives the output as &quot;infinity&quot;. But I used &quot;integer&quot; ( which is decimal, I hope so) and I got the same one, &quot;infinity&quot;. So please help me out.</description>
		<content:encoded><![CDATA[<p>Module divzero<br />
    Sub Main()<br />
        Dim n1, n2 As Integer<br />
        Dim op As Char</p>
<p>        Console.WriteLine(&#8220;Enter the two numbers and the operator&#8221;)</p>
<p>        n1 = Console.ReadLine<br />
        n2 = Console.ReadLine<br />
        op = Console.ReadLine</p>
<p>        Console.WriteLine(&#8220;Division &#8212;&#8212;&gt;&#8221; &amp; (n1 / n2))<br />
        Console.ReadLine()<br />
    End Sub<br />
End Module</p>
<p>#########################################################</p>
<p>I am beginner in .net programming. I am facing the same problem here. You said that using &#8220;double&#8221; gives the output as &#8220;infinity&#8221;. But I used &#8220;integer&#8221; ( which is decimal, I hope so) and I got the same one, &#8220;infinity&#8221;. So please help me out.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Debug and Release Builds by Santi24</title>
		<link>http://dotnetthoughts.wordpress.com/2007/11/29/debug-and-release-builds/#comment-144</link>
		<dc:creator>Santi24</dc:creator>
		<pubDate>Thu, 27 Nov 2008 12:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2007/11/29/debug-and-release-builds/#comment-144</guid>
		<description>Hello!

Do you know if the &quot;Release mode&quot; treats numbers differently from the &quot;Debug mode&quot;?

I have to do a conversion from char* to double and it does it correctly in the &quot;Debug mode&quot; but incorrectly in the &quot;Release mode&quot;.

Example:
          - Debug:   9.0377972222222
          - Release: 9.0397277777778


Santi24 needs help! Please!</description>
		<content:encoded><![CDATA[<p>Hello!</p>
<p>Do you know if the &#8220;Release mode&#8221; treats numbers differently from the &#8220;Debug mode&#8221;?</p>
<p>I have to do a conversion from char* to double and it does it correctly in the &#8220;Debug mode&#8221; but incorrectly in the &#8220;Release mode&#8221;.</p>
<p>Example:<br />
          &#8211; Debug:   9.0377972222222<br />
          &#8211; Release: 9.0397277777778</p>
<p>Santi24 needs help! Please!</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Where Did My Exception Occur? by Franklin</title>
		<link>http://dotnetthoughts.wordpress.com/2007/10/27/where-did-my-exception-occur/#comment-143</link>
		<dc:creator>Franklin</dc:creator>
		<pubDate>Thu, 06 Nov 2008 05:47:13 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2007/10/27/where-did-my-exception-occur/#comment-143</guid>
		<description>Hi,

getErrorLineNo() function realy helped me to get what I want. Thanks,
I would like to add few of my code which would be more helpfull in this prospect. Here, you get the filename, LineNumber and the MethodName where the Exception Orginated.

public static void LogException(Exception ex)
        {
            System.Diagnostics.StackTrace Trace = new System.Diagnostics.StackTrace(ex, true);
            System.Diagnostics.StackFrame frame = Trace.GetFrame(Trace.FrameCount - 1);
            string FileName = frame.GetMethod().ToString();
            string MethodName = frame.GetMethod().ToString(); 
            string LineNumber = frame.GetFileLineNumber().ToString(); 
 }

Thanks,
Franklin</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>getErrorLineNo() function realy helped me to get what I want. Thanks,<br />
I would like to add few of my code which would be more helpfull in this prospect. Here, you get the filename, LineNumber and the MethodName where the Exception Orginated.</p>
<p>public static void LogException(Exception ex)<br />
        {<br />
            System.Diagnostics.StackTrace Trace = new System.Diagnostics.StackTrace(ex, true);<br />
            System.Diagnostics.StackFrame frame = Trace.GetFrame(Trace.FrameCount &#8211; 1);<br />
            string FileName = frame.GetMethod().ToString();<br />
            string MethodName = frame.GetMethod().ToString();<br />
            string LineNumber = frame.GetFileLineNumber().ToString();<br />
 }</p>
<p>Thanks,<br />
Franklin</p>
]]></content:encoded>
	</item>
	<item>
		<title>Comment on Debug and Release Builds by Atreya A</title>
		<link>http://dotnetthoughts.wordpress.com/2007/11/29/debug-and-release-builds/#comment-142</link>
		<dc:creator>Atreya A</dc:creator>
		<pubDate>Fri, 26 Sep 2008 21:42:54 +0000</pubDate>
		<guid isPermaLink="false">http://dotnetthoughts.wordpress.com/2007/11/29/debug-and-release-builds/#comment-142</guid>
		<description>Thanks for this nice article.

Two thinks which were really helpful:
1. You mentioned the IL code using ILDasm
2. The link given to scott&#039;s article.

namaste!
Atreya A</description>
		<content:encoded><![CDATA[<p>Thanks for this nice article.</p>
<p>Two thinks which were really helpful:<br />
1. You mentioned the IL code using ILDasm<br />
2. The link given to scott&#8217;s article.</p>
<p>namaste!<br />
Atreya A</p>
]]></content:encoded>
	</item>
</channel>
</rss>
