<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://weblogs.asp.net/utility/FeedStylesheets/atom.xsl" media="screen"?><feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en"><title type="html">Johan Danforth's Blog</title><subtitle type="html">Yet another blog by yet another .NET coder...</subtitle><id>http://weblogs.asp.net/jdanforth/atom.aspx</id><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/default.aspx" /><link rel="self" type="application/atom+xml" href="http://weblogs.asp.net/jdanforth/atom.aspx" /><generator uri="http://communityserver.org" version="3.0.20510.895">Community Server</generator><updated>2008-06-04T14:29:42Z</updated><entry><title>The Touch Wall Demonstration by Bill Gates</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/08/20/the-touch-wall-demonstration-by-bill-gates.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/08/20/the-touch-wall-demonstration-by-bill-gates.aspx</id><published>2008-08-20T08:41:34Z</published><updated>2008-08-20T08:41:34Z</updated><content type="html">&lt;p&gt;This video has been around for a few months now, but it's still cool. It's not one of Bill's better demos as he's kind of standing in the way of the screen all the time, but it still shows off the Touch Wall/Surface capabilities pretty well. I'm sure we'll see something like this in class rooms and larger meeting rooms in the future. It's easy to learn to use, but the presenter will have to learn how move on the podium as well as work with the presentation and give the talk. Interesting... what do you think?&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p align="center"&gt;&lt;span style="display: none"&gt;&amp;#160;&lt;/span&gt;&lt;embed pluginspage="http://www.macromedia.com/go/getflashplayer" src="http://images.video.msn.com/flash/soapbox1_1.swf" width="432" height="364" type="application/x-shockwave-flash" wmode="opaque" quality="high" base="http://images.video.msn.com" flashvars="c=v&amp;amp;v=ec39a94b-ce15-434b-802b-64de4d8ebb99&amp;amp;ifs=true&amp;amp;fr=msnvideo&amp;amp;mkt=sv-SE&amp;amp;brand=" allowscriptaccess="never" allownetworking="internal" /&gt;     &lt;br /&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The video sequence is from the &lt;a href="http://www.microsoft.com/presspass/events/ceosummit/default.mspx" target="_blank"&gt;Microsoft CEO Summit 2008&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6541807" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="Office" scheme="http://weblogs.asp.net/jdanforth/archive/tags/Office/default.aspx" /></entry><entry><title>Microsoft Save as PDF or XPS Add-in for Office 2007</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/08/20/microsoft-save-as-pdf-or-xps-add-in-for-office-2007.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/08/20/microsoft-save-as-pdf-or-xps-add-in-for-office-2007.aspx</id><published>2008-08-20T08:10:00Z</published><updated>2008-08-20T08:10:00Z</updated><content type="html">&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/MicrosoftSaveasPDForXPSAddinforOffice200_8EF4/Office_2.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="62" alt="Office" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/MicrosoftSaveasPDForXPSAddinforOffice200_8EF4/Office_thumb.jpg" width="163" align="right" border="0" /&gt;&lt;/a&gt;I must be daft, I completely missed this &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=4D951911-3E7E-4AE6-B059-A2E79ED87041&amp;amp;displaylang=en" target="_blank"&gt;free add-in from Microsoft to be able to save as PDF&lt;/a&gt; (and XPS) for Office 2007. It's been around for years... duh.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;This download allows you to export and save to the PDF and XPS formats in eight 2007 Microsoft Office programs. It also allows you to send as e-mail attachment in the PDF and XPS formats in a subset of these programs.&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6541765" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="Office" scheme="http://weblogs.asp.net/jdanforth/archive/tags/Office/default.aspx" /></entry><entry><title>Excel Automation - Example with Named Ranges</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/08/18/excel-automation-example-with-named-ranges.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/08/18/excel-automation-example-with-named-ranges.aspx</id><published>2008-08-18T14:43:56Z</published><updated>2008-08-18T14:43:56Z</updated><content type="html">&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/ExcelAutomationExamplewithNamedRanges_EB35/excel.jpg"&gt;&lt;img style="border-right: 0px; border-top: 0px; margin: 5px; border-left: 0px; border-bottom: 0px" height="144" alt="excel" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/ExcelAutomationExamplewithNamedRanges_EB35/excel_thumb.jpg" width="142" align="right" border="0" /&gt;&lt;/a&gt; And now to something completely different... the Excel automation. Every now and then you need to open up an Excel file and do stuff with it. In this case we needed to create and read from named ranges in Excel, and it's not overy easy to get information about how to do that, so I thought I might as well post some sample code here.&lt;/p&gt;  &lt;p&gt;To get started with Excel automation, there is a good KB-article on MSDN: &lt;a href="http://support.microsoft.com/kb/q302094" target="_blank"&gt;http://support.microsoft.com/kb/q302094&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Now, here's a console app in .NET 3.5 using VB.NET (I prefer to work with VB.NET with Office Interop and VSTO), which opens Excel, adds a new workbook, creates a (3,5) string array with values, fills the a range with these values, creates a named range and gets the values again to see that it worked properly. &lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;Imports&lt;/span&gt; Microsoft.Office.Interop

&lt;span style="color: rgb(0,0,255)"&gt;Module&lt;/span&gt; Module1

    &lt;span style="color: rgb(0,0,255)"&gt;Sub&lt;/span&gt; Main()
        &lt;span style="color: rgb(0,0,255)"&gt;Dim&lt;/span&gt; application = &lt;span style="color: rgb(0,0,255)"&gt;New&lt;/span&gt; Excel.Application
        application.Visible = &lt;span style="color: rgb(0,0,255)"&gt;True
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;Dim&lt;/span&gt; workbook = application.Workbooks.Add()
        &lt;span style="color: rgb(0,0,255)"&gt;Dim&lt;/span&gt; worksheet &lt;span style="color: rgb(0,0,255)"&gt;As&lt;/span&gt; Excel._Worksheet = workbook.ActiveSheet

        &lt;span style="color: rgb(0,0,255)"&gt;Dim&lt;/span&gt; saRet(3, 5) &lt;span style="color: rgb(0,0,255)"&gt;As&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;String

&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;For&lt;/span&gt; iRow = 0 &lt;span style="color: rgb(0,0,255)"&gt;To&lt;/span&gt; 3
            &lt;span style="color: rgb(0,0,255)"&gt;For&lt;/span&gt; iCol = 0 &lt;span style="color: rgb(0,0,255)"&gt;To&lt;/span&gt; 5
                saRet(iRow, iCol) = iRow.ToString() + &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;|&amp;quot;&lt;/span&gt; + iCol.ToString()
            &lt;span style="color: rgb(0,0,255)"&gt;Next&lt;/span&gt; iCol
        &lt;span style="color: rgb(0,0,255)"&gt;Next&lt;/span&gt; iRow&lt;br /&gt;
        &lt;span style="color: rgb(0,128,0)"&gt;'get a range, alternative 1
&lt;/span&gt;        &lt;span style="color: rgb(0,128,0)"&gt;'Dim range As Excel.Range = worksheet.Range(&amp;quot;A1:E3&amp;quot;, Reflection.Missing.Value)

&lt;/span&gt;        &lt;span style="color: rgb(0,128,0)"&gt;'get a range, alternative 2
&lt;/span&gt;        &lt;span style="color: rgb(0,0,255)"&gt;Dim&lt;/span&gt; range &lt;span style="color: rgb(0,0,255)"&gt;As&lt;/span&gt; Excel.Range = worksheet.Range(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;A1&amp;quot;&lt;/span&gt;, Reflection.Missing.Value)
        range = range.Resize(3, 5)

        &lt;span style="color: rgb(0,128,0)"&gt;'set value of range to that of the string array
&lt;/span&gt;        range.Value = saRet
        &lt;span style="color: rgb(0,128,0)"&gt;'name the range, explicitly (using dollar $ sign)
