<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Research ~ A ~ holic</title>
	<atom:link href="http://researchaholic.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://researchaholic.com</link>
	<description>Thoughts by Chad England</description>
	<lastBuildDate>Fri, 24 May 2013 01:21:06 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='researchaholic.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Research ~ A ~ holic</title>
		<link>http://researchaholic.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://researchaholic.com/osd.xml" title="Research ~ A ~ holic" />
	<atom:link rel='hub' href='http://researchaholic.com/?pushpress=hub'/>
		<item>
		<title>Older Web applications and the challenge of IE 10+</title>
		<link>http://researchaholic.com/2013/05/02/older-web-applications-and-the-challenge-of-ie-10/</link>
		<comments>http://researchaholic.com/2013/05/02/older-web-applications-and-the-challenge-of-ie-10/#comments</comments>
		<pubDate>Thu, 02 May 2013 17:30:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[Browser]]></category>
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=632</guid>
		<description><![CDATA[As the market share of Internet Explorer 10 increases along with the looming release of Internet Explorer 11 a growing number of web developers are realizing that Microsoft in their great wisdom (I am not against it, just wish there &#8230; <a href="http://researchaholic.com/2013/05/02/older-web-applications-and-the-challenge-of-ie-10/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=632&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>As the market share of Internet Explorer 10 increases along with the looming release of Internet Explorer 11 a growing number of web developers are realizing that Microsoft in their great wisdom (I am not against it, just wish there was an option) removed the ability to use conditional comments.</p>
<p>In a sense breaking every legacy application that a company might be using.  For those that do not know or need a refresh, conditional comments where a way to do something like this:</p>
<p><span id="more-632"></span></p>
<p>&lt;!&#8211;[if IE 8]&gt;</p>
<p>&lt;link rel=&#8221;stylesheet&#8221; type=&#8221;text/css&#8221; href=&#8221;/css/ie8.css&#8221; /&gt;</p>
<p>&lt;![endif]&#8211;&gt;</p>
<p>Conditional comments were commonly used by developers to load a CSS files specificly for the quirks of that browser.  Why?  Because the rules would change for how features where handled (joys of lack of feature standardization).  So one could say with conditional comments being removed in IE10 developers must now pay for the past faults.  An businesses have to enforce stupid lock out rules like all PC’s can only have IE 8 or 9, or <em>shoot me now</em> IE6.</p>
<p><strong>So what do we do about it?</strong></p>
<p>The purist out there say “oh just make the changes and only support IE 10, DEATH to all other browsers!!!”  To them I must ask if they have ever worked in an enterprise setting.</p>
<p>Firstly this is not always possible, project time lines, size of the application, and resources sometimes does not allow this to be an option.  Secondly on most teams I have been on new features are more important then fixing past issues.  Most of the time a legacy feature was probably written by someone else so teams avoid changing what is working for fear of breaking that code.  So in essence of ROI of upgrading an application to a newer browser does not out way the ROI of implementing new features. Perfect example of why there is still market share for IE6.</p>
<p>I am sure this hack will probably get some angry feedback from the purist and those that think it is so easy to just waist time and money on older applications or complex ones that are slowly being refactored (large applications can not be upgraded over night, sometimes it takes <em>YEARS</em>).</p>
<p><strong>Option 1: (Restore conditionals through changing the document mode)</strong></p>
<p>Internet Explorer 10 might have some great new features; however if you have an application that must support all the flavors of IE still more then likely HTML5 is not on the radar you can set the browser document mode in a way that it only affects IE 10.  This will in turn allow IE 10 to see conditional comments, it will be treated as if the browser is Internet Explorer 9.</p>
<pre class="csharpcode">&lt;!DOCTYPE html <span class="kwrd">public</span> <span class="str">"-//W3C//DTD HTML 4.0 Strict//en"</span>&gt;
&lt;meta http-equiv=<span class="str">"X-UA-Compatible"</span> content=<span class="str">"IE=9"</span> /&gt;</pre>
<p><strong>Option 2: (Feature detection to determine which browser)</strong></p>
<p>Feature detection is where we check (usually through JavaScript) if the browser supports a specific HTML/CSS feature.  This is a growing tread with HTML5 and browsers implementing those features differently.  Well we can do the same thing to attempt to figure out what browser a client is currently using.  You might ask “Why not just use browser detection and look at the agent?” Simple answer browser detection is considered evil, very unreliable, and easy to lie to.</p>
<p>I found two references to two charts</p>
<p><a href="http://tanalin.com/en/articles/ie-version-js/" target="_blank">Tanalin.com</a></p>
<table width="200" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="85">IE Versions</td>
<td valign="top" width="463">Supported Standard Object</td>
</tr>
<tr>
<td valign="top" width="85">10+</td>
<td valign="top" width="463">window.atob</td>
</tr>
<tr>
<td valign="top" width="85">9+</td>
<td valign="top" width="463">document.addEventListener</td>
</tr>
<tr>
<td valign="top" width="85">8+</td>
<td valign="top" width="463">document.querySelector</td>
</tr>
<tr>
<td valign="top" width="85">7+</td>
<td valign="top" width="463">window.XMLHttpRequest</td>
</tr>
<tr>
<td valign="top" width="85">6+</td>
<td valign="top" width="463">document.compatMode</td>
</tr>
</tbody>
</table>
<p><a href="http://snippets.webaware.com.au/snippets/feature-sniffing-internet-explorer/" target="_blank">snippets.webaware.com.au</a></p>
<table width="200" border="0" cellspacing="0" cellpadding="2">
<tbody>
<tr>
<td valign="top" width="85">IE Versions</td>
<td valign="top" width="463">Find Version</td>
</tr>
<tr>
<td valign="top" width="85">10+</td>
<td valign="top" width="463">&#8220;history&#8221; in window &amp;&amp; &#8220;pushState&#8221; in window.history</td>
</tr>
<tr>
<td valign="top" width="85">9+</td>
<td valign="top" width="463">&#8220;performance&#8221; in window</td>
</tr>
<tr>
<td valign="top" width="85">8+</td>
<td valign="top" width="463">&#8220;documentMode&#8221; in document</td>
</tr>
<tr>
<td valign="top" width="85">7</td>
<td valign="top" width="463">&#8220;maxHeight&#8221; in document.documentElement.style &amp;&amp; !(&#8220;documentMode&#8221; in document)</td>
</tr>
<tr>
<td valign="top" width="85">6</td>
<td valign="top" width="463">!(&#8220;maxHeight&#8221; in document.documentElement.style)</td>
</tr>
</tbody>
</table>
<p>With these two tables we can now do something like this:</p>
<pre class="csharpcode"><span class="rem">// Check if this is Internet explorer</span>
<span class="kwrd">if</span> (<span class="str">"documentElement"</span> <span class="kwrd">in</span> document &amp;&amp; (<span class="str">"filters"</span> <span class="kwrd">in</span> document.documentElement || <span class="str">"documentMode"</span> <span class="kwrd">in</span> document)) {
       <span class="rem">// IE 6</span>
       <span class="kwrd">if</span> (!(<span class="str">"maxHeight"</span> <span class="kwrd">in</span> document.documentElement.style)) {
               document.documentElement.className += <span class="str">' ie6'</span>;

                <span class="rem">// can load js file or css if needed</span>
       }

       <span class="rem">// IE 7</span>
       <span class="kwrd">if</span> ((document.documentMode === 7) || (<span class="str">"maxHeight"</span> <span class="kwrd">in</span> document.documentElement.style &amp;&amp; !(<span class="str">"documentMode"</span> <span class="kwrd">in</span> document))) {
                document.documentElement.className += <span class="str">' ie7'</span>;

                <span class="rem">// can load js file or css if needed</span>
       }

       <span class="rem">// IE 8</span>
       <span class="kwrd">if</span> ((document.documentMode === 8) || (document.all &amp;&amp; document.querySelector &amp;&amp; !document.addEventListener)) {
                document.documentElement.className += <span class="str">' ie8'</span>;

               <span class="rem">// can load js file or css if needed</span>
       }

      <span class="rem">// IE 9</span>
      <span class="kwrd">if</span> (document.documentMode === 9) {
                document.documentElement.className += <span class="str">' ie9'</span>;
      }
}</pre>
<p>With this code snippet I am looking to see if the browser first is IE.  If it is IE, I then start to check for browser features to determine which one I am most likely talking to.  If you notice I am checking the documentMode first for IE 7,8, and 9.  This is because as we saw in option one we can force the documentMode for IE. (Example: Telling IE 10 to run documentMode of IE 8).</p>
<p>So in the example above what ends up happening is if say IE 8 is found.  It changes the html tag to look like this:</p>
<pre class="csharpcode"><span class="kwrd">&lt;</span><span class="html">html</span> <span class="attr">class</span><span class="kwrd">="ie8"</span><span class="kwrd">&gt;</span></pre>
<p>Since CSS gradients can be a pain in IE 6, 7, and 8; we have the option now to add a change for our CSS class that looks like this:</p>
<pre class="csharpcode" style="height:462px;width:639px;">.WorkListGrid tr.Row
{
    background: #dedede;
    background: -webkit-gradient(linear, 0 0, 0 bottom, from(#dedede), to(#ffffff));
    background: -webkit-linear-gradient(#dedede, #ffffff);
    background: -moz-linear-gradient(#dedede, #ffffff);
    background: -ms-linear-gradient(#dedede, #ffffff);
    background: -o-linear-gradient(#dedede, #ffffff);
    background: linear-gradient(#dedede, #ffffff);

}

/* Do not need to add the cross browser background sizes, this will only run for IE*/
.ie6 .WorkListGrid tr.Row,
.ie7 .WorkListGrid tr.Row,
.ie8 .WorkListGrid tr.Row {
    background: #dedede;
    background-image: url(../../img/gradientgrey.jpg);
    background-repeat: repeat-x;
    background-size: 100% 100%;
}</pre>
<p>If the browser is IE 6, 7, or 8 it will use a gradient image file, and so we do not break any modern browser we can still implement the standard background gradient CSS parms.</p>
<p>In conclusion like I said in the intro this might not be best practice nor will the purist like this article, but in business there are times when developers have no choose but to do hacks and slashes to get a feature out the door.  It is the way the world turns.  In my opinion option two could be a good.  If an application is being redesigned one feature at a time in order to modernizing it.  You gain the flexibility of making changes without major features breaking.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/632/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/632/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=632&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2013/05/02/older-web-applications-and-the-challenge-of-ie-10/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>
	</item>
		<item>
		<title>Battle of the INotifyPropertyChanged techniques</title>
		<link>http://researchaholic.com/2013/03/11/battle-of-the-inotifypropertychanged-techniques/</link>
		<comments>http://researchaholic.com/2013/03/11/battle-of-the-inotifypropertychanged-techniques/#comments</comments>
		<pubDate>Mon, 11 Mar 2013 14:00:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[PostSharp]]></category>
		<category><![CDATA[Resharper]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=621</guid>
		<description><![CDATA[Recently at a conference I was given the opportunity to talk about Aspect Orientated programming with PostSharp.  In my demo I showed off the difference between creating an INotifyPropertyChanged class manually, using boilerplate code generated by Resharper, and using smart &#8230; <a href="http://researchaholic.com/2013/03/11/battle-of-the-inotifypropertychanged-techniques/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=621&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Recently at a conference I was given the opportunity to talk about Aspect Orientated programming with PostSharp.  In my demo I showed off the difference between creating an INotifyPropertyChanged class manually, using boilerplate code generated by Resharper, and using smart tags built into PostSharp 3.  By the request of a few, here is what was covered.</p>
<p><span id="more-621"></span></p>
<p><span style="color:#333333;"><strong>What is INotifyPropertyChanged?</strong></span></p>
<p>It is an interface provided by Microsoft .NET Framework that is used to let client application know when a property has changed.  Typically this will then allow the client to refresh a field to display the changed value.</p>
<p><strong>Initial Setup</strong></p>
<p>In this example lets use this class for as our simple example:</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> Customer{
     <span class="kwrd">public</span> <span class="kwrd">int</span> CustomerId {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> FirstName {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> LastName {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> FullName {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> Address {get; set;}
}</pre>
<p><strong>&#8212;- Manually &#8212;-</strong></p>
<p>In the beginning we coded stuff manually.</p>
<p>First thing that needs to be done is to add INotifyPropertyChanged to our class.  Add the interface member along with a method to handle the OnPropertyChanged event.  We will now have a class that looks like this:</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> Customer : INotifyPropertyChanged{
     <span class="kwrd">public</span> <span class="kwrd">int</span> CustomerId {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> FirstName {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> LastName {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> FullName {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> Address {get; set;}

     <span class="kwrd">public</span> <span class="kwrd">event</span> PropertyChangedEventHandler PropertyChanged;

     <span class="kwrd">protected</span> <span class="kwrd">void</span> OnPropertyChanged(<span class="kwrd">string</span> propertyName){
          <span class="kwrd">if</span> (<span class="kwrd">this</span>.PropertyChanged != <span class="kwrd">null</span>){
               <span class="kwrd">this</span>.PropertyChanged(<span class="kwrd">this</span>, <span class="kwrd">new</span> PropertyChangedEventArgs(propertyName));
          }
     }
}</pre>
<p>Now we can setup our properties to use the OnPropertyChanged method.  Can you spot the error?</p>
<pre class="csharpcode"><span class="kwrd">public</span> <span class="kwrd">class</span> Customer : INotifyPropertyChanged{
        <span class="kwrd">private</span> <span class="kwrd">string</span> customerFirstName, customerLastName, address;

        <span class="kwrd">public</span> <span class="kwrd">int</span> CustomerId { get; set; }

        <span class="kwrd">public</span> <span class="kwrd">string</span> FirstName{
            get{
                <span class="kwrd">return</span> customerFirstName;
            }

            set{
                <span class="kwrd">if</span> (<span class="kwrd">value</span> != <span class="kwrd">null</span>){
                    customerFirstName = <span class="kwrd">value</span>;
                    <span class="kwrd">this</span>.OnPropertyChanged(<span class="str">"FirstName"</span>);
                    <span class="kwrd">this</span>.OnPropertyChanged(<span class="str">"FullName"</span>);
                }
            }
        }

        <span class="kwrd">public</span> <span class="kwrd">string</span> LastName{
            get{
                <span class="kwrd">return</span> customerLastName;
            }

            set{
                <span class="kwrd">if</span> (<span class="kwrd">value</span> != <span class="kwrd">null</span>){
                    customerLastName = <span class="kwrd">value</span>;
                    <span class="kwrd">this</span>.OnPropertyChanged(<span class="str">"LastName"</span>);
                    <span class="kwrd">this</span>.OnPropertyChanged(<span class="str">"FullName"</span>);
                }
            }
        }

        <span class="kwrd">public</span> <span class="kwrd">string</span> FullName{
            get{
                <span class="kwrd">return</span> <span class="kwrd">string</span>.Format(<span class="str">"{0}  {1}"</span>, FirstName, LastName);
            }
        }

        <span class="kwrd">public</span> <span class="kwrd">string</span> Address{
            get{
                <span class="kwrd">return</span> address;
            }

            set{
                <span class="kwrd">if</span> (<span class="kwrd">value</span> != <span class="kwrd">null</span>){
                    company = <span class="kwrd">value</span>;
                    <span class="kwrd">this</span>.OnPropertyChanged(<span class="str">"<em><strong>FirstName</strong></em>"</span>);
                }
            }
        }

        <span class="kwrd">public</span> <span class="kwrd">event</span> PropertyChangedEventHandler PropertyChanged;

        <span class="kwrd">protected</span> <span class="kwrd">void</span> OnPropertyChanged(<span class="kwrd">string</span> propertyName){
            <span class="kwrd">if</span> (<span class="kwrd">this</span>.PropertyChanged != <span class="kwrd">null</span>){
                <span class="kwrd">this</span>.PropertyChanged(<span class="kwrd">this</span>, <span class="kwrd">new</span> PropertyChangedEventArgs(propertyName));
            }
        }
    }</pre>
<p>I hope you spotted the error.</p>
<p>A big problem like this commonly occurs when a developer needs to add a slew of properties like this.  Most of the time out of pure boredom they will eventually just start copy, pasting and modifying the code.  In our example above, we copy pasted the FirstName property and modified that.  When we got to address, we forgot to change the OnPropertyChanged string.</p>
<p><strong>&#8212;- Boilerplate &#8212;-</strong></p>
<p>Because of the bugs that can be generated by copy paste development, tools like Resharper 7.x+ have built in boilerplate generating functions.  I am not going to go into a lot of detail on this, if you want to read more about this go <a href="http://blogs.jetbrains.com/dotnet/2012/07/inotifypropertychanged-support-in-resharper-7/" target="_blank">here</a>.</p>
<p>Through the use of boilerplate code generation and Resharpers smart tags; adding new properties is pretty simple.  With a few clicks our end code looks similar to the end code of the manual process.  So you might be wondering why I still have issues with this, why do I still consider this a mid tier solution.</p>
<p><strong>&#8212;- PostSharp 3 &#8212;-</strong></p>
<p>PostSharp is a framework that adds Aspect Oriented Programming or AOP to a solution.  This allows developers to separate out boilerplate code (or referenced as cross cutting concerns) from business code.  With PostSharp 3 they introduced the concept of design pattern automation.   If you want to read a great article about this, please go <a href="http://www.infoq.com/articles/Design-Pattern-Automation" target="_blank">here</a>.</p>
<p><a href="http://chadit.files.wordpress.com/2013/03/aop.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" title="AoP" alt="AoP" src="http://chadit.files.wordpress.com/2013/03/aop_thumb.png?w=423&#038;h=191" width="423" height="191" border="0" /></a></p>
<p>You can install PostSharp3 from the Visual Studio Extension Gallery.  Once installed right click your solution and select to add PostSharp.  After that go to your class file (notice in the image that it looks like our original code base), from the smart tag select ‘Implement INotifyPropertyChanged’ and watch the magic happen.  The end code will look similar to this:</p>
<pre class="csharpcode">[NotifyPropertyChanged]
<span class="kwrd">public</span> <span class="kwrd">class</span> Customer{
     <span class="kwrd">public</span> <span class="kwrd">int</span> CustomerId {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> FirstName {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> LastName {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> FullName {get; set;}
     <span class="kwrd">public</span> <span class="kwrd">string</span> Address {get; set;}
}</pre>
<p>That is it, don’t believe me… try it and use something like Teleriks JustDecompile or Resharpers dotPeek (Reflector if you have the money for a license.) The code generated in the dll will look similar to our manually and boilerplate code.  In the end which is easier to read, modify, and troubleshoot if a problem arises?</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/621/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/621/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=621&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2013/03/11/battle-of-the-inotifypropertychanged-techniques/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/03/aop_thumb.png" medium="image">
			<media:title type="html">AoP</media:title>
		</media:content>
	</item>
		<item>
		<title>Presenting at Orlando Code Camp Sat March 16th</title>
		<link>http://researchaholic.com/2013/03/08/presenting-at-orlando-code-camp-sat-march-16th/</link>
		<comments>http://researchaholic.com/2013/03/08/presenting-at-orlando-code-camp-sat-march-16th/#comments</comments>
		<pubDate>Fri, 08 Mar 2013 14:00:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=618</guid>
		<description><![CDATA[This year I am given the honor to talk to people at the Orlando Code Camp Saturday March 16th.&#160; This will be my first time there and I am really excited to get a presentation slot.&#160; 4:00 – 4:50 Room&#160; &#8230; <a href="http://researchaholic.com/2013/03/08/presenting-at-orlando-code-camp-sat-march-16th/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=618&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This year I am given the honor to talk to people at the Orlando Code Camp Saturday March 16th.&nbsp; This will be my first time there and I am really excited to get a presentation slot.&nbsp; </p>
<p><strong>4:00 – 4:50 Room&nbsp; TBD</strong> – Test Frist Development/TDD<br />
<blockquote>
<p>We are going to dive into what unit testing is, talk about some of the advantages of Unit testing and TDD along with walking through the process of using TDD to create a method.</p>
</blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/618/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/618/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=618&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2013/03/08/presenting-at-orlando-code-camp-sat-march-16th/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>
	</item>
		<item>
		<title>NCrunch a Visual Studio Add-In for Unit Testing</title>
		<link>http://researchaholic.com/2013/02/20/ncrunch-a-visual-studio-add-in-for-unit-testing/</link>
		<comments>http://researchaholic.com/2013/02/20/ncrunch-a-visual-studio-add-in-for-unit-testing/#comments</comments>
		<pubDate>Wed, 20 Feb 2013 15:00:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[Visual Studio]]></category>
		<category><![CDATA[Visual Studio Testing]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=617</guid>
		<description><![CDATA[I made it a goal late in 2012 that one of my personal task for 2013 was going to be diving deeper into unit testing and mocking.&#160; In my research I came across a unit testing tool for Visual Studio &#8230; <a href="http://researchaholic.com/2013/02/20/ncrunch-a-visual-studio-add-in-for-unit-testing/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=617&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>I made it a goal late in 2012 that one of my personal task for 2013 was going to be diving deeper into unit testing and mocking.&nbsp; In my research I came across a unit testing tool for Visual Studio called <a href="http://www.ncrunch.net/">NCrunch</a> which is developed by <a href="https://twitter.com/remcomulder">Remco Mulder</a>.&nbsp; I downloaded the trial and immediately fell in love with it.&nbsp;&nbsp; The rest of this article is a high overview, I highly recommend you check out there site and give it a try.</p>
<p><span id="more-617"></span>
<p>At first the price of NCrunch can put some folks back ($159 for user license and $289 for seat license), until you look at all the features it packs in, then it becomes a deal.&nbsp; If you are doing some form of Test Driven Development (TDD) it almost becomes the tool you can’t live without.&nbsp; </p>
<p><strong><em>Automated concurrent testing</em></strong></p>
<p>Normally a developer write code in this form: (if following TDD)</p>
<ol>
<li>Write the test code
<li>Run the test code (should fail by TDD rules)
<li>Write the code
<li>Run the test code
<li>If the Test passes write another test, else repeat step 3 and 4 till passes.</li>
</ol>
<p>In a perfect world at the most developers experience 5 steps when writing a test and method of code to go along with it.&nbsp; What if you could simplify this process even more to something like this:</p>
<ol>
<li>Write the test code
<li>Write the code
<li>If test passes write another test else repeat step 2 till passes</li>
</ol>
<p>You might be asking yourself “How the heck are you removing the steps to run the test”.&nbsp; Simply put you could have a display like below</p>
<p><a href="http://chadit.files.wordpress.com/2013/02/ncrunchtest.png"><img title="ncrunchTest" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="ncrunchTest" src="http://chadit.files.wordpress.com/2013/02/ncrunchtest_thumb.png?w=918&#038;h=126" width="918" height="126"></a></p>
<p>Ncrunch will automatically run the test in the background on separate threads and as you change code the affected unit test are run.&nbsp; The results are returned pretty fast, speed can vary depending on your workstation environment and amount of test affected.&nbsp; In one test on an i7 with 8GB of ram and 15 unit test there was about a 20 second delay in total feedback.&nbsp;&nbsp;&nbsp; There are two modes for testing, run them side by side (if you have the memory for it) or one after the other.&nbsp; I choose one after the other when I reach about 10 test (personal preference).</p>
<p>In the bottom right of Visual Studio you will have a Ncrunch status icon that looks like this:</p>
<p><a href="http://chadit.files.wordpress.com/2013/02/ncrunchindecator.png"><img title="NcrunchIndecator" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="NcrunchIndecator" src="http://chadit.files.wordpress.com/2013/02/ncrunchindecator_thumb.png?w=65&#038;h=53" width="65" height="53"></a></p>
<p>This will provide you with some rapid information about what NCrunch is doing in the background.&nbsp; In this instance it is showing I have one test that is failing.&nbsp; If it is blue with a number in it, that means there are test queued up and waiting to run, and a blue N means it is idle.</p>
<p><strong><em>Code Coverage</em></strong></p>
<p>As Ncrunch runs the test in the background it will identify the code coverage of your application. Below is an example of what it looks like from the test and source code text editors: </p>
<p><a href="http://chadit.files.wordpress.com/2013/02/ncrunchrgrefactor.png"><img title="NcrunchRGRefactor" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="NcrunchRGRefactor" src="http://chadit.files.wordpress.com/2013/02/ncrunchrgrefactor_thumb.png?w=714&#038;h=341" width="714" height="341"></a></p>
<p>As the test are running the lines of code will show Red for failed test, green for passed test, and black for no code coverage. Each code coverage also has access to a context menu with additional options</p>
<p><a href="http://chadit.files.wordpress.com/2013/02/ncrunchrgrefactorcontextmenu.png"><img title="NcrunchRGRefactorContextMenu" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="NcrunchRGRefactorContextMenu" src="http://chadit.files.wordpress.com/2013/02/ncrunchrgrefactorcontextmenu_thumb.png?w=330&#038;h=189" width="330" height="189"></a></p>
<p>Just like other code coverage tools you can see the metrics for your methods.&nbsp; NCrunch also allows you to ignore classes from the metrics; along with export them to a text file.</p>
<p><a href="http://chadit.files.wordpress.com/2013/02/ncrunchcodemetrics.png"><img title="ncrunchCodeMetrics" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="ncrunchCodeMetrics" src="http://chadit.files.wordpress.com/2013/02/ncrunchcodemetrics_thumb.png?w=651&#038;h=203" width="651" height="203"></a></p>
<p><strong><em>Performance Metrics</em></strong></p>
<p>NCrunch also has performance metrics built in.&nbsp;&nbsp; As test are run, NCrunch will alert on hot spots by displaying the line dot in yellow.&nbsp; Hot spots are generally slowly running code, here is an example:</p>
<p><a href="http://chadit.files.wordpress.com/2013/02/ncrunchrgrefactorslow.png"><img title="NcrunchRGRefactorSlow" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="NcrunchRGRefactorSlow" src="http://chadit.files.wordpress.com/2013/02/ncrunchrgrefactorslow_thumb.png?w=838&#038;h=80" width="838" height="80"></a></p>
<p><strong><em>Inline Exception Details</em></strong></p>
<p>NCrunch will display exceptions inline, this will make it easier to spot test failures</p>
<p><a href="http://chadit.files.wordpress.com/2013/02/ncrunchinlineexception.png"><img title="NcrunchInlineException" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="NcrunchInlineException" src="http://chadit.files.wordpress.com/2013/02/ncrunchinlineexception_thumb.png?w=714&#038;h=149" width="714" height="149"></a></p>
<p><strong><em>Intelligent Test Execution</em></strong></p>
<p>As test are run there are metrics collected on system impact.&nbsp; There is a processing queue system that ranks test (the ranking varies by either test speed or memory this can be set in the settings section).</p>
<p><a href="http://chadit.files.wordpress.com/2013/02/ncrunchprocessqueue.png"><img title="ncrunchprocessqueue" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="ncrunchprocessqueue" src="http://chadit.files.wordpress.com/2013/02/ncrunchprocessqueue_thumb.png?w=716&#038;h=268" width="716" height="268"></a>&nbsp;</p>
<p>Included also is a Risk/Progress bar, it will display the metric as your test runs (see the NCrunch support site <a href="http://www.ncrunch.net/documentation/concepts_test-pipeline" target="_blank">here</a> for more information on this).</p>
<p><a href="http://chadit.files.wordpress.com/2013/02/ncrunchmemorymetrics.png"><img title="ncrunchMemoryMetrics" style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" border="0" alt="ncrunchMemoryMetrics" src="http://chadit.files.wordpress.com/2013/02/ncrunchmemorymetrics_thumb.png?w=361&#038;h=72" width="361" height="72"></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/617/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/617/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=617&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2013/02/20/ncrunch-a-visual-studio-add-in-for-unit-testing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/ncrunchtest_thumb.png" medium="image">
			<media:title type="html">ncrunchTest</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/ncrunchindecator_thumb.png" medium="image">
			<media:title type="html">NcrunchIndecator</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/ncrunchrgrefactor_thumb.png" medium="image">
			<media:title type="html">NcrunchRGRefactor</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/ncrunchrgrefactorcontextmenu_thumb.png" medium="image">
			<media:title type="html">NcrunchRGRefactorContextMenu</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/ncrunchcodemetrics_thumb.png" medium="image">
			<media:title type="html">ncrunchCodeMetrics</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/ncrunchrgrefactorslow_thumb.png" medium="image">
			<media:title type="html">NcrunchRGRefactorSlow</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/ncrunchinlineexception_thumb.png" medium="image">
			<media:title type="html">NcrunchInlineException</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/ncrunchprocessqueue_thumb.png" medium="image">
			<media:title type="html">ncrunchprocessqueue</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/ncrunchmemorymetrics_thumb.png" medium="image">
			<media:title type="html">ncrunchMemoryMetrics</media:title>
		</media:content>
	</item>
		<item>
		<title>South Florida Code Camp 2013 my demo links #sflcc</title>
		<link>http://researchaholic.com/2013/02/13/south-florida-code-camp-2013-my-demo-links-sflcc/</link>
		<comments>http://researchaholic.com/2013/02/13/south-florida-code-camp-2013-my-demo-links-sflcc/#comments</comments>
		<pubDate>Wed, 13 Feb 2013 15:00:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[PostSharp]]></category>
		<category><![CDATA[Presentations]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=597</guid>
		<description><![CDATA[This year was my second year presenting at the South Florida Code Camp.  I am once again amazed at the amount of attendees, number of sessions, and of course the great folks you get to meet and learn from. This &#8230; <a href="http://researchaholic.com/2013/02/13/south-florida-code-camp-2013-my-demo-links-sflcc/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=597&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This year was my second year presenting at the South Florida Code Camp.  I am once again amazed at the amount of attendees, number of sessions, and of course the great folks you get to meet and learn from.</p>
<p><span id="more-597"></span></p>
<p>This year I was lucky and both my sessions were accepted.  Great turn out for both of them.  I loved the feedback and open discussion that occurred in both of them.  As requested here are both of sessions slides and projects.</p>
<p>Session one: Unit Testing and TDD</p>
<p>Description: In this session we talked about the advantages that come from Unit Testing, and an overview of Test Driven Development.  On top of that we talk about a great tool that makes TDD a breeze, <a href="http://www.ncrunch.net/" target="_blank">nCrunch</a>.  If you haven’t used this tool before, I highly recommend you give the trial a try.</p>
<ul>
<li>Presentation is located <a href="https://skydrive.live.com/redir?resid=C6602323F76A8F12!98385&amp;authkey=!ACZDcO8HIfWavpI" target="_blank">here</a>.</li>
<li>Demo code is located <a href="https://github.com/chadit/TestingDemo" target="_blank">here</a>.</li>
</ul>
<p>Session Two: AoP with PostSharp to the Rescue</p>
<p>Description: In this session I showed the power behind using Aspects in your development cycle.  Included in this demo encapsulated how Aspects have many advantages over cut and copy code and boilerplate code.</p>
<ul>
<li>Presentation is located <a href="https://skydrive.live.com/redir?resid=C6602323F76A8F12!98386&amp;authkey=!AC9ykHW-mA59ju8" target="_blank">here</a>.</li>
</ul>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/597/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/597/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=597&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2013/02/13/south-florida-code-camp-2013-my-demo-links-sflcc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>
	</item>
		<item>
		<title>Entity Framework 5 easier way to update record</title>
		<link>http://researchaholic.com/2013/02/06/entity-framework-5-easier-way-to-update-record/</link>
		<comments>http://researchaholic.com/2013/02/06/entity-framework-5-easier-way-to-update-record/#comments</comments>
		<pubDate>Wed, 06 Feb 2013 14:00:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[Entity Framework]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WebApi]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=594</guid>
		<description><![CDATA[In the past with EF if you wanted to update a record you would need to do something like this: public HttpResponseMessage PutCustomer(Customer customer) { using (var context = new ChinookContext()) { var request = context.Customers.Single(c =&#62; c.CustomerId == customer.CustomerId); &#8230; <a href="http://researchaholic.com/2013/02/06/entity-framework-5-easier-way-to-update-record/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=594&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>In the past with EF if you wanted to update a record you would need to do something like this:</p>
<p><span id="more-594"></span></p>
<pre class="csharpcode"> <span class="kwrd">public</span> HttpResponseMessage PutCustomer(Customer customer)
        {
            <span class="kwrd">using</span> (var context = <span class="kwrd">new</span> ChinookContext())
            {
                var request = context.Customers.Single(c =&gt; c.CustomerId == customer.CustomerId);

                <span class="rem">// todo this has to have an easier way.  Customer.Attach throws an error</span>
                request.FirstName = customer.FirstName;
                request.LastName = customer.LastName;
                request.Address = customer.Address;
                request.City = customer.City;
                request.PostalCode = customer.PostalCode;
                request.State = customer.State;
                request.Country = customer.Country;
                request.Fax = customer.Fax;
                request.Email = customer.Email;
                request.Company = customer.Company;

                context.SaveChanges();

                var response = Request.CreateResponse(HttpStatusCode.Accepted, customer);
                response.Headers.Location = <span class="kwrd">new</span> Uri(Request.RequestUri, <span class="kwrd">string</span>.Format(<span class="str">"Customer/{0}"</span>, customer.CustomerId));
                <span class="kwrd">return</span> response;
            }
        }</pre>
<p>As you may notice this can get tedious and rather large as more fields need updating.   In Entity Framework 5  we get a wonderful new method ‘SetValues’.  With this new method we can change the above code from that to this:</p>
<pre class="csharpcode"> <span class="kwrd">public</span> HttpResponseMessage PutCustomer(Customer customer)
        {
            <span class="kwrd">using</span> (var context = <span class="kwrd">new</span> ChinookContext())
            {
                var original = context.Customers.Find(customer.CustomerId);

                <span class="kwrd">if</span> (original != <span class="kwrd">null</span>)
                {
                    context.Entry(original).CurrentValues.SetValues(customer);
                    context.SaveChanges();
                }

                var response = Request.CreateResponse(HttpStatusCode.Accepted, customer);
                response.Headers.Location = <span class="kwrd">new</span> Uri(Request.RequestUri, <span class="kwrd">string</span>.Format(<span class="str">"Customer/{0}"</span>, customer.CustomerId));
                <span class="kwrd">return</span> response;
            }
        }</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/594/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/594/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=594&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2013/02/06/entity-framework-5-easier-way-to-update-record/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>
	</item>
		<item>
		<title>Presenting at South Florida Code Camp Sat 9th</title>
		<link>http://researchaholic.com/2013/02/04/presenting-at-south-florida-code-camp-sat-9th/</link>
		<comments>http://researchaholic.com/2013/02/04/presenting-at-south-florida-code-camp-sat-9th/#comments</comments>
		<pubDate>Mon, 04 Feb 2013 20:00:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[PostSharp]]></category>
		<category><![CDATA[Presentations]]></category>
		<category><![CDATA[Testing]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=593</guid>
		<description><![CDATA[This coming weekend (Feb 9th) I will be giving two presentations. 1:20 – 2:30 Room  1052 – Test Frist Development/TDD We are going to dive into what unit testing is, talk about some of the advantages of Unit testing and &#8230; <a href="http://researchaholic.com/2013/02/04/presenting-at-south-florida-code-camp-sat-9th/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=593&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>This coming weekend (Feb 9th) I will be giving two presentations.</p>
<p><span id="more-593"></span></p>
<p><strong>1:20 – 2:30 Room  1052</strong> – Test Frist Development/TDD</p>
<blockquote><p>We are going to dive into what unit testing is, talk about some of the advantages of Unit testing and TDD along with walking through the creation of a project using TDD.  I will also be demoing a fascinating new unit testing tool called <a href="http://www.ncrunch.net/" target="_blank">NCrunch</a>.</p></blockquote>
<p>In honor of Separation of Concerns month (<a href="http://sites.fastspring.com/telerik/product/featured-gear" target="_blank">2013 Software Craftsmanship Calendar</a>)</p>
<p><a href="http://chadit.files.wordpress.com/2013/02/separation-of-concerns-feb-2013.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" title="Separation-Of-Concerns-Feb-2013" alt="Separation-Of-Concerns-Feb-2013" src="http://chadit.files.wordpress.com/2013/02/separation-of-concerns-feb-2013_thumb.png?w=244&#038;h=244" width="244" height="244" border="0" /></a></p>
<p><strong>2:40-3:50 Room 1048</strong> – AoP with PostSharp to the Rescue.</p>
<blockquote><p>In this session we will dive into what Aspect Oriented programming is, how it can be an advantage to development teams, and show off some Aspects including new features coming in PostSharp 3</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/593/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/593/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=593&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2013/02/04/presenting-at-south-florida-code-camp-sat-9th/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/02/separation-of-concerns-feb-2013_thumb.png" medium="image">
			<media:title type="html">Separation-Of-Concerns-Feb-2013</media:title>
		</media:content>
	</item>
		<item>
		<title>Call WCF Service Asynchronously</title>
		<link>http://researchaholic.com/2013/01/16/call-wcf-service-asynchronously/</link>
		<comments>http://researchaholic.com/2013/01/16/call-wcf-service-asynchronously/#comments</comments>
		<pubDate>Wed, 16 Jan 2013 14:00:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[C#]]></category>
		<category><![CDATA[VB.NET]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[WebService]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=588</guid>
		<description><![CDATA[Why would we want to call a WCF Service asynchronously? The biggest reason to move from synchronous to asynchronous is performance.  When a synchronous call is made, the current thread locks till the call is completed.  It varies by OS &#8230; <a href="http://researchaholic.com/2013/01/16/call-wcf-service-asynchronously/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=588&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>Why would we want to call a WCF Service asynchronously?</p>
<p>The biggest reason to move from synchronous to asynchronous is performance.  When a synchronous call is made, the current thread locks till the call is completed.  It varies by OS and programming language but most application will have a set number of threads they can pull out of a thread pool.  If to many threads are being utilized to retrieve data synchronously it could cause the entire application to lock up while it waits for a thread to become available.  This is bad when end user usability plays a large part in development decisions today.</p>
<p><span id="more-588"></span></p>
<p>Asynchronous calls will call the WCF service and release the thread back into the thread pool.  When the async call is completed a callback method is raised, this will pull out a new thread to consume the returning data.</p>
<p>In order to setup Async calls do the following:</p>
<ul>
<li>Right click on the service reference</li>
<li>Select ‘configure service reference’</li>
<li>Check ‘Allow generation of asynchronous operations’</li>
<li>Ensure ‘Generate asynchronous operations’ is selected</li>
<li>Click OK</li>
</ul>
<p><a href="http://chadit.files.wordpress.com/2013/01/wcfasyncsettings.png"><img style="background-image:none;padding-top:0;padding-left:0;display:inline;padding-right:0;border-width:0;" title="WcfAsyncSettings" alt="WcfAsyncSettings" src="http://chadit.files.wordpress.com/2013/01/wcfasyncsettings_thumb.png?w=244&#038;h=149" width="244" height="149" border="0" /></a></p>
<p>Then to make the call in your code you just simple do this</p>
<p><strong>C# version</strong></p>
<pre class="csharpcode"><span class="kwrd">private</span> <span class="kwrd">void</span> AsyncTest()
{
    WcfClient someWcfClient = <span class="kwrd">new</span> WcfClient();
    <span class="rem">//Setup a listener that can wait for the async call to complete</span>
    someWcfClient.SimpleSearchCompleted += DocCallback;
    <span class="rem">//call the async method and optionally pass in a parm</span>
    someWcfClient.SimpleSearchAsync(someParm);
}

<span class="kwrd">private</span> <span class="kwrd">void</span> DocCallback(<span class="kwrd">object</span> sender, SinpleSearchEventArgs e)
{
    <span class="rem">// do something</span>
}</pre>
<p><strong>VB.NET version</strong></p>
<pre class="csharpcode">Private Sub AsyncTest()
Dim someWcfClient As New WcfClient()
<span class="str">'Setup a listener that can wait for the async call to complete
AddHandler someWcfClient.SimpleSearchCompleted, AddressOf DocCallback
'</span>call the async method and optionally pass <span class="kwrd">in</span> a parm
someWcfClient.SimpleSearchAsync(someParm)
End Sub

Private Sub DocCallback(ByVal sender As Object, ByVal e As SinpleSearchEventArgs)
' <span class="kwrd">do</span> something
End Sub</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/588/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/588/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=588&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2013/01/16/call-wcf-service-asynchronously/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>

		<media:content url="http://chadit.files.wordpress.com/2013/01/wcfasyncsettings_thumb.png" medium="image">
			<media:title type="html">WcfAsyncSettings</media:title>
		</media:content>
	</item>
		<item>
		<title>@media and IE8 and below</title>
		<link>http://researchaholic.com/2013/01/10/media-and-ie8-and-below/</link>
		<comments>http://researchaholic.com/2013/01/10/media-and-ie8-and-below/#comments</comments>
		<pubDate>Thu, 10 Jan 2013 14:00:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[jQuery]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=585</guid>
		<description><![CDATA[So this week I have been working on creating an adaptive UI for the various screen resolutions that our users operate on.&#160; Currently the page was static and looked horrible on high resolution screens. Playing around with HTML/JS Windows 8 &#8230; <a href="http://researchaholic.com/2013/01/10/media-and-ie8-and-below/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=585&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So this week I have been working on creating an adaptive UI for the various screen resolutions that our users operate on.&nbsp; Currently the page was static and looked horrible on high resolution screens. </p>
<p>Playing around with HTML/JS Windows 8 and MVC 4 applications I got the idea of just using @media with a min and max range. On IE 9, 10, Chrome, and Firefox everything looked super.&nbsp; Then I got the test case of ensuring it also worked on IE 7 and 8.&nbsp; I Cringed, adding support for older browsers can be troublesome at the very least.</p>
<p><span id="more-585"></span>
<p>IE 8 and below does not support a CSS setting for min and max on the width.&nbsp; Which completely blew my design out of the water.</p>
<p>Luckily I found a solution by <a href="http://scottjehl.com/" target="_blank">Scott Jehl</a> on github.&nbsp; The project is called <a href="https://github.com/scottjehl/Respond#readme" target="_blank">respond</a>. Its goal is to enable browsers to utilize CSS3 media queries that normally do not.&nbsp; </p>
<p>It is very easy to turn the feature on.&nbsp; </p>
<ul>
<li>Download it from the link above
<li>Add it to your project folder
<li>Add a link to the file in the header of our page.
<pre class="csharpcode">&lt;script src=<span class="str">"../js/respond.min.js"</span>&gt;&lt;/script&gt;</pre>
<li>You can now freely use the @media query in your pages for IE 7 and 8.</li>
</ul>
<p>Example:</p>
<pre class="csharpcode">@media screen and (min-width: 600px) and (max-width: 1024px) {
        .PanelsLeft {
            width: 40%;
        }

        .PanelsRight {
            width: 60%;
        }
}</pre>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/585/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/585/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=585&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2013/01/10/media-and-ie8-and-below/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>
	</item>
		<item>
		<title>Change the Computer Name for a TFS workspace</title>
		<link>http://researchaholic.com/2012/12/19/change-the-computer-name-for-a-tfs-workspace/</link>
		<comments>http://researchaholic.com/2012/12/19/change-the-computer-name-for-a-tfs-workspace/#comments</comments>
		<pubDate>Wed, 19 Dec 2012 14:00:00 +0000</pubDate>
		<dc:creator>chadit</dc:creator>
				<category><![CDATA[Source Control]]></category>
		<category><![CDATA[TFS]]></category>

		<guid isPermaLink="false">https://chadit.wordpress.com/?p=581</guid>
		<description><![CDATA[So today I had the enjoyment of the infrastructure team changing the workstation station naming conventions company wide. Which if you have been a developer for sometime this usually will make you cringe. With Visual Studio Microsoft included a command &#8230; <a href="http://researchaholic.com/2012/12/19/change-the-computer-name-for-a-tfs-workspace/">Continue reading <span class="meta-nav">&#8594;</span></a><img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=581&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
				<content:encoded><![CDATA[<p>So today I had the enjoyment of the infrastructure team changing the workstation station naming conventions company wide. Which if you have been a developer for sometime this usually will make you cringe.</p>
<p><span id="more-581"></span></p>
<p>With Visual Studio Microsoft included a command line utility tf.exe which is usually located in *\Common7\IDE.  This utility allows you to do more administrative style commands that are hidden from the UI side of visual studio.</p>
<p>To updated the computer name for all of your workspaces in a collection you would run something like this:</p>
<pre class="brush: powershell; title: ; notranslate">
tf workspaces /updateComputerName:oldcomputername /collection:http://tfsServer:8080/tfs/DefaultCollection
</pre>
<p>If  you are going across domain you might need to send the /login:NetworkName with it.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/chadit.wordpress.com/581/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/chadit.wordpress.com/581/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=researchaholic.com&#038;blog=10560698&#038;post=581&#038;subd=chadit&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://researchaholic.com/2012/12/19/change-the-computer-name-for-a-tfs-workspace/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<georss:point>0.000000 0.000000</georss:point>
		<geo:lat>0.000000</geo:lat>
		<geo:long>0.000000</geo:long>
		<media:content url="http://2.gravatar.com/avatar/b036dc291165d1f8d77299b9599d8250?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">chadit</media:title>
		</media:content>
	</item>
	</channel>
</rss>
