<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>{Code: Impossible}</title>
    <link>http://codeimpossible.com</link>
    <description>It's just this blog, ya know?</description>
    <item>
      <title>MassiveRecord: How DynamicObject gave C# its groove back</title>
      <link>http://codeimpossible.com/2012/2/20/MassiveRecord-How-DynamicObject-gave-C-its-groove-back</link>
      <description>&lt;p&gt;
	I &lt;a href="http://codeimpossible.com/2012/2/13/MassiveRecord-A-nice-warm-blanket-for-Massive" target="_blank"&gt;blogged last time about MassiveRecord&lt;/a&gt;, my attempt at porting ActiveRecord over to .Net as a wrapper for the micro-ORM Massive.&lt;/p&gt;
&lt;p&gt;
	In this post I&amp;#39;m going to explain a bit about how MassiveRecord can have FindByID and FindByFirstNameAndLastName with less than 200 lines of code.&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;First, a little about the dynamic keyword and DynamicObject.&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	The CLR in .net has always been like a nosey neighbors.&amp;nbsp;It wants to know when your garbage is collected, what objects you have laying around in your yard, and what type each of your variables is.&lt;/p&gt;
&lt;p&gt;
	Okay, so I couldn&amp;#39;t think of a good analogy for the last one, but I think you get the point.&lt;/p&gt;
&lt;p&gt;
	In .Net 4.0&amp;nbsp;Microsoft added the dynamic keyword - mostly to make working with COM a lot easier - but the COM developers gains are ours too. The dynamic keyword gives us the ability to tell the CLR to back off.&lt;/p&gt;
&lt;p&gt;
	It let&amp;#39; s us say &amp;quot;I know what this object is, and I don&amp;#39;t want to care about its type.&amp;quot; It&amp;#39;s the developer equivalent of closing your blinds while your nosey neighbor - Carl Lee Richman (get it?) - sits, frustrated, in his living room with his binoculars.&lt;/p&gt;
&lt;p&gt;
	DynamicObject is new to .Net 4 too. It&amp;#39;s a sealed class which means you have to inherit from it but it gives you several overridable methods that are called in different situations when your inheriting object is dynamically dispatched. DynamicObject is the &amp;quot;man behind the curtain&amp;quot; for MassiveRecord. It&amp;#39;s the thing that let&amp;#39;s MR do it&amp;#39;s awesome voodoo magic with the FindBy*() methods.&lt;/p&gt;
&lt;p&gt;
	I won&amp;#39;t go into all of the methods that DynamicObject provides but you should &lt;a href="http://msdn.microsoft.com/en-us/library/system.dynamic.dynamicobject.aspx" target="_blank"&gt;read about them over at the MSDN website&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;How does MassiveRecord do FindBy*()?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	Before I cover the FindBy*() methods, I think it would help to go over how MassiveRecord works from a high-level.&lt;/p&gt;
&lt;p&gt;
	MassiveRecord is made up of two objects. The first is called DynamicTable which is a static class with a mini fluent interface that handles configuration and creation of the second class.&lt;/p&gt;
&lt;p&gt;
	The second is the MassiveContextBase, this is the object that inherits from Massive&amp;#39;s DynamicModel and allows users to do things like FindByUserNameAndEmail(). The code below shows how the inheritance looks:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;// from Massive.cs
public class DynamicModel : DynamicObject {
// ... snip ...
}