&lt;/span&gt;        workbook.Names.Add(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;NamedRange&amp;quot;&lt;/span&gt;, &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;=$A$1:$E$3&amp;quot;&lt;/span&gt;)&lt;br /&gt;
        &lt;span style="color: rgb(0,128,0)"&gt;'clear range
&lt;/span&gt;        range = &lt;span style="color: rgb(0,0,255)"&gt;Nothing
&lt;/span&gt;        &lt;span style="color: rgb(0,128,0)"&gt;'get the values of the named range
&lt;/span&gt;        range = worksheet.Range(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;NamedRange&amp;quot;&lt;/span&gt;)
        &lt;span style="color: rgb(0,0,255)"&gt;Dim&lt;/span&gt; values(,) &lt;span style="color: rgb(0,0,255)"&gt;As&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;Object&lt;/span&gt; = range.Value
        Console.WriteLine(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;rows:&amp;quot;&lt;/span&gt; &amp;amp; values.GetUpperBound(0))
        Console.WriteLine(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;cols:&amp;quot;&lt;/span&gt; &amp;amp; values.GetUpperBound(1))
        Console.WriteLine(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;value of row 2, column 4 (D4) = &amp;quot;&lt;/span&gt; &amp;amp; values(2, 4))

        Console.WriteLine(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;Press key to exit...&amp;quot;&lt;/span&gt;)
        Console.Read()
        workbook.Close(&lt;span style="color: rgb(0,0,255)"&gt;False&lt;/span&gt;)
        application.Quit()
    &lt;span style="color: rgb(0,0,255)"&gt;End&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;Sub

