<?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>PeterKellner.net &#187; Visual Studio 2010</title>
	<atom:link href="http://peterkellner.net/category/visual-studio-2010/feed/" rel="self" type="application/rss+xml" />
	<link>http://peterkellner.net</link>
	<description>Microsoft Focussed, JavaScript (ExtJS, SenchaTouch &#38; Windows 8 Metro)</description>
	<lastBuildDate>Tue, 07 Feb 2012 21:14:45 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Create A Simple MVC Button Click Listener in SenchaTouch2</title>
		<link>http://peterkellner.net/2012/01/23/create-a-simple-mvc-button-click-listener-in-senchatouch2/</link>
		<comments>http://peterkellner.net/2012/01/23/create-a-simple-mvc-button-click-listener-in-senchatouch2/#comments</comments>
		<pubDate>Tue, 24 Jan 2012 04:14:39 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Sencha]]></category>
		<category><![CDATA[SenchaMVC]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[visu]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2012/01/23/create-a-simple-mvc-button-click-listener-in-senchatouch2/</guid>
		<description><![CDATA[&#160;  I do not even want to admit how much time I spent today in a more complex application trying to get a button to respond to a tap event in SenchaTouch 2.0 Beta.&#160; I did notice several people like me on the forums with similar issues, but I did not find one concrete [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>  <p>I do not even want to admit how much time I spent today in a more complex application trying to get a <a href="http://www.sencha.com/learn/layout-faq/">button</a> to respond to a tap event in <a href="http://www.sencha.com/products/touch/">SenchaTouch 2.0 Beta</a>.&#160; I did notice several people like me on the forums with similar issues, but I did not find one concrete example that made the simple “click a <a href="http://miamicoder.com/2010/creating-sencha-touch-toolbar-buttons/">button application</a>”.&#160; Of course I’m building this in <a href="http://www.microsoft.com/visualstudio/en-us">Microsoft Visual Studio 2010</a> and debugging with <a href="https://chrome.google.com/">Chrome</a>.&#160; Let me start at the end.&#160; When you are done, you will have a simple two button page that you can click on either button and have your MVC controller react to either button as well as trap the button hit inside the actual Panel.</p>  <p>&#160;</p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2012/01/image12.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2012/01/image_thumb10.png" width="431" height="255" /></a></p>  <p>&#160;</p>  <p>And for those of you that have read enough, here is the source:&#160;&#160; <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:6cf571a4-5052-4531-9334-dc07fcce1ced" class="wlWriterEditableSmartContent"><p> <a href="http://peterkellner.net/wp/wp/wp-content/uploads/2012/01/Sencha2MVCButtons1.zip" target="_blank">ZIP File Of Project With 2 Buttons and Listeners</a></p></div> </p>  <p>&#160;</p>  <p>&#160;</p>  <h2>The Nitty Gritty</h2>  <p>Creating an SenchaTouch project with MVC is a little tricky to setup.&#160; You need to get all the directories right.&#160; My favorite way to do this is to use the Sencha Designer to create the project, then abandon it if I want to strike out on my own.&#160; That is what I’ve done here.&#160; I don’t even think you can tell.</p>  <p>Here is the file layout as seen from Visual Studio:</p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2012/01/image13.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2012/01/image_thumb11.png" width="213" height="170" /></a></p>  <p>5 Files and 3 directories.</p>  <p>Let’s first take a look at the Panel that contains the buttons.&#160; Here is the code:</p>  <pre class="csharpcode">Ext.define(<span class="str">'MyApp.view.MyPanel'</span>, {
    extend: <span class="str">'Ext.Panel'</span>,
    alias: <span class="str">'widget.mypanel'</span>,
    config: {
        items: [
            {
                xtype: <span class="str">'button'</span>,
                itemId: <span class="str">'mybutton1'</span>,
                text: <span class="str">'MyButton1'</span>,
                action: <span class="str">'b1'</span>
            },
            {
                xtype: <span class="str">'button'</span>,
                itemId: <span class="str">'mybutton2'</span>,
                text: <span class="str">'MyButton2'</span>,
                action: <span class="str">'b2'</span>
            }
        ],

        listeners: [
            {
                fn: <span class="str">'onMybutton1Tap'</span>,
                <span class="kwrd">event</span>: <span class="str">'tap'</span>,
                <span class="kwrd">delegate</span>: <span class="str">'#mybutton1'</span>
            }
        ]
    },
    onMybutton1Tap: <span class="kwrd">function</span> (button, e, options) {
        console.log(<span class="str">'tap from mybutton1'</span>);
    }
});</pre>

<p><style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>Just a couple things to notice.&#160; 1) I’m defining an itemId which we will only be using in the local event (onMybutton1Tap).&#160; If you notice the listener has a property delegate which looks for that.&#160; I’m not sure if this is the best way to do this.&#160; I’ve notice several forum people saying use the “on” syntax.&#160; I did not find an example of that so this is what we have and it works.&#160; Also notice the action property.&#160; If you try and look that up on the SenchaTouch doc’s you will not find it.&#160; I just made it up out of thin air (really!, well, I followed others examples).&#160; I actually asked about this in the forums and I was told that is OK.&#160; As a type safe language guy, it hurts, but I did it.</p>

<p>&#160;</p>

<p>That’s it for the view.&#160; Let’s move over to the controller.&#160; Here is the source for that:</p>

<pre class="csharpcode">Ext.define(<span class="str">'MyApp.controller.MyController'</span>, {
    extend: <span class="str">'Ext.app.Controller'</span>,

    views: [
        <span class="str">'MyPanel'</span>
    ],

    refs: [
        {
            <span class="kwrd">ref</span>: <span class="str">'MyPanel'</span>,
            selector: <span class="str">'mypanel'</span>
        }],

    init: <span class="kwrd">function</span> () {

        <span class="kwrd">this</span>.control({
            <span class="str">'button[action=b1]'</span>: {
                tap: <span class="kwrd">this</span>.onButtonTap1
            },
            <span class="str">'button[action=b2]'</span>: {
                tap: <span class="kwrd">this</span>.onButtonTap2
            }
        });
    },

    onLaunch: <span class="kwrd">function</span> () {
        console.log(<span class="str">'onLaunch'</span>);
    },

    onButtonTap1: <span class="kwrd">function</span> () {
        console.log(<span class="str">'controller: onButtonTap1'</span>);
    },

    onButtonTap2: <span class="kwrd">function</span> () {
        console.log(<span class="str">'controller: onButtonTap2'</span>);
    },

    config: {

    }
});</pre>

<p><style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: consolas, "Courier New", courier, monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}
.csharpcode pre { margin: 0em; }
.csharpcode .rem { color: #008000; }
.csharpcode .kwrd { color: #0000ff; }
.csharpcode .str { color: #006080; }
.csharpcode .op { color: #0000c0; }
.csharpcode .preproc { color: #cc6633; }
.csharpcode .asp { background-color: #ffff00; }
.csharpcode .html { color: #800000; }
.csharpcode .attr { color: #ff0000; }
.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}
.csharpcode .lnum { color: #606060; }</style>Basically, what this is doing is filtering all buttons, then looking at just the buttons that have an action of b1 or b2.&#160; If this was a large application, we’d probably want to do some more fancy component querying, but for now, this is OK.&#160; If you keep your controllers small, this should always work.</p>

<p>&#160;</p>

<p>That’s it for now.&#160; Download the source and run it.&#160; I hope it saves you a ton of time.&#160; </p>

<p>As always any experts want to comment and improve or correct what I’ve done, please feel free to comment.&#160; </p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2012/01/23/create-a-simple-mvc-button-click-listener-in-senchatouch2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Using The DataContext In EntityFramework To Retrieve Nested Objects</title>
		<link>http://peterkellner.net/2011/11/27/using-the-datacontext-in-entityframework-to-retrieve-nested-objects/</link>
		<comments>http://peterkellner.net/2011/11/27/using-the-datacontext-in-entityframework-to-retrieve-nested-objects/#comments</comments>
		<pubDate>Sun, 27 Nov 2011 18:41:22 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[CodeFirst]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/11/27/using-the-datacontext-in-entityframework-to-retrieve-nested-objects/</guid>
		<description><![CDATA[I’m always somewhat amazed when I read something from documentation that is not straight forward and it actually works.&#160; So amazed and excited that I often feel the need to blog about it.  So, here is the problem.&#160; I created a CodeFirst implementation of EntityFramework in Visual Studio and created a simple hierarchy in [...]]]></description>
			<content:encoded><![CDATA[<p>I’m always somewhat amazed when I read something from documentation that is not straight forward and it actually works.&#160; So amazed and excited that I often feel the need to blog about it.</p>  <p>So, here is the problem.&#160; I created a <a href="http://blogs.msdn.com/b/adonet/archive/2011/03/15/ef-4-1-code-first-walkthrough.aspx">CodeFirst</a> implementation of <a href="http://msdn.microsoft.com/en-us/data/aa937723">EntityFramework</a> in <a href="http://msdn.microsoft.com/en-us/vstudio/aa718325">Visual Studio</a> and created a simple hierarchy in my data model.&#160; That is, without showing all the code, here is what I have:</p>  <div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">   <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> Person<br />{<br />    [Key]<br />    [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">int</span> Id { get; set; }<br /><br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">virtual</span> List&lt;EmailAddressInfo&gt; EmailAddressInfoList { get; set; }<br />    ..<br />}<br /><br /><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> EmailAddressInfo<br />{<br />    [Key]<br />    [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">int</span> Id { get; set; }<br /><br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">string</span> EmailAddress { get; set; }<br /><br />}<br /></pre>

  <br /></div>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> EmailAccount<br />{<br />    [Key]<br />    [DatabaseGeneratedAttribute(DatabaseGeneratedOption.Identity)]<br />    <span style="color: #0000ff">public</span> <span style="color: #0000ff">int</span> Id { get; set; }<br />    ...<br />}</pre>

  <br /></div>

<p>Now, if you execute a LINQ command like the following:</p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">var recs = (from data <span style="color: #0000ff">in</span> db.Persons<br />                            select data);<br />                <span style="color: #0000ff">foreach</span> (var rec <span style="color: #0000ff">in</span> recs)<br />                {<br />                    <span style="color: #0000ff">foreach</span> (var email <span style="color: #0000ff">in</span> rec.EmailAddressInfoList)<br />                    {<br />                        Console.WriteLine(email);<br />                    }<br />                }</pre>

  <br /></div>

<p>You get the error:</p>

<blockquote>
  <p><b>Exception Details: </b><em>System.InvalidOperationException: There is already an open DataReader associated with this Command which must be closed first.</em></p>
</blockquote>

<p>&#160;</p>

<p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2011/11/image17.png"><img style="background-image: none; border-right-width: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2011/11/image_thumb16.png" width="579" height="181" /></a></p>

<p>&#160;</p>

<p>To solve this, you need to tell EntityFramework/CodeFirst to include the EmailAddressInfoList in the query.&#160; All you need to do is change the db.Persons to db.Persons.Include(&quot;EmailAddressInfoList&quot;) as follows:</p>

<p>&#160;</p>

<div style="border-bottom: silver 1px solid; text-align: left; border-left: silver 1px solid; padding-bottom: 4px; line-height: 12pt; background-color: #f4f4f4; margin: 20px 0px 10px; padding-left: 4px; width: 97.5%; padding-right: 4px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; max-height: 200px; font-size: 8pt; overflow: auto; border-top: silver 1px solid; cursor: text; border-right: silver 1px solid; padding-top: 4px" id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; background-color: #f4f4f4; margin: 0em; border-left-style: none; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; border-right-style: none; font-size: 8pt; overflow: visible; padding-top: 0px" id="codeSnippet">var recs = (from data <span style="color: #0000ff">in</span> db.Persons.Include(<span style="color: #006080">&quot;EmailAddressInfoList&quot;</span>)<br />            select data);</pre>

  <br /></div>

<p>&#160;</p>

<p>Then, it all works!</p>

<p>Hope this helps.</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/11/27/using-the-datacontext-in-entityframework-to-retrieve-nested-objects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>With Visual Studio 2010 (and vs2011 preview) Fast Launch Not Helpful Often</title>
		<link>http://peterkellner.net/2011/11/12/with-visual-studio-2010-and-vs2011-preview-fast-launch-not-helpful-often/</link>
		<comments>http://peterkellner.net/2011/11/12/with-visual-studio-2010-and-vs2011-preview-fast-launch-not-helpful-often/#comments</comments>
		<pubDate>Sat, 12 Nov 2011 17:06:58 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/11/12/with-visual-studio-2010-and-vs2011-preview-fast-launch-not-helpful-often/</guid>
		<description><![CDATA[&#160;  Let’s say I’ve created two Visual Studio Projects with the same name “WebApp” but reside in different directories as shown below (c:\temp\Proj1 and c:\temp\Proj2).&#160; I often call the project WebApp, however I want to keep the projects totally separate.&#160; Below are the File/New Project dialog examples.  &#160;      [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>  <p>Let’s say I’ve created two Visual Studio Projects with the same name “WebApp” but reside in different directories as shown below (c:\temp\Proj1 and c:\temp\Proj2).&#160; I often call the project WebApp, however I want to keep the projects totally separate.&#160; Below are the File/New Project dialog examples.</p>  <p>&#160;</p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2011/11/image10.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2011/11/image_thumb9.png" width="558" height="145" /></a></p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2011/11/image11.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2011/11/image_thumb10.png" width="564" height="137" /></a></p>  <p>&#160;</p>  <p>Now, when I click start (this is with the vs2011 preview I’m demonstrating), I see the following:</p>  <p>&#160;</p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2011/11/image12.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2011/11/image_thumb11.png" width="322" height="392" /></a></p>  <p>&#160;</p>  <p>I actually have to hover over each “WebApp.sln” to tell which project is which.&#160; I think that information should be in the pinned app itself, not require a hover over to tell which project it is.</p>  <p>Agree?&#160; Add your comment below and go to the following link to vote up my connect suggestion.</p>  <p><a href="https://connect.microsoft.com/VisualStudio/feedback/details/679081/should-have-vs-launch-shortcuts-inside-vs-recent-projects-because-run-as-admin">https://connect.microsoft.com/VisualStudio/feedback/details/679081/should-have-vs-launch-shortcuts-inside-vs-recent-projects-because-run-as-admin</a></p>  <p>From the comments, Microsoft said they would consider it for the next release, but it looks like it has not made it.&#160; Let’s try and change that!</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/11/12/with-visual-studio-2010-and-vs2011-preview-fast-launch-not-helpful-often/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Microsoft ASP.NET presentations at Silicon Valley Code Camp on 10/8 and 10/9</title>
		<link>http://peterkellner.net/2011/10/02/microsoft-asp-net-presentations-at-silicon-valley-code-camp-on-108-and-109/</link>
		<comments>http://peterkellner.net/2011/10/02/microsoft-asp-net-presentations-at-silicon-valley-code-camp-on-108-and-109/#comments</comments>
		<pubDate>Sun, 02 Oct 2011 22:01:19 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[VS2010]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[asp.net]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/10/02/microsoft-asp-net-presentations-at-silicon-valley-code-camp-on-108-and-109/</guid>
		<description><![CDATA[&#160;  SV Code Camp is happening next weekend with well over 200 sessions.&#160; The conference is really technology agnostic and try hard to keep it that way, but I am an ASP.NET guy these days so I think it reasonable I take my Code Camp Coordinator hat off for the moment and put on [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>  <p><a href="http://www.siliconvalley-codecamp.com/">SV Code Camp</a> is happening next weekend with well over 200 sessions.&#160; The conference is really technology agnostic and try hard to keep it that way, but I am an ASP.NET guy these days so I think it reasonable I take my Code Camp Coordinator hat off for the moment and put on my ASP.NET hat.&#160; As an ASP.NET Microsoft MVP, I feel I’m in a good position to give a tour of some sessions in ASP.NET and throw in my own 2 cents.&#160; Below are a list of these sessions in no particular order.</p>  <p>&#160;</p>  <h3><a href="http://www.siliconvalley-codecamp.com/Sessions.aspx?OnlyOne=true&amp;id=687">Demystifying ASP.NET MVC, $(Lino).MVC{getknowledge()}</a></h3>  <p><strong>Sunday, October 9th 9:45AM</strong></p>  <p>MVC (Model View Controller) is one of the hottest patterns around building web sites these days no matter what the technology. When Microsoft first introduced Web programming to Visual Studio, they did it such that almost anyone who had done windows programming (VB or other) could quickly come up to speed and build a web site. Personally, this what sucked me into web programming. Drag a button, drag a textbox, double click on the button and add some code to set the text box and WHAM, you have a web site. Unfortunately, as things get more complicated, this model does not scale so well. <a href="http://www.asp.net/mvc">ASP.NET&#8217;s MVC implementation</a> does scale, it takes a little bit of flipping your mind around if you are Web Forms programmer, but definitely worth learning about and seeing if it&#8217;s right for you.</p>  <p><a href="http://www.siliconvalley-codecamp.com/Speakers.aspx?AttendeeId=529">Lino Tadros</a> is one of my favorite presenters and I&#8217;m sure will give you a much better understanding of MVC and how it fits into the ASP.NET programming model. I strongly recommend this one. Lino is the CEO for one of the top Application development and training companies in the world that partners with <a href="http://www.microsoft.com/en-us/default.aspx">Microsoft</a>, <a href="http://falafel.com/default.aspx">Falafel Software</a>. In other words, GO TO THIS SESSION!</p>  <p>&#160;</p>  <h3><a href="http://www.siliconvalley-codecamp.com/Sessions.aspx?OnlyOne=true&amp;id=823">Pragmatic JavaScript, jQuery &amp; Ajax with ASP.NET</a></h3>  <p>Saturday, October 9th 1:45PM</p>  <p><a href="http://www.siliconvalley-codecamp.com/Speakers.aspx?AttendeeId=6788">Damian Edwards</a> is a Program Manager on the Microsoft ASP.NET team.&#160; That’s right, he is flying here from Redmond just to present to us.&#160; He’s also an awesome presenter and we are extremely lucky to have him at Code Camp!&#160;&#160; Damien will tak about using JQuery while building sites with the Microsoft ASP.NET framework.&#160; Something Damien knows very very well.&#160; For those who don’t know, Damien is also leading the next generation efforts around ASP.NET WebForms which is the technology 90% of who use ASP.NET use (it’s what the <a href="http://www.siliconvalley-codecamp.com/">silicon valley code camp</a> web site is built with).</p>  <p>DON’T MISS THIS PRESENTATION!</p>  <p>&#160;</p> <a href="http://www.siliconvalley-codecamp.com/Sessions.aspx?OnlyOne=true&amp;id=627">   <h3><a href="http://www.siliconvalley-codecamp.com/Sessions.aspx?OnlyOne=true&amp;id=627">WebMatrix In Depth</a></h3> </a>  <p>Saturday, October 9th&#160; 5:00PM</p>  <p><a href="http://www.siliconvalley-codecamp.com/Speakers.aspx?AttendeeId=6011">John Sheehan</a>, one of the best guys I know at explaining complex things is presenting this session on WebMatrix.&#160; I’m not sure everyone would agree with me, but for those people that really don’t like the heavy weight feeling of building web applications with Visual Studio, <a href="http://www.asp.net/webmatrix">WebMatrix</a> will make you feel right at home. It’s much lighter weight and also gives tons of punch.&#160; Come see John and ask him a million questions!&#160; He loves that.</p>  <p>&#160;</p>  <p>All the sessions Tagged ASP.NET can be found here:&#160; <a title="http://www.siliconvalley-codecamp.com/Sessions.aspx?sortby=title&amp;by=category&amp;tag=3" href="http://www.siliconvalley-codecamp.com/Sessions.aspx?sortby=title&amp;by=category&amp;tag=3">http://www.siliconvalley-codecamp.com/Sessions.aspx?sortby=title&amp;by=category&amp;tag=3</a></p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/10/02/microsoft-asp-net-presentations-at-silicon-valley-code-camp-on-108-and-109/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>With VS2010 Debugger, Step Into, From a Windows .Net App Directly into a Windows Azure Web Role Hosting a WCF Service In The Developer Fabric</title>
		<link>http://peterkellner.net/2011/06/07/with-vs2010-debugger-step-into-from-a-windows-net-app-directly-into-a-windows-azure-web-role-hosting-a-wcf-service-in-the-developer-fabric/</link>
		<comments>http://peterkellner.net/2011/06/07/with-vs2010-debugger-step-into-from-a-windows-net-app-directly-into-a-windows-azure-web-role-hosting-a-wcf-service-in-the-developer-fabric/#comments</comments>
		<pubDate>Tue, 07 Jun 2011 21:52:09 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure Blob Storage]]></category>
		<category><![CDATA[Azure Deployment]]></category>
		<category><![CDATA[Azure Web Role]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/06/07/with-vs2010-debugger-step-into-from-a-windows-net-app-directly-into-a-windows-azure-web-role-hosting-a-wcf-service-in-the-developer-fabric/</guid>
		<description><![CDATA[&#160;  OK, I think this is the longest post title I’ve ever made, but if you understand it, you’ll know why it needs to be so long.&#160; I discovered this totally by accident.&#160; I would never ever have pressed F11 (step into) from a client side proxy and expect to get into anything but [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>  <p>OK, I think this is the longest post title I’ve ever made, but if you understand it, you’ll know why it needs to be so long.&#160; I discovered this totally by accident.&#160; I would never ever have pressed F11 (step into) from a client side proxy and expect to get into anything but a bunch of ugly machine generated proxy code (especially with <a href="http://www.microsoft.com/windowsazure/">Azure</a>).&#160; To my total surprise, I landed right inside my <a href="http://msdn.microsoft.com/en-us/netframework/aa663324.aspx">WCF</a> service as if I had started the <a href="http://www.microsoft.com/en-us/cloud/developer/resource.aspx?resourceId=what-is-windows-azure&amp;fbid=flWeS4xmu1C&amp;WT.srch=1&amp;WT.mc_id=85C588D4-A353-4E3D-8824-823A9551AA51&amp;CR_SCC=200028978">Windows Azure Developer fabric</a> in debug mode and set a break point.</p>  <p>So, I’ll step through the process an show screen shots on the outside chance I was dreaming and can’t reproduce it. If I can, now I will have proof so I can do it again.&#160; Sorry for the work in progress code you will see.&#160; The point here is really the debugger and not the code I’m showing so try and ignore that.</p>  <p>OK, here we go.</p>  <p>Let’s assume you have a completely configured azure web role that is hosting a simple <a href="http://en.wikipedia.org/wiki/Windows_Communication_Foundation">WCF</a> service.&#160; When you start that web role and point at the service, you’ll get something like this: (just a note that I started the app fabric by deploying directly from <a href="http://www.microsoft.com/en-us/default.aspx">Microsoft</a> <a href="http://www.microsoft.com/visualstudio/en-us">Visual Studio 2010</a> with the start/run.&#160; I am using a debug profile but am <strong>NOT </strong>running in debug mode.&#160; If I do run the app fabric in debug mode, this does not work.</p>  <p>&#160;</p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2011/06/image4.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2011/06/image_thumb4.png" width="480" height="366" /></a></p>  <span id="more-1508"></span>  <p>&#160;</p>  <p>OK, now let’s run my app that has a <a href="http://visualstudiomagazine.com/articles/2011/06/01/pcnet_wcf-and-soa.aspx">WCF</a> client configured to connect to this service.&#160; The configuration is the normal “Add Service Reference” you would expect but I’m showing it any how just to be clear.</p>  <p>&#160;</p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2011/06/image5.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2011/06/image_thumb5.png" width="485" height="473" /></a></p>  <p>&#160;</p>  <p>Next, we simply Launch <a href="http://www.microsoft.com/visualstudio/en-us">Visual Studio 2010</a> in <a href="http://msdn.microsoft.com/en-us/library/sc65sadd.aspx">debug</a> mode and put a break point just before we cross over into the WCF service by calling the above proxy code.&#160; Here is what that screen looks like after the break point is hit and I’m about to step INTO.</p>  <p>&#160;</p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2011/06/image6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2011/06/image_thumb6.png" width="616" height="198" /></a></p>    <p><font size="6">F11</font></p>  <p>&#160;</p>  <p>and…..</p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2011/06/image7.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2011/06/image_thumb7.png" width="657" height="265" /></a></p>  <p><font size="2"></font></p>  <p>There we are!!! right inside the source code that is my WCF service with everything working as if I had launched the site on it’s own, set a break point and waited.</p>  <p>&#160;</p>  <p>Truly amazing!!!&#160; I have nothing more to say.</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/06/07/with-vs2010-debugger-step-into-from-a-windows-net-app-directly-into-a-windows-azure-web-role-hosting-a-wcf-service-in-the-developer-fabric/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Getting Fiddler to See you WCF Traffic</title>
		<link>http://peterkellner.net/2011/04/25/getting-fiddler-to-see-you-wcf-traffic/</link>
		<comments>http://peterkellner.net/2011/04/25/getting-fiddler-to-see-you-wcf-traffic/#comments</comments>
		<pubDate>Tue, 26 Apr 2011 00:48:15 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Fiddler]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[WCF]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/04/25/getting-fiddler-to-see-you-wcf-traffic/</guid>
		<description><![CDATA[There are lots of articles on the internet if you search for WCF Fiddler however it’s not clear what the simplest path to follow is. For me, it turns out that just sprinkling a couple lines of code at the bottom of my windows forms app’s app.config file is all it took.&#160; I got the [...]]]></description>
			<content:encoded><![CDATA[<p>There are lots of articles on the internet if you search for <a href="http://msdn.microsoft.com/en-us/netframework/aa663324">WCF</a> <a href="http://fiddler2.com/fiddler2/">Fiddler</a> however it’s not clear what the simplest path to follow is. For me, it turns out that just sprinkling a couple lines of code at the bottom of my windows forms app’s app.config file is all it took.&#160; I got the tip from this post:&#160; <a title="http://www.fiddler2.com/fiddler/help/hookup.asp" href="http://www.fiddler2.com/fiddler/help/hookup.asp">http://www.fiddler2.com/fiddler/help/hookup.asp</a></p>  <p>The magic lines are as follows:</p>  <p>&lt;<b>system.net</b>&gt;    <br />&#160;&#160;&#160; &lt;defaultProxy&gt;    <br />&#160;&#160;&#160;&#160;&#160; &lt;proxy bypassonlocal=&quot;false&quot; usesystemdefault=&quot;true&quot; /&gt;    <br />&#160;&#160;&#160; &lt;/defaultProxy&gt;    <br />&#160; &lt;/<b>system.net</b>&gt;    <br />&lt;/configuration&gt;</p>  <p>That’s it!&#160; Now, Fiddler just sees the traffic.&#160; I’m a happy camper.</p>  <p><a href="http://peterkellner.net/wp/wp/wp-content/uploads/2011/04/image2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/wp/wp/wp-content/uploads/2011/04/image_thumb2.png" width="721" height="357" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/04/25/getting-fiddler-to-see-you-wcf-traffic/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>MVC3 Unable To Return Large JSON Even with Web Config Patch, Using LargeJsonResult Instead</title>
		<link>http://peterkellner.net/2011/03/21/mvc3-unable-to-return-large-json-even-with-web-config-patch-using-largejsonresult-instead/</link>
		<comments>http://peterkellner.net/2011/03/21/mvc3-unable-to-return-large-json-even-with-web-config-patch-using-largejsonresult-instead/#comments</comments>
		<pubDate>Mon, 21 Mar 2011 18:11:25 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[JSON]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/03/21/mvc3-unable-to-return-large-json-even-with-web-config-patch-using-largejsonresult-instead/</guid>
		<description><![CDATA[I’m trying to download a base64 encoded image that is about 4 Megabytes embedded inside a JSON object.&#160; When I first tried this from my MVC3 Web application, I got the error:     Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on [...]]]></description>
			<content:encoded><![CDATA[<p>I’m trying to download a base64 encoded image that is about 4 Megabytes embedded inside a <a href="http://json.org/">JSON</a> object.&#160; When I first tried this from my <a href="http://www.asp.net/mvc/mvc3">MVC3 Web application</a>, I got the error:</p>  <blockquote>   <h4><i>Error during serialization or deserialization using the JSON JavaScriptSerializer. The length of the string exceeds the value set on the maxJsonLength property.</i></h4> </blockquote>  <p>&#160;</p>  <span id="more-1450"></span>  <p>I then tried to set the web.config property that everyone seems to reference on the web as follows:</p>  <p>&#160;</p>  <div id="codeSnippetWrapper">   <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">&lt;</span><span style="color: #800000">system.web.extensions</span><span style="color: #0000ff">&gt;</span> <br />    <span style="color: #0000ff">&lt;</span><span style="color: #800000">scripting</span><span style="color: #0000ff">&gt;</span> <br />        <span style="color: #0000ff">&lt;</span><span style="color: #800000">webServices</span><span style="color: #0000ff">&gt;</span> <br />            <span style="color: #0000ff">&lt;</span><span style="color: #800000">jsonSerialization</span> <span style="color: #ff0000">maxJsonLength</span><span style="color: #0000ff">=&quot;2147483645&quot;</span> <span style="color: #ff0000">recursionLimit</span><span style="color: #0000ff">=&quot;100&quot;</span><span style="color: #0000ff">&gt;</span> <br />            <span style="color: #0000ff">&lt;/</span><span style="color: #800000">jsonSerialization</span><span style="color: #0000ff">&gt;</span> <br />        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">webServices</span><span style="color: #0000ff">&gt;</span> <br />        <span style="color: #0000ff">&lt;/</span><span style="color: #800000">scripting</span><span style="color: #0000ff">&gt;</span> <br /><span style="color: #0000ff">&lt;/</span><span style="color: #800000">system.web.extensions</span><span style="color: #0000ff">&gt;</span> <br /><br /></pre>

  <br /></div>

<p>However, I kept getting the same error over and over.&#160; So, I used the technique suggested in this article</p>

<p><a title="http://thoughtfulcode.wordpress.com/2011/01/03/custom-jsonresult-class-for-asp-net-mvc-to-avoid-maxjsonlength-exceeded-exception/" href="http://thoughtfulcode.wordpress.com/2011/01/03/custom-jsonresult-class-for-asp-net-mvc-to-avoid-maxjsonlength-exceeded-exception/">http://thoughtfulcode.wordpress.com/2011/01/03/custom-jsonresult-class-for-asp-net-mvc-to-avoid-maxjsonlength-exceeded-exception/</a></p>

<p>by <a href="http://thoughtfulcode.wordpress.com/about/">Brian Reiter</a> to create an override of the JsonResult class.&#160; That actually worked for me, however unfortunately, it does not show the shape of the data that is currently being returned by MVC3.&#160; That is, MVC3 currently returns a JsonResult as follows:</p>

<p>&#160;</p>

<div>
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">return</span> Json(<span style="color: #0000ff">new</span><br />{<br />    total = blobs.Count,<br />    data = blobs.ToList()<br />}, JsonRequestBehavior.AllowGet);</pre>
</div>

<div>&#160;</div>

<div>Brian suggest in his article to return his LargeJsonResult, do the following:</div>

<div>&#160;</div>

<div>
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">return</span> <span style="color: #0000ff">new</span> LargeJsonResult() { Data = output, MaxJsonLength = <span style="color: #0000ff">int</span>.MaxValue };<br /></pre>
</div>

<div>&#160;</div>

<div>This does not quite work for what I want.&#160; For my result to work, I needed to modify the result a little and return it as follows:</div>

<div>&#160;</div>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">return</span><br />   <span style="color: #0000ff">new</span> LargeJsonResult<br />       {<br />           MaxJsonLength = 20000000,<br />           JsonRequestBehavior = JsonRequestBehavior.AllowGet,<br />           Data = <span style="color: #0000ff">new</span><br />                      {<br />                          total = blobs.Count,<br />                          data = blobs.ToList()<br />                      }<br />       };</pre>

  <br /></div>

<div>&#160;</div>

<div>Not much different, but does solve my problem.</div>

<div>&#160;</div>

<div>Thanks Brian for the nice contribution! 
  <br /></div>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/03/21/mvc3-unable-to-return-large-json-even-with-web-config-patch-using-largejsonresult-instead/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How To Gracefully Stop and Windows Azure Deployment From Visual Studio 2010</title>
		<link>http://peterkellner.net/2011/03/09/how-to-gracefully-stop-and-windows-azure-deployment-from-visual-studio-2010/</link>
		<comments>http://peterkellner.net/2011/03/09/how-to-gracefully-stop-and-windows-azure-deployment-from-visual-studio-2010/#comments</comments>
		<pubDate>Wed, 09 Mar 2011 17:00:16 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure Web Role]]></category>
		<category><![CDATA[VS2010]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2011/03/09/how-to-gracefully-stop-and-windows-azure-deployment-from-visual-studio-2010/</guid>
		<description><![CDATA[The way I do Windows Azure development is that I have OneClick Deployment setup on my Azure host.&#160; This means I can simply and quickly update what I have on my Azure WebRole and test it without going through the 10 to 20 minute deployment process.&#160; Sometimes, when I’m tired, I accidentally press the “Debug” [...]]]></description>
			<content:encoded><![CDATA[<p>The way I do <a href="http://www.microsoft.com/windowsazure/">Windows Azure</a> development is that I have <a href="http://social.technet.microsoft.com/Forums/en/windowsazuredata/thread/aedbfdd4-0092-4b10-a84f-ba816438ed54">OneClick Deployment</a> setup on my Azure host.&#160; This means I can simply and quickly update what I have on my Azure WebRole and test it without going through the 10 to 20 minute deployment process.&#160; Sometimes, when I’m tired, I accidentally press the “Debug” or “Run” button on my <a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions">Visual Studio 2010</a> cloud project.&#160; This launches a 2 or 3 minute process that I have trouble killing.</p>  <p>Today, I accidentally figured out a way to stop it.&#160; Simply go to the web project and right mouse button on your project and say “Publish”. You will be immediately presented with an option to stop the deployment!</p>  <p>That’s it.&#160; Simple, but pretty undiscoverable IMHO.</p>  <p>&#160;</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/How-To-Gracefully-Stop-and-Windows-Azure_7C9D/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/How-To-Gracefully-Stop-and-Windows-Azure_7C9D/image_thumb.png" width="244" height="95" /></a></p>  <p>&#160;</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/How-To-Gracefully-Stop-and-Windows-Azure_7C9D/SNAGHTMLc6db08a.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="SNAGHTMLc6db08a" border="0" alt="SNAGHTMLc6db08a" src="http://peterkellner.net/FilesForWebDownload/How-To-Gracefully-Stop-and-Windows-Azure_7C9D/SNAGHTMLc6db08a_thumb.png" width="287" height="369" /></a></p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2011/03/09/how-to-gracefully-stop-and-windows-azure-deployment-from-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pinning Watch Variables While Debugging Visual Studio 2010, Awesome Feature</title>
		<link>http://peterkellner.net/2010/12/08/pinning-watch-variables-while-debugging-visual-studio-2010/</link>
		<comments>http://peterkellner.net/2010/12/08/pinning-watch-variables-while-debugging-visual-studio-2010/#comments</comments>
		<pubDate>Wed, 08 Dec 2010 18:11:25 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/12/08/pinning-watch-variables-while-debugging-visual-studio-2010/</guid>
		<description><![CDATA[I just have to blog about what a helpful feature this is that the VS team added in VS2010.&#160; That is, as you are debugging, you can set a watch variable and pin it to your source code.&#160; In previous versions, you needed to basically go through the hassle of setting conditional break points to [...]]]></description>
			<content:encoded><![CDATA[<p>I just have to blog about what a helpful feature this is that the VS team added in <a href="http://www.microsoft.com/visualstudio/en-us/products/2010-editions">VS2010</a>.&#160; That is, as you are <a href="http://weblogs.asp.net/scottgu/archive/2010/08/18/debugging-tips-with-visual-studio-2010.aspx">debugging</a>, you can set a watch variable and pin it to your source code.&#160; In previous versions, you needed to basically go through the hassle of setting conditional break points to do simple debugging or be prepared to do lots of mouse clicking.&#160; In the latest version, all you have to do is click the little thumb tack icon and drag the variable to where you want to see it. Here is what your screen looks like.</p>  <p>&#160;</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/Pinning-Watch-Variables-While-Debugging-_87E9/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Pinning-Watch-Variables-While-Debugging-_87E9/image_thumb.png" width="430" height="174" /></a></p>  <span id="more-1420"></span>  <p>The way I got here was to first hover over the variable I wanted to look at.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/Pinning-Watch-Variables-While-Debugging-_87E9/image_3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Pinning-Watch-Variables-While-Debugging-_87E9/image_thumb_3.png" width="355" height="68" /></a></p>  <p>Then, expand the details and press the push pin with the red arrow pointing at it.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/Pinning-Watch-Variables-While-Debugging-_87E9/image_4.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Pinning-Watch-Variables-While-Debugging-_87E9/image_thumb_4.png" width="712" height="208" /></a></p>  <p>Pressing the push pin puts the variable on your desktop and lets you drag it where ever you want.&#160; The other nice thing is it stays there after you close visual studio and bring it up again (for those of us that require more than one debugging session to find a problem).</p>  <p>A very nice feature!&#160; </p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/12/08/pinning-watch-variables-while-debugging-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>A Simple MultiThreading Pattern For C# With No Statics.  Shows Compressing A File With GZip</title>
		<link>http://peterkellner.net/2010/12/04/simple-multithreading-pattern-for-c-sharp-with-no-statics-and-gzip-compression/</link>
		<comments>http://peterkellner.net/2010/12/04/simple-multithreading-pattern-for-c-sharp-with-no-statics-and-gzip-compression/#comments</comments>
		<pubDate>Sat, 04 Dec 2010 15:09:03 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[VS2010]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[gzip]]></category>
		<category><![CDATA[threading]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/12/04/simple-multithreading-pattern-for-c-sharp-with-no-statics-and-gzip-compression/</guid>
		<description><![CDATA[Background  This post shows a very simple technique for processing a gzip compression on a background thread using c# with Visual Studio 2010.&#160; What is unique here is we are using no statics to do it.&#160; I’m not totally against using statics, but in general, it is best to avoid them.&#160; I’ve heard the [...]]]></description>
			<content:encoded><![CDATA[<h2>Background</h2>  <p>This post shows a very simple technique for processing a <a href="http://msdn.microsoft.com/en-us/library/system.io.compression.gzipstream.aspx">gzip</a> compression on a background <a href="http://msdn.microsoft.com/en-us/library/aa645740(VS.71).aspx">thread</a> using <a href="http://msdn.microsoft.com/en-us/vcsharp/default.aspx">c#</a> with <a href="http://msdn.microsoft.com/en-us/vstudio/default.aspx">Visual Studio 2010</a>.&#160; What is unique here is we are using no statics to do it.&#160; I’m not totally against using statics, but in general, it is best to avoid them.&#160; I’ve heard the notorious <a href="http://www.neverindoubtnet.blogspot.com/">Ward Bell</a> say <a href="http://msdn.microsoft.com/en-us/library/98f28cdx.aspx">statics</a> are evil and have had many cases where they have bitten me.&#160; Since I heard Ward say this, I’ve been trying to avoid them where I can.</p>  <p>&#160;</p>  <h2>The Simple Problem</h2>  <p>The problem is to simply compress a file to bytes and return to us the compressed, uncompressed and byte array of the result.&#160; We can pass parameters into a thread, however we can not return them (when I say thread, I mean the anonymous method that processes our data).</p>  <span id="more-1418"></span>  <h2>Some Code</h2>  <p>So, to that end, Let’s create a main method as below.&#160; Notice that it creates a very simple anonymous method which executes the code cryptoCopress.CompressFile(…), then simply starts that thread.&#160; Once the thread starts, it simply waits for the thread to end by looping every 50 milliseconds on the thread.IsAlive method.&#160; Finally, when it returns, it simply looks at the cryptCompress object for the results.&#160; No Statics!</p>  <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:dd5555c2-7bcc-4715-9cc2-b94a7ef4604b" class="wlWriterEditableSmartContent"><p><div>Code:<a href="http://peterkellner.net/FilesForWebDownload/A-Simple-MultiThreading-Pattern-For-C_6021/MultiThreadingInCSharpSimple.zip" target="_self">MultiThreadingInCSharpSimple.zip</a></div></p></div>  <p>&#160;</p>  <div id="codeSnippetWrapper">   <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">private</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> Main(<span style="color: #0000ff">string</span>[] args)<br />{<br />    var cryptCompress =<br />        <span style="color: #0000ff">new</span> CryptCompress();<br />    var thread =<br />        <span style="color: #0000ff">new</span> Thread(<br />            () =&gt;<br />            cryptCompress.CompressFile<br />                (<span style="color: #006080">@&quot;G:\NoBackup\ext-3.2.1\ext-all-debug-w-comments.js&quot;</span>));<br />    thread.Start();<br /><br />    <span style="color: #0000ff">int</span> cnt = 0;<br />    <span style="color: #0000ff">while</span> (thread.IsAlive)<br />    {<br />        cnt++;<br />        Console.WriteLine(<span style="color: #006080">&quot;Waiting... &quot;</span> + cnt);<br />        Thread.Sleep(50);<br />    }<br />    Console.WriteLine(<span style="color: #006080">&quot;Before Compression KBytes: {0}&quot;</span>,<br />                        cryptCompress.BeforeCompressionBytes/1000);<br />    Console.WriteLine(<span style="color: #006080">&quot;After Compression KBytes: {0}&quot;</span>,<br />                        cryptCompress.AfterCompressionBytes/1000);<br />}</pre>

  <br /></div>

<p>Now, Lets look at the CryptCompress class.&#160; Notice that it’s basically got one public method (CompressFile) and 3 public properties that will be used to hold the return values.&#160; This way, the main method that started the thread can get the results.&#160; Again, notice that there is no word static any place in this project.</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">class</span> CryptCompress<br />{<br /><span style="color: #0000ff">public</span> <span style="color: #0000ff">byte</span>[] CompressedBytes { get; set; }<br /><span style="color: #0000ff">public</span> <span style="color: #0000ff">long</span> BeforeCompressionBytes { get; set; }<br /><span style="color: #0000ff">public</span> <span style="color: #0000ff">long</span> AfterCompressionBytes { get; set; }<br /><br /><span style="color: #0000ff">public</span> <span style="color: #0000ff">void</span> CompressFile(<span style="color: #0000ff">string</span> fileName)<br />{<br />    <span style="color: #0000ff">using</span> (var fileStream = <br />        <span style="color: #0000ff">new</span> FileStream(fileName, FileMode.Open, FileAccess.Read))<br />    {<br />        var uncompressedBytes = <span style="color: #0000ff">new</span> <span style="color: #0000ff">byte</span>[fileStream.Length];<br />        fileStream.Read(uncompressedBytes, 0, <br />            (<span style="color: #0000ff">int</span>) fileStream.Length);<br />        CompressedBytes = CompressGzip(uncompressedBytes);<br />        BeforeCompressionBytes = fileStream.Length;<br />        AfterCompressionBytes = CompressedBytes.Length;<br />        fileStream.Close();<br />    }<br />}<br /><br /><span style="color: #008000">/// &lt;summary&gt;</span><br /><span style="color: #008000">/// Take a simple stream of uncompressed bytes and compress them</span><br /><span style="color: #008000">/// &lt;/summary&gt;</span><br /><span style="color: #008000">/// &lt;param name=&quot;uncompressedBytes&quot;&gt;&lt;/param&gt;</span><br /><span style="color: #008000">/// &lt;returns&gt;&lt;/returns&gt;</span><br /><span style="color: #0000ff">public</span> <span style="color: #0000ff">byte</span>[] CompressGzip(<span style="color: #0000ff">byte</span>[] uncompressedBytes)<br />{<br />    <span style="color: #0000ff">using</span> (var memory = <span style="color: #0000ff">new</span> MemoryStream())<br />    {<br />        <span style="color: #0000ff">using</span> <br />            (var gZipStream = <br />                <span style="color: #0000ff">new</span> GZipStream(memory, CompressionMode.Compress, <span style="color: #0000ff">true</span>))<br />        {<br />            gZipStream.Write<br />                (uncompressedBytes, 0, uncompressedBytes.Length);<br />        }<br />        <span style="color: #0000ff">return</span> memory.ToArray();<br />    }<br />}<br />}</pre>
</div>

<p>&#160;</p>

<h2>The Results</h2>

<p>When we run this, notice that it takes 3 iterations (or 150 milliseconds) to complete. I’m only compressing a small file so no surprise.&#160; The file is actually 2.7 Megabytes and compress to .7 Megabytes.</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/A-Simple-MultiThreading-Pattern-For-C_6021/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/A-Simple-MultiThreading-Pattern-For-C_6021/image_thumb.png" width="244" height="116" /></a></p>

<p>&#160;</p>

<p>That’s it for now! Hope this helps.</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/12/04/simple-multithreading-pattern-for-c-sharp-with-no-statics-and-gzip-compression/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using SHA256Managed to Generate SHA256 Hash with Microsoft .Net Cryptography Namespace / Memory Usage Implications</title>
		<link>http://peterkellner.net/2010/12/03/using-sha256managed-to-generate-sha256-hash/</link>
		<comments>http://peterkellner.net/2010/12/03/using-sha256managed-to-generate-sha256-hash/#comments</comments>
		<pubDate>Fri, 03 Dec 2010 19:33:10 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Cryptography]]></category>
		<category><![CDATA[SHA256]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/?p=1415</guid>
		<description><![CDATA[&#160;  Background And Conclusion  In my very last post I talked about how using SHA256 seemed to not be affected by whether you use Buffered or Not Buffered streams.&#160; An astute reader (Samuel Jack) referenced an article by one of my favorite ex MIcrosoft employees (Brad Abrams) saying that almost all the .Net [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>  <h2>Background And Conclusion</h2>  <p>In my <a href="http://peterkellner.net/2010/11/24/efficiently-generating-sha256-checksum-for-files-using-csharp/">very last post</a> I talked about how using <a href="http://msdn.microsoft.com/en-us/library/d0hxa5e7.aspx">SHA256</a> seemed to not be affected by whether you use Buffered or Not Buffered streams.&#160; An astute reader (<a href="http://blog.functionalfun.net/">Samuel Jack</a>) referenced <a href="http://blogs.msdn.com/b/brada/archive/2004/04/15/114329.aspx">an article</a> by one of my favorite ex MIcrosoft employees (<a href="http://bradabrams.com/">Brad Abrams</a>) saying that almost all the .Net streams have buffering built in.</p>  <p>Well, I think SHA256Managed does not.&#160; One of the challenges I’ve been facing lately with my current project is to provide feedback while doing all kinds of byte piping (stream stuff).&#160; While figuring out how to do this, I inadvertently figured out that buffering makes a huge difference.&#160; Briefly, let me show my results first, then talk about the code that went into it.</p>  <p>Notice that when I use a 64MB Buffer, the memory used for the process is 77MB and when I use an 8MB buffer, the memory used is 17MB.&#160; Clearly the buffer allocated matters.&#160; Just for information, I’ve also included the code that does not break the SHA256 hash into blocks, and it has the same results based on the size of the Memory Buffer declared.&#160; That is, small buffer, small use, big buffer, big use.</p>  <span id="more-1415"></span>  <p><a href="http://peterkellner.net/FilesForWebDownload/Using_9C01/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Using_9C01/image_thumb.png" width="402" height="220" /></a></p>  <p><a href="http://peterkellner.net/FilesForWebDownload/Using_9C01/image_3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/Using_9C01/image_thumb_3.png" width="405" height="276" /></a></p>    <h2>The Code</h2>  <p>The code that I wrote to do this basically does a nice job of splitting up the processing so that you can log progress as it runs. I’m attaching the <a href="http://msdn.microsoft.com/en-us/vstudio/default.aspx">Visual Studio 2010</a> project here as well as pasting the relevant source code.&#160; It’s a good base to experiment with.&#160; Feel free to comment on interesting things you find experimenting with it.</p>  <p>Visual Studio 2010 Project:&#160;&#160;&#160;&#160;&#160;&#160; <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:8eb9d37f-1541-4f29-b6f4-1eea890d4876:3633437a-182a-48b1-90bc-e4ae3be04a84" class="wlWriterEditableSmartContent"><p><div><a href="http://peterkellner.net/FilesForWebDownload/Using_9C01/SHA512BufferedConsoleProject.zip" target="_self">SHA512BufferedConsoleProject.zip</a></div></p></div> </p>  <p>&#160;</p>  <div id="codeSnippetWrapper">   <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #008000">/// &lt;summary&gt;</span><br /><span style="color: #008000">/// Used so we can get MD5Hash and get progress on calculation</span><br /><span style="color: #008000">/// &lt;/summary&gt;</span><br /><span style="color: #008000">/// &lt;param name=&quot;streamIn&quot;&gt;&lt;/param&gt;</span><br /><span style="color: #008000">/// &lt;returns&gt;&lt;/returns&gt;</span><br /><span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">string</span> GetSha512Buffered(Stream streamIn)<br />{<br />    Process process = Process.GetCurrentProcess();<br />    <span style="color: #0000ff">const</span> <span style="color: #0000ff">int</span> bufferSizeForMd5Hash = 1024*1024*8; <span style="color: #008000">// 8MB</span><br />    Console.WriteLine(<span style="color: #006080">&quot;-----------------------------------&quot;</span>);<br />    Console.WriteLine(<span style="color: #006080">&quot;Memory Buffer Size {0} MB&quot;</span>, bufferSizeForMd5Hash/1000);<br />    Console.WriteLine(<span style="color: #006080">&quot;-----------------------------------&quot;</span>);<br />    <span style="color: #0000ff">string</span> hashString;<br />    <span style="color: #0000ff">using</span> (var md5Prov = <span style="color: #0000ff">new</span> SHA256Managed())<br />    {<br />        <span style="color: #0000ff">int</span> readCount;<br />        <span style="color: #0000ff">long</span> bytesTransfered = 0;<br />        var buffer = <span style="color: #0000ff">new</span> <span style="color: #0000ff">byte</span>[bufferSizeForMd5Hash];<br />        <span style="color: #0000ff">while</span> ((readCount = streamIn.Read(buffer, 0, buffer.Length)) != 0)<br />        {<br />            <span style="color: #008000">// Need to figure out if this is final block</span><br />            <span style="color: #0000ff">if</span> (bytesTransfered + readCount == streamIn.Length)<br />            {<br />                md5Prov.TransformFinalBlock(buffer, 0, readCount);<br />            }<br />            <span style="color: #0000ff">else</span><br />            {<br />                md5Prov.TransformBlock(buffer, 0, bufferSizeForMd5Hash, buffer, 0);<br />            }<br />            bytesTransfered += readCount;<br />            Console.WriteLine(<span style="color: #006080">&quot;GetSha512Buffered:{0}MB/{1}MB.   Memory Used: {2}MB&quot;</span>,<br />                                bytesTransfered/1000000,<br />                                streamIn.Length/1000000,<br />                                process.PrivateMemorySize64/1000000);<br />        }<br />        hashString = BitConverter.ToString(md5Prov.Hash).Replace(<span style="color: #006080">&quot;-&quot;</span>, String.Empty);<br />        md5Prov.Clear();<br />    }<br />    <span style="color: #0000ff">return</span> hashString;<br />}</pre>

  <br /></div>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/12/03/using-sha256managed-to-generate-sha256-hash/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Building Job Ads Management Module With LightSwitch Beta 1 For Silicon Valley Code Camp</title>
		<link>http://peterkellner.net/2010/09/30/building-job-ads-management-module-with-lightswitch-beta-1-for-silicon-valley-code-camp/</link>
		<comments>http://peterkellner.net/2010/09/30/building-job-ads-management-module-with-lightswitch-beta-1-for-silicon-valley-code-camp/#comments</comments>
		<pubDate>Thu, 30 Sep 2010 15:34:29 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[LightSwitch]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/?p=1370</guid>
		<description><![CDATA[&#160;  The End Result  &#160;   &#160;  Motivation  As you can imagine, The Silicon Valley Code Camp web site has lots of “back end” functions that need to be done. That is, things like doing mailings, assigning roles to users, making schedules, allocating rooms and times and literally&#160; hundreds of [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>  <h2>The End Result</h2>  <p>&#160;<a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_17.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_17.png" width="398" height="318" /></a> </p>  <p>&#160;</p>  <h2>Motivation</h2>  <p>As you can imagine, The <a href="http://www.siliconvalley-codecamp.com/" target="_blank">Silicon Valley Code Camp</a> web site has lots of “back end” functions that need to be done. That is, things like doing mailings, assigning roles to users, making schedules, allocating rooms and times and literally&#160; hundreds of other tasks like that.&#160; Over the 5 years of code camp, I’ve always built simple protected asp.net web pages to do this.&#160; I’ve always used the simplest asp.net control I could find, such as GridView, DetailsView, DropDownList, and SqlDataSource.&#160; The interfaces usually basically work but are very clumsy and lacking in both functionality and aesthetics.</p>  <p>&#160;</p>  <h2>Why Now</h2>  <p>I’ve seen lots of short demos on <a href="http://msdn.microsoft.com/en-us/lightswitch/default.aspx" target="_blank">LightSwitch for Visual Studio</a> and recently read on someone else&#8217;s blog that they are now building all their simple applications using LIghtSwitch.&#160; Also, my friend <a href="http://blogs.msdn.com/b/bethmassi/" target="_blank">Beth Massi</a> has been running around the world espousing the greatness of this product and I knew if I ran into any dumb issues that she’d bail me out (I’m the king of running into dumb issues.&#160; I’ve found that given two choices that seem right, I always pick the wrong one which is what actually happened here along the way, and Beth did bail me out).</p> <span id="more-1370"></span>  <p>&#160;</p>  <h2>First Blood</h2>  <p>First thing to do (after installing LightSwitch) is to say “File/New/Project”.&#160; My plan is to add this project right off my SV Codecamp solution.&#160; So, here goes.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb.png" width="309" height="180" /></a> </p>  <p>So far so good.&#160; Next step is to choose attach to an external database</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_3.png" width="329" height="113" /></a> </p>  <p>Continuing, but don’t get tripped up here like I did.&#160; You will use WCF RIA Services under the covers but you don’t want to select that choice.&#160; You want to say that you want to connect to a database and let LightSwitch do the work for you.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_4.png" width="341" height="230" /></a> </p>  <p>PIck your database and connection strings.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_5.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_5.png" width="217" height="310" /></a> </p>  <p>Now, pick the tables you plan on working with.&#160; If this were Linq2sql, I’d be choosing them all, but now that I’m in RIA Services land, I’m hoping I can&#160; have separate “Domains” and not have to reference all the tables all the time.&#160; Jury is still out on that one but for now, I’m following the advice of the team and just picking the tables I want to manage now.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_6.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_6.png" width="327" height="114" /></a> </p>  <p>And, I’m going to name the Data Source “svcodecampDataJobs”.&#160; I’ll have to see how this goes and report later.&#160; I’m doing this live so I really don’t know where I’ll end up.</p>  <p>click finish, then rebuild all and it&#160; all works.&#160; It comes up with this screen showing me my relationship between the tables. It is showing me a Company table with a link to a JobListing table which is what I have. Here is what LightSwitch shows me.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_7.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_7.png" width="384" height="384" /></a> </p>  <p>The reality of my database is that I also have a JobListingDates table that is now shown here.&#160; Taking a step backwards to explain my database, I have a simple company table, the company has a detail table associated with it called JobListings, and the JobListings table has a details file associated with it called JobListingsDates.&#160; That is, a company may run an ad for 30 days, take it down for 30,and bring it back up again.</p>  <p>Here is what that schema actually looks like in SqlManager from EMS.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_8.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_8.png" width="370" height="336" /></a> </p>  <p>&#160;</p>  <p>One thing I like about great software is that it has things that are discoverable.&#160; So, just now, I double clicked on the little table called JobListings and the view changed to having JobListing as primary and if you look on the bottom right, it shows JobListingDate.&#160; Very cool.&#160; I have no idea where this is all going but I’m starting to get excited.&#160; Here is what I’m looking at now.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_9.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_9.png" width="377" height="377" /></a> </p>  <p>&#160;</p>  <h2>Building a Screen</h2>  <p>&#160;</p>  <p>So now, let’s push the “Screen” button and see what happens (while looking at the Company View).</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_10.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_10.png" width="323" height="102" /></a> </p>  <p>This is nice, I get a list of sample screens.&#160; How about if we build an Editable Grid Screen with the hope of editing and adding new Companies.&#160; Notice that I’m naming it EditableGridCompany and chosing the Company for the data in the dropdown.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_11.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_11.png" width="362" height="266" /></a></p>  <p>You now get a screen that is a little scary looking so rather than actually try and understand it, I thought “maybe I’m done, maybe this will just run”.&#160; So, here goes, Debug/Start Without Debug.&#160; Here is the scary screen, followed by what happens after the run.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_12.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_12.png" width="399" height="344" /></a> </p>  <p>And the Run:</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_13.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_13.png" width="427" height="303" /></a> </p>  <p>Wow!&#160; Paging, Fancy editing including date pickers, exporting to Excel, Inserts, Updates and Deletes on the company table.&#160; This is amazing.&#160; Let me add another Grid so that I can add JobListings to the company.&#160; To do that, go back to the solution explorer and choose add screen.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_14.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_14.png" width="218" height="244" /></a> </p>  <p>Then again, I have choices.</p>  <p>I choose Details Screen and check Company in the dropdown, Company Details and Company JobListings for the additional data.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_15.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_15.png" width="399" height="292" /></a> </p>  <p>Another intimidating screen, but simply do Debug/Debug Start.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_16.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/BuildingJobAdsManagementWithLightSwitchB_13C17/image_thumb_16.png" width="415" height="229" /></a></p>  <p>&#160;</p>  <p>Well, that’s it for now.&#160; Code Camp is 4 days away and I don’t really have time to take this to the next level.&#160; You can see from the screen at the top of the post that this is pretty amazing for the effort!&#160; I’m sure I’ll be back to this.</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/09/30/building-job-ads-management-module-with-lightswitch-beta-1-for-silicon-valley-code-camp/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>How To View Your Blob Storage in Windows Azure</title>
		<link>http://peterkellner.net/2010/09/02/viewing-azure-blog-storage-in-visual-studio-2010/</link>
		<comments>http://peterkellner.net/2010/09/02/viewing-azure-blog-storage-in-visual-studio-2010/#comments</comments>
		<pubDate>Thu, 02 Sep 2010 13:20:35 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Azure]]></category>
		<category><![CDATA[Azure Blob Storage]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/09/02/viewing-azure-blog-storage-in-visual-studio-2010/</guid>
		<description><![CDATA[I’m just starting to use Windows Azure for a project and plan on using the Azure Blob Storage part.&#160; I won’t go into the details here, but let’s say I figured it out far enough so that I have pushed some piles of data into the blog storage.&#160;&#160; Now, I want to see them.&#160; I [...]]]></description>
			<content:encoded><![CDATA[<p>I’m just starting to use Windows Azure for a project and plan on using the <a href="http://msdn.microsoft.com/en-us/library/dd135733.aspx">Azure Blob Storage</a> part.&#160; I won’t go into the details here, but let’s say I figured it out far enough so that I have pushed some piles of data into the blog storage.&#160;&#160; Now, I want to see them.&#160; I assumed that from the Azure portal, there would be some interface where I could see what I actual did and am being billed from.&#160; I posted to the forums and basically was told that’s not really the case.&#160; Here is the post with the answer saying you need some other software to do it (details below).</p>  <p>My friend <a href="http://robindotnet.wordpress.com/">RobinDotNet</a> suggested I look at his <a href="http://blogs.msdn.com/b/jnak/archive/2010/06/10/windows-azure-storage-browser-in-the-visual-studio-server-explorer.aspx">article</a> about how to use Visual Studio 2010 to view the blob storage.&#160; Sure enough, in VS, I can set my account and key in server explorer and see the blob storage!&#160; Thanks Robin.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/HowToViewYourBlobStorageinWindowsAzure_5925/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/HowToViewYourBlobStorageinWindowsAzure_5925/image_thumb.png" width="283" height="232" /></a> </p> <span id="more-1360"></span>  <p>&#160;</p>  <p><a href="http://social.msdn.microsoft.com/Forums/en-US/windowsazure/thread/eb624e14-9f89-4846-89d5-d17d78c6c87f/">Link to Thread with details below:</a></p>  <p><em>Reply:</em></p>  <p><em>The billing portal will give you a fairly detailed report on your storage consumption (it&#8217;s about 4 hours behind realtime). You can get to this from the Azure portal (should be near the upper-right by your Live ID). This won&#8217;t give you per-container breakdowns or anything that detailed though.</em></p>  <p><em>This Azure Storage Team </em><a href="http://blogs.msdn.com/b/windowsazurestorage/archive/2010/07/09/understanding-windows-azure-storage-billing-bandwidth-transactions-and-capacity.aspx"><em>blog post</em></a><em> gives a fairly detailed breakdown of how consumption is computed. Knowing this, you could create a more detailed storage consumption report than the billing report by enumerating your containers, then enumerating each blob within the containers and reading each blob&#8217;s size (via CloudBlob.Properties.Length).</em></p>  <p><em>There&#8217;s nothing I know of that will give you a bandwidth breakdown for each container. For that, you&#8217;d need to create some sort of service tier, where you could then retrieve the blob in question and accumulate your own stats within that service tier.</em></p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/09/02/viewing-azure-blog-storage-in-visual-studio-2010/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Creating New Overloaded Methods in Visual Studio C# is Really Easy with CodeRush</title>
		<link>http://peterkellner.net/2010/07/25/refactor-overload-coderush-visualstudio-2010/</link>
		<comments>http://peterkellner.net/2010/07/25/refactor-overload-coderush-visualstudio-2010/#comments</comments>
		<pubDate>Mon, 26 Jul 2010 01:48:35 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[CodeRush]]></category>
		<category><![CDATA[DevExpress]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/07/25/refactor-overload-coderush-visualstudio-2010/</guid>
		<description><![CDATA[So, you want to add a couple extra parameters to an existing method in Visual Studio, while not having to change all your existing code to call the new method signature?&#160; It’s easy with CodeRush from Devexpress.&#160; In this post, I’ll start with a simple method and add some parameters to it, then do the [...]]]></description>
			<content:encoded><![CDATA[<p>So, you want to add a couple extra parameters to an existing method in <a href="http://www.microsoft.com/visualstudio/en-us/">Visual Studio</a>, while not having to change all your existing code to call the new method signature?&#160; It’s easy with <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/">CodeRush</a> from <a href="http://www.devexpress.com/">Devexpress</a>.&#160; In this post, I’ll start with a simple method and add some parameters to it, then do the magic refactor.</p>  <p>Here is the starting code.</p>  <div id="codeSnippetWrapper">   <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">int</span> SynchronizeScopesAsyncStart(<br />  <span style="color: #0000ff">int</span> dbSyncPairId, <span style="color: #0000ff">string</span> schemaName, <br />  <span style="color: #0000ff">string</span> connectionStringLeft,<br />  <span style="color: #0000ff">string</span> scopeLeft, <span style="color: #0000ff">string</span> connectionStringRight, <br />  <span style="color: #0000ff">string</span> scopeRight, <span style="color: #0000ff">bool</span> skipDbLogging)<br />    {...</pre>

  <br /></div>
<span id="more-1344"></span>

<p>So, We need to add a couple new parameters as follows.</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">public</span> <span style="color: #0000ff">static</span> <span style="color: #0000ff">int</span> SynchronizeScopesAsyncStart<br />           (<span style="color: #0000ff">int</span> dbSyncPairId, <span style="color: #0000ff">string</span> schemaName,<br />            <span style="color: #0000ff">string</span> connectionStringLeft,<br />            <span style="color: #0000ff">string</span> scopeLeft, <span style="color: #0000ff">string</span> connectionStringRight,<br />            <span style="color: #0000ff">string</span> scopeRight, <span style="color: #0000ff">bool</span> skipDbLogging,<br />            <span style="color: #0000ff">int</span> pauseMsScopeLeft,<span style="color: #0000ff">int</span> pauseMsScopeRight)<br />        {</pre>

  <br /></div>

<p>So now, we want to create an overloaded method with the two new parameters (pauseMsScopeLeft and pauseMsScopeRight) left out.&#160; </p>

<p>The way we do this is first, hover the cursor over the method name (SynchronizeScopeAsynStart) as follows.</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/CreatingNewOverloadedMethodsinCisReallyE_1086D/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/CreatingNewOverloadedMethodsinCisReallyE_1086D/image_thumb.png" width="491" height="166" /></a> </p>

<p>Notice the helper message telling us</p>

<blockquote>
  <p>Create an overloaded method similar to this one with fewer parameters.</p>
</blockquote>

<p>This is exactly what we want to do so we chose this by pressing enter.&#160; CodeRush now gives us a red arrow pointer telling us where it will put the overloaded method by default as well as giving us some instructions on how to put the method someplace else.&#160; In our case, I’m happy to have it right below where the original method is, so I just press enter.</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/CreatingNewOverloadedMethodsinCisReallyE_1086D/image_3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/CreatingNewOverloadedMethodsinCisReallyE_1086D/image_thumb_3.png" width="519" height="375" /></a> </p>

<p>Now, is the really clever part.&#160; I can simply follow the little helper window and move through the parameter list and exclude parameters I don’t want in the parameter list of my new overloaded method.&#160; In my case, I want to get rid of the last two parameters.&#160; It highlights the last one to start, so I simply press “space” as it says, then I press Shift-Tab to get to the previous parameter, space bar again to exclude that one and I’m almost done.&#160; Here is the screen I’m now looking at.</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/CreatingNewOverloadedMethodsinCisReallyE_1086D/image_4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/CreatingNewOverloadedMethodsinCisReallyE_1086D/image_thumb_4.png" width="536" height="353" /></a> </p>

<p>Finally, I press enter to commit my changes and I have a new overloaded method that looks like the following.</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/CreatingNewOverloadedMethodsinCisReallyE_1086D/image_5.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/CreatingNewOverloadedMethodsinCisReallyE_1086D/image_thumb_5.png" width="562" height="227" /></a> </p>

<p>You can continue with the refactoring and tell CodeRush to “inline” your temporary variables, but I think this is enough for now.</p>

<p>Hope this helps!</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/07/25/refactor-overload-coderush-visualstudio-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Another Nice DevExpress CodeRush Refactoring</title>
		<link>http://peterkellner.net/2010/07/04/coderush-factorings-introduce-lambda-using-statements/</link>
		<comments>http://peterkellner.net/2010/07/04/coderush-factorings-introduce-lambda-using-statements/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 16:42:26 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[CodeRush]]></category>
		<category><![CDATA[Refactor]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/07/04/coderush-factorings-introduce-lambda-using-statements/</guid>
		<description><![CDATA[For the last few days, I’ve been using DevExpress CodeRush and am finding some very useful refactorings.&#160; Many I’m not blogging about, but there are a few that I really like.&#160; In this post, I’m going to show just two of those refactorings that have been making my code much nicer and easier to write.&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>For the last few days, I’ve been using <a href="http://devexpress.com/">DevExpress</a> <a href="http://devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/">CodeRush</a> and am finding some very useful refactorings.&#160; Many I’m not blogging about, but there are a few that I really like.&#160; In this post, I’m going to show just two of those refactorings that have been making my code much nicer and easier to write.&#160; One is the “Introduce Using” refactoring, and the other is “Convert to Lambda Expression”.</p>  <p>Before I go into the details, I’d just like to disclose that when I was first writing the <a href="http://www.siliconvalley-codecamp.com/">Silicon Valley Code Camp</a> web site, I was an asp.net and c# newby.&#160; I’m not claiming wizard status now, but I have to admit that when I go back and look at some of the code I wrote back then (including what I’m showing below before the refactoring), it’s a little embarrassing.&#160; Silicon Valley Code Camp for me as “when I’m not doing real work” web site so I don’t really have the time to go back and clean things up.&#160; Now, with CodeRush, it’s easy to clean things up when I see them with very little effort.</p> <span id="more-1337"></span>  <h2>Introduce Using Statement Refactoring</h2>  <p>Here is the code I wrote 5+ years ago:</p>  <div id="codeSnippetWrapper">   <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">SqlConnection conn = <span style="color: #0000ff">new</span> SqlConnection(connectionString);<br />conn.Open();<br /><br /><span style="color: #008000">// First, make a quick list of counts for each id that is unavailable and show</span><br /><span style="color: #008000">// not be shown</span><br /><span style="color: #0000ff">string</span> selectCount = <span style="color: #006080">@&quot;select VistaSlotsId FROM attendees <br />                     WHERE VistaSlotsId &gt;= 2 AND VistaSlotsId &lt;= 5 Group By VistaSlotsId <br />                     HAVING COUNT(*) &gt;= @MaxPerSlot  &quot;</span>;<br />List&lt;<span style="color: #0000ff">int</span>&gt; unavailableSlotsList = <span style="color: #0000ff">new</span> List&lt;<span style="color: #0000ff">int</span>&gt;();<br />SqlDataReader readerUnavailable = <span style="color: #0000ff">null</span>;<br />SqlCommand cmdUnAvailable = <span style="color: #0000ff">new</span> SqlCommand(selectCount, conn);<br />cmdUnAvailable.Parameters.Add(<span style="color: #006080">&quot;@MaxPerSlot&quot;</span>, SqlDbType.Int).Value = maxPerSlot;<br />readerUnavailable = cmdUnAvailable.ExecuteReader();<br /><span style="color: #0000ff">try</span><br />{<br />    <span style="color: #0000ff">while</span> (readerUnavailable.Read())<br />    {<br />        <span style="color: #0000ff">int</span> id = readerUnavailable.GetInt32(0);<br />        unavailableSlotsList.Add(id);<br />    }<br />}<br /><span style="color: #0000ff">finally</span><br />{<br />    <span style="color: #0000ff">if</span> (readerUnavailable != <span style="color: #0000ff">null</span>) readerUnavailable.Close();<br />}</pre>

  <br /></div>

<p>By placing the cursor over the “conn” on the top line of the code above, CodeRush gives us the following result:</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/AnotherNiceDevExpressCodeRushRefactoring_8873/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AnotherNiceDevExpressCodeRushRefactoring_8873/image_thumb.png" width="507" height="233" /></a> </p>

<p>There are actually quite a few things happening here.</p>

<ol>
  <li>It is showing us in the top textbox what the using syntax will be </li>

  <li>It is crossing out the lines of code it will change </li>

  <li>It is teaching us a little about the using statement </li>
</ol>

<p>If I accept the changes, I get a nice refactoring.&#160; I can continue doing this with “using” for SqlCommand and SqlReader.&#160; I did need to move the SqlReader declaration inside the SqlCommand codeblock for this to work.&#160; Here is the final refactored code that took about 10 seconds.&#160; By hand, I’d say it would have taken me 3 minutes and I may have gotten it wrong which is why I would never do it before.&#160; Now, I’m confident I did not break my code.</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">using</span> (SqlConnection conn = <span style="color: #0000ff">new</span> SqlConnection(connectionString))<br />{<br />    conn.Open();<br />    <span style="color: #008000">// First, make a quick list of counts for each id that is unavailable and show</span><br />    <span style="color: #008000">// not be shown</span><br />    <span style="color: #0000ff">string</span> selectCount = <span style="color: #006080">@&quot;select VistaSlotsId FROM attendees <br />                                 WHERE VistaSlotsId &gt;= 2 AND VistaSlotsId &lt;= 5 Group By VistaSlotsId <br />                                 HAVING COUNT(*) &gt;= @MaxPerSlot  &quot;</span>;<br />    List&lt;<span style="color: #0000ff">int</span>&gt; unavailableSlotsList = <span style="color: #0000ff">new</span> List&lt;<span style="color: #0000ff">int</span>&gt;();<br />    <span style="color: #0000ff">using</span> (SqlCommand cmdUnAvailable = <span style="color: #0000ff">new</span> SqlCommand(selectCount, conn))<br />    {<br />        cmdUnAvailable.Parameters.Add(<span style="color: #006080">&quot;@MaxPerSlot&quot;</span>, SqlDbType.Int).Value = maxPerSlot;<br />        <span style="color: #0000ff">using</span> (SqlDataReader readerUnavailable = cmdUnAvailable.ExecuteReader())<br />        {<br />            <span style="color: #0000ff">try</span><br />            {<br />                <span style="color: #0000ff">while</span> (readerUnavailable.Read())<br />                {<br />                    <span style="color: #0000ff">int</span> id = readerUnavailable.GetInt32(0);<br />                    unavailableSlotsList.Add(id);<br />                }<br />            }<br />            <span style="color: #0000ff">finally</span><br />            {<br />                <span style="color: #0000ff">if</span> (readerUnavailable != <span style="color: #0000ff">null</span>)<br />                    readerUnavailable.Close();<br />            }<br />        }<br />    }</pre>&#160; </div>

<div>
  <br /></div>

<h2>Compress To Lambda Expression Refactoring</h2>

<p>A lot of the Silicon Valley Code Camp web site was written prior to the introduction of Lamba Expressions.&#160; If you recall, I wrote an MSDN article back in 2006 entitled <a href="http://peterkellner.net/2006/03/13/adding-personalization-via-profiles-to-the-objectdatasource-in-aspnet-20/">Adding Personalization via Profiles to the ObjectDataSource in ASP.NET 2.0.</a>&#160; <a href="http://blogs.tedneward.com/">Ted Neward</a> inspired a construct to cleverly sort the result list using delegates as shown in the screen shot (form that above post).</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/AnotherNiceDevExpressCodeRushRefactoring_8873/image_3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AnotherNiceDevExpressCodeRushRefactoring_8873/image_thumb_3.png" width="569" height="353" /></a> </p>

<p>&#160;</p>

<p>The code below is similar to the above but not quite the same.&#160; This is how it looks before the refactoring:</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">Comparison&lt;DataObjectSessionsOverview&gt; comparison = <span style="color: #0000ff">null</span>;<br />    <span style="color: #0000ff">switch</span> (sortDataBase)<br />    {<br />        <span style="color: #0000ff">case</span> <span style="color: #006080">&quot;Userfirstname&quot;</span>:<br />            comparison = <span style="color: #0000ff">new</span> Comparison&lt;DataObjectSessionsOverview&gt;(<br />               <span style="color: #0000ff">delegate</span>(DataObjectSessionsOverview lhs, DataObjectSessionsOverview rhs)<br />               {<br />                   <span style="color: #0000ff">return</span> lhs.Userfirstname.CompareTo(rhs.Userfirstname);<br />               }<br />             );<br />            <span style="color: #0000ff">break</span>;</pre>

  <br /></div>

<p>CodeRush suggests:</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/AnotherNiceDevExpressCodeRushRefactoring_8873/image_4.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AnotherNiceDevExpressCodeRushRefactoring_8873/image_thumb_4.png" width="551" height="245" /></a> </p>

<p>Which then give us:</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">switch</span> (sortDataBase)<br />{<br />   <span style="color: #0000ff">case</span> <span style="color: #006080">&quot;Userfirstname&quot;</span>:<br />       comparison = (lhs, rhs) =&gt; lhs.Userfirstname.CompareTo(rhs.Userfirstname);<br />       <span style="color: #0000ff">break</span>;</pre>

  <br /></div>

<p>I like it!</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/07/04/coderush-factorings-introduce-lambda-using-statements/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A Handy Refactoring with CodeRush (InLine Temp)</title>
		<link>http://peterkellner.net/2010/07/02/coderush-refactoring-inline-temp/</link>
		<comments>http://peterkellner.net/2010/07/02/coderush-refactoring-inline-temp/#comments</comments>
		<pubDate>Fri, 02 Jul 2010 14:34:56 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[CodeRush]]></category>
		<category><![CDATA[Refactor]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/07/02/coderush-refactoring-inline-temp/</guid>
		<description><![CDATA[I’ve recently started using CodeRush with Visual Studio 2010 and am so far very impressed with the convenience it adds to coding.&#160; One thing that is very clear is that the creators of CodeRush are real programmers and look very hard for patterns that us developers are constantly doing.&#160; As I run into these things [...]]]></description>
			<content:encoded><![CDATA[<p>I’ve recently started using <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/">CodeRush</a> with <a href="http://msdn.microsoft.com/en-us/vstudio/default.aspx">Visual Studio 2010</a> and am so far very impressed with the convenience it adds to coding.&#160; One thing that is very clear is that the creators of <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/">CodeRush</a> are real programmers and look very hard for patterns that us developers are constantly doing.&#160; As I run into these things that get my attention, I plan on blogging them.&#160; Some are just earth shattering, and others, just nice to have.&#160; This particular one is a nice to have.</p>  <p>So, say you have code like this:</p>  <p>&#160;</p>  <div>   <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">var sessionAttendeeOds = <br />  <span style="color: #0000ff">new</span> SessionAttendeeODS();<br />listSessionAttendees = <br />  sessionAttendeeOds.GetByUsername(Context.User.Identity.Name);</pre>
</div>

<div>&#160;</div>
<span id="more-1335"></span>

<div>When I first wrote code, I often do it like this thinking that I may have more methods I’m going to call against the instantiated object.&#160; In this case, many years later, I’m looking at the code and want to condense it.&#160; With <a href="http://www.devexpress.com/Products/Visual_Studio_Add-in/Coding_Assistance/">CodeRush</a>, it show me three little dots under the variable sessionAttendeeOds as follows.&#160; When I click on these three dots, I get the following screen.</div>

<p><a href="http://peterkellner.net/FilesForWebDownload/AHandyRefactoringwithCodeRushInLineTemp_6A97/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AHandyRefactoringwithCodeRushInLineTemp_6A97/image_thumb.png" width="405" height="156" /></a> </p>

<p>When I chose “InlineTemp”, the code changes to the following, make it easier to read.</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet">listSessionAttendees = <br />                <span style="color: #0000ff">new</span> SessionAttendeeODS().GetByUsername(Context.User.Identity.Name);</pre>

  <br /></div>

<p>Again, this is not a huge deal, but small fixes like this will add up over time and make my code cleaner and more readable.&#160; CodeRush makes it so easy that I’m sure I’ll do this kind of thing more and more.</p>

<p>HTH’s.</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/07/02/coderush-refactoring-inline-temp/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>A VS2010 Project Made From Post: How to: Host a WCF Service in a Managed Windows Service</title>
		<link>http://peterkellner.net/2010/06/18/wcf-service-in-managed-windows-service-vs2010-2/</link>
		<comments>http://peterkellner.net/2010/06/18/wcf-service-in-managed-windows-service-vs2010-2/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 14:37:33 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[ASP.NET 4.0]]></category>
		<category><![CDATA[VS2010]]></category>
		<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[WCF]]></category>
		<category><![CDATA[Windows Service]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/06/18/wcf-service-in-managed-windows-service-vs2010-2/</guid>
		<description><![CDATA[MSDN has a very nice article on how to create a windows service that hosts a Windows Communication Foundation (WCF) service.&#160; It explains all the details of doing this in a step by step fashion.&#160; One thing that I often find missing from these articles is the actual Visual Studio project that I can download [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://msdn.microsoft.com/en-us/library/ms733069.aspx" target="_blank">MSDN has a very nice article</a> on how to create a windows service that hosts a <a href="http://msdn.microsoft.com/en-us/netframework/aa663324.aspx" target="_blank">Windows Communication Foundation (WCF)</a> service.&#160; It explains all the details of doing this in a step by step fashion.&#160; One thing that I often find missing from these articles is the actual Visual Studio project that I can download and play with.&#160; What I usually do is put that together myself (which I’m sure is the author’s intent).</p>  <p>To save anyone some time who wants to do the same thing, I’ve created a VS2010 project from the example, added a very simple Windows C# console application that consumes the service, as well as made some small changes in a very nice Windows Presentation Foundation (WPF) <a href="http://code.google.com/p/wpf-mvvm-calculator/" target="_blank">calculator project</a> so that the calculator does it operations inside the windows service rather than in the calculator itself.</p>  <p>In this article, I’ve attached the source code (with my small changes and additions) for you to work with and change as you like.</p> <span id="more-1332"></span>  <p>First, here is the project: </p>  <div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:fb3a1972-4489-4e52-abe7-25a00bb07fdf:d3a970ab-d487-417a-bf52-fd64c206e6d2" class="wlWriterEditableSmartContent"><p>Visual Studio 2010 Project <a href="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/WCFServiceInManagedWindowsService_3.zip" target="_blank">Project Zip Here</a></p></div>  <p>Now, let’s talk about the details</p>  <p>&#160;</p>  <h2>The Visual Studio 2010 Solution Itself</h2>  <p><a href="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_11.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_thumb_9.png" width="490" height="381" /></a> </p>  <p>There are three projects in this solution.&#160; The service itself which is called WCFServiceInmanagedWindowsService, Console Application and Calculator.</p>  <p>&#160;</p>  <h3>WCFServiceInManagedWindowsService Project</h3>  <p>&#160;</p>  <p>This project is really what is taken from the <a href="http://msdn.microsoft.com/en-us/library/ms733069.aspx" target="_blank">MSDN article</a>. It’s got almost no change and is primarily created by following the directions in the article.&#160; There are a couple batch files added for creating and deleting the service itself in the root of that project directory, but that’s about it.&#160; All the code is in a file called service.cs.</p>  <p>To Add the service, go to the “Service Reference”/”Add Service” Dialog and enter the address of the service (you can find it in the app.config file).</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_12.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_thumb_10.png" width="408" height="337" /></a> </p>  <p><a href="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_13.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_thumb_11.png" width="395" height="85" /></a> </p>  <p><a title="http://localhost:8000/ServiceModelSamples/service" href="http://localhost:8000/ServiceModelSamples/service">http://localhost:8000/ServiceModelSamples/service</a></p>  <p>Notice that the methods exposed are Add/Divide/Multiple and Subtract.</p>  <p>To start the actual service, after rebuilding the project, execute the bat file InstallService.bat in the root directory.&#160; Make sure you build the release version because this script installs the service from the release directory. Once started, you will see it in the services application as follows:</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_14.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_thumb_12.png" width="354" height="178" /></a> </p>  <p>Then, start the service by running the command: “net start WCFWindowsServiceSample”&#160; If you get the error: <em>“No connection could be made because the target machine actively refused it 127.0.0.1:8000”,</em> this likely means you did not start your service.</p>  <p>&#160;</p>  <h3>The Console Application</h3>  <p>The Console application is new and very simple. All you have to do is create a new windows c# console project, use the “Add Service” DialWCFWindowsServiceSampleog and point it at&#160; ( <a title="http://localhost:8000/ServiceModelSamples/service" href="http://localhost:8000/ServiceModelSamples/service">http://localhost:8000/ServiceModelSamples/service</a> ) as follows:</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_15.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_thumb_13.png" width="288" height="317" /></a> </p>  <p>Now, you can simply write a console app with the following code and you will be calling the service correctly.&#160; Here is the code:</p>  <p>&#160;</p>  <div id="codeSnippetWrapper">   <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">class</span> Program<br />    {<br />        <span style="color: #0000ff">static</span> <span style="color: #0000ff">void</span> Main(<span style="color: #0000ff">string</span>[] args)<br />        {<br />            var calculatorClient = <span style="color: #0000ff">new</span> CalculatorClient();<br /><br />            var answer = calculatorClient.Add(5, 4);<br />            Console.WriteLine(<span style="color: #006080">&quot;Answer to Adding 5 + 4: {0}&quot;</span>, answer);<br />            Console.ReadKey();<br /><br /><br />            <br />        }<br />    }</pre>

  <br /></div>

<p>And, when we run it, now surprise, we get 9!</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_16.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_thumb_14.png" width="244" height="120" /></a> </p>

<p>…</p>

<h3>The Calculator Application</h3>

<p>Just to show a real life use of the service, I grabbed the codeplex project <a title="http://code.google.com/p/wpf-mvvm-calculator/" href="http://code.google.com/p/wpf-mvvm-calculator/">http://code.google.com/p/wpf-mvvm-calculator/</a>.</p>

<p><a href="http://code.google.com/p/wpf-mvvm-calculator/"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_17.png" width="372" height="157" /></a> </p>

<p>Then, modifying a small section of code inside (after adding the service reference of course, just like we did in the above console project, we now have a calculator that adds by calling a service for the answer.&#160; Here is the modified code:</p>

<div id="codeSnippetWrapper">
  <pre style="border-bottom-style: none; text-align: left; padding-bottom: 0px; line-height: 12pt; border-right-style: none; background-color: #f4f4f4; margin: 0em; padding-left: 0px; width: 100%; padding-right: 0px; font-family: &#39;Courier New&#39;, courier, monospace; direction: ltr; border-top-style: none; color: black; font-size: 8pt; border-left-style: none; overflow: visible; padding-top: 0px" id="codeSnippet"><span style="color: #0000ff">try</span><br />           {<br />               <span style="color: #008000">// Establish the connection to the Service</span><br />               var calculatorClient = <span style="color: #0000ff">new</span> CalculatorClient();<br />               var firstOperand = Convert.ToDouble(FirstOperand);<br />               var secondOperand = Convert.ToDouble(SecondOperand);<br /><br /><br /><br />               var stopwatch = <span style="color: #0000ff">new</span> Stopwatch();<br />               stopwatch.Start();<br /><br />               <span style="color: #0000ff">switch</span> (Operation)<br />               {<br />                   <span style="color: #0000ff">case</span> (<span style="color: #006080">&quot;+&quot;</span>):<br />                       result = calculatorClient.Add(firstOperand, secondOperand).ToString();<br />                       <span style="color: #0000ff">break</span>;<br /><br />                   <span style="color: #0000ff">case</span> (<span style="color: #006080">&quot;-&quot;</span>):<br />                       result = calculatorClient.Subtract(firstOperand, secondOperand).ToString();<br />                       <span style="color: #0000ff">break</span>;<br /><br />                   <span style="color: #0000ff">case</span> (<span style="color: #006080">&quot;*&quot;</span>):<br />                       result = calculatorClient.Multiply(firstOperand, secondOperand).ToString();<br />                       <span style="color: #0000ff">break</span>;<br /><br />                   <span style="color: #0000ff">case</span> (<span style="color: #006080">&quot;/&quot;</span>):<br />                       result = calculatorClient.Divide(firstOperand, secondOperand).ToString();<br />                       <span style="color: #0000ff">break</span>;<br />               }<br /><br />               stopwatch.Stop();</pre>

  <br /></div>

<p>And, when we run the calculator, it looks like this:</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_18.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AVS2010ProjectMadeFromPostHowtoHostaWCFS_C58D/image_thumb_15.png" width="333" height="232" /></a>&#160;</p>

<p>&#160;</p>

<h2>Conclusions</h2>

<p>In this post, we simply implemented the source as a <a href="http://www.microsoft.com/visualstudio/en-us">Visual Studio 2010</a> project from the MSDN article on how to build a windows service using WCF.&#160; It’s been pointed out that we are better off using named pipes for this kind of application for better performance, but our purpose here was just to elaborate on the existing application.</p>

<p>Hope this helps.</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/06/18/wcf-service-in-managed-windows-service-vs2010-2/feed/</wfw:commentRss>
		<slash:comments>18</slash:comments>
		</item>
		<item>
		<title>Using Visual Studio 2010&#8217;s Debugger PIN Feature</title>
		<link>http://peterkellner.net/2010/05/14/visualstudio2010-debugging-pin-variables-watch/</link>
		<comments>http://peterkellner.net/2010/05/14/visualstudio2010-debugging-pin-variables-watch/#comments</comments>
		<pubDate>Sat, 15 May 2010 04:57:26 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[VS2010]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/05/14/visualstudio2010-debugging-pin-variables-watch/</guid>
		<description><![CDATA[One of the very cool new features in Visual Studio 2010 is the ability to “Pin” a variable you are watching, right in the place you want to see it.&#160; It’s always been a hassle to have to add a “Watch” and keep track of it among all your other watch variables.&#160; I guess I [...]]]></description>
			<content:encoded><![CDATA[<p>One of the very cool new features in Visual Studio 2010 is the ability to “Pin” a variable you are watching, right in the place you want to see it.&#160; It’s always been a hassle to have to add a “Watch” and keep track of it among all your other watch variables.&#160; I guess I shouldn’t really complain because I’ve always really like the debug capabilities in Visual Studio, but I have to say, this new “Pin” is really nice.</p> <span id="more-1317"></span>  <p>&#160;</p>  <p>So, let me explain by example.&#160; </p>  <p>At the moment, I’m debugging the Silicon Valley Code Camp web site project and I’m checking a boolean I set called DoValidation.&#160; I’m trying to figure out why it is changing, but first I have to figure out when.&#160; So, I set a break point on the line as shown below:</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/UsingVisualStudio2010sDebuggerPINFeature_134A7/image.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/UsingVisualStudio2010sDebuggerPINFeature_134A7/image_thumb.png" width="444" height="203" /></a> </p>  <p>Now, I hover over the variable I want to pin and press the little pin icon shown here:</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/UsingVisualStudio2010sDebuggerPINFeature_134A7/image_3.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/UsingVisualStudio2010sDebuggerPINFeature_134A7/image_thumb_3.png" width="443" height="198" /></a> </p>  <p>I then see the following with my little watch window right in line with my code.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/UsingVisualStudio2010sDebuggerPINFeature_134A7/image_4.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/UsingVisualStudio2010sDebuggerPINFeature_134A7/image_thumb_4.png" width="447" height="144" /></a> </p>  <p>I can even click the little chevron under the pin and add a comment as I show next.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/UsingVisualStudio2010sDebuggerPINFeature_134A7/image_5.png"><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/UsingVisualStudio2010sDebuggerPINFeature_134A7/image_thumb_5.png" width="468" height="193" /></a> </p>  <p>The nice thing is that this stays here just like your break point until you close it.&#160; A very convenient feature.</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/05/14/visualstudio2010-debugging-pin-variables-watch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Authentication and Authorization Using RIA Services (Article 7 of 7)</title>
		<link>http://peterkellner.net/2010/01/25/authentication-and-authorization-using-ria-services-article-7-of-7/</link>
		<comments>http://peterkellner.net/2010/01/25/authentication-and-authorization-using-ria-services-article-7-of-7/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 23:25:12 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[RIA Services]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[VS2010]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[RIA Service Presentation]]></category>
		<category><![CDATA[RIA Services Bay.Net Presentation]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/01/25/authentication-and-authorization-using-ria-services-article-7-of-7/</guid>
		<description><![CDATA[               &#160;       Title Of Each Article       Video Included With Each Post                 Part 1 [...]]]></description>
			<content:encoded><![CDATA[<br /><table width="90%">   <tbody>     <tr>       <td width="70">&nbsp;</td>       <td>Title Of Each Article</td>       <td width="150" style="width: 100px;">Video Included With Each Post</td>     </tr>     <tr>       <td width="70">Part 1</td>       <td><a href="/2010/01/20/riaservices-silverlight-4-tutorial-svcc-part1of7-introduction/">Introduction To RIA Services In Silverlight (This Article)</a></td>       <td width="150" style="width: 100px;">7 Minutes</td>     </tr>     <tr>       <td width="70">Part 2</td>       <td><a href="/2010/01/25/basic-ria-services-and-datagrid-with-vs-2010-tooling-article-2-of-7/">Basic RIA Services And DataGrid With&nbsp; VS 2010 Tooling</a></td>       <td width="150" style="width: 100px;">14 Minutes</td>     </tr>     <tr>       <td width="70">Part 3</td>       <td><a href="/2010/01/23/adding-a-datagrid-with-connect-the-dots-databinding-in-vs-2010-article-3-of-7/">Adding A DataGrid With Connect The Dots DataBinding in VS 2010</a></td>       <td width="150" style="width: 100px;">13 Minutes</td>     </tr>     <tr>       <td width="70">Part 4</td>       <td><a href="/2010/01/25/adding-a-navigation-page-to-a-silverlight-business-application-template-article-4-of-7/">Adding a Navigation Page to a Silverlight Business Application Template</a></td>       <td width="150" style="width: 100px;">11 Minutes</td>     </tr>     <tr>       <td width="70">Part 5</td>       <td><a href="/2010/01/25/adding-speakers-page-template-with-converters-in-visual-studio-2010-beta2-article-5-of-7/">Adding Speakers Page Template With Converters In Visual Studio 2010 Beta2</a></td>       <td width="150" style="width: 100px;">11 Minutes</td>     </tr>     <tr>       <td width="70">Part 6</td>       <td><a href="/2010/01/25/adding-a-sessions-page-that-includes-a-query-parameter-in-silverlight-vs2010-article-6-of-7/">Adding A Sessions Page That Includes a Query Parameter In Silverlight VS2010 Beta2</a></td>       <td width="150" style="width: 100px;">10 Minutes</td>     </tr>     <tr>       <td width="70">Part 7</td>       <td><a href="/2010/01/25/authentication-and-authorization-using-ria-services-article-7-of-7/">Basic Authentication and Authorization In RIA Services</a></td>       <td width="150" style="width: 100px;">5 Minutes</td>     </tr> </tbody></table><br />  <br /><img src="http://video.peterkellner.net/video/RIAServicesBayNet20090120/P7_AuthenticationAndAuthorization_Thumb.jpg" alt="media" /><br />
   <p>This article is very short.&#160; In the actual presentation, there was not much time to talk about this so a brief overview was done.&#160; Basically, it’s all standard WCF stuff.&#160; The idea is that the Silverlight Business Template adds logging in and supports Authentication just like an asp.net application does.&#160; It uses the DomainDataSource to do the bridging between the silverlight clientside app, and the web application.&#160; Authorization is built into the login module also so that you can assign attributes to your domainservice classes to restrict access.</p> <span id="more-484"></span> <p>That is, if you only want people who are logged in able to access one of your methods, you simply tag it as follows with the [RequiresAuthentication] attribute.</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/AuthenticationandAuthorizationUsingRIASe_E1CB/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AuthenticationandAuthorizationUsingRIASe_E1CB/image_thumb.png" width="694" height="222" /></a></p>  <p>If you only want a certain logged in user role to be able to access a certain method, you tag it as follows</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/AuthenticationandAuthorizationUsingRIASe_E1CB/image_3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AuthenticationandAuthorizationUsingRIASe_E1CB/image_thumb_3.png" width="710" height="151" /></a></p>  <p>This of course solve the server side only.&#160; On the client side, you need to call methods that are exposed through the domain data.&#160; <a title="http://www.silverlightshow.net/items/Silverlight-3-with-Ria-Authentication-service.aspx" href="http://www.silverlightshow.net/items/Silverlight-3-with-Ria-Authentication-service.aspx">http://www.silverlightshow.net/items/Silverlight-3-with-Ria-Authentication-service.aspx</a> discusses much of this on the client side.</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/01/25/authentication-and-authorization-using-ria-services-article-7-of-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://video.peterkellner.net/video/RIAServicesBayNet20090120/P7_AuthenticationAndAuthorization.flv" length="1" type="video/x-flv"/>
	</item>
		<item>
		<title>Adding A Sessions Page That Includes a Query Parameter In Silverlight VS2010 Beta2 (Article 6 of 7)</title>
		<link>http://peterkellner.net/2010/01/25/adding-a-sessions-page-that-includes-a-query-parameter-in-silverlight-vs2010-article-6-of-7/</link>
		<comments>http://peterkellner.net/2010/01/25/adding-a-sessions-page-that-includes-a-query-parameter-in-silverlight-vs2010-article-6-of-7/#comments</comments>
		<pubDate>Mon, 25 Jan 2010 23:22:47 +0000</pubDate>
		<dc:creator>Peter Kellner</dc:creator>
				<category><![CDATA[.NET 4.0]]></category>
		<category><![CDATA[C#]]></category>
		<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[LINQ]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[RIA Services]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[VS2010]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>

		<guid isPermaLink="false">http://peterkellner.net/2010/01/25/adding-a-sessions-page-that-includes-a-query-parameter-in-silverlight-vs2010-article-6-of-7/</guid>
		<description><![CDATA[&#160;              &#160;        Title Of Each Article        Video Included With Each Post                  [...]]]></description>
			<content:encoded><![CDATA[<p>&#160;</p>  <table width="90%"><tbody>     <tr>       <td width="70">&#160;</td>        <td>Title Of Each Article</td>        <td style="width: 100px" width="150">Video Included With Each Post</td>     </tr>      <tr>       <td width="70">Part 1</td>        <td><a href="/2010/01/20/riaservices-silverlight-4-tutorial-svcc-part1of7-introduction/">Introduction To RIA Services In Silverlight (This Article)</a></td>        <td style="width: 100px" width="150">7 Minutes</td>     </tr>      <tr>       <td width="70">Part 2</td>        <td><a href="/2010/01/25/basic-ria-services-and-datagrid-with-vs-2010-tooling-article-2-of-7/">Basic RIA Services And DataGrid With&#160; VS 2010 Tooling</a></td>        <td style="width: 100px" width="150">14 Minutes</td>     </tr>      <tr>       <td width="70">Part 3</td>        <td><a href="/2010/01/23/adding-a-datagrid-with-connect-the-dots-databinding-in-vs-2010-article-3-of-7/">Adding A DataGrid With Connect The Dots DataBinding in VS 2010</a></td>        <td style="width: 100px" width="150">13 Minutes</td>     </tr>      <tr>       <td width="70">Part 4</td>        <td><a href="/2010/01/25/adding-a-navigation-page-to-a-silverlight-business-application-template-article-4-of-7/">Adding a Navigation Page to a Silverlight Business Application Template</a></td>        <td style="width: 100px" width="150">11 Minutes</td>     </tr>      <tr>       <td width="70">Part 5</td>        <td><a href="/2010/01/25/adding-speakers-page-template-with-converters-in-visual-studio-2010-beta2-article-5-of-7/">Adding Speakers Page Template With Converters In Visual Studio 2010 Beta2</a></td>        <td style="width: 100px" width="150">11 Minutes</td>     </tr>      <tr>       <td width="70">Part 6</td>        <td><a href="/2010/01/25/adding-a-sessions-page-that-includes-a-query-parameter-in-silverlight-vs2010-article-6-of-7/">Adding A Sessions Page That Includes a Query Parameter In Silverlight VS2010 Beta2</a></td>        <td style="width: 100px" width="150">10 Minutes</td>     </tr>      <tr>       <td width="70">Part 7</td>        <td><a href="/2010/01/25/authentication-and-authorization-using-ria-services-article-7-of-7/">Basic Authentication and Authorization In RIA Services</a></td>        <td style="width: 100px" width="150">5 Minutes</td>     </tr>   </tbody></table>  <br />  <br />  <br /><img src="http://video.peterkellner.net/video/RIAServicesBayNet20090120/P6_AddingSessionsPageWithRequestParam_Thumb.jpg" alt="media" /><br />
  <br />  <br />  <p>In this section, we will talk about what happens when the users presses the “Sessions” hyperlink from the speakers page.&#160; If you remember from the last article, we used a special converter on the Speakers.xaml page and bound that to the hyperlink titled sessions as shown below.</p> <span id="more-482"></span>  <p>&#160;</p>  <p><a href="http://peterkellner.net/FilesForWebDownload/AddingASessionsPageThatIncludesaQueryPar_DF36/image.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AddingASessionsPageThatIncludesaQueryPar_DF36/image_thumb.png" width="376" height="323" /></a></p>  <p>&#160;</p>  <p>When this link is clicked, the navigation created is as follows:</p>  <pre class="csharpcode">&#160;</pre>

<pre class="csharpcode"><a href="http://localhost:9951/Presentation1TestPage.aspx#/Sessions?SpeakerId=903">http://localhost:9951/Presentation1TestPage.aspx#/Sessions?SpeakerId=903</a></pre>

<!-- code formatted by http://manoli.net/csharpformat/ -->
<style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }
</style>
<div class="csharpcode">
<pre class="alt"><span class="rem">// Executes when the user navigates to this page.</span></pre>
<pre><span class="kwrd">protected</span> <span class="kwrd">override</span> <span class="kwrd">void</span> OnNavigatedTo(NavigationEventArgs e)</pre>
<pre class="alt">{</pre>
<pre>    <span class="rem">//Handle SpeakerId</span></pre>
<pre class="alt">    var qs = NavigationContext.QueryString;</pre>
<pre>    <span class="kwrd">if</span> (qs.ContainsKey(<span class="str">"SpeakerId"</span>))</pre>
<pre class="alt">    {</pre>
<pre>        <span class="kwrd">this</span>.sessionsOverviewDomainDataSource.FilterDescriptors =</pre>
<pre class="alt">            <span class="kwrd">new</span> FilterDescriptorCollection();</pre>
<pre>        <span class="kwrd">this</span>.sessionsOverviewDomainDataSource.FilterDescriptors.Add(</pre>
<pre class="alt">              <span class="kwrd">new</span> FilterDescriptor(<span class="str">"AttendeeId"</span>,</pre>
<pre>                  FilterOperator.IsEqualTo, qs[<span class="str">"SpeakerId"</span>]));</pre>
<pre class="alt">    }</pre>
<pre>}</pre>
</div>

<p>This simply adds a filter to the current DomainDataSource that filters the column AttendeeId with the passed in query parameter SpeakerId.</p>

<p>&#160;</p>

<p>The resulting page looks as follows assuming <a href="http://www.siliconvalley-codecamp.com/Sessions.aspx?ForceSortBySessionTime=true&amp;id=151">Peter Kellner’s Session link</a> was clicked.</p>

<p>&#160;</p>

<p><a href="http://peterkellner.net/FilesForWebDownload/AddingASessionsPageThatIncludesaQueryPar_DF36/image_3.png"><img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://peterkellner.net/FilesForWebDownload/AddingASessionsPageThatIncludesaQueryPar_DF36/image_thumb_3.png" width="523" height="207" /></a></p>

<p>&#160;</p>

<p>The video referenced in this article goes into building this page in more details, but fundamentally, the major point is just the query parameter.</p>]]></content:encoded>
			<wfw:commentRss>http://peterkellner.net/2010/01/25/adding-a-sessions-page-that-includes-a-query-parameter-in-silverlight-vs2010-article-6-of-7/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	<enclosure url="http://video.peterkellner.net/video/RIAServicesBayNet20090120/P6_AddingSessionsPageWithRequestParam.flv" length="1" type="video/x-flv"/>
	</item>
	</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching 4/15 queries in 0.004 seconds using disk

Served from: peterkellner.net @ 2012-02-10 05:01:55 -->
