<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>public Blog&amp;lt;BenR&amp;gt;</title><link>http://dotnetjunkies.com/WebLog/barblog/default.aspx</link><description>Ben Reichelt's Blog</description><dc:language>en-US</dc:language><generator>CommunityServer 1.0 (Build: 1.0.1.50214)</generator><item><title>Blog moved to codebetter.com</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/02/01/50051.aspx</link><pubDate>Tue, 01 Feb 2005 23:17:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:50051</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/50051.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=50051</wfw:commentRss><description>&lt;P&gt;
&lt;FONT face=Arial size=2&gt;I moved my blog a few days ago to 
codebetter.com, I'm sure most of you know the story by now.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;This is just a notice to anyone to subscribes to 
redirect your aggregator to my new url:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;&lt;FONT face=Arial color=#800080 size=2&gt;&lt;A 
href="http://codebetter.com/blogs/ben.reichelt/Rss.aspx"&gt;http://codebetter.com/blogs/ben.reichelt/Rss.aspx&lt;/A&gt;&lt;/FONT&gt;&lt;/U&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I would also encourage you to subscribe to the main 
feed at codebetter.com&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://codebetter.com/blogs/MainFeed.aspx"&gt;&lt;FONT face=Arial 
size=2&gt;http://codebetter.com/blogs/MainFeed.aspx&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;thanks for reading!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=50051" width="1" height="1"&gt;</description></item><item><title>Thanks Brendan</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/28/48922.aspx</link><pubDate>Fri, 28 Jan 2005 22:16:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:48922</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/48922.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=48922</wfw:commentRss><description>&lt;FONT face=Arial&gt;Visual Blogger test post on the new blog 
:-)&lt;/FONT&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=48922" width="1" height="1"&gt;</description></item><item><title>Scrollable divs and Firefox</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/28/48881.aspx</link><pubDate>Fri, 28 Jan 2005 14:18:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:48881</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/48881.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=48881</wfw:commentRss><description>&lt;DIV style="FONT-SIZE: 14px; FONT-FAMILY: Arial, Helvetica, sans-serif"&gt;
&lt;P&gt;Firefox does not support scrollable divs with the mouse wheel. &lt;/P&gt;
&lt;P&gt;I poked around in the &lt;A href="https://bugzilla.mozilla.org/" 
target=_blank&gt;extensive bug database&lt;/A&gt; trying to find this listed, but the 
number of bugs is just too daunting. This really sucks, because we develop our 
stuff to work on ie as well as Firefox, so whenever we run into a div with a 
scroll bar, the screen just kind of jumps around. I'm surprised that I haven't 
heard much about this problem from other people, as the mouse wheel has become 
invaluable to me, I hate having to move my mouse to the scroll bar, and manually 
move it down......&lt;/P&gt;&lt;/DIV&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=48881" width="1" height="1"&gt;</description></item><item><title>Goodger leaves Mozilla for Google</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/24/48067.aspx</link><pubDate>Mon, 24 Jan 2005 16:57:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:48067</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/48067.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=48067</wfw:commentRss><description>Hmm, is &lt;a href="http://weblogs.mozillazine.org/ben/archives/007366.html" target="blank"&gt;this&lt;/a&gt; the sound of a &lt;a href="http://www.kottke.org/04/08/the-google-browser" target="blank"&gt;Google web browser rumor&lt;/a&gt; starting up again??  Ben Goodger has left the Mozilla Foundation where he was a lead engineer of the Firefox browser.  Coincidence? I think not.......&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=48067" width="1" height="1"&gt;</description></item><item><title>CSci 101 Part III</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/21/47011.aspx</link><pubDate>Fri, 21 Jan 2005 11:52:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:47011</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/47011.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=47011</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial&gt;Now we've seen a &lt;A href="http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/18/45891.aspx"&gt;slow way&lt;/A&gt; to generate the fibonacci numbers, and we've seen &lt;A href="http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/20/46563.aspx"&gt;why its so slow&lt;/A&gt;, now we'll try to do better.&amp;nbsp; Here's my proposed improvement to our recursive function that we made the first day:&lt;/FONT&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;static&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; Fibo(&lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; n)&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;//&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// check the base cases&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (n &amp;lt;= 1)&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; 0;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (n == 2)&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; 1;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// initialize our array of fibonacci numbers&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt;[] numbers = &lt;SPAN style="COLOR: blue"&gt;new&lt;/SPAN&gt; &lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt;[n];&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;numbers[0] = 0;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;numbers[1] = 1;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// calculate the 2nd through nth &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// fibonacci numbers in the array&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; i = 2; i &amp;lt; n; i++)&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;numbers[i] = numbers[i - 1] + numbers[i - 2];&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; numbers[n - 1];&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT face=Arial&gt;So what we're doing here is that instead of making recursive calls to the Fibo function, we are just storing the fibonacci numbers in an array of length n. We don't have the recursion tree at all now, as there are no recursive calls.&amp;nbsp; All we have is the overhead of the array, and a loop that will loop n times.&amp;nbsp; During each&amp;nbsp;loop interation, we simply add the two previous numbers in the array, and&amp;nbsp;put the result in the current array position.&amp;nbsp; Using this function we can easily get the 50th, 100th, or 1000000th fibonacci number, no problem.&amp;nbsp; Go ahead, try it!&amp;nbsp; The response is nearly immediate!&amp;nbsp; However, there is one more little thing we can change to make the function even better.&amp;nbsp; &lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT face=Arial&gt;In the code above, we maintain an array of the 0 to nth fibonacci numbers, when really, all we need is the current number, and the previous number, in order to generate the next one.&amp;nbsp; So we can remove the overhead costs that are associated with the array:&lt;/FONT&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;static&lt;/SPAN&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; Fibo(&lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; n)&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;//&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// check the base cases&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (n &amp;lt;= 1)&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; 0;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;if&lt;/SPAN&gt; (n == 2)&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; 1;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// initialize our loop varibles&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; x = 0;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; y = 1;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; current = 0;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// calculate the 2nd through nth&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// fibonacci numbers, but without&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;// the array overheard&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: gray"&gt;//&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;for&lt;/SPAN&gt; (&lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; i = 2; i &amp;lt; n; i++)&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;{&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="mso-tab-count: 1"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;current = x + y;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;x = y;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;y = current;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;}&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN style="COLOR: blue"&gt;return&lt;/SPAN&gt; current;&lt;/SPAN&gt;&lt;/P&gt; &lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;/P&gt; &lt;P&gt; &lt;P&gt;&lt;FONT face=Arial&gt;Here, instead of an array of length n, we simply have x, y, and current.&amp;nbsp; We still have the loop that will iterate n times, but each time the loop adds x and y and then puts the value of y into x, and the new value into y.&amp;nbsp; We can store all the values we need in just three variables!&amp;nbsp;&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT face=Arial&gt;I ran some tests and compared the results of the 3 different functions, heres what I found:&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;  &lt;TABLE class=tbl style="BORDER-TOP: #000000 1px solid; BORDER-LEFT: #000000 1px solid" cellSpacing=0 cellPadding=5 width=500 align=center border=0&gt; &lt;TBODY&gt; &lt;TR&gt; &lt;TD&gt;&amp;nbsp;&lt;/TD&gt; &lt;TD&gt;10&lt;/TD&gt; &lt;TD&gt;20&lt;/TD&gt; &lt;TD&gt;30&lt;/TD&gt; &lt;TD&gt;40&lt;/TD&gt; &lt;TD&gt;50&lt;/TD&gt;&lt;/TR&gt; &lt;TR&gt; &lt;TD&gt;Slow&lt;/TD&gt; &lt;TD&gt;125000&lt;/TD&gt; &lt;TD&gt;62500&lt;/TD&gt; &lt;TD&gt;312500&lt;/TD&gt; &lt;TD&gt;37484375&lt;/TD&gt; &lt;TD&gt;4.18E+09&lt;/TD&gt;&lt;/TR&gt; &lt;TR&gt; &lt;TD&gt;Better&lt;/TD&gt; &lt;TD&gt;140625&lt;/TD&gt; &lt;TD&gt;78125&lt;/TD&gt; &lt;TD&gt;31250&lt;/TD&gt; &lt;TD&gt;31250&lt;/TD&gt; &lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt; &lt;TR&gt; &lt;TD&gt;Best&lt;/TD&gt; &lt;TD&gt;93750&lt;/TD&gt; &lt;TD&gt;109375&lt;/TD&gt; &lt;TD&gt;46875&lt;/TD&gt; &lt;TD&gt;78125&lt;/TD&gt; &lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT face=Arial&gt;So you can see that the difference in the functions is trivial when finding the 10th or 20th fibonacci number.&amp;nbsp; However, the difference&amp;nbsp; becomes very noticeable when generating the 40th number, and once we get to the 50th, the difference is staggering.&amp;nbsp; I went and ate dinner while the slow function was processing the 50th number!&amp;nbsp; The numbers provided are the number of "ticks" the functions took.&amp;nbsp; I ran each function 10 times for each value.&amp;nbsp; The difference between the faster two functions is negligible, as the only optimization we used there was to reduce the amount of memory needed, not processing time.&amp;nbsp; These results clearly show how much slower tree recursion can be than an iterative function.&lt;/FONT&gt;&lt;/P&gt; &lt;P&gt;&lt;FONT face=Arial&gt;Thanks for reading, I hope you've enjoyed the series!&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=47011" width="1" height="1"&gt;</description></item><item><title>CSci 101 Part II</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/20/46563.aspx</link><pubDate>Thu, 20 Jan 2005 13:03:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:46563</guid><dc:creator>reic0113</dc:creator><slash:comments>1</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/46563.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=46563</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial&gt;Okay, so yesterday we saw &lt;A 
href="http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/18/45891.aspx"&gt;one 
way&lt;/A&gt; to generate the "nth" fibonacci number using recursion.&amp;nbsp;The 
recursion that we used is also called "&lt;A 
href="http://mitpress.mit.edu/sicp/chapter1/node13.html"&gt;tree recursion&lt;/A&gt;", 
the reason for this being that we made two recursive calls inside the 
function.&amp;nbsp; If you were to draw a diagram of the function calls, the diagram 
would take on the shape&amp;nbsp;of a tree, because every node would have two 
branches, like this:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;&lt;IMG height=204 
src="http://dotnetjunkies.com/WebLog/images/dotnetjunkies_com/barblog/2293/r_fibo.GIF" 
width=640 border=0&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;If you tried to use this function to find the 35th fibonacci 
number, you probably realized that it can take quite a bit of time.&amp;nbsp; The 
reason for this is that we are computing the same value many times over.&amp;nbsp; 
Consider what happens when you call Fibo(4).&amp;nbsp; The function is going to add 
Fibo(3) + Fibo(2).&amp;nbsp; Fibo(3) will, in turn, call Fibo(2)&amp;nbsp;+ Fibo(1). So 
you can see that we are calling Fibo(2) twice, which is&amp;nbsp;a waste.&amp;nbsp; Its 
not a big deal for only the 4th fibonacci number, but when you put in 50, the 
extra work can definitely start to make a difference.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;See if you can come up with a way to speed up the function, 
and I'll post my ideas tomorrow, along with a performance&amp;nbsp;comparison of a 
few different functions.&amp;nbsp; Thanks for reading!&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=46563" width="1" height="1"&gt;</description></item><item><title>Gut feeling followup</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/20/46600.aspx</link><pubDate>Thu, 20 Jan 2005 12:10:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:46600</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/46600.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=46600</wfw:commentRss><description>&lt;p&gt;
	&lt;a target="_blank" href="http://www.dotnetjunkies.com/weblog/joewood"&gt;Joe&lt;/a&gt; posted a comment about my &lt;a target="_blank" href="http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/19/46406.aspx"&gt;entry&lt;/a&gt; on the new nofollow attribute. He has a good idea to fix the problem I had, it would allow blog owners to selectively promote links in comments, so valid links would get their due &amp;quot;Google juice.&amp;quot; I think this is a good idea, but I dont think many blog owners would be diligent in promoting peoples links, especially &lt;a target="_blank" href="http://radio.weblogs.com/0001011/"&gt;people who get a lot of comments&lt;/a&gt;.