End&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;Module
&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Hope this helps someone.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6534967" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="Office" scheme="http://weblogs.asp.net/jdanforth/archive/tags/Office/default.aspx" /></entry><entry><title>Totally Off Topic - Swedish Rune Stones From the Viking Age</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/08/16/totally-off-topic-swedish-rune-stones-from-the-viking-age.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/08/16/totally-off-topic-swedish-rune-stones-from-the-viking-age.aspx</id><published>2008-08-16T20:19:00Z</published><updated>2008-08-16T20:19:00Z</updated><content type="html">&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/DSC00378_1.jpg" mce_href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/DSC00378_1.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 5px; BORDER-RIGHT-WIDTH: 0px" height=200 alt=Ölsastenen src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/DSC00378_thumb_1.jpg" width=260 align=right border=0 mce_src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/DSC00378_thumb_1.jpg"&gt;&lt;/A&gt; This is totally off topic from the things I usually write about, but I thought I might show some pictures of a few beautiful rune stones we have scattered around not far from where we live (&lt;A href="http://en.wikipedia.org/wiki/Botkyrka" target=_blank mce_href="http://en.wikipedia.org/wiki/Botkyrka"&gt;Botkyrka&lt;/A&gt;, southern part of Stockholm, Sweden) and tell you something about this particular type of landmark the &lt;A href="http://en.wikipedia.org/wiki/Viking" target=_blank mce_href="http://en.wikipedia.org/wiki/Viking"&gt;Vikings&lt;/A&gt; left us. My knowledge of rune stones and runic inscriptions are minimal and I may get some info slightly wrong here, so bear with me :) I'm sure Wikipedia got tons of info on the topic if you hunger for more.&lt;/P&gt;
&lt;P&gt;The typical rune stone is a raised stone with runic inscriptions on it, but it also happens that you run across runes inscribed on bedrocks. It seems that the main purpose of these stones where to mark important events, explain inheritance, boast about the construction of a bridge or a road and very often to bring glory to kinsmen who travelled far and (quite often) died in foreign lands. Most rune stones are located in Scandinavia (Sweden, Norway, Denmark, Iceland), but there are also a few in locations where the Scandinavians of that time (mostly Norsemen) went, like England, Greenland and Ireland.&lt;/P&gt;
&lt;P&gt;What's so cool is that most of these stones were carved and erected during the Viking Age (from around year 790 to 1100), and thousands of these stones still stand where they were erected more than a thousand years ago. Some stones have been moved from where they were first found to a place close nearby where they are more accessible to folks who are interested in them. Through the years stones have been destroyed by construction, stolen by collectors and damaged by air pollution but still there are over 6.000 registered rune stones or fragments of them around, most of them (over 3.000) are located in Sweden, and most of those in the province of &lt;A href="http://en.wikipedia.org/wiki/Uppland" target=_blank mce_href="http://en.wikipedia.org/wiki/Uppland"&gt;Uppland&lt;/A&gt; on the eastern coast of Sweden, just north of Stockholm.&lt;/P&gt;
&lt;P&gt;In Sweden, most of the stones are kept in a healthy state and looked after by a state organization. These people remove lichen and sometimes paint the runes with red paint, which is believed to be the most common color used. There are stories of runes being reddened by blood, but that's probably just that - stories. The rune stone above to the right is called "Ölsastenen", found in Uppland but moved to &lt;A href="http://en.wikipedia.org/wiki/Skansen" target=_blank mce_href="http://en.wikipedia.org/wiki/Skansen"&gt;Skansen&lt;/A&gt;, an open air museum and zoo located in the middle of Stockholm. It is painted in (probably) authentic manner. That picture I took with my mobile camera, so the quality is quite bad. &lt;/P&gt;
&lt;P&gt;If you ever visit Stockholm and want to see a few rune stones, &lt;A href="http://en.wikipedia.org/wiki/Skansen" target=_blank mce_href="http://en.wikipedia.org/wiki/Skansen"&gt;Skansen&lt;/A&gt; is probably the easiest place to go. &lt;/P&gt;
&lt;P&gt;The alphabet used on most of stones around where we live is the one called The Younger Futhark which consists of 16 characters:&lt;/P&gt;
&lt;P&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; BORDER-RIGHT-WIDTH: 0px" height=72 alt="younger futhark" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/futhark_6.png" width=260 border=0 mce_src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/futhark_6.png"&gt;&lt;/P&gt;
&lt;P&gt;Some experts are so skilled in this language, they can read it right off the stones if the runes are clear enough to read. What may be interesting to know is that the English language borrowed hundreds of words from the language spoken by the Vikings of this age, Old Norse. The Scandinavian words were introduced during the Viking invasion of England in the 9th and 10th century. It's easy to recognize some of the words written on the rune stones in both the English and Swedish language. For example, the Viking word &lt;EM&gt;faþur&lt;/EM&gt;, means &lt;EM&gt;father&lt;/EM&gt; which is &lt;EM&gt;fader&lt;/EM&gt; in Swedish. There are many, many other examples of old, basic words which are similar in English and Swedish. Now, I think that Old English and Old Norse were derived from the same Germanic language, so it may be that the word &lt;EM&gt;father&lt;/EM&gt; came from there, but it's still cool. I've read somewhere that Scandinavian "businessmen" visiting the British islands could make themselves understood quite well, even without screaming and raised swords... &lt;/P&gt;
&lt;P&gt;Most of the rune stones in the Uppland area have a Christian cross carved into them, showing they were of the Christian faith or supported a Christian king.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0099.jpg" mce_href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0099.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 5px; BORDER-RIGHT-WIDTH: 0px" height=260 alt=Hamra src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0099_thumb.jpg" width=200 border=0 mce_src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0099_thumb.jpg"&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;This picture I took with a somewhat better camera and show the stone at Hamra (Sö 289). It reads "Björn and Holm--- erected this stone after Kättilbjörn, their --- God help the soul". Some carvings cannot be clearly read as you can see.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/IMG_6310_2.jpg" mce_href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/IMG_6310_2.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 5px; BORDER-RIGHT-WIDTH: 0px" height=260 alt="Uringe, Grödinge" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/IMG_6310_thumb.jpg" width=180 border=0 mce_src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/IMG_6310_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;This is the stone at Uringe (Sö 298) and reads "Håur and Karl and Sighjälm and Vihjälm and Kåre erected this stone after Vigmar, their father". How nice of them! The stone is over 1000 years old.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0106.jpg" mce_href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0106.jpg"&gt;&lt;IMG style="BORDER-TOP-WIDTH: 0px; BORDER-LEFT-WIDTH: 0px; BORDER-BOTTOM-WIDTH: 0px; MARGIN: 5px; BORDER-RIGHT-WIDTH: 0px" height=200 alt=Uttran src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0106_thumb.jpg" width=260 border=0 mce_src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0106_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;To get an understanding of the size of some of these stones, here's a picture of the stone at Uttran (Sö 305) and myself. The picture is taken by my son Pontus and a rune stone excursion we did earlier this summer. This stone was erected by two brothers and reads "Sibbe and Tjarve erected this stone after Torkel their father". &lt;/P&gt;
&lt;P&gt;&lt;A href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0094.jpg" mce_href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0094.jpg"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN: 5px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=200 alt=Glömsta src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0094_thumb.jpg" width=260 border=0 mce_src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0094_thumb.jpg"&gt;&lt;/A&gt; &lt;A href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0092.jpg" mce_href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0092.jpg"&gt;&lt;IMG style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; MARGIN: 5px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" height=200 alt=Glömsta src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0092_thumb.jpg" width=260 border=0 mce_src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OffTopicSwedishRuneStonesFromtheVikingAg_9D85/PICT0092_thumb.jpg"&gt;&lt;/A&gt; &lt;/P&gt;
&lt;P&gt;The pictures above show the bedrock carvings in Glömsta (Sö 300), just 5 minutes from where we live. This rune stone is a bit special because it's dedicated to a mother: "Sverker built the bridge after Ärengunn, his good mother". The bridge Sverker mentions is probably not a bridge over water, but rather improvement of the (what is believed to be an important) road that passed by this very place. So to honor his mother, perhaps he inherited lands from her, Sverker had this road improved and let everyone that used it read about this. 1000 years ago. I know, it's not like wall paintings in pyramids, but still cool.&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6527355" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author></entry><entry><title>My Toolbelt</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/08/15/my-toolbelt.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/08/15/my-toolbelt.aspx</id><published>2008-08-15T09:46:00Z</published><updated>2008-08-15T09:46:00Z</updated><content type="html">&lt;P&gt;&lt;IMG style="MARGIN: 5px" height=213 alt=Toolbelt src="http://www.charlesandhudson.com/archives/toolbelt.jpg" width=330 align=right border=0 mce_src="http://www.charlesandhudson.com/archives/toolbelt.jpg"&gt;My friend &lt;A href="http://janerikohman.wordpress.com/" target=_blank mce_href="http://janerikohman.wordpress.com/"&gt;Jan-Erik&lt;/A&gt; told me he was about to write a blog page about good tools he is currently using, so I thought I might just do the same. I like my machine clean, so if I'm not using a program or tool for some time, it's out. I'm not listing the most obvious tools and programs from Microsoft (word, vs etc.), but these tools I use frequently and they help me do my work as a developer and software architect, so in no particular order:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://get.live.com/writer/overview" target=_blank mce_href="http://get.live.com/writer/overview"&gt;Windows Live Writer&lt;/A&gt; - a wonderful tool from Microsoft for writing and managing your blog posts. I'm using it now and will probably use it for a very, very long time. It's that good.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.snapfiles.com/get/cropper.html" target=_blank mce_href="http://www.snapfiles.com/get/cropper.html"&gt;Cropper&lt;/A&gt; - a superb screen capture utility by &lt;A href="http://www.snapfiles.com/publishers/brian-scott/index.html" target=_blank mce_href="http://www.snapfiles.com/publishers/brian-scott/index.html"&gt;Brian Scott&lt;/A&gt;. It's small, neat and looks great too :)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.utorrent.com/" target=_blank mce_href="http://www.utorrent.com"&gt;µTorrent&lt;/A&gt; - a pretty good bit-torrent client that just works. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.fiddlertool.com/fiddler/" target=_blank mce_href="http://www.fiddlertool.com/fiddler/"&gt;Fiddler&lt;/A&gt; - web debugger by Microsoft (written by Eric Lawrence I believe) that will help any developer who's into AJAX, REST, ASMX, WCF, plain HTML or whatever project that involves sending stuff over HTTP. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.getpaint.net/" target=_blank mce_href="http://www.getpaint.net/"&gt;Paint.NET&lt;/A&gt; - not as good as Photoshop, but not far from it and free! Written in .NET, this wonderful program gets new features every week it seems. Was #19 on PC World &lt;A href="http://www.pcworld.com/article/id,131925-page,19-c,electronics/article.html" target=_blank mce_href="http://www.pcworld.com/article/id,131925-page,19-c,electronics/article.html"&gt;"Top 100 Products of 2007"&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://foxitsoftware.com/pdf/rd_intro.php" target=_blank mce_href="http://foxitsoftware.com/pdf/rd_intro.php"&gt;Foxit Reader&lt;/A&gt; - a light weight, free, alternative to Adobe Reader for reading (and annotating) pdf files. I wish I could replace all programs from Adobe like this, man how I hate the extra junk Adobe installs on my machine. I just want to be able to read PDF files... same call goes to HP while I'm at comapnies that install "things" that bogs down the startup of my laptop.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://toolbar.google.com/gmail-helper/notifier_windows.html" target=_blank mce_href="http://toolbar.google.com/gmail-helper/notifier_windows.html"&gt;Gmail Notifier&lt;/A&gt; - I don't use Gmail alot, sometimes I'm not in there for over a week or two, so a notifier is required or I'll miss some important message. This notifier is not great, but it works (most of the time). Thinking of boiling my own notifier or just jack Gmail into Outlook...&lt;/P&gt;
&lt;P&gt;&lt;A href="http://tortoisesvn.tigris.org/" target=_blank mce_href="http://tortoisesvn.tigris.org/"&gt;TortoiseSVN&lt;/A&gt; - the "The coolest Interface to (Sub)Version Control". I use this to get open source projects, like IronRuby and ASP.NET MVC. The Windows Explorer integration is really nice.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://francis.dupont.free.fr/truedownloader/" target=_blank mce_href="http://francis.dupont.free.fr/truedownloader/"&gt;TrueDownloader&lt;/A&gt; - open source download manager I've been using for a while now. As with uTorrent above, there are loads of download managers out there, but this one works and has no banners or ads.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://www.foldershare.com/welcome.aspx" target=_blank mce_href="https://www.foldershare.com/welcome.aspx"&gt;FolderShare&lt;/A&gt; - from Microsoft, and it's &lt;STRONG&gt;one of the coolest free tools you can get your hands on&lt;/STRONG&gt;. Keep files in sync across your computers, share folders with friends and access your files from any computer. And it works :) If you haven't used this program yet, give it a try. I use it to backup source code and documents between 3 computers. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.daemon-tools.cc/" target=_blank mce_href="http://www.daemon-tools.cc/"&gt;Daemon Tools&lt;/A&gt; - 'nuf said!&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;Developer Specific Tools and Addins&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;I thought I'll go through the more developer specific tools and addins in a separate list, so here goes:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.ultrapico.com/ExpressoDownload.htm" target=_blank mce_href="http://www.ultrapico.com/ExpressoDownload.htm"&gt;Expresso&lt;/A&gt; - a powerful tool to help you write regular expressions. Requires a registration code after 60 days, but it's free.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.nunit.org/index.php" target=_blank mce_href="http://www.nunit.org/index.php"&gt;NUnit&lt;/A&gt; - one of the most frequently used unit test frameworks for .NET out there. &lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.postsharp.org/" target=_blank mce_href="http://www.postsharp.org/"&gt;PostSharp&lt;/A&gt; - an aspect oriented programming "weaver" for .NET which plugs in to visual studio and MSBuild. PostSharp is a great tool for doing AOP weaving in .NET, if you need it that is. Read up on AOP before you go there, most times there are other options.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.jetbrains.com/resharper/index.html" target=_blank mce_href="http://www.jetbrains.com/resharper/index.html"&gt;ReSharper&lt;/A&gt; - the number one addin to VisualStudio ever written. If you're a c# or vb.net developer, this is the one tool you should learn to use. There is so much to say about this work of art from the JetBrains, but it makes you way more productive and it helps you become a better programmer.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.roland-weigelt.de/ghostdoc/" target=_blank mce_href="http://www.roland-weigelt.de/ghostdoc/"&gt;GhostDoc&lt;/A&gt; - addin for VisualStudio by Roland Weigelt which tries to automatically generate XML documentation comments. No block buster, but it's cute :)&lt;/P&gt;
&lt;P&gt;&lt;A href="http://code.google.com/p/moq/" target=_blank mce_href="http://code.google.com/p/moq/"&gt;Moq&lt;/A&gt; - a mocking library for .NET which takes good advantage of .NET 3.5 with linq- and lambda expressions. My mock library of choise!&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.microsoft.com/technet/scriptcenter/topics/msh/download.mspx" target=_blank mce_href="http://www.microsoft.com/technet/scriptcenter/topics/msh/download.mspx"&gt;PowerShell&lt;/A&gt; and &lt;A href="http://thepowershellguy.com/blogs/posh/pages/powertab.aspx" target=_blank mce_href="http://thepowershellguy.com/blogs/posh/pages/powertab.aspx"&gt;PowerTab&lt;/A&gt; - if you're a powershell user and also a .NET developer, make sure you install powertab by Marc van Orsouw (the powershell guy), which is an extension to powershell that gives you tab-expansion for the .NET library. To get an understanding of the power (heh) of this, check out &lt;A class="" href="http://www.dnrtv.com/default.aspx?showNum=82" target=_blank mce_href="http://www.dnrtv.com/default.aspx?showNum=82"&gt;this DNR-TV episode with Scott Hanselman&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.aisto.com/roeder/dotnet/" target=_blank mce_href="http://www.aisto.com/roeder/dotnet/"&gt;Reflector&lt;/A&gt; - aw, you know this one already! This is a now legendary tool by Lutz Roeder.&lt;/P&gt;
&lt;P&gt;&lt;FONT size=1&gt;Note: the toolbelt image is a &lt;/FONT&gt;&lt;A href="http://www.charlesandhudson.com/archives/2007/01/leather_toolbelts.htm" target=_blank mce_href="http://www.charlesandhudson.com/archives/2007/01/leather_toolbelts.htm"&gt;&lt;FONT size=1&gt;leather toolbelt from Charles &amp;amp; Hudson&lt;/FONT&gt;&lt;/A&gt;&lt;FONT size=1&gt; that I just thought looked great&lt;/FONT&gt;&lt;/P&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6521950" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="Tools" scheme="http://weblogs.asp.net/jdanforth/archive/tags/Tools/default.aspx" /></entry><entry><title>More on RESTful Service with WCF and POX/POCO</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/08/09/more-on-restful-service-with-wcf-and-pox-poco.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/08/09/more-on-restful-service-with-wcf-and-pox-poco.aspx</id><published>2008-08-09T13:55:20Z</published><updated>2008-08-09T13:55:20Z</updated><content type="html">&lt;p&gt;Kirk Eveans wrote a blog post about &lt;a href="http://blogs.msdn.com/kaevans/archive/2008/04/03/creating-restful-services-using-wcf.aspx" target="_blank"&gt;Creating RESTful Services Using WCF&lt;/a&gt;, which gives youa good understanding about how go get started with REST on WCF. In his sample, Kirk has 2 methods in his REST interface:&lt;/p&gt;  &lt;pre class="code"&gt;[&lt;span style="color: rgb(43,145,175)"&gt;ServiceContract&lt;/span&gt;]
&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;interface&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;IService
&lt;/span&gt;{
    [&lt;span style="color: rgb(43,145,175)"&gt;OperationContract&lt;/span&gt;]
    [&lt;span style="color: rgb(43,145,175)"&gt;WebGet&lt;/span&gt;(UriTemplate = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;customers/{id}&amp;quot;&lt;/span&gt;)]
    &lt;span style="color: rgb(43,145,175)"&gt;Customer&lt;/span&gt; GetCustomer(&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; id);

    [&lt;span style="color: rgb(43,145,175)"&gt;OperationContract&lt;/span&gt;]
    [&lt;span style="color: rgb(43,145,175)"&gt;WebInvoke&lt;/span&gt;(UriTemplate = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;customers&amp;quot;&lt;/span&gt;)]
    &lt;span style="color: rgb(43,145,175)"&gt;Customer&lt;/span&gt; PostCustomer(&lt;span style="color: rgb(43,145,175)"&gt;Customer&lt;/span&gt; c);
}&lt;/pre&gt;

