<?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: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>Mon, 09 Nov 2009 21:19:14 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<cloud domain='tiredblogger.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://www.gravatar.com/blavatar/e87df6e5b075c4485671acebd012921a?s=96&#038;d=http://s.wordpress.com/i/buttonw-com.png</url>
		<title>Ramblings of the Sleepy...</title>
		<link>http://tiredblogger.wordpress.com</link>
	</image>
			<item>
		<title>Creating Local Git Repositories &#8211; Yeah, it&#8217;s that simple!</title>
		<link>http://tiredblogger.wordpress.com/2009/11/09/creating-local-git-repositories-yeah-its-that-simple/</link>
		<comments>http://tiredblogger.wordpress.com/2009/11/09/creating-local-git-repositories-yeah-its-that-simple/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 21:19:10 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[General Development]]></category>
		<category><![CDATA[Git]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Workplace]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/11/09/creating-local-git-repositories-yeah-its-that-simple/</guid>
		<description><![CDATA[We&#8217;re in the process of evaluating several source control systems here at the office.&#160; It&#8217;s a JOYOUS experience and I mean that&#8230; sorta.&#160; Currently, we have a montage of files dumped into two SourceSafe repos.
At this point, most of you are either laughing, crying, or have closed your web browser so you don&#8217;t get caught [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=996&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p style="margin-right:0;" dir="ltr">We&rsquo;re in the process of evaluating several source control systems here at the office.&nbsp; It&rsquo;s a JOYOUS experience and I mean that&hellip; sorta.&nbsp; Currently, we have a montage of files dumped into two SourceSafe repos.</p>
<p style="margin-right:0;" dir="ltr">At this point, most of you are either laughing, crying, or have closed your web browser so you don&rsquo;t get caught reading something with the word &lsquo;SourceSafe&rsquo; in it.&nbsp; That&rsquo;s cool, I get that.</p>
<p style="margin-right:0;" dir="ltr">As part of my demonstrations (for the various toolings we&rsquo;re looking at), I wanted to show how simple it was to create a local GIT repository.</p>
<p style="margin-right:0;" dir="ltr">Since I&rsquo;m discussing &lsquo;local&rsquo;, I&rsquo;m taking a lot of things out of the picture.</p>
<ul>
<li>
<div style="margin-right:0;">Authentication/authorization is handled by Windows file permissions/Active Directory.&nbsp; If you can touch the repo and read it, then knock yourself out.</div>
</li>
<li>
<div style="margin-right:0;">Everything is handled through shares, no HTTP or that goodness.&nbsp; Users are used to hitting a mapped drive for SourceSafe repos, we&rsquo;re just emulating that.</div>
</li>
</ul>
<p style="margin-right:0;">So what do we need to do to create a Git repository? <strong>Three easy steps (commands).</strong></p>
<p style="margin-right:0;">1. Create your directory with the .git extention.</p>
<blockquote>
<p style="margin-right:0;">mkdir example.git</p>
</blockquote>
<p style="margin-right:0;">2. Change into that new directory.</p>
<blockquote>
<p style="margin-right:0;">cd example.git</p>
</blockquote>
<p style="margin-right:0;">3. Initialize the repository using Git.</p>
<blockquote>
<p style="margin-right:0;"><a href="http://www.kernel.org/pub/software/scm/git/docs/git-init.html" target="_blank">git init &mdash;bare</a></p>
</blockquote>
<p style="margin-right:0;">Our new&nbsp;Git repository is now initialized.&nbsp;You can even see that PowerShell picks up on the new repository and&nbsp;has changed my prompt accordingly.</p>
<p style="margin-right:0;"><img border="2" hspace="5" alt="Local Git Repository - example.git" vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=578" /></p>
<p style="margin-right:0;">Now that we have example.git as our &lsquo;remote&rsquo; repository, we&rsquo;re ready to <strong>make a local clone</strong>.</p>
<blockquote>
<p style="margin-right:0;">git clone H:\example.git example</p>
</blockquote>
<p style="margin-right:0;">Now we have an empty clone (and it&rsquo;s kind enough to tell us).</p>
<p style="margin-right:0;"><img border="2" hspace="5" alt="Empty clone." vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=579" /></p>
<p style="margin-right:0;">All of our Git goodness is packed into the standard .git directory.</p>
<p style="margin-right:0;"><img border="2" hspace="5" alt="Git clone contents." vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=580" /></p>
<p style="margin-right:0;">To test things out, let&rsquo;s create a quick file, add it to our repo, and then commit it in.</p>
<p style="margin-right:0;">First, let&rsquo;s create/append an example file in our clone.</p>
<p style="margin-right:0;"><img border="2" hspace="5" alt="Create/append an example file to Git" vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=581" /></p>
<p style="margin-right:0;"><em>(note: this is called &lsquo;so lazy, I don&rsquo;t even want to open NotePad&rsquo;)</em></p>
<p style="margin-right:0;">Now, we can add and verify that our newly added &lsquo;example.text&rsquo; file shows up:</p>
<p style="margin-right:0;"><img border="2" hspace="5" alt="Git - add file and verify" vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=582" /></p>
<p style="margin-right:0;">Finally, commit&hellip;</p>
<blockquote>
<p style="margin-right:0;">git commit -a -m &ldquo;this is our first commit&rdquo;</p>
</blockquote>
<p style="margin-right:0;"><img border="2" hspace="5" alt="First commit" vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=583" /></p>
<p style="margin-right:0;">&hellip; and push!</p>
<blockquote>
<p style="margin-right:0;">git push origin master</p>
</blockquote>
<p style="margin-right:0;"><img border="2" hspace="5" alt="Push to origin repo." vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=584" /></p>
<p style="margin-right:0;">The last step is to ensure that our new &lsquo;remote&rsquo; repository can be reproduced.&nbsp; Here&rsquo;s a quick single line to clone our repository into another new folder, list out the contents, and verify the log has the commit we made in the first repo.</p>
<p style="margin-right:0;"><img border="2" hspace="5" alt="Finished Second Clone to Verify" vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=585" /></p>
<p style="margin-right:0;">It&rsquo;s amazing how quick and easy it is to setup local Git repositories.&nbsp; From here, we can look at the file system/Windows for authentication/authorization and focus on our migration AWAY from Visual SourceSafe. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/git">git</a>, <a rel="tag" href="http://technorati.com/tag/howto">howto</a></div>
Posted in General Development, Git, PowerShell, Workplace  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/996/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/996/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/996/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=996&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/11/09/creating-local-git-repositories-yeah-its-that-simple/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://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=578" medium="image">
			<media:title type="html">Local Git Repository - example.git</media:title>
		</media:content>

		<media:content url="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=579" medium="image">
			<media:title type="html">Empty clone.</media:title>
		</media:content>

		<media:content url="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=580" medium="image">
			<media:title type="html">Git clone contents.</media:title>
		</media:content>

		<media:content url="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=581" medium="image">
			<media:title type="html">Create/append an example file to Git</media:title>
		</media:content>

		<media:content url="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=582" medium="image">
			<media:title type="html">Git - add file and verify</media:title>
		</media:content>

		<media:content url="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=583" medium="image">
			<media:title type="html">First commit</media:title>
		</media:content>

		<media:content url="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=584" medium="image">
			<media:title type="html">Push to origin repo.</media:title>
		</media:content>

		<media:content url="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=585" medium="image">
			<media:title type="html">Finished Second Clone to Verify</media:title>
		</media:content>
	</item>
		<item>
		<title>PowerShell: Recreating SQL*Plus &#8216;ed&#8217; Command</title>
		<link>http://tiredblogger.wordpress.com/2009/11/09/powershell-recreating-sqlplus-ed-command/</link>
		<comments>http://tiredblogger.wordpress.com/2009/11/09/powershell-recreating-sqlplus-ed-command/#comments</comments>
		<pubDate>Mon, 09 Nov 2009 20:25:10 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Server]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/11/09/powershell-recreating-sqlplus-ed-command/</guid>
		<description><![CDATA[Aside from PowerShell, I spend a bit of time day-to-day in Oracle’s SQL*Plus.  I’m slowly replacing my dependency on SQL*Plus with PowerShell scripts, functions, and such, but there are some core things that it’s just easier to bring up a console and hack out.
One thing I really love about SQL*Plus is the ‘ed’ command.  The [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=993&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Aside from PowerShell, I spend a bit of time day-to-day in Oracle’s SQL*Plus.  I’m slowly replacing my dependency on SQL*Plus with PowerShell scripts, functions, and such, but there are some core things that it’s just easier to bring up a console and hack out.</p>
<p>One thing I <strong><span style="text-decoration:underline;">really</span></strong> love about SQL*Plus is the ‘ed’ command.  The ‘ed’ command dumps your last statement into a temp file, then opens it in Notepad.  Make your changes in Notepad, save, and rerun (in SQL*Plus, it’s a single slash and then Enter), and the frustration of lengthy command line editing is solved.</p>
<p>So, this is a work in progress—my attempt to simulate the same process in PowerShell.</p>
<p><strong><span style="text-decoration:underline;">Example Situation</span></strong></p>
<p>Let’s say, for example, we have a long command we have been hacking away at, but are getting tired of arrowing back and forth on:</p>
<blockquote><p>$count = 0; sq mydb &#8220;select id from reports&#8221; | % { $count++ }; $count</p></blockquote>
<p dir="ltr">(Yes, yes, it’s not ‘very long’, but that’s why this is called an example!)</p>
<p dir="ltr">So, a simple row counter.</p>
<p><strong><span style="text-decoration:underline;">The ‘ed’ Command</span></strong></p>
<p>To recreate the ‘ed’ experience, I need two things:</p>
<ul>
<li>Access to the command line history via <strong>get-history</strong>.</li>
<li>A temporary file.</li>
</ul>
<blockquote>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;font-size:small;">touch c:\temp.tmp</span></p>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;font-size:small;">get-history | ?{ $_.commandline -ne &#8220;ex&#8221; } | </span></p>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;"> ? { $_.commandline -ne &#8220;ed&#8221; } | </span></p>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;"> select commandline -last 1 | </span></p>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;"> %{ $_.CommandLine} &gt; c:\temp.tmp</span></p>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;"> np c:\temp.tmp</span></p>
</blockquote>
<p>Stepping through the code:</p>
<ol>
<li>Create a temporary file.  I used c:\temp.tmp, but you could get a bit fancier and use the systems $TEMP directory or something.</li>
<li>Get-History.  This returns an ascending list of your command history in PowerShell by ID and CommandLine.  We want to ignore any calls to our ‘ed’ or ‘ex’ functions and grab the “last 1”—then insert it into our temp file.</li>
<li>Finally, open up the temp file in NotePad (np is an alias on my PowerShell profile for NotePad2).</li>
</ol>
<p>So now that I have my ed command, let’s try it out after I’ve already ran my simple row counter.</p>
<p><img src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=577" border="2" alt="Last Command in NotePad2" hspace="5" vspace="5" /></p>
<p>Cool.  We can now make changes to this and SAVE the temp file.  The next step would be to jump back to PowerShell and <strong>ex</strong>ecute the updated command.</p>
<p><strong><span style="text-decoration:underline;">The ‘ex’ Command</span></strong></p>
<p>Since the slash has special meaning in a PowerShell window, I simply named this script ‘ex’ instead.  Ex… execute… surely I can’t forget that, right?</p>
<blockquote>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;font-size:small;">get-content c:\temp.tmp | </span></p>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;"> % { </span></p>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;"> $_</span></p>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;"> invoke-expression $_ </span></p>
<p class="MsoNoSpacing" style="margin:0;"><span style="font-family:Calibri;"> }</span></p>
</blockquote>
<p dir="ltr">The ‘ex’ command is pretty simple.</p>
<ol>
<li>
<div>Get the content of our temporary file from <strong>get-content</strong>.</div>
</li>
<li>
<div>For each line (since get-content returns an array of lines), print out the line as text and then invoke (run) it using <strong>invoke-expression</strong>.</div>
</li>
</ol>
<p>Invoke-Expression takes a string as a command (from our text file) and returns the results.  For more information on Invoke-Expression, <a href="http://technet.microsoft.com/en-us/library/dd347550.aspx" target="_blank">check out MSDN</a>.</p>
<p><strong><span style="text-decoration:underline;">Wrapping It Up</span></strong></p>
<p>Now that we have our two commands—ed and ex—we’re ready for those “oh, this is short and easy” commands that turn into multi-page monsters—without fighting tabs and arrow keys.</p>
<p>As I said, this is a work-in-progress.  I’ll update the post as new/better ideas come up. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/PowerShell">PowerShell</a>, <a rel="tag" href="http://technorati.com/tag/Oracle">Oracle</a>, <a rel="tag" href="http://technorati.com/tag/Command+Line">Command+Line</a>, <a rel="tag" href="http://technorati.com/tag/Windows+7">Windows+7</a>, <a rel="tag" href="http://technorati.com/tag/Windows+Server+2008">Windows+Server+2008</a></div>
Posted in Microsoft, PowerShell, Windows 7, Windows Server  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/993/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/993/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/993/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/993/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/993/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/993/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/993/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/993/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/993/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/993/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=993&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/11/09/powershell-recreating-sqlplus-ed-command/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://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=577" medium="image">
			<media:title type="html">Last Command in NotePad2</media:title>
		</media:content>
	</item>
		<item>
		<title>PowerShell : TGIF Reminder</title>
		<link>http://tiredblogger.wordpress.com/2009/11/06/powershell-tgif-reminder/</link>
		<comments>http://tiredblogger.wordpress.com/2009/11/06/powershell-tgif-reminder/#comments</comments>
		<pubDate>Fri, 06 Nov 2009 14:01:10 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[General Development]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Workplace]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/11/06/powershell-tgif-reminder/</guid>
		<description><![CDATA[Jeff Hicks&#8217; TGIF post yesterday was a fun way to learn a bit of PowerShell (casting, working with dates, etc) and also add something valuable to your professional toolbelt&#8212;knowing when to go home.  
I tweaked the date output a bit to be more human readable, but also moved it from just a function to [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=991&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><a href="http://bit.ly/3dlfCt" target="_blank">Jeff Hicks&rsquo; TGIF post</a> yesterday was a fun way to learn a bit of PowerShell (casting, working with dates, etc) and also add something valuable to your professional toolbelt&mdash;knowing when to go home. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>I tweaked the date output a bit to be more human readable, but also moved it from just a function to part of my UI.&nbsp; I mean, I should ALWAYS know how close I am to quittin&rsquo; time, right? Especially as we joke around our office during our &lsquo;payless weeks&rsquo;.</p>
<blockquote>
<p># Determines if today is the end of friday! (fun function)<br />function get-tgif {<br />&nbsp;$now=Get-Date<br />&nbsp;# If it&#8217;s Saturday or Sunday then Stop! It&#8217;s the weekend!<br />&nbsp;if ([int]$now.DayOfWeek -eq 6 -or [int]$now.DayOfWeek -eq 7)<br />&nbsp;{<br />&nbsp;&nbsp;&#8221;Weekend!&#8221;<br />&nbsp;}<br />&nbsp;else {<br />&nbsp;&nbsp;# Determine when the next quittin&#8217; time is&#8230;<br />&nbsp;&nbsp;[datetime]$TGIF=&#8221;{0:MM/dd/yyyy} 4:30:00 PM&#8221; -f `<br />&nbsp;&nbsp;&nbsp;(($now.AddDays( 5 &#8211; [int]$now.DayOfWeek)) )<br />&nbsp;&nbsp;<br />&nbsp;&nbsp;# Must be Friday, but after quittin&#8217; time, GO HOME!<br />&nbsp;&nbsp;if ((get-date) -ge $TGIF) {<br />&nbsp;&nbsp;&nbsp;&#8221;TGIF has started without you!&#8221;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;else {<br />&nbsp;&nbsp;&nbsp;# Awww, still at work&#8211;how long until <br />&nbsp;&nbsp;&nbsp;# it&#8217;s time to go to the pub?<br />&nbsp;&nbsp;&nbsp;$diff = $($tgif &#8211; (get-date))<br />&nbsp;&nbsp;&nbsp;&#8221;TGIF: $($diff.Days)d $($diff.Hours)h $($diff.Minutes)m&#8221;<br />&nbsp;&nbsp;}<br />&nbsp;}<br />}</p>
</blockquote>
<p><strong>NOTE: </strong>My &ldquo;end time&rdquo; is set to 4:30PM, not 5:00PM&mdash;since that&rsquo;s when I escape.&nbsp; Change as necessary. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p>The code comments explain most of it.&nbsp; As you can see, I added in one more check&mdash;let me know when it&rsquo;s simply the weekend.&nbsp; I also removed the Write-Host calls, since I simply want to return a String from the function.&nbsp; I could use the function, as necessary, with formatting, and add it to other scripts and such.&nbsp; For example:</p>
<blockquote>
<p>Write-Host $(get-tgif) -fore red</p>
</blockquote>
<p>The next step was tapping into the $Host variable.&nbsp; Since I use <a href="http://bit.ly/3wrzDy" target="_blank">Console2</a>, my PowerShell window is a tab rather than the whole window.&nbsp; Console2 is aware of PowerShell&rsquo;s $Host.UI methods and adheres to the changes.</p>
<p>To add <strong>get-tgif</strong> to my prompt&rsquo;s window title:</p>
<blockquote>
<p>$windowTitle = &#8220;(&#8221; + $(get-tgif) + &#8220;) &#8220;<br />$host.ui.rawui.WindowTitle = $windowTitle</p>
</blockquote>
<p>Easy enough.&nbsp; Now my window title looks like (ignore the path in there for now):</p>
<p><img border="2" hspace="5" alt="TGIF countdown in WindowTitle" vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=575" /></p>
<p>But that only sets it when you log in&hellip; and I want to update it (and keep that path updated as I traverse through directories).&nbsp; To do that add a function called &lsquo;prompt&rsquo; to your PowerShell Profile.&nbsp; Prompt is processed every time the &ldquo;PS&gt;&rdquo; is generated and allows you a great deal of customization.&nbsp; <a href="http://bit.ly/19aNs8" target="_blank">See the post here</a> for further details on how I&rsquo;ve customized my prompt to handle Git repositories.</p>
<p>So, move those two lines into our&nbsp;prompt function, and our TGIF timer now updates every time our prompt changes&hellip; keeping it pretty close to real time as you work.</p>
<blockquote>
<p>function prompt {<br />&nbsp;$windowTitle = &#8220;(&#8221; + $(get-tgif) + &#8220;) &#8221; + $(get-location).ToString()<br />&nbsp;$host.ui.rawui.WindowTitle = $windowTitle</p>
<p>[&hellip;]</p>
<p>}</p>
</blockquote>
<p dir="ltr">This could be tweaked to any type of countdown.&nbsp; I&rsquo;m sure a few of those around the office would have fun adding retirement countdowns, etc. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
<p dir="ltr">Happy TGIF!</p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/PowerShell">PowerShell</a>, <a rel="tag" href="http://technorati.com/tag/scripting">scripting</a>, <a rel="tag" href="http://technorati.com/tag/fun">fun</a>, <a rel="tag" href="http://technorati.com/tag/Windows7">Windows7</a></div>
Posted in General Development, Microsoft, PowerShell, Windows 7, Workplace  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/991/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/991/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/991/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=991&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/11/06/powershell-tgif-reminder/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://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=575" medium="image">
			<media:title type="html">TGIF countdown in WindowTitle</media:title>
		</media:content>
	</item>
		<item>
		<title>PowerShell : Add Recursive Directories to PATH</title>
		<link>http://tiredblogger.wordpress.com/2009/10/19/powershell-add-recursive-directories-to-path/</link>
		<comments>http://tiredblogger.wordpress.com/2009/10/19/powershell-add-recursive-directories-to-path/#comments</comments>
		<pubDate>Mon, 19 Oct 2009 12:50:25 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/10/19/powershell-add-recursive-directories-to-path/</guid>
		<description><![CDATA[As I continue to go script crazy (a bit) with PowerShell, I&#8217;ve noticed that my general scripts directory has grown quite a bit and is becoming a bit unmanagable.&#160; Being a lover of neat and tidy, I wanted to separate &#8216;common&#8217; scripts from &#8216;server-based&#8217; and &#8216;task&#8217; scripts.
Sounds easy enough, but that breaks part of my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=988&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>As I continue to go script crazy (a bit) with PowerShell, I&rsquo;ve noticed that my general scripts directory has grown quite a bit and is becoming a bit unmanagable.&nbsp; Being a lover of neat and tidy, I wanted to separate &lsquo;common&rsquo; scripts from &lsquo;server-based&rsquo; and &lsquo;task&rsquo; scripts.</p>
<p>Sounds easy enough, but that breaks part of my PowerShell profile&mdash;the part where I add the scripts directory to the path.&nbsp; Moving those files out of that directory, even if they&rsquo;re in subdirectories, would take them out of the path and I&rsquo;d lose my [a..b]-{tab} goodness.</p>
<p>So, how to add the recursive structure to PATH?</p>
<p>It&rsquo;s easy!</p>
<p>In my Profile, <strong>$scripts</strong> is a variable that contains a path to my &lsquo;standard&rsquo; scripts directory based on whatever computer I&rsquo;m currently logged into.</p>
<p>From there, simply use the built-in features of PowerShell.</p>
<p style="margin:0;" class="MsoNoSpacing"><span style="font-size:10pt;"><font face="Calibri">gci $scripts |</font></span></p>
<p style="margin:0;" class="MsoNoSpacing"><span style="font-size:10pt;"><font face="Calibri"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>? { $_.psIsContainer } | </font></span></p>
<p style="margin:0;" class="MsoNoSpacing"><span style="font-size:10pt;"><font face="Calibri"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>% { [System.Environment]::SetEnvironmentVariable(&#8220;PATH&#8221;, </font></span></p>
<p style="margin:0;" class="MsoNoSpacing"><span style="font-size:10pt;"><font face="Calibri"><span>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </span>$Env:Path + &#8220;;&#8221; + $_.FullName, &#8220;Process&#8221;) }</font></span></p>
<p>Verbatim: for each child object in $scripts that is a container, append the full name to PATH.</p>
<p>Exactly what I wanted and works like a champ.&nbsp; Now I can move my scripts around, create new directories, the works&mdash;and each time I restart my console, it&rsquo;ll detect the new directories and simply work&mdash;exactly like a shell should.</p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/PowerShell">PowerShell</a></div>
Posted in Microsoft, PowerShell  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/988/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/988/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/988/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=988&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/10/19/powershell-add-recursive-directories-to-path/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>Updated: PowerShell &#8220;Code-Cat&#8221; With Colors and Line Breaks</title>
		<link>http://tiredblogger.wordpress.com/2009/10/13/updated-powershell-code-cat-with-colors-and-line-breaks/</link>
		<comments>http://tiredblogger.wordpress.com/2009/10/13/updated-powershell-code-cat-with-colors-and-line-breaks/#comments</comments>
		<pubDate>Tue, 13 Oct 2009 18:16:53 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Server]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/10/13/updated-powershell-code-cat-with-colors-and-line-breaks/</guid>
		<description><![CDATA[Motivated by Jeffery Hicks&#8217; fun with my original &#8220;code-cat&#8221; version, I decided to fill in a few of the original updates&#160;I had floating in my head.
The full code is available here via CodePaste.Net.
First off, I loved the idea of colorizing the comments in a file; however, I wanted to keep my line numbers out of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=986&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Motivated by <a href="http://bit.ly/v9UqJ" target="_blank">Jeffery Hicks&rsquo; fun</a> with my original &ldquo;code-cat&rdquo; version, I decided to fill in a few of the original updates&nbsp;I had floating in my head.</p>
<p><strong>The full code is </strong><a href="http://codepaste.net/ocsymv" target="_blank"><strong>available here</strong></a><strong> via CodePaste.Net.</strong></p>
<p>First off, I loved the idea of colorizing the comments in a file; however, I wanted to keep my line numbers out of the &ldquo;coloring&rdquo; and simply color the comments.&nbsp; To do this, I had to break apart the line numbers from the actual output.</p>
<p><img border="2" hspace="5" alt="Coloring Code Cat Comments" vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=572" /></p>
<p>Second, I really wanted a cleaner way to wrap lines in my code and to have those lines still lineup with everything else.&nbsp; </p>
<p><img border="2" hspace="5" alt="Line Wraps" vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=573" /></p>
<p>The full code is available via CodePaste.Net (<a href="http://codepaste.net/ocsymv" target="_blank">click here</a>), but let&rsquo;s step through it and see how things work.</p>
<p><strong><u>SplitString Function</u></strong></p>
<p>You&rsquo;ll notice at the top, I&rsquo;ve included a custom helper function that takes a string and splits it into an array.&nbsp; I use this to break up &ldquo;long&rdquo; strings into window-sized strings.</p>
<blockquote>
<p>function splitString([string]$string, [int]$length)<br />{<br />&nbsp;$lines = @();<br />&nbsp;$stringLength = $string.Length;<br />&nbsp;$position = 0;</p>
<p>&nbsp;while ($position -lt $stringLength)<br />&nbsp;{<br />&nbsp;&nbsp;if (($position + $length) -lt $stringLength)<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;$lines += $string.substring($position, $length);<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;else<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;$lines += $string.substring($position);<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;$position += $length;<br />&nbsp;}</p>
<p>&nbsp;return $lines;<br />}</p>
</blockquote>
<p>This method is actually in my PowerShell profile for use in numerous parsing activities.</p>
<p><strong><u>Colors and Window Size</u></strong></p>
<p>Unlike the original method, I&rsquo;ve pulled out the colors into variables so they are easily configured.&nbsp; I am also using the built-in PowerShell $Host object to determine the width of my console window.&nbsp; I&rsquo;ll use this later for the line breaks.</p>
<blockquote>
<p>$codeColor = &#8220;Gray&#8221;;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br />$counterColor = &#8220;White&#8221;;<br />$commentColor = &#8220;Green&#8221;;<br />$newLineColor = &#8220;Yellow&#8221;;</p>
<p># Window size, minus the counter, spacing, and a bit extra padding.<br />$maxLineSize = $Host.UI.RawUI.WindowSize.Width &#8211; 12;</p>
</blockquote>
<p><strong><u>Parsing The Code File</u></strong></p>
<p>There are a few important points in the $content body, here we go!</p>
<p><strong>Replacing Tabs With Spaces</strong></p>
<p>I found that the Substring and Length functions got really quirkly (is a tab 1 character or five, etc) when they came across several tabs (which, tabbing is pretty common in a code file, especially some SQL files).&nbsp; To remedy this, I replace tabs with five spaces.&nbsp; This also allows me to control the tabs a bit more, so if I wanted to ease my code output to the left, I could use three or four spaces.</p>
<blockquote>
<p># remove tabs, they&#8217;re counted as one character, not five.<br />$currentLine = $_.Replace(&#8220;`t&#8221;, &#8220;&nbsp;&nbsp;&nbsp; &#8220;);</p>
</blockquote>
<p>Setting the Color of Comments</p>
<p>Using Jeffery&rsquo;s example, I&rsquo;m also setting my comments (for PowerShell, C#, and TSQL) to a bright color.</p>
<blockquote>
<p># Color-code comments green (PowerShell, C#, SQL)<br />if ($currentLine.Trim().StartsWith(&#8220;#&#8221;) -or `<br />&nbsp;&nbsp;&nbsp;&nbsp;$currentLine.Trim().StartsWith(&#8220;//&#8221;) -or `<br />&nbsp;&nbsp;&nbsp;&nbsp;$currentLine.Trim().StartsWith(&#8220;&#8211;&#8221;))<br />{<br />&nbsp;&nbsp;&nbsp;&nbsp; $foregroundColor = $commentColor;<br />}</p>
</blockquote>
<p dir="ltr"><strong>Separating&nbsp;Line Numbers From Content</strong></p>
<p dir="ltr">I didn&rsquo;t want my line numbers to show up green for comments and I wanted to treat them with a different color than the rest of the code body, so I&rsquo;m taking advantage of the &ldquo;-nonewline&rdquo; feature of <strong>write-host.</strong> This returns the content without forcing a new line break into the result.&nbsp; Very handy.</p>
<p dir="ltr">write-host (&#8220;{0:d4} | &#8221; -f $counter) -nonewline -foregroundColor $counterColor;</p>
<p dir="ltr"><strong>Checking for Line Breaks and Handling Them</strong></p>
<p dir="ltr">The next bit is in &ldquo;beta&rdquo; for the time being.&nbsp; The gist is that it looks at the length of the current line vs. the maximum line size we specified in the variables.&nbsp; </p>
<p dir="ltr">If the current line is longer, it breaks the line into an array of &ldquo;max line size&rdquo; lines.&nbsp; The first line is output using our normal methods&mdash;we want our counter to show up, right?&nbsp; The &lsquo;overflow&rsquo; lines are output using a fancy arrow &ldquo;\&mdash;&gt;&rdquo; and do not include a counter&mdash;simply because they are not &lsquo;new lines&rsquo;.</p>
<p dir="ltr">Of course, if our line is shorter than our window size, it is simply output.</p>
<blockquote>
<p dir="ltr">if ($currentLine.Length -ge $maxLineSize)<br />{<br />&nbsp;$splitLines = splitString $currentLine $maxLineSize;<br />&nbsp;&nbsp;&nbsp; $countOfLines = $splitLines.Length;<br />&nbsp;for ($i = 0; $i -lt $countOfLines; $i++) <br />&nbsp;&nbsp;&nbsp; {<br />&nbsp;&nbsp;if ($i -eq 0)<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;# our first line doesn&#8217;t look any different.<br />&nbsp;&nbsp;&nbsp;write-host (&#8220;{0}&#8221; -f $splitLines[$i]) -foregroundColor $foregroundColor;<br />&nbsp;&nbsp;}<br />&nbsp;&nbsp;else<br />&nbsp;&nbsp;{<br />&nbsp;&nbsp;&nbsp;# next lines are using the fancy arrow.<br />&nbsp;&nbsp;&nbsp;write-host (&#8220;\&#8211;&gt; |&nbsp;&nbsp; &#8220;) -nonewline -foregroundColor $newLineColor;<br />&nbsp;&nbsp;&nbsp;write-host (&#8220;{0}`n&#8221; -f $splitLines[$i]) -nonewline -foregroundColor $foregroundColor;<br />&nbsp;&nbsp;}<br />&nbsp;}<br />}<br />else<br />{<br />&nbsp;write-host (&#8220;{0}&#8221; -f $_) -foregroundColor $foregroundColor;<br />}</p>
</blockquote>
<p dir="ltr">Again, the full code is <a href="http://codepaste.net/ocsymv" target="_blank">available here</a> via CodePaste.Net.</p>
<p dir="ltr">Like all things, a work in progress!</p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/powershell">powershell</a>, <a rel="tag" href="http://technorati.com/tag/windows+7">windows+7</a></div>
Posted in PowerShell, Windows 7, Windows Server  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/986/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/986/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/986/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/986/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/986/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/986/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/986/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/986/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/986/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/986/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=986&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/10/13/updated-powershell-code-cat-with-colors-and-line-breaks/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://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=572" medium="image">
			<media:title type="html">Coloring Code Cat Comments</media:title>
		</media:content>

		<media:content url="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=573" medium="image">
			<media:title type="html">Line Wraps</media:title>
		</media:content>
	</item>
		<item>
		<title>PowerShell &#8211; Easy Line Numbers using Cat (Get-Content)</title>
		<link>http://tiredblogger.wordpress.com/2009/10/08/powershell-easy-line-numbers-using-cat-get-content/</link>
		<comments>http://tiredblogger.wordpress.com/2009/10/08/powershell-easy-line-numbers-using-cat-get-content/#comments</comments>
		<pubDate>Thu, 08 Oct 2009 16:01:21 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Server]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/10/08/powershell-easy-line-numbers-using-cat-get-content/</guid>
		<description><![CDATA[I often cat out code pages from the prompt when I simply want to see what&#8217;s inside or look for a method.&#160; Cat, of course, is an alias to PowerShell&#8217;s get-content cmdlet, but cat brings me back to days in Unix and makes me feel better.  
One thing that was a bit of a [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=984&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I often <strong>cat</strong> out code pages from the prompt when I simply want to see what&rsquo;s inside or look for a method.&nbsp; Cat, of course, is an alias to PowerShell&rsquo;s <strong>get-content </strong>cmdlet, but cat brings me back to days in Unix and makes me feel better. <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>One thing that was a bit of a trouble was looking for a specific line of code.</p>
<p>For example: Looking through the debug logs, I see an error occuring at line 40 of some file.&nbsp; That&rsquo;s great, but who wants to count lines?&nbsp; Instead, we open up Visual Studio and look.&nbsp; Well, that&rsquo;s a hassle too.</p>
<p>Here&rsquo;s a quick script that does a simple line count with the line in the file.</p>
<blockquote>
<p>param ([string] $filename)<br />$counter = 0; <br />$content = get-content $filename | <br />&nbsp;% { $counter++; write-host &#8220;$counter`t| $_&#8221; }</p>
</blockquote>
<p dir="ltr">Since the result of get-content becomes an enumerable line-by-line list, it&rsquo;s easy to iterate through and increment a counter.</p>
<p dir="ltr">To call it, just call the method with the file name.&nbsp; For mine, I called it cat-code.ps1, though I&rsquo;ll probably set an alias to &lsquo;cc&rsquo; or something later on.</p>
<blockquote>
<p dir="ltr">.\cat-code.ps1 psake_default.ps1</p>
</blockquote>
<p dir="ltr"><img border="2" hspace="5" alt="Code Cat example." vspace="5" src="http://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&amp;id=571" /></p>
<p dir="ltr">From here, you could add in a check to the $Host.UI.RawUI and handle the overflows a bit better, but that&rsquo;s for another day!</p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/powershell">powershell</a>, <a rel="tag" href="http://technorati.com/tag/tips">tips</a>, <a rel="tag" href="http://technorati.com/tag/scripts">scripts</a></div>
Posted in Microsoft, PowerShell, Windows 7, Windows Server  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/984/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/984/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/984/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=984&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/10/08/powershell-easy-line-numbers-using-cat-get-content/feed/</wfw:commentRss>
		<slash:comments>2</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://photos.tiredstudent.com/WebStorageHandler.ashx?tb=false&#38;id=571" medium="image">
			<media:title type="html">Code Cat example.</media:title>
		</media:content>
	</item>
		<item>
		<title>Reusable &#8216;Controls&#8217; with Sprites, CSS, and Spark Partials</title>
		<link>http://tiredblogger.wordpress.com/2009/10/02/reusable-controls-with-sprites-css-and-spark-partials/</link>
		<comments>http://tiredblogger.wordpress.com/2009/10/02/reusable-controls-with-sprites-css-and-spark-partials/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 15:15:34 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[HTML]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Spark View Engine]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/10/02/reusable-controls-with-sprites-css-and-spark-partials/</guid>
		<description><![CDATA[I came across SilkSprite during some of my work with BluePrintCSS and fell in love.&#160; I&#8217;ve used the FamFamSilk icons for ages and, with a current project, wanted to implement some instant CSS buttons and menu items using those icons.
So, with CSS-fu in hand, here&#8217;s how the button turned out.
First, creating a simple CSS button [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=981&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I came across <a href="http://bit.ly/18stDl" target="_blank">SilkSprite</a> during some of my work with BluePrintCSS and fell in love.&nbsp; I&rsquo;ve used the FamFamSilk icons for ages and, with a current project, wanted to implement some instant CSS buttons and menu items using those icons.</p>
<p>So, with CSS-fu in hand, here&rsquo;s how the button turned out.</p>
<p>First, creating a simple CSS button style:</p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;"><span style="color:#cae682;"></p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;"><span style="color:#cae682;"></p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;"><span style="color:#cae682;">.button</span></p>
<p style="margin:0;">{</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; display: inline-block;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; font-weight: bold;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; font: bold .85em/2.5em Verdana, Helvetica, sans-serif;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; text-decoration: none;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; text-indent: 10px;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; width: 150px;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; height: 2.5em;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; color: #555555;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; background-color: #EAEAD7;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; border: #CCCCCC solid 1px;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; -moz-border-radius: 5px;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; -webkit-border-radius: 5px;</p>
<p style="margin:0;">}</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:#cae682;">.button:hover</span></p>
<p style="margin:0;">{</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; background-color: #F3F3E9;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; color: #737373;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; cursor: pointer;</p>
<p style="margin:0;">}</p>
</div>
<p><!--EndFragment--></span></div>
<p><!--EndFragment--></span></div>
<p><!--EndFragment--></p>
<p>This button is pretty simple and standard&mdash;nothing fancy.&nbsp; The most important tag in there is <strong>display: inline-block </strong>as this allows our buttons to share the same row and not stack on top of each other (like float:left would cause).</p>
<p>Hover Off: <img border="2" hspace="5" alt="CSS Button - Hover Off" vspace="5" src="http://bit.ly/4jINM3" /></p>
<p>Hover On: <img border="2" hspace="5" alt="CSS Button - Hover On" vspace="5" src="http://bit.ly/ZlrM6" /></p>
<p>Second, because I needed to include the icon INSIDE another container (the button), I modified the original SilkSprite <strong>ss_sprite</strong> and removed a bit of the extra padding.</p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;"><span style="color:#cae682;"></p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;"><span style="color:#cae682;">.sprite</span></p>
<p style="margin:0;">{</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; display: inline-block;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; overflow: hidden;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; background-repeat: no-repeat;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; background-image: url(/content/img/sprites.png);</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; padding-left: 25px;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; padding-top: 2px;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; height: 16px;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; max-height: 16px;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; vertical-align: middle;</p>
<p style="margin:0;">}</p>
</div>
<p><!--EndFragment--></span></div>
<p><!--EndFragment--></p>
<p>The important thing to note here is the <strong>padding-top</strong> and the <strong>height</strong> attributes.&nbsp; Until I&rsquo;m lead into the light and improve my CSS-fu, I&rsquo;m compensating for the font height differences by using padding-top.&nbsp; e.g. I want the icon to truly show up in the &ldquo;middle&rdquo;&hellip; and vertical-align just wasn&rsquo;t pushing it far enough.</p>
<p>We&rsquo;ll come back to actually working with SilkSprite in a moment, let&rsquo;s work up a quick Spark partial view to display our results.&nbsp; Now, you could do this without the partial views&mdash;just replace my Spark variables with the actual text we&rsquo;re passing to them.&nbsp; I&rsquo;ll provide both examples.</p>
<p>Our button needs three elements to be useful:</p>
<ol>
<li>An ID so that we can call it from jQuery or your client-side query engine of choice,</li>
<li>A Sprite Name, such as ss_add, etc.&nbsp; These are provided by SilkSprite.</li>
<li>The button text.</li>
</ol>
<p>So, knowing that, a basic button could be rendered using:</p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;">&lt;<span style="color:#8ac6f2;">div</span> <span style="color:#cae682;">id</span>=&#8221;my-button&#8221; <span style="color:#cae682;">class</span>=&#8221;button&#8221;&gt;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &lt;<span style="color:#8ac6f2;">span</span> <span style="color:#cae682;">class</span>=&#8221;sprite ss_add&#8221; /&gt;Add Activity</p>
<p style="margin:0;">&lt;/<span style="color:#8ac6f2;">div</span>&gt;</p>
</div>
<p><!--EndFragment--></p>
<p>We can simply substitute out the variable elements (id, sprite class, and text) and create a Spark partial view (named _styledButton.spark and located in the /Shared view folder).</p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;">&lt;<span style="color:#8ac6f2;">div</span> <span style="color:#cae682;">id</span>=&#8221;<span style="color:teal;">${</span>id<span style="color:teal;">}</span>&#8221; <span style="color:#cae682;">class</span>=&#8221;button&#8221;&gt;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &lt;<span style="color:#8ac6f2;">span</span> <span style="color:#cae682;">class</span>=&#8221;sprite <span style="color:teal;">${</span>sprite<span style="color:teal;">}</span>&#8220;&gt;&lt;/<span style="color:#8ac6f2;">span</span>&gt;<span style="color:teal;">${</span>text<span style="color:teal;">}</span></p>
<p style="margin:0;">&lt;/<span style="color:#8ac6f2;">div</span>&gt;</p>
</div>
<p><!--EndFragment--></p>
<p>In our views, it&rsquo;s easy to create a button:</p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;">&lt;<span style="color:#8ac6f2;">styledButton</span> <span style="color:#cae682;">text</span>=&#8221;&#8216;<span style="color:#e5786d;">Add Activity</span>&#8216;&#8221; <span style="color:#cae682;">id</span>=&#8221;&#8216;<span style="color:#e5786d;">my-button</span>&#8216;&#8221; <span style="color:#cae682;">sprite</span>=&#8221;&#8216;<span style="color:#e5786d;">ss_page_add</span>&#8216;&#8221; /&gt;</p>
</div>
<p><!--EndFragment--></p>
<p><strong>Note: </strong>You need to surround your text with single quotes (&lsquo;text&rsquo;)&nbsp;to inform the Spark engine that the information contained in your variables is a string.</p>
<p>Now, we have shiny, icon&rsquo;d buttons:</p>
<p>Hover Off: <img border="2" hspace="5" alt="" vspace="5" src="http://bit.ly/Nhd6j" /></p>
<p>Hover On: <img border="2" hspace="5" alt="" vspace="5" src="http://bit.ly/4g0js" /></p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/css+sprites">css+sprites</a>, <a rel="tag" href="http://technorati.com/tag/css">css</a>, <a rel="tag" href="http://technorati.com/tag/blueprint+css">blueprint+css</a>, <a rel="tag" href="http://technorati.com/tag/spark+view+engine">spark+view+engine</a></div>
Posted in HTML, MVC, Spark View Engine  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/981/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/981/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/981/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/981/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/981/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/981/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/981/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/981/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/981/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/981/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=981&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/10/02/reusable-controls-with-sprites-css-and-spark-partials/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://bit.ly/4jINM3" medium="image">
			<media:title type="html">CSS Button - Hover Off</media:title>
		</media:content>

		<media:content url="http://bit.ly/ZlrM6" medium="image">
			<media:title type="html">CSS Button - Hover On</media:title>
		</media:content>

		<media:content url="http://bit.ly/Nhd6j" medium="image" />

		<media:content url="http://bit.ly/4g0js" medium="image" />
	</item>
		<item>
		<title>Automating Extracts Using External .SQL Files and PowerShell</title>
		<link>http://tiredblogger.wordpress.com/2009/09/29/automating-extracts-using-external-sql-files-and-powershell/</link>
		<comments>http://tiredblogger.wordpress.com/2009/09/29/automating-extracts-using-external-sql-files-and-powershell/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 14:58:56 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[General Development]]></category>
		<category><![CDATA[Hardware and Software]]></category>
		<category><![CDATA[Microsoft]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[SQL]]></category>
		<category><![CDATA[Windows 7]]></category>
		<category><![CDATA[Windows Server]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/09/29/automating-extracts-using-external-sql-files-and-powershell/</guid>
		<description><![CDATA[Rather than rely on a system task, I wanted to be able to kick off an export of one of our SQL databases on the fly, have it generate a CSV, then email the CSV to one of our developers.
Sounds like a task for PowerShell!
Why PowerShell? Well, frankly, because moving jobs around and such on [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=979&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>Rather than rely on a system task, I wanted to be able to kick off an export of one of our SQL databases on the fly, have it generate a CSV, then email the CSV to one of our developers.</p>
<p>Sounds like a task for PowerShell!</p>
<p>Why PowerShell? Well, frankly, because moving jobs around and such on our mixed-mash of SQL versions and servers is a bit annoying and I wanted to see if it worked.</p>
<p>So, to start off, I have a file, call it <strong>export_data.sql </strong>that contains all of the logic of my SQL query and the format I require.</p>
<p>I&rsquo;ll also be using the Microsoft SQL query script I discussed in <a href="http://tiredblogger.wordpress.com/2009/08/31/querying-sql-server-using-powershell/" target="_blank">this blog post</a>.</p>
<p>The tricky part is reading in the .sql file as a single &ldquo;entity&rdquo;&mdash;not the array of rows that get-content usually provides.&nbsp; Thankfully, there is an easy way to do it.</p>
<blockquote>
<p><strong>@(gc &lsquo;export_data.sql&rsquo; -readcount 0)</strong></p>
</blockquote>
<p dir="ltr">According to the PowerShell documentation, the <strong>readcount</strong> parameter serves two purposes:&nbsp;one is to set the number of lines to read at a time, the second (when set to zero) is to pull in all of the lines at once.&nbsp; Great, that&rsquo;s exactly what we need.</p>
<p dir="ltr">From there, it&rsquo;s simply feeding our query to the sql-query function I wrote and exporting to CSV.&nbsp; Nice enough, CSV exports are built-in to PowerShell!</p>
<p dir="ltr">The final command looks something like this:</p>
<blockquote>
<p dir="ltr"><strong>@(gc &lsquo;export_data.sql&rsquo; -readcount 0) |&nbsp; <br />&nbsp;&nbsp; % { sql-query server db $_ } | <br />&nbsp;&nbsp; export-csv dump.csv</strong></p>
</blockquote>
<p dir="ltr">I could then add another field to mail the csv using the built-in command <strong>Send-MailMessage</strong>.</p>
<p dir="ltr">&lt;3 PowerShell.</p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/powershell">powershell</a>, <a rel="tag" href="http://technorati.com/tag/csv">csv</a>, <a rel="tag" href="http://technorati.com/tag/export">export</a>, <a rel="tag" href="http://technorati.com/tag/sql+server">sql+server</a></div>
Posted in General Development, Hardware and Software, Microsoft, PowerShell, SQL, Windows 7, Windows Server  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/979/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/979/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/979/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/979/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/979/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/979/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/979/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/979/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/979/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/979/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=979&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/09/29/automating-extracts-using-external-sql-files-and-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>
	</item>
		<item>
		<title>Populating Select Lists in ASP.NET MVC and jQuery</title>
		<link>http://tiredblogger.wordpress.com/2009/09/25/populating-select-lists-in-asp-net-mvc-and-jquery/</link>
		<comments>http://tiredblogger.wordpress.com/2009/09/25/populating-select-lists-in-asp-net-mvc-and-jquery/#comments</comments>
		<pubDate>Fri, 25 Sep 2009 15:50:26 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[NHibernate]]></category>
		<category><![CDATA[Spark View Engine]]></category>
		<category><![CDATA[Visual Studio 2008]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/09/25/populating-select-lists-in-asp-net-mvc-and-jquery/</guid>
		<description><![CDATA[I&#8217;ve been working the last bit to find the best way to create/populate select (option) lists using a mixture of ASP.NET MVC and jQuery.&#160; What I&#8217;ve run into is that the &#8220;key&#8221; and &#8220;value&#8221; tags are not passed along when using Json(data).
Here&#8217;s what I&#8217;m trying to pull off in jQuery: building&#160;a simple select drop down [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=977&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p>I&rsquo;ve been working the last bit to find the best way to create/populate select (option) lists using a mixture of ASP.NET MVC and jQuery.&nbsp; What I&rsquo;ve run into is that the &ldquo;key&rdquo; and &ldquo;value&rdquo; tags are not passed along when using <strong>Json(data)</strong>.</p>
<p>Here&rsquo;s what I&rsquo;m trying to pull off in jQuery: building&nbsp;a simple select drop down list.</p>
<blockquote>
<p>var dd_activities = &#8220;&lt;select id=&#8217;dd_activities&#8217;&gt;&#8221;;<br />var count = data.length;<br />for (var i = 0; i &lt; count; i++) {<br />&nbsp;dd_activities += &#8220;&lt;option value=&#8217;&#8221; + data[i].Key + &#8220;&#8216;&gt;&#8221; + data[i].Value + &#8220;&lt;/option&gt;&#8221;;<br />}<br />dd_activities += &#8220;&lt;/select&gt;&#8221;;</p>
<p>$(&#8220;#activities&#8221;).before(dd_activities);</p>
</blockquote>
<p>Using some very basic key/value data:</p>
<blockquote>
<p>[ <br />&nbsp;{"3","Text Value"},<br />&nbsp;{"4","Another Text Value"},<br />&nbsp;{"1","More boring values..."},<br />&nbsp;{"2","Running out of values"},<br />&nbsp;{"5","Last value..."}<br />]</p>
</blockquote>
<div class="netInfoResponseText netInfoText ">Without any sort of name, I was at a loss on how to access the information, how to get it&rsquo;s length, or anything.&nbsp; FireBug was happy to order it up&hellip; but that didn&rsquo;t help.</div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">My first attempt was to use a custom object, but that just felt dirty&mdash;creating NEW objects simply to return Json data.</div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">My second attempt matched the mentality of newing new anonymous Json objects and seemed to work like a champ:</div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;">[<span style="color:#cae682;">Authorize</span>]</p>
<p style="margin:0;">[<span style="color:#cae682;">CacheFilter</span>(Duration = <span style="color:#e5786d;">20</span>)]</p>
<p style="margin:0;"><span style="color:#8ac6f2;">public</span> <span style="color:#cae682;">ActionResult</span> GetActivitiesList()</p>
<p style="margin:0;">{</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; <span style="color:#8ac6f2;">try</span></p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:#8ac6f2;">var</span> results = </p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; _activityRepository</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; .GetAll()</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; .OrderBy(x =&gt; x.Target.Name).OrderBy(x =&gt; x.Name)</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; .Select(x =&gt; <span style="color:#8ac6f2;">new</span></p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Key = x.Id.ToString(), </p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Value = <span style="color:#8ac6f2;">string</span>.Format(<span style="color:#e5786d;">&#8220;[{0}] {1}&#8221;</span>, x.Target.Name, x.Name)</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; })</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; .ToList();</p>
</div>
<p><!--EndFragment--><!--EndFragment--></div>
</div>
<p><!--EndFragment--></p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:#8ac6f2;">return</span> Json(results);</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; <span style="color:#8ac6f2;">catch</span> (<span style="color:#cae682;">Exception</span> ex)</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; <span style="color:#8ac6f2;">return</span> Json(ex.Message);</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; }</p>
<p style="margin:0;">}</p>
</div>
<p><!--EndFragment--></div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">Well, not beautiful, but returns a sexy Key/Value list that Json expects&mdash;and that populates our select list.</div>
<blockquote>
<div class="netInfoResponseText netInfoText ">[<br />&nbsp;{"Key":"3","Value":"Text Value"},<br />&nbsp;{"Key":"4","Value":"Another Text Value"},<br />&nbsp;{"Key":"1","Value":"More boring values..."},<br />&nbsp;{"Key":"2","Value":"Running out of values"},<br />&nbsp;{"Key":"5","Value":"Last value..."}<br />]</div>
</blockquote>
<div class="netInfoResponseText netInfoText ">The next step was to get that out of the controller and into the data repository&hellip; pushing some of that logic back down to the database.</div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;"><span style="color:#8ac6f2;"></p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;"><span style="color:#8ac6f2;"></p>
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;"><span style="color:#8ac6f2;">var</span> criteria =</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; Session.CreateCriteria&lt;<span style="color:#cae682;">Activity</span>&gt;()</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; .CreateAlias(<span style="color:#e5786d;">&#8220;Target&#8221;</span>, <span style="color:#e5786d;">&#8220;Target&#8221;</span>)</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; .Add(<span style="color:#cae682;">Restrictions</span>.Eq(<span style="color:#e5786d;">&#8220;IsValid&#8221;</span>, <span style="color:#8ac6f2;">true</span>))</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; .AddOrder(<span style="color:#cae682;">Order</span>.Asc(<span style="color:#e5786d;">&#8220;Target.Name&#8221;</span>))</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; .AddOrder(<span style="color:#cae682;">Order</span>.Asc(<span style="color:#e5786d;">&#8220;Name&#8221;</span>))</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; .SetMaxResults(<span style="color:#e5786d;">100</span>);</p>
<p style="margin:0;">&nbsp;</p>
<p style="margin:0;"><span style="color:#8ac6f2;">var</span> data = criteria.List&lt;<span style="color:#cae682;">Activity</span>&gt;();</p>
<p style="margin:0;"><span style="color:#8ac6f2;">var</span> result =</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; data</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; .Select(x =&gt; <span style="color:#8ac6f2;">new</span></p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; {</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Key = x.Id.ToString(), </p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; Value = <span style="color:#8ac6f2;">string</span>.Format(<span style="color:#e5786d;">&#8220;[{0}] {1}&#8221;</span>, x.Target.Name, x.Name)</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; })</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; .ToList();</p>
<p style="margin:0;">tx.Commit();</p>
<p style="margin:0;"><span style="color:#8ac6f2;">return</span> result;</p>
</div>
<p><!--EndFragment--></span></div>
<p><!--EndFragment--></span><!--EndFragment--></div>
</div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">A bit of formatting, restrictions, push the ordering back to the database, and a tidy SQL statement is created.</div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">The last touch is the return type.&nbsp; Since we&rsquo;re returning a &ldquo;List&rdquo; of anonymous types, the return type of GetActivitiesList() must be an <strong>IList.</strong></div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">That shrinks down my ActionResult to a single call.</div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">
<div style="font-family:Envy Code R, Consolas, Arial;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;"><span style="color:#8ac6f2;">try</span></p>
<p style="margin:0;">&nbsp;{</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#8ac6f2;">return</span> Json(_activityRepository.GetActivitiesList());</p>
<p style="margin:0;">&nbsp;}</p>
<p style="margin:0;">&nbsp;<span style="color:#8ac6f2;">catch</span> (<span style="color:#cae682;">Exception</span> ex)</p>
<p style="margin:0;">&nbsp;{</p>
<p style="margin:0;">&nbsp;&nbsp;&nbsp;&nbsp; <span style="color:#8ac6f2;">return</span> Json(ex.Message);</p>
<p style="margin:0;">&nbsp;}</p>
</div>
<p><!--EndFragment--></div>
<div class="netInfoResponseText netInfoText ">&nbsp;</div>
<div class="netInfoResponseText netInfoText ">That works&hellip; and will work for now.&nbsp; Though, I&rsquo;ve marked it as a HACK in my code.&nbsp; Why?&nbsp; I&rsquo;m honestly not sure yet.&nbsp; Just a feeling.</div>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/asp.net+mvc">asp.net+mvc</a>, <a rel="tag" href="http://technorati.com/tag/jquery">jquery</a>, <a rel="tag" href="http://technorati.com/tag/nhibernate">nhibernate</a></div>
Posted in .net 3.5, AJAX, c#, JavaScript, MVC, NHibernate, Spark View Engine, Visual Studio 2008  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/977/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/977/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/977/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/977/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/977/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/977/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/977/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/977/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/977/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/977/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=977&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/09/25/populating-select-lists-in-asp-net-mvc-and-jquery/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>Html.Grid Rendering as Plain Text?</title>
		<link>http://tiredblogger.wordpress.com/2009/09/23/html-grid-rendering-as-plain-text/</link>
		<comments>http://tiredblogger.wordpress.com/2009/09/23/html-grid-rendering-as-plain-text/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 03:22:43 +0000</pubDate>
		<dc:creator>David Longnecker</dc:creator>
				<category><![CDATA[.net 3.5]]></category>
		<category><![CDATA[AJAX]]></category>
		<category><![CDATA[MVC]]></category>
		<category><![CDATA[Spark View Engine]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://tiredblogger.wordpress.com/2009/09/23/html-grid-rendering-as-plain-text/</guid>
		<description><![CDATA[Notice: Stupid, stupid moment described ahead.&#160; Proceed with caution.
I spent a good half hour trying to figure out why my MVCContrib Html.Grid&#60;T&#62; wasn&#8217;t rendering.&#160; It wasn&#8217;t throwing an error, it was simply returning the HTML code as Plain Text.

The AutoMapper code looked good,
The Html.Grid&#60;T&#62; code looked good (it&#8217;d be templated off another page anyway and [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=975&subd=tiredblogger&ref=&feed=1" />]]></description>
			<content:encoded><![CDATA[<div class='snap_preview'><br /><p><strong>Notice: Stupid, stupid moment described ahead.&nbsp; Proceed with caution.</strong></p>
<p>I spent a good half hour trying to figure out why my MVCContrib Html.Grid&lt;T&gt; wasn&rsquo;t rendering.&nbsp; It wasn&rsquo;t throwing an error, it was simply returning the HTML code as Plain Text.</p>
<ul>
<li>The AutoMapper code looked good,</li>
<li>The Html.Grid&lt;T&gt; code looked good (it&rsquo;d be templated off another page anyway and that page was working),</li>
<li>The view model code looked good.</li>
</ul>
<p>So why was I being greeted with garble junk?</p>
<blockquote>
<p>${Html.Grid(Model.Details) .Attributes(Id =&gt; &#8220;RoutineDetails&#8221;) .Columns(column =&gt; { column.For(c =&gt; this.Button(&#8220;EditDetail&#8221;).Value(&#8220;Edit&#8221;).Id(string.Format(&#8220;edit_{0}&#8221;, c.Id))).DoNotEncode(); column.For(c =&gt; c.Activity.Target.Name).Named(&#8220;Target Area&#8221;); column.For(c =&gt; c.Activity.Name).Named(&#8220;Activity&#8221;); column.For(c =&gt; c.Sets); column.For(c =&gt; c.Weight); column.For(c =&gt; c.Repetitions); column.For(c =&gt; c.Duration); })}</p>
</blockquote>
<p>Html.Grid that is not&hellip; well, at least not properly.</p>
<p>Encoding issue? Maybe. Data issue? Perhaps.</p>
<p>No, the issue was typing too quick and not paying attention.</p>
<div style="font-family:Consolas, Tahoma, Helvetica;background:#242424;color:#e8f3f6;font-size:10pt;">
<p style="margin:0;"><span style="color:#8ac6f2;">public</span> <span style="color:#cae682;">ActionResult</span> New()</p>
<p style="margin:0;">&nbsp;{</p>
<p style="margin:0;">&nbsp;&nbsp; &nbsp; <span style="color:#8ac6f2;">var</span> viewModel = BuildRoutineNewViewModel(<span style="color:#8ac6f2;">new</span> <span style="color:#cae682;">Routine</span>());</p>
<p style="margin:0;">&nbsp;&nbsp; &nbsp; <span style="color:#8ac6f2;">return</span> View();</p>
<p style="margin:0;">&nbsp;}</p>
</div>
<p><!--EndFragment--></p>
<p>Yeah, that&rsquo;s the problem&hellip; right there.&nbsp; I&rsquo;d forgotten to pass the view model into the View.&nbsp; Apparently the Html.Grid&lt;T&gt; helper simply panics if the model you&rsquo;re reading from is empty or null&mdash;rather than throwing an error.</p>
<p>Oddly enough, this is one of those times I&rsquo;d wish the screen would have lit up red.&nbsp; Lessons learned.</p>
<div class="bjtags">Tags: <a rel="tag" href="http://technorati.com/tag/mvccontrib">mvccontrib</a>, <a rel="tag" href="http://technorati.com/tag/spark+view+engine">spark+view+engine</a>, <a rel="tag" href="http://technorati.com/tag/asp.net+mvc">asp.net+mvc</a></div>
Posted in .net 3.5, AJAX, c#, MVC, Spark View Engine  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/tiredblogger.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/tiredblogger.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/tiredblogger.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/tiredblogger.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/tiredblogger.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/tiredblogger.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/tiredblogger.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/tiredblogger.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/tiredblogger.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/tiredblogger.wordpress.com/975/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=tiredblogger.wordpress.com&blog=253870&post=975&subd=tiredblogger&ref=&feed=1" /></div>]]></content:encoded>
			<wfw:commentRss>http://tiredblogger.wordpress.com/2009/09/23/html-grid-rendering-as-plain-text/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>
	</item>
	</channel>
</rss>