// from MassiveRecord.cs
public class MassiveContextBase : DynamicModel {
// ... snip ...
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Let&amp;#39;s go a bit deeper into how DynamicObject is used in MassiveRecord.&lt;/p&gt;
&lt;p&gt;
	Since Massive&amp;#39;s DynamicModel inherits from DynamicObject, MassiveContextBase can override any of the methods on the DynamicObject class, which it does, specifically: TryInvokeMember().&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;public override bool TryInvokeMember( System.Dynamic.InvokeMemberBinder binder, 
                                      object[] args, 
                                      out object result ) {
    if( binder.Name.ToLower().StartsWith( &amp;quot;findby&amp;quot; ) ) {
        var where = new StringBuilder();
        var method = binder.Name.ToLower().Replace( &amp;quot;findby&amp;quot;, &amp;quot;&amp;quot; );
        var methodColumns = Regex.Split( method, &amp;quot;and&amp;quot; );

        for( int i = 0; i &amp;lt; methodColumns.Length; i++ )
            where.AppendFormat( &amp;quot;{0} [{1}] = {2} &amp;quot;, 
                                    i &amp;gt; 0 ? &amp;quot; and &amp;quot; : &amp;quot;&amp;quot;, 
                                    methodColumns[ i ], 
                                    ToSql( args[ i ] ) );
        result = All( where: where.ToString() );
        return true;
    }

    var type = GetType();
    if( type.GetMethod( binder.Name ) != null ) {
        result = type.InvokeMember( binder.Name, 
                                    BindingFlags.Default | BindingFlags.InvokeMethod, 
                                    null, 
                                    this, 
                                    args );
        return true;
    }

    return base.TryInvokeMember( binder, args, out result );
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	&lt;strong&gt;The breakdown&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;
	Don&amp;#39;t worry about that gigantic block of code, I&amp;#39;ll break it down and go over it piece by piece.&lt;/p&gt;
&lt;p&gt;
	TryInvokeMember takes three arguments: a binder (information about what method the user asked for), the arguments the user passed (if any), and an out argument that should hold the return value.&lt;/p&gt;
&lt;p&gt;
	Lets take a look at the first IF block:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;if( binder.Name.ToLower().StartsWith( &amp;quot;findby&amp;quot; ) ) {
    var where = new StringBuilder();
    var method = binder.Name.ToLower().Replace( &amp;quot;findby&amp;quot;, &amp;quot;&amp;quot; );
    var methodColumns = Regex.Split( method, &amp;quot;and&amp;quot; );

    for( int i = 0; i &amp;lt; methodColumns.Length; i++ )
        where.AppendFormat( &amp;quot;{0} [{1}] = {2} &amp;quot;, 
                                i &amp;gt; 0 ? &amp;quot; and &amp;quot; : &amp;quot;&amp;quot;, 
                                methodColumns[ i ], 
                                ToSql( args[ i ] ) );
    result = All( where: where.ToString() );
    return true;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	First thing MassiveRecord needs is the method name. &lt;em&gt;Are you trying to invoke a MassiveRcord method or a Massive method?&lt;/em&gt; This is done by checking for a &amp;quot;trigger phrase&amp;quot;, specifically &amp;quot;findby&amp;quot;. If MassiveRecord knows the method it is broken out into columns and each column is then put into a WHERE clause using custom code - ToSql() - to format the names.&lt;/p&gt;
&lt;p&gt;
	Once this step is done MassiveRecord passes the WHERE clause off to Massive&amp;#39;s All() method and returns the result to the user. TryInvokeMember demands we return a boolean value - true if the method was handled or false if the method was not. If we return a false here then the user would see an exception at run time saying that the method could not be found.&lt;/p&gt;
&lt;p&gt;
	The next piece of code is something I&amp;#39;m actually pretty proud of.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;var type = GetType();
if( type.GetMethod( binder.Name ) != null ) {
    result = type.InvokeMember( binder.Name, 
                                BindingFlags.Default | BindingFlags.InvokeMethod, 
                                null, 
                                this, 
                                args );
    return true;
}&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Since MassiveContextBase overrides TryInvokeMember every method call will have to go through TryInvokeMember() first. Even Massive-only methods like All() and Insert() will be popping through here on their way to Massive. This code checks to see if the method exists on the current class and if it does the method is executed.&lt;/p&gt;
&lt;p&gt;
	The last piece shouldn&amp;#39;t need any explanation. If both of the paths above failed, then pass the request onto Massive&amp;#39;s implementation of TryInvokeMember and hope that it can sort out what needs to be done.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;return base.TryInvokeMember( binder, args, out result );&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	So that, in a nutshell, is how MassiveRecord does its voodoo to give you FindBy*() methods. I really like how DynamicObject lets me create classes and methods in C# that would otherwise be impossible. It makes C# fun again.&lt;/p&gt;
&lt;p&gt;
	If you haven&amp;#39;t done so already, please checkout &lt;a href="https://github.com/codeimpossible/MassiveRecord"&gt;MassiveRecord on github&lt;/a&gt;, fork it, submit patches, features, whatever!&lt;/p&gt;
&lt;p&gt;
	&amp;nbsp;&lt;/p&gt;
</description>
      <guid>http://codeimpossible.com/2012/2/20/MassiveRecord-How-DynamicObject-gave-C-its-groove-back</guid>
    </item>
    <item>
      <title>MassiveRecord: A nice warm blanket for Massive</title>
      <link>http://codeimpossible.com/2012/2/13/MassiveRecord-A-nice-warm-blanket-for-Massive</link>
      <description>&lt;p&gt;
	I&amp;#39;ve been writing code for almost 10 years now and one thing I&amp;#39;ve learned is that working with Databases &lt;strong&gt;sucks&lt;/strong&gt;. I was ecstatic when Rob Conery released &lt;a href="http://github.com/robconery/massive"&gt;Massive&lt;/a&gt; last year. Massive makes databases fun again. You&amp;#39;re not wondering what kind of SQL is going to be generated, it&amp;#39;s fast and only about 600 lines of code.&lt;/p&gt;
&lt;p&gt;
	If you haven&amp;#39;t seen Massive in action here is a really quick snippet for you:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;var tbl = new Products();
var products = tbl.All(where: &amp;quot;CategoryID = @0&amp;quot;, args: 5);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Massive makes db work pretty simple but all the sugar that it pours on your db access layer isn&amp;#39;t enough, I wanted more.&lt;/p&gt;
&lt;p&gt;
	I started thinking how this could be made easier, and how it could be done Massive-style; One semi-large code file that you just drop into your project and then rock and roll.&lt;/p&gt;
&lt;p&gt;
	So I came up with &lt;a href="http://github.com/codeimpossible/massiverecord"&gt;MassiveRecord&lt;/a&gt;. MassiveRecord is my attempt to move the fun stuff from Rails&amp;#39;s&amp;nbsp;&lt;a href="http://api.rubyonrails.org/classes/ActiveRecord/Base.html"&gt;ActiveRecord&lt;/a&gt; over to the .Net world so developers can do things like this:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;var products = DynamicTable.Create(&amp;quot;Products&amp;quot;).FindByCategory(&amp;quot;Televisions&amp;quot;);
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Behind the scenes, MassiveRecord uses the &lt;code&gt;DynamicObject&lt;/code&gt; type in .Net 4.0 to give you some awesome convention-based shortcuts. I&amp;rsquo;ll have some more posts that go into details about how this is done but for right now all you need to know is that it&amp;rsquo;s not a lot of code and it&amp;rsquo;s actually pretty easy to do.&lt;/p&gt;
&lt;p&gt;
	So easy that if we wanted to get all fo the products in a category and with a certain price we just alter our method call a little:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;var products = DynamicTable.Create(&amp;quot;Products&amp;quot;).FindByCategoryAndPrice( &amp;quot;Televisions&amp;quot;, 20.00 );
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	MassiveRecord. Just. Works. It takes convention-based method calls, converts them to Massive black-magic and gives you the result. And there is very little configuration needed. Put this in your main application initialization code (global.asax) and you&amp;rsquo;re golden:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;DynamicTable.Configure( c =&amp;gt; c.WhenAskedFor(&amp;quot;Products&amp;quot;).Use( s =&amp;gt; {
    s.ConnectionString = &amp;quot;AdventureWorks&amp;quot;;
    s.Table = &amp;quot;Products&amp;quot;;
    s.PrimaryKey = &amp;quot;Id&amp;quot;;
}));
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Now, instead of building out classes with custom methods you can keep all of your configuration in one place and rely on conventions to get things done with less code. I&amp;rsquo;ve got more posts coming about MassiveRecord but for right now, &lt;a href="http://github.com/codeimpossible/MassiveRecord"&gt;the code is up on github&lt;/a&gt; and you should download it, try it out and start submitting features and fixes!&lt;/p&gt;
</description>
      <guid>http://codeimpossible.com/2012/2/13/MassiveRecord-A-nice-warm-blanket-for-Massive</guid>
    </item>
    <item>
      <title>This blog will be different tomorrow</title>
      <link>http://codeimpossible.com/2012/1/17/This-blog-will-be-different-tomorrow</link>
      <description>&lt;p&gt;
	In the words of &lt;a href="http://www.minecraft.com"&gt;Minecraft&lt;/a&gt; creator &lt;a href="http://notch.tumblr.com/"&gt;Notch&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
	&lt;p&gt;
		No sane person can be for SOPA. I don&amp;rsquo;t know if we&amp;rsquo;re sane, but we are strongly, uncompromisingly against SOPA, and any similar laws. Sacrificing freedom of speech for the benefit of corporate profit is abominable and disgusting.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;h3&gt;
	How can I join in?&lt;/h3&gt;
&lt;p&gt;
	It&amp;#39;s easy - If you are a software developer you should fork &lt;a href="https://github.com/SaraJo/SOPA-PIPA-Protest-Page"&gt;Sara Chipps&amp;#39;s SOPA-PIPA protest git repository&lt;/a&gt; and add your website(s) to the ever-growing list of blackout participants.&lt;/p&gt;
&lt;p&gt;
	Then, when the time comes (Midnight, EST on 01/18/2012) simply modify your website(s) to display the HTML in the index.html file that is located in the root of the repository.&lt;/p&gt;
&lt;p&gt;
	Keep in mind that for this protest you should modify your website so that it returns a 503 response code header so that google and other search engines won&amp;#39;t index your SOPA/PIPA protest page as original content.&lt;/p&gt;
&lt;p&gt;
	There are instructions on the internet on how to do this in &lt;a href="http://www.kristen.org/content/503-http-status-code-when-site-down"&gt;Drupal&lt;/a&gt;, &lt;a href="http://shiftcommathree.com/articles/make-your-rails-maintenance-page-respond-with-a-503"&gt;.htaccess&lt;/a&gt;, &lt;a href="http://php.net/manual/en/function.header.php"&gt;Php&lt;/a&gt;, &lt;a href="http://stackoverflow.com/questions/4495961/how-to-send-a-status-code-500-in-asp-net-and-still-write-to-the-response"&gt;C#&lt;/a&gt;, and &lt;a href="http://stackoverflow.com/questions/8890351/return-a-specific-http-status-code-in-rails"&gt;Ruby on Rails&lt;/a&gt;.&lt;/p&gt;
&lt;h3&gt;
	That made no sense&lt;/h3&gt;
&lt;p&gt;
	Well, if you&amp;#39;re not a software developer we have a much easier option. Just include the javascript below on your website and visitors to your site will be sent to &lt;a href="http://protestsopa.org/"&gt;http://protestsopa.org/&lt;/a&gt;.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot;&amp;gt;
    window.location.href = &amp;quot;http://protestsopa.org/&amp;quot;;
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;h3&gt;
	I can&amp;#39;t blackout my entire site but still want to help&lt;/h3&gt;
&lt;p&gt;
	Completely understandable, and there is an option for you as well! If you include the following javascript a 50px banner will be displayed on your site (example of the banner is included below the script):&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;&amp;lt;script type=&amp;quot;text/javascript&amp;quot; 
src=&amp;quot;https://raw.github.com/SaraJo/SOPA-PIPA-Protest-Page/master/javascript-only/banner.min.js&amp;quot;&amp;gt;
&amp;lt;/script&amp;gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;p align="center"&gt;
	&lt;a href="http://dl.dropbox.com/u/6291954/sopa_pipa_banner_example.PNG"&gt;&lt;img src="http://dl.dropbox.com/u/6291954/sopa_pipa_banner_example.PNG" width="400px" /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	If you do decide to join in on the SOPA/PIPA blackout leave a comment here with your website urls and I&amp;#39;ll make sure you get added to the list.&lt;/p&gt;
</description>
      <guid>http://codeimpossible.com/2012/1/17/This-blog-will-be-different-tomorrow</guid>
    </item>
    <item>
      <title>Getting to the NERD Center</title>
      <link>http://codeimpossible.com/2012/1/16/Getting-to-the-NERD-Center</link>
      <description>&lt;p&gt;
	I&amp;#39;ve been going to the Microsoft NERD Center for a few months now (about 2-3 times a week) for various user groups and community events.&lt;/p&gt;
&lt;p&gt;
	I try to bring new people with me as much as possible and I find that getting them within shouting distance of the building is easy, it&amp;#39;s that last 1/4 mile or so that is hard. So I&amp;#39;m throwing this post up here so I can link people to it in the future.&lt;/p&gt;
&lt;p align="center"&gt;
	&lt;img alt="" src="http://dl.dropbox.com/u/6291954/nerd_center_directions.png" /&gt;&lt;/p&gt;
&lt;p&gt;
	1) This is the road you should be traveling on. If you&amp;#39;re not on this road, you&amp;#39;re doomed.&lt;/p&gt;
&lt;p&gt;
	2) This is the right hand turn that you will not realize is there until you are almost past it. Watch out for merging traffic from the left. This turn will put you on the home stretch. Memorial drive. Take in the scenic Charles River on your left, but don&amp;#39;t stare too long because...&lt;/p&gt;