&lt;p&gt;The Data Contract for Customer looks like this:&lt;/p&gt;

&lt;pre class="code"&gt;[&lt;span style="color: rgb(43,145,175)"&gt;DataContract&lt;/span&gt;(Namespace = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;&amp;quot;&lt;/span&gt;)]
&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Customer
&lt;/span&gt;{
    [&lt;span style="color: rgb(43,145,175)"&gt;DataMember&lt;/span&gt;]
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; ID { &lt;span style="color: rgb(0,0,255)"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(0,0,255)"&gt;set&lt;/span&gt;; }
    [&lt;span style="color: rgb(43,145,175)"&gt;DataMember&lt;/span&gt;]
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; Name { &lt;span style="color: rgb(0,0,255)"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(0,0,255)"&gt;set&lt;/span&gt;; }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Kirk also describes how to use the &lt;a href="http://www.fiddlertool.com" target="_blank"&gt;Fiddler tool&lt;/a&gt; to send REST request to the service, which is a wonderful tool for these circumstances.&lt;/p&gt;

&lt;p&gt;Now, to get the customer with ID 123, just send a GET request to the url: &lt;strong&gt;http://127.0.0.1:8000/customers/123&lt;/strong&gt; and the service will return:&lt;/p&gt;

&lt;pre class="code"&gt;&amp;lt;Customer&amp;gt;&lt;br /&gt;  &amp;lt;ID&amp;gt;123&amp;lt;/ID&amp;gt;&lt;br /&gt;  &amp;lt;Name&amp;gt;Demo User&amp;lt;/Name&amp;gt;&lt;br /&gt;&amp;lt;/Customer&amp;gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;To call the other method, PostCustomer(), send a POST request to &lt;strong&gt;http://127.0.0.1/customers&lt;/strong&gt; with the following request body:&lt;/p&gt;

&lt;pre class="code"&gt;&amp;lt;Customer&amp;gt;&lt;br /&gt;  &amp;lt;ID&amp;gt;123&amp;lt;/ID&amp;gt;&lt;br /&gt;  &amp;lt;Name&amp;gt;Demo User&amp;lt;/Name&amp;gt;&lt;br /&gt;&amp;lt;/Customer&amp;gt;&lt;/pre&gt;

&lt;p&gt;This returns:&lt;/p&gt;

&lt;pre class="code"&gt;&amp;lt;Customer xmlns:i=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;ID&amp;gt;123&amp;lt;/ID&amp;gt;&lt;br /&gt;  &amp;lt;Name&amp;gt;Hello, Demo User&amp;lt;/Name&amp;gt;&lt;br /&gt;&amp;lt;/Customer&amp;gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;em&gt;&lt;strong&gt;NOTE:&lt;/strong&gt; Remember that you must add a HTTP header, specifying the content type, or the POST request will fail (Content-Type: application/xml).&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Wrong Order of Nodes?&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;But what if the programmer sends the &amp;lt;Name&amp;gt; note before the &amp;lt;ID&amp;gt; node? Like this:&lt;/p&gt;

&lt;pre class="code"&gt;&amp;lt;Customer&amp;gt;&lt;br /&gt;  &amp;lt;Name&amp;gt;Demo User&amp;lt;/Name&amp;gt;&lt;br /&gt;  &amp;lt;ID&amp;gt;123&amp;lt;/ID&amp;gt;&lt;br /&gt;&amp;lt;/Customer&amp;gt;&lt;/pre&gt;

&lt;p&gt;The service will then return:&lt;/p&gt;

&lt;pre class="code"&gt;&amp;lt;Customer xmlns:i=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;ID i:nil=&amp;quot;true&amp;quot;/&amp;gt;&lt;br /&gt;  &amp;lt;Name&amp;gt;Hello, Demo User&amp;lt;/Name&amp;gt;&lt;br /&gt;&amp;lt;/Customer&amp;gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Note that the ID is null! If the ID was declared as an integer in the Data Contract, the response from the service would be:&lt;/p&gt;

&lt;pre class="code"&gt;&amp;lt;Customer xmlns:i=&amp;quot;http://www.w3.org/2001/XMLSchema-instance&amp;quot;&amp;gt;&lt;br /&gt;  &amp;lt;ID&amp;gt;0&amp;lt;/ID&amp;gt;&lt;br /&gt;  &amp;lt;Name&amp;gt;Hello, Demo User&amp;lt;/Name&amp;gt;&lt;br /&gt;&amp;lt;/Customer&amp;gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Note that ID is 0 (zero), which could become a somewhat hard bug to catch. I asked Kirk about this and he confirmed the reason for this behaviour is the way the DataContractSerializer works. If no order is specified in the DataContract, it will (de)serialize in alphabetic order. If this is a problem for you, there is away around it by specifying the XmlSerializerFormat attribute on the REST interface:&lt;/p&gt;

&lt;pre class="code"&gt;[&lt;span style="color: rgb(43,145,175)"&gt;ServiceContract&lt;/span&gt;]
&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;interface&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;IService
&lt;/span&gt;{
    [&lt;span style="color: rgb(43,145,175)"&gt;OperationContract&lt;/span&gt;]
    [&lt;span style="color: rgb(43,145,175)"&gt;WebGet&lt;/span&gt;(UriTemplate = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;customers/{id}&amp;quot;&lt;/span&gt;)]
    [&lt;span style="color: rgb(43,145,175)"&gt;XmlSerializerFormat&lt;/span&gt;]
    &lt;span style="color: rgb(43,145,175)"&gt;Customer&lt;/span&gt; GetCustomer(&lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; id);

    [&lt;span style="color: rgb(43,145,175)"&gt;OperationContract&lt;/span&gt;]
    [&lt;span style="color: rgb(43,145,175)"&gt;WebInvoke&lt;/span&gt;(UriTemplate = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;customers&amp;quot;&lt;/span&gt;)]
    [&lt;span style="color: rgb(43,145,175)"&gt;XmlSerializerFormat&lt;/span&gt;]
    &lt;span style="color: rgb(43,145,175)"&gt;Customer&lt;/span&gt; PostCustomer(&lt;span style="color: rgb(43,145,175)"&gt;Customer&lt;/span&gt; c);
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&lt;strong&gt;POCO Support in SP1&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;One of the new features in .NET 3.5 SP1 is the support for POCOs - the DataContractSerializer supports serializing types that doesn't have the [DataContract] or [Serializable] attributes. &lt;a href="http://www.pluralsight.com/community/blogs/aaron/archive/2008/05/13/50934.aspx" target="_blank"&gt;Aaron Skonnard has a good post on this.&lt;/a&gt; This means you can safely get rid of the attributes on the Customer class:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;Customer
&lt;/span&gt;{
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; ID { &lt;span style="color: rgb(0,0,255)"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(0,0,255)"&gt;set&lt;/span&gt;; }
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; Name { &lt;span style="color: rgb(0,0,255)"&gt;get&lt;/span&gt;; &lt;span style="color: rgb(0,0,255)"&gt;set&lt;/span&gt;; }
}&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Note that the DataContractSerializer is still picky about the XML it gets to be able to deserialize it properly. Again, to get a more &amp;quot;relaxed&amp;quot; REST interface where WCF accepts the Name and ID nodes in any order, use the XmlSerializerFormat. I'm not sure this is what you want, but it's an option.&lt;/p&gt;

&lt;p&gt;I had a short mail conversation with Kirk about this, and he raised an interesting question about the lack of a industry accepted standard for describing RESTful services and I think he's right there. The XML-node order wouldn't be a problem at all if I gave the client programmer a schema or a contract which specified exactly how the RESTful interface was to be accessed and in which order the XML-nodes must come. Kirk had a lot to say about this, and I do hope he writes up a blog post about his thoughts ;)&lt;/p&gt;

&lt;p&gt;There are ways to send and receive any XML to a RESTful interface with WCF, and I'll write a blog post about that another day.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6498733" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="WCF" scheme="http://weblogs.asp.net/jdanforth/archive/tags/WCF/default.aspx" /><category term=".NET 3.5" scheme="http://weblogs.asp.net/jdanforth/archive/tags/.NET+3.5/default.aspx" /><category term="REST" scheme="http://weblogs.asp.net/jdanforth/archive/tags/REST/default.aspx" /></entry><entry><title>WPF is Different - The XAML Way of Doing Things</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/08/04/wpf-is-different-the-xaml-way-of-doing-things.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/08/04/wpf-is-different-the-xaml-way-of-doing-things.aspx</id><published>2008-08-04T11:57:06Z</published><updated>2008-08-04T11:57:06Z</updated><content type="html">&lt;p&gt;&lt;img style="border-right: 0px; border-top: 0px; margin: 5px; border-left: 0px; border-bottom: 0px" height="120" alt="WPF" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/WPFisDifferentTheXAMLWayofDoingThings_C3E4/WPF_3.png" width="244" align="right" border="0" /&gt; Wow, I've finally spent some time looking at Silverlight and WPF samples, and it sure takes a while to wrap your head around &amp;quot;The XAML Way of Doing Things&amp;quot;. It's so easy to fall back to the WinForms coding style when you're supposed to do it The XAML Way.&lt;/p&gt;  &lt;p&gt;For example, if you have an options dialog with user settings for your app - DON'T do it the old WinForms way, but look at &lt;a href="http://www.hanselman.com/blog/LearningWPFWithBabySmashConfigurationWithDataBinding.aspx" target="_blank"&gt;Configuration with Databinding&lt;/a&gt; (from &lt;a href="http://www.hanselman.com/blog/CategoryView.aspx?category=BabySmash" target="_blank"&gt;Scott Hanselman's adventure with BabySmash&lt;/a&gt;). The code behind you need is really minimal if you do it the right way.&lt;/p&gt;  &lt;p&gt;There are also a gazillion ways to handle control events declaratively within the XAML itself, without having to create a code behind event and code things up from there. Take a look at WPF Styles and Triggers and learn it! Especially if you want to create nice looking effects, animations and such, but styles and triggers are useful for more than bells and whistles. For many things related to the UI there are 2 ways of doing it - in XAML or in code behind. There's a pretty good &lt;a href="http://www.microsoft.com/belux/msdn/nl/community/columns/gillcleeren/wpf_stylesandtriggers.mspx" target="_blank"&gt;starter on Styles and Triggers on the Microsoft Belgium MSDN site&lt;/a&gt;. It may not be wrong to do it in code behind, and some things *must* be coded that way, but always search for The XAML Way of doing it before falling into old WinForms behaviour.&lt;/p&gt;  &lt;p&gt;Finally, what will take me a long time to understand and learn (if I ever learn it) is the XAML layout manager. I'm trying to position a group of controls in the center of a WPF Window that may be in full screen mode. First I used the Canvas panel and hacked away in a WinForms style specifying location depending on screen size and stuff, but I'm sure it can all be done in XAML... somehow *smile* ScottGu wrote an &lt;a href="http://weblogs.asp.net/scottgu/pages/silverlight-tutorial-part-2-using-layout-management.aspx" target="_blank"&gt;intro for Silverlight 2 on the layout manager&lt;/a&gt;, which is good reading if you are new to this.&lt;/p&gt;  &lt;p&gt;I should probably install Expression Blend and learn at least the basics of it. The XAML editor in VS2008 is just not enough for more complex layouts. What scares me somewhat is that a fairly complex WPF/Silverlight window may result in pretty nasty XAML with a bunch of Grids, Stackpanels, Canvases, more Stackpanels within Stackpanels within a certain Grid.Column and so on. Add a bunch more if you're using triggers and animation. I know you can shrink the XAML somewhat by using Styles, but are we getting back into HTML Table Hell again when we've just been saved by CSS?&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6480917" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="WPF" scheme="http://weblogs.asp.net/jdanforth/archive/tags/WPF/default.aspx" /></entry><entry><title>Open a WPF Window from WinForms</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/07/29/open-a-wpf-window-from-winforms.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/07/29/open-a-wpf-window-from-winforms.aspx</id><published>2008-07-29T18:31:19Z</published><updated>2008-07-29T18:31:19Z</updated><content type="html">&lt;p&gt;If you find yourself in need to open a WPF Window from a WinForms program - this is one way to do it (works for me):&lt;/p&gt;  &lt;p&gt;1) Create/Add a new project of type &amp;quot;WPF Custom Control Library&amp;quot;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OpenaWPFWindowfromWinForms_12091/image_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="167" alt="image" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OpenaWPFWindowfromWinForms_12091/image_thumb.png" width="415" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;2) Add a new Item of type &amp;quot;Window (WPF)&amp;quot;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OpenaWPFWindowfromWinForms_12091/image_4.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="168" alt="image" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/OpenaWPFWindowfromWinForms_12091/image_thumb_1.png" width="416" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;3) Do your thing with the WPF Window &lt;/p&gt;  &lt;p&gt;4) From your WinForms app, create and open the WPF Window:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Forms;
&lt;span style="color: rgb(0,0,255)"&gt;using&lt;/span&gt; System.Windows.Forms.Integration;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; wpfwindow = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; WPFWindow.&lt;span style="color: rgb(43,145,175)"&gt;Window1&lt;/span&gt;();
&lt;span style="color: rgb(43,145,175)"&gt;ElementHost&lt;/span&gt;.EnableModelessKeyboardInterop(wpfwindow);
wpfwindow.Show();&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;There you go!&lt;/p&gt;

&lt;p&gt;The EnableModelessKeyboardInterop() call is necessary to handle keyboard input in the WPF window if loaded from a non-WPF host like WinForms. I understand there are other ways to do this and you can &lt;a href="http://msdn.microsoft.com/en-us/library/ms742474.aspx" target="_blank"&gt;read more about WPF/WinForms interop here&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6457858" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="WPF" scheme="http://weblogs.asp.net/jdanforth/archive/tags/WPF/default.aspx" /></entry><entry><title>IronRuby with ASP.NET MVC</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/07/21/ironruby-with-asp-net-mvc.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/07/21/ironruby-with-asp-net-mvc.aspx</id><published>2008-07-21T15:59:56Z</published><updated>2008-07-21T15:59:56Z</updated><content type="html">&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/IronRubywithASP.NETMVC_FD06/MVCIronRuby_2.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; margin: 5px; border-left: 0px; border-bottom: 0px" height="185" alt="MVCIronRuby" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/IronRubywithASP.NETMVC_FD06/MVCIronRuby_thumb.png" width="240" align="right" border="0" /&gt;&lt;/a&gt; Now that ASP.NET MVC preview 4 is out, &lt;a href="http://haacked.com/archive/2008/07/20/ironruby-aspnetmvc-prototype.aspx" target="_blank"&gt;Phil Haack did as promised and made available a working prototype of IronRuby + ASP.NET MVC integration&lt;/a&gt;. He wrote:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;Now that Preview 4 is out, I revisited the prototype and got it working again. I use the term &lt;em&gt;working&lt;/em&gt; loosely here. Yeah, it works, but it is really rough around the edges.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;To be able to use Ruby with ASP.NET MVC there has to be some c# glue/bridge code, especially in global.asax, which loads the routing tables (via extensions) and points at a specially made Ruby Controller Factory:&lt;/p&gt;  &lt;p&gt;protected void Application_Start(object sender, EventArgs e)   &lt;br /&gt;{    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; RouteTable.Routes.LoadFromRuby();    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ControllerBuilder.Current.SetControllerFactory(new RubyControllerFactory());    &lt;br /&gt;} &lt;/p&gt;  &lt;p&gt;That glue code is placed in a c# library called IronRubyMvcLibrary, which also contains support for .rhtml view pages. The objects you need to use from within the view page is accessible through Ruby global variables - $model, $response, $html and so on. &lt;/p&gt;  &lt;p&gt;As &lt;a href="http://www.iunknown.com/2008/06/ironruby-and-aspnet-mvc.html" target="_blank"&gt;John&lt;/a&gt; and &lt;a href="http://haacked.com/archive/2008/07/20/ironruby-aspnetmvc-prototype.aspx" target="_blank"&gt;Phil&lt;/a&gt; points out, this is a prototype and a test to try out a few things with IronRuby and MVC, and I think it's cool. Much will change over time, like how they use instance variables on the controller to pass data to the view.&lt;/p&gt;  &lt;p&gt;This is a step towards something which may become quite popular in the Ruby community, and perhaps to Rails people who has to, or wants to, write web apps on the .NET platform in the future. For those that hasn't been looking at IronRuby yet and want to have some fun with this - note that you don't have any intellisense or anything lika that in Visual Studio yet. &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6427468" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="ASP.NET MVC" scheme="http://weblogs.asp.net/jdanforth/archive/tags/ASP.NET+MVC/default.aspx" /><category term="Ruby" scheme="http://weblogs.asp.net/jdanforth/archive/tags/Ruby/default.aspx" /></entry><entry><title>IronRuby Getting Started Links</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/07/15/ironruby-getting-started-links.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/07/15/ironruby-getting-started-links.aspx</id><published>2008-07-15T08:44:10Z</published><updated>2008-07-15T08:44:10Z</updated><content type="html">&lt;p&gt;&lt;a href="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/IronRubyGettingStartedLinks_96F5/CropperCapture%5B5%5D.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="75" alt="CropperCapture[5]" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/IronRubyGettingStartedLinks_96F5/CropperCapture%5B5%5D_thumb.png" width="160" align="right" border="0" /&gt;&lt;/a&gt; Justin Etheredge wrote a &lt;a href="http://www.codethinked.com/post/2008/07/Getting-IronRuby-Up-and-Running.aspx" target="_blank"&gt;detailed step-by-step blog post about how to download, build and get IronRuby up and running&lt;/a&gt; which is really good. &lt;/p&gt;  &lt;p&gt;There is also the new wiki on the official IronRuby web site (&lt;a href="http://www.ironruby.com"&gt;www.ironruby.com&lt;/a&gt;) which covers the same topic and also has a few code samples that might get you going a few steps further - look at the &lt;a href="http://www.ironruby.com/Frequently_Asked_Questions" target="_blank"&gt;FAQ pages&lt;/a&gt;.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6401141" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="Ruby" scheme="http://weblogs.asp.net/jdanforth/archive/tags/Ruby/default.aspx" /></entry><entry><title>Fetching User Details from OpenId via Attribute Exchange</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/07/11/fetching-user-details-from-openid-via-attribute-exchange.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/07/11/fetching-user-details-from-openid-via-attribute-exchange.aspx</id><published>2008-07-11T14:09:41Z</published><updated>2008-07-11T14:09:41Z</updated><content type="html">&lt;p&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="178" alt="CropperCapture[4]" src="http://weblogs.asp.net/blogs/jdanforth/WindowsLiveWriter/FetchingUserDetailsfromOpenIdviaAttribut_E340/CropperCapture%5B4%5D_1.png" width="240" align="right" border="0" /&gt;Rob Conery did &lt;a href="http://blog.wekeroad.com/mvc-storefront/mvcstore-part-16/" target="_blank"&gt;another excellent episode of his MVC Storefront series&lt;/a&gt; the other day where he ripped out his user membership code and replaced it with OpenId.&lt;/p&gt;  &lt;p&gt;Implementing the whole OpenId protocol yourself isn't necessary as there are some great libraries for you out there which makes it really, really simple to use and integrate with both WebFoms and A SP.NET MVC. Rob uses the &lt;a href="http://code.google.com/p/dotnetopenid/" target="_blank"&gt;DotNetOpenId library&lt;/a&gt; to authenticate the user but didn't show how to fetch user details like the user full name.&lt;/p&gt;  &lt;p&gt;Well, this is possible using Attribute Exchange which is a way of transferring information about the user between the OpenID provider and relying party. The DotNetOpenId library supports this too, and it just requires a small change to the DotNetOpenId code samples I've seen out there.&lt;/p&gt;  &lt;p&gt;First, most people redirect to the provider like this:&lt;/p&gt;  &lt;pre class="code"&gt;openid.CreateRequest(id).RedirectToProvider();&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;But instead, create the request manually and add extension requests to fetch user information (like the name for example) to it before redirecting:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; openidRequest = openid.CreateRequest(id);
&lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; fetch = &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;FetchRequest&lt;/span&gt;();
fetch.AddAttribute(&lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;AttributeRequest&lt;/span&gt;(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;http://schema.openid.net/namePerson&amp;quot;&lt;/span&gt;));
openidRequest.AddExtension(fetch);

openidRequest.RedirectToProvider();&lt;/pre&gt;

&lt;p&gt;Just keep on adding the attributes you're interested in, like email, website etc. Remeber to inform your user about you wanting to fetch the extra information before doing the authentication. &lt;/p&gt;

&lt;p&gt;After a successful OpenId authentication the provider redirects back to your site and you normally authenticate and redirect like this:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;switch&lt;/span&gt; (openid.Response.Status)
{
    &lt;span style="color: rgb(0,0,255)"&gt;case&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;AuthenticationStatus&lt;/span&gt;.Authenticated:
        &lt;span style="color: rgb(43,145,175)"&gt;FormsAuthentication&lt;/span&gt;.RedirectFromLoginPage(openid.Response.ClaimedIdentifier, &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;);&lt;br /&gt;        &lt;span style="color: rgb(0,128,0)"&gt;//...snip...&lt;/span&gt;&lt;/pre&gt;

&lt;p&gt;Now, before the redirect statement, you have the chance to fetch out the attributes you asked for from the OpenId response, like this for example:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;switch&lt;/span&gt; (openid.Response.Status)
{
    &lt;span style="color: rgb(0,0,255)"&gt;case&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;AuthenticationStatus&lt;/span&gt;.Authenticated:
        &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; fetch = openid.Response.GetExtension&amp;lt;&lt;span style="color: rgb(43,145,175)"&gt;FetchResponse&lt;/span&gt;&amp;gt;();
        &lt;span style="color: rgb(0,0,255)"&gt;if&lt;/span&gt; (fetch != &lt;span style="color: rgb(0,0,255)"&gt;null&lt;/span&gt;)
        {
            &lt;span style="color: rgb(0,128,0)"&gt;//assuming we got data back from the provider - add sanity check to this :)
&lt;/span&gt;            &lt;span style="color: rgb(0,0,255)"&gt;var&lt;/span&gt; name = fetch.GetAttribute(&lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;http://schema.openid.net/namePerson&amp;quot;&lt;/span&gt;).Values[0];
            &lt;span style="color: rgb(0,128,0)"&gt;//...store name in session or something...&lt;br /&gt;&lt;/span&gt;        } &lt;br /&gt;        &lt;span style="color: rgb(43,145,175)"&gt;FormsAuthentication&lt;/span&gt;.RedirectFromLoginPage(openid.Response.ClaimedIdentifier, &lt;span style="color: rgb(0,0,255)"&gt;false&lt;/span&gt;);
        &lt;span style="color: rgb(0,128,0)"&gt;//...snip...&lt;/span&gt;&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;Note that DotNetOpenId library offers a few &amp;quot;well known&amp;quot; attributes as enums which all uses the &amp;quot;axschema.org&amp;quot; schema, but they do not work with the myOpenId provider. That's why I'm using the &amp;quot;schema.openid.net&amp;quot; schema instead.&lt;/p&gt;

&lt;p&gt;&lt;a href="http://raku.to/"&gt;Rakuto Furutani&lt;/a&gt; blogged about &lt;a href="http://rakuto.blogspot.com/2008/03/ruby-fetch-some-attributes-from.html" target="_blank"&gt;the attribute schema problems&lt;/a&gt; in a Ruby on Rails post:&lt;/p&gt;

&lt;blockquote&gt;
  &lt;p&gt;myOpenID supports only some attributes that can be exchange with OpenID Attribute Exchange, but you should care about Type URI, because myOpenID doesn't support Type URI described on &amp;quot;http://www.axschema.org/types/&amp;quot;. &lt;strong&gt;You should specify Type URI with &amp;quot;http://schema.openid.net/&amp;quot; instead.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It could be I'm using an older version of the DotNetOpenId library and it's been changed in newed releases. I have to check this out.&lt;/p&gt;

&lt;p&gt;Also, &lt;a href="http://blog.nerdbank.net/" target="_blank"&gt;Andrew Arnott&lt;/a&gt; has written a longer post on &lt;a href="http://blog.nerdbank.net/2008/07/how-to-use-dotnetopenid-attribute.html" target="_blank"&gt;how to use DotNetOpenId's Attribute Extensions extension&lt;/a&gt; which you should read if you want some more in-depth sample code (he's using ASP.NET WebForms). &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6389059" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="ASP.NET MVC" scheme="http://weblogs.asp.net/jdanforth/archive/tags/ASP.NET+MVC/default.aspx" /><category term="OpenID" scheme="http://weblogs.asp.net/jdanforth/archive/tags/OpenID/default.aspx" /></entry><entry><title>ThreadPool.QueueUserWorkItem with Anonymous Types</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/07/03/threadpool-queueuserworkitem-with-anonymous-types.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/07/03/threadpool-queueuserworkitem-with-anonymous-types.aspx</id><published>2008-07-03T09:10:25Z</published><updated>2008-07-03T09:10:25Z</updated><content type="html">&lt;p&gt;I thought &lt;a href="http://thevalerios.net/matt/2008/05/use-threadpoolqueueuserworkitem-with-anonymous-types" target="_blank"&gt;this blog post by Matt Valerio&lt;/a&gt; was good, and it gave me a few ideas to use in a current test project. He wrote a helper method to be able to use anonymous types when calling a delegate or lambda in the ThreadPool:&lt;/p&gt;  &lt;pre class="code"&gt;&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;delegate&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;void&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;WaitCallback&lt;/span&gt;&amp;lt;T&amp;gt;(T state);

&lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;class&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;ThreadPoolHelper
&lt;/span&gt;{
    &lt;span style="color: rgb(0,0,255)"&gt;public&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;static&lt;/span&gt; &lt;span style="color: rgb(0,0,255)"&gt;bool&lt;/span&gt; QueueUserWorkItem&amp;lt;T&amp;gt;(T state, &lt;span style="color: rgb(43,145,175)"&gt;WaitCallback&lt;/span&gt;&amp;lt;T&amp;gt; callback)
    {
        &lt;span style="color: rgb(0,0,255)"&gt;return&lt;/span&gt; &lt;span style="color: rgb(43,145,175)"&gt;ThreadPool&lt;/span&gt;.QueueUserWorkItem(s =&amp;gt; callback((T)s), state);
    }
}&lt;/pre&gt;

&lt;p&gt;And his example code for using this method:&lt;/p&gt;

&lt;pre class="code"&gt;&lt;span style="color: rgb(43,145,175)"&gt;ThreadPoolHelper&lt;/span&gt;.QueueUserWorkItem(
    &lt;span style="color: rgb(0,0,255)"&gt;new&lt;/span&gt; { Name = &lt;span style="color: rgb(163,21,21)"&gt;&amp;quot;Matt&amp;quot;&lt;/span&gt;, Age = 26 },
    (data) =&amp;gt;
    {
        &lt;span style="color: rgb(0,0,255)"&gt;string&lt;/span&gt; name = data.Name;
        &lt;span style="color: rgb(0,0,255)"&gt;int&lt;/span&gt; age = data.Age;
        &lt;span style="color: rgb(0,128,0)"&gt;// Long-running computation
&lt;/span&gt;    });&lt;/pre&gt;
&lt;a href="http://11011.net/software/vspaste"&gt;&lt;/a&gt;

&lt;p&gt;&amp;#160;&lt;/p&gt;

&lt;p&gt;Cute, eh? &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6352586" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term=".NET 3.5" scheme="http://weblogs.asp.net/jdanforth/archive/tags/.NET+3.5/default.aspx" /></entry><entry><title>RROD - Our Xbox 360 Finally Gave Up</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/06/07/rrod-our-xbox-360-finally-gave-up.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/06/07/rrod-our-xbox-360-finally-gave-up.aspx</id><published>2008-06-07T18:27:22Z</published><updated>2008-06-07T18:27:22Z</updated><content type="html">&lt;p&gt;&lt;img style="margin: 4px" height="198" src="http://files.for-robots.com/gfr/postimg/rrod.jpg" width="209" align="right" /&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;UPDATE:&lt;/strong&gt; And this morning it works again! Amazing. Yesterday I tried everything together with the support guy on the phone - unplugged power, hard drive, network, everything - but it was RROD still after 8-10 retries. And now, 20 hours later it works again? Weird. I'll let the box run for a few hours today and tomorrow. If nothing crashes I'll call Xbox support again and hear what they've got to say about it. &lt;/em&gt;&lt;/p&gt;  &lt;p&gt;&lt;em&gt;&lt;strong&gt;ANOTHER UPDATE:&lt;/strong&gt; And a few days later it really, really died so I sent it in for repairs. :) I just got it back today - it took about 2 weeks &amp;quot;door-to-door&amp;quot;, which is not too bad considering it travelled to Germany for repairs and back again to Sweden. The motherboard replaced.&lt;/em&gt;&lt;/p&gt;  &lt;p&gt;Some time ago our Xbox 360 here at home started to glich - the screen froze up after a few minutes with a short squeeky noise from the speakers, one of the red lamps on the front lit and I thought the Xbox was going down. I contacted the support center to have it repaired (I would have to pay for it because we've had it for a couple of years and the warranty didn't cover this error), but they had problems with their incident system for a couple of days and therefore couldn't submit repair request... I asked them to call me back or send me an email when the system worked again, but they couldn't do that (boooh). That made me a bit angry, and I kind of dropped the Xbox from a few inches of height into the floor... and it worked pretty well after that!&lt;/p&gt;  &lt;p&gt;...until now that is. This morning we had a real proper RROD (Red Ring of Death) - hardware failure. Argh!&lt;/p&gt;  &lt;p&gt;I called the support center again and was prepared to pay for the repairs, but I was told that Microsoft extended the warranty for RROD/hardware failures to 3 years - good! I just got the UPS lables to print out and stick onto the box and will arrange for UPS to pick it up on Monday. They said it might take up to 3 weeks to have the thing repaired and sent back to us, but there's not much I can do about that.&lt;/p&gt;  &lt;p&gt;I guess we'll have to power up the old Xbox console now and play Worms for a while :)&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6256048" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="Xbox" scheme="http://weblogs.asp.net/jdanforth/archive/tags/Xbox/default.aspx" /></entry><entry><title>ASP.NET MVC Resources</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/06/05/asp-net-mvc-resources.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/06/05/asp-net-mvc-resources.aspx</id><published>2008-06-05T10:48:12Z</published><updated>2008-06-05T10:48:12Z</updated><content type="html">&lt;p&gt;&lt;a href="http://weblogs.asp.net/craigshoemaker/default.aspx" target="_blank"&gt;Craig Shoemaker&lt;/a&gt;, the host of &lt;a href="http://polymorphicpodcast.com/" target="_blank"&gt;Polymorphic Podcast&lt;/a&gt; (a .NET podcast which is getting better and better all the time), published a &lt;a href="http://weblogs.asp.net/craigshoemaker/archive/2008/04/24/47-asp-net-mvc-resources-to-rock-your-development.aspx" target="_blank"&gt;great set of resources for ASP.NET MVC&lt;/a&gt; which will keep you occupied for hours.&lt;/p&gt;  &lt;p&gt;Also listen to his shows on MVC. He's got interviews with both Scott Hanselman and Jeffery Palermo around this topic.&lt;/p&gt;  &lt;p&gt;I'm not going to copy/paste his list, just go there and check it out if you're into MVC.&lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6249590" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term="Podcasts" scheme="http://weblogs.asp.net/jdanforth/archive/tags/Podcasts/default.aspx" /><category term="ASP.NET MVC" scheme="http://weblogs.asp.net/jdanforth/archive/tags/ASP.NET+MVC/default.aspx" /></entry><entry><title>ASP.NET MVC Supporting IronRuby and IronPython</title><link rel="alternate" type="text/html" href="http://weblogs.asp.net/jdanforth/archive/2008/06/04/asp-net-mvc-supporting-ironruby-and-ironpython.aspx" /><id>http://weblogs.asp.net/jdanforth/archive/2008/06/04/asp-net-mvc-supporting-ironruby-and-ironpython.aspx</id><published>2008-06-04T12:29:42Z</published><updated>2008-06-04T12:29:42Z</updated><content type="html">&lt;p&gt;I just picked up this answer to a &lt;a href="http://weblogs.asp.net/scottgu/archive/2008/06/01/asp-net-mvc-support-with-visual-web-developer-2008-express.aspx#6240898" target="_blank"&gt;comment on ScottGu's blog&lt;/a&gt;:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;I believe we will be showing using ASP.NET MVC with IronRuby and IronPython later this week at TechEd.&amp;#160; I don't think we've finalized what the tooling support will be - but you will be able to use these as language options with ASP.NET.&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It would have been cool to be at TechEd... &lt;/p&gt;&lt;img src="http://weblogs.asp.net/aggbug.aspx?PostID=6247332" width="1" height="1"&gt;</content><author><name>jdanforth</name><uri>http://weblogs.asp.net/members/jdanforth.aspx</uri></author><category term=".NET 3.5" scheme="http://weblogs.asp.net/jdanforth/archive/tags/.NET+3.5/default.aspx" /><category term="ASP.NET MVC" scheme="http://weblogs.asp.net/jdanforth/archive/tags/ASP.NET+MVC/default.aspx" /><category term="Ruby" scheme="http://weblogs.asp.net/jdanforth/archive/tags/Ruby/default.aspx" /></entry></feed>