﻿<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Dan's Blog</title>
    <description>Welcome to my blog! This is the place where I publish my thoughts and experiences for my friends and family, and the world, to see. If you have any questions or comments, please feel free to write a comment, and I'll try to get back to you as soon as I have a moment. Thanks, enjoy!</description>
    <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/BlogId/2/Default.aspx</link>
    <language>en-US</language>
    <managingEditor>daniel@dittenhafer.net</managingEditor>
    <webMaster>webmaster@dwd2.info</webMaster>
    <pubDate>Mon, 21 May 2012 00:18:19 GMT</pubDate>
    <lastBuildDate>Mon, 21 May 2012 00:18:19 GMT</lastBuildDate>
    <docs>http://backend.userland.com/rss</docs>
    <generator>Blog RSS Generator Version 3.2.0.29758</generator>
    <item>
      <title>How to Get Error/Exception Details in PowerShell Catch Block</title>
      <description>&lt;span style="font-family:Arial,Helvetica,SansSerif;font-size:larger;"&gt;
For the last couple of weeks I have been required to import a data log file (CSV) from a legacy SCADA system
into my centralized data management system. It occured to me today that I might be able to use PowerShell
to automate some of the importing steps which include import to a DEV, QA and Production system. I'm still
working on this script, but in the process of developing it, I had a need to learn more about an exception
that was occuring in the script. I had my try/catch block already specified, but was simply using Write-Error,
as in the following code sample, to report a generic message "Failed to..." whenever the catch block was executed. 
&lt;pre style="border-style:inset;border-width:thin;font-size:11px;"&gt;
try
{
    $session = Logon...
}
catch
{
    Write-Error "Failed to logon to DMS."
}
&lt;/pre&gt;
&lt;br /&gt;
I searched the local PowerShell help and didn't see any info on how to get more detail about a given exception. I searched a little online including
&lt;a href="http://technet.microsoft.com/en-us/library/dd315350.aspx"&gt;about_Try_Catch_Finally&lt;/a&gt;  
and didn't find any gems. Then I thought "Maybe there is a global object, 
like &lt;code style="color:red"&gt;$host&lt;/code&gt;, that as some error info". I tried $Err and $Error with no success... then I tried &lt;strong&gt;&lt;code style="color:red"&gt;$_&lt;/code&gt;&lt;/strong&gt; and surprise! 
It resulted in an object with exception details! See the code sample below, where the &lt;code style="color:red"&gt;$_&lt;/code&gt; object is used in the catch block and converted to a string for output
to the Write-Error stream.
&lt;pre style="border-style:inset;border-width:thin;font-size:11px;"&gt;
try
{
    $session = Logon...
}
catch
{
    # Using $_ in the catch block to include more details about the error that occured.
    Write-Error ("Failed to logon to DMS." + $_)
}
&lt;/pre&gt;
&lt;br /&gt;
When run through Get-Member, the $_ object in the catch block returns the following result:
&lt;pre style="border-style:inset;border-width:thin;font-size:11px;"&gt;
   TypeName: System.Management.Automation.ErrorRecord

Name                  MemberType     Definition
----                  ----------     ----------
Equals                Method         bool Equals(System.Object obj)
GetHashCode           Method         int GetHashCode()
GetObjectData         Method         System.Void GetObjectData(System.Runtime.Serialization.SerializationInfo info, 
                                     System.Runtime.Serialization.StreamingContext context)
