<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>David Mohundro</title>
    <link>http://www.mohundro.com/blog/</link>
    <description>From the life of a programmer</description>
    <language>en-us</language>
    <copyright>David Mohundro</copyright>
    <lastBuildDate>Fri, 12 Jun 2009 12:58:18 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 2.3.9074.18820</generator>
    <managingEditor>drmohundro@gmail.com</managingEditor>
    <webMaster>drmohundro@gmail.com</webMaster>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/DavidMohundro" type="application/rss+xml" /><item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=6b15a888-ae1a-41b1-8559-5ac3f8e8fbab</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,6b15a888-ae1a-41b1-8559-5ac3f8e8fbab.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,6b15a888-ae1a-41b1-8559-5ac3f8e8fbab.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=6b15a888-ae1a-41b1-8559-5ac3f8e8fbab</wfw:commentRss>
      
      <title>Find-String.ps1 – ack for PowerShell</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,6b15a888-ae1a-41b1-8559-5ac3f8e8fbab.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/7PYA0Lxxiho/FindStringps1AckForPowerShell.aspx</link>
      <pubDate>Fri, 12 Jun 2009 12:58:18 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Never heard of &lt;a href="http://betterthangrep.com/"&gt;ack&lt;/a&gt;? Well, by ack’s admission,&#xD;
it is “better than grep.” That’s up to you to decide, but it does make searching code&#xD;
easier than grep.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
As a means of illustration, here is a grep example of a recursive search for StringBuilder&#xD;
across multiple C# files that I used back in &lt;a href="http://www.mohundro.com/blog/2009/05/12/FindingStuffQuicklyOrSearchingThroughCodeEffectively.aspx"&gt;my&#xD;
post on “finding stuff quickly.”&lt;/a&gt;&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;img src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_thumb_5.png"&gt;&lt;/img&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The output is pretty nice, but the addition of the find command to limit the searching&#xD;
to only C# files isn’t the easiest to type quickly.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
ack makes this a little… well, a lot easier.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_2.png"&gt;&#xD;
            &lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_thumb.png" width="503" height="173"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Nice! Even EASIER to read than the grep matching. And it is easier to type.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Well, of course, I had to add this functionality to Find-String. (Guess what, it runs&#xD;
faster than grep and ack both! At least on Windows…)&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_4.png"&gt;&#xD;
            &lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_thumb_1.png" width="594" height="277"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Now, this makes… the third post I’ve had on a Find-String PowerShell script I think.&#xD;
At some point, you’re going to get tired of this if you haven’t already. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
“Is this guy seriously going to post every time he changes the way Find-String works?”&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
No, no, I guess I shouldn’t.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
But for my own benefit, I do want this in source control. And I’d like to make it&#xD;
easier to use and find this. I’ve been using a local SVN repository for my changes&#xD;
to my scripts, but they included all of my scripts. Well, I moved just the Find-String&#xD;
source over to GitHub yesterday. I even started from the initial version of Find-String&#xD;
and committed my change history over from SVN :-)&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_6.png"&gt;&#xD;
            &lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_thumb_2.png" width="624" height="103"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
For up to date versions of Find-String, they’ll be out there. The URL is &lt;a title="http://github.com/drmohundro/Find-String/tree/master" href="http://github.com/drmohundro/Find-String/tree/master"&gt;http://github.com/drmohundro/Find-String/tree/master&lt;/a&gt;.&#xD;
If you don’t want to install &lt;a href="http://www.git-scm.com/"&gt;git&lt;/a&gt; to check the&#xD;
source out, there is a big download button on the project page. It will package up&#xD;
the current version of Find-String for you which you can then download and use to&#xD;
your heart’s content.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
If you improve upon the script, send me pull requests or a patch and I’d be happy&#xD;
to make it better.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
 &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Warning, upcoming tangent regarding GitHub adding PowerShell syntax support…&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
My other hope with posting this is that maybe GitHub will add the PowerShell syntax&#xD;
support to GitHub. If you view the source for Find-String on the GitHub website, you&#xD;
won’t see any syntax highlighting.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_8.png"&gt;&#xD;
            &lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_thumb_3.png" width="369" height="250"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
But… they have syntax highlighting for &lt;em&gt;lots&lt;/em&gt; of other file types, as is evidenced&#xD;
by the gists I’ve already shared.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_10.png"&gt;&#xD;
            &lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/FindString.ps1ackforPowerShell_7013/image_thumb_4.png" width="430" height="295"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://support.github.com/discussions/feature-requests/327-powershell-as-a-support-language#comment_134001"&gt;I&#xD;
already asked for this on the GitHub support site&lt;/a&gt;, but it was inexplicably closed&#xD;
with “no more actions from GitHub… are required” and that it is apparently “resolved.”&#xD;
Maybe I shouldn’t worry and the feature just hasn’t gone live yet. In which case,&#xD;
I’m just blabbing on and on for no reason and creating a long tangent to the rest&#xD;
of my post. If &lt;em&gt;not&lt;/em&gt;, well, maybe they’ll add support if I complain some more!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=6b15a888-ae1a-41b1-8559-5ac3f8e8fbab"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DavidMohundro?a=7PYA0Lxxiho:8DAwdnXmVF0:G79ilh31hkQ"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DavidMohundro?d=G79ilh31hkQ" border="0"&gt;&lt;/img&gt;&lt;/a&gt; &lt;a href="http://feeds.feedburner.com/~ff/DavidMohundro?a=7PYA0Lxxiho:8DAwdnXmVF0:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DavidMohundro?i=7PYA0Lxxiho:8DAwdnXmVF0:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/7PYA0Lxxiho" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,6b15a888-ae1a-41b1-8559-5ac3f8e8fbab.aspx</comments>
      <category>PowerShell</category>
      <category>Programming</category>
      <category>Utilities</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/06/12/FindStringps1AckForPowerShell.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=fa72ff57-5c08-49fa-979e-c732df2bf5f8</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,fa72ff57-5c08-49fa-979e-c732df2bf5f8.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,fa72ff57-5c08-49fa-979e-c732df2bf5f8.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=fa72ff57-5c08-49fa-979e-c732df2bf5f8</wfw:commentRss>
      
      <title>NHibernate Unit Testing… with Fluent NHibernate!</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,fa72ff57-5c08-49fa-979e-c732df2bf5f8.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/vB_rrb7b1Yo/NHibernateUnitTestingWithFluentNHibernate.aspx</link>
      <pubDate>Tue, 19 May 2009 17:34:06 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I’ve been attempting to learn NHibernate lately. One of the big draws for me was the&#xD;