&lt;p&gt;
	3)&amp;nbsp;You have to make this right hand turn into the main &amp;quot;driveway&amp;quot; which leads you to...&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	4)&amp;nbsp;the NERD Center parking garage!&lt;/p&gt;
&lt;p&gt;
	Park and enjoy your free pizza, event speakers and networking!&lt;/p&gt;
</description>
      <guid>http://codeimpossible.com/2012/1/16/Getting-to-the-NERD-Center</guid>
    </item>
    <item>
      <title>Podcasts</title>
      <link>http://codeimpossible.com/2012/1/16/Podcasts</link>
      <description>&lt;p&gt;
	I&amp;#39;ve been meaning to post this for about a year now, and I&amp;#39;m not sure why it took me so long. I get asked what podcasts I listen to by my developer friends a lot. I always try to throw a few out there but I can never remember the whole list - which is actually kind of sad because the list isn&amp;#39;t that long.&lt;/p&gt;
&lt;p&gt;
	Most of these podcasts are around the 1 hour mark for time, except Hanselminutes which is usually about 40 minutes.&lt;/p&gt;
&lt;p&gt;
	So without further delay, here is the list of podcasts that I enjoy!&lt;/p&gt;
&lt;p&gt;
	&lt;em&gt;One last delay: My pal, &lt;a href="http://johnnycode.com"&gt;John Bubriski&lt;/a&gt; has a great list of podcasts (and many other things) over on his &lt;a href="http://www.johnnycode.com/blog/resources/"&gt;Developer Resources&lt;/a&gt; page.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;em&gt;One more one last delay - I&amp;#39;ve marked podcasts that have strong language with a NSFW.&lt;/em&gt;&lt;/p&gt;