&lt;/p&gt;
&lt;p&gt;
	 
&lt;/p&gt;
&lt;p&gt;
	What I would like is some sort of keyword list that I could maintain and links that contain these keywords would have the rel=&amp;quot;nofollow&amp;quot; attribute. Then meaningful links to real blogs would still their credit. I would also want to be able to retroactively apply the keyword filtering, so if I get a bunch of comment spam one day, and I dont happen to have any keywords for the new spam, I would want to add the keywords, and then have the blogging application check my comments against my updated keywords list.
&lt;/p&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=46600" width="1" height="1"&gt;</description></item><item><title>Gut feeling</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/19/46406.aspx</link><pubDate>Thu, 20 Jan 2005 02:37:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:46406</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/46406.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=46406</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial&gt;Its nice to see &lt;/FONT&gt;&lt;A 
href="http://blogs.msdn.com/dareobasanjo/archive/2005/01/19/356177.aspx"&gt;&lt;FONT 
face=Arial&gt;some people&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; are not so giddy over the 
&lt;/FONT&gt;&lt;A 
href="http://www.google.com/googleblog/2005/01/preventing-comment-spam.html"&gt;&lt;FONT 
face=Arial&gt;new attribute&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; that we can add to 
links.&amp;nbsp;I've heard people lauding this as the end of comment spam, and I 
agree that it will be a big help, however, one important&amp;nbsp;way that people 
get "known" in the blog world is by getting moved up in the Google rank through 
meaningful comments.&amp;nbsp;I like the fact that when I make a comment, its 
contributing to the conversation, but that I'm also getting a link to my blog 
out there.&amp;nbsp;Now, when I leave comments, it won't be counted if the blog 
owner applies this attribute to all incoming comments.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;This was my first impression when I first learned of the 
tag, and maybe I'm way off base, but this is just&amp;nbsp;my knee jerk 
reaction.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=46406" width="1" height="1"&gt;</description></item><item><title>CSci 101 Part I</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/18/45891.aspx</link><pubDate>Wed, 19 Jan 2005 03:11:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:45891</guid><dc:creator>reic0113</dc:creator><slash:comments>2</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/45891.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=45891</wfw:commentRss><description>&lt;HTML xmlns:o = "urn:schemas-microsoft-com:office:office"&gt;&lt;P&gt;&lt;FONT face=Arial size=3&gt;I'd like to do a little educational series a la &lt;/FONT&gt;&lt;A 
href="http://weblogs.asp.net/oldnewthing/archive/2004/12/29/343664.aspx" 
target=_blank&gt;&lt;FONT face=Arial size=3&gt;Raymond Chen&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=3&gt; and 
&lt;/FONT&gt;&lt;A 
href="http://weblogs.asp.net/larryosterman/archive/2004/09/08/226938.aspx" 
target=_blank&gt;&lt;FONT face=Arial size=3&gt;Larry Osterman&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=3&gt;.&amp;nbsp; 
Now, this series will NOT be nearly as technical, nor as difficult or in depth 
as these two can get, its just something that I thought&amp;nbsp;I would try 
out.&amp;nbsp; If I like it, maybe someday I will have some really cool stuff to 
give a tutorial on, and I can do that, but for now, we're going to keep it 
fairly academic, being as I just graduated from college, this seems 
appropriate.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=3&gt;I'm going&amp;nbsp;to talk about the &lt;/FONT&gt;&lt;A 
href="http://www.mcs.surrey.ac.uk/Personal/R.Knott/Fibonacci/fib.html" 
target=_blank&gt;&lt;FONT face=Arial size=3&gt;fibonacci numbers&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=3&gt;, 
and a few different ways to go about generating them.&amp;nbsp; The fibonacci 
numbers are a sequence of numbers that are calculated by adding the previous two 
numbers in the sequence.&amp;nbsp; The first two numbers are given, they are 0 and 
1, respectively. So the 3rd number in the sequence is 0 + 1 = 1, the 4th is 1 + 
1 = 2, and so on.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=3&gt;In my first computer science class at &lt;/FONT&gt;&lt;A 
href="http://www.it.umn.edu/" target=_blank&gt;&lt;FONT 
face=Arial size=3&gt;school&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=3&gt;, one of the first concepts they 
try to beat into you is recursion.&amp;nbsp;A recursive function is one that makes a 
call to itself.&amp;nbsp; A classic example of recursion is the way that you can 
write a factorial function.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=3&gt;We can rewrite n! as n * (n-1)!, which we can rewrite as n * 
(n - 1) * (n - 2)!, etc.&amp;nbsp; The way this would be represented in our code 
would be:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;static&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN 
style="COLOR: blue"&gt;int&lt;/SPAN&gt; fact(&lt;SPAN style="COLOR: blue"&gt;int&lt;/SPAN&gt; 
n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;if&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; (n == 
1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;return&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; 
1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;else&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;return&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; n * 
fact(n - 1);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;
&lt;P&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT 
face=Arial size=3&gt;Notice how the fact function calls itself.&amp;nbsp; Its important 
to have a base case so that the recursion ends at some point; in this example 
the base case occurs when n == 1, at that point we simply return 1 because 1! = 
1, so we can stop recursing.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT 
face=Arial size=3&gt;The first way that we will generate the fibonacci numbers is 
using recursion.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT 
face=Arial size=3&gt;The base cases for our function will be when n == 0 or n == 1, 
because those fibonacci numbers are given to us.&amp;nbsp;If n&amp;nbsp;&amp;gt; 1, then we 
will calculate the 2 previous fibonacci numbers, by recursively calling the same 
function, and adding them together.&amp;nbsp; Here's the code:&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-fareast-font-family: 'Times New Roman'; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;static&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; &lt;SPAN 
style="COLOR: blue"&gt;long&lt;/SPAN&gt; Fibo(&lt;SPAN style="COLOR: blue"&gt;long&lt;/SPAN&gt; 
n)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;{&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;//&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;// 
check the base cases&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;//&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;if&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; (n &amp;lt;= 
1)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;return&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; 
0;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;if&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; (n == 
2)&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt 0.5in; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;return&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; 
1;&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;//&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;// 
calculate the 2 previous &lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;// 
numbers and add them together&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;//&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal 
style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in; mso-layout-grid-align: none"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;return&lt;/SPAN&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt; Fibo(n - 
1) + Fibo(n - 2);&lt;o:p&gt;&lt;/o:p&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;}&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT 
face=Arial size=3&gt;This code is extremely simple, there are more lines of 
comments than of actual code! Try this code out in a console application, start 
out small by calling Fibo(4), Fibo(5), etc.&amp;nbsp; See if you notice anything as 
you put in higher and higher numbers :-) Next, we'll inspect this function a 
little, and improve upon it a little bit.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT 
face=Arial size=3&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN 
style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"&gt;&lt;FONT 
face=Arial size=3&gt;Thanks for reading!&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=45891" width="1" height="1"&gt;</description></item><item><title>Date.AddMinutes()</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/07/42463.aspx</link><pubDate>Fri, 07 Jan 2005 20:35:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:42463</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/42463.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=42463</wfw:commentRss><description>&lt;div style="font-family:Arial, Helvetica, sans-serif "&gt;
I really wanted an &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpref/html/frlrfsystemdatetimeclassaddminutestopic.asp"&gt;AddMinutes()&lt;/a&gt; method to use in javascript like C# has.  So I set out to write one myself. 
&lt;div style="margin-top:10px; "&gt;I soon realized how complicated it could get, for instance, the minutes could move the date to the next day, month, or year.  I started writing down all the conditions to check, to make sure that I could handle all situations.  Since javascript uses the setMinutes(), setHours(), setMonth(), etc.. style of altering a date, I was going to parse the minutes into the number of months, days, hours, and minutes that were represented by the minutes.  So 10080 minutes would equal 7 days. After I did that I could add all the appropriate fields and then get my new date.
&lt;/div&gt;&lt;div style="margin-top:10px; "&gt;Then I realized a MUCH easier way to get it done.  There is a Date method called &lt;a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/script56/html/js56jsmthgettime.asp"&gt;getTime()&lt;/a&gt; that returns the number of milliseconds since 1/1/1970.  There is also a Date constructor that takes in an integer, which also represents the number of milliseconds since 1/1/1970.  So all I had to do was use the getTime() method, convert the minutes that I want to add into milliseconds, add the milliseconds and the create a new date instance with this new value.  Much, much easier and I don't have the headache of managing all those situations mentioned above, whew!!  Here's the code I used:
&lt;/div&gt;
&lt;div style="margin-top:15px; "&gt;
&lt;span style="font-weight:bold; "&gt;function&lt;/span&gt; addMinutes(dateTimeObj, iMinutes) {&lt;br/&gt;
&lt;span style="margin-left:35px; "&gt;var length = iMinutes * 60 * 1000;&lt;br/&gt;&lt;/span&gt;
&lt;span style="margin-left:35px; "&gt;var iseconds = dateTimeObj.getTime();&lt;br/&gt;&lt;/span&gt;
&lt;span style="margin-left:35px; "&gt;iseconds += length;&lt;br/&gt;&lt;/span&gt;
&lt;span style="margin-left:35px; "&gt;var dt = new Date(iseconds);&lt;br/&gt;&lt;/span&gt;
&lt;span style="margin-left:35px; "&gt;return dt;&lt;br/&gt;&lt;/span&gt;
&lt;span&gt;}&lt;/span&gt;