ability to write unit tests that did hit a database, but an in-memory one. Ayende&#xD;
recently posted on &lt;a href="http://ayende.com/Blog/archive/2009/04/28/nhibernate-unit-testing.aspx"&gt;how&#xD;
to use SQLite to get in-memory unit tests&lt;/a&gt;. His example assumed standard hbm mappings&#xD;
and configuration.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I was curious how hard it would be port his example over to Fluent NHibernate. Not&#xD;
surprisingly, it was quite easy actually!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Here’s the Blog entity I used, which is based on the usage I saw from Ayende’s post:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;script src="http://gist.github.com/114239.js"&gt;&#xD;
          &lt;/script&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
And here is the mapping:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;script src="http://gist.github.com/114241.js"&gt;&#xD;
          &lt;/script&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
As you can see, it is pretty straight forward so far. The next piece of code is the&#xD;
Fluent NHibernate implementation of Ayende’s InMemoryDatabaseTest.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;script src="http://gist.github.com/114242.js"&gt;&#xD;
          &lt;/script&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
There aren’t too many differences really. We’re using the same SchemaExport, but we&#xD;
do need to call ExposeConfiguration so that we can store off a reference to the Configuration&#xD;
to be used by the SchemaExport instance.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The final piece, the actual test itself, is identical to Ayende’s example, except&#xD;
that I’m using MbUnit instead of xUnit:&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;script src="http://gist.github.com/114244.js"&gt;&#xD;
          &lt;/script&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Nice and easy! I like it!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
As you can also tell, I’m experimenting with using &lt;a href="http://github.com/"&gt;github&lt;/a&gt;’s &lt;a href="http://gist.github.com/"&gt;gist&lt;/a&gt; feature.&#xD;
I’ve been using &lt;a href="http://github.com/"&gt;github&lt;/a&gt; to store off my dot files&#xD;
and other environment-related settings as well as my presentations, but the gist feature&#xD;
seems pretty nice.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=fa72ff57-5c08-49fa-979e-c732df2bf5f8"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DavidMohundro?a=vB_rrb7b1Yo:4Q_fD_uIRaQ:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DavidMohundro?i=vB_rrb7b1Yo:4Q_fD_uIRaQ:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/vB_rrb7b1Yo" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,fa72ff57-5c08-49fa-979e-c732df2bf5f8.aspx</comments>
      <category>.NET</category>
      <category>Unit Testing</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/05/19/NHibernateUnitTestingWithFluentNHibernate.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=83ba3e37-c3e9-402c-9a13-7cfcb306c007</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,83ba3e37-c3e9-402c-9a13-7cfcb306c007.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,83ba3e37-c3e9-402c-9a13-7cfcb306c007.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=83ba3e37-c3e9-402c-9a13-7cfcb306c007</wfw:commentRss>
      <slash:comments>3</slash:comments>
      
      <title>Finding stuff quickly (or searching through code effectively)</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,83ba3e37-c3e9-402c-9a13-7cfcb306c007.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/SZL7CnO72aM/FindingStuffQuicklyOrSearchingThroughCodeEffectively.aspx</link>
      <pubDate>Tue, 12 May 2009 19:55:25 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I &lt;a href="http://www.mohundro.com/blog/2006/11/06/FindInFilesWithPowerShell.aspx"&gt;blogged&#xD;
a while back about finding in files with PowerShell&lt;/a&gt; and I wanted to share an update&#xD;
on that.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The original post highlighted using a combination of Get-ChildItem and Select-String&#xD;
to quickly find things. It works fine, but the output isn’t the easiest to read, because&#xD;
the found text isn’t highlighted in any way.&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: ps1;"&gt;Get-ChildItem –include *.cs –recurse | Select-String searchText&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_8.png"&gt;&#xD;
            &lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_thumb_3.png" width="678" height="127"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I really like the color output that grep provides. Check out the results of grep on&#xD;
the same search.&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: bash;"&gt;find –name *.cs | xargs grep StringBuilder&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_10.png"&gt;&#xD;
            &lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_thumb_4.png" width="665" height="85"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
That is &lt;em&gt;so much easier&lt;/em&gt; to read that it isn’t even funny. The match jumps&#xD;
out at you because of the color difference.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I did some searching and found &lt;a href="http://weblogs.asp.net/whaggard/archive/2007/03/23/powershell-script-to-find-strings-and-highlight-them-in-the-output.aspx"&gt;Wes&#xD;
Haggard’s Find-String script&lt;/a&gt;. It had the additional benefit that it also displayed&#xD;
the line number, but it didn’t display the relative path.&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: ps1;"&gt;find-string.ps1 StringBuilder *.cs -recurse&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_6.png"&gt;&#xD;
            &lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_thumb_2.png" width="663" height="82"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Wes’ script still served my purposes, though, so I used it for a long time until I&#xD;
learned about grep’s Context Line Control arguments. They would let grep print out&#xD;
additional lines before or after the display search result so that you could see the&#xD;
context of your search result. Like so:&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: bash;"&gt;find –name *.cs | xargs grep StringBuilder –A 3&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_12.png"&gt;&#xD;
            &lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_thumb_5.png" width="700" height="159"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Unfortunately for me, PowerShell’s Select-String didn’t support context… at least&#xD;
until version 2.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
With the addition of the Context parameter, I could now build a nice grep replacement&#xD;
in PowerShell. I broke my version out into two separate scripts: one to actually format&#xD;
the MatchInfo object and one to do the finding. As you might imagine, the formatting&#xD;
script is a little more interesting. You can get Out-ColorMatchInfo at &lt;a title="http://poshcode.org/1095" href="http://poshcode.org/1095"&gt;http://poshcode.org/1095&lt;/a&gt; and&#xD;
you can get my version of Find-String at &lt;a title="http://poshcode.org/1096" href="http://poshcode.org/1096"&gt;http://poshcode.org/1096&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Here’s sample output:&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: ps1;"&gt;find-string StringBuilder *.cs –context 0,3&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_14.png"&gt;&#xD;
            &lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/Findingstuffquicklyorsearchingthroughcod_BD54/image_thumb_6.png" width="650" height="183"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt; &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I went with only displaying the relative path to the file on one line and then displaying&#xD;
