<?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>Parallelcoding.com &#187; .NET</title>
	<atom:link href="http://www.parallelcoding.com/tag/net/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.parallelcoding.com</link>
	<description></description>
	<lastBuildDate>Mon, 16 Aug 2010 11:55:45 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>Intel Threading Challenge #1</title>
		<link>http://www.parallelcoding.com/2009/07/10/intel-threading-challenge-1/</link>
		<comments>http://www.parallelcoding.com/2009/07/10/intel-threading-challenge-1/#comments</comments>
		<pubDate>Fri, 10 Jul 2009 15:16:57 +0000</pubDate>
		<dc:creator>Robert Green</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Parallel / Distributed]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[concurrent]]></category>
		<category><![CDATA[Intel]]></category>
		<category><![CDATA[Parallel]]></category>
		<category><![CDATA[Sorting]]></category>

		<guid isPermaLink="false">http://www.parallelcoding.com/?p=466</guid>
		<description><![CDATA[While I never participated in the Intel Threading Challenge, I still find the problems really intriguing. Why? Because they are problems designed to test threaded development which is not only cool but is also going to play a large part in the future of computing. I would call all this problem for the most part [...]]]></description>
			<content:encoded><![CDATA[<p>While I never participated in the <a href="http://software.intel.com/en-us/contests/Threading-Challenge-2009/codecontest.php">Intel Threading Challenge</a>, I still find the problems really intriguing. Why? Because they are problems designed to test threaded development which is not only cool but is also going to play a large part in the future of computing. I would call all this problem for the most part concurrent, not parallel. Why? Read <a href="http://www.linux-mag.com/id/7411">this</a> and you&#8217;ll understand completely. Now, on to the challenge!</p>
<p>Problem # 1 states:</p>
<blockquote>
<p style="font-family: verdana, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 16px; padding: 0px;"><em>Problem description: Given a set of unsorted items with keys that can be considered as a binary representation of an integer, the bits within the key can be used to sort the set of items. This method of sorting is known as Radix Sort.</em></p>
<p style="font-family: verdana, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 16px; padding: 0px;"><em>Write a program that includes a threaded version of a Radix Sort algorithm that sorts the keys read from an input file, then output the sorted keys to another file. The input and output file names shall be the first and second arguments on the command line of the application execution.</em></p>
<p style="font-family: verdana, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 16px; padding: 0px;"><em>The first line of the input text file is the total number of keys (N) to be sorted; this is followed by N keys, one per line, in the file.  A key will be a seven-character string made up of printable characters not including the space character (ASCII 0&#215;20). The number of keys within the file is less than 2^31 &#8211; 1.  Sorted output must be stored in a text file, one key per line.</em></p>
<p style="font-family: verdana, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 16px; padding: 0px;"><em>Timing: If you put timing code into your application to time the sorting process and report the elapsed time, this time will be used for scoring.  If no timing code is added, the entire execution time (including time for input and output) will be used for scoring.</em></p>
<p style="font-family: verdana, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 16px; padding: 0px;"><em><br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />Example Input file:<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />8<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />H@skell<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />surVEYs<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />sysTEMS<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />HASKELL<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />Surveys<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />1234567<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />SURveys<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />systEMS</em></p>
<p style="font-family: verdana, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 16px; padding: 0px;"><em>Example Output file:<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />1234567<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />H@skell<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />HASKELL<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />SURveys<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />Surveys<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />surVEYs<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />sysTEMS<br style="font-family: verdana, sans-serif; padding: 0px; margin: 0px;" />systEMS</em></p>
</blockquote>
<p style="font-family: verdana, sans-serif; margin-top: 0px; margin-right: 0px; margin-bottom: 10px; margin-left: 0px; line-height: 16px; padding: 0px;">My solution (both serial and parallel):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">using</span> <span style="color: #008080;">System</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections.Generic</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Linq</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Text</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Collections</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Diagnostics</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.Threading</span><span style="color: #008000;">;</span>
<span style="color: #0600FF;">using</span> <span style="color: #008080;">System.IO</span><span style="color: #008000;">;</span>
&nbsp;
<span style="color: #0600FF;">namespace</span> RadixSort <span style="color: #000000;">&#123;</span>
&nbsp;
    <span style="color: #FF0000;">class</span> Program <span style="color: #000000;">&#123;</span>
        <span style="color: #0600FF;">static</span> <span style="color: #0600FF;">void</span> Main<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> args<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            StreamReader sr<span style="color: #008000;">;</span>
            <span style="color: #FF0000;">int</span> length<span style="color: #008000;">;</span>
            TimeSpan serial, parallel<span style="color: #008000;">;</span>
            sr <span style="color: #008000;">=</span> File.<span style="color: #0000FF;">OpenText</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">@&quot;C:\Documents and Settings\rgreen\Desktop\Threading\Threading\rsTestK100.dat&quot;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            length <span style="color: #008000;">=</span> Convert.<span style="color: #0000FF;">ToInt32</span><span style="color: #000000;">&#40;</span>sr.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Trim</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> values <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span>length<span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
            <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> newValues <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span>length<span style="color: #000000;">&#93;</span><span style="color: #008000;">;</span>
            <span style="color: #0600FF;">for</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> x <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> x <span style="color: #008000;">&lt;</span> length<span style="color: #008000;">;</span> x<span style="color: #008000;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                values<span style="color: #000000;">&#91;</span>x<span style="color: #000000;">&#93;</span> <span style="color: #008000;">=</span> sr.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Trim</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            Stopwatch sw <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> Stopwatch<span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">//</span>
            <span style="color: #008080; font-style: italic;">// Serial</span>
            <span style="color: #008080; font-style: italic;">//</span>
            sw.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            RadixSort<span style="color: #000000;">&#40;</span>values<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">CopyTo</span><span style="color: #000000;">&#40;</span>newValues, <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            sw.<span style="color: #0000FF;">Stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            serial <span style="color: #008000;">=</span> sw.<span style="color: #0000FF;">Elapsed</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #008080; font-style: italic;">//</span>
            <span style="color: #008080; font-style: italic;">// Parallel</span>
            <span style="color: #008080; font-style: italic;">//</span>
            sw.<span style="color: #0000FF;">Reset</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            sw.<span style="color: #0000FF;">Start</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            ParallelRadixSort<span style="color: #000000;">&#40;</span>values<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">CopyTo</span><span style="color: #000000;">&#40;</span>newValues, <span style="color: #FF0000;">0</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            sw.<span style="color: #0000FF;">Stop</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            parallel <span style="color: #008000;">=</span> sw.<span style="color: #0000FF;">Elapsed</span><span style="color: #008000;">;</span>
&nbsp;
&nbsp;
            Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Serial Time: &quot;</span> <span style="color: #008000;">+</span> serial<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            Console.<span style="color: #0000FF;">WriteLine</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;Parallel Time: &quot;</span> <span style="color: #008000;">+</span> parallel<span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
            Console.<span style="color: #0000FF;">ReadLine</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> ParallelRadixSort<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> array<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
            <span style="color: #FF0000;">int</span> length <span style="color: #008000;">=</span> array.<span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span>
&nbsp;
            Parallel.<span style="color: #0600FF;">For</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">0</span>, array<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span>, <span style="color: #FF0000;">delegate</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> curRadix<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                <span style="color: #FF0000;">int</span> index <span style="color: #008000;">=</span> array<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span> <span style="color: #008000;">-</span> curRadix<span style="color: #008000;">;</span>
                array <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> MergeSort<span style="color: #000000;">&#40;</span>array, array<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span> <span style="color: #008000;">-</span> index<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Results</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">return</span> array<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
&nbsp;
        <span style="color: #0600FF;">public</span> <span style="color: #0600FF;">static</span> <span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> RadixSort<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">string</span><span style="color: #000000;">&#91;</span><span style="color: #000000;">&#93;</span> array<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
            <span style="color: #FF0000;">int</span> length <span style="color: #008000;">=</span> array.<span style="color: #0000FF;">Length</span><span style="color: #008000;">;</span>
&nbsp;
            <span style="color: #0600FF;">for</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> curRadix <span style="color: #008000;">=</span> array<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span><span style="color: #008000;">;</span> curRadix <span style="color: #008000;">&gt;=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span> curRadix<span style="color: #008000;">--</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
                array <span style="color: #008000;">=</span> <span style="color: #008000;">new</span> MergeSort<span style="color: #000000;">&#40;</span>array, array<span style="color: #000000;">&#91;</span><span style="color: #FF0000;">0</span><span style="color: #000000;">&#93;</span>.<span style="color: #0000FF;">Length</span> <span style="color: #008000;">-</span> <span style="color: #FF0000;">1</span> <span style="color: #008000;">-</span> curRadix<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Results</span><span style="color: #008000;">;</span>
            <span style="color: #000000;">&#125;</span>
&nbsp;
            <span style="color: #0600FF;">return</span> array<span style="color: #008000;">;</span>
        <span style="color: #000000;">&#125;</span>
    <span style="color: #000000;">&#125;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>And there you have it!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2009/07/10/intel-threading-challenge-1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Project Euler #6</title>
		<link>http://www.parallelcoding.com/2009/07/01/project-euler-6/</link>
		<comments>http://www.parallelcoding.com/2009/07/01/project-euler-6/#comments</comments>
		<pubDate>Wed, 01 Jul 2009 13:52:40 +0000</pubDate>
		<dc:creator>Robert Green</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Parallel / Distributed]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Project Euler]]></category>

		<guid isPermaLink="false">http://www.parallelcoding.com/?p=451</guid>
		<description><![CDATA[Project Euler problem #6 is Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum. When I first began looking at this problem I wanted to experiment a bit with the Parallel Extensions for .NET, so I started where any parallel algorithm begins: [...]]]></description>
			<content:encoded><![CDATA[<p>Project Euler problem #6 is</p>
<blockquote><p>Find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum.</p></blockquote>
<p>When I first began looking at this problem I wanted to experiment a bit with the Parallel Extensions for .NET, so I started where any parallel algorithm begins: with a sequential algorithm. The algorithm here is rather trivial: Loop over the natural numbers from 1 to 100. In order to sum the squares I will sum the square of each number. In order to square the sum I will sum the numbers and then square them. The difference is the answer. So, first, I came up with two functions: SumOfSquares and SquareOfSums.</p>
<p><br/></p>
<p>My first attempt at these functions ended up something like this:</p>
<p><br/></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">static</span> <span style="color: #FF0000;">double</span> SumOfSquares<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> min, <span style="color: #FF0000;">int</span> max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #FF0000;">double</span> result <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF;">for</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> x <span style="color: #008000;">=</span> min<span style="color: #008000;">;</span> x <span style="color: #008000;">&lt;=</span> max<span style="color: #008000;">;</span> x<span style="color: #008000;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        result <span style="color: #008000;">+=</span> Math.<span style="color: #0000FF;">Pow</span><span style="color: #000000;">&#40;</span>x, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
     <span style="color: #000000;">&#125;</span>
     <span style="color: #0600FF;">return</span> result<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">static</span> <span style="color: #FF0000;">double</span> SquareOfSums<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> min, <span style="color: #FF0000;">int</span> max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #FF0000;">double</span> result <span style="color: #008000;">=</span> <span style="color: #FF0000;">0</span><span style="color: #008000;">;</span>
    <span style="color: #0600FF;">for</span><span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> x <span style="color: #008000;">=</span> min<span style="color: #008000;">;</span> x <span style="color: #008000;">&lt;=</span> max<span style="color: #008000;">;</span> x<span style="color: #008000;">++</span><span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
        result <span style="color: #008000;">+=</span> x<span style="color: #008000;">;</span>
    <span style="color: #000000;">&#125;</span>
    <span style="color: #0600FF;">return</span> Math.<span style="color: #0000FF;">Pow</span><span style="color: #000000;">&#40;</span>result, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p> Both of those functions are very straight forward. My first thought after writing these was, &#8220;Hey, why not use some LINQ?&#8221; So I did. Here is how the functions change:</p>
<p><br/></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">static</span> <span style="color: #FF0000;">double</span> LinqSumOfSquares<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> min, <span style="color: #FF0000;">int</span> max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">return</span> Enumerable.<span style="color: #0000FF;">Range</span><span style="color: #000000;">&#40;</span>min, max<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Select</span><span style="color: #000000;">&#40;</span>d <span style="color: #008000;">=&gt;</span> Math.<span style="color: #0000FF;">Pow</span><span style="color: #000000;">&#40;</span>d, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Sum</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>           
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">static</span> <span style="color: #FF0000;">double</span> LinqSquareOfSums<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> min, <span style="color: #FF0000;">int</span> max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">return</span> Math.<span style="color: #0000FF;">Pow</span><span style="color: #000000;">&#40;</span>Enumerable.<span style="color: #0000FF;">Range</span><span style="color: #000000;">&#40;</span>min, max<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Select</span><span style="color: #000000;">&#40;</span>d <span style="color: #008000;">=&gt;</span> d<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Sum</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>    
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p>Wow! Talk about incredible, shrinking functions! I love finding a way to make code more succinct, readable, and elegant and these changes seem to have hit the nail on the head! Anyways, that is basically all the pieces for the sequential algorithm. All you have to do is call each of those functions and take the difference. Simple, huh? But the real question is how can we parallelize these bad boys? I have a few thoughts.</p>
<ol>
<li>Call each function in parallel. In other words let the sumOfSquares and SquareOfSum function run at the same time in different threads.</li>
<li>Parallelize each function invidvidually. In other words  leverage the loops inside of each function in order to parallelize them.</li>
</ol>
<p>So let&#8217;s take a look at each method using the Parallel Extensions for .NET. The first method is calling each function in parallel. My first thought here was to use Parallel.Invoke in order to call each function at the same time. A little further research quickly revealed that Parallel.Invoke cannot return any values. My initial response to that: &#8220;Well that sucks.&#8221; Luckily there&#8217;s another class in the Parallel library called Futures. What&#8217;s a future? From <a href="http://www.devx.com/dotnet/Article/39204/1763/page/5">DevX</a> &#8211;<br />
<blockquote>&#8220;In TPL terms, a Future is basically a task that returns a value. It&#8217;s like a deferred function. You start it running and then use its value later. If the Future hasn&#8217;t finished calculating its value by the time you need it, it makes you wait while it finishes.&#8221; </p></blockquote>
<p>Sounds good to me. So how do we use futures? Like this:
</p>
<p><br/></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">static</span> <span style="color: #FF0000;">long</span> Problem6Futures<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> min, <span style="color: #FF0000;">int</span> max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
&nbsp;
    Future<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">double</span><span style="color: #008000;">&gt;</span> fSumOfSquares <span style="color: #008000;">=</span> Future.<span style="color: #0000FF;">Create</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=&gt;</span> SumOfSquares<span style="color: #000000;">&#40;</span>min, max<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    Future<span style="color: #008000;">&lt;</span><span style="color: #FF0000;">double</span><span style="color: #008000;">&gt;</span> fSquareOfSums <span style="color: #008000;">=</span> Future.<span style="color: #0000FF;">Create</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span> <span style="color: #008000;">=&gt;</span> SquareOfSums<span style="color: #000000;">&#40;</span>min, max<span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
    <span style="color: #FF0000;">double</span> result <span style="color: #008000;">=</span> fSquareOfSums.<span style="color: #0000FF;">Value</span> <span style="color: #008000;">-</span> fSumOfSquares.<span style="color: #0000FF;">Value</span><span style="color: #008000;">;</span>
&nbsp;
    <span style="color: #0600FF;">return</span> result<span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p> Easy, huh? All you have to remember is that Futures are deferred functions that return values. The result of  Future operation gets stored in an object of type Future<Type> and the value is stored in Object.Value. So how about the second method of parallelizing this algorithm? Well, it&#8217;s even easier because of PLINQ &#8211; or Parallel LINQ. Let&#8217;s see what it looks like.</p>
<p><br/></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;"><span style="color: #0600FF;">static</span> <span style="color: #FF0000;">double</span> ParallelSumOfSquares<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> min, <span style="color: #FF0000;">int</span> max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">return</span> Enumerable.<span style="color: #0000FF;">Range</span><span style="color: #000000;">&#40;</span>min, max<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">AsParallel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Select</span><span style="color: #000000;">&#40;</span>d <span style="color: #008000;">=&gt;</span> Math.<span style="color: #0000FF;">Pow</span><span style="color: #000000;">&#40;</span>d, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Sum</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span>
<span style="color: #0600FF;">static</span> <span style="color: #FF0000;">double</span> ParallelSquareOfSums<span style="color: #000000;">&#40;</span><span style="color: #FF0000;">int</span> min, <span style="color: #FF0000;">int</span> max<span style="color: #000000;">&#41;</span> <span style="color: #000000;">&#123;</span>
    <span style="color: #0600FF;">return</span> Math.<span style="color: #0000FF;">Pow</span><span style="color: #000000;">&#40;</span>Enumerable.<span style="color: #0000FF;">Range</span><span style="color: #000000;">&#40;</span>min, max<span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">AsParallel</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>.<span style="color: #0000FF;">Sum</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>, <span style="color: #FF0000;">2</span><span style="color: #000000;">&#41;</span><span style="color: #008000;">;</span>
<span style="color: #000000;">&#125;</span></pre></td></tr></table></div>

<p> Hah! Even easier! All that I did was add .AsParrallel() to our data. That tells LINQ to do the processing in parallel!</p>
<p>
So, there&#8217;s Project Euler Problem #6 for you. Was it a hard problem? Not really. Are you going to see major performance results through the parallelization of this algorithm? No. But you gotta&#8217; start somewhere when you&#8217;re learning how to parallelize algorithms using a new library. Today I used Futures and PLINQ and that sound&#8217;s like a pretty solid start to me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2009/07/01/project-euler-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Future of Web Pages</title>
		<link>http://www.parallelcoding.com/2009/06/11/the-future-of-web-pages/</link>
		<comments>http://www.parallelcoding.com/2009/06/11/the-future-of-web-pages/#comments</comments>
		<pubDate>Thu, 11 Jun 2009 15:46:40 +0000</pubDate>
		<dc:creator>Robert Green</dc:creator>
				<category><![CDATA[.NET]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Javascript]]></category>

		<guid isPermaLink="false">http://www.parallelcoding.com/?p=430</guid>
		<description><![CDATA[This morning I came across this jQuery library and it got me to thinking a little bit. All of the web sites that I currently have coded ( I don&#8217;t really do the design) tend to use .NET or PHP that is mashed up with some Javascript here and there. I&#8217;m wondering why we tend [...]]]></description>
			<content:encoded><![CDATA[<p>This morning I came across <a href="http://flowplayer.org/tools/performance.html">this</a> jQuery library and it got me to thinking a little bit. All of the web sites that I currently have coded ( I don&#8217;t really do the design) tend to use .NET or PHP that is mashed up with some Javascript here and there.</p>
<p><br/></p>
<p>I&#8217;m wondering why we tend to still use PHP and .NET except for things that are absolutely on the back end. Why would I use .NET or PHP to manipulate elements in a page when I can just use JavaScript?</p>
<p><br/></p>
<p>Maybe the web community should start developing pages that are JavaScript run and call PHP/.NET WebServices. That puts all the processing for display on the JS and all the data manipulation and retrieval where it should be &#8211; on the server.</p>
<p><br/></p>
<p>Any thoughts?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2009/06/11/the-future-of-web-pages/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Content-Disposition attachment vs inline</title>
		<link>http://www.parallelcoding.com/2008/05/30/content-disposition-attachment-vs-inline/</link>
		<comments>http://www.parallelcoding.com/2008/05/30/content-disposition-attachment-vs-inline/#comments</comments>
		<pubDate>Fri, 30 May 2008 16:46:03 +0000</pubDate>
		<dc:creator>manatarms</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[C#]]></category>

		<guid isPermaLink="false">http://dotanything.wordpress.com/?p=17</guid>
		<description><![CDATA[Today I ran into an interesting issue. We have some legacy code in .NET 1.1 that exports an HTML table to Microsoft Excel. This export occurs by simply rendering the table via Response.Write and setting the header content-disposition to &#8220;attachment; filename=FileName.xls&#8221;. The original code looked something like this: 1 2 3 4 5 6 7 [...]]]></description>
			<content:encoded><![CDATA[<p>Today I ran into an interesting issue. We have some legacy code in .NET 1.1 that exports an HTML table to Microsoft Excel. This export occurs by simply rendering the table via Response.Write and setting the header content-disposition to &#8220;attachment; filename=FileName.xls&#8221;. The original code looked something like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">Response.<span style="color: #0000FF;">Clear</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
Response.<span style="color: #0000FF;">AddHeader</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;content-disposition&quot;</span>, <span style="color: #666666;">&quot;attachment;filename=SalesByProductReport.xls&quot;</span><span style="color: #000000;">&#41;</span>
Response.<span style="color: #0000FF;">Charset</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;utf-8&quot;</span>
Response.<span style="color: #0000FF;">Cache</span>.<span style="color: #0000FF;">SetCacheability</span><span style="color: #000000;">&#40;</span>HttpCacheability.<span style="color: #0000FF;">NoCache</span><span style="color: #000000;">&#41;</span>
Response.<span style="color: #0000FF;">ContentType</span> <span style="color: #008000;">=</span> <span style="color: #666666;">&quot;application/vnd.ms-excel&quot;</span>
&nbsp;
Dim stringWrite <span style="color: #0600FF;">As</span> IO.<span style="color: #0000FF;">StringWriter</span> <span style="color: #008000;">=</span> <span style="color: #008000;">New</span> <span style="color: #000000;">System.<span style="color: #0000FF;">IO</span></span>.<span style="color: #0000FF;">StringWriter</span>
Dim htmlWrite <span style="color: #0600FF;">As</span> HtmlTextWriter <span style="color: #008000;">=</span> <span style="color: #008000;">New</span> HtmlTextWriter<span style="color: #000000;">&#40;</span>stringWrite<span style="color: #000000;">&#41;</span>
&nbsp;
tblTable.<span style="color: #0000FF;">RenderControl</span><span style="color: #000000;">&#40;</span>htmlWrite<span style="color: #000000;">&#41;</span>
&nbsp;
Response.<span style="color: #0000FF;">Write</span><span style="color: #000000;">&#40;</span>stringWrite.<span style="color: #0000FF;">ToString</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span><span style="color: #000000;">&#41;</span>
Response.<span style="color: #0000FF;">Flush</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span>
Response.<span style="color: #0000FF;">End</span><span style="color: #000000;">&#40;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p>The problem that occurred was that any user using Internet Explorer (surprise, surprise!) would get a prompt to download the file but the file would not download! The file worked properly in all other browsers. The solution is to change</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">Response.<span style="color: #0000FF;">AddHeader</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;content-disposition&quot;</span>, <span style="color: #666666;">&quot;attachment;filename=SalesByProductReport.xls&quot;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p>to</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="csharp" style="font-family:monospace;">Response.<span style="color: #0000FF;">AddHeader</span><span style="color: #000000;">&#40;</span><span style="color: #666666;">&quot;content-disposition&quot;</span>, <span style="color: #666666;">&quot;inline;filename=SalesByProductReport.xls&quot;</span><span style="color: #000000;">&#41;</span></pre></td></tr></table></div>

<p>Now, why exactly does this work? I&#8217;m not sure, so if you know please tell me.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2008/05/30/content-disposition-attachment-vs-inline/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>ASP .NET Nested Forms (Or why do I get the error &#8216;Invalid postack or callback argument&#8217;)</title>
		<link>http://www.parallelcoding.com/2008/03/07/asp-net-nested-forms-or-why-do-i-get-the-error-invalid-postack-or-callback-argument/</link>
		<comments>http://www.parallelcoding.com/2008/03/07/asp-net-nested-forms-or-why-do-i-get-the-error-invalid-postack-or-callback-argument/#comments</comments>
		<pubDate>Fri, 07 Mar 2008 16:57:25 +0000</pubDate>
		<dc:creator>manatarms</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP]]></category>

		<guid isPermaLink="false">http://dotanything.wordpress.com/?p=15</guid>
		<description><![CDATA[I have now come across a few situations where using nested forms in ASP .NET causes problems. The typical error produced in this case is a &#8216;Invalid postback or callback argument&#8217; error. This occurs because ASP .NET allows the rendering of multiple, nested forms but fails to validate the forms when a postback occurs. Thus [...]]]></description>
			<content:encoded><![CDATA[<p class="MsoNormal">I have now come across a few situations where using nested forms in ASP .NET causes problems. The typical error produced in this case is a &#8216;Invalid postback or callback argument&#8217; error. This occurs because ASP .NET allows the rendering of multiple, nested forms but fails to validate the forms when a postback occurs. Thus when ASP .NET recognizes nested forms in a page, it marks the page as not valid (Page.IsValid returns false).</p>
<p class="MsoNormal">The reason that this error occurs is because multiple, nested forms cannot reside on a single aspx page .</p>
<p class="MsoNormal">The solution is very simple: The submit button for the user created form must contain the following attribute: onclick=&#8221;this.form.submit();&#8221;. A recent example I came across is below. The basic form that was developed and placed inside an aspx page as a nested form was as follows (only the beginning and ending of this form is shown. The content is not necessary or relevant):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;form accept-charset=&quot;UTF-8&quot; action=&quot;http://www.response-o-matic.com/mail.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
&lt;table&gt;
&lt;tbody&gt;
...
&lt;tr&gt;
&lt;td colspan=&quot;2&quot; align=&quot;center&quot;&gt;
&lt;input value=&quot;Submit Form&quot; type=&quot;submit&quot; /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/form&gt;</pre></td></tr></table></div>

<p class="MsoNormal">The following code demonstrates the proper way of entering this form so that nested forms will work. Please note that I reiterated all of the attributes (action, method, enctype, etc&#8230;) of the form<span> </span>in the JavaScript call.</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;form accept-charset=&quot;UTF-8&quot; action=&quot;http://www.response-o-matic.com/mail.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
&lt;table&gt;
&lt;tbody&gt;
...
&lt;tr&gt;
&lt;td&gt;
&lt;input onclick=&quot;this.form.action='http://www.response-o-matic.com/mail.php'; this.form.method='post';this.form.enctype='multipart/form-data';this.form.submit();&quot; value=&quot; Submit Form &quot; type=&quot;submit&quot; /&gt;
&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/form&gt;</pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2008/03/07/asp-net-nested-forms-or-why-do-i-get-the-error-invalid-postack-or-callback-argument/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>SEO 301 Redirects for ASP .NET 1.1</title>
		<link>http://www.parallelcoding.com/2008/02/26/seo-301-redirects-for-asp-net-11/</link>
		<comments>http://www.parallelcoding.com/2008/02/26/seo-301-redirects-for-asp-net-11/#comments</comments>
		<pubDate>Tue, 26 Feb 2008 22:44:03 +0000</pubDate>
		<dc:creator>manatarms</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP]]></category>

		<guid isPermaLink="false">http://dotanything.wordpress.com/?p=14</guid>
		<description><![CDATA[I recently worked on a project where any URL following the form of http://www.mydomain.com/subDomain/Default.aspx needed to 301 redirect to http://www.mydomain.com/subDomain/. Basically this calls for stripping the &#8216;Default.aspx&#8217; off of any request that has it. The project was to be completed using Visual Basic .NET 1.1. The solution is  is to add a few lines of [...]]]></description>
			<content:encoded><![CDATA[<p>I recently worked on a project where any URL following the form of http://www.mydomain.com/subDomain/Default.aspx needed to 301 redirect to http://www.mydomain.com/subDomain/. Basically this calls for stripping the &#8216;Default.aspx&#8217; off of any request that has it. The project was to be completed using Visual Basic .NET 1.1.</p>
<p>The solution is  is to add a few lines of code in the Global.asax.vb file inside of the  <span style="color: #0000ff;">Sub</span> Application_BeginRequest(<span style="color: #0000ff;">ByVal </span>sender <span style="color: #0000ff;">As Object</span>, ByVal e <span style="color: #0000ff;">As </span>EventArgs) function. The final product looks like this:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
</pre></td><td class="code"><pre class="vb" style="font-family:monospace;"><span style="color: #000080;">Sub</span> Application_BeginRequest(<span style="color: #000080;">ByVal</span> sender <span style="color: #000080;">As</span> <span style="color: #000080;">Object</span>, <span style="color: #000080;">ByVal</span> e AsEventArgs)
    <span style="color: #000080;">Dim</span> oPath <span style="color: #000080;">As</span> <span style="color: #000080;">String</span> = Request.CurrentExecutionFilePath.ToLower
    <span style="color: #000080;">If</span> <span style="color: #000080;">Not</span> oPath.EndsWith(<span style="color: #800000;">&quot;default.aspx&quot;</span>) <span style="color: #000080;">Then</span> Return
&nbsp;
    Response.Status = <span style="color: #800000;">&quot;301 Moved Permanently&quot;</span>
    Response.AddHeader(<span style="color: #800000;">&quot;Location&quot;</span>, <span style="color: #800000;">&quot;http://www.myDomain.com&quot;</span> +  
    oPath.Substring(0, oPath.IndexOf(<span style="color: #800000;">&quot;default.aspx&quot;</span>)))
&nbsp;
<span style="color: #000080;">End</span> <span style="color: #000080;">Sub</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2008/02/26/seo-301-redirects-for-asp-net-11/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Debugging .NET 1.1 With Visual Studio 2003 on Windows XP x64</title>
		<link>http://www.parallelcoding.com/2008/01/24/debugging-net-11-with-visual-studio-2003-on-windows-xp-x64/</link>
		<comments>http://www.parallelcoding.com/2008/01/24/debugging-net-11-with-visual-studio-2003-on-windows-xp-x64/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 20:54:29 +0000</pubDate>
		<dc:creator></dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[Visual Studio]]></category>

		<guid isPermaLink="false">http://dotanything.wordpress.com/2008/01/24/debuggin-net-11-with-visual-studio-2003-on-windows-xp-x64/</guid>
		<description><![CDATA[In order to debug .NET 1.1 properly, it is necessary to uninstall the .NET 2.0 framework when you want to debug. The command to uninstall is: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_regiis.exe -u The command to reinstall when your are done is: C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_regiis.exe -i]]></description>
			<content:encoded><![CDATA[<p>In order to debug .NET 1.1 properly, it is necessary to uninstall the .NET 2.0 framework when you want to debug. The command to uninstall is:</p>
<pre language="DOS">
C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_regiis.exe -u
</pre>
<p>The command to reinstall when your are done is:</p>
<p>C:WINDOWSMicrosoft.NETFrameworkv2.0.50727aspnet_regiis.exe -i</p>
]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2008/01/24/debugging-net-11-with-visual-studio-2003-on-windows-xp-x64/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Upload Large Files in ASP.NET</title>
		<link>http://www.parallelcoding.com/2007/12/03/upload-large-files-in-aspnet/</link>
		<comments>http://www.parallelcoding.com/2007/12/03/upload-large-files-in-aspnet/#comments</comments>
		<pubDate>Tue, 04 Dec 2007 00:43:00 +0000</pubDate>
		<dc:creator>manatarms</dc:creator>
				<category><![CDATA[Web Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[ASP]]></category>

		<guid isPermaLink="false">http://dotanything.wordpress.com/2007/12/03/upload-large-files-in-aspnet/</guid>
		<description><![CDATA[Here&#8217;s the simple solution to uploading large files in ASP .net. Add a new key in the web.config. The fileSize (maxRequestLength) is in kilobytes with a default size of 4. The key to add is 1 &#60;httpRuntime maxRequestLength=&#34;2000000&#34;/&#62;]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s the simple solution to uploading large files in ASP .net.</p>
<p>Add a new key in the web.config. The fileSize (maxRequestLength) is in kilobytes with a default size of 4.</p>
<p>The key to add is</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;httpRuntime</span> <span style="color: #000066;">maxRequestLength</span>=<span style="color: #ff0000;">&quot;2000000&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://www.parallelcoding.com/2007/12/03/upload-large-files-in-aspnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
