<?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/"
	>

<channel>
	<title>Chinh Do &#187; PowerShell</title>
	<atom:link href="http://www.chinhdo.com/category/programming/powershell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.chinhdo.com</link>
	<description>Chinh's not quite random thoughts on software development, .NET, gadgets, and other things.</description>
	<lastBuildDate>Sat, 06 Aug 2011 21:04:25 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Give The Power of Speech and Sound to Your PowerShell Scripts</title>
		<link>http://www.chinhdo.com/20100116/give-the-power-of-speech-and-sound-to-your-powershell-scripts/</link>
		<comments>http://www.chinhdo.com/20100116/give-the-power-of-speech-and-sound-to-your-powershell-scripts/#comments</comments>
		<pubDate>Sat, 16 Jan 2010 05:34:00 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/20100120/give-the-power-of-speech-and-sound-to-your-powershell-scripts/</guid>
		<description><![CDATA[Do you ever have the problem where you start a long running script (such as running a code build), multi-task on something else on another monitor while waiting for the script to finish, and then totally forget about the script until half an hour later? Well, here’s a solution your problem: have your script give [...]]]></description>
			<content:encoded><![CDATA[<p>Do you ever have the problem where you start a long running script (such as running a code build), multi-task on something else on another monitor while waiting for the script to finish, and then totally forget about the script until half an hour later? Well, here’s a solution your problem: have your script give you holler at you when it’s done.</p>
<p><img title="Hello sir! I am done running your command!" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="224" alt="Hello sir! I am done running your command!" src="http://www.chinhdo.com/wp-content/uploads/2010/01/image1.png" width="279" border="0" /> </p>
<p>In my library script file, I have the following functions to play sound files and to speak any text:</p>
<pre class="brush: csharp;">function PlayMp3($path) {
    # Use the default player to play. Hide the window.
    $si = new-object System.Diagnostics.ProcessStartInfo
    $si.fileName = $path
    $si.windowStyle = [System.Diagnostics.ProcessWindowStyle]::Hidden
    $process = New-Object System.Diagnostics.Process
    $process.startInfo=$si
    $process.start()
}

function PlayWav($path) {
    $sound = new-Object System.Media.SoundPlayer;
    $sound.SoundLocation=&quot;$path&quot;;
    $sound.Play();
}

function Say($msg) {
    $Voice = new-object -com SAPI.SpVoice
    $Voice.Speak($msg, 1 )
}</pre>
<p>If you like the text-to-speech feature but find Windows’ speech engine lacking, check out <a href="http://www.ivona.com/?tk=jtvleiDF">Ivona</a>. It’s a commercial text-to-speech engine but you are allow to generate and download short speech files for free personal use. Now, my script can nicely interrupt me to tell me when it’s done. Other online text-to-speech engines: <a href="http://vozme.com/index.php?lang=en">vozMe</a>, <a href="http://spokentext.net/">SpokenText</a>.</p>
<h3>If Making Noise Is Not Your Thing</h3>
<p>If making noise is not your thing, consider displaying a message in the Notification Area. Here’s the code (courtesy <a href="http://www.microsoft.com/technet/scriptcenter/resources/pstips/may08/pstip0523.mspx">Microsoft TechNet</a>):</p>
<p><img title="Build complete!" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="96" alt="Build complete!" src="http://www.chinhdo.com/wp-content/uploads/2010/01/x.jpg" width="209" border="0" /> </p>
<pre class="brush: csharp;">function Get-ScriptName {
    $MyInvocation.ScriptName
} 

function DisplayNotificationInfo($msg, $title, $type) {
    # $type - &quot;info&quot; or &quot;error&quot;
    if ($type -eq $null) {$type = &quot;info&quot;}
    if ($title -eq $null) {$title = Get-ScriptName}

    [void] [System.Reflection.Assembly]::LoadWithPartialName(&quot;System.Windows.Forms&quot;)
    $objNotifyIcon = New-Object System.Windows.Forms.NotifyIcon
    # Specify your own icon below
    $objNotifyIcon.Icon = &quot;C:CdoScriptsFolder.ico&quot;
    $objNotifyIcon.BalloonTipIcon = &quot;Info&quot;
    $objNotifyIcon.BalloonTipTitle = $title
    $objNotifyIcon.BalloonTipText = $msg

    $objNotifyIcon.Visible = $True
    $objNotifyIcon.ShowBalloonTip(10000)
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20100116/give-the-power-of-speech-and-sound-to-your-powershell-scripts/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Automating Maven with PowerShell</title>
		<link>http://www.chinhdo.com/20100107/powershell-mvn-integration/</link>
		<comments>http://www.chinhdo.com/20100107/powershell-mvn-integration/#comments</comments>
		<pubDate>Fri, 08 Jan 2010 02:10:00 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/20100107/powershell-mvn-integration/</guid>
		<description><![CDATA[I found out the hard way that mvn (Maven) on Windows always return a success code of true, which means you cannot use the return code ($?) to check whether the mvn command succeeded or failed. Why they decided to break this seemingly basic program contract is a mystery. A work-around is to scan the [...]]]></description>
			<content:encoded><![CDATA[<p>I found out the hard way that mvn (<a href="http://www.google.com/url?sa=t&amp;source=web&amp;ct=res&amp;cd=1&amp;ved=0CA0QFjAA&amp;url=http%3A%2F%2Fmaven.apache.org%2F&amp;ei=Qb9DS-HiBMTIlAfm_amRBw&amp;usg=AFQjCNEOM94DrY-KbHD2ionSrXoOiwwnDg&amp;sig2=UCki6L-5dzDdtQDasrKCYA">Maven</a>) on Windows always return a success code of true, which means you cannot use the return code ($?) to check whether the mvn command succeeded or failed. Why they decided to break this seemingly basic program contract is a mystery. A work-around is to scan the mvn output and look for specific strings such as “BUILD SUCCESSFUL”.</p>
<p>Here’s how:</p>
<pre class="brush: csharp;">function InvokeAndCheckStdOut($cmd, $successString, $failString) {
    Write-Host &quot;====&gt; InvokeAndCheckStdOut&quot;
    $fullCmd = &quot;$cmd|Tee-Object -variable result&quot; 

    Invoke-Expression $fullCmd
    $found = $false
    $success = $false
    foreach ($line in $result) {
      if ($line -match $failString) {
       $found = $true
       $success = $false
       break
      }
      else {
       if ($line -match $successString) {
        $found = $true
        $success = $true
        #&quot;[InvokeAndCheckStdOut] FOUND MATCH: $line&quot;
        break
       }
       else {
        #&quot;[InvokeAndCheckStdOut] $line&quot;
       }
      }
    }

    if (! $success) {
      PlayWav &quot;${env:windir}\Media\ding.wav&quot;
      throw &quot;Mvn command failed.&quot;
    }

    Write-Host &quot;InvokeAndCheckStdOut &lt;====&quot;
}

function InvokeMvn($cmd) {
    InvokeAndCheckStdOut $cmd &quot;BUILD SUCCESSFUL&quot; &quot;BUILD FAILED&quot;
}

InvokeMvn &quot;mvn clean install&quot;</pre>
<h3>See Also</h3>
<ul>
<li><a href="http://www.chinhdo.com/20100105/powershell-invoke-expression-tee-object/">Tee-Object and Invoke-Expression in PowerShell</a> </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20100107/powershell-mvn-integration/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tee-Object and Invoke-Expression in PowerShell</title>
		<link>http://www.chinhdo.com/20100105/powershell-invoke-expression-tee-object/</link>
		<comments>http://www.chinhdo.com/20100105/powershell-invoke-expression-tee-object/#comments</comments>
		<pubDate>Wed, 06 Jan 2010 02:07:00 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/20100105/powershell-invoke-expression-tee-object/</guid>
		<description><![CDATA[The PowerShell Tee-Object Cmdlet allows you to send command output to a file or a variable, and display it in the console at the same time. This is very useful for those instances where you need to parse the text output of a command. I had a hard time getting it to work with Invoke-Expression. [...]]]></description>
			<content:encoded><![CDATA[<p>The PowerShell Tee-Object Cmdlet allows you to send command output to a file or a variable, and display it in the console at the same time. This is very useful for those instances where you need to parse the text output of a command. I had a hard time getting it to work with Invoke-Expression. After trying different things, I finally found the solution. To get Tee-Object to work with Invoke-Expression in PowerShell 1, include the Tee command in the Invoke-Expression command like this:</p>
<pre class="brush: csharp;">Invoke-Expression &quot;mvn clean install | Tee –variable result”</pre>
<p>The following, which I guess is what most people try first, doesn’t work (at least in PowerShell V1). I guess because you are storing the result of the “Invoke-Expression” command itself into the variable instead of “mvn clean install”.</p>
<pre class="brush: csharp;">    Invoke-Expression &quot;mvn clean install” | Tee -variable result</pre>
<p>Wrapping Invoke-Expression in parenthesis (see below) works, but has a drawback: the output is not written to Standard Out until the whole command finishes.</p>
<pre class="brush: csharp;">    (Invoke-Expression &quot;mvn clean install”) | Tee -variable result</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20100105/powershell-invoke-expression-tee-object/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Create a Temporary File in PowerShell</title>
		<link>http://www.chinhdo.com/20091210/create-a-temporary-file-in-powershell/</link>
		<comments>http://www.chinhdo.com/20091210/create-a-temporary-file-in-powershell/#comments</comments>
		<pubDate>Fri, 11 Dec 2009 00:52:00 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/20091210/create-a-temporary-file-in-powershell/</guid>
		<description><![CDATA[$tempFile = [IO.Path]::GetTempFileName() An empty file created immediately when you call this method. Remember to clean it up when are you done!]]></description>
			<content:encoded><![CDATA[<p>$tempFile = [IO.Path]::GetTempFileName()</p>
<p>An empty file created immediately when you call this method. Remember to clean it up when are you done!</p>
<p><img title="image" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="154" alt="image" src="http://www.chinhdo.com/wp-content/uploads/2009/12/image.png" width="454" border="0" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20091210/create-a-temporary-file-in-powershell/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bag of Links #2</title>
		<link>http://www.chinhdo.com/20090212/bag-of-links-2/</link>
		<comments>http://www.chinhdo.com/20090212/bag-of-links-2/#comments</comments>
		<pubDate>Fri, 13 Feb 2009 00:36:31 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[Dotnet/.NET - C#]]></category>
		<category><![CDATA[Links]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Silverlight]]></category>
		<category><![CDATA[Software/tools]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/20090212/bag-of-links-2/</guid>
		<description><![CDATA[.NET/C# Programming Thread synchronization: Wait and Pulse demystified. By Nick Butler. Use a shortened GUID for file names and request strings. ShortGuid &#8211; A shorter and url friendly GUID class in C#. By Dave Transom. Top Ten Tips to Using XPath and XPointer. By John E. Simpson. Client-side caching for script methods access in ASP.NET [...]]]></description>
			<content:encoded><![CDATA[<h3>.NET/C# Programming</h3>
<ul>
<li><a href="http://www.codeproject.com/KB/threads/WaitPulse.aspx">Thread synchronization: Wait and Pulse demystified</a>. By Nick Butler.</li>
<li>Use a shortened GUID for file names and request strings. <a href="http://www.singular.co.nz/blog/archive/2007/12/20/shortguid-a-shorter-and-url-friendly-guid-in-c-sharp.aspx">ShortGuid &#8211; A shorter and url friendly GUID class in C#</a>. By Dave Transom.</li>
<li><a href="http://www.xml.com/pub/a/2002/08/14/xpath_tips.html">Top Ten Tips to Using XPath and XPointer</a>. By John E. Simpson.</li>
<li><a href="http://www.codeproject.com/KB/ajax/ScriptMethodClientCache.aspx?display=Print">Client-side caching for script methods access in ASP.NET AJAX</a>, by Jeffrey Zhao.</li>
<li>A very nice two-part <a href="http://www.west-wind.com/presentations/jQuery/default.aspx">introduction to jQuery</a>, by Rick Strahl.</li>
<li><a href="http://www.25hoursaday.com/CsharpVsJava.html">A COMPARISON OF MICROSOFT&#8217;S C# PROGRAMMING LANGUAGE TO SUN MICROSYSTEMS&#8217; JAVA PROGRAMMING LANGUAGE</a>. By Dare Obasanjo.</li>
<li><strong>Silverlight</strong>
<ul>
<li><a href="http://weblogs.asp.net/scottgu/pages/silverlight-2-end-to-end-tutorial-building-a-digg-search-client.aspx">Silverlight 2 End to End Tutorial: Building a Digg Search Client</a>, by Scott Guthrie.</li>
<li><a href="http://www.silverlightexamples.net/post/Fluid-Canvas-in-Silverlight.aspx">Fluid Canvas in Silverlight</a>, by neo.</li>
</ul>
</li>
<li><strong>WCF</strong>
<ul>
<li><a href="http://blogs.msdn.com/wenlong/archive/2007/10/27/performance-improvement-of-wcf-client-proxy-creation-and-best-practices.aspx">Performance Improvement for WCF Client Proxy Creation in .NET 3.5 and Best Practices</a>. By Wenlon Dong.</li>
<li><a href="http://blogs.conchango.com/simonevans/archive/2007/09/17/A-comprehensive-guide-to-using-MsmqIntegrationBinding-with-MSMQ-3.0-in-WCF.aspx">A comprehensive guide to using MsmqIntegrationBinding with MSMQ 3.0 in WCF</a>. By Simon Evans.</li>
<li>If your WSE 3.0 Mutual Certificate Authentication web service runs very slowly, try setting <a href="http://msdn.microsoft.com/en-us/library/microsoft.web.services3.design.securitypolicyassertion.establishsecuritycontext.aspx">establishSecurityContext</a> to true.</li>
</ul>
</li>
</ul>
<h3>PowerShell</h3>
<ul>
<li><a href="http://www.codeplex.com/PowerShellCX">PowerShell Community Extensions</a> has very useful cmdlets such as Get/Set-Clipboard, Write-GZip, Start-Process, Select-Xml and many others.</li>
<li>John D. Cook&#8217;s <a href="http://www.johndcook.com/PowerShellCookbook.html">PowerShell Cookbook</a> has lots of useful PowerShell recipes.</li>
</ul>
<h3>Apps and Tools</h3>
<ul>
<li>Microsoft <a href="http://www.microsoft.com/windows/products/winfamily/sharedaccess/default.mspx">Windows SteadyState</a> (free) is great for maintaining public-access computers.</li>
</ul>
<h3>Other Stuff</h3>
<ul>
<li><a href="http://www.theregister.co.uk/2008/08/22/anatomy_of_a_hack/">Anatomy of a malware scam &#8211; The evil genius of XP Antivirus 2008</a>. By Jesper M. Johansson. If you&#8217;ve had to help your relatives and friends clean up after XP Antivirus 2008/2009, read this very detailed analysis of the malware.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20090212/bag-of-links-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bag of Links #1</title>
		<link>http://www.chinhdo.com/20090123/bags-of-links-1/</link>
		<comments>http://www.chinhdo.com/20090123/bags-of-links-1/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 03:52:21 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[Dotnet/.NET - C#]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software/tools]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Windows Mobile / Pocket PC]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/?p=269</guid>
		<description><![CDATA[A while ago I had been posting my Finds of the Weeks series and this is the continuation of that. Instead of weekly though, this series will be more of a &#8220;whenever possible&#8221; kind of thing. General Programming Some code optimizations can actually slow down your app. Beautiful Code: False Optimizations by sernaferna. Quad core [...]]]></description>
			<content:encoded><![CDATA[<p>A while ago I had been posting my <a href="http://www.chinhdo.com/?s=Finds+of+the+Week" target="_blank">Finds of the Weeks</a> series and this is the continuation of that. Instead of weekly though, this series will be more of a &#8220;whenever possible&#8221; kind of thing.</p>
<h3>General Programming</h3>
<ul>
<li>Some code optimizations can actually slow down your app. <a href="http://sernaferna.blogspot.com/2008/07/beautiful-code-false-optimizations.html">Beautiful Code: False Optimizations</a> by sernaferna.</li>
<li><a href="http://www.sharepointblogs.com/craiglussier/archive/2008/07/04/quad-core-8gb-ram-server-2008-with-hyper-v-a-great-dev-environment.aspx">Quad core + 8GB RAM + Server 2008 with Hyper-V = A Great Dev Environment</a>. By Craig Lussier.</li>
<li>I started using <a href="http://jquery.com/">JQuery</a> a few months ago and it&#8217;s now my favorite Javascript library. Combine with <a href="http://weblogs.asp.net/scottgu/archive/2008/11/21/jquery-intellisense-in-vs-2008.aspx">Visual Studio 2008&#8242;s Javascript intellisense</a>, and you have scripting nirvana.</li>
<li><a href="http://dev.iceburg.net/jquery/jqModal/">jqModal</a> is a modal dialog plug-in for JQuery. Worked great for a project I was working on two months ago.</li>
<li><a href="http://my.safaribooksonline.com/0596100655/eclipsepg-CHP-1" target="_blank">Safari Books Online</a> is a great online programming books service. For a monthly fee, you get to read several books using your browser. The browser interface is not great, but the price is much lower than actually buying the book.<a href="http://www.chinhdo.com/wp-content/uploads/2009/01/image3.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://www.chinhdo.com/wp-content/uploads/2009/01/image-thumb3.png" border="0" alt="Safari Online Books" width="470" height="367" /></a></li>
<li>Randomly ordering an array is simple. That&#8217;s what I thought until I ran across <a href="http://aspnet.4guysfromrolla.com/articles/070208-1.aspx" target="_blank">Techniques for Randomly Reordering an Array</a> (by Scott Michell).</li>
</ul>
<h3>.NET/C# Stuff</h3>
<ul>
<li>Eugene Osovetsky explained a few peculiarities when consuming WCF services from Visual Studio 2003: <a href="http://blogs.msdn.com/eugeneos/archive/2007/02/05/solving-the-disappearing-data-issue-when-using-add-web-reference-or-wsdl-exe-with-wcf-services.aspx" target="_blank">Solving the &#8220;disappearing data&#8221; issue when using Add Web Reference or Wsdl.exe with WCF services</a>.</li>
<li>If you have a DataReader and don&#8217;t intend to read all records from it, call <a href="http://msdn.microsoft.com/en-us/library/system.data.idbcommand.cancel.aspx" target="_blank">IDbCommand.Cancel</a> before you call IDataReader.Close so that the rest of the unread records are skipped.</li>
<li>Scott Hanselman: <a href="http://www.hanselman.com/blog/CommentView.aspx?guid=a6959f2b-bd77-41d7-8600-0f5037cf0f06#commentstart" target="_blank">Assembly Fiefdoms: What&#8217;s the Right Number of Assemblies/Libraries?</a></li>
<li><a href="http://weblogs.asp.net/savanness/archive/2003/07/22/10417.aspx" target="_blank">VS.NET Tip of the Day: Reusing C# Source Code Across Multiple Assemblies</a>. By ShawnVN.</li>
<li><a href="http://insario.com/blog/jfk/archive/2004/11/30/164.aspx" target="_blank">Setting the log file location at runtime with a DOM configured log4net</a>. By Keyley on Kode.</li>
<li>WCF &#8211; <a href="http://msdn.microsoft.com/en-us/library/aa702726.aspx" target="_blank">Recommended Settings for Tracing and Message Logging</a>. MSDN.</li>
<li>WCF &#8211; <a href="http://blogs.msdn.com/drnick/archive/2007/07/18/enabling-performance-counters.aspx" target="_blank">Enabling Performance Counters</a>. By Nicholas Allen.</li>
<li>One of these days I&#8217;ll get back into Windows Mobile programming. <a href="http://msdn.microsoft.com/en-us/magazine/cc163341.aspx" target="_blank">Adjust Your Ring Volume For Ambient Noise</a>, Chris Mitchell.</li>
<li>Did you know ReSharper supports wildcards in its Go To Type dialog box? Joe White&#8217;s <a href="http://blog.excastle.com/2007/01/31/blog-event-the-31-days-of-resharper/" target="_blank">31 Days of ReSharper</a> series is a must read for ReSharper fanatics like me.</li>
<li>Is image processing in C++ a thing of the past? <a href="http://www.devx.com/dotnet/Article/18163/1954?pf=true" target="_blank">Discover Enhanced Image Manipulation with GDI+</a> (by Tade Oyebode).</li>
<li><a href="http://msdn.microsoft.com/en-us/library/system.runtime.serialization.datacontractserializer.aspx" target="_blank">DataContractSerializer</a> can be used to deserialize WCF messages.</li>
<li><a href="http://www.codeproject.com/KB/dotnet/mysteriesofconfiguration.aspx" target="_blank">Unraveling the Mysteries of .NET 2.0 Configuration</a>, by Jon Rista.</li>
</ul>
<h3>Database</h3>
<ul>
<li>Stefan Delmarco talked about the <a href="http://www.fotia.co.uk/fotia/DY.19.NewSequentialId.aspx" target="_blank">NEWSEQUENTIALID function</a> in SQL Server 2005.</li>
<li>Mutexes are fun: <a href="http://www.sqlteam.com/article/application-locks-or-mutexes-in-sql-server-2005" target="_blank">Application Locks (or Mutexes) in SQL Server 2005</a>. Mladen Prajdic.</li>
</ul>
<h3>Windows</h3>
<ul>
<li>Experiencing strange issues with your Windows (like dialog boxes that don&#8217;t show up)? You may be having a desktop heap issue. Try these articles:
<ul>
<li><a href="http://weblogs.asp.net/kdente/archive/2004/06/04/148145.aspx" target="_blank">Windows XP flakiness &#8211; solved</a>. By Kevin Dente.</li>
<li><a href="http://support.microsoft.com/kb/126962" target="_blank">&#8220;Out of Memory&#8221; error message appears when you have a large number of programs running</a>. Microsoft Support.</li>
</ul>
</li>
<li>If IE crashes when you try to open SharePoint documents, try this fix: regsvr32 &#8220;C:\Program Files\Microsoft Office\OFFICE11\OWSSUPP.DLL&#8221;.</li>
</ul>
<h3>Software, Tools, etc.</h3>
<ul>
<li>If you have a Linksys WRT54* router, I highly recommend loading <a href="http://www.polarcloud.com/tomato" target="_blank">Tomato firmware</a>. I have been using it for about 6 months now and it&#8217;s so much better than the built-in Linksys firmware. Tomato&#8217;s QOS works great to make sure my Vonage phone line remains usable at all times.<a href="http://www.chinhdo.com/wp-content/uploads/2009/01/image4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" src="http://www.chinhdo.com/wp-content/uploads/2009/01/image-thumb4.png" border="0" alt="Tomato firmware" width="454" height="314" /></a></li>
</ul>
<h3>PowerShell</h3>
<ul>
<li>Ben Pierce posted a series of very useful PowerShell command-line demos: <a href="http://blogs.technet.com/benp/archive/2008/06/12/tech-ed-2008-demo-1-administering-windows.aspx" target="_blank">Demo1</a> (Administering Windows), <a href="http://blogs.technet.com/benp/archive/2008/06/12/tech-ed-2008-demo-2-administering-servers-in-bulk.aspx" target="_blank">Demo 2</a> (Administering Servers in bulk), <a href="http://blogs.technet.com/benp/archive/2008/06/12/tech-ed-2008-demo-3-how-do-i-know-which-classes-to-use.aspx" target="_blank">Demo 3</a> (How do I Know Which Class to Use), <a href="http://blogs.technet.com/benp/archive/2008/06/12/tech-ed-2008-demo-4-administering-hyper-v.aspx" target="_blank">Demo 4</a> (Administering Hyper-V).</li>
</ul>
<h3>Something Different</h3>
<ul>
<li><a href="http://vimeo.com/1470875">World War</a> is a very nicely done digital animation by Vincent Chai. My son can watch it for hours.</li>
<li>Your browsing history can be used by any web site out there to guess your gender. <a href="http://www.mikeonads.com/2008/07/13/using-your-browser-url-history-estimate-gender/">Using your browser URL history to estimate gender</a>, by Mike on Ads.</li>
<li><a href="http://vimeo.com/moogaloop.swf?clip_id=1778399&amp;server=vimeo.com&amp;sho">Humans can fly</a> (video).</li>
<li>A fascinating into the human mind: <a href="http://www.newyorker.com/reporting/2007/04/16/070416fa_fact_colapinto?currentPage=all" target="_blank">The Interpreter</a> (Has a remote Amazonian tribe upended our understanding of language?). By John Colapinto.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20090123/bags-of-links-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Interesting Finds &#8211; August 27, 2008</title>
		<link>http://www.chinhdo.com/20080827/interesting-finds-20080827/</link>
		<comments>http://www.chinhdo.com/20080827/interesting-finds-20080827/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 03:54:46 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[Dotnet/.NET - C#]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/20080827/find-of-the-week-20080625/</guid>
		<description><![CDATA[If you are a subscriber to my blog, you may have noticed that I have not been posting my more &#8220;Finds of the Week&#8221; in the last 2 months. Well, I was a little busy with the month-long Euro 2008 tournament in June, plus a couple of new games (Crysis and Medieval Total War II). [...]]]></description>
			<content:encoded><![CDATA[</p>
<p>If you are a subscriber to my blog, you may have noticed that I have not been posting my more &#8220;Finds of the Week&#8221; in the last 2 months. Well, I was a little busy with the month-long Euro 2008 tournament in June, plus a couple of new games (Crysis and Medieval Total War II). Finally the Olympics in August finished me off.</p>
<p>I am going to turn this series into a periodic (as in longer than weekly <img src='http://www.chinhdo.com/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> ) Interesting Finds series from now on.</p>
<p>Oh, if you want to know&#8230; Crysis is ok. Very good graphics and requires a hot rod box but gameplay is just ok. I am more into realistic squad-based shooters. Medieval 2 is very addictive.</p>
<h3>.NET, C#</h3>
<ul>
<li>I can&#8217;t believe I didn&#8217;t know about <a href="http://msdn.microsoft.com/en-us/library/system.threadstaticattribute.aspx">ThreadStaticAttribute</a>. While searching for more information on it, I ran across this interesting article on MSDN Magazine: <a href="http://msdn.microsoft.com/en-us/magazine/cc300805.aspx">Scope&lt;T&gt; and More</a> (Stephen Toub) that talked about the use of ThreadStatic in System.Transactions.
<li><a href="http://weblogs.asp.net/ashraful/archive/2008/06/24/10-tools-which-i-left-after-using-vsts-2008.aspx">10 Tools Which I Left After Using VSTS 2008</a>. By joycsharp.
<li><a href="http://blog.bluecog.co.nz/archives/2008/06/23/ndepend-deep-code-metrics/">NDepend &#8211; deep code metrics</a>. By John-Daniel Trask.</li>
</ul>
<h3>Programming, General</h3>
<ul>
<li>Windows Vista and Server 2008 bring us Transactional NTFS. Find out more with <a href="http://msdn.microsoft.com/en-us/magazine/cc163388.aspx">Enhance Your Apps With File System Transactions</a>. Jason Olson, MSDN.
<li><a href="http://angryhacker.com/blog/archive/2008/06/20/10-reasons-why-sql-server-2008-is-going-to-rock.aspx">10 reasons why SQL Server 2008 is going to rock</a>. By Angry Hacker.</li>
</ul>
<h3>PowerShell</h3>
<ul>
<li>I am finding more and more things I can do with PowerShell everyday. The other day I had to &#8220;touch&#8221; a file&#8230; two lines is what it takes:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ -->
<pre class="csharpcode">PS C:\Users\Cdo\AppData\Local\Temp&gt; $f = ls testFile.txt
PS C:\Users\Cdo\AppData\Local\Temp&gt; $f.LastWriteTime = new-object System.DateTime 2007,12,31
PS C:\Users\Cdo\AppData\Local\Temp&gt; ls testFile.txt

    Directory: Microsoft.PowerShell.Core\FileSystem::C:\Users\Cdo\AppData\Local\Temp

Mode                LastWriteTime     Length Name
----                -------------     ------ ----
-a---        12/31/2007  12:00 AM          8 testFile.txt

PS C:\Users\Cdo\AppData\Local\Temp&gt;</pre>
</li>
</ul>
<h3>Something Different</h3>
<ul>
<li><a href="http://www.youtube.com/watch?v=6pXuBibPeeU">Euro 2008 Official Match Ball &#8211; special production film</a> [video]. Yes, I was a little obsessed with Euro 2008.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20080827/interesting-finds-20080827/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Touching a File with PowerShell</title>
		<link>http://www.chinhdo.com/20080625/powershell-touch-file/</link>
		<comments>http://www.chinhdo.com/20080625/powershell-touch-file/#comments</comments>
		<pubDate>Thu, 26 Jun 2008 01:48:36 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/20080625/powershell-touch-file/</guid>
		<description><![CDATA[I am finding more and more things I can do with PowerShell everyday. The other day, I had to &#8220;touch&#8221; a file&#8230; one line is what it takes: (ls testFile.txt).LastWriteTime = New-object DateTime 1991,12,31]]></description>
			<content:encoded><![CDATA[<p>I am finding more and more things I can do with PowerShell everyday. The other day, I had to &#8220;touch&#8221; a file&#8230; one line is what it takes:</p>
<p><!-- code formatted by http://manoli.net/csharpformat/ -->
<pre class="csharpcode">(ls testFile.txt).LastWriteTime = New-object DateTime 1991,12,31
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20080625/powershell-touch-file/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Finds of the Week &#8211; March 30, 2008</title>
		<link>http://www.chinhdo.com/20080331/finds-of-the-week-march-30-2008/</link>
		<comments>http://www.chinhdo.com/20080331/finds-of-the-week-march-30-2008/#comments</comments>
		<pubDate>Mon, 31 Mar 2008 08:53:54 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[Dotnet/.NET - C#]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Software/tools]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/20080331/finds-of-the-week-march-30-2008/</guid>
		<description><![CDATA[Programming Lighten up, you&#8217;re having fun. Says Kyle Baley. Sergio Pereira shares tips on how to get more work done: Automation FTW. Green tests != proven code. By Derik Whittaker. &#34;k&#34; explains deadlocking with The Parable of the Bathroom. .NET/C# ASP.NET MVC Source Code Now Available. By Scott Guthrie. Patrick Smacchia: I want non-nullable types [...]]]></description>
			<content:encoded><![CDATA[<h3>Programming</h3>
<ul>
<li><a href="http://codebetter.com/blogs/kyle.baley/archive/2008/03/25/lighten-up-you-re-having-fun.aspx">Lighten up, you&#8217;re having fun</a>. Says Kyle Baley.</li>
<li>Sergio Pereira shares tips on how to get more work done: <a href="http://devlicio.us/blogs/sergio_pereira/archive/2008/03/27/automation-ftw.aspx">Automation FTW</a>.</li>
<li><a href="http://devlicio.us/blogs/derik_whittaker/archive/2008/03/26/green-tests-proven-code.aspx">Green tests != proven code</a>. By Derik Whittaker.</li>
<li>&quot;k&quot; explains deadlocking with <a href="http://karlagius.wordpress.com/2008/03/23/the-parable-of-the-bathroom/">The Parable of the Bathroom</a>.</li>
</ul>
<h3>.NET/C#</h3>
<ul>
<li><a href="http://weblogs.asp.net/scottgu/archive/2008/03/21/asp-net-mvc-source-code-now-available.aspx">ASP.NET MVC Source Code Now Available</a>. By Scott Guthrie.</li>
<li>Patrick Smacchia: <a href="http://codebetter.com/blogs/patricksmacchia/archive/2007/07/25/i-want-non-nullable-types-in-c-4.aspx">I want non-nullable types in C#4</a>.</li>
<li><a href="http://www.devmuse.com/2008/03/19/converttoint32-vs-cast/">Why Convert.ToInt32 Might be dangerous</a>. DevMuse.</li>
<li><a href="http://www.dotnetkicks.com/csharp/FormatWith_2_0_String_formatting_with_named_variables">FormatWith 2.0 &#8211; String formatting with named variables</a>. By James Newton.</li>
<li><a href="http://dotnetfacts.blogspot.com/2008/03/how-to-optimize-memory-usage-with.html">How to: Optimize the memory usage with strings</a>. Dot Net Facts.</li>
<li>Dan Rigsby demonstrates a technique to <a href="http://www.danrigsby.com/blog/index.php/2008/03/28/how-to-grayout-an-image-in-net/">grayout an image in .Net</a>.</li>
<li><a href="http://msdn2.microsoft.com/en-us/magazine/cc163590.aspx">Discover Mighty Instance Management Techniques For Developing WCF Apps</a>. By Juval Lowy.</li>
<li>Good introduction to ASP.NET MVC from Chris Tavares: <a href="http://msdn2.microsoft.com/en-us/magazine/cc337884.aspx">Building Web Apps without Web Forms</a>.</li>
</ul>
<h3>PowerShell</h3>
<ul>
<li>PowerShell 2.0 has script debugging! Bart de Smet has more on his article: <a href="http://community.bartdesmet.net/blogs/bart/archive/2008/03/26/windows-powershell-2-0-feature-focus-script-debugging.aspx">Windows PowerShell 2.0 Feature Focus &#8211; Script Debugging</a>.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20080331/finds-of-the-week-march-30-2008/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Finds of the Week &#8211; March 2, 2008</title>
		<link>http://www.chinhdo.com/20080304/finds-of-the-week-20080302/</link>
		<comments>http://www.chinhdo.com/20080304/finds-of-the-week-20080302/#comments</comments>
		<pubDate>Tue, 04 Mar 2008 05:56:34 +0000</pubDate>
		<dc:creator>Chinh Do</dc:creator>
				<category><![CDATA[Dotnet/.NET - C#]]></category>
		<category><![CDATA[PowerShell]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Windows Mobile / Pocket PC]]></category>

		<guid isPermaLink="false">http://www.chinhdo.com/20080304/finds-of-the-week-20080302/</guid>
		<description><![CDATA[Programming Very good tips to gain a better understanding of your Project Managers: 10 things Project Managers wish Developers understood. By Frank Kelly. Jakob Nielsen&#8217;s Top-10 Application-Design Mistakes point out some common design problems that can be easily avoided. What&#8217;s your favorite code search engine? Learn to search for code better with one of these [...]]]></description>
			<content:encoded><![CDATA[</p>
<h3>Programming</h3>
<ul>
<li>Very good tips to gain a better understanding of your Project Managers: <a href="http://softarc.blogspot.com/2008/02/ten-things-developers-would-know-if.html">10 things Project Managers wish Developers understood</a>. By Frank Kelly. </li>
<li>Jakob Nielsen&#8217;s <a href="http://www.useit.com/alertbox/application-mistakes.html">Top-10 Application-Design Mistakes</a> point out some common design problems that can be easily avoided. </li>
<li>What&#8217;s your favorite code search engine? Learn to search for code better with one of these <a href="http://knightknetwork.com/2007/09/13/5-great-code-search-engines/">5 Great Code Search Engines!</a>. By David Knight. </li>
</ul>
<h3>C#.NET</h3>
<ul>
<li>Scott Guthrie provided an extensive <a href="http://weblogs.asp.net/scottgu/archive/2008/02/28/first-look-at-using-expression-blend-with-silverlight-2.aspx">First Look at Using Expression Blend with Silverlight 2</a>. </li>
<li><a href="http://www.sitechno.com/Blog/CircularReferencesWithWCFSolvedADifferentWay.aspx">Circular references with WCF: solved a different way</a>. By Ruurd Boeke. </li>
<li>Bored with nothing to read? Check out <a href="http://www.yoda.arachsys.com/csharp/">Jon Skeet&#8217;s C# and .NET articles and links</a>. Lots of good stuff to peruse. </li>
<li>Keith Brown&#8217;s <a href="http://msdn2.microsoft.com/en-us/magazine/cc163531.aspx">Security Briefs: Limited User Problems and Split Knowledge</a> discusses WCF services running under normal user accounts. </li>
<li>WCF &#8211; <a href="http://www.theserverside.net/tt/articles/showarticle.tss?id=SecuringWCFService">Securing your WCF service</a>. By William Tay. </li>
<li>WCF &#8211; <a href="http://www.code-magazine.com/article.aspx?quickid=0611051&amp;page=1">Fundamentals of WCF Security</a>. By Michele Leroux. </li>
</ul>
<h3>.NET Tips &amp; Tricks</h3>
<ul>
<li>Did you know you can <a href="http://msdn2.microsoft.com/en-us/library/581hfskb(VS.80).aspx">give threads any names you want</a> (MSDN)? The names are extremely useful when it comes to debugging time:       </p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="130" alt="Thread names and debugging" src="http://www.chinhdo.com/wp-content/uploads/2008/03/image.png" width="220" border="0" /> </li>
<li>System.IO.Directory.CreateDirectory will create all directories and subdirectories as specified by the path parameter. No need to write code to create each directory in the chain. Just do this:
<pre class="csharpcode">Directory.CreateDirectory(<span class="str">@&quot;c:\MyApp\Env\Dev&quot;</span>);</pre>
</li>
<li>System.IO.Path.GetDirectoryName returns the directory name from a fully qualified file name.<br />
    </li>
</ul>
<h3>Powershell</h3>
<ul>
<li><a href="http://www.hanselman.com/blog/2008WindowScriptingGamesAdvancedPowerShellEvent7.aspx">Round-robin game scheduling algorithm in Powershell</a>. By Scott Hanselman. Check out my C# 2.0 algorithm in the comments section. </li>
<li>Mitch Denny wrote <a href="http://notgartner.wordpress.com/2008/02/23/how-to-host-the-powershell-runtime/">How To: Host the PowerShell Runtime</a>. </li>
<li>Use Powershell array expression syntax @(&#8230;) allows you to force a scalar return value to be wrapped in a array, if it&#8217;s not already in an array. I learned about this the hard way while trying to figure out while Get-Childitem sometimes returns an array and sometimes a scalar. Bruce Payette wrote more about it <a href="http://blogs.msdn.com/powershell/archive/2007/01/23/array-literals-in-powershell.aspx">here</a>. </li>
</ul>
<h3>Windows Mobile / Pocket PC</h3>
<ul>
<li>I needed a way to stream music and other media to my Windows Mobile phone (Samsung SCH-i760) and all the PCs around the house. <a href="http://www.orb.com">Orb</a> seems to be the answer. I&#8217;ve only had it running for a few days but it seems to be working great. I can stream music and photos (have not tested videos yet) to any PC in the house or anywhere on the net. I can also listen to my entire music library on my i760 phone anytime, anywhere through Verizon Wireless&#8217;s unlimited (with a catch&#8230; not to exceed 5GB) EDVO connection.
<p><a href="http://www.chinhdo.com/wp-content/uploads/2008/03/image1.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="328" alt="Orb Mycast" src="http://www.chinhdo.com/wp-content/uploads/2008/03/image-thumb.png" width="450" border="0" /></a> </p>
<p></li>
<li>I am a Google Mobile guy, but <a href="http://mobile.yahoo.com">Yahoo! Go for Windows Mobile</a> also looks very cool. I downloaded it to my Samsung SCH-i760 a few days ago. I am still checking it out but here are a few things I like:
<ul>
<li>Nice and responsive interface. </li>
<li>Built-in RSS Reader. </li>
<li>Street and satellite maps.
<p>Here are a few screenshots: </p>
<p><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="210" alt="Yahoo! Go" src="http://www.chinhdo.com/wp-content/uploads/2008/03/image2.png" width="222" border="0" /> </p>
<p><a href="http://www.chinhdo.com/wp-content/uploads/2008/03/image3.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="220" alt="Yahoo! Go" src="http://www.chinhdo.com/wp-content/uploads/2008/03/image-thumb1.png" width="247" border="0" /></a> </p>
<p><a href="http://www.chinhdo.com/wp-content/uploads/2008/03/image4.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="241" alt="Yahoo! Go Weather" src="http://www.chinhdo.com/wp-content/uploads/2008/03/image-thumb2.png" width="186" border="0" /></a>&#160; </li>
</ul>
</li>
</ul>
<h3>Software and Tools</h3>
<ul>
<li>
<p>You can configure Notepad++ to always use spaces for tabs/indentation. The option is a little hidden. It&#8217;s in Settings/Preferences/MISC, under Tab Setting: </p>
<p><a href="http://www.chinhdo.com/wp-content/uploads/2008/03/image5.png"><img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="297" alt="Notepad++ tab to spaces setting" src="http://www.chinhdo.com/wp-content/uploads/2008/03/image-thumb3.png" width="426" border="0" /></a> </p>
</li>
</ul>
<h3>Something a Little Different</h3>
<ul>
<li><a href="http://www.break.com/index/roommate-alien-prank-goes-bad.html">Alien Prank Goes Bad</a> (video). </li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://www.chinhdo.com/20080304/finds-of-the-week-20080302/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