the results on the following lines. It makes reading context easier for me.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Let me know what you think.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=83ba3e37-c3e9-402c-9a13-7cfcb306c007"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DavidMohundro?a=SZL7CnO72aM:VHCO80XGmJY:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DavidMohundro?i=SZL7CnO72aM:VHCO80XGmJY:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/SZL7CnO72aM" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,83ba3e37-c3e9-402c-9a13-7cfcb306c007.aspx</comments>
      <category>PowerShell</category>
      <category>Utilities</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/05/12/FindingStuffQuicklyOrSearchingThroughCodeEffectively.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=2ff35723-b8aa-4d51-b050-6c1508a65a8b</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,2ff35723-b8aa-4d51-b050-6c1508a65a8b.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,2ff35723-b8aa-4d51-b050-6c1508a65a8b.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=2ff35723-b8aa-4d51-b050-6c1508a65a8b</wfw:commentRss>
      
      <title>NWA Code Camp 2009 is tomorrow</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,2ff35723-b8aa-4d51-b050-6c1508a65a8b.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/tNbOhuoQF8M/NWACodeCamp2009IsTomorrow.aspx</link>
      <pubDate>Fri, 24 Apr 2009 12:28:37 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
If you’ll be in the northwest Arkansas area tomorrow (April 25), be sure to come out&#xD;
for the &lt;a href="http://codecamp.nwadnug.org/"&gt;NWA Code Camp&lt;/a&gt;. There will be presentations&#xD;
on everything ranging from LINQ and Silverlight to iPhone development. I’ll be presenting&#xD;
my PowerShell talk one more time as well. If I can count at all, it looks like there&#xD;
will be 15 different speakers total.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I’m looking forward to it!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://codecamp.nwadnug.org/"&gt;&#xD;
            &lt;img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/NWACodeCamp2009istomorrow_691F/image_9.png" width="244" height="75"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt; &#xD;
&lt;/p&gt;&#xD;
        &lt;div style="padding-bottom: 0px; margin: 0px; padding-left: 0px; padding-right: 0px; display: inline; float: none; padding-top: 0px" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:a3e83366-c886-4d06-a6c6-6eaa8f87f3a4" class="wlWriterEditableSmartContent"&gt;Technorati&#xD;
Tags: &lt;a href="http://technorati.com/tags/CodeCamp" rel="tag"&gt;CodeCamp&lt;/a&gt;&lt;/div&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=2ff35723-b8aa-4d51-b050-6c1508a65a8b"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DavidMohundro?a=tNbOhuoQF8M:Xn57YzKxIjM:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DavidMohundro?i=tNbOhuoQF8M:Xn57YzKxIjM:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/tNbOhuoQF8M" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,2ff35723-b8aa-4d51-b050-6c1508a65a8b.aspx</comments>
      <category>Conferences</category>
      <category>Speaking</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/04/24/NWACodeCamp2009IsTomorrow.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=87272438-95ca-4a44-a411-59c1e98b7c6d</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,87272438-95ca-4a44-a411-59c1e98b7c6d.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,87272438-95ca-4a44-a411-59c1e98b7c6d.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=87272438-95ca-4a44-a411-59c1e98b7c6d</wfw:commentRss>
      
      <title>Quickly Extract Files with PowerShell</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,87272438-95ca-4a44-a411-59c1e98b7c6d.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/Q5S1qV1IREs/QuicklyExtractFilesWithPowerShell.aspx</link>
      <pubDate>Tue, 31 Mar 2009 02:55:29 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
This is just a quick post to share a &lt;em&gt;very&lt;/em&gt; simple PowerShell script I wrote&#xD;
to extract files from a compressed file (zip, 7z, whatever). When downloading utilities&#xD;
that don’t have installers, like Sysinternals tools, I typically extract them to a&#xD;
Utils directory that is in my PATH. Previously, I would always do this by right-clicking,&#xD;
choosing the 7-Zip context menu option and then extracting to to c:\Utils. Another&#xD;
common option would be to extract to a folder of the same name.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/QuicklyExtractFileswithPowerShell_13450/image_2.png"&gt;&#xD;
            &lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/QuicklyExtractFileswithPowerShell_13450/image_thumb.png" width="561" height="484"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I had tried in the past to use the 7-Zip command line tool, but the arguments were&#xD;
not very intuitive or consistent with other command line tools (Windows, Unix, PowerShell&#xD;
or otherwise). So, I got fed up and wrote a script to do it for me. It just shells&#xD;
out to the 7-Zip command line app, but it saves me some time.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The script assumes that you’ve aliased ‘zip’ to the 7z.exe command line executable.&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: plain;"&gt;[1] » ls alias:zip&#xD;
&#xD;
CommandType     Name                                                  Definition&#xD;
-----------     ----                                                  ----------&#xD;
Alias           zip                                                   7z&#xD;
&#xD;
[2] » get-command 7z&#xD;
&#xD;
CommandType     Name                                                  Definition&#xD;
-----------     ----                                                  ----------&#xD;
Application     7z.exe                                                C:\Utils\7z.exe&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
Here’s the script:&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: ps1;"&gt;param (&#xD;
    [string]$file,&#xD;
    [string]$outputDir = ''&#xD;
)&#xD;
&#xD;
if (-not (Test-Path $file)) {&#xD;
    $file = Resolve-Path $file&#xD;
}&#xD;
&#xD;
if ($outputDir -eq '') {&#xD;
    $outputDir = [System.IO.Path]::GetFileNameWithoutExtension($file)&#xD;
}&#xD;
&#xD;
zip e "-o$outputDir" $file&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
Like I said, pretty basic. If you don’t specify an output directory, it uses the name&#xD;
of the file.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Other people have written scripts that do this, too, but I needed an excuse to publish&#xD;
something on my blog for March :-)&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=87272438-95ca-4a44-a411-59c1e98b7c6d"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~ff/DavidMohundro?a=Q5S1qV1IREs:fA5tcxZLTDg:F7zBnMyn0Lo"&gt;&lt;img src="http://feeds.feedburner.com/~ff/DavidMohundro?i=Q5S1qV1IREs:fA5tcxZLTDg:F7zBnMyn0Lo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/Q5S1qV1IREs" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,87272438-95ca-4a44-a411-59c1e98b7c6d.aspx</comments>
      <category>PowerShell</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/03/31/QuicklyExtractFilesWithPowerShell.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=1cfa3c38-e590-4736-b46d-e5ec02babc66</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,1cfa3c38-e590-4736-b46d-e5ec02babc66.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,1cfa3c38-e590-4736-b46d-e5ec02babc66.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=1cfa3c38-e590-4736-b46d-e5ec02babc66</wfw:commentRss>
      
      <title>An Essential Tip for Working with Windows Forms</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,1cfa3c38-e590-4736-b46d-e5ec02babc66.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/1rwGWSIPohU/AnEssentialTipForWorkingWithWindowsForms.aspx</link>
      <pubDate>Wed, 25 Feb 2009 16:32:12 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