&lt;h3&gt;
	General Nerd Podcasts&lt;/h3&gt;
&lt;p&gt;
	&lt;strong&gt;The Geekbox&lt;/strong&gt; - &lt;a href="http://www.geekbox.net"&gt;Website&lt;/a&gt; - NSFW, Just a group of hilarious geeks/nerds talking about videogames, tv, movies and comics. Can&amp;#39;t pick any favorites for this as every episode is awesome.&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;A life well wasted&lt;/strong&gt; - &lt;a href="http://alifewellwasted.com/podcast/"&gt;Website&lt;/a&gt; - NSFW, A &amp;quot;This American Life&amp;quot; for video game nerds. Favorite epsiodes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		The death of EGM - &lt;a href="http://alifewellwasted.com/2009/03/03/episode-two-gotta-catch-em-all/"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		Gotta Catch &amp;#39;Em All - &lt;a href="http://alifewellwasted.com/2009/01/23/episode-one-the-death-of-egm/"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;strong&gt;Comic Conspiracy&lt;/strong&gt; - &lt;a href="http://www.geekbox.net/archives/category/podcasts/comic-conspiracy/"&gt;Website&lt;/a&gt; - NSFW, Podcast that covers everything comic book related. No favorites here, every episode is excellent.&lt;/p&gt;
&lt;h3&gt;
	Development Oriented Podcasts&lt;/h3&gt;
&lt;p&gt;
	&lt;strong&gt;This Developers Life&lt;/strong&gt; - &lt;a href="http://thisdeveloperslife.com/"&gt;Website&lt;/a&gt; - &amp;quot;This American Life&amp;quot; for programmers. Awesome, awesome podcast. Favorite episodes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		Pressure - &lt;a href="http://thisdeveloperslife.com/post/2-0-2-pressure"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		Criticism - &lt;a href="http://thisdeveloperslife.com/post/2-0-1-criticism"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		Getting Fired - &lt;a href="http://thisdeveloperslife.com/post/1203177584/1-0-1-getting-fired"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;strong&gt;Herding Code&lt;/strong&gt; - &lt;a href="http://herdingcode.com"&gt;Website&lt;/a&gt; - Informative and funny podcast that usually highlights the &amp;quot;hip&amp;quot; new stuff in Microsoft .Net Development. Favorite episodes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		Interview with Miguel de Icaza (&lt;a href="http://herdingcode.com/?p=109"&gt;Part 1&lt;/a&gt;) (&lt;a href="http://herdingcode.com/?p=114"&gt;Part 2&lt;/a&gt;)&lt;/li&gt;
	&lt;li&gt;
		Scott Belware on BDD and Lean Development - &lt;a href="http://herdingcode.com/?p=176"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		Measuring victory in software development - &lt;a href="http://herdingcode.com/?p=221"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt; 

&lt;p&gt;&lt;strong&gt;Hanselminutes&lt;/strong&gt; - &lt;a href="http://hanselminutes.com"&gt;Website&lt;/a&gt; - The 800lb gorrila of .Net focused podcasts. Each week Scott Hanselman interviews someone in the field of IT/Software Development and posts the result. Favorite episodes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		Anything from the &amp;quot;Startup Series&amp;quot; &lt;a href="http://hanselminutes.com/archives"&gt;Episodes 282 - 287&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		History of HTTP - &lt;a href="http://hanselminutes.com/292/history-of-http-and-the-world-wide-web-with-henrik-frystyk-nielsen"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		A C64 emulator in Silverlight &lt;a href="http://hanselminutes.com/155/a-c64-emulator-with-silverlight-3-by-pete-brown"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;strong&gt;Alt.net Podcast&lt;/strong&gt; - &lt;a href="http://altnetpodcast.com"&gt;Website&lt;/a&gt; - Now defunct, this podcast promotes an alternative way of thinking, about problems and about code, for .Net developers. Favorite episodes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		Object Databases with James Avery and Rob Conery - &lt;a href="http://altnetpodcast.com/episodes/14-object-databases"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		Ruby on Rails &lt;a href="http://altnetpodcast.com/episodes/13-ruby-on-rails/"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		Dependency Injection and IOC with Nate Kohari and Brad Wilson &lt;a href="http://altnetpodcast.com/episodes/5-di-and-ioc/"&gt;Part 1&lt;/a&gt; &lt;a href="http://altnetpodcast.com/episodes/6-more-di-and-ioc/"&gt;Part 2&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
	&lt;strong&gt;Thirsty Developer&lt;/strong&gt; - &lt;a href="http://thirstydeveloper.com"&gt;Website&lt;/a&gt; - Podcast that interviews various people in software development, usually over drinks. Very laid back atmosphere and a great educational resource. No longer in production. Favorite episodes:&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		Interview with Jeff Atwood - &lt;a href="http://thirstydeveloper.com/Shows/TD018-JeffAtwood.mp3"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;
		The Meta Episode - &lt;a href="http://thirstydeveloper.com/2011/04/06/TheThirstyDeveloper100TheMetaEpisode.aspx"&gt;Full Episode&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
