<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Ramblings of the Sleepy...</title>
	<atom:link href="http://tiredblogger.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://tiredblogger.wordpress.com</link>
	<description>For an underpaid web architect and overplayed gamer... there is no such thing as sleep.</description>
	<lastBuildDate>Sat, 21 Jan 2012 04:42:49 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='tiredblogger.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Ramblings of the Sleepy...</title>
		<link>http://tiredblogger.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://tiredblogger.wordpress.com/osd.xml" title="Ramblings of the Sleepy..." />
	<atom:link rel='hub' href='http://tiredblogger.wordpress.com/?pushpress=hub'/>
		<item>
		<title>NuGet Package Restore, Multiple Repositories, and CI Servers</title>
		<link>http://tiredblogger.wordpress.com/2012/01/20/nuget-package-restore-multiple-repositories-and-ci-servers/</link>
		<comments>http://tiredblogger.wordpress.com/2012/01/20/nuget-package-restore-multiple-repositories-and-ci-servers/#comments</comments>
		<pubDate>Sat, 21 Jan 2012 04:41:36 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[nuget]]></category>
		<category><![CDATA[TeamCity]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[teamcity]]></category>
		<category><![CDATA[visualstudio]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/?p=1288</guid>
		<description><![CDATA[I really like NuGet&#8217;s new Package Restore feature (and so does our git repositories). We have several common libraries that we&#8217;ve moved into a private, local NuGet repository on our network. It&#8217;s really helped deal with the dependency and version nightmares between projects and developers. I checked my first project using full package restore and our new [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1288&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I really like NuGet&#8217;s new <a title="NuGet Package Restore" href="http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages" target="_blank">Package Restore feature</a> (and so does our git repositories).</p>
<p>We have several common libraries that we&#8217;ve moved into a private, local NuGet repository on our network. It&#8217;s really helped deal with the dependency and version nightmares between projects and developers.</p>
<p><a href="http://tiredblogger.files.wordpress.com/2012/01/work-5542900-1-sticker375x360.png"><img class="alignright  wp-image-1293" title="Boom!" src="http://tiredblogger.files.wordpress.com/2012/01/work-5542900-1-sticker375x360.png?w=180&#038;h=173" alt="Boom!" width="180" height="173" /></a>I checked my first project using full package restore and our new local repositories into our CI server, TeamCity, the other day and noticed that the Package Restore feature couldn&#8217;t find the packages stored in our local repository.</p>
<p>At first, I thought there was a snag (permissions, network, general unhappiness) with our NuGet share, but all seemed well. To my surprise, repository locations are not stored in that swanky .nuget directory, but as part of the <strong><span style="text-decoration:underline;">current user profile</span></strong>. <strong>%appdata%\NuGet\NuGet.Config</strong> to be precise.</p>
<p>Well, that&#8217;s nice on my workstation, but NETWORK SERVICE doesn&#8217;t have a profile and the All Users AppData directory didn&#8217;t seem to take effect.</p>
<h2>The solution:</h2>
<p>For TeamCity, at least, the solution was to set the TeamCity build agent services to run as a specific user (I chose a domain user in our network, you could use a local user as well). Once you have a profile, go into <strong>%drive%:\users\{your service name}\appdata\roaming\nuget</strong> and modify the <strong>nuget.config</strong> file.</p>
<p>Here&#8217;s an example of the file:</p>
<p><pre class="brush: xml;">
&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
&lt;configuration&gt;
  &lt;packageSources&gt;
    &lt;add key=&quot;NuGet official package source&quot; value=&quot;https://msft.long.url.here&quot; /&gt;
    &lt;add key=&quot;Student Achievement [local]&quot; value=&quot;\\server.domain.com\shared$\nuget&quot; /&gt;
  &lt;/packageSources&gt;
  &lt;activePackageSource&gt;
    &lt;add key=&quot;NuGet official package source&quot; value=&quot;https://msft.long.url.here&quot; /&gt;
  &lt;/activePackageSource&gt;
&lt;/configuration&gt;
</pre></p>
<p>Package Restore will attempt to find the packages on the &#8216;activePackageSource&#8217; first then proceed through the list.</p>
<p>Remember, if you have multiple build agent servers, this must be done on each server.</p>
<p><strong>Wish List: The option to include non-standard repositories as part of the .nuget folder. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </strong></p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/microsoft/'>Microsoft</a>, <a href='http://tiredblogger.wordpress.com/category/visual-studio-2010/nuget/'>nuget</a>, <a href='http://tiredblogger.wordpress.com/category/teamcity-2/'>TeamCity</a>, <a href='http://tiredblogger.wordpress.com/category/visual-studio-2010/'>Visual Studio 2010</a>, <a href='http://tiredblogger.wordpress.com/category/windows-server/'>Windows Server</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1288/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1288/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1288/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1288&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2012/01/20/nuget-package-restore-multiple-repositories-and-ci-servers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2012/01/work-5542900-1-sticker375x360.png?w=300" medium="image">
			<media:title type="html">Boom!</media:title>
		</media:content>
	</item>
		<item>
		<title>Workaround: Oracle, NHibernate, and CreateSQLQuery Not Working</title>
		<link>http://tiredblogger.wordpress.com/2012/01/17/workaround-oracle-nhibernate-and-createsqlquery-not-working/</link>
		<comments>http://tiredblogger.wordpress.com/2012/01/17/workaround-oracle-nhibernate-and-createsqlquery-not-working/#comments</comments>
		<pubDate>Wed, 18 Jan 2012 03:25:38 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[.net 4.0]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[oracle]]></category>
		<category><![CDATA[sql]]></category>
		<category><![CDATA[workaround]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/?p=1260</guid>
		<description><![CDATA[It&#8217;s difficult to sum this post up with a title. I started the morning adding (what I thought to be) a trivial feature to one of our shared repository libraries. By the time I saw light at the end of the rabbit hole, I wasn&#8217;t sure what happened. This is the tale of my journey. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1260&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><img class="size-full wp-image-1273 alignright" title="Works On My Machine!" src="http://tiredblogger.files.wordpress.com/2012/01/6a0120a85dcdae970b0128776ff992970c.png?w=600" alt=""   /></p>
<p>It&#8217;s difficult to sum this post up with a title. I started the morning adding (what I thought to be) a trivial feature to one of our shared repository libraries.</p>
<p>By the time I saw light at the end of the rabbit hole, I wasn&#8217;t sure what happened. This is the tale of my journey. All of the code is is guaranteed to work on my machine&#8230; usually. <img src='http://s1.wp.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>I&#8217;ve done this before&#8211;<a title="Jeremy Clarkson" href="http://www.youtube.com/watch?v=nVE09yyznfc" target="_blank">how hard could it be</a>?</p>
<h4>The full source code is <a href="https://gist.github.com/1608818" target="_blank">available via a gist</a>.</h4>
<h2>The initial need</h2>
<p>A simple need really: take a complex query and trim it down to a model using <strong>NHibernate&#8217;s Session.CreateSQLQuery</strong> and <strong>Transformers.AliasToBean&lt;T&gt;</strong>.</p>
<h2>The problems</h2>
<p>&nbsp;</p>
<blockquote><p>So far, the only data provider I&#8217;ve had these problems with is Oracle&#8217;s ODP: Oracle.DataAccess. I&#8217;m not sure if the built-in System.Data.OracleClient.</p></blockquote>
<p>&nbsp;</p>
<h3>Problem #1 &#8211; Why is EVERYTHING IN CAPS?</h3>
<p>
The first oddness I ran into seemed to be caused by the <strong>IPropertyAccessor</strong> returning the properties in ALL CAPS. When it tried to match the aliases in the array, <code>[FIRSTNAME] != [FirstName]</code>. Well, that&#8217;s annoying.</p>
<p><strong>Workaround: Add an additional PropertyInfo[] and fetch the properties myself.</strong></p>
<p>This method ignores the aliases parameter in <strong>TransformTuple</strong> and relies on a call in the constructor to populate the Transformer&#8217;s properties.</p>
<p><pre class="brush: csharp;">
public OracleSQLAliasToBeanTransformer(Type resultClass)
{
    // [snip!]
    // this is also a PERSONAL preference to only return fields that have a valid setter.
    _fields = this._resultClass.GetProperties(Flags)
                   .Where(x =&gt; x.GetSetMethod() != null).ToArray();
}
</pre></p>
<p>Inside <strong>TransformTuple</strong>, I then call on <strong>_fields</strong> rather than the <strong>aliases</strong> constructor parameter.</p>
<p><pre class="brush: csharp;">
var fieldNames = _fields.Select(x =&gt; x.Name).ToList();

// [big snip!]

setters = new ISetter[fieldNames.Count];
for (var i = 0; i &lt; fieldNames.Count; i++)
{
    var fieldName = fieldNames[i];
    _setters[i] = _propertyAccessor.GetSetter(_resultClass, fieldName);
}
</pre></p>
<p>Problem solved. Everything is proper case.</p>
<p><strong>Bold assumption</strong>: I&#8217;m guessing this is coming back in as upper case because Oracle, by default, stores and retrieves everything as upper case unless it&#8217;s surrounded by quotes (which has it&#8217;s own disadvantages).<br />
</p>
<h3>Problem #2 &#8211; Why are my ints coming in as decimals and strings as char[]?</h3>
<p>
This one I&#8217;m taking a wild guess. I found a <a title="Hibernate issue HHH-2304" href="https://hibernate.onjira.com/browse/HHH-2304" target="_blank">similar issue for Hibernate</a> (Java daddy of NHibernate), but didn&#8217;t see a matching NHibernate issue. It seems that the types coming in are correct, but the tuple data types are wrong.</p>
<p>For example, if an object as a integer 0 value, it returns as 0M and implicitly converts to decimal.</p>
<p><strong>Workaround: Use System.Convert.ChangeType(obj, T)</strong></p>
<p>If I used this on every piece of code, I&#8217;d feel more guilty than I do; however, on edge cases where the standard <strong>AliasToBeanTransformer</strong> won&#8217;t work, I chalk it up to part of doing business with Oracle.</p>
<p>Inside the <strong>TransformTuple</strong> method, I iterate over the fields and recast each tuple member accordingly.  The only caveat is that I&#8217;m separating out enums and specifically casting them as int32. YMMV.</p>
<p><pre class="brush: csharp;">

var fieldNames = _fields.Select(x =&gt; x.Name).ToList();
for (var i = 0; i &lt; fieldNames.Count; i++)
{
    var fieldType = _fields[i].PropertyType;
    if (fieldType.IsEnum)
    {
        // It can't seem to handle enums, so convert them
	// to Int (so the enum will work)
	tuple[i] = Convert.ChangeType(tuple[i], TypeCode.Int32);
    }
    else
    {
        // set it to the actual field type on the property we're
	// filling.
	tuple[i] = Convert.ChangeType(tuple[i], fieldType);
    }
}
</pre></p>
<p>At this point, everything is recast to match the <strong>Type</strong> of the incoming property. When all is said and done, adding a bit of exception handling around this is recommended (though, I&#8217;m not sure when a non-expected error might pop here).</p>
<p>Problem solved. Our <strong>_setters[i].Set()</strong> can now populate our transformation and return it to the client.</p>
<h2>Summary</h2>
<p>Lessons learned? Like Mr. Clarkson usually discovers, when it sounds easy, it means you&#8217;ll usually end up on fire. Keep fire extinguishers handy at all times.</p>
<p>Is there another way to do this? Probably. I could probably create a throwaway DTO with all capital letters then use AutoMapper or such to map it to the properly-cased objects. That, honestly, seems more mindnumbing than this (though perhaps less voodoo).</p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/net-4-0/'>.net 4.0</a>, <a href='http://tiredblogger.wordpress.com/category/c/'>c#</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1260/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1260/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1260/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1260&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2012/01/17/workaround-oracle-nhibernate-and-createsqlquery-not-working/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2012/01/6a0120a85dcdae970b0128776ff992970c.png" medium="image">
			<media:title type="html">Works On My Machine!</media:title>
		</media:content>
	</item>
		<item>
		<title>Posting to Campfire using PowerShell (and curl)</title>
		<link>http://tiredblogger.wordpress.com/2012/01/16/posting-to-campfire-using-powershell-and-curl/</link>
		<comments>http://tiredblogger.wordpress.com/2012/01/16/posting-to-campfire-using-powershell-and-curl/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 19:00:58 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[campfire]]></category>

		<guid isPermaLink="false">https://tiredblogger.wordpress.com/?p=1249</guid>
		<description><![CDATA[I have a few tasks that kick off nightly that I wanted to post status updates into our team&#8217;s Campfire room. Thankfully, 37signals Campfire has an amazing API.  With that knowledge, time to create a quick PowerShell function! NOTE: I use curl for this. The Linux/Unix folks likely know curl, however, I&#8217;m sure the Windows [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1249&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have a few tasks that kick off nightly that I wanted to post status updates into our team&#8217;s Campfire room. Thankfully, 37signals Campfire has <a href="http://developer.37signals.com/campfire/" title="Campfire API" target="_blank">an amazing API</a>.  With that knowledge, time to create a quick PowerShell function!</p>
<blockquote><p><strong>NOTE: I use curl for this. The Linux/Unix folks likely know curl, however, I&#8217;m sure the Windows folks have funny looks on their faces. You can grab the </strong><a href="http://curl.haxx.se/download.html" target="_blank"><strong>latest curl here</strong></a><strong> for Windows (the Win32 or Win64 generic versions are fine).</strong></p></blockquote>
<h4>The full code for this function is <a href="https://gist.github.com/1622328" target="_blank">available via gist</a>.</h4>
<p>I pass two parameters: the room number (though this could be tweaked to be optional if you only have one room) and the message to post.</p>
<p><pre class="brush: powershell;">
param (
 [string]$RoomNumber = (Read-Host &quot;The room to post to (default: 123456) &quot;),
 [string]$Message = (Read-Host &quot;The message to send &quot;)
)
$defaultRoom = &quot;123456&quot;
if ($RoomNumber -eq &quot;&quot;) {
 $RoomNumber = $defaultRoom
}
</pre></p>
<p>There are two baked-in variables, the authentication token for your posting user (we created a &#8216;robot&#8217; account that we use) and the <strong>YOURDOMAIN</strong> prefix for Campfire.</p>
<p><pre class="brush: powershell;">
$authToken = &quot;YOUR AUTH TOKEN&quot;
$postUrl = &quot;https://YOURDOMAIN.campfirenow.com/room/{0}/speak.json&quot; -f $RoomNumber
</pre></p>
<p>The rest is simply using curl to HTTP POST a bit of JSON back up to the web service. If you&#8217;re not familiar with the JSON data format, <a href="http://www.json.org/js.html" title="JSON in JavaScript" target="_blank">give this a quick read</a>. The best way I can sum up JSON is that it&#8217;s XML objects for the web with less wrist-cutting. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p><pre class="brush: powershell;">
$data = &quot;`&quot;{'message':{'body':'$message'}}`&quot;&quot;

$command = &quot;curl -i --user {0}:X -H 'Content-Type: application/json' --data {1} {2}&quot; 
     -f $authToken, $data, $postUrl

$result = Invoke-Expression ($command)

if ($result[0].EndsWith(&quot;Created&quot;) -ne $true) {
	Write-Host &quot;Error!&quot; -foregroundcolor red
	$result
}
else {
	Write-Host &quot;Success!&quot; -foregroundcolor green
}
</pre></p>
<div id="attachment_1255" class="wp-caption alignnone" style="width: 610px"><a href="http://tiredblogger.files.wordpress.com/2012/01/screenshot-1_16_2012-1_13_09-pm.png"><img src="http://tiredblogger.files.wordpress.com/2012/01/screenshot-1_16_2012-1_13_09-pm.png?w=600&#038;h=97" alt="Running SendTo-CampFire" title="Running SendTo-CampFire" width="600" height="97" class="size-full wp-image-1255" /></a><p class="wp-caption-text">Running SendTo-Campfire with Feedback</p></div>
<p>Indeed, there be success!</p>
<div id="attachment_1257" class="wp-caption alignnone" style="width: 278px"><a href="http://tiredblogger.files.wordpress.com/2012/01/screenshot-1_16_2012-1_15_42-pm.png"><img src="http://tiredblogger.files.wordpress.com/2012/01/screenshot-1_16_2012-1_15_42-pm.png?w=600" alt="Success!" title="Success!"   class="size-full wp-image-1257" /></a><p class="wp-caption-text">Success!</p></div>
<p>It&#8217;s important to remember that PowerShell IS extremely powerful, but can become even more powerful coupled with other available tools&#8211;even the web itself!</p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/powershell/'>PowerShell</a>, <a href='http://tiredblogger.wordpress.com/category/windows-7/'>Windows 7</a>, <a href='http://tiredblogger.wordpress.com/category/windows-server/'>Windows Server</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1249/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1249/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1249/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1249&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2012/01/16/posting-to-campfire-using-powershell-and-curl/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2012/01/screenshot-1_16_2012-1_13_09-pm.png" medium="image">
			<media:title type="html">Running SendTo-CampFire</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2012/01/screenshot-1_16_2012-1_15_42-pm.png" medium="image">
			<media:title type="html">Success!</media:title>
		</media:content>
	</item>
		<item>
		<title>Changing Default Printers by Network Subnet</title>
		<link>http://tiredblogger.wordpress.com/2012/01/13/changing-default-printers-by-network-subnet/</link>
		<comments>http://tiredblogger.wordpress.com/2012/01/13/changing-default-printers-by-network-subnet/#comments</comments>
		<pubDate>Fri, 13 Jan 2012 15:18:23 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[windows7]]></category>
		<category><![CDATA[printers]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/?p=1239</guid>
		<description><![CDATA[Windows 7 includes a pretty handy feature for mobile devices called location-aware printing. The feature itself is pretty cool and great if you&#8217;re moving between two distinct networks (home and work, for example). However, if you&#8217;re moving within the SAME network&#8211;and the SAME wireless SSID, it doesn&#8217;t register a difference. LAP doesn&#8217;t pay attention to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1239&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Windows 7 includes a pretty handy feature for mobile devices called <a title="location-aware printing" href="http://windows.microsoft.com/en-US/windows7/Automatically-switch-default-printers-between-home-work-or-school" target="_blank">location-aware printing</a>. The feature itself is pretty cool and great if you&#8217;re moving between two distinct networks (home and work, for example). However, if you&#8217;re moving within the SAME network&#8211;and the SAME wireless SSID, it doesn&#8217;t register a difference. LAP doesn&#8217;t pay attention to your IP address, just the SSID you&#8217;re connected to.</p>
<p>In our organization, and most large corporations, wireless access points have the same name/credentials so that users can move seamlessly through the enterprise. How can we address location-based printing then?</p>
<p>One of my peers recently moved into a position where they are constantly between two buildings multiple times per day and frequently forgetting to reset their default printer.</p>
<p>Here&#8217;s how I helped her out using a bit of PowerShell.</p>
<p>For the full code, <a title="Set-PrinterByLocation.ps1 gist" href="https://gist.github.com/1606790" target="_blank">check out this gist</a>.</p>
<div id="attachment_1240" class="wp-caption alignnone" style="width: 353px"><a href="http://tiredblogger.files.wordpress.com/2012/01/1_13_2012-9_11_54-am.png"><img class="size-full wp-image-1240 " title="Set-PrinterByLocation in action!" src="http://tiredblogger.files.wordpress.com/2012/01/1_13_2012-9_11_54-am.png?w=600" alt="Set-PrinterByLocation in action!"   /></a><p class="wp-caption-text">Set-PrinterByLocation in action!</p></div>
<p>To begin, we need to specify our IP subnets and the printers associated to them. As this gets bigger (say 4-5 sites), it&#8217;d be easier to toss this into a separate file as a key-value pair and import it.</p>
<p><pre class="brush: powershell;">
$homeNet = &quot;10.1.4.*&quot;, &quot;OfficePrinter&quot;
$remoteNet = &quot;10.1.6.*&quot;, &quot;W382_HP_Printer&quot;
</pre></p>
<p>Next, let&#8217;s grab all of the IP addresses currently active on our computer. Since we could have both wireless and wired plugged in, this returns an array.</p>
<p><pre class="brush: powershell;">
$ipAddress = @()
$ipAddress = gwmi win32_NetworkAdapterConfiguration |
	? { $_.IPEnabled -eq $true } |
	% { $_.IPAddress } |
	% { [IPAddress]$_ } |
	? { $_.AddressFamily -eq 'internetwork'  } |
	% { $_.IPAddressToString }

Write-Host -fore cyan &quot;Your current network is $ipAddress.&quot;
</pre></p>
<p>Our last step is to switch (using the awesome -wildcard flag since we&#8217;re using wildcards &#8216;*&#8217; in our subnets) based on the returned IPs. The Set-DefaultPrinter function is a tweaked version of <a title="set-defaultprinter original source" href="http://blogs.technet.com/b/heyscriptingguy/archive/2009/05/20/how-can-i-use-windows-powershell-to-remove-old-printer-connections-list-printers-and-set-new-default-printers.aspx" target="_blank">this code from The Scripting Guy</a>.</p>
<p><pre class="brush: powershell;">
function Set-DefaultPrinter([string]$printerPath) {
	$printers = gwmi -class Win32_Printer -computer .
	Write-Host -fore cyan &quot;Default Printer: $printerPath&quot;
	$dp = $printers | ? { $_.deviceID -match $printerPath }
	$dp.SetDefaultPrinter() | Out-Null
}

switch -wildcard ($ipAddress) {
	$homeNet[0] { Set-DefaultPrinter $homeNet[1] }
	$remoteNet[0] { Set-DefaultPrinter $remoteNet[1] }
	default { Set-DefaultPrinter $homeNet[1] }
</pre></p>
<p>The full source code (and a constantly updated version available from <a title="Set-PrinterByLocation.ps1 gist" href="https://gist.github.com/1606790" target="_blank">gist</a>).</p>
<p><pre class="brush: powershell;">
$homeNet = &quot;10.1.4.*&quot;, &quot;OfficePrinter&quot;
$remoteNet = &quot;10.1.6.*&quot;, &quot;W382_HP_Printer&quot;

function Set-DefaultPrinter([string]$printerPath) {
	$printers = gwmi -class Win32_Printer -computer .
	Write-Host -fore cyan &quot;Default Printer: $printerPath&quot;
	$dp = $printers | ? { $_.deviceID -match $printerPath }
	$dp.SetDefaultPrinter() | Out-Null
}

$ipAddress = @()
$ipAddress = gwmi win32_NetworkAdapterConfiguration |
	? { $_.IPEnabled -eq $true } |
	% { $_.IPAddress } |
	% { [IPAddress]$_ } |
	? { $_.AddressFamily -eq 'internetwork'  } |
	% { $_.IPAddressToString }

Write-Host -fore cyan &quot;Your current network is $ipAddress.&quot;

switch -wildcard ($ipAddress) {
	$homeNet[0] { Set-DefaultPrinter $homeNet[1] }
	$remoteNet[0] { Set-DefaultPrinter $remoteNet[1] }
	default { Set-DefaultPrinter $homeNet[1] }
}
</pre></p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/microsoft/'>Microsoft</a>, <a href='http://tiredblogger.wordpress.com/category/powershell/'>PowerShell</a>, <a href='http://tiredblogger.wordpress.com/category/windows-7/'>Windows 7</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1239/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1239/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1239/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1239&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2012/01/13/changing-default-printers-by-network-subnet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2012/01/1_13_2012-9_11_54-am.png" medium="image">
			<media:title type="html">Set-PrinterByLocation in action!</media:title>
		</media:content>
	</item>
		<item>
		<title>Tip: Using Spark Conditionals to Toggle CSS and JavaScript</title>
		<link>http://tiredblogger.wordpress.com/2012/01/03/using-spark-conditionals-to-toggle-css-and-javascript/</link>
		<comments>http://tiredblogger.wordpress.com/2012/01/03/using-spark-conditionals-to-toggle-css-and-javascript/#comments</comments>
		<pubDate>Wed, 04 Jan 2012 01:57:06 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Spark View Engine]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[sparkviewengine]]></category>

		<guid isPermaLink="false">https://tiredblogger.wordpress.com/?p=1230</guid>
		<description><![CDATA[The conditional attribute is a fantastic shortcut to toggle CSS, input boxes, and other elements on a page&#8211;and is something I don&#8217;t see used in very many examples. One of my favorites is applying classes to an element based on a output model property, such as a permission boolean. Here&#8217;s an example. In a recent [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1230&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>The conditional attribute is a fantastic shortcut to toggle CSS, input boxes, and other elements on a page&#8211;and is something I don&#8217;t see used in very many examples. One of my favorites is applying classes to an element based on a output model property, such as a permission boolean.</p>
<h3>Here&#8217;s an example.</h3>
<p>In a recent project, a dashboard screen had several charts that toggled on and off based on the user&#8217;s preference. Rather than rebuild the screen each time, each class simply toggled an <strong>&#8216;enabled&#8217; </strong>class based on a <strong>Model.{Property}</strong>.</p>
<p><pre class="brush: css; auto-links: false; gutter: false; html-script: true; pad-line-numbers: true; toolbar: true;">
&lt;div class=&quot;charts&quot;&gt;
    &lt;div id=&quot;enteredbycount&quot; class=&quot;loading enabled?{Model.ShowEnteredBy}&quot;
		style=&quot;inlineChart&quot;&gt;
	&lt;/div&gt;
    &lt;div id=&quot;schoolcount&quot; class=&quot;loading enabled?{Model.ShowSchoolCount}&quot;
		style=&quot;inlineChart&quot;&gt;
	&lt;/div&gt;
&lt;/div&gt;
</pre></p>
<p>The Spark Conditional only renders the text preceding the conditional <strong>?{} </strong>if the condition is true. In this example, if our Model.ShowSchoolCount returns false, enabled never renders and our chart (due to some styling), remains hidden and never posts back to the server to get the chart data (saving an unnecessary AJAX call).</p>
<p>By toggling a class, you can trigger a certain set of styles, events using JavaScript, or most anything else you can dream up.</p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/html/'>HTML</a>, <a href='http://tiredblogger.wordpress.com/category/net-35/mvc/'>MVC</a>, <a href='http://tiredblogger.wordpress.com/category/spark-view-engine-2/'>Spark View Engine</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1230/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1230/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1230/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1230&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2012/01/03/using-spark-conditionals-to-toggle-css-and-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>
	</item>
		<item>
		<title>Finding TODOs and Reporting in PowerShell</title>
		<link>http://tiredblogger.wordpress.com/2011/12/28/finding-todos-and-reporting-in-powershell/</link>
		<comments>http://tiredblogger.wordpress.com/2011/12/28/finding-todos-and-reporting-in-powershell/#comments</comments>
		<pubDate>Wed, 28 Dec 2011 17:59:59 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[TeamCity]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[scripting]]></category>
		<category><![CDATA[teamcity]]></category>
		<category><![CDATA[vs2010]]></category>

		<guid isPermaLink="false">https://tiredblogger.wordpress.com/?p=1196</guid>
		<description><![CDATA[After @andyedinborough shared a blog post on how to report TODOs in CruiseControl.NET, I figured there HAD to be a snazzy way to do this with TeamCity. I already have TeamCity configured to dump out the results from our Machine.Specifications tests and PartCover code coverage (simple HTML and XML transforms) so another HTML file shouldn’t [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1196&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After <a href="https://twitter.com/#!/andyedinborough" target="_blank">@andyedinborough</a> shared a blog post on <a href="http://blog.guymahieu.com/2007/01/22/todo-reports-in-cruisecontrolnet/" target="_blank">how to report TODOs in CruiseControl.NET</a>, I figured there HAD to be a snazzy way to do this with TeamCity.</p>
<p>I already have TeamCity configured to dump out the results from our Machine.Specifications tests and PartCover code coverage (simple HTML and XML transforms) so another HTML file shouldn’t be difficult. When we&#8217;re done, we&#8217;ll have an HTML file, so we just need to setup a custom report to look for the file name. For more information on setting up custom reports in TeamCity, <a href="http://tiredblogger.wordpress.com/2010/12/02/playing-nice-with-psake-partcover-and-teamcity/" target="_blank">checkout this post</a> (step 3 in particular). </p>
<h1>Let&#8217;s Dig In!</h1>
<h4>&#160;</h4>
<h4>The <strong>code</strong>! The current working version of the code is available via <a href="https://gist.github.com/1524336" target="_blank">this gist</a>.</h4>
<p>The code is designed to be placed in a file of it’s own. Mine’s named <em>Get-TODO.ps1</em>.&#160; </p>
<blockquote><p>Note: If you want to include this in another file (such as your PowerShell profile), be sure to replace the <em>param() </em>into <em>function Get-TODO( {all the params} )</em>.</p>
</blockquote>
<p>The the script parameters make a few assumptions based on my own coding standards; change as necessary: </p>
<ul>
<li>My projects are named {SolutionName}.Web/.Specifications/.Core and are inside a directory called {SolutionName}, </li>
<li>By default, it includes several file extensions: .spark, .cs, .coffee, .js, and .rb, </li>
<li>By default, it excludes several directories: fubu-content, packages, build, and release. </li>
</ul>
<p>It also includes a couple of flags for Html output&#8211;we&#8217;ll get to that in a bit.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:37aa0d99-62d5-4cf7-89e0-ccb71e0c23cb" class="wlWriterEditableSmartContent">
<pre class="brush: powershell; auto-links: false; gutter: false; pad-line-numbers: true; toolbar: false;">
param(
	#this is appalling; there has to be a better way to get the raw name of &quot;this&quot; directory. 
	[string]$DirectoryMask = 
		(get-location),
	[array]$Include = 
		@(&quot;*.spark&quot;,&quot;*.cs&quot;,&quot;*.js&quot;,&quot;*.coffee&quot;,&quot;*.rb&quot;),
	[array]$Exclude = 
		@(&quot;fubu-content&quot;,&quot;packages&quot;,&quot;build&quot;,&quot;release&quot;),
	[switch]$Html,
	[string]$FileName = &quot;todoList.html&quot;)
</pre>
</div>
<h2>Fetching Our Files</h2>
<p>We need to grab a collection of all of our solution files. This will include the file extensions from $Include and use the directories from $DirectoryMask (which the default is everything from the current location).</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:a7f95e81-0f59-42be-ae30-cdbf26ac7189" class="wlWriterEditableSmartContent">
<pre class="brush: powershell; auto-links: false; gutter: false; toolbar: false;">
$originalFiles = 
	gci -Recurse -Include $Include -Path $DirectoryMask;
</pre>
</div>
<p>Unfortunately, the <em>-Exclude</em> flag is…well, unhappy, in PowerShell as it doesn&#8217;t seem to work with <em>-Recurse</em> (or if it does, there&#8217;s voodoo involved).</p>
<p>How do we address voodoo issues? <strong>Regular expressions</strong>. <img style="border-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://tiredblogger.files.wordpress.com/2011/12/wlemoticon-smile.png?w=600" /> Aww, yeah.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:4f6b5f2b-42d4-4451-b505-1996249b2721" class="wlWriterEditableSmartContent">
<pre class="brush: powershell; auto-links: false; gutter: false; toolbar: false;">
$withoutExcludes = $originalFiles | ? {
	if ($Exclude.count -gt 0) {
		#need moar regex
		[regex] $ex = 
			# 1: case insensitive and start of string
			# 2: join our array, using RegEx to escape special characters
			# the * allow wildcards so directory names filter out
			# and not just exact paths.
			# 3: end of string
			#  1                   2										3
			'(?i)^(.*'+(($Exclude|%{[regex]::escape($_)}) -join &quot;.*|.*&quot;)+'.*)$'
		$_ -notmatch $ex
	}
	else { 
		$_ 
	}
}
</pre>
</div>
<p>Breath, it&#8217;s okay. That is mostly code comments to explain what each line is doing.&#160; This snippet is dynamically creating a regular expression string based on our <em>$Exclude </em>parameter then comparing the current file in the iteration to the regular expression and returning the ones that do not match.&#160; If <em>$Exclude</em> is empty, it simply returns all files.</p>
<h2>Finding our TODOs</h2>
<p>Select-String provides us with a quick way to find patterns inside of text files and provides us with helpful output such as the line of text, line number, and file name (select-string is somewhat like PowerShell&#8217;s <strong>grep </strong>command).</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:bf10188a-63ed-4d5e-947d-df070ea5d107" class="wlWriterEditableSmartContent">
<pre class="brush: powershell; auto-links: false; gutter: false; toolbar: false;">
$todos = $withoutExcludes | 
	% { select-string $_ -pattern &quot;TODO:&quot; } |
	select-object LineNumber, FileName, Line;
</pre>
</div>
<p>Let&#8217;s take all of our remaining files, look at them as STRINGs and find the pattern &quot;TODO:&quot;.&#160; This returns an array of <strong>MatchInfo objects</strong>. Since these have a few ancillary properties we don&#8217;t want, let&#8217;s simply grab the LineNumber, FileName, and the Line (of the match) for our reporting.</p>
<p>Now that we have our list, let&#8217;s pretty it up a bit.&#160; PowerShell&#8217;s select-object has the ability to reformat objects on the fly using expressions.&#160; I could have combined this in the last command; however, it&#8217;s a bit clearer to fetch our results THEN format them.</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:e26fa1f0-3c7f-4e05-8621-9f25fd98920e" class="wlWriterEditableSmartContent">
<pre class="brush: powershell; auto-links: false; gutter: false; toolbar: false;">
$formattedOutput = $todos | select-object `
	@{Name='LineNumber'; Expression={$_.LineNumber}}, `
	@{Name='FileName'; Expression={$_.FileName}}, `
	@{Name='TODO'; Expression={$_.Line.Trim() -replace '// TODO: ',''}}
</pre>
</div>
<ol>
<li>LineNumber: We&#8217;re keeping this line the same. </li>
<li>FileName: Again, input-&gt;output. <img style="border-style:none;" class="wlEmoticon wlEmoticon-smile" alt="Smile" src="http://tiredblogger.files.wordpress.com/2011/12/wlemoticon-smile.png?w=600" /> </li>
<li>TODO: Here&#8217;s the big change. &quot;Line&quot; isn&#8217;t real descriptive, so let&#8217;s set Name=&#8217;TODO&#8217; for this column. Second, let&#8217;s trim the whitespace off the line AND replace the string &quot;// TODO: &quot; with an empty string (remove it).&#160; This cleans it up a bit. </li>
</ol>
<h2>Reporting It Out</h2>
<p>At this point, we could simply return <strong>$formattedOutput | ft -a</strong> and have a handy table that looks like this:</p>
<p>  <a href="http://tiredblogger.files.wordpress.com/2011/12/consoleoutput.png"><img style="background-image:none;padding-right:0;display:inline;padding-top:0;border-width:0;" title="consoleoutput" border="0" alt="consoleoutput" src="http://tiredblogger.files.wordpress.com/2011/12/consoleoutput_thumb.png?w=466&#038;h=152" width="466" height="152" /></a></p>
<p>Good for scripts, not so good for reporting and presenting to the boss/team (well, not my boss or team…). I added a <em>-Html </em>and <em>-FileName</em> flag to our parameters at the beginning just for this. I&#8217;ve pre-slugged the filename to todoList.html so I can set TeamCity to pickup the report automagically.&#160; But how do we build the report?</p>
<p>PowerShell contains a fantastic built-in cmdlet called <strong>ConvertTo-Html</strong> that you can pipe pretty much any tabular content into and it turns it into a table.</p>
<p>&#160;</p>
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:C89E2BDB-ADD3-4f7a-9810-1B7EACF446C1:3d56ef3e-1107-4b4d-bd44-bcdac9cdfc4d" class="wlWriterEditableSmartContent">
<pre class="brush: powershell; auto-links: false; gutter: false; toolbar: false;">
if ($Html) {
	$head = @'
	&lt;style&gt; 
	body{	font-family:Segoe UI; background-color:white;} 
	table{	border-width: 1px;border-style: solid;
			border-color: black;border-collapse: collapse;width:100%;} 
	th{		font-family:Segoe Print;font-size:1.0em; border-width: 1px;
			padding: 2px;border-style: solid;border-color:black;
			background-color:lightblue;} 
	td{		border-width: 1px;padding: 2px;border-style: solid;
			border-color: black;background-color:white;} 
	&lt;/style&gt; 
'@
	$solutionName = 
		(Get-Location).ToString().Split(&quot;\&quot;)[(Get-Location).ToString().Split(&quot;\&quot;).Count-1];

	$header = &quot;&lt;h1&gt;&quot;+$solutionName +&quot; TODO List&lt;/h1&gt;&lt;p&gt;Generated on &quot;+ [DateTime]::Now +&quot;.&lt;/p&gt;&quot;
	$title = $solutionName +&quot; TODO List&quot;
	$formattedOutput | 
              ConvertTo-HTML -head $head -body $header -title $title |
              Out-File $FileName
}
else {
	$formattedOutput
}
</pre>
</div>
<p>Our html &lt;head&gt; tag needs some <em><u>style</u></em>. Simple CSS to address that problem.&#160; I even added a few fonts in there for kicks and placed them in <em>$head</em>.</p>
<p>As I mentioned before, my solutions are usually the name of the project&#8211;which is what I want as the<em> $title</em> and <em>$header</em>. The <em>$solutionName </em>is ugly right now&#8211;if anyone out there has a BETTER way to get the STRING name of the current directory (not the Path), I&#8217;m all ears.</p>
<p>We take our<em> $formattedOutput, $header, $title</em> and pass them into <strong>ConvertTo-Html</strong>. It looks a bit strange that we&#8217;re setting our &#8216;body&#8217; as the header; however, whatever is piped into the cmdlet <u>appends</u> to what is passed into <em><strong>-</strong>body</em><strong>.</strong> It then parses our content out to the <em>$FileName</em><strong> </strong>specified.</p>
<p>  <a href="http://tiredblogger.files.wordpress.com/2011/12/htmloutput.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="htmloutput" border="0" alt="htmloutput" src="http://tiredblogger.files.wordpress.com/2011/12/htmloutput_thumb.png?w=632&#038;h=169" width="632" height="169" /></a></p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/powershell/'>PowerShell</a>, <a href='http://tiredblogger.wordpress.com/category/teamcity-2/'>TeamCity</a>, <a href='http://tiredblogger.wordpress.com/category/visual-studio-2010/'>Visual Studio 2010</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1196/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1196/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1196/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1196&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2011/12/28/finding-todos-and-reporting-in-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/12/wlemoticon-smile.png" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/12/wlemoticon-smile.png" medium="image">
			<media:title type="html">Smile</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/12/consoleoutput_thumb.png" medium="image">
			<media:title type="html">consoleoutput</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/12/htmloutput_thumb.png" medium="image">
			<media:title type="html">htmloutput</media:title>
		</media:content>
	</item>
		<item>
		<title>Using Cassette with Spark View Engine</title>
		<link>http://tiredblogger.wordpress.com/2011/07/21/using-cassette-with-spark-view-engine/</link>
		<comments>http://tiredblogger.wordpress.com/2011/07/21/using-cassette-with-spark-view-engine/#comments</comments>
		<pubDate>Fri, 22 Jul 2011 03:02:35 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[.net 4.0]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[nuget]]></category>
		<category><![CDATA[Spark View Engine]]></category>
		<category><![CDATA[Visual Studio 2010]]></category>
		<category><![CDATA[aspnet]]></category>
		<category><![CDATA[javascript]]></category>
		<category><![CDATA[sparkviewengine]]></category>

		<guid isPermaLink="false">https://tiredblogger.wordpress.com/2011/07/21/using-cassette-with-spark-view-engine/</guid>
		<description><![CDATA[Knapsack&#8230; *cough*&#8230; I mean Cassette is a fantastic javascript/css/coffeescript resource manager from Andrew Davey. It did, however, take a bit to figure out why it wouldn’t work with Spark View Engine. Thankfully, blogs exist to remind me of this at a later date. Namely—because I’ve never tried to use anything that returned void before. Helpers [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1165&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Knapsack&#8230; *cough*&#8230; I mean <a href="https://github.com/andrewdavey/cassette" target="_blank">Cassette</a> is a fantastic javascript/css/coffeescript resource manager from <a href="http://twitter.com/#!/andrewdavey" target="_blank">Andrew Davey</a>. It did, however, take a bit to figure out why it wouldn’t work with Spark View Engine. Thankfully, blogs exist to remind me of this at a later date. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Namely—because I’ve never tried to use anything that returned <strong>void</strong> before. Helpers tend to always return either Html or a value.</p>
<p>I finally stumbled on a section in the Spark View Engine documentation for <a href="http://sparkviewengine.com/documentation/expressions#Inlinecode" target="_blank">inline expressions</a>.</p>
<blockquote><p>Sometimes, when push comes to shove, you have a situation where you&#8217;re not writing output and there isn&#8217;t a markup construct for what you want to do. As a last resort you can produce code directly in-place in the generated class.</p></blockquote>
<p>Well then, that sounds like what I want.</p>
<p>So our <strong>void </strong>methods, the Html.ReferenceScript and Html.ReferenceStylesheet should be written as:<br />
<pre class="brush: plain;">
#{Html.ReferenceScript(&quot;scripts/app/home.index.js&quot;);}
#{Html.ReferenceStylesheet(&quot;styles/app&quot;);}
</pre><br />
<em>Note the # (pound sign) and the semi-colon at the end of the statement block.</em></p>
<p>Our rendering scripts; however, use standard Spark output syntax:</p>
<p><pre class="brush: plain;">
${Html.RenderScripts()}
${Html.RenderStylesheetLinks()}
</pre></p>
<p>Now my Spark view contains the hashed Urls&#8211;in order&#8211;as it should.</p>
<p><pre class="brush: plain;"> &lt;!DOCTYPE html&gt;
 &lt;html&gt;
 &lt;head&gt;
   &lt;link href=&quot;/styles/app/site.css?f8f8e3a3aec6d4e07008efb57d1233562d2c4b70&quot; type=&quot;text/css&quot; rel=&quot;stylesheet&quot; /&gt;
 &lt;/head&gt;
 &lt;body&gt;
 &lt;h2&gt;Index&lt;/h2&gt;
   &lt;script src=&quot;/scripts/libs/jquery-1.6.2.js?eeee9d4604e71f2e01b818fc1439f7b5baf1be7a&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
   &lt;script src=&quot;/scripts/app/application.js?91c81d13cf1762045ede31783560e6a46efc33d3&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
   &lt;script src=&quot;/scripts/app/home.index.js?b0a66f7ba204e2dcf5261ab75934baba9cb94e51&quot; type=&quot;text/javascript&quot;&gt;&lt;/script&gt;
 &lt;/body&gt; </pre></p>
<p>Excellent.</p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/net-4-0/'>.net 4.0</a>, <a href='http://tiredblogger.wordpress.com/category/javascript/'>JavaScript</a>, <a href='http://tiredblogger.wordpress.com/category/visual-studio-2010/nuget/'>nuget</a>, <a href='http://tiredblogger.wordpress.com/category/spark-view-engine-2/'>Spark View Engine</a>, <a href='http://tiredblogger.wordpress.com/category/visual-studio-2010/'>Visual Studio 2010</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1165/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1165/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1165/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1165&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2011/07/21/using-cassette-with-spark-view-engine/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>
	</item>
		<item>
		<title>Review: Asus Transformer TF-101</title>
		<link>http://tiredblogger.wordpress.com/2011/06/15/review-asus-transformer-tf-101/</link>
		<comments>http://tiredblogger.wordpress.com/2011/06/15/review-asus-transformer-tf-101/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 15:44:22 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[Android]]></category>
		<category><![CDATA[Everything Else]]></category>
		<category><![CDATA[Hardware and Software]]></category>
		<category><![CDATA[Workplace]]></category>
		<category><![CDATA[android]]></category>
		<category><![CDATA[asus]]></category>
		<category><![CDATA[honeycomb]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[transformer]]></category>

		<guid isPermaLink="false">https://tiredblogger.wordpress.com/2011/06/15/review-asus-transformer-tf-101/</guid>
		<description><![CDATA[tl;dr: Awesome! I wanted to give my review after at least a week to settle in and integrate into my daily &#8216;flow&#8217;. Why the Asus Transformer? I&#8217;ve looked at more tablets than I can remember, teetering between the Motorola Xoom, Apple iPad2, Notion Ink Adam, and the Transformer.&#160; All of these seemed like great devices [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1158&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><strong>tl;dr:</strong> Awesome!</p>
<p>I wanted to give my review after at least a week to settle in and integrate into my daily &#8216;flow&#8217;.</p>
<h2>Why the Asus Transformer?</h2>
<p>I&#8217;ve looked at more tablets than I can remember, teetering between the <a href="http://www.motorola.com/staticfiles/Consumers/xoom-android-tablet/us-en/overview.html" target="_blank">Motorola Xoom</a>, <a href="http://www.apple.com/ipad/" target="_blank">Apple iPad2</a>, <a href="http://www.notionink.com/" target="_blank">Notion Ink Adam</a>, and the <a href="http://www.asus.com/Eee/Eee_Pad/Eee_Pad_Transformer_TF101/" target="_blank">Transformer</a>.&#160; All of these seemed like great devices and had their own pros; however, the Transformer sold me on a few of its flashy innovations:</p>
<ul>
<li>Asus <strong>seems</strong> dedicated to constant updates. They&#8217;ve already pushed out Android Honeycomb 3.1 OTA and it updated like a champ. </li>
<li>The docking station/keyboard is brilliant and really bridges the gap between netbook and tablet and adds incredible battery life. </li>
<li>The mix of hardware performance for an incredible price point (499$US for the 32GB unit and 149$US for the keyboard/docking station at Amazon.com). </li>
<li>Flash support. Yes, I&#8217;m looking at you iPad2. </li>
</ul>
<p> <a href="http://tiredblogger.files.wordpress.com/2011/06/img_20110614_215101.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Photo of the Transformer... and swanky placemat backdrop." border="0" alt="Photo of the Transformer... and swanky placemat backdrop." src="http://tiredblogger.files.wordpress.com/2011/06/img_20110614_215101_thumb.jpg?w=644&#038;h=475" width="644" height="475" /></a>
<p>&#160;</p>
<h2>How has the Transformer changed things?</h2>
<p>I&#8217;ve noticed it&#8217;s changed things in the oddest of ways. I haven&#8217;t opened my personal laptop since I got the Transformer (it looks big and powerful, but it&#8217;s just old and &#8230; well, old).</p>
<p>Around the house, I&#8217;ve found myself using the Transformer in place of my EVO. I use it in the kitchen to look up recipes, check for coupons, make note of my groceries in Mighty Shopper, and listen to music. Other times, like for this post, for simple word processing, web browsing, and email. More functionality and less squinting.</p>
<p><a href="http://tiredblogger.files.wordpress.com/2011/06/img_20110613_084907.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:left;padding-top:0;border-width:0;margin:1px 10px 4px 0;" title="Work Computer Size Comparison" border="0" alt="Work Computer Size Comparison" align="left" src="http://tiredblogger.files.wordpress.com/2011/06/img_20110613_084907_thumb.jpg?w=244&#038;h=202" width="244" height="202" /></a>At work, I&#8217;ve used Polaris Office for note taking, presentations (via the HDMI out), web browsing and research as I wander around the office with folks, and email. The remote desktop client (2X Client) allows me to remote into servers, my office desktop, and client machines for diagnostic work.</p>
<p>With Android 3.1, the web browser engine finally supports NTLM/Windows authentication so I can log into our corporate web sites (I hope this is coming to the Gingerbread builds soon).</p>
<p>I still have my phone with me through all this.. the Transformer hasn&#8217;t replaced the portability and features of my phone, but augmented what I can do without an actual desktop computer.</p>
<p>&#160;</p>
<h2>The Hardware</h2>
<p>You can read the unit&#8217;s <a href="http://www.asus.com/Eee/Eee_Pad/Eee_Pad_Transformer_TF101/#specifications" target="_blank">specifications</a>, so I won&#8217;t drive into them too much. There are a few things to mention.</p>
<h3>The bulk</h3>
<p>Overall, the unit (and keyboard doc) are quite light compared to a normal 14&quot; laptop.&#160; The tablet itself is very comfortable to carry around (long days here at work, so I&#8217;ve been pacing around while researching on the web).</p>
<h3>The keyboard dock</h3>
<p><a href="http://tiredblogger.files.wordpress.com/2011/06/img_20110615_094528.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:right;padding-top:0;border-width:0;margin:0 10px;" title="The keyboard dock." border="0" alt="Image of the the keyboard dock." align="right" src="http://tiredblogger.files.wordpress.com/2011/06/img_20110615_094528_thumb.jpg?w=244&#038;h=184" width="244" height="184" /></a>I was a bit worried that the keyboard dock would be uncomfortable to use; however, that&#8217;s not the case.&#160; The keys are well spaced apart (once you get used to the &#8216;special&#8217; keys at the top&#8211;I keep accidently locking the unit when I hit backspace) and the monitor can tilt back far enough for easy reading.</p>
<p>It&#8217;s important to note that the keyboard dock&#8217;s additional battery life is due to the dock <strong><u>charging</u></strong> the main unit while it&#8217;s docked.&#160; This is advantageous.&#160; Wander around and run the battery down a bit on the tablet, then dock and let the keyboard charge things up, detach, and you have a fully charged tablet again.</p>
<h3>The POWER!</h3>
<p>It is quite disappointing that the Transformer has a unique USB cable; however, even more so that it&#8217;s only about a meter long.&#160; This hassle is aggravated by the fact you cannot charge the unit via USB while it&#8217;s on, so if you need a charge AND need to use it, you&#8217;re trapped a meter from your electrical connection or extension cord.</p>
<p>Thankfully, with the 14-16 hours of battery life, charging isn&#8217;t a central focus of the day (unlike my EVO which is dead by the time I get to work).</p>
<h3>The video output</h3>
<p>Less of a big deal and more of a &#8216;oh&#8217; moment when digging for cables.&#160; My EVO and a few other video devices all use micro HDMI so I had to <a href="http://www.amazon.com/AmazonBasics-Speed-Mini-HDMI-Ethernet-Meters/dp/B003ES5ZR8/ref=pd_cp_e_1" target="_blank">pickup a 1.3a mini HDMI cable</a> for the Transformer.</p>
<h3>The screen</h3>
<p>I love the screen. It&#8217;s a bit hard to see in high light (it&#8217;s <strong><u>not</u></strong> a Kindle for outdoor reading); however, the fingerprints are a bit out of control. I plan on getting a screen protector which, I hope, will help.</p>
<h3>The camera</h3>
<p>The camera is only a 5MP (compared to the 8MP in my EVO) and takes 4:3 photos rather than wide screen. That aside, it&#8217;s quite a good camera for general &#8216;here I am!&#8217; sorts of photos&#8211;like lounging on the hammock in the back yard on a peaceful evening.</p>
<p><a href="http://tiredblogger.files.wordpress.com/2011/06/img_20110611_193622.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="Example Transformer camera image--my back yard." border="0" alt="Example Transformer camera image--my back yard." src="http://tiredblogger.files.wordpress.com/2011/06/img_20110611_193622_thumb.jpg?w=644&#038;h=484" width="644" height="484" /></a></p>
<h3>The lack of right click</h3>
<p>I understand… I really do. The Android device doesn&#8217;t have a context for &#8216;right-click&#8217;; however, I dream of the day when it does so that the remote desktop clients have right-click.</p>
<h3>Keeping it safe</h3>
<p>I picked up a <a href="http://www.amazon.com/Belkin-inch-Netbook-Laptop-Sleeve/dp/B002O0KATK/ref=sr_1_1?ie=UTF8&amp;qid=1308149149&amp;sr=8-1" target="_blank">Belkin 10&quot; Netbook Sleeve</a> when ordering and highly recommend it as a carry case for the Transformer.&#160; The unit, whether you&#8217;re just carrying the tablet or the tablet and keyboard dock, fit very well into the sleeve and the zips/material feel and look good.</p>
<p>&#160;</p>
<h2>The Software</h2>
<p>Out of the box, the Transformer walks you through a simple configuration&#8211;much like my EVO (or any Android phone). Setting up email, syncing contacts, and such worked just fine. I was impressed that the unit also synced my Google bookmarks. That&#8217;s an added bonus.</p>
<p>The basics are included:</p>
<ul>
<li><strong>Email</strong> (Enterprise, Gmail, etc.) &#8211; The layout and flow of both mail applications is the same and works VERY well on landscape mode. </li>
<li><strong>Calendaring</strong> &#8211; nice, clean &quot;Outlook-esque&quot; layout. </li>
<li><strong>Contacts</strong> &#8211; standard Android contacts client. </li>
<li><strong>Polaris Office</strong> &#8211; bundled Office client for DOC, XLS, and PPT. Works quite well (and what I used for this post). It can also read/write to Google Docs, Dropbox, and a few other cloud services. At this time, I&#8217;m getting 400 errors trying to save BACK to Google Docs; however, from the forums, it appears that it is a Google API issue. </li>
<li><strong>MyReader</strong> &#8211; Simple eBook/pdf reader akin to Aikido. </li>
<li><strong>MyNet</strong> &#8211; network-based HD streaming client. Detects my PlayOn devices and streams perfectly. </li>
<li><strong>MyCloud</strong> &#8211; a subscription-based, unlimited storage system for music and files. Transformer includes a free 1 year subscription. I haven&#8217;t dug into this much as I have LiveSync and DropBox. </li>
</ul>
<p>In addition to the boxed software, there are a few applications that I&#8217;d recommend (and seem to work quite well with the Transformer and Honeycomb):</p>
<ul>
<li><strong>Dolphin Browser HD</strong> &#8211; Bit cleaner interface for web browsing and plugin modules (3.1 addresses some rendering issues though).
<div style="display:inline;float:none;margin:0;padding:0;" id="scid:0767317B-992E-4b12-91E0-4F059A8CECA8:5d4fa368-7475-4c4d-bca1-b56ae6c0d5b9" class="wlWriterEditableSmartContent">Technorati Tags: <a href="http://technorati.com/tags/honeycomb" rel="tag">honeycomb</a>,<a href="http://technorati.com/tags/android" rel="tag">android</a>,<a href="http://technorati.com/tags/asus" rel="tag">asus</a>,<a href="http://technorati.com/tags/transformer" rel="tag">transformer</a>,<a href="http://technorati.com/tags/review" rel="tag">review</a></div>
<p> . </li>
<li><strong>Amazon Kindle Reader</strong> &#8211; Great for reading Kindle books on the run (and without your Kindle). The update for Android 3.1 works even better! </li>
<li><strong>Pandora</strong> &#8211; Great and solid music client. </li>
<li><strong>Grooveshark</strong> &#8211; Formatting is a bit off, but works fantastic to query and stream your favorite tunes. </li>
<li><strong>Google Reader</strong> &#8211; Great tablet support for full-screen reading. </li>
<li><strong>imo Chat beta</strong> &#8211; Best IM client I&#8217;ve found for any type of Android device. </li>
<li><strong>Plume</strong> &#8211; best Twitter client that takes advantage of the notifications and wide screen layout. </li>
<li><strong>DropBox</strong> &#8211; the Android DropBox client is pretty stellar. </li>
<li><strong>PrintBot </strong>- a free (and for cheap) application to print to network devices over WIFI. Works great and, hopefully, future versions will allow for multiple printers. </li>
</ul>
<ul><strong>NOTE:</strong> Similar to the Gingerbread break, Netflix is defunct on Honeycomb as well. I had hopes (dreams) that 3.1 would fix it, but alas it doesn&#8217;t seem so. Netflix is adamant that a new version is in the works. I hope so. It was great to have mobile movies on my cell phone and the Transformer seems ideal</ul>
<h2>Upgrading to Android Honeycomb 3.1</h2>
<p><a href="http://tiredblogger.files.wordpress.com/2011/06/honeycomb_3-1-580x309.jpg"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;float:right;padding-top:0;border-width:0;margin:10px;" title="honeycomb_3-1-580x309" border="0" alt="honeycomb_3-1-580x309" align="right" src="http://tiredblogger.files.wordpress.com/2011/06/honeycomb_3-1-580x309_thumb.jpg?w=244&#038;h=132" width="244" height="132" /></a>On 10 June 2011, Asus released <a href="http://developer.android.com/sdk/android-3.1-highlights.html" target="_blank">Android Honeycomb 3.1</a> for the Transformer. The official version is v8.4.4.5 (the SKUs are separate by locale).&#160; </p>
<p>There are two options:</p>
<ul>
<li><a href="http://usa.asus.com/Eee/Eee_Pad/Eee_Pad_Transformer_TF101/#download" target="_blank">manually download the update</a> to an SD card and update. </li>
<li>wait for the OTA update (Settings &gt; About Tablet &gt; System Update). </li>
</ul>
<p>I&#8217;m <u><strong>impatient</strong></u>, so I opted for the manual method.&#160; The process was quite simple:</p>
<ol>
<li>Download the 8.4.4.5 zip file from the internet. </li>
<li>On a microSD card create an \asus\update directory and copy the ZIP file into that directory. </li>
<li>Insert the microSD card into the Transformer. You should see a notification that an update is available. </li>
<li>The device will reboot a few times and then be good to go. </li>
</ol>
<p>There are a few highlights to 3.1 (detailed by the release notes) that I really dig:</p>
<ol>
<li>The browser (and any browsers relying on it&#8217;s webkit) now supports NTLM/Windows Authentication. AWESOME for work! </li>
<li>(Most) widgets are now resizable. I&#8217;ve come across a few that won&#8217;t resize. </li>
<li>Speed! 3.1 generally <em>feels</em> faster.&#160; Multitasking across a dozen apps with notifications flying and music playing doesn&#8217;t seem to bother it. </li>
</ol>
<h2>Summary</h2>
<p>With the tablet upgraded to 3.1, the applications that I like, and features that keep impressing me, I think the Transformer will continue to be a great fit. The keyboard matches my dire need to rapidly input information (take notes, respond to emails) and the portability matches my recent need to roam free of wires and surf the web.&#160; </p>
<p>The Transformer is a fantastic bridge between the smallest of laptops and the largest of cell phones and, unfortunately, is what I&#8217;d hoped the <a href="http://tiredblogger.wordpress.com/2010/12/18/cr-48-the-first-twenty-four/" target="_blank">Google Chromebook</a> <strong><u>would have been</u></strong>.&#160; Don&#8217;t get me wrong, I like my Chromebook&#8211;it was free and I like free&#8211;but the Android-based Transformer can actually DO the things I need to do in my day-to-day life.</p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/android/'>Android</a>, <a href='http://tiredblogger.wordpress.com/category/everything-else/'>Everything Else</a>, <a href='http://tiredblogger.wordpress.com/category/hardware-and-software/'>Hardware and Software</a>, <a href='http://tiredblogger.wordpress.com/category/workplace/'>Workplace</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1158/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1158/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1158/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1158&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2011/06/15/review-asus-transformer-tf-101/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/06/img_20110614_215101_thumb.jpg" medium="image">
			<media:title type="html">Photo of the Transformer... and swanky placemat backdrop.</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/06/img_20110613_084907_thumb.jpg" medium="image">
			<media:title type="html">Work Computer Size Comparison</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/06/img_20110615_094528_thumb.jpg" medium="image">
			<media:title type="html">The keyboard dock.</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/06/img_20110611_193622_thumb.jpg" medium="image">
			<media:title type="html">Example Transformer camera image--my back yard.</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/06/honeycomb_3-1-580x309_thumb.jpg" medium="image">
			<media:title type="html">honeycomb_3-1-580x309</media:title>
		</media:content>
	</item>
		<item>
		<title>Dynamically Adding Sub Reports to an ActiveReport</title>
		<link>http://tiredblogger.wordpress.com/2011/04/05/dynamically-adding-sub-reports-to-an-activereport/</link>
		<comments>http://tiredblogger.wordpress.com/2011/04/05/dynamically-adding-sub-reports-to-an-activereport/#comments</comments>
		<pubDate>Tue, 05 Apr 2011 19:31:27 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[ActiveReports]]></category>
		<category><![CDATA[subreports]]></category>

		<guid isPermaLink="false">https://tiredblogger.wordpress.com/?p=1128</guid>
		<description><![CDATA[I&#8217;m currently working on a project where I needed to iterate through a group of users and plug in a little sub report that contains some demographic information and a Code38 barcode. One sub report is easy&#8211;add the control to the page, set the .Report property and away we go; however, adding multiple sub reports [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1128&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m currently working on a project where I needed to iterate through a group of users and plug in a little sub report that contains some demographic information and a Code38 barcode.</p>
<p>One sub report is easy&#8211;add the control to the page, set the .Report property and away we go; however, adding multiple sub reports dynamically and getting the spacing right proved to be a bit challenging.</p>
<p><em><strong>Warning: It &#8220;works on my machine&#8221;.</strong></em></p>
<p>To add controls to your report dynamically, you must use the _ReportStart event of your report.</p>
<p>To address the spacing issue, let&#8217;s start out by specifying our &#8216;base&#8217; top and the height of our sub report.</p>
<p><pre class="brush: csharp;">const float height = 0.605f;
var currentTop = 7.250f;</pre></p>
<p>In my case, I want my sub reports to start at about 7.25&#8243; and be ~0.605&#8243; in height.</p>
<p>The actual creation of the sub report placeholder is fairly standard&#8211;new it up and assign a few properties. I&#8217;ll get into the looping a bit later.</p>
<p><pre class="brush: csharp;">var subReport = new SubReport
{
    CloseBorder = false,
    Height = height,
    Left = 0F,
    Width = 7.5F,
    Top = currentTop,
    Name = person.DisplayName + &quot;_SubReport&quot;,
    ReportName = person.DisplayName + &quot;_SubReport&quot;,
};</pre></p>
<p>Notice how I&#8217;ve set the Top property to be our currentTop variable. Keep that in mind.</p>
<p>The next step is to new up our actual sub report object.  My sub report has two properties on it, each for a data item.  I could pass it along as an object, but it seems a bit overkill for two string properties. After the report object is assigned to our new sub report container, add the container to our details section.</p>
<p><pre class="brush: csharp;">var spReport = new _PersonAssignment()
{
    Name = person.DisplayName,
    EmployeeId = person.EmployeeId
};

subReport.Report = spReport;
this.Sections[&quot;detail&quot;].Controls.Add(subReport);</pre></p>
<p>Because we&#8217;ve assigned it a left, width, and top, our sub report will be added where expected.</p>
<p>The final piece is incrementing the &#8216;top&#8217; to accommodate for the height of the last sub report.</p>
<p><pre class="brush: csharp;">currentTop += height;</pre></p>
<p>Easy.  Now the next sub report will start at 7.250&#8243; + 0.605&#8243; or 7.855&#8243;.  Keep in mind that the 0.605&#8243; includes a bit of whitespace, if you need additional whitespace, pad the height number.</p>
<p>The full _ReportStart event looks like:</p>
<p><pre class="brush: csharp;">const float height = 0.605f;
var currentTop = 7.250f;
foreach (var person in Model.People)
{
    var subReport = new SubReport
    {
        CloseBorder = false,
        Height = height,
        Left = 0F,
        Width = 7.5F,
        Top = currentTop,
        Name = person.DisplayName + &quot;_SubReport&quot;,
        ReportName = person.DisplayName + &quot;_SubReport&quot;,
      };

    var spReport = new _PersonAssignment()
    {
        Name = person.DisplayName,
        EmployeeId = person.EmployeeId
    };

    subReport.Report = spReport;
    this.Sections[&quot;detail&quot;].Controls.Add(subReport);
    currentTop += height;
}</pre></p>
<p>Bingo.</p>
<p><a href="http://tiredblogger.files.wordpress.com/2011/04/4_5_2011-2_23_43-pm1.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border:0;" title="Example of Dynamic Sub Reports" src="http://tiredblogger.files.wordpress.com/2011/04/4_5_2011-2_23_43-pm_thumb1.png?w=906&#038;h=229" border="0" alt="Example of Dynamic Sub Reports" width="906" height="229" /></a></p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/net-35/'>.net 3.5</a>, <a href='http://tiredblogger.wordpress.com/category/c/'>c#</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1128/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1128/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1128/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1128&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2011/04/05/dynamically-adding-sub-reports-to-an-activereport/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/04/4_5_2011-2_23_43-pm_thumb1.png" medium="image">
			<media:title type="html">Example of Dynamic Sub Reports</media:title>
		</media:content>
	</item>
		<item>
		<title>Quick Solution Generation using PowerShell: New-Project</title>
		<link>http://tiredblogger.wordpress.com/2011/02/13/quick-solution-generation-using-powershell-new-project/</link>
		<comments>http://tiredblogger.wordpress.com/2011/02/13/quick-solution-generation-using-powershell-new-project/#comments</comments>
		<pubDate>Sun, 13 Feb 2011 20:07:22 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[.net 4.0]]></category>
		<category><![CDATA[General Development]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">https://tiredblogger.wordpress.com/2011/02/13/quick-solution-generation-using-powershell-new-project/</guid>
		<description><![CDATA[When I have an idea or want to prototype things, I tend to mock it up in Balsamiq, then dig right in and write some specs to see how it&#8217;d work.&#160; Unfortunately deleting the junk Class1.cs in Library projects, the plethora of excess in MVC3 webs, and such tends to be the most time intensive [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1122&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>When I have an idea or want to prototype things, I tend to mock it up in Balsamiq, then dig right in and write some specs to see how it&#8217;d work.&#160; Unfortunately deleting the junk Class1.cs in Library projects, the plethora of excess in MVC3 webs, and such tends to be the most time intensive part of wiring up a quick project in .net.</p>
<p>All that deleting is too many steps&#8211;especially if you&#8217;re developing on the fly with a room of folks. I needed something ala command line to fit my normal workflow:</p>
<ol>
<li>o init-wrap MyProject -git </li>
<li>cd MyProject </li>
<li>git flow init </li>
<li>{something to create projects, solutions, etc} </li>
<li>o init-wrap -all </li>
<li>{spend 5 minutes cleaning up junk files in my way}</li>
</ol>
<h3>Introducing New-Project</h3>
<p>Yes, I know. I&#8217;m not a marketing guru. I don&#8217;t have a cool name for it.&#160; Just a standard PowerShell convention.</p>
<p><strong>Usage:</strong></p>
<p>&#160; <font face="Courier New">-Library { }</font> : Takes a string[] of names for c# class libraries to create.</p>
<p>&#160; <font face="Courier New">-Web { }</font> : Takes a string[] of names for MVC3 web projects to create.</p>
<p>&#160; <font face="Courier New">-Solution &quot;&quot;</font> : Takes a single string for your solution name.</p>
<p><strong>Example:</strong></p>
<p><font face="Courier New">New-Project -Library MyProj.Core, MyProj.Specs -Web MyProj.Web -Solution MyProject</font></p>
<p><a href="http://tiredblogger.files.wordpress.com/2011/02/sitescaffolding.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="SiteScaffolding" border="0" alt="SiteScaffolding" src="http://tiredblogger.files.wordpress.com/2011/02/sitescaffolding_thumb.png?w=456&#038;h=168" width="456" height="168" /></a></p>
<h3>&#160;</h3>
<h3>What does this all do?</h3>
<p>Well, honestly, I&#8217;m not sure how &#8216;reusable&#8217; this is… the projects are pretty tailored.</p>
<p><strong>Libraries</strong></p>
<ul>
<li>Libraries don&#8217;t have the annoying Class1.cs file that you always delete. </li>
<li>AssemblyInfo.cs is updated with the specified Name and Title. </li>
</ul>
<p><strong>MVC3 Webs</strong></p>
<ul>
<li>The web.config is STRIPPED down to the minimal (27 lines). </li>
<li>The folder structure is reorganized (removed unnecessary folders, like Controllers, which I put in libraries, not the web project). </li>
</ul>
<p><strong>Solution</strong></p>
<ul>
<li>This is the only one I&#8217;m actually using the VisualStudio.DTE for&#8211;it makes it super easy to create and add projects into the solution. </li>
</ul>
<h3>But there are other scaffolding systems out there&#8211;why not use them?</h3>
<p>Most of the time, I don&#8217;t need a full system. I don&#8217;t need my objects mapped, views automatically set up, or anything else.&#160; </p>
<p>Start with three empty projects, load up the Specifications project, and start driving out features.&#160; That&#8217;s how it&#8217;s supposed to work, right?&#160; So why would I want to have to pre-fill my projects ahead of time?</p>
<p>&#160;</p>
<h3>What&#8217;s next?</h3>
<ul>
<li>Error catching and handling (it&#8217;s pretty lax right now) </li>
<li>Handle setting up gitflow, openwrap, jQuery, etc. Less typing good! </li>
<li>Something… who knows. <img src='http://s0.wp.com/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' />  </li>
</ul>
<h3>&#160;</h3>
<h3>Where to get it?</h3>
<p>I&#8217;ve tossed it up on github at <a href="https://github.com/drlongnecker/New-Project">https://github.com/drlongnecker/New-Project</a>.&#160; Right now it has the WOMM warranty. </p>
<p><a href="http://tiredblogger.files.wordpress.com/2011/02/6a0120a85dcdae970b0128776ff992970c.png"><img style="background-image:none;padding-left:0;padding-right:0;display:inline;padding-top:0;border-width:0;" title="6a0120a85dcdae970b0128776ff992970c" border="0" alt="6a0120a85dcdae970b0128776ff992970c" src="http://tiredblogger.files.wordpress.com/2011/02/6a0120a85dcdae970b0128776ff992970c_thumb.png?w=200&#038;h=193" width="200" height="193" /></a></p>
<br />Filed under: <a href='http://tiredblogger.wordpress.com/category/net-35/'>.net 3.5</a>, <a href='http://tiredblogger.wordpress.com/category/net-4-0/'>.net 4.0</a>, <a href='http://tiredblogger.wordpress.com/category/general-development/'>General Development</a>, <a href='http://tiredblogger.wordpress.com/category/net-35/mvc/'>MVC</a>, <a href='http://tiredblogger.wordpress.com/category/powershell/'>PowerShell</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/1122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/1122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/1122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/1122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/tiredblogger.wordpress.com/1122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/tiredblogger.wordpress.com/1122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/tiredblogger.wordpress.com/1122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/tiredblogger.wordpress.com/1122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/1122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/1122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/1122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/1122/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/1122/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/1122/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&amp;blog=253870&amp;post=1122&amp;subd=tiredblogger&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2011/02/13/quick-solution-generation-using-powershell-new-project/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/31657c007e961f2f893c8b8ee594754a?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/02/sitescaffolding_thumb.png" medium="image">
			<media:title type="html">SiteScaffolding</media:title>
		</media:content>

		<media:content url="http://tiredblogger.files.wordpress.com/2011/02/6a0120a85dcdae970b0128776ff992970c_thumb.png" medium="image">
			<media:title type="html">6a0120a85dcdae970b0128776ff992970c</media:title>
		</media:content>
	</item>
	</channel>
</rss>