I couldn’t resist borrowing my title from &lt;a href="http://devlicious.com/blogs/christopher_bennage/default.aspx"&gt;Christopher&#xD;
Bennage’s&lt;/a&gt; post entitled &lt;a href="http://devlicious.com/blogs/christopher_bennage/archive/2009/02/04/an-essential-tip-for-working-with-xaml.aspx"&gt;“An&#xD;
Essential Tip for Working with XAML.”&lt;/a&gt; My “essential tip” is identical to what&#xD;
he has already shown for WPF (and &lt;a href="http://weblogs.asp.net/fmarguerie/archive/2009/01/29/life-changer-xaml-tip-for-visual-studio.aspx"&gt;Fabrice&#xD;
originally&lt;/a&gt;) – it just applies to Windows Forms instead of WPF :-)&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I’ll mix it up some and show with pictures instead of text, though.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Step 1. Right click on a Form, UserControl, or Component and select “Open With…”&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/AnEssentialTipforWorkingwithWindowsForms_9428/image_2.png"&gt;&#xD;
            &lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="245" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/AnEssentialTipforWorkingwithWindowsForms_9428/image_thumb.png" width="273" border="0"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Step 2. Select “CSharp Editor” and click “Set as Default” - (note that this setting&#xD;
only applies to C# code, though you can perform the identical setup for VB.NET as&#xD;
well)&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/AnEssentialTipforWorkingwithWindowsForms_9428/image_4.png"&gt;&#xD;
            &lt;img title="image" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="329" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/AnEssentialTipforWorkingwithWindowsForms_9428/image_thumb_1.png" width="490" border="0"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Step 3. Enjoy your delicious, hot meal of faster Visual Studio!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
In case you missed it, the real benefit that you get from this setting is that double&#xD;
clicking a file in the Solution Explorer will now go directly to the code instead&#xD;
of defaulting to the designer view. If you want to get to the designer view, just&#xD;
right click and select “View Designer.”&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Thanks again to Christopher and Fabrice who did the real work here!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=1cfa3c38-e590-4736-b46d-e5ec02babc66"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/DavidMohundro?a=yOc5At2h"&gt;&lt;img src="http://feeds.feedburner.com/~f/DavidMohundro?i=yOc5At2h" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/1rwGWSIPohU" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,1cfa3c38-e590-4736-b46d-e5ec02babc66.aspx</comments>
      <category>.NET</category>
      <category>General</category>
      <category>Visual Studio</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/02/25/AnEssentialTipForWorkingWithWindowsForms.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=3a062223-e79a-40b8-a23a-e31a7734b92e</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,3a062223-e79a-40b8-a23a-e31a7734b92e.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,3a062223-e79a-40b8-a23a-e31a7734b92e.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=3a062223-e79a-40b8-a23a-e31a7734b92e</wfw:commentRss>
      <slash:comments>1</slash:comments>
      
      <title>Getting started with WiX and Major Upgrades!</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,3a062223-e79a-40b8-a23a-e31a7734b92e.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/n_yBqYaCEwY/GettingStartedWithWiXAndMajorUpgrades.aspx</link>
      <pubDate>Mon, 23 Feb 2009 19:38:15 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;WiX Setup&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I’ve been doing some work with MSIs lately, specifically using the &lt;a href="http://wix.sourceforge.net/"&gt;WiX&#xD;
toolkit&lt;/a&gt;, so I thought I’d share a short primer on using WiX to build your own&#xD;
MSIs, and also to share some links and some tricks to avoid some pitfalls that I ran&#xD;
into.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
First off, WiX stands for Windows Installer XML and, from what I understand, &lt;a href="http://blogs.msdn.com/robmen/archive/2004/04/05/107709.aspx"&gt;is&#xD;
the first Microsoft-supported open source project&lt;/a&gt;. Not only that, but it is the&#xD;
way that Microsoft builds their MSIs, too, so it is pretty significant.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
To get started, I wouldn’t even bother with the release version of 2.0. The real fun&#xD;
is in &lt;a href="http://wix.sourceforge.net/downloadv3.html"&gt;version 3.0&lt;/a&gt;, which,&#xD;
even though it is in beta, is plenty stable (IMHO) and supports Visual Studio with&#xD;
a project template and intellisense support via schema files. It also makes the building&#xD;
step a lot easier.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/GettingstartedwithWiXandMajorUpgrades_BFD6/image_2.png"&gt;&#xD;
            &lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/GettingstartedwithWiXandMajorUpgrades_BFD6/image_thumb.png" width="644" height="397"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;My First WiX Project&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Once you start your project, you’re presented with a WXS file pre-filled with a few&#xD;
initial options that looks like this:&#xD;
&lt;/p&gt;&#xD;
        &lt;p style="font-size: 1.2em;"&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;pre class="brush: xml;"&gt;&amp;lt;?xml version="1.0" encoding="UTF-8"?&amp;gt;&#xD;
&amp;lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&amp;gt;&#xD;
    &amp;lt;Product Id="de9157d6-2fbf-4c16-9d28-77f790788b28" Name="WixProject1" Language="1033" Version="1.0.0.0" Manufacturer="WixProject1" UpgradeCode="f5614cd8-aa70-4bc4-948b-208b34e16a6d"&amp;gt;&#xD;
        &amp;lt;Package InstallerVersion="200" Compressed="yes" /&amp;gt;&#xD;
&#xD;
        &amp;lt;Media Id="1" Cabinet="media1.cab" EmbedCab="yes" /&amp;gt;&#xD;
&#xD;
        &amp;lt;Directory Id="TARGETDIR" Name="SourceDir"&amp;gt;&#xD;
            &amp;lt;Directory Id="ProgramFilesFolder"&amp;gt;&#xD;
                &amp;lt;Directory Id="INSTALLLOCATION" Name="WixProject1"&amp;gt;&#xD;
                    &amp;lt;!-- TODO: Remove the comments around this Component element and the ComponentRef below in order to add resources to this installer. --&amp;gt;&#xD;
                    &amp;lt;!-- &amp;lt;Component Id="ProductComponent" Guid="95758d74-281c-4eee-84ce-4fda6ad60557"&amp;gt; --&amp;gt;&#xD;
                        &amp;lt;!-- TODO: Insert files, registry keys, and other resources here. --&amp;gt;&#xD;
                    &amp;lt;!-- &amp;lt;/Component&amp;gt; --&amp;gt;&#xD;
                &amp;lt;/Directory&amp;gt;&#xD;
            &amp;lt;/Directory&amp;gt;&#xD;
        &amp;lt;/Directory&amp;gt;&#xD;
&#xD;
        &amp;lt;Feature Id="ProductFeature" Title="WixProject1" Level="1"&amp;gt;&#xD;
            &amp;lt;!-- TODO: Remove the comments around this ComponentRef element and the Component above in order to add resources to this installer. --&amp;gt;&#xD;
            &amp;lt;!-- &amp;lt;ComponentRef Id="ProductComponent" /&amp;gt; --&amp;gt;&#xD;
        &amp;lt;/Feature&amp;gt;&#xD;
    &amp;lt;/Product&amp;gt;&#xD;