</description>
      <guid>http://codeimpossible.com/2012/1/16/Podcasts</guid>
    </item>
    <item>
      <title>Moving your mercurial repository to git</title>
      <link>http://codeimpossible.com/2011/12/29/Moving-your-mercurial-repository-to-git</link>
      <description>&lt;p&gt;&lt;/p&gt;

&lt;p&gt;Moving source code is easy. You can do it with a couple of mouse clicks, a commit and be done in about 5 minutes if you really wanted to. But if you did, you'd be missing the most important part: the history.&lt;/p&gt;

&lt;p&gt;The greatest thing about source control is that it gives you a history for your project. You can see how a project has grown from one commit to the next. You can see who the heavy hitters are and who built that kick ass feature you love.&lt;/p&gt;

&lt;p&gt;However, this becomes a problem when you talk about moving your source code from one repository vendor to another. You have all this history... this is the stuff that I really wanted to move over.&lt;/p&gt;

&lt;p&gt;Thankfully, in the case of moving from Mercurial to Git, a programmer by the name of Cosmin Stejerean - check out his blog at &lt;a href="http://offbytwo.com"&gt;offbytwo.com&lt;/a&gt;, it's a great read - built a hg import module for git.&lt;/p&gt;

&lt;p&gt;The hg to git importer (&lt;a href="http://github.com/offbytwo/git-hg"&gt;git-hg&lt;/a&gt;) is a bunch of shell scripts that interact with mercurial and sort of "replay" your mercurial commits into a new, empty git repository that git-hg creates on your machine. &lt;/p&gt;

&lt;h2&gt;Installing git-hg&lt;/h2&gt;

&lt;p&gt;Installation of git-hg is simple but you'll need to have hg and python installed and in your &lt;code&gt;PATH&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;You should do a dump of your &lt;code&gt;$PATH&lt;/code&gt; variable to make sure you have these apps there or if you're lazy like me you can just try to run each app.&lt;/p&gt;

