<?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&#8230;</title>
	<atom:link href="https://tiredblogger.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>https://tiredblogger.wordpress.com</link>
	<description>For an underpaid web architect and overplayed gamer... there is no such thing as sleep.</description>
	<lastBuildDate>Wed, 19 Sep 2012 21:29:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<site xmlns="com-wordpress:feed-additions:1">253870</site><cloud domain='tiredblogger.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>https://s0.wp.com/i/buttonw-com.png</url>
		<title>Ramblings of the Sleepy&#8230;</title>
		<link>https://tiredblogger.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="https://tiredblogger.wordpress.com/osd.xml" title="Ramblings of the Sleepy..." />
	<atom:link rel='hub' href='https://tiredblogger.wordpress.com/?pushpress=hub'/>
	<item>
		<title>Moving to drlongnecker.com!</title>
		<link>https://tiredblogger.wordpress.com/2012/09/19/moving-to-drlongnecker-com/</link>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Wed, 19 Sep 2012 21:29:02 +0000</pubDate>
				<category><![CDATA[Everything Else]]></category>
		<guid isPermaLink="false">http://tiredblogger.wordpress.com/?p=1354</guid>

					<description><![CDATA[I&#8217;m finally taking the time to replace the domain redirect and house my blog, prototype site, and other fun toys over at http://drlongnecker.com. This WordPress blog will remain for link joy and the information it contains (rather than export/import madness). Stop by, say hi, and look forward to new posts coming soon! -david]]></description>
										<content:encoded><![CDATA[<p>I&#8217;m finally taking the time to replace the domain redirect and house my blog, prototype site, and other fun toys over at <a href="http://drlongnecker.com" title="David Longnecker" target="_blank">http://drlongnecker.com</a>.</p>
<p>This WordPress blog will remain for link joy and the information it contains (rather than export/import <strong>madness</strong>).</p>
<p>Stop by, say hi, and look forward to new posts coming soon!</p>
<p><em>-david</em></p>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1354</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>
	</item>
		<item>
		<title>New Adventures Await with @Tracky!</title>
		<link>https://tiredblogger.wordpress.com/2012/05/06/new-adventures-await-with-tracky/</link>
					<comments>https://tiredblogger.wordpress.com/2012/05/06/new-adventures-await-with-tracky/#comments</comments>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Sun, 06 May 2012 18:17:19 +0000</pubDate>
				<category><![CDATA[Everything Else]]></category>
		<category><![CDATA[Workplace]]></category>
		<category><![CDATA[job]]></category>
		<category><![CDATA[tracky]]></category>
		<guid isPermaLink="false">http://tiredblogger.wordpress.com/?p=1343</guid>

					<description><![CDATA[After over a decade with the Wichita Public Schools, I&#8217;m starting a new adventure with fantastic folks at Tracky. I&#8217;m looking forward to the journey and opportunity to work with and learn from a fantastic team. Onward!]]></description>
										<content:encoded><![CDATA[<p>After over a decade with the Wichita Public Schools, I&#8217;m starting a new adventure with fantastic folks at <a href="http://www.tracky.com" title="Tracky - The Open Social Collaboration Platform" target="_blank">Tracky</a>. I&#8217;m looking forward to the journey and opportunity to work with and learn from a fantastic team.</p>
<p>Onward!</p>
<p><a href="https://tracky.com"><img data-attachment-id="1344" data-permalink="https://tiredblogger.wordpress.com/2012/05/06/new-adventures-await-with-tracky/multi-logo-300/" data-orig-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/05/multi-logo-300.png" data-orig-size="300,77" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Tracky Logo" data-image-description="&lt;p&gt;Tracky &amp;#8211; The Open Social Collaboration Platform&lt;/p&gt;
" data-image-caption="&lt;p&gt;Tracky &amp;#8211; The Open Social Collaboration Platform&lt;/p&gt;
" data-medium-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/05/multi-logo-300.png?w=300" data-large-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/05/multi-logo-300.png?w=300" src="https://tiredblogger.wordpress.com/wp-content/uploads/2012/05/multi-logo-300.png?w=595" alt="Tracky - The Open Social Collaboration Platform" title="Tracky Logo"   class="size-full wp-image-1344" srcset="https://tiredblogger.wordpress.com/wp-content/uploads/2012/05/multi-logo-300.png 300w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/05/multi-logo-300.png?w=150&amp;h=39 150w" sizes="(max-width: 300px) 100vw, 300px" /></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://tiredblogger.wordpress.com/2012/05/06/new-adventures-await-with-tracky/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1343</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="https://tiredblogger.wordpress.com/wp-content/uploads/2012/05/multi-logo-300.png" medium="image">
			<media:title type="html">Tracky Logo</media:title>
		</media:content>
	</item>
		<item>
		<title>Mashing CSVs around using PowerShell</title>
		<link>https://tiredblogger.wordpress.com/2012/02/15/mashing-csvs-around-using-powershell/</link>
					<comments>https://tiredblogger.wordpress.com/2012/02/15/mashing-csvs-around-using-powershell/#comments</comments>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Wed, 15 Feb 2012 12:00:33 +0000</pubDate>
				<category><![CDATA[.net 4.0]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[General Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[csv]]></category>
		<category><![CDATA[productivity]]></category>
		<guid isPermaLink="false">http://tiredblogger.wordpress.com/?p=1331</guid>

					<description><![CDATA[Since I spend most of my day in the console, PowerShell also serves as my &#8216;Excel&#8217;. So, continuing my recent trend of PowerShell related posts, let&#8217;s dig into a quick and easy way to parse up CSV files (or most any type of file) by creating objects! We, of course, need a few rows of [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Since I spend most of my day in the console, PowerShell also serves as my &#8216;Excel&#8217;. So, continuing my recent trend of PowerShell related posts, let&#8217;s dig into a quick and easy way to parse up CSV files (or most any type of file) by creating objects!</p>
<p>We, of course, need a few rows of example data. Let&#8217;s use this pseudo student roster.</p>
<p>Example data:</p>
<pre class="brush: plain; title: ; notranslate">
Student,Code,Product,IUID,TSSOC,Date
123456,e11234,Reading,jsmith,0:18,1/4/2012
123456,e11234,Reading,jsmith,1:04,1/4/2012
123456,e11234,Reading,jsmith,0:27,1/5/2012
123456,e11234,Reading,jsmith,0:19,1/7/2012
123456,e11235,Math,jsmith,0:14,1/7/2012
</pre>
<p>Now, for reporting, I want my &#8216;Minutes&#8217; to be a calculation of the TSSOC column (hours:minutes). Easy, we have PowerShell&#8211;it can split AND multiple!</p>
<p>The code:</p>
<p>Begin by creating an empty array to hold our output, importing our data into the &#8216;pipe&#8217;, and opening up an iteration (for each) function. The final $out is our return value&#8211;calling our array so we can see our results.</p>
<pre class="brush: powershell; title: ; notranslate">
$out = @()
import-csv data_example.csv |
   % {

   }
$out
</pre>
<p>Next, let&#8217;s add in our logic to split out the hours and minutes. We have full access to the .NET string methods in PowerShell, which includes .Split(). .Split() returns an array, so since we have HH:MM, our first number is our hours and our second number is our minutes. Hours then need to be multiplied by 60 to return the &#8220;minutes per hour.&#8221;</p>
<p>You&#8217;ll also notice the [int] casting&#8211;this ensures we can properly multiply&#8211;give it a whirl without and you&#8217;ll get 60 0&#8217;s or 1&#8217;s back (it multiples the string).</p>
<pre class="brush: powershell; title: ; notranslate">
$out = @()
import-csv data_example.csv |
   % {
	$hours = [int]$_.TSSOC.Split(':')[0] * 60
	$minutes = [int]$_.TSSOC.Split(':')[1]
   }
$out
</pre>
<p>The next step is to create a new object to contain our return values. We can use the new PowerShell v2.0 syntax to create a quick hashtable of our properties and values. Once we have our item, add it to our $out array.</p>
<pre class="brush: powershell; title: ; notranslate">
$out = @()
import-csv data_example.csv |
   % {
	$hours = [int]$_.TSSOC.Split(':')[0] * 60
	$minutes = [int]$_.TSSOC.Split(':')[1]
        $item = new-object PSObject -Property @{
			Date=$_.Date;
			Minutes=($hours + $minutes);
			UserId=$_.IUID;
			StudentId=$_.Student;
			Code=$_.Code;
			Course=$_.Product
		}
	$out = $out + $item
   }
</pre>
<p>With that, we&#8217;re done, we can pipe it to an orderby for a bit of sorting, grouping, table formatting, or even export it BACK out as another CSV.</p>
<pre class="brush: powershell; title: ; notranslate">
$out = @()
import-csv data_example.csv |
   % {
	$hours = [int]$_.TSSOC.Split(':')[0] * 60
	$minutes = [int]$_.TSSOC.Split(':')[1]
        $item = new-object PSObject -Property @{
			Date=$_.Date;
			Minutes=($hours + $minutes);
			UserId=$_.IUID;
			StudentId=$_.Student;
			Code=$_.Code;
			Course=$_.Product
		}
	$out = $out + $item
   } | sortby Date, Code
$out | ft -a
</pre>
<p>Quick and dirty CSV manipulation&#8211;all without opening anything but the command prompt!</p>
<p><a href="https://tiredblogger.wordpress.com/wp-content/uploads/2012/02/screenshot-2_10_2012-7_50_16-pm.png"><img data-attachment-id="1334" data-permalink="https://tiredblogger.wordpress.com/2012/02/15/mashing-csvs-around-using-powershell/screenshot-2_10_2012-7_50_16-pm/" data-orig-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/02/screenshot-2_10_2012-7_50_16-pm.png" data-orig-size="404,145" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Our CSV Format Table Result" data-image-description="" data-image-caption="" data-medium-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/02/screenshot-2_10_2012-7_50_16-pm.png?w=300" data-large-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/02/screenshot-2_10_2012-7_50_16-pm.png?w=404" class="alignleftsize-full wp-image-1334" title="Our CSV Format Table Result" src="https://tiredblogger.wordpress.com/wp-content/uploads/2012/02/screenshot-2_10_2012-7_50_16-pm.png?w=595" alt=""   srcset="https://tiredblogger.wordpress.com/wp-content/uploads/2012/02/screenshot-2_10_2012-7_50_16-pm.png 404w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/02/screenshot-2_10_2012-7_50_16-pm.png?w=150&amp;h=54 150w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/02/screenshot-2_10_2012-7_50_16-pm.png?w=300&amp;h=108 300w" sizes="(max-width: 404px) 100vw, 404px" /></a></p>
<p><strong>UPDATE:</strong> Matt has an excellent point in the comments below. PowerShell isn&#8217;t the &#8216;golden hammer&#8217; for every task and finding the right tool for the job. We&#8217;re a mixed environment (Windows, Solaris, RHEL, Ubuntu), so PowerShell only applies to our Windows boxes. However, as a .net developer, I spend 80-90% of my time <strong>on</strong> those Windows boxes. So let&#8217;s say it&#8217;s a silver hammer. <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Now, the code in this post looks pretty long&#8211;and hopping back and forth between notepad, the CLI, and your CSV is tiresome. I bounce back and forth between the CLI and notepad2 with the &#8216;ed&#8217; and &#8216;ex&#8217; functions (these commands are &#8216;borrowed&#8217; from Oracle PL/SQL). More information <a href="https://tiredblogger.wordpress.com/2009/11/09/powershell-recreating-sqlplus-ed-command/" target="_blank">here</a>.</p>
<p>So how would I type this if my boss ran into my cube with a CSV and needed a count of Minutes?</p>
<pre class="brush: powershell; title: ; notranslate">
$out=@();Import-Csv data_example.csv | % { $out += (new-object psobject -prop @{ Date=$_.Date;Minutes=[int]$_.TSSOC.Split(':')[1]+([int]$_.TSSOC.Split(':')[0]*60);UserId=$_.IUID;StudentId=$_.Student;Code=$_.Code;Course=$_.Product }) }; $out | ft -a
</pre>
<p>Now, that&#8217;s quicker to type, but a LOT harder to explain. <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> I&#8217;m sure this can be simplified down&#8211;any suggestions? If you could do automatic/implied property names, that&#8217;d REALLY cut it down.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tiredblogger.wordpress.com/2012/02/15/mashing-csvs-around-using-powershell/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1331</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="https://tiredblogger.wordpress.com/wp-content/uploads/2012/02/screenshot-2_10_2012-7_50_16-pm.png" medium="image">
			<media:title type="html">Our CSV Format Table Result</media:title>
		</media:content>
	</item>
		<item>
		<title>The Post-Certification Era?</title>
		<link>https://tiredblogger.wordpress.com/2012/02/13/the-post-certification-era/</link>
					<comments>https://tiredblogger.wordpress.com/2012/02/13/the-post-certification-era/#comments</comments>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Mon, 13 Feb 2012 12:00:37 +0000</pubDate>
				<category><![CDATA[Education]]></category>
		<category><![CDATA[Enterprise Architecture]]></category>
		<category><![CDATA[General Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[Standards]]></category>
		<category><![CDATA[Workplace]]></category>
		<category><![CDATA[certification]]></category>
		<category><![CDATA[developer]]></category>
		<category><![CDATA[education]]></category>
		<category><![CDATA[training]]></category>
		<guid isPermaLink="false">http://tiredblogger.wordpress.com/?p=1311</guid>

					<description><![CDATA[Oh look, starting off with a disclaimer. This should be good! These are patterns I&#8217;ve noticed in our organization over the past ten years&#8211;ranging from hardware to software to development technical staff. These are my observations, experiences with recruiting, and a good dash of my opinions. I&#8217;m certain there are exceptions. If you&#8217;re an exception, you get [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>Oh look, starting off with a <span style="color:#ff0000;"><strong>disclaimer</strong></span>. This should be good!</p>
<blockquote><p>These are patterns I&#8217;ve noticed in <strong><span style="text-decoration:underline;">our</span></strong> organization over the past ten years&#8211;ranging from hardware to software to development technical staff. These are my observations, experiences with recruiting, and a good dash of my opinions. I&#8217;m certain there are exceptions. If you&#8217;re an exception, you get a cookie. <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>This isn&#8217;t specifically focused on Microsoft&#8217;s certifications. We&#8217;re a .NET shop, but we&#8217;re also an Oracle shop, a Solaris shop, and a RHEL shop. So many certification opportunities, so little training dollars.</p>
<p>Finally, I&#8217;ll also throw out that I have a few certifications. When I made my living as a full-time consultant and contractor and was just getting started, they were the right thing to do (read on for why). Years later &#8230; things have changed.</p></blockquote>
<h2>Evaluating The Post-Certification Era</h2>
<p>In today&#8217;s development ecosystem, certifications seem play a nearly unmentionable role outside of college recruitment offices and general practice consulting agencies. While certifications provide a baseline for those just entering the field, I rarely see established developers (read: &gt;~2 years experience) heading out to the courseware to seek a new certification.</p>
<p><strong>Primary reasons for certifications: entry into the field and “saleability”.</strong><br />
Entry into the field &#8211; provides a similar baseline to compare candidates for entry-level positions.</p>
<p style="padding-left:30px;" dir="ltr"><strong>Example</strong>: An entry-level developer vs. hiring an experienced enterprise architect. For an entry-level developer, a certification usually provides a baseline of skills.</p>
<p style="padding-left:30px;" dir="ltr">For an experienced architect, however, past project experience, core understanding of architecture practices, examples of work in open source communities, and scenario-based knowledge provides the best gauge of skills.</p>
<p>“Saleability” of certifications for consulting agencies allows “one upping” other organizations, but usually lack the actual real-world skills necessary for implementation.</p>
<p style="padding-left:30px;" dir="ltr"><strong>Example</strong>: We had a couple of fiascos years back with a very reputable consulting company filled with certified developers, but simply couldn&#8217;t wrap those skills into a finished product. We managed to bring the project back in-house and get our customers squared away, but it broke the working relationship we had with that consulting company.</p>
<p><strong>Certifications provide a baseline for experience and expertise similar to college degrees.</strong><br />
Like in college, being able to cram and pass a certification test is a poor indicator (or replacement) for handling real-life situations.</p>
<p style="padding-left:30px;" dir="ltr"><strong>Example</strong>: Many certification “crammers” and boot camps are available for a fee&#8211;rapid memorization and passing of tests.  I do not believe that these prepare you for actual situations AND do not prepare you to continue to expand your knowledge base.</p>
<p><strong>Certifications are outdated before they’re even released.</strong><br />
Test-makers and publishers cannot keep up with technology at it’s current pace. The current core Microsoft certifications focus on v2.0 technologies (though are slowly being updated to 4.0). </p>
<p>I&#8217;m sure it&#8217;s a game of tag between the DivDev and Training teams up in Redmond. We, as developers, push for new features faster, but the courseware can only be written/edited/reviewed/approved so quickly.</p>
<p>In addition, almost all of our current, production applications are <em>.NET applications</em>; however, a great deal of functionality is derived from open-source and community-driven projects that go beyond the scope of a Microsoft certification.</p>
<p><strong>Certifications do not account for today’s open-source/community environment.</strong><br />
A single “Microsoft” certification does not cover a large majority of the programming practices and tools used in modern development.</p>
<p>Looking beyond Microsoft allows us the flexibility to find the right tool/technology for the task. In nearly every case, these alternatives provide a cost savings to the district.</p>
<p style="padding-left:30px;" dir="ltr"><strong>Example</strong>: Many sites that we develop now feature non-Microsoft &#8216;tools&#8217; from the ground up.</p>
<p style="padding-left:30px;" dir="ltr">
<ul>
<li>web engine: FubuMVC, OpenRasta, ASP.NET MVC</li>
<li>view engine: Spark, HAML</li>
<li>dependency injection/management: StructureMap, Ninject, Cassette</li>
<li>source control: git, hg</li>
<li>data storage: NHibernate, RavenDB, MySQL</li>
<li>testing: TeamCity, MSpec, Moq, Jasmine</li>
<li>tooling: PowerShell, rake</li>
</ul>
<p>This doesn&#8217;t even take into consideration the extensive use of client-side programming technologies, such as JavaScript.</p>
<p>A more personal example: I&#8217;ve used NHibernate/FluentNHibernate for years now. Fluent mappings, auto mappings, insane conventions and more fill my day-to-day data modeling. NH meets our needs in spades and, since many of our objects talk to vendor views and Oracle objects, Entity Framework doesn&#8217;t meet our needs. If I wanted our team to dig into the Microsoft certification path, we&#8217;d have to dig into Entity Framework. <em>Why would I want to waste everyone&#8217;s time?</em></p>
<p>This same question applies to many of the plug-and-go features of .NET, especially since most certification examples focus on arcane things that most folks would look up in a time of crisis anyway and not on the <em>meat and potatoes</em> of daily tasks.</p>
<p><strong>Certifications do not account for the current scope of modern development languages.</strong><br />
Being able to determine an integer from a string and when to call a certain method crosses language and vendor boundaries.  A typical Student Achievement project contains anywhere from three to six <em>different</em> languages&#8211;only one of those being a Microsoft-based language.</p>
<p>Whether it’s Microsoft’s C#, Sun’s Java, JavaScript, Ruby, or any number of scripting languages implemented in our department&#8211;there are ubiquitous core skills to cultivate.</p>
<h2>Cultivating the Post-Certification Developer</h2>
<p>In a &#8220;Google age&#8221;, knowing <strong>how</strong> and <strong>why</strong> components optimally fit together provides far more value than syntax and memorization. If someone needs a code syntax explanation, a quick search reveals the answer. For something more destructive, such as modifications to our Solaris servers, I&#8217;d PREFER our techs look up the syntax&#8211;especially if it&#8217;s something they do once a decade. There are no heroes when a backwards bash flag formats an array. <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<p>Within small development shops, such as ours, a large percentage of <em>development value-added skills</em> lie in enterprise architecture, domain expertise, and understanding design patterns&#8211;typical skills not covered on technology certification exams.</p>
<p>Rather than focusing on outdated technologies and unused skills, a modern developer and development organization can best be &#8216;grown&#8217; by an active community involvement.  Active community involvement provides a post-certification developer with several learning tools:</p>
<p><strong>Participating in open-source projects</strong> allows the developer to observe, comment, and learn from other professional developers using modern tools and technologies.</p>
<p style="padding-left:30px;" dir="ltr"><strong>Example</strong>: Submitting a code example to an open source project where a dozen developers pick it apart and, if necessary, provide feedback on better coding techniques.</p>
<p><strong>Developing a social network of professional developers </strong>provides an instant feedback loop for ideas, new technologies, and best practices. Blogging, and reading blogs, allows a developer to cultivate their programming skill set with a world-wide echo chamber.</p>
<p style="padding-left:30px;" dir="ltr"><strong>Example</strong>: A simple message on Twitter about an error in a technology released that day can garner instant feedback from a project manager at that company, prompting email exchanges, telephone calls, and the necessary steps to resolve the problem directly from the developer who implemented the feature in the new technology.</p>
<p><strong>Participating in community-driven events </strong>such as webinars/webcasts, user groups, and open space discussions. These groups bolster existing social networks and provide knowledge transfer of best practices and patterns on current subjects as well as provide networking opportunities with peers in the field.</p>
<p style="padding-left:30px;" dir="ltr"><strong>Example</strong>: Community-driven events provide both a medium to learn and a medium to give back to the community through talks and online sessions.  This helps build both a mentoring mentality in developers as well as a drive to fully understand the inner-workings of each technology.</p>
<h2>Summary</h2>
<p>While certifications can provide a bit of value&#8211;especially getting your foot in the door, I don&#8217;t see many on the resumes coming across my desk these days. Most, especially the younger crowd, flaunt their open source projects, hacks, and adventures with &#8216;technology X&#8217; as a badge of achievement rather than certifications. In our shop and hiring process, that works out well. I doubt it&#8217;s the same everywhere.</p>
<p>Looking past certifications in &#8216;technology X&#8217; to long-term development value-added skills adds more bang to the resume, and the individual, than any finite-lived piece of paper.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tiredblogger.wordpress.com/2012/02/13/the-post-certification-era/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1311</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>
	</item>
		<item>
		<title>DeployTo &#8211; a simple PowerShell web deployment script</title>
		<link>https://tiredblogger.wordpress.com/2012/02/10/deployto-a-simple-powershell-web-deployment-script/</link>
					<comments>https://tiredblogger.wordpress.com/2012/02/10/deployto-a-simple-powershell-web-deployment-script/#comments</comments>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Fri, 10 Feb 2012 17:13:55 +0000</pubDate>
				<category><![CDATA[Git]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[psake]]></category>
		<category><![CDATA[TeamCity]]></category>
		<category><![CDATA[aspnet]]></category>
		<category><![CDATA[ci]]></category>
		<category><![CDATA[deployment]]></category>
		<category><![CDATA[teamcity]]></category>
		<guid isPermaLink="false">http://tiredblogger.wordpress.com/?p=1300</guid>

					<description><![CDATA[We&#8217;re constantly working to standardize how builds get pushed out to our development, UAT, and production servers. The typical &#8216;order of operations&#8217; includes: compile the build backup the existing deployment copy the new deployment celebrate Pretty simple, but with a few moving parts (git push, TeamCity pulls in, compiles, runs deployment procedures, IIS (hopefully) doesn&#8217;t [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>We&#8217;re constantly working to standardize how builds get pushed out to our development, UAT, and production servers. The typical &#8216;order of operations&#8217; includes:</p>
<ol>
<li>compile the build</li>
<li>backup the existing deployment</li>
<li>copy the new deployment</li>
<li>celebrate</li>
</ol>
<p>Pretty simple, but with a few moving parts (git push, TeamCity pulls in, compiles, runs deployment procedures, IIS (hopefully) doesn&#8217;t explode).</p>
<p>One step to standardize this has been to add these steps into our <a title="psake - best build automation tool ever" href="https://github.com/psake/psake" target="_blank">psake</a> scripts, but that got tiring (and dangerous when we found a flaw).  When in doubt, refactor!</p>
<h2>First, get the codez!</h2>
<p><a href="https://gist.github.com/1790661" title="DeployTo.ps1 gist" target="_blank">DeployTo.ps1</a> and an <a href="https://gist.github.com/1790678" title="settings.xml gist" target="_blank">example settings.xml</a> file.</p>
<h3>Creating a simple deployment tool &#8211; DeployTo</h3>
<p>The PowerShell file, <a title="DeployTo.ps1 - the codez!" href="https://gist.github.com/1790661" target="_blank">DeployTo.ps1</a>, should be located in your project, your PATH, or wherever your CI server can find it&#8211;I tend to include it in a folder we have that synchronizes to ALL of our build servers automatically via Live Mesh. You could include it with your project to ensure dependencies are always met (for public projects).</p>
<p>DeployTo has one expectation, that a settings.xml file (or file passed in the Settings argument) will contain a breakdown of your deployment paths.</p>
<p>Example:</p>
<pre class="brush: xml; title: ; notranslate">
&lt;site&gt;
    &lt;name&gt;development&lt;/name&gt;
    &lt;path&gt;\\server\webs\path&lt;/path&gt;
&lt;/site&gt;
</pre>
<p>With names and paths in hand, DeployTo sets about to match the passed in deployment location to what exists in the file. If one is found, it proceeds with the backup and deployment process.</p>
<p>Calling DeployTo is as simple as:</p>
<pre class="brush: plain; title: ; notranslate">
deployto development
</pre>
<p>Now, looping through our settings.xml file looking for &#8216;deployment&#8217;:</p>
<pre class="brush: powershell; title: ; notranslate">
foreach ($site in $xml.settings.site) {
    if ($site.name.ToLower() -eq $deploy.ToLower()) {
        writeMessage (&quot;Found deployment plan for {0} -&gt; {1}.&quot; -f $site.name, $site.path)
	if ($SkipBackup -eq $false) {
	    backup($site)
	}
	deploy($site)
	$success = $true
	break;
    }
}
</pre>
<p>The output also lets us know what&#8217;s happening (and is helpful for diagnosing issues in your CI&#8217;s build logs).</p>
<pre class="brush: plain; title: ; notranslate">
Deploying to DEVELOPMENT
Reading settings file at settings.xml.
Testing release path at .\release.
Found deployment plan for development -&gt; \\server\site.
Making backup of 255 file(s) at \\server\site to \\server\site-2012-02-10-105321.
Backup succeeded.
Removing existing files at \\server\site.
Copying new release to \\server\site.
Deployment succeeded.
SUCCESS!
</pre>
<h3>Backing up &#8211; A safety net when things go awry.</h3>
<p>Your builds NEVER go bad, right? Deployments work 100% of the time? Right? Sure. <img src="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /> No matter how many staging sites you test on, things can go back on a deployment. That&#8217;s why we have BACKUPS. I could get fancy and .7z/.gzip up the files and such, but a simple directory copy serves exactly what <strong>I</strong> need.</p>
<p>The backup function itself is quite simple&#8211;take a list directory of files, copy it into a new directory with the directory name + current date/time.</p>
<pre class="brush: powershell; title: ; notranslate">
function backup($site) {
try {
    $currentDate = (Get-Date).ToString(&quot;yyyy-MM-dd-HHmmss&quot;);
    $backupPath = $site.path + &quot;-&quot; + $currentDate;

    $originalCount = (gci -recurse $site.path).count

    writeMessage (&quot;Making backup of {0} file(s) at {1} to {2}.&quot; -f $originalCount, $site.path, $backupPath)
    
    # do the actual file copy, but ignore the thumbs.db file. It's such a horrid little file.
    cp -recurse -exclude thumbs.db $site.path $backupPath

    $backupCount = (gci -recurse $backupPath).count	

    if ($originalCount -ne $backupCount) {
      writeError (&quot;Backup failed; attempted to copy {0} file(s) and only copied {1} file(s).&quot; -f $originalCount, $backupCount)
    }
    else {
      writeSuccess (&quot;Backup succeeded.&quot;)
    }
}
catch
{
    writeError (&quot;Could not complete backup. EXCEPTION: {1}&quot; -f $_)
}
}
</pre>
<h3>Deploying &#8212; copying files, plain and simple</h3>
<p>Someday, I may have the need to be fancy. Since IIS automatically boots itself when a new web.config is added, I don&#8217;t have any &#8216;logic&#8217; to my deployment scripts. We also, for now, keep our database deployments separate from our web view deployments. For now, deploying is copying files; however, who wants to do that by hand? Not me.</p>
<pre class="brush: powershell; title: ; notranslate">
function deploy($site) {
try {
    writeMessage (&quot;Removing existing files at {0}.&quot; -f $site.path)

    # force, because thumbs.db is annoying
    rm -force -recurse $site.path

    writeMessage (&quot;Copying new release to {0}.&quot; -f $site.path)

    cp -recurse -exclude thumbs.db  $releaseDirectory $site.path
    $originalCount = (gci -recurse $releaseDirectory).count
    $siteCount = (gci -recurse $site.path).count
    
    if ($originalCount -ne $siteCount)
    {
      writeError ( &quot;Deployment failed; attempted to copy {0} file(s) and only copied {1} file(s).&quot; -f $originalCount, $siteCount)
    }
    else {
      writeSuccess (&quot;Deployment succeeded.&quot;)
    }
}
catch {
    writeError (&quot;Could not deploy. EXCEPTION: {1}&quot; -f $_)
}
}
</pre>
<p>That&#8217;s it.</p>
<p>Once thing you&#8217;ll notice in both scripts is I am doing a bit of monitoring and testing.</p>
<ul>
<li>Do paths exist before we begin the process?</li>
<li>Do the backed up/copied/original file counts match?</li>
<li>Did anything else go awry so we can throw a general error?</li>
</ul>
<p>It&#8217;s a work in progress, but has met our needs quite well over the past several months with psake and TeamCity.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://tiredblogger.wordpress.com/2012/02/10/deployto-a-simple-powershell-web-deployment-script/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1300</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>
	</item>
		<item>
		<title>NuGet Package Restore, Multiple Repositories, and CI Servers</title>
		<link>https://tiredblogger.wordpress.com/2012/01/20/nuget-package-restore-multiple-repositories-and-ci-servers/</link>
					<comments>https://tiredblogger.wordpress.com/2012/01/20/nuget-package-restore-multiple-repositories-and-ci-servers/#comments</comments>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Sat, 21 Jan 2012 04:41:36 +0000</pubDate>
				<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 [&#8230;]]]></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="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/work-5542900-1-sticker375x360.png"><img data-attachment-id="1293" data-permalink="https://tiredblogger.wordpress.com/2012/01/20/nuget-package-restore-multiple-repositories-and-ci-servers/work-5542900-1-sticker375x360/" data-orig-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/work-5542900-1-sticker375x360.png" data-orig-size="375,360" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Boom!" data-image-description="" data-image-caption="" data-medium-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/work-5542900-1-sticker375x360.png?w=300" data-large-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/work-5542900-1-sticker375x360.png?w=375" class="alignright  wp-image-1293" title="Boom!" src="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/work-5542900-1-sticker375x360.png?w=180&#038;h=173" alt="Boom!" width="180" height="173" srcset="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/work-5542900-1-sticker375x360.png?w=300 300w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/work-5542900-1-sticker375x360.png?w=180 180w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/work-5542900-1-sticker375x360.png?w=360 360w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/work-5542900-1-sticker375x360.png?w=150 150w" sizes="(max-width: 180px) 100vw, 180px" /></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>
<pre class="brush: xml; title: ; notranslate">
&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>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="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></strong></p>
]]></content:encoded>
					
					<wfw:commentRss>https://tiredblogger.wordpress.com/2012/01/20/nuget-package-restore-multiple-repositories-and-ci-servers/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1288</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="https://tiredblogger.wordpress.com/wp-content/uploads/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>https://tiredblogger.wordpress.com/2012/01/17/workaround-oracle-nhibernate-and-createsqlquery-not-working/</link>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Wed, 18 Jan 2012 03:25:38 +0000</pubDate>
				<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. [&#8230;]]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" data-attachment-id="1273" data-permalink="https://tiredblogger.wordpress.com/2012/01/17/workaround-oracle-nhibernate-and-createsqlquery-not-working/6a0120a85dcdae970b0128776ff992970c/" data-orig-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/6a0120a85dcdae970b0128776ff992970c.png" data-orig-size="200,193" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Works On My Machine!" data-image-description="" data-image-caption="" data-medium-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/6a0120a85dcdae970b0128776ff992970c.png?w=200" data-large-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/6a0120a85dcdae970b0128776ff992970c.png?w=200" class="size-full wp-image-1273 alignright" title="Works On My Machine!" src="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/6a0120a85dcdae970b0128776ff992970c.png?w=595" alt=""   srcset="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/6a0120a85dcdae970b0128776ff992970c.png 200w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/6a0120a85dcdae970b0128776ff992970c.png?w=150&amp;h=145 150w" sizes="(max-width: 200px) 100vw, 200px" /></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="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f609.png" alt="😉" class="wp-smiley" style="height: 1em; max-height: 1em;" /></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>
<pre class="brush: csharp; title: ; notranslate">
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>Inside <strong>TransformTuple</strong>, I then call on <strong>_fields</strong> rather than the <strong>aliases</strong> constructor parameter.</p>
<pre class="brush: csharp; title: ; notranslate">
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>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>
<pre class="brush: csharp; title: ; notranslate">

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>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>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1260</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="https://tiredblogger.wordpress.com/wp-content/uploads/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>https://tiredblogger.wordpress.com/2012/01/16/posting-to-campfire-using-powershell-and-curl/</link>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Mon, 16 Jan 2012 19:00:58 +0000</pubDate>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Server]]></category>
		<category><![CDATA[campfire]]></category>
		<guid isPermaLink="false">http://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 [&#8230;]]]></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>
<pre class="brush: powershell; title: ; notranslate">
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>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>
<pre class="brush: powershell; title: ; notranslate">
$authToken = &quot;YOUR AUTH TOKEN&quot;
$postUrl = &quot;https://YOURDOMAIN.campfirenow.com/room/{0}/speak.json&quot; -f $RoomNumber
</pre>
<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="https://s0.wp.com/wp-content/mu-plugins/wpcom-smileys/twemoji/2/72x72/1f642.png" alt="🙂" class="wp-smiley" style="height: 1em; max-height: 1em;" /></p>
<pre class="brush: powershell; title: ; notranslate">
$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>
<div data-shortcode="caption" id="attachment_1255" style="width: 610px" class="wp-caption alignnone"><a href="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_13_09-pm.png"><img aria-describedby="caption-attachment-1255" loading="lazy" data-attachment-id="1255" data-permalink="https://tiredblogger.wordpress.com/2012/01/16/posting-to-campfire-using-powershell-and-curl/screenshot-1_16_2012-1_13_09-pm/" data-orig-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_13_09-pm.png" data-orig-size="656,107" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Running SendTo-CampFire" data-image-description="" data-image-caption="&lt;p&gt;Running SendTo-Campfire with Feedback&lt;/p&gt;
" data-medium-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_13_09-pm.png?w=300" data-large-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_13_09-pm.png?w=595" src="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_13_09-pm.png?w=595" alt="Running SendTo-CampFire" title="Running SendTo-CampFire"   class="size-full wp-image-1255" srcset="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_13_09-pm.png?w=600&amp;h=98 600w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_13_09-pm.png?w=150&amp;h=24 150w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_13_09-pm.png?w=300&amp;h=49 300w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_13_09-pm.png 656w" sizes="(max-width: 600px) 100vw, 600px" /></a><p id="caption-attachment-1255" class="wp-caption-text">Running SendTo-Campfire with Feedback</p></div>
<p>Indeed, there be success!</p>
<div data-shortcode="caption" id="attachment_1257" style="width: 278px" class="wp-caption alignnone"><a href="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_15_42-pm.png"><img aria-describedby="caption-attachment-1257" loading="lazy" data-attachment-id="1257" data-permalink="https://tiredblogger.wordpress.com/2012/01/16/posting-to-campfire-using-powershell-and-curl/screenshot-1_16_2012-1_15_42-pm/" data-orig-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_15_42-pm.png" data-orig-size="268,131" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Success!" data-image-description="" data-image-caption="&lt;p&gt;Success!&lt;/p&gt;
" data-medium-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_15_42-pm.png?w=268" data-large-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_15_42-pm.png?w=268" src="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_15_42-pm.png?w=595" alt="Success!" title="Success!"   class="size-full wp-image-1257" srcset="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_15_42-pm.png 268w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/screenshot-1_16_2012-1_15_42-pm.png?w=150&amp;h=73 150w" sizes="(max-width: 268px) 100vw, 268px" /></a><p id="caption-attachment-1257" 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>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1249</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="https://tiredblogger.wordpress.com/wp-content/uploads/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="https://tiredblogger.wordpress.com/wp-content/uploads/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>https://tiredblogger.wordpress.com/2012/01/13/changing-default-printers-by-network-subnet/</link>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Fri, 13 Jan 2012 15:18:23 +0000</pubDate>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[printers]]></category>
		<category><![CDATA[windows7]]></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 [&#8230;]]]></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 data-shortcode="caption" id="attachment_1240" style="width: 353px" class="wp-caption alignnone"><a href="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/1_13_2012-9_11_54-am.png"><img aria-describedby="caption-attachment-1240" loading="lazy" data-attachment-id="1240" data-permalink="https://tiredblogger.wordpress.com/2012/01/13/changing-default-printers-by-network-subnet/1_13_2012-9_11_54-am/" data-orig-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/1_13_2012-9_11_54-am.png" data-orig-size="343,88" data-comments-opened="1" data-image-meta="{&quot;aperture&quot;:&quot;0&quot;,&quot;credit&quot;:&quot;&quot;,&quot;camera&quot;:&quot;&quot;,&quot;caption&quot;:&quot;&quot;,&quot;created_timestamp&quot;:&quot;0&quot;,&quot;copyright&quot;:&quot;&quot;,&quot;focal_length&quot;:&quot;0&quot;,&quot;iso&quot;:&quot;0&quot;,&quot;shutter_speed&quot;:&quot;0&quot;,&quot;title&quot;:&quot;&quot;}" data-image-title="Set-PrinterByLocation in action!" data-image-description="" data-image-caption="&lt;p&gt;Set-PrinterByLocation in action!&lt;/p&gt;
" data-medium-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/1_13_2012-9_11_54-am.png?w=300" data-large-file="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/1_13_2012-9_11_54-am.png?w=343" class="size-full wp-image-1240 " title="Set-PrinterByLocation in action!" src="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/1_13_2012-9_11_54-am.png?w=595" alt="Set-PrinterByLocation in action!"   srcset="https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/1_13_2012-9_11_54-am.png 343w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/1_13_2012-9_11_54-am.png?w=150&amp;h=38 150w, https://tiredblogger.wordpress.com/wp-content/uploads/2012/01/1_13_2012-9_11_54-am.png?w=300&amp;h=77 300w" sizes="(max-width: 343px) 100vw, 343px" /></a><p id="caption-attachment-1240" 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>
<pre class="brush: powershell; title: ; notranslate">
$homeNet = &quot;10.1.4.*&quot;, &quot;OfficePrinter&quot;
$remoteNet = &quot;10.1.6.*&quot;, &quot;W382_HP_Printer&quot;
</pre>
<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>
<pre class="brush: powershell; title: ; notranslate">
$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>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>
<pre class="brush: powershell; title: ; notranslate">
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>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>
<pre class="brush: powershell; title: ; notranslate">
$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>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1239</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>

		<media:content url="https://tiredblogger.wordpress.com/wp-content/uploads/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>https://tiredblogger.wordpress.com/2012/01/03/using-spark-conditionals-to-toggle-css-and-javascript/</link>
		
		<dc:creator><![CDATA[David Longnecker]]></dc:creator>
		<pubDate>Wed, 04 Jan 2012 01:57:06 +0000</pubDate>
				<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">http://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 [&#8230;]]]></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>
<pre class="brush: css; auto-links: false; gutter: false; html-script: true; pad-line-numbers: true; title: ; toolbar: true; notranslate">
&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>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>
]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1230</post-id>
		<media:content url="https://0.gravatar.com/avatar/c42f7f087a65a47f2024d0d2e9efdb1cf45bec3f9b3d0acdd0c8003e056cf916?s=96&#38;d=identicon&#38;r=G" medium="image">
			<media:title type="html">drlongnecker</media:title>
		</media:content>
	</item>
	</channel>
</rss>