&amp;lt;/Wix&amp;gt;&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
It has most of the things that you’ll be interested in. &#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The Product element is likely the most important element as it defines the application&#xD;
that your MSI will install. You’ll notice that WiX is built around a lot of Guids.&#xD;
MSIs, or Windows Installer actually, is built around tables. Using the &lt;a href="http://msdn.microsoft.com/en-us/library/aa370557.aspx"&gt;orca&#xD;
tool that ships with the Windows SDK&lt;/a&gt;, you can actually see these tables for any&#xD;
MSI. (FYI, you’ll find your Product Id Guid if you look under &lt;a href="file://\\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"&gt;\\HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\&lt;/a&gt; after&#xD;
installation.)&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;a href="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/GettingstartedwithWiXandMajorUpgrades_BFD6/image_4.png"&gt;&#xD;
            &lt;img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.mohundro.com/blog/content/binary/WindowsLiveWriter/GettingstartedwithWiXandMajorUpgrades_BFD6/image_thumb_1.png" width="644" height="448"&gt;&lt;/img&gt;&#xD;
          &lt;/a&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;You Can Refactor WiX, Too&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Before going further with your WiX file, I would strongly recommend refactoring some&#xD;
of the Guids and common strings out into variables like so:&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: xml;"&gt;&amp;lt;Wix xmlns="http://schemas.microsoft.com/wix/2006/wi"&amp;gt;&#xD;
  &amp;lt;?define ProductName = "WixProject1"?&amp;gt;&#xD;
  &amp;lt;?define ProductCode = "de9157d6-2fbf-4c16-9d28-77f790788b28"?&amp;gt;&#xD;
  &amp;lt;?define UpgradeCode = "f5614cd8-aa70-4bc4-948b-208b34e16a6d"?&amp;gt;&#xD;
  &amp;lt;?define ProductVersion = "1.0.0.0"?&amp;gt;&#xD;
  &#xD;
  &amp;lt;Product Id="$(var.ProductCode)"&#xD;
           Name="$(var.ProductName)"&#xD;
           Language="1033"&#xD;
           Version="$(var.ProductVersion)"&#xD;
           Manufacturer="WixProject1"&#xD;
           UpgradeCode="$(var.UpgradeCode)"&amp;gt;&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
Doing this can help you greatly later when you’re trying to figure out which Guid&#xD;
goes where or what the Guid is actually for. The rest of the process of building your&#xD;
WiX file involves mapping out your dependencies. The project template by default already&#xD;
creates Directory elements pointing to the ProgramFilesFolder constant (see &lt;a title="http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx#system_folder_properties" href="http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx#system_folder_properties"&gt;http://msdn.microsoft.com/en-us/library/aa370905(VS.85).aspx#system_folder_properties&lt;/a&gt; for&#xD;
the other system folder constants). The Component tag resolves to what I think of&#xD;
as a separate installable component. Components go together to form a Feature (think&#xD;
Complete versus Custom installs) so you’ll refer to your Component (by Id) in the&#xD;
Feature element using a ComponentRef element. The template has this commented out,&#xD;
but it shows how this would work. I’ll defer to the &lt;a href="http://www.tramontana.co.hu/wix/"&gt;WiX&#xD;
Tutorial&lt;/a&gt; for specific examples here.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
To build your MSI, you just have to do a Visual Studio build because you followed&#xD;
my instructions and installed beta 3.0, which comes with Visual Studio integration!&#xD;
Behind the scenes, though, all the build does is call out to candle.exe passing in&#xD;
your WXS file which results in a wixobj file. Then it calls out to light.exe passing&#xD;
in the wixobj file which results in an MSI. (WiX is pronounced like “wicks” – that&#xD;
should help you get the candle and light jokes… WiX also includes tools like dark,&#xD;
torch, votive, smoke, melt… :-))&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Upgrading!&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Up to this point, I didn’t really run into any problems with building my MSI. The&#xD;
online resources were fairly good at getting me started. What I wanted was for my&#xD;
MSI to be able to remove existing versions of my software before installing its version. &lt;a href="http://msdn.microsoft.com/en-us/library/aa370579(VS.85).aspx"&gt;MSIs&#xD;
support three types of upgrades&lt;/a&gt;: small update, minor upgrade, and major upgrades.&#xD;
I’d recommend skipping directly to major upgrade. From what I’ve seen so far, the&#xD;
other two options require additional command line arguments to msiexec to actually&#xD;
perform the removal of a prior install of your product.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
To get a major upgrade to work, the most important thing you’ll need is your UpgradeCode.&#xD;
This is an attribute off of your Product element tag. Always store that off, regardless&#xD;
of whether or not you plan on allowing upgrades. As soon as you decide you don’t need&#xD;
to upgrade, you’ll want to upgrade. If you don’t have an UpgradeCode, you can’t upgrade.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
You’ll use your UpgradeCode in an Upgrade tag like so:&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: xml;"&gt;&amp;lt;Upgrade Id='$(var.UpgradeCode)'&amp;gt;&#xD;
  &amp;lt;UpgradeVersion Minimum='$(var.ProductVersion)'&#xD;
                  IncludeMinimum='no'&#xD;
                  OnlyDetect='yes'&#xD;
                  Property='NEWPRODUCTFOUND' /&amp;gt;&#xD;
  &amp;lt;UpgradeVersion Minimum='$(var.RTMProductVersion)'&#xD;
                  IncludeMinimum='yes'&#xD;
                  Maximum='$(var.ProductVersion)'&#xD;
                  IncludeMaximum='no'&#xD;
                  Property='UPGRADEFOUND' /&amp;gt;&#xD;