&lt;/div&gt;
&lt;/div&gt;
&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=42463" width="1" height="1"&gt;</description></item><item><title>Maximum length of url in winamp</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/06/42177.aspx</link><pubDate>Fri, 07 Jan 2005 00:05:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:42177</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/42177.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=42177</wfw:commentRss><description>&lt;P&gt;&lt;A href="http://www.winamp.com"&gt;&lt;FONT face=Arial&gt;Winamp&lt;/FONT&gt;&lt;/A&gt;&lt;FONT 
face=Arial&gt; currently has a maximum string length of 260 for urls that point to 
streaming audio.&amp;nbsp; After I finally&amp;nbsp;got the &lt;A 
href="http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/02/40588.aspx"&gt;streaming 
to work&lt;/A&gt;, I wanted to encrypt the querystring, so users couldn't mess with 
the url.&amp;nbsp; After using the encryption, I kept getting a bunch of errors, 
most of them were&amp;nbsp;"Invalid length for a base 64 char array."&amp;nbsp; So I 
naturally assumed that my encryption was getting a little goofed up because of 
the browser url encoding the string.&amp;nbsp; So I messed around with some diffent 
encryption types, but nothing worked.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Then I noticed that the url in winamp was different from the 
one that I was initially sending to the user, it was truncated.&amp;nbsp; Only then 
did I do some digging and find that winamp &lt;/FONT&gt;&lt;A 
href="http://forums.winamp.com/showthread.php?s=&amp;amp;threadid=188985"&gt;&lt;FONT 
face=Arial&gt;uses the MAX_PATH&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt; variable in the windows 
api headers, which is set to 260.&amp;nbsp; This really sucks, because winamp 
handles streams much better than Window Media Player, because you can set the 
default action to "enqueue" rather than "clear my playlist and play the new 
stream", also, WMP doesn't seem to read the track names correctly, so instead of 
a playlist that has my list of songs, it just has the word "Play" for every 
track, not real easy to tell whats playing next.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Well, at least now I know that it wasn't something that I 
did wrong, but I guess I&amp;nbsp;should have verified the url before wasting all 
that time.....&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=42177" width="1" height="1"&gt;</description></item><item><title>More on o/r</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/05/41761.aspx</link><pubDate>Thu, 06 Jan 2005 01:21:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:41761</guid><dc:creator>reic0113</dc:creator><slash:comments>1</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/41761.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=41761</wfw:commentRss><description>&lt;P&gt;&lt;A 
href="http://staff.develop.com/ballen/blog/PermaLink.aspx?guid=66cf8079-7f15-4983-9993-7a3387c9148e"&gt;&lt;FONT 
face=Arial&gt;Brock Allen&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial&gt;&amp;nbsp;refers to his object 
relational mapping tool as an RO mapper, as opposed to an&amp;nbsp;OR mapper. 
&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;He does this because he builds the database first, and then 
maps the database into objects, so its a&amp;nbsp;relational-object mapper 
instead.&amp;nbsp; I've never heard it called that before, but I like it, because 
thats exactly the process that we follow too, build the database how you want 
it, and then make the objects fit the data model.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=41761" width="1" height="1"&gt;</description></item><item><title>Alternative NUnit GUI</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/05/41531.aspx</link><pubDate>Wed, 05 Jan 2005 11:20:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:41531</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/41531.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=41531</wfw:commentRss><description>I just read about this &lt;a href="http://www.adapdev.com/zanebug"&gt;alternative gui&lt;/a&gt; for nunit over at &lt;a href="http://weblogs.asp.net/rosherove/archive/2005/01/05/346855.aspx"&gt;Roy Osherove's&lt;/a&gt;.&lt;div style="margin-top:10px;"&gt;  I just downloaded it and it looks pretty sweet!  Haven't had a chance to use it much yet, but I'm excited to see all the statistics that it produces....&lt;/div&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=41531" width="1" height="1"&gt;</description></item><item><title>Updates, Inserts, and checkboxes</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/03/41027.aspx</link><pubDate>Tue, 04 Jan 2005 03:49:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:41027</guid><dc:creator>reic0113</dc:creator><slash:comments>0</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/41027.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=41027</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial&gt;When we were developing our data access objects, we added an 
Update, and an Insert method, with the corresponding signatures:&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;Update(System.Collections.Specialized.NameValueCollection 
form);&lt;BR&gt;Insert(System.Collections.Specialized.NameValueCollection 
form);&lt;BR&gt;&lt;BR&gt;These methods take advantage of the fact that when you post a 
form, the form values are contained in a NameValueCollection object, so you can 
loop through the elements of the form, and update the respective data fields, 
and then update (or insert) the database with the new values.&lt;BR&gt;&lt;BR&gt;This scheme 
is really convenient for when you want to add or remove items from the form, 
because you can simply remove them from the html, without even worrying about 
the backend, because those added or removed form elements are inconsequential to 
the workings of the code behind.&amp;nbsp; You could have a form that contained none 
of the data fields, and still call these methods without any problem.&lt;BR&gt;&lt;BR&gt;The 
only problem arises when you need to deal with checkboxes.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;If the user checks the checkbox, the value of the checkbox 
gets submitted and the data object can be updated with the checkbox value. 
However, suppose the checkbox is initially checked, and the user unchecks the 
checkbox.&amp;nbsp; Now, when the form is submitted, it appears as though the 
checkbox never existed, because it will not be present in the 
NameValueCollection, and the data object does not know to update the 
appropriate&amp;nbsp;value.&amp;nbsp; We typically use checkboxes to denote true/false 
or 1/0&amp;nbsp;values in the database, so if a user were to leave a checkbox 
unchecked it means that the database value should be false or 0, but since there 
is no form value present, the data object does nothing to that field.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial&gt;What we did to work around this problem, was to add a hidden 
form element to our forms.&amp;nbsp; This hidden field is a comma separated list of 
all the form elements that exist on the form.&amp;nbsp; This hidden field gets 
submitted with the rest of the form, and as the data object loops the form 
elements, it records them.&amp;nbsp;When the looping is finished, it compares the 
list of form elements that it found, to the comma separated list that was 
submitted with the form.&amp;nbsp; If there are any form elements in the list, that 
were not included in the form, then the data object knows that a checkbox was 
left unchecked, and can then update the field 
accordingly.&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=41027" width="1" height="1"&gt;</description></item><item><title>Can't stream mp3 file in .net</title><link>http://dotnetjunkies.com/WebLog/barblog/archive/2005/01/02/40588.aspx</link><pubDate>Sun, 02 Jan 2005 16:23:00 GMT</pubDate><guid isPermaLink="false">58df7014-fd75-437c-9641-150997716d1c:40588</guid><dc:creator>reic0113</dc:creator><slash:comments>1</slash:comments><comments>http://dotnetjunkies.com/WebLog/barblog/comments/40588.aspx</comments><wfw:commentRss>http://dotnetjunkies.com/WebLog/barblog/commentrss.aspx?PostID=40588</wfw:commentRss><description>&lt;P&gt;&lt;FONT face=Arial&gt;I am trying to convert an internal application that we have 
that streams mp3 files to winamp.&amp;nbsp; The app is currently written in asp, and 
I'm moving it to asp.net.&amp;nbsp; I copied the streaming code almost exactly from 
the vbscript to c#, but now when I try to listen to an mp3 from the new site, I 
get the great error message "error syncing to mpeg."&amp;nbsp; Does anyone have 
experience in streaming mp3 files to winamp?&amp;nbsp; The asp code reads the file 
from an ADODB.Stream object in 2048 size chunks and buffers the content.&amp;nbsp; I 
initially did the same thing in c#, but after getting the error, I tried 
simplifying the code and just using the Response.WriteFile(string path) 
method.&amp;nbsp; The reason for reading the file in chunks is so that large files 
don't timeout.&lt;BR&gt;&lt;BR&gt;I think that it might have something to do with&amp;nbsp;a bad 
header or something, but I don't know if asp.net puts in extra headers 
automatically, in any case, I don't see why these don't work the same way.&amp;nbsp; 
I can load both examples in a firefox browser window, and the content is the 
same, its the base64 content of the file, so I know that its actually reading 
the correct data, winamp just won't recognize the file as an mp3.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;U&gt;asp code (this works):&lt;BR&gt;&lt;BR&gt;&lt;/U&gt;&lt;FONT face="Microsoft Sans Serif" 
size=2&gt;Response.Buffer = True&lt;BR&gt;Response.Clear&lt;BR&gt;Response.AddHeader 
"Content-Disposition", "inline; filename=" &amp;amp; FileName&lt;BR&gt;Response.AddHeader 
"Content-Length", FileSize&lt;BR&gt;&lt;BR&gt;Set objStream = 
Server.CreateObject("ADODB.Stream")&lt;BR&gt;objStream.Open&lt;BR&gt;objStream.Type = 
adTypeBinary&lt;BR&gt;objStream.LoadFromFile FilePath &lt;BR&gt;&lt;BR&gt;lSize = 
objStream.size&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Microsoft Sans Serif"&gt;&lt;FONT 
size=2&gt;CHUNK=2048&lt;BR&gt;NumberofBlocks=(lSize -(lsize mod chunk))/chunk&lt;BR&gt;For 
lBlocks = 1 To NumberofBlocks&lt;BR&gt;If Response.IsClientConnected = False Then Exit 
For&lt;BR&gt;Response.BinaryWrite objStream.Read(CHUNK)&lt;BR&gt;Response.Flush&lt;BR&gt;Next 
&lt;BR&gt;&lt;BR&gt;objStream.Close&lt;BR&gt;Set objStream = Nothing&lt;/FONT&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;BR&gt;&lt;U&gt;c# 
code:&lt;/U&gt;&lt;/P&gt;&lt;FONT color=#008080 size=2&gt;
&lt;P&gt;&lt;FONT face="Microsoft Sans Serif"&gt;HttpResponse&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT 
face="Microsoft Sans Serif"&gt;&lt;FONT size=2&gt; Response = System.Web.&lt;/FONT&gt;&lt;FONT 
color=#008080 size=2&gt;HttpContext&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;&lt;FONT 
face="Microsoft Sans Serif"&gt;.Current.Response;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Microsoft Sans Serif"&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Microsoft Sans Serif"&gt;Response.Buffer = &lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT 
face="Microsoft Sans Serif" color=#0000ff size=2&gt;true&lt;/FONT&gt;&lt;FONT 
face="Microsoft Sans Serif"&gt;&lt;FONT 
size=2&gt;;&lt;BR&gt;Response.Clear();&lt;BR&gt;Response.ClearContent();&lt;BR&gt;Response.ClearHeaders();&lt;BR&gt;Response.AppendHeader(&lt;/FONT&gt;&lt;FONT 
color=#800000 size=2&gt;"Content-Disposition"&lt;/FONT&gt;&lt;FONT size=2&gt;, &lt;/FONT&gt;&lt;FONT 
color=#800000 size=2&gt;"inline; filename="&lt;/FONT&gt;&lt;FONT size=2&gt; + 
System.Web.&lt;/FONT&gt;&lt;FONT color=#008080 size=2&gt;HttpContext&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT 
face="Microsoft Sans Serif"&gt;&lt;FONT 
size=2&gt;.Current.Server.UrlEncode(SongName));&lt;BR&gt;Response.AppendHeader(&lt;/FONT&gt;&lt;FONT 
color=#800000 size=2&gt;"Content-Length"&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT 
face="Microsoft Sans Serif" size=2&gt;, 
Size.ToString());&lt;BR&gt;Response.WriteFile(path);&lt;BR&gt;&lt;BR&gt;&lt;/FONT&gt;&lt;FONT color=#808080 
size=2&gt;&lt;FONT face="Microsoft Sans Serif"&gt;/*&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Microsoft Sans Serif"&gt;System.IO.FileStream fs = new 
System.IO.FileStream(path, System.IO.FileMode.Open, 
System.IO.FileAccess.Read);&lt;BR&gt;int CHUNK = 2048;&lt;BR&gt;byte[] buffer = new 
byte[CHUNK];&lt;BR&gt;&lt;BR&gt;while (fs.Read(buffer, 0, CHUNK) &amp;gt; 
0)&lt;BR&gt;{&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; if 
(!Response.IsClientConnected)&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; 
break;&lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.OutputStream.Write(buffer, 0, 
buffer.Length);&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Response.Flush();&lt;BR&gt;}&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="Microsoft Sans Serif"&gt;fs.Close();&lt;BR&gt;fs = 
null;&lt;BR&gt;&lt;BR&gt;*/&lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;
&lt;div style="color:red;margin-top:15px;"&gt;Update: I got it working, there was something in my base page class that was goofing the stream up somehow.  I think it had to do with cookies, but I will investigate further.&lt;/div&gt;&lt;img src="http://dotnetjunkies.com/WebLog/aggbug.aspx?PostID=40588" width="1" height="1"&gt;</description></item></channel></rss>