GetType               Method         type GetType()                                        
ToString              Method         string ToString()                                     
CategoryInfo          Property       System.Management.Automation.ErrorCategoryInfo CategoryInfo {get;}
ErrorDetails          Property       System.Management.Automation.ErrorDetails ErrorDetails {get;set;} 
Exception             Property       System.Exception Exception {get;}                                 
FullyQualifiedErrorId Property       System.String FullyQualifiedErrorId {get;}                        
InvocationInfo        Property       System.Management.Automation.InvocationInfo InvocationInfo {get;} 
PipelineIterationInfo Property       System.Collections.ObjectModel.ReadOnlyCollection`1[[System.Int32, mscorlib, 
                                     Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089]] 
                                     PipelineIterationInfo {get;}
TargetObject          Property       System.Object TargetObject {get;}                             
PSMessageDetails      ScriptProperty System.Object PSMessageDetails {get=&amp; { Set-StrictMode -Version 1; 
                                     $this.Exception.InnerException.PSMessageDetails };}
&lt;/pre&gt;
&lt;br /&gt;
Of course, after having figured this out, I thought "Hmm... I bet others might have the same question about getting more exception detail inside a catch block", and so was born this blog entry.
Hope it helps!
&lt;/span&gt;</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/21/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/21/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=21</guid>
      <pubDate>Mon, 02 May 2011 07:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=21</trackback:ping>
    </item>
    <item>
      <title>Lessons Learned from the 2011 Scripting Games</title>
      <description>&lt;span style="width:525px;" &gt;
I joined the &lt;a href="http://2011sg.poshcode.org"&gt;2011 Scripting Games&lt;/a&gt; as a beginner. I was aware of PowerShell and had even written a decent script at one point a couple years ago to modify an XML file, but generally PowerShell wasn’t part of my toolbox and I wasn’t specifically seeking to make it so. Then came the &lt;a href="http://www.bing.com/search?q=PowerShell%3A+Learn+It+Now+before+It+is+an+Emergency"&gt;PowerShell: Learn It Now before It's an Emergency&lt;/a&gt; LiveMeeting series presented by &lt;a href="http://twitter.com/scriptingguys"&gt;Scripting Guy Ed Wilson&lt;/a&gt;. I attended some of the sessions and learned some good bits about syntax and pipelining along with the actual topics being covered like how to use the Get-Process cmdlet. Ed mentioned the Scripting Games were coming up, and I thought, “Hmm, this isn’t too difficult; I bet I could enter as a beginner, maybe do pretty well in the competition, and definitely practice PowerShell to the point where it would be a tool in my toolbox.” 
&lt;br /&gt;&lt;br /&gt;
Now that the Scripting Games are coming to a close, I’ve decided to write down some of the things I felt held my scripts back even when 
I thought I had met all the scenario requirements.
&lt;br /&gt;&lt;br /&gt;
The scripting games are a bit like golf. As a competitor, you are playing against the course first, and against your fellow competitors second. During my “round” of 10 beginner events I started off strong with 3.5 stars on event 1, and quickly descended to 1.5 stars on event 2. I’m still waiting for results for the later events, but based on judge’s comments so far and drawing some of my own conclusions in some cases, I’ve put together the following list of lessons learned from the 2011 Scripting Games:
&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;Return objects&lt;/strong&gt; – Unless otherwise required by the scenario, return an object or array of objects (and not the result of ConvertTo-CSV) on the pipeline 
at the end of your script so that consumers of said script can gracefully continue processing. A good reference for this tip comes 
from #9 on James O’Neill’s blog post &lt;a href="http://jamesone111.wordpress.com/2011/04/10/ten-tips-for-better-powershell-functions/"&gt;Ten tips for better PowerShell functions&lt;/a&gt; as well as #3 from Ed Wilson’s &lt;a href="http://blogs.technet.com/b/heyscriptingguy/archive/2011/04/10/top-ten-suggestions-at-the-end-of-week-1-of-the-2011-scripting-games.aspx"&gt;Top Ten Suggestions at the End of Week 1 of the 2011 Scripting Games&lt;/a&gt;.
&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;Specify parameter defaults&lt;/strong&gt; – Where appropriate, default values for parameters are very useful and can be specified directly in the Param block of 
your script or function instead of embedding them in the script with “if” statements and such. Here is an example of a simple parameter definition with a the default
message "Default message":
&lt;br /&gt;
&lt;pre&gt;
Param
( 
    [parameter(Mandatory=$false)]
    [String] $Message = "Default message"
)
&lt;/pre&gt;
I’m not sure if I missed out on stars due to using the “if“ statement approach instead of the Param approach (above), but I certainly learned about it during the games and feel it is a better approach.
&lt;br /&gt;
&lt;strong&gt;Where Array does not contain Value&lt;/strong&gt; – I learned this from a comment left by Scripting Games Judge &lt;a href="http://twitter.com/claustn"&gt;Claus Nielsen&lt;/a&gt;. I had put together a foreach loop in the script block of the Where clause similar to the following:
&lt;br /&gt;&lt;br /&gt;
&lt;code&gt;
… | where {$bInc = $true; foreach($str in $Exclude) { if($_.startname.ToUpper() -eq $str) { $bInc = $false; break;} }; $bInc;} | …
&lt;/code&gt;
&lt;br /&gt;&lt;br /&gt;
As you can see, the above Where script block is not very elegant and just asking for bugs.
Claus suggested the following, which is not only more readable, but a good use for the conditional operator &lt;code&gt;-notcontains&lt;/code&gt; which I hadn’t known existed previously:
&lt;br /&gt;&lt;br /&gt;
&lt;code&gt;
… | where {$Exclude -notcontains $_.startname } | …
&lt;/code&gt;
&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;Splatter!&lt;/strong&gt; - Midway through the games, Scripting Games Judge &lt;a href="http://twitter.com/@Steven Murawski"&gt;Steven Murawski&lt;/a&gt; published the 
article &lt;a href="http://blog.usepowershell.com/2011/04/clean-up-your-parameters/"&gt;Clean Up Your Parameters&lt;/a&gt; 
    about the PowerShell v2 feature known as "splatting". Basically, with splatting, 
    you can wrap up all the parameters you would pass to a cmdlet inside a custom 
    object and then simply pass the object variable to the cmdlet. He points out 
    that this can improve code readability and cut down on the lengthy lines of 
    piping often found in PowerShell scripts. For both of these reasons, splatting 
    has become more common in my scripts.
&lt;br /&gt;&lt;br /&gt;
&lt;strong&gt;Select-String&lt;/strong&gt; - Again, a short comment by one of the judges (&lt;a href="http://twitter.com/andys146"&gt;Andy Schneider&lt;/a&gt;) shows how a simple cmdlet can turn 
    6 lines of code into 1. 
&lt;br /&gt;&lt;br /&gt;
My original code:
&lt;br /&gt;
&lt;pre&gt;
$WinUpdateLogFile = "C:\Windows\WindowsUpdate.log";
$logContent = Get-Content $WinUpdateLogFile

foreach($line in $logContent)
{
    if($line.Contains("FATAL"))
    {
        $str = $WinUpdateLogFile + ": " + $line;
        Write-Output $str;
    }
}
&lt;/pre&gt;
And the revised code using Andy's suggestion, Select-String:
&lt;br /&gt;
&lt;pre&gt;
$args = @{Path = "C:\Windows\WindowsUpdate.log"
          Pattern = "FATAL"
          SimpleMatch = $true}

Select-string @args
&lt;/pre&gt;
I used the splatting technique, above, to illustrate but as you can see the revised code is simpler, cleaner, and will be easier to maintain in the future.
&lt;br /&gt;&lt;br /&gt;
These may seem like minor tips to many experienced PowerShell people, but for those of us who are new to PowerShell, each new feature can be make a big difference. 
As I mentioned earlier, I'm still waiting for the results of the last several events and I expect I'll learn just as much from them also. Thanks to Microsoft and
Scripting Guy Ed Wilson for organizing the Scripting Games, and all the sponsors for their support and prizes!
&lt;br /&gt;&lt;br /&gt;
Good luck to all as we approach the end of 2011 Scripting Games!
&lt;/span&gt;
</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/20/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/20/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=20</guid>
      <pubDate>Thu, 21 Apr 2011 07:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=20</trackback:ping>
    </item>
    <item>
      <title>On the Problem of Evil</title>
      <description> In his textbook The Philosophical Journey, William Lawhead defines the problem of evil as “the difficulty of reconciling the existence of suffering and other evils in the world with the existence of God”. Traditionally, philosophers place various types of suffering and unfortunate situations into two categories. The category of Moral Evil encompasses the actions and their side effects that originate from beings that are considered capable of being held morally responsible.</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/19/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/19/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=19</guid>
      <pubDate>Mon, 16 Mar 2009 05:00:00 GMT</pubDate>
      <slash:comments>3</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=19</trackback:ping>
    </item>
    <item>
      <title>Book Review: Pro LINQ Object Relational Mapping with C# 2008</title>
      <description>&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial size=2&gt;I’ve really gotten a lot out of this book. Vijay Mehta does an excellent job of encompassing both ORM and LINQ topics important to professional software development into one affordable text. He opens with an overview of Object Relational Mapping (ORM), and the criteria he uses when evaluating ORM solutions, including a quick synopsis of how LINQ to SQL and the Entity Framework rate against his criteria. This provides a solid basis for understanding where he is coming from throughout the remainder of the book, and a perfect jumping off point for Vijay’s deeper examination of LINQ to SQL and the Entity Framework. For someone who is already familiar with ORM concepts and patterns, you may want to skip the first two chapters, but you’ll also be missing out on the perspective Vijay brings to the remainder of the text. Although there are some syntax errors in the sample code of the first couple chapters (which I was initially distracted by), these were minor and didn’t detract at all from the actual ORM, LINQ to SQL or EF topics. Additionally, I was pleased to see that the author has made much of the source code from the text available as a download from the Apress website (&lt;/FONT&gt;&lt;A href="http://apress.com/book/view/9781590599655"&gt;&lt;U&gt;&lt;FONT face=Arial color=#800080 size=2&gt;http://apress.com/book/view/9781590599655&lt;/FONT&gt;&lt;/U&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt;), which makes experimenting all that much easier.&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoNormal style="MARGIN: 0in 0in 10pt"&gt;&lt;FONT face=Arial size=2&gt;All in all, I would highly recommend this book to anyone looking for both an introduction and an in-depth professional analysis of ORM as it relates to LINQ to SQL or the Entity Framework.&lt;/FONT&gt;&lt;/P&gt;</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/18/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/18/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=18</guid>
      <pubDate>Sun, 24 Aug 2008 05:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=18</trackback:ping>
    </item>
    <item>
      <title>Magna Carta: A Basis for the American Revolution</title>
      <description>&lt;P class=Normal-MLA style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in"&gt;&lt;FONT face=Arial size=2&gt;The Magna Carta, or “Great Charter” in Latin, was written in 1215 by English barons to limit the English monarchy’s power and help prevent a pending civil war &lt;?xml:namespace prefix = w ns = "urn:schemas-microsoft-com:office:word" /&gt;&lt;w:Sdt id=7542852 Citation="t"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;(Fiero 6)&lt;/SPAN&gt;&lt;/w:Sdt&gt;. King John begrudgingly endorsed it, but unfortunately the entire charter was invalidated by Pope Innocent III just weeks after it was signed, and the pending civil war broke out shortly thereafter &lt;w:Sdt id=7542853 Citation="t"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;(Lyon 39)&lt;/SPAN&gt;&lt;/w:Sdt&gt;. Although the Magna Carta of 1215 was slow to change the political landscape of its era, over time it has sunk into the permanent conscience of European governments and provided a precedent for the &lt;/FONT&gt;&lt;A name=OLE_LINK2&gt;&lt;/A&gt;&lt;A name=OLE_LINK1&gt;&lt;SPAN style="mso-bookmark: OLE_LINK2"&gt;&lt;FONT face=Arial size=2&gt;rebellion against the Stamp Act of 1765, a catalyst for the American Revolution.&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P class=Normal-MLA style="MARGIN: 0in 0in 0pt; TEXT-INDENT: 0.5in"&gt;&lt;FONT face=Arial&gt;&lt;/FONT&gt; &lt;/P&gt;&lt;SPAN style="mso-bookmark: OLE_LINK2"&gt;&lt;/SPAN&gt;&lt;SPAN style="mso-bookmark: OLE_LINK1"&gt;&lt;/SPAN&gt;
&lt;P class=Normal-MLA style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;SPAN style="mso-tab-count: 1"&gt;            &lt;/SPAN&gt;The common counsel, an early version of present day English Parliament, was legally permitted in the Magna Carta by clause 14:&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Normal-MLA style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P class=Quote-MLA style="MARGIN: 0in 0in 0pt 1in"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;And for obtaining the common counsel of the kingdom anent&lt;/FONT&gt;&lt;SPAN class=MsoFootnoteReference&gt;&lt;SPAN style="mso-special-character: footnote"&gt;&lt;SPAN class=MsoFootnoteReference&gt;&lt;SPAN style="FONT-SIZE: 12pt; COLOR: black; LINE-HEIGHT: 115%; FONT-FAMILY: 'Times New Roman','serif'; mso-fareast-font-family: Calibri; mso-fareast-theme-font: minor-latin; mso-bidi-theme-font: minor-bidi; mso-themecolor: text1; mso-bidi-font-size: 11.0pt; mso-bidi-font-style: italic; mso-ansi-language: EN-US; mso-fareast-language: EN-US; mso-bidi-language: AR-SA"&gt;&lt;FONT size=2&gt;&lt;SUP&gt;1&lt;/SUP&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;FONT size=2&gt; the assessing of an aid&lt;SUP&gt;2&lt;/SUP&gt;&lt;/FONT&gt;&lt;FONT size=2&gt; (except in the three cases aforesaid) or of a scutage&lt;SUP&gt;3&lt;/SUP&gt;&lt;/FONT&gt;&lt;FONT size=2&gt;, we will cause to be summoned the archbishops, bishops, abbots, earls, and greater barons, severally by our letters… &lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Quote-MLA style="MARGIN: 0in 0in 0pt 1in"&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P class=Normal-MLA style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial size=2&gt;This clause also gives the common counsel the power to levy taxes and, in conjunction with clause 12 (“No scutage nor aid shall be imposed on our kingdom, unless by common counsel of our kingdom…”), effectively stripped the power from the English Monarchy. &lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Normal-MLA style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P class=Normal-MLA style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;SPAN style="mso-tab-count: 1"&gt;            &lt;/SPAN&gt;British Parliament’s Stamp Act of 1765 imposed a tax specifically on the British American colonies by requiring all legal documents to have a tax stamp received only by paying the prescribed stamp duty. This stamp duty was taken so far as to be applied to pamphlets, newspapers, advertisements, playing cards, and even dice &lt;w:Sdt id=10188183 Citation="t"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;(Stamp Act - 1765)&lt;/SPAN&gt;&lt;/w:Sdt&gt;.&lt;SPAN style="mso-spacerun: yes"&gt;  &lt;/SPAN&gt;The British American colonies of the day did not have any level of representation in British Parliament, so this taxation was considered counter to the Magna Carta’s concept of taxation only through representation. Although the Stamp Act was not specifically applied to tea, the Townshend Act, which was enacted during the same period of time, did apply a tax on common products (including tea) which were imported into the British American colonies&lt;w:Sdt id=10188199 Citation="t"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;SPAN style="mso-spacerun: yes"&gt; &lt;/SPAN&gt;(The Townshend Act, November 20, 1767)&lt;/SPAN&gt;&lt;/w:Sdt&gt;. Many colonists became fed up; the Boston Tea Party resulted, and ended up acting as a catalyst for the American Revolution.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=Normal-MLA style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial size=2&gt;&lt;/FONT&gt; &lt;/P&gt;
&lt;P class=Normal-MLA style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT size=2&gt;&lt;FONT face=Arial&gt;&lt;SPAN style="mso-tab-count: 1"&gt;            &lt;/SPAN&gt;The Magna Carta of 1215 was largely a hollow document paying lip service to the demands of the common people of the time. Even still, the ideas expressed in the document, including the concept of taxation only through representation, had a lasting influence on what would be considered acceptable government in the centuries that followed. Thankfully, the colonists of the American colonies realized the injustice that was being forced on them by the British Parliament through the Stamp and Townshend Acts and responded accordingly, leading to the formation of the United States of America.&lt;/FONT&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;DIV style="mso-element: footnote-list"&gt;&lt;BR clear=all&gt;&lt;/DIV&gt;&lt;FONT face=Tahoma size=2&gt;
&lt;DIV style="mso-element: footnote-list"&gt;
&lt;HR align=left width="33%" SIZE=1&gt;
&lt;/DIV&gt;&lt;/FONT&gt;
&lt;P class=MsoFootnoteText style="MARGIN: 0in 0in 0pt; mso-element: footnote"&gt;&lt;FONT face=Tahoma size=2&gt;&lt;SUP&gt;1&lt;/SUP&gt; In regard to&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoFootnoteText style="MARGIN: 0in 0in 0pt; mso-element: footnote"&gt;&lt;FONT face=Tahoma size=2&gt;&lt;SUP&gt;2&lt;/SUP&gt; A tax levied by the King&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoFootnoteText style="MARGIN: 0in 0in 0pt; mso-element: footnote"&gt;&lt;FONT face=Tahoma size=2&gt;&lt;SUP&gt;3 &lt;/SUP&gt;A fee to avoid military service&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoFootnoteText style="MARGIN: 0in 0in 0pt; mso-element: footnote"&gt;
&lt;HR&gt;

&lt;P align=center&gt;&lt;FONT face=Arial size=2&gt;Works Cited&lt;/FONT&gt;&lt;FONT face=Tahoma&gt;&lt;/P&gt;
&lt;P class=MsoBibliography dir=ltr style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial size=2&gt;British Parliament. "Stamp Act - 1765." &lt;U&gt;America's Homepage.&lt;/U&gt; 19 July 2008 &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P class=MsoBibliography dir=ltr style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;HTTP: stamp_act_bp_1765.html ahp.gatech.edu&gt;.&lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;—. "The Townshend Act, November 20, 1767." &lt;U&gt;The Avalon Project at Yale Law &lt;/U&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;U&gt;School.&lt;/U&gt; 19 Juy 2008 &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;HTTP: townsend_act_1767.htm parliament amerrev avalon lawweb www.yale.edu&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;Fiero, Gloria K. &lt;U&gt;The Humanistic Tradition Book 3.&lt;/U&gt; New York: McGraw-Hill, 2006.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial size=2&gt;Lyon, Ann. &lt;U&gt;Constitutional History of the UK.&lt;/U&gt; Portland: Cavendish Publishing Ltd, &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;2003.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;"The Project Gutenberg EBook of The Magna Carta." March 2006. &lt;U&gt;Project &lt;/U&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;U&gt;Gutenberg.&lt;/U&gt; Ed. Michael Hart. 13 July 2008 &lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;&lt;HTTP: magna01.txt etext06 dirs www.gutenberg.org&gt;.&lt;o:p&gt;&lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;SPAN style="mso-no-proof: yes"&gt;&lt;FONT face=Arial size=2&gt;Turner, Ralph V. "The Meaning of Magna Carta Since 1215." &lt;U&gt;History Today&lt;/U&gt; &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;
&lt;P class=MsoBibliography style="MARGIN: 0in 0in 10pt"&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;&lt;SPAN style="mso-no-proof: yes"&gt;(2003): 29-35.&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;&lt;/BLOCKQUOTE&gt;</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/17/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/17/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=17</guid>
      <pubDate>Thu, 24 Jul 2008 07:00:00 GMT</pubDate>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=17</trackback:ping>
    </item>
    <item>
      <title>ListView.DoubleClick Event</title>
      <description>&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Lately I've been answering questions on the &lt;A href="http://forums.microsoft.com/Forums/ShowForum.aspx?ForumID=160&amp;SiteID=1" target=_blank&gt;Microsoft Visual C# forum&lt;/A&gt; and have been recenting focusing on the ListView.DoubleClick event. &lt;A href="http://forums.microsoft.com/Forums/ShowPost.aspx?PostID=3193760&amp;SiteID=1"&gt;A question came up about how to detect which item was actually double clicked in the ListView when the DoubleClick event fired&lt;/A&gt;, especially if the ListView.SelectedItems collection indicated that an item was selected, but the user had double clicked in a non-item area. Remember that the DoubleClick event handler is a non-descrip, standard EventHandler method, so it's parameters are simply the object sender (the ListView is the sender in this case), and the EventsArgs e. Neither are especiall helpful, as one would already have a reference to the ListView as a class member.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;Here is a ZIP file containing a sample C# project that demonstrates hooking the DoubleClick event and using the ListView.HitTest method to determine which item the mouse is doubleclicking on. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;&lt;A href="http://www.dittenhafer.net/downloads/ListViewDoubleClickTest.zip"&gt;http://www.dittenhafer.nethttp://www.dittenhafer.net/downloads/ListViewDoubleClickTest.zip&lt;/A&gt;&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Tahoma size=2&gt;The combining of the HitTest in the DoubleClick event is effective, but I think a more elegant solution is to hook the MouseDoubleClick event instead of the standard DoubleClick event.  The MouseDoubleClick event comes with MouseEventArgs which include the Mouse's position as a Point object at the time the event was fired. This is useful as compared to accessing the Control.MousePosition property realtime in the DoubleClick event because the mouse's position is determined before the event handler is executed. By doing so, the time between double click and mouse position fetching are effectively atomic for the purposes of the event handlers execution.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt; &lt;/P&gt;</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/16/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/16/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=16</guid>
      <pubDate>Sun, 20 Apr 2008 07:00:00 GMT</pubDate>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=16</trackback:ping>
    </item>
    <item>
      <title>Earth, our Home</title>
      <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;We all have a place we call home, but the Earth provides the environment for our homes to exist, and for us to exist as well. The Earth is really our giant hotel in the grand universe of space time, and eventually we all have to checkout. But before I checkout, I hope to leave Earth in an "as good or better" way than I found it. Much has been published in the news and on the Internet about the potential for global climate change, and many people around the world are trying to do their part to help lower overall carbon emissions and slow the process of climate change, but we all must do as much as we can to lower our energy usage and carbon emissions output! President Bush and his administration have made a conscious effort to suppress the scientific news about climate change, and as such some Americans are not as knowledgable about climate change as they should be. But you can help. Talk to people you know, and pass the word around. Remind them that our current primary energy sources (coal and petroleum products) are not renewable or unlimited, and all the processes associated with them, from extraction to refinement, to consumption, contribute to polluting our home, the Earth, and also add to the potential for global climate change. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;We &lt;U&gt;can&lt;/U&gt; live cleaner, greener lives and also be more produtive while doing it, we just have to commit ourselves to doing it by choosing to live on Earth in a sustainable way, without wasteful energy use. Turn off the lights when you aren't using them. And next time a bulb burns out, replace it with a compact flouresent (CFL) blub which uses just a fraction of the energy for an equal light output. Try wearing an extra layer of clothing on the colder days of winter, rather than turning up the central heating. Just remember, you have to make the decision to live greener, then start taking action, living it every day. If every American made that choice, just think of how much energy we can save. &lt;/FONT&gt;&lt;/P&gt;</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/15/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/15/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=15</guid>
      <pubDate>Mon, 15 Oct 2007 07:00:00 GMT</pubDate>
      <slash:comments>4</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=15</trackback:ping>
    </item>
    <item>
      <title>Progress in Iraq?</title>
      <description>&lt;P&gt;&lt;FONT face=Arial&gt;&lt;FONT size=2&gt;You've got to see this video. It's a great reminder of just how hard the Bush Administration is trying to spin this war. &lt;?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /&gt;&lt;o:p&gt; &lt;/o:p&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;FONT face=Arial size=2&gt;This was one of the bloodiest summers for US troops in Iraq, Iraqi casualties are running at twice the pace of last year and 15 of 18 of President Bush's own benchmarks remain unmet. But the White House is telling us that things in Iraq are going just great. Here is a quote from the &lt;A href="http://www.gao.gov/new.items/d071195.pdf" target=_blank&gt;Government Accountability Office's report&lt;/A&gt; (PDF):&lt;/FONT&gt;&lt;/P&gt;&lt;FONT face=Arial size=2&gt;&lt;FONT size=2&gt;
&lt;BLOCKQUOTE dir=ltr style="MARGIN-RIGHT: 0px"&gt;&lt;FONT size=3&gt;
&lt;P align=left&gt;&lt;FONT size=2&gt;The January 2007 U.S. strategy seeks to provide the Iraqi government with the time and space needed to help Iraqi society reconcile. Our analysis of the 18 legislative, security and economic benchmarks shows that as of August 30, 2007, the Iraqi government met 3, partially met 4, and did not meet 11 of its 18 benchmarks. (See next page). Overall, key legislation has not been passed, violence remains high, and it is unclear whether the Iraqi government will spend $10 billion in reconstruction funds. These results do not diminish the courageous efforts of coalition forces. &lt;/FONT&gt;&lt;/P&gt;&lt;FONT size=3&gt;
&lt;P align=left&gt;&lt;FONT size=2&gt;The Iraqi government has met [only] one of eight legislative benchmarks: the rights of minority political parties in Iraq’s legislature are protected.&lt;/FONT&gt; &lt;/P&gt;&lt;/BLOCKQUOTE&gt;
&lt;P dir=ltr align=left&gt;&lt;FONT size=2&gt;It seems plain to me that Iraq's progress is slow and limited at best, and certainly doesn't represent a respect and appreciation for our military and the efforts they make every day to maintain security. "Iraq is making incredible political progress." That is a lie. &lt;/FONT&gt;&lt;/P&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;&lt;/FONT&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;FONT face=Arial size=2&gt;We need to pass this video around widely to remind America that the White House has a bit of a "credibility gap" when it comes to progress in Iraq. Check it out, then forward it on:&lt;/FONT&gt;&lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;&lt;FONT face=Consolas&gt;&lt;/FONT&gt;&lt;/o:p&gt; &lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;o:p&gt;
&lt;OBJECT height=350 width=425&gt;&lt;PARAM NAME="movie" VALUE="http://www.youtube.com/v/ULyka2Bfp04"&gt;&lt;PARAM NAME="wmode" VALUE="transparent"&gt;
&lt;embed src="http://www.youtube.com/v/ULyka2Bfp04" type="application/x-shockwave-flash" wmode="transparent" width="425" height="350"&gt;&lt;/embed&gt;&lt;/OBJECT&gt;&lt;/o:p&gt; &lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt; &lt;/P&gt;
&lt;P class=MsoPlainText style="MARGIN: 0in 0in 0pt"&gt;&lt;A href="http://www.youtube.com/watch?v=ULyka2Bfp04"&gt;http://www.youtube.com/watch?v=ULyka2Bfp04&lt;/A&gt;&lt;/P&gt;</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/14/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/14/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=14</guid>
      <pubDate>Sun, 09 Sep 2007 07:00:00 GMT</pubDate>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=14</trackback:ping>
    </item>
    <item>
      <title>Sailor's Blog</title>
      <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Ever considered buying a sailboat, giving up your land based life, and sailing away in search of discovery? Project Bluesphere is the website and blog of someone who is doing it. Alex Dorsey decided it was time to live out his dream of sailing around the world. Several years ago he found a Westsail 28, refurbished it, and set sail from the east coast of the United States on a journey to new lands. Today Alex is floating around the islands of the Pacific as he makes his way westward around the globe. I've been following his adventures via his blog, along with pictures and video that he posts to &lt;/FONT&gt;&lt;A href="http://www.projectbluesphere.com/"&gt;&lt;FONT face=Arial size=2&gt;http://www.projectbluesphere.com/&lt;/FONT&gt;&lt;/A&gt;&lt;FONT face=Arial size=2&gt; periodically, and thought some of my readers might enjoy it as well. He welcomes email and messages from 'viewers' and enjoys telling his story. &lt;/FONT&gt;&lt;A href="http://www.projectbluesphere.com/Members/TV/Start/?MID=1"&gt;&lt;FONT face=Arial size=2&gt;Checkout Alex's latest video and see for yourself.&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/13/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/13/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=13</guid>
      <pubDate>Fri, 24 Aug 2007 07:00:00 GMT</pubDate>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=13</trackback:ping>
    </item>
    <item>
      <title>Italy Part 4: Cinque Terre</title>
      <description>&lt;P&gt;&lt;FONT face=Arial size=2&gt;Just before Christmas, in December 2006, I mentioned to a colleague that Jen and I were going to Italy for the holidays.  He immediately asked if we were planning on visiting Cinque Terre. I had never heard of Cinque Terre but of course I was intrigued. My colleague Charlie explained that it was something like a national park that encompassed five small towns on the west coast of Italy and had a hiking trail that connected all of the towns. He had spent a week or so there during his trip to Italy, and he highly recommended it. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;I talked to Jen about it, and as we learned more, it became apparent that Cinque Terre should be part of our itinerary. We planned to spend one night in one of the towns of Cinque Terre, but after finding the Hotel Vasari in Florence and realizing how much easier our travels would be if we didn't have to bring our luggage with us, we ended up using our last day in Florence for a day trip over to Cinque Terre.&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;The train ride didn't take long, though it was probably an hour or so, and soon we were in La Spezia looking for our connection to Riomaggiore, the southernmost town in Cinque Terre. The train from La Spezia to Riomaggiore only takes about ten minutes, most of which is in a tunnel cutting through the mountains to the coast. The Riomaggiore train station is a small segment about 50 yards long between two tunnels, one from La Spezia, the other to Manarola, the next town north in Cinque Terre. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;Cinque Terre has amazing topology and a wonderful spirit. We first spent some time enjoying the view from Riomaggiore at a small cliffside cafe and after sharing a tomato mozzarrella panino (sandwich) and some wine, we started our trek along the Via Dell' Amore. &lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Arial size=2&gt;&lt;A href="http://www.dittenhafer.net/video/2007.CinqueTerre.v3.wmv"&gt;Check out the video for more about our hike through Cinque Terre.&lt;/A&gt;&lt;/FONT&gt; &lt;/P&gt;</description>
      <link>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/9/Default.aspx</link>
      <author>daniel@dittenhafer.net</author>
      <comments>http://www.dittenhafer.net/dnn/AboutDan/DansBlog/tabid/60/EntryID/9/Default.aspx#Comments</comments>
      <guid isPermaLink="true">http://www.dittenhafer.net/dnn/Default.aspx?tabid=60&amp;EntryID=9</guid>
      <pubDate>Sun, 29 Jul 2007 07:00:00 GMT</pubDate>
      <slash:comments>2</slash:comments>
      <trackback:ping>http://www.dittenhafer.net/dnn/DesktopModules/Blog/Trackback.aspx?id=9</trackback:ping>
    </item>
  </channel>
</rss>