&amp;lt;/Upgrade&amp;gt;&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
Notice how I’m using my predefined variables. Makes it easier, eh? I’ve also added&#xD;
an additional variable defined as RTMProductVersion. This is the version of my installed&#xD;
application that I am upgrading from. UpgradeVersion tags work like ranges. So, for&#xD;
the UPGRADEFOUND to match, the installed application has to match inclusive RTMProductVersion&#xD;
(inclusive because of IncludeMinimum=’yes’) up to exclusive ProductVersion, which&#xD;
is the new version we’re about to install.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Now, changing the version isn’t enough for a major upgrade to work. You also need&#xD;
to change your ProductCode. This is what I continued to miss and why I was getting&#xD;
so frustrated with WiX. Now that I know what it should do (and what to search for),&#xD;
I’m finding plenty of WiX articles on how to do major upgrades! The reasoning for&#xD;
this is because major upgrades only work between two completely different products&#xD;
(think of Visual Studio 2005 and Visual Studio 2008 as having two different ProductCodes).&#xD;
These two products can run &lt;em&gt;side-by-side&lt;/em&gt;, hence the different Guids for their&#xD;
product code. These applications allow side-by-side execution so they’re not specifying&#xD;
the removal of the old software, but they certainly could. &lt;a href="http://msdn.microsoft.com/en-us/library/aa370837(VS.85).aspx"&gt;MSDN&#xD;
has a good article on everything that you’ll need to check before getting an MSI ready&#xD;
for a major upgrade&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Once you have a new version and a new product code, you’ll need to actually tell the&#xD;
MSI to remove the existing version. To do this, you’ll add a RemoveExistingProducts&#xD;
element to an InstallExecuteSequence. Like this:&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: xml;"&gt;&amp;lt;InstallExecuteSequence&amp;gt;&#xD;
  &amp;lt;Custom Action='PreventDowngrading'&#xD;
          After='FindRelatedProducts'&amp;gt;NEWPRODUCTFOUND&amp;lt;/Custom&amp;gt;&#xD;
  &amp;lt;RemoveExistingProducts After='InstallFinalize' /&amp;gt;&#xD;
&amp;lt;/InstallExecuteSequence&amp;gt;&#xD;
&#xD;
&amp;lt;InstallUISequence&amp;gt;&#xD;
  &amp;lt;Custom Action='PreventDowngrading'&#xD;
          After='FindRelatedProducts'&amp;gt;NEWPRODUCTFOUND&amp;lt;/Custom&amp;gt;&#xD;
&amp;lt;/InstallUISequence&amp;gt;&#xD;
&#xD;
&amp;lt;CustomAction Id='PreventDowngrading'&#xD;
              Error='Newer version already installed' /&amp;gt;&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
In my example, I’ve told RemoveExistingProducts to run after the ‘InstallFinalize’&#xD;
action, but &lt;a href="http://msdn.microsoft.com/en-us/library/aa371197(VS.85).aspx"&gt;this&#xD;
is customizable and can have an impact on the efficiency of your installer&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Once I set my WiX project up like this, it worked like a charm.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
There are two resources that are &lt;em&gt;essential&lt;/em&gt; for getting up to speed with WiX&#xD;
that I’d like to share. One is the &lt;a href="http://www.tramontana.co.hu/wix/"&gt;WiX&#xD;
Tutorial&lt;/a&gt;. I’m probably using about a 10th of the content posted there. Second&#xD;
is &lt;a href="http://blogs.technet.com/alexshev/pages/from-msi-to-wix.aspx"&gt;Alex Shevchuk’s&#xD;
“From MSI to WiX” articles&lt;/a&gt;, particularly &lt;a href="http://blogs.technet.com/alexshev/archive/2008/02/15/from-msi-to-wix-part-8-major-upgrade.aspx"&gt;his&#xD;
post on major upgrades&lt;/a&gt;, which was invaluable to me.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=3a062223-e79a-40b8-a23a-e31a7734b92e"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/DavidMohundro?a=KplvY4ae"&gt;&lt;img src="http://feeds.feedburner.com/~f/DavidMohundro?i=KplvY4ae" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/n_yBqYaCEwY" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,3a062223-e79a-40b8-a23a-e31a7734b92e.aspx</comments>
      <category>General</category>
      <category>Programming</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/02/23/GettingStartedWithWiXAndMajorUpgrades.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=d6e53de0-4c86-4d18-b0b2-5bd063d2a173</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,d6e53de0-4c86-4d18-b0b2-5bd063d2a173.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,d6e53de0-4c86-4d18-b0b2-5bd063d2a173.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=d6e53de0-4c86-4d18-b0b2-5bd063d2a173</wfw:commentRss>
      <slash:comments>3</slash:comments>
      
      <title>Finding the right exception to throw</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,d6e53de0-4c86-4d18-b0b2-5bd063d2a173.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/E_MS851Z7Ko/FindingTheRightExceptionToThrow.aspx</link>
      <pubDate>Mon, 26 Jan 2009 13:47:21 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
If you’ve been writing .NET applications for a while, you’re likely aware that &lt;a href="http://msdn.microsoft.com/en-us/library/ms229021.aspx"&gt;you’re&#xD;
not supposed to just throw Exception&lt;/a&gt;. Instead, if you’re dealing with a null argument,&#xD;
you should be throwing an ArgumentNullException instead. FxCop warns against cases&#xD;
like this.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
My problem isn’t knowing to not throw Exception. My problem is finding the appropriate&#xD;
exception to throw.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
Just about every time I need to throw an exception in code, I type something like&#xD;
throw new… then wait for intellisense, and then inevitably try to type something like&#xD;
*Exception. Which fails of course. Then I do a google search for common exception&#xD;
types and will come across a post like &lt;a href="http://blogs.msdn.com/brada/archive/2005/03/27/402801.aspx"&gt;Brad&#xD;
Abram’s Common Exception Types&lt;/a&gt;. Which is somewhat useful, except that his list&#xD;
only contains Exception names including Exceptions like the &lt;a href="http://msdn.microsoft.com/en-us/library/system.invalidprogramexception.aspx"&gt;InvalidProgramException&lt;/a&gt;,&#xD;
which has a description of “the exception that is thrown when a program contains invalid&#xD;
MSIL.” Most likely not what I need :-) &lt;a href="http://www.codinghorror.com/blog/archives/000115.html"&gt;Jeff&#xD;
Atwood has an older post about a console application he wrote to write out Exception&#xD;
types from assemblies&lt;/a&gt;, but once again, it doesn’t provide the description I needed&#xD;
to help make my decision, too.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
So, I decided to solve this problem myself.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I liked Jeff’s approach because it was lightweight and could be piped to programs&#xD;
like findstr so that I could look for certain types of exceptions. I essentially wanted&#xD;
what he had, but I wanted summary information as well. I ended up solving the problem&#xD;
with PowerShell. First, check out the output:&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: plain;"&gt;[3] » Get-Exception Null | Format-List&#xD;
&#xD;
Name    : System.ArgumentNullException&#xD;
Summary : The exception that is thrown when a null reference (Nothing in Visual Basic) is passed to a method that does not&#xD;
          accept it as a valid argument.&#xD;