&lt;pre class="prettyprint"&gt;&lt;code&gt;$ hg --version
$ Mercurial Distributed SCM (version 1.9.1)
$ (see http://mercurial.selenic.com for more information)

$ Copyright (C) 2005-2011 Matt Mackall and others
$ This is free software; see the source for copying conditions. There is NO
$ warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

$ python --version
$ Python 2.7.2+
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Now all that is missing is git-hg. Clone the git-hg repo with git and install the submodule.&lt;/p&gt;

&lt;pre class="prettyprint"&gt;&lt;code&gt;$ git clone http://github.com/offbytwo/git-hg

$ cd git-hg
$ git submodule update --init
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;After the submodule is registered add git-hg into the PATH. I usually copy the necessary files to &lt;code&gt;/usr/local/bin&lt;/code&gt;.&lt;/p&gt;

&lt;pre class="prettyprint"&gt;&lt;code&gt;$ cp git-hg/bin/git-hg /usr/local/bin/git-hg
$ cp git-hg/fast-export /usr/local/fast-export
&lt;/code&gt;&lt;/pre&gt;

&lt;h2&gt;Porting your first repository&lt;/h2&gt;

&lt;pre class="prettyprint"&gt;&lt;code&gt;$ git-hg clone http://bitbucket.org/codeimpossible/artigo artigo-git
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;Git-hg will clone the repo, this can take a while depending on how many commits your repo has. Once it's done you can add a new remote for your github repo and push it up.&lt;/p&gt;

&lt;pre class="prettyprint"&gt;&lt;code&gt;$ git remote add github http://github.com/codeimposible/Artigo.git
$ git push github master

... enter credentials here ...
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;And it's as easy as that! I realize this was a linux/mac only walkthrough, if anyone has steps or tools that they use to accomplish the same thing on Windows please post in the comments, I'd like to help as many people as possible move over to the 'hub.&lt;/p&gt;

&lt;p&gt;Also, I'm no linux expert so if I made really stupid mistakes let me know so I can fix them up!&lt;/p&gt;</description>
      <guid>http://codeimpossible.com/2011/12/29/Moving-your-mercurial-repository-to-git</guid>
    </item>
    <item>
      <title>Stupid Git Trick - getting contributor stats</title>
      <link>http://codeimpossible.com/2011/12/16/Stupid-Git-Trick-getting-contributor-stats</link>
      <description>&lt;p&gt;
	We use&amp;nbsp;&lt;a href="http://github.com" style="font-size: 18px; "&gt;github&lt;/a&gt;&amp;nbsp;for all of our source code and documentation on the&amp;nbsp;&lt;a href="http://ohloh.net" style="font-size: 18px; "&gt;Ohloh&lt;/a&gt;&amp;nbsp;team. We&amp;#39;ve even got a few&amp;nbsp;&lt;a href="http://github.com/blackducksw" style="font-size: 18px; "&gt;public open source&lt;/a&gt;&amp;nbsp;projects up there that you should check out, but I&amp;#39;ll talk about those another time.&lt;/p&gt;
&lt;p&gt;
	Earlier this week I tweeted my YTD commit stats from my new job:&lt;/p&gt;
&lt;blockquote class="twitter-tweet tw-align-center"&gt;
	&lt;p&gt;
		git stats so far - added lines: 4158 removed lines : 1628, need to get some more cleanup done!&lt;/p&gt;
	&amp;mdash; Jared Barboza (@codeimpossible) &lt;a data-datetime="2011-12-13T16:08:08+00:00" href="https://twitter.com/codeimpossible/status/146622441274351616"&gt;December 13, 2011&lt;/a&gt;&lt;/blockquote&gt;
&lt;script src="//platform.twitter.com/widgets.js" charset="utf-8"&gt;&lt;/script&gt;
&lt;p&gt;
	And I was asked how I came up with those numbers, which made me realize two things:&lt;/p&gt;
&lt;ol&gt;
	&lt;li&gt;
		git is awesome&lt;/li&gt;
	&lt;li&gt;
		those numbers are wrong!&lt;/li&gt;
&lt;/ol&gt;
&lt;h2&gt;
	Git is awesome&lt;/h2&gt;
&lt;p&gt;
	Git &lt;strong&gt;is&lt;/strong&gt; awesome, and for a of other reasons that I&amp;#39;ll cover in some future posts. Git is awesome right now because it collects stats. Not as a main feature, not really anyway, but as a by product of you and your team pushing code around.&lt;/p&gt;
&lt;p&gt;
	Every commit in git is logged so git knows what the heck is going on at any given moment. Git is like that kid in college or high school that was so awesome at taking notes that he was able to buy a cannondale super v using the money he made selling copies of his notes to other people.&lt;/p&gt;
&lt;p&gt;
	Git could probably afford to buy Amazing Fantasy issue 15 (first appearance of spider man for the non-nerds), git is &lt;strong&gt;that&lt;/strong&gt; good at it.&lt;/p&gt;
&lt;p&gt;
	Getting your commits from a git repo is pretty damned easy:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;git log --author=&amp;quot;Jared Barboza&amp;quot; --pretty=tformat: --numstat
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	That line will ask git to go into its log and pull out the commits that you&amp;#39;ve made and format them using the &amp;quot;numstat&amp;quot; formatting, more on this in a moment. The output will look like the example below, with the first column displays the number of additions (lines you added) and the second number is the number of deletions (lines removed).&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;5       8       public/javascripts/main.js
2000    0       public/javascripts/jquery/jquery.cycle.all.js
10      9       public/stylesheets/layout.css
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Awesome, let&amp;#39;s see if we can a nicer looking total out of this. Now, in order to do this we&amp;#39;re going to need to do some terminal magic with &lt;a href="http://gnuwin32.sourceforge.net/packages/gawk.htm"&gt;gawk&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
	If you&amp;#39;ve never used gawk before this might be really strange looking to you but it&amp;#39;s pretty easy to grok. Gawk allows us to run &amp;quot;code&amp;quot; via the terminal and uses any text piped to it as arguments. So we can do this:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;git log --author=&amp;quot;Jared Barboza&amp;quot; --pretty=tformat: --numstat | \
gawk &amp;#39;{ add += $1 ; subs += $2 ; loc += $1 - $2 } END \
{ printf &amp;quot;added lines: %s removed lines: %s total lines: %s\n&amp;quot;,add,subs,loc }&amp;#39; -
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	This will pipe (more about piping in the next section) the output from the &lt;code&gt;git log&lt;/code&gt; command into gawk which will use each line as a new set of arguments and will keep a running total of the additions (first argument) , deletions (second argument) and the difference between the two (the &amp;quot;true&amp;quot; lines of code I&amp;#39;ve commited).&lt;/p&gt;
&lt;p&gt;
	After gawk is done we&amp;#39;ll see this result on our terminal:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;added lines: 2015 removed lines: 17 total lines: 1998
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	For those of you who are linux termnial n00bs like me, the &lt;code&gt;\&lt;/code&gt; in the terminal command above is a line continuation character. It lets us tell the terminal that the command is continued on the next line.&lt;/p&gt;
&lt;p&gt;
	The &lt;code&gt;|&lt;/code&gt; character tells the terminal to take the output from the command on the left and feed it to the command on the right, this is called &amp;quot;piping&amp;quot;.&lt;/p&gt;
&lt;p&gt;
	For all my Windows peeps, you can grab &lt;a href="http://www.wingrep.com/features.htm"&gt;grep&lt;/a&gt; and &lt;a href="http://gnuwin32.sourceforge.net/packages/gawk.htm"&gt;gawk&lt;/a&gt; for Windows to get this to work.&lt;/p&gt;
&lt;p&gt;
	Now, back to the stats. They&amp;#39;re great but they are not really accurate are they? I mean it&amp;#39;s counting a jquery library (&lt;a href="http://jquery.malsup.com/cycle/"&gt;jQuery Cycle&lt;/a&gt; by Mr. Amazing himself, &lt;a href="http://twitter.com/malsup"&gt;Mike Alsup&lt;/a&gt;) which isn&amp;#39;t my code so I don&amp;#39;t want that to be part of my count. Which brings me to my next point.&lt;/p&gt;
&lt;h2&gt;
	The numbers I posted are completely wrong!&lt;/h2&gt;
&lt;p&gt;
	When I posted those numbers on the twitters I totally ignored the fact that I was counting files that I didn&amp;#39;t write. So I needed to figure out how to remove certain lines from the result &lt;em&gt;before&lt;/em&gt; it gets passed into gawk.&lt;/p&gt;
&lt;p&gt;
	I found grep has a &lt;code&gt;-v&lt;/code&gt; option that tells it to ignore lines that match the text supplied. So I can use the following in the &amp;quot;pipeline&amp;quot; (a chain of piped commands) to trim out the unwanted code file.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;grep -v public/javascripts/jquery
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	When that it combined with the script from before I end up with:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;git log --author=&amp;quot;Jared Barboza&amp;quot; --pretty=tformat: --numstat | \
grep -v public/javascripts/jquery | \
gawk &amp;#39;{ add += $1 ; subs += $2 ; loc += $1 - $2 } END \
{ printf &amp;quot;added lines: %s removed lines : %s total lines: %s\n&amp;quot;,add,subs,loc }&amp;#39; -
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Which will print out&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;added lines: 15 removed lines: 17 total lines: -2
&lt;/code&gt;&lt;/pre&gt;
&lt;p&gt;
	Now this is a much better count. We can see that I&amp;#39;ve actually removed code from our codebase which is always a good thing.&lt;/p&gt;
&lt;h2&gt;
	The &amp;quot;Official Stats&amp;quot; for my first 3 weeks&lt;/h2&gt;
&lt;p&gt;
	So now that we have a much better way of determining commit stats, I re-did all my stats for the last three weeks. I used grep commands to break out the commit stats even more e.g. using &lt;code&gt;grep /test&lt;/code&gt; and &lt;code&gt;grep /public/javascripts&lt;/code&gt; to get the stats for unit tests and javascript.&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Unit Tests:&lt;/strong&gt; added lines: 696 removed lines: 107&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Controllers:&lt;/strong&gt; added lines: 43 removed lines: 50&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Models:&lt;/strong&gt; added lines: 71 removed lines: 77&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Helpers:&lt;/strong&gt; added lines: 15 removed lines: 7&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Views:&lt;/strong&gt; added lines: 221 removed lines: 143&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Javascript:&lt;/strong&gt; added lines: 1112 removed lines: 927&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Css:&lt;/strong&gt; added lines: 416 removed lines: 220&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Project Total:&lt;/strong&gt;&amp;nbsp;added lines: 2574 removed lines: 1531&lt;/p&gt;
&lt;ul&gt;
	&lt;li&gt;
		6.9% of removals and 27% of additions were unit tests&lt;/li&gt;
	&lt;li&gt;
		60.5% of removals and 43% of additions were javascript&lt;/li&gt;
&lt;/ul&gt;
</description>
      <guid>http://codeimpossible.com/2011/12/16/Stupid-Git-Trick-getting-contributor-stats</guid>
    </item>
    <item>
      <title>Installing the Package Control plugin for Sublime Text</title>
      <link>http://codeimpossible.com/2011/11/29/Installing-the-Package-Control-plugin-for-Sublime-Text</link>
      <description>&lt;p&gt;I wrote previously how &lt;a href="http://www.codeimpossible.com/2011/11/13/Notepad-it-s-time-we-saw-other-editors"&gt;I've given up on Notepad++&lt;/a&gt;. It's time to find a new editor. But this new editor has to be great. Not just "good", or "okay", or "decent" but great. We're talking Sean Connery as Bond &lt;strong&gt;great&lt;/strong&gt;.
&lt;/p&gt;&lt;p&gt;
I've used N++ for the past 6 years as my defacto file editor. Javascript, Html, Css, Xml, java, c#, ruby, basically anything I needed to edit was run through N++. &lt;/p&gt;

&lt;p&gt;Which means its replacement has to do a lot of heavy lifting in the syntax coloring and language features area. And with its really amazing plugin framework and one particularly awesome plugin, Sublime Text has no equal.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Enter Package Control&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="http://wbond.net/sublime_packages/package_control"&gt;Package Control&lt;/a&gt; is a plugin for sublime text written by Will Bond, who has &lt;a href="http://wbond.net/sublime_packages/"&gt;an awesome collection of plugins&lt;/a&gt; on his site. Will has instructions on &lt;a href="http://wbond.net/sublime_packages/package_control#installation"&gt;how to install Package Control&lt;/a&gt; on his website. It's pretty easy, just copy and paste some python text into the SublimeText console, restart the editor and you're off and running!&lt;/p&gt;

&lt;p&gt;Package Control is a plugin manager for sublime text. If you've used &lt;a href="http://rubygems.org"&gt;rubygems&lt;/a&gt; or &lt;a href="http://nuget.org"&gt;nuget&lt;/a&gt; you'll be very familiar with Package Control.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Installing your first plugin&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Installing a plugin is insanely simple. Use the key combination &lt;code&gt;ctrl+shift+p&lt;/code&gt;, this will bring up the command palette window. From here you just type in "Package Control:" and you will see a listing similar to the screenshot below.&lt;/p&gt;

&lt;p&gt;&lt;img src="http://content.screencast.com/users/codeimpossible/folders/Jing/media/6a9278bf-f7f3-47c6-af65-a512732274cb/2011-11-13_2050.png"&gt;&lt;/p&gt;

&lt;p&gt;See that text "Install Package"...? Yeah, select that (you can click it or use the arrow keys) and PackageControl will start fetching the list of plugins from the current list of repositories. &lt;/p&gt;

&lt;p&gt;You can add repositories to this list by following the directions on the Package Control website but it has a bunch of plugins included by default.&lt;/p&gt;

&lt;p&gt;Once the list of plugins is retrieved it will be displayed in the same way the command palette was and you can filter the items by typing. &lt;/p&gt;

&lt;p&gt;I wanted a ruby test runner so I typed in "Ruby" and I saw a plugin named "RubyTest". I pressed enter and about 30 seconds later the plugin was installed. No need to restart SublimeText!&lt;/p&gt;

&lt;p&gt;Extensibility is something a lot of applications brag about (Microsoft Office, Notepad++) but only a few truly deliver on that. Sublime Text is one of those applications. Sublime Text takes the same approach to plugins that FireFox did. If you can think it, you can do it.&lt;/p&gt;&lt;/div&gt;</description>
      <guid>http://codeimpossible.com/2011/11/29/Installing-the-Package-Control-plugin-for-Sublime-Text</guid>
    </item>
    <item>
      <title>Notepad++, it's time we saw other editors</title>
      <link>http://codeimpossible.com/2011/11/13/Notepad-it-s-time-we-saw-other-editors</link>
      <description>&lt;p&gt;
	Notepad++ has been my text editor of choice for the past 6 years. I&amp;#39;ve always found it to be a productivity aide and it&amp;#39;s always&amp;nbsp;&lt;strong&gt;just worked&lt;/strong&gt;. However, lately, Notepad++ has a nasty habit of losing all of my settings and it&amp;#39;s becoming unbearable.&lt;/p&gt;
&lt;p&gt;
	I asked on twitter the other day if anyone had a better editor that they had used on Windows. I got a lot of good suggestions and most of them were for &lt;a href="http://www.sublimetext.com/2" target="_blank"&gt;Sublime Text&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;
	First things first: you should be aware that SublimeText is not free. It has an unlimited time trial but you&amp;#39;ll get a semi-annoying popup asking you to buy a copy. Currently, SublimeText costs $59 per user.&lt;/p&gt;
&lt;p&gt;
	The good news is that SublimeText is licensed on a per-user basis, not per-machine. This means you can install your licensed copy of SublimeText on as many machines as you like. Also, SublimeText uses a hosted version of Python v2.6.5, so you can build some pretty awesome plugins. I&amp;#39;ll have a post soon on how to build a pretty sweet plugin in a few days.&lt;/p&gt;
&lt;p&gt;
	SublimeText has an awesome set of features. I&amp;#39;ve pointed out a few of my favorites in the screenshot below but there are others that deserve a mention.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;
	&lt;a href="http://content.screencast.com/users/codeimpossible/folders/Jing/media/0cd8cd69-e702-4891-ba03-eb7ce4f986a6/2011-11-13_1750.png" target="_blank"&gt;&lt;img alt="" src="http://content.screencast.com/users/codeimpossible/folders/Jing/media/0cd8cd69-e702-4891-ba03-eb7ce4f986a6/2011-11-13_1750.png" style="width: 400px; height: 309px; " /&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Totally Configurable and Extendable&lt;/strong&gt;&lt;br /&gt;
	All of the user/global settings are stored in editable JSON files. Need to add a custom keybinding? No problem. Select Preferences\Key Bindings - Default or Key Bindings - User and start editing. All key bindings call python-based plugin methods so adding a keybinding for your plugin is really simple.&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Auto Completion&lt;/strong&gt;&lt;br /&gt;
	SublimeText has a really great tab autocompletion system. It auto-completes local variables, local methods and it seems to have an uncanny knowledge of what you meant.&lt;/p&gt;
&lt;p&gt;
	&lt;strong&gt;Finding stuff is easier&lt;/strong&gt;&lt;br /&gt;
	The find function is incredibly easy to use, just hit ctrl+f and start typing. SublimeText will bring you to the first match and start highlighing all the other matches.&amp;nbsp;Find and replace uses&amp;nbsp;&lt;strong&gt;real&lt;/strong&gt; regular expressions, not the strange hybrid that notepad++ uses and definitely not that filthy mess that visual studio tries to pass off as regular expressions.&lt;/p&gt;
&lt;p&gt;
	I&amp;#39;ll be evaluating SublimeText for another couple of days, building out some plugins and using it as my default for a while before I make the decision to buy it, but it&amp;#39;s already impressed the hell out of me and made me want to stop using Notepad++.&lt;/p&gt;
&lt;p&gt;
	Have you used SublimeText or another text editor? Let me know what your favorite is in the comments!&lt;/p&gt;
</description>
      <guid>http://codeimpossible.com/2011/11/13/Notepad-it-s-time-we-saw-other-editors</guid>
    </item>
    <item>
      <title>An example of using Dynamic objects in your Razor views</title>
      <link>http://codeimpossible.com/2011/11/10/An-example-of-using-Dynamic-objects-in-your-Razor-views</link>
      <description>&lt;p&gt;
	My good friend &lt;a href="https://twitter.com/#!/JohnBubriski"&gt;@JohnBubriski&lt;/a&gt; put up &lt;a href="http://www.johnnycode.com/blog/2011/11/09/asp-net-mvc-extension-method-for-id-in-route"&gt;a great post on his blog&lt;/a&gt; where he talks about accessing url route params in your MVC views.&lt;/p&gt;
&lt;p&gt;
	John made a really good solution by adding an extension method to the HtmlHelper class which would return the &lt;code&gt;{id}&lt;/code&gt; route param. This solution is simple, any developer can understand it at a glance, but I thought I would show how you might use DynamicObject and the features of .Net 4.0 to solve this problem.&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Dynamic;

namespace System.Web.Mvc {

    public class DynamicUrlAccessor : DynamicObject {
        private ViewContext _context;
        
        public DynamicUrlAccessor(ViewContext context) {
            _context = context;
        }
        
        public override bool TryInvokeMember(
                InvokeMemberBinder binder, 
                object[] args, 
                out object result) {

            if (_context.RouteData.Values.ContainsKey(binder.Name)) {
                result = _context.RouteData.Values[binder.Name].ToString();
                return true;
            }

            // the dirty way too
            var querystring = HttpContext.Current.Request.QueryString;
            if (querystring.AllKeys.Contains(binder.Name)) {
                result = querystring[binder.Name].ToString();
                return true;
            }
            
            return base.TryInvokeMember(binder, args, out result);
        }
    }

    public static class ContextExtensions {

        public static dynamic RouteInfo(this System.Web.Mvc.HtmlHelper helper) {
            var accessor = new DynamicUrlAccessor(helper.ViewContext);
            return accessor;
        }
    }
}
&lt;/code&gt;
&lt;/pre&gt;
&lt;p&gt;
	Now you can use this code in your view like so:&lt;/p&gt;
&lt;pre class="prettyprint"&gt;
&lt;code&gt;
&amp;lt;h2&amp;gt;About&amp;lt;/h2&amp;gt;
&amp;lt;p&amp;gt;
     Hello @Html.RouteInfo().name()! You are in the @Html.RouteInfo().action() action, 
which is located in the @Html.RouteInfo().controller() controller.
&amp;lt;/p&amp;gt;
&lt;/code&gt;
&lt;/pre&gt;
&lt;p align="center"&gt;
	&lt;img src="http://content.screencast.com/users/codeimpossible/folders/Jing/media/456e1966-0970-4470-93a9-05789d98c8db/2011-11-09_2255.png" style="-moz-box-shadow: 10px 10px 5px #888; -webkit-box-shadow: 10px 10px 5px #888; box-shadow: 10px 10px 5px #888;" /&gt;&lt;/p&gt;
&lt;p&gt;
	When the &lt;code&gt;RouteInfo()&lt;/code&gt; method is called our DynamicUrlAccessor object is retuned as a &lt;code&gt;dynamic&lt;/code&gt;. This in turn will cause our overridden method &lt;code&gt;TryInvokeMember&lt;/code&gt; to be called.&lt;br /&gt;
	&lt;br /&gt;
	The binder object will contain the name of the method that was invoked, any arguments passed will be in the args[] collection. All we need to do at this point is check whether the ViewContext or the QueryString contains the requested parameter and set its value into the result variable.&lt;/p&gt;
&lt;p&gt;
	So hopefully this shows you how a little work with DynamicObject can go a long way towards improving code readability and creating elegant solutions.&lt;/p&gt;
</description>
      <guid>http://codeimpossible.com/2011/11/10/An-example-of-using-Dynamic-objects-in-your-Razor-views</guid>
    </item>
  </channel>
</rss>