&#xD;
Name    : System.NullReferenceException&#xD;
Summary : The exception that is thrown when there is an attempt to dereference a null object reference.&#xD;
&#xD;
Name    : System.Management.Automation.PSArgumentNullException&#xD;
Summary : No summary found.&#xD;
&#xD;
Name    : System.Data.NoNullAllowedException&#xD;
Summary : No summary found.&#xD;
&#xD;
Name    : System.Data.SqlTypes.SqlNullValueException&#xD;
Summary : No summary found.&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
As you can see, my script is called Get-Exception and it can handle searches. The&#xD;
results can be passed to the various formatting cmdlets like Format-List. You can&#xD;
also pipe the results to Select-String for further searching if you wish or just pipe&#xD;
it to a Where statement.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The script itself is fairly simple. The pulling of exception types is based entirely&#xD;
off of the following statement:&#xD;
&lt;/p&gt;&#xD;
        &lt;pre class="brush: ps1;"&gt;$exceptions = [System.AppDomain]::CurrentDomain.GetAssemblies() | foreach {   &#xD;
    $_.GetTypes() | where { $_.FullName -match "System$filter.*Exception$" }  &#xD;
}&#xD;
&lt;/pre&gt;&#xD;
        &lt;p&gt;&#xD;
To pull the summary documentation, I’m using the returned type’s Assembly.Location&#xD;
property and checking for an XML file with the same name at the same location. This&#xD;
usually equates to an XML file in C:\windows\microsoft.net\framework\v2.0.50727. Then&#xD;
I use an XPath expression against it.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I’ve posted the script out on the &lt;a href="http://poshcode.org/"&gt;PowerShell Code Repository&lt;/a&gt; at &lt;a title="http://poshcode.org/827" href="http://poshcode.org/827"&gt;http://poshcode.org/827&lt;/a&gt; if&#xD;
you’re interested in downloading it and trying it out. There are a lot of other great&#xD;
scripts there as well.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=d6e53de0-4c86-4d18-b0b2-5bd063d2a173"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/DavidMohundro?a=0zZfevmo"&gt;&lt;img src="http://feeds.feedburner.com/~f/DavidMohundro?i=0zZfevmo" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/E_MS851Z7Ko" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,d6e53de0-4c86-4d18-b0b2-5bd063d2a173.aspx</comments>
      <category>PowerShell</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/01/26/FindingTheRightExceptionToThrow.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=426906e2-a26e-4424-b8b0-38a09187e4f6</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,426906e2-a26e-4424-b8b0-38a09187e4f6.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,426906e2-a26e-4424-b8b0-38a09187e4f6.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=426906e2-a26e-4424-b8b0-38a09187e4f6</wfw:commentRss>
      
      <title>SQL Server 2008 Launch Event&amp;hellip; Locally!</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,426906e2-a26e-4424-b8b0-38a09187e4f6.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/GTrC0hiV8uU/SQLServer2008LaunchEventhellipLocally.aspx</link>
      <pubDate>Tue, 13 Jan 2009 04:09:06 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
Tonight, the &lt;a href="http://www.fsdnug.org"&gt;FSDNUG&lt;/a&gt; group participated in their&#xD;
first launch event ever – for SQL Server 2008! Woo!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The gist of it was that 4 of us took about 15 to 20 minutes to talk about different&#xD;
portions of SQL Server. It turned out to be more intro than deep dives, but I think&#xD;
the group got more out of the presentation this way.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
My portion of the presentation was on &lt;a href="http://msdn.microsoft.com/en-us/library/ms131089.aspx"&gt;SQL&#xD;
CLR&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I think my talk went alright, but my demo definitely didn’t work. I blamed the Windows&#xD;
7 beta but it probably had more to do with my lack of knowledge. *shrug* If you’re&#xD;
interested in trying the example out for yourself, &lt;a href="http://dotnetslackers.com/Community/blogs/basharkokash/archive/2008/06/04/sql-clr-overview.aspx"&gt;Bashar&#xD;
Kokash has a good post on it&lt;/a&gt;. The example worked fine on my machine without any&#xD;
problems the first time, but during the talk, the Visual Studio deployment apparently&#xD;
didn’t work. Oh well.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The other code examples that I had all are linked off of &lt;a href="http://msdn.microsoft.com/en-us/library/ms131089.aspx"&gt;the&#xD;
MSDN overview of SQL CLR link&lt;/a&gt; from above, so knock yourself out. &lt;a href="http://www.keithelder.net/blog/archive/2007/10/29/Creating-Custom-SQL-CLR-UserDefined-Types.aspx"&gt;Keith&#xD;
Elder’s post on creating custom SQL CLR user-defined types&lt;/a&gt; is also a good start.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
The final two links I used were &lt;a href="http://www.sqlskills.com/resources/Whitepapers/SQL%20Server%20DBA%20Guide%20to%20SQLCLR.htm"&gt;this&#xD;
one from SQL Skills&lt;/a&gt; and &lt;a href="http://www.google.com/search?hl=en&amp;amp;q=sqlclr"&gt;this&#xD;
one… that provided most of my information&lt;/a&gt; :-) Thanks Google!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I enjoyed the chance to present again! If you have any feedback, feel free to let&#xD;
me know.&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=426906e2-a26e-4424-b8b0-38a09187e4f6"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/DavidMohundro?a=d7p3ZLxb"&gt;&lt;img src="http://feeds.feedburner.com/~f/DavidMohundro?i=d7p3ZLxb" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/GTrC0hiV8uU" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,426906e2-a26e-4424-b8b0-38a09187e4f6.aspx</comments>
      <category>.NET User Group</category>
      <category>Speaking</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/01/13/SQLServer2008LaunchEventhellipLocally.aspx</feedburner:origLink></item>
    <item>
      <trackback:ping>http://www.mohundro.com/blog/Trackback.aspx?guid=58b84948-4d3c-4e9e-bd3f-4a424165ac14</trackback:ping>
      <pingback:server>http://www.mohundro.com/blog/pingback.aspx</pingback:server>
      <pingback:target>http://www.mohundro.com/blog/PermaLink,guid,58b84948-4d3c-4e9e-bd3f-4a424165ac14.aspx</pingback:target>
      <dc:creator>David Mohundro</dc:creator>
      <wfw:comment>http://www.mohundro.com/blog/CommentView,guid,58b84948-4d3c-4e9e-bd3f-4a424165ac14.aspx</wfw:comment>
      <wfw:commentRss>http://www.mohundro.com/blog/SyndicationService.asmx/GetEntryCommentsRss?guid=58b84948-4d3c-4e9e-bd3f-4a424165ac14</wfw:commentRss>
      <slash:comments>1</slash:comments>
      
      <title>I&amp;rsquo;m thankful that my computer will type &amp;lsquo;2009&amp;rsquo; for me</title>
      <guid isPermaLink="false">http://www.mohundro.com/blog/PermaLink,guid,58b84948-4d3c-4e9e-bd3f-4a424165ac14.aspx</guid>
      <link>http://feedproxy.google.com/~r/DavidMohundro/~3/HrijikeC8Ss/IrsquomThankfulThatMyComputerWillTypeLsquo2009rsquoForMe.aspx</link>
      <pubDate>Thu, 01 Jan 2009 20:13:41 GMT</pubDate>
      <description>&lt;body xmlns="http://www.w3.org/1999/xhtml"&gt;&#xD;
        &lt;p&gt;&#xD;
So, a year ago to the day, I posted &lt;a href="http://www.mohundro.com/blog/2008/01/01/Welcome20082007InReview.aspx"&gt;my&#xD;
review of 2007 with a look towards 2008&lt;/a&gt;. To continue that age old tradition, I&#xD;
will now review 2008.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Learning&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I started off the month by stating that &lt;a href="http://www.mohundro.com/blog/2008/01/30/LearningTechnologiesOutsideAndInsideOfTheMicrosoftEcosystem.aspx"&gt;I&#xD;
wanted to learn some new languages, primarily Python and Ruby&lt;/a&gt;. I’m sad to say&#xD;
that I haven’t made it past the 5th python challenge yet. I pretty much got distracted,&#xD;
which is a lame excuse. On the other hand, instead of learning languages, I’ve learned&#xD;
a ton about editing in VIM and even a little about Emacs (though I have to use viper&#xD;
or vimpulse to be at all productive in Emacs). I’m even using ViEmu in Visual Studio.&#xD;
The Vim key-bindings have become muscle memory now and I consider that a positive&#xD;
thing. I’m still going to try to learn other languages this year, but I’m going to&#xD;
need a project to work on before I can become proficient.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;FSDNUG&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
This year, a very exciting thing for me was the formation of &lt;a href="http://www.fsdnug.org"&gt;FSDNUG&lt;/a&gt;. &lt;a href="http://www.mpaladino.com/"&gt;Michael&#xD;
Paladino&lt;/a&gt; pretty much did all of the work, but he lets me call myself a co-leader. &lt;a href="http://www.mohundro.com/blog/2008/03/04/FSDNUGMeetingWithRaymondLewallenOnBehaviorDrivenDesign.aspx"&gt;Raymond&#xD;
Lewallen opened up the FSDNUG meetings by speaking about Behavior Driven Development&lt;/a&gt;.&#xD;
I didn’t really grok BDD at that point, but I’m learning. I most definitely prefer&#xD;
the context/specification style of naming specs over traditional TDD test names.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Conferences&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I was fortunate enough to attend both &lt;a href="http://www.mohundro.com/blog/2008/07/02/TechEdNdashDay1Review.aspx"&gt;Tech&#xD;
Ed&lt;/a&gt; and &lt;a href="http://www.mohundro.com/blog/2008/08/27/devLink2008Recap.aspx"&gt;DevLink&lt;/a&gt; this&#xD;
year. I even told people at DevLink that I’d be attending &lt;a href="http://codemash.org/"&gt;CodeMash&lt;/a&gt;,&#xD;
but I sadly won’t be able to make it after all. I have no doubts that it will be an&#xD;
amazing conference, though, and wish I could be there.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Presentations&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I presented on PowerShell three times in 2008. &lt;a href="http://www.mohundro.com/blog/2008/09/09/PowerShellFSDNUGPresentationWithSlidesAndNotes.aspx"&gt;Once&#xD;
to FSDNUG&lt;/a&gt;, &lt;a href="http://www.mohundro.com/blog/2008/09/30/SlidesAndNotesFromMNUGTalk.aspx"&gt;once&#xD;
to MNUG&lt;/a&gt; and then once to Harding University CS students. My presentations pretty&#xD;
much took up &lt;a href="http://www.mohundro.com/blog/default,month,2008-09.aspx"&gt;all&#xD;
of September&lt;/a&gt;. It was a great experience and I’m looking forward to speaking to&#xD;
the Shreveport .NET User Group in March!&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;Posts&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
My post on &lt;a href="http://www.mohundro.com/blog/2008/05/23/RealWorldWalkthroughWithWinDbg.aspx"&gt;“real&#xD;
world debugging witn WinDbg” post&lt;/a&gt; was featured on the &lt;a href="http://msdn.microsoft.com/en-us/events/teched/cc531163.aspx"&gt;Tech&#xD;
Ed bloggers site&lt;/a&gt;, which led to me being selected as a “featured Tech Ed blogger”&#xD;
for a day. I was also excited to have my &lt;a href="http://www.mohundro.com/blog/2008/10/11/SimplePowerShellScriptToGenerateThumbnails.aspx"&gt;PowerShell&#xD;
thumbnail script&lt;/a&gt;&lt;a href="http://feeds.feedburner.com/~r/Powerscripting/~3/455545211/index.php"&gt;mentioned&#xD;
on the PowerScripting Podcast&lt;/a&gt;.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
          &lt;strong&gt;In closing…&lt;/strong&gt;&#xD;
        &lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
All in all, a really great year. I noted in 2007, that it had been the year of the&#xD;
most growth for me as a developer. That was true… at least until 2008. My opinion&#xD;
right now is that there is no such thing as a good developer, only a better developer.&#xD;
This saying comes from a discussion I had with a coworker a few months back where&#xD;
we came to the conclusion that there isn’t such a thing as a good design or architecture,&#xD;
only a better design or architecture – all because we’ll inevitably have learned a&#xD;
better way to do things in the future.&#xD;
&lt;/p&gt;&#xD;
        &lt;p&gt;&#xD;
I hope everyone has a great 2009!&#xD;
&lt;/p&gt;&#xD;
        &lt;img width="0" height="0" src="http://www.mohundro.com/blog/aggbug.ashx?id=58b84948-4d3c-4e9e-bd3f-4a424165ac14"&gt;&lt;/img&gt;&#xD;
      &lt;/body&gt;&lt;div class="feedflare"&gt;
&lt;a href="http://feeds.feedburner.com/~f/DavidMohundro?a=fGcLGFuw"&gt;&lt;img src="http://feeds.feedburner.com/~f/DavidMohundro?i=fGcLGFuw" border="0"&gt;&lt;/img&gt;&lt;/a&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/DavidMohundro/~4/HrijikeC8Ss" height="1" width="1"/&gt;</description>
      <comments>http://www.mohundro.com/blog/CommentView,guid,58b84948-4d3c-4e9e-bd3f-4a424165ac14.aspx</comments>
      <category>General</category>
    <feedburner:origLink>http://www.mohundro.com/blog/2009/01/01/IrsquomThankfulThatMyComputerWillTypeLsquo2009rsquoForMe.aspx</feedburner:origLink></item>
  </channel>
</rss>
