<?xml version="1.0" encoding="UTF-8" ?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US"><title type="html">Damon Armstrong</title><subtitle type="html">Caffeine Induced Tirades about .NET and Life</subtitle><id>http://www.simple-talk.com/community/blogs/damon_armstrong/atom.aspx</id><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/default.aspx" /><link rel="self" type="application/atom+xml" href="http://www.simple-talk.com/community/blogs/damon_armstrong/atom.aspx" /><generator uri="http://communityserver.org" version="2.0.60217.2664">Community Server</generator><updated>2006-12-23T01:13:00Z</updated><entry><title>Avoid Parenthesis in VS 2005/2008 Web Site Project Paths</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2008/04/19/47878.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2008/04/19/47878.aspx</id><published>2008-04-19T05:44:00Z</published><updated>2008-04-19T05:44:00Z</updated><content type="html">&lt;P&gt;I was developing against a web site project -- you know the ones in Visual Studio 2005/2008 where you can just point to a directory and do your thing (as compared to a web application project with an actual project file) -- and I noticed something a bit odd.&amp;nbsp; When I compiled the project the Error List was not showing file references, line numbers, columns, or any other information about the location of the compiler errors.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;I figured Visual Studio was just getting tired since it had been open for days, so I restarted the application in hopes that it would straighten out.&amp;nbsp; No such luck.&amp;nbsp; Then I restarted the computer.&amp;nbsp; That's what tech support normally recommends anyway, so I figured I'd start with the basics.&amp;nbsp; Once again, no error location information.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;At this point, I was starting to wonder if it was an issue with Visual Studio 2008 that nobody had noticed yet.&amp;nbsp; Of course, if VS 2008 wasn't showing error location information on web site projects then there probably would have been an outcry long before this.&amp;nbsp; So I hit the search engines.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;It was a pain to find, which is why I'm trying to help publicize the issue, but there are a few references to the exact issue I was having.&amp;nbsp; Specifically on the following sites:&lt;/P&gt;
&lt;P&gt;&lt;A title=http://www.developmentnow.com/g/51_2006_7_0_0_790825/Errors-in-Error-List-with-no-line-numbers.htm href="http://www.developmentnow.com/g/51_2006_7_0_0_790825/Errors-in-Error-List-with-no-line-numbers.htm" target=_blank&gt;http://www.developmentnow.com/g/51_2006_7_0_0_790825/Errors-in-Error-List-with-no-line-numbers.htm&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://www.dotnetmonster.com/Uwe/Forum.aspx/vs-net-ide/4006/Error-List-Missing-the-Code-File-Reference" target=_blank&gt;http://www.dotnetmonster.com/Uwe/Forum.aspx/vs-net-ide/4006/Error-List-Missing-the-Code-File-Reference&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;What was the problem?&amp;nbsp; I was using parenthesis in the path to the web site project.&amp;nbsp; After removing the parenthesis, the problem was gone.&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=47878" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>Disabling an ASP.NET Button when Clicked</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/12/20/Disable_a_ASP_NET_Button_When_Clicked.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/12/20/Disable_a_ASP_NET_Button_When_Clicked.aspx</id><published>2007-12-21T05:55:00Z</published><updated>2007-12-21T05:55:00Z</updated><content type="html">&lt;P&gt;I was answering a question in the ASP.NET forums on Simple-Talk.com (&lt;A href="/community/forums/41512/ShowThread.aspx#41512" target=_blank&gt;click here you want to check it out&lt;/A&gt;) about how to avoid the issue of users submitting multiple page requests when they click on buttons.&amp;nbsp; My first inclination was hey, just disable the button after they click it and everything will be just fine.&amp;nbsp; So I fired up Visual Studio and threw the following code into a page:&lt;BR&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;asp:Button runat&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"server" &lt;/SPAN&gt;&lt;SPAN&gt;Text&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"My Button" &lt;/SPAN&gt;&lt;SPAN&gt;OnClientClick&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"this.disabled=true;" &lt;/SPAN&gt;&lt;SPAN&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/CODE&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;And naturally it failed miserably.&amp;nbsp; Why?&amp;nbsp; Because nothing works on the first try -- unless fate is trying to store up some catastrophe points to use on you later.&amp;nbsp; And apparently if you disable a button in the onclick it doesn't post back for reasons that I haven't dug into very far.&amp;nbsp; Not to be outwitted by HTML, Javascript, .NET, or whatever else you can blame for your problems, I tried a myriad of random ideas until I hit upon this -- instead of disabling the button when you click it, set the onclick event to fire a function that returns false.&amp;nbsp; So it looks something like this:&lt;BR&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;asp:Button runat&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"server" &lt;/SPAN&gt;&lt;SPAN&gt;Text&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"My Button" &lt;/SPAN&gt;&lt;SPAN&gt;OnClientClick&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"this.onclick=new Function('return false;');" &lt;/SPAN&gt;&lt;SPAN&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/CODE&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR&gt;This approach effectively disables the button, but doesn't gray it out.&amp;nbsp; So there you go.&amp;nbsp; If you want a gray button then this isn't the blog for you, but it does keep people from clicking on it the button more than once.&amp;nbsp; Naturally, this means that some sticklers out there will whine because the button stays disabled if the request times out or the viewer stops the request manually.&amp;nbsp; Part of me says leave it disabled as vengeful tribute to the multitudes who quintuple-clicked your button and created a horde of duplicate records for you to delete.&amp;nbsp; Then there's the other part of me that likes the JavaScript setTimeout function and a bit of a challenge:&lt;BR&gt;&lt;/P&gt;
&lt;P&gt;&lt;CODE&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;script type&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"text/javascript" &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;function &lt;/SPAN&gt;&lt;SPAN&gt;disableButton&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;button&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;resetDelay&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; button.oldonclick &lt;/SPAN&gt;&lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;button.onclick&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;button.onclick&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;noClick&lt;/SPAN&gt;&lt;SPAN&gt;; //&lt;/SPAN&gt;&lt;SPAN&gt;new &lt;/SPAN&gt;&lt;SPAN&gt;Function&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"return false;"&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;setTimeout&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"enableButton('"&lt;/SPAN&gt;&lt;SPAN&gt;+ &lt;/SPAN&gt;&lt;SPAN&gt;button.id &lt;/SPAN&gt;&lt;SPAN&gt;+ &lt;/SPAN&gt;&lt;SPAN&gt;"');" resetDelay&lt;/SPAN&gt;&lt;SPAN&gt;);&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;function &lt;/SPAN&gt;&lt;SPAN&gt;noClick&lt;/SPAN&gt;&lt;SPAN&gt;() &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; alert&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"Chill - You already submitted this page once. "&lt;/SPAN&gt;&lt;SPAN&gt;+ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"Submitting it twice isn't going to make the "&lt;/SPAN&gt;&lt;SPAN&gt;+&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"server go faster.&amp;nbsp; Quit hitting the "&lt;/SPAN&gt;&lt;SPAN&gt;+ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;"freakin' button!"&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;return &lt;/SPAN&gt;&lt;SPAN&gt;false&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;function &lt;/SPAN&gt;&lt;SPAN&gt;enableButton&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;buttonId&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; var button &lt;/SPAN&gt;&lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;document.getElementById&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;buttonId&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;if&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;button&lt;/SPAN&gt;&lt;SPAN&gt;!=null) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; button.onclick &lt;/SPAN&gt;&lt;SPAN&gt;= &lt;/SPAN&gt;&lt;SPAN&gt;button.oldonclick&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;/&lt;/SPAN&gt;&lt;SPAN&gt;script&lt;/SPAN&gt;&lt;SPAN&gt;&amp;gt;&lt;/SPAN&gt;&lt;/CODE&gt; &lt;/P&gt;
&lt;P&gt;&lt;BR&gt;&lt;SPAN&gt;&lt;FONT face="Trebuchet MS" color=#000000&gt;The disableButton function copies the "standard" onclick method into a fake property of the button for safe keeping, sets the new onclick to the noClick function (which displays a nice message to the user if they DO try to click), then sets up a delayed function call (read--asynchronous method) that executes after a delay that you set when calling the disableButton method (a value of 1000 for the resetDelay = 1 second, so multiply accordingly for your needs).&amp;nbsp; Here's an example of what it looks like in a button:&lt;BR&gt;&lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;SPAN&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;CODE&gt;&lt;SPAN&gt;&amp;lt;&lt;/SPAN&gt;&lt;SPAN&gt;asp:Button runat&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"server" &lt;/SPAN&gt;&lt;SPAN&gt;Text&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"My Button" &lt;/SPAN&gt;&lt;SPAN&gt;OnClientClick&lt;/SPAN&gt;&lt;SPAN&gt;=&lt;/SPAN&gt;&lt;SPAN&gt;"disableButton(this,30000)" &lt;/SPAN&gt;&lt;SPAN&gt;/&amp;gt;&lt;/SPAN&gt;&lt;/CODE&gt; &lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class=MsoNormal&gt;&lt;BR&gt;When you click this button, it gets disabled for 30 seconds.&amp;nbsp; And if a user clicks on that button in the interim, they even get a little feedback on what's going on.&amp;nbsp; Just remember, don't blame me when you get fired for pasting the script into your project and forgetting to change the message.&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=41515" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>WPF: WindowsFormsHost Control Error</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/09/04/36863.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/09/04/36863.aspx</id><published>2007-09-05T00:39:21Z</published><updated>2007-09-05T00:39:21Z</updated><content type="html">&lt;p&gt;I had the code base for&amp;nbsp;my first WPF application ready to go, so I compiled a release version of software and tried to run it from the .exe instead of directly from Visual Studio.&amp;nbsp; I was promptly greeted with the following error:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;The tag 'WindowsFormsHost' does not exist in XML namespace 'http://schemas.microsoft.com/winfx/2006/xaml/presentation'.&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;It ran flawlessly from the Visual Studio .NET debugger,&amp;nbsp;which I found a bit odd.&amp;nbsp; I tracked the issue back to the following problem.&amp;nbsp; When I originally referenced the WindowsFormsIntegration.DLL from my project, the "Copy Local" option was set to false.&amp;nbsp; When I went back in and set that value to True, the application promptly broke when it ran in the debugger.&amp;nbsp; I don't mind when things break as long as they break consistently, so this was a step in the right direction.&amp;nbsp; I had found a few helpful forum entries informing me that you have to specify the xml namespace for the WindowsFormsIntegration assembly.&amp;nbsp; So I added the following xmlns entry:&lt;/p&gt; &lt;p&gt;&lt;strong&gt;xmlns:wfi="clr-namespace:System.Windows.Forms.Integration;assembly=WindowsFormsIntegration"&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;And changed my WindowsFormsIntegration tag from&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&amp;lt;WindowsFormsHost&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&amp;lt;/WindowsFormsHost&amp;gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;to&lt;/p&gt; &lt;p&gt;&lt;strong&gt;&amp;lt;wfi:WindowsFormsHost&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&amp;lt;/wfi:WindowsFormsHost&amp;gt;&lt;/strong&gt;&lt;/p&gt; &lt;p&gt;and it started working just fine.&lt;/p&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=36863" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>Simple Code Performance Testing</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/08/24/35357.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/08/24/35357.aspx</id><published>2007-08-24T20:44:00Z</published><updated>2007-08-24T20:44:00Z</updated><content type="html">&lt;P&gt;After posting &lt;A href="/community/blogs/damon_armstrong/archive/2007/08/22/35160.aspx"&gt;Performance: Caching vs. Reading from an In-Memory XML Document&lt;/A&gt;, there have been some questions about how I actually do the performance testing.&amp;nbsp; My approach to performance testing is really simple... I just write some code, run that code in a big for loop, and time how long it takes to run through all of those iterations.&amp;nbsp; Nothing too complicated.&amp;nbsp; Calculating the speed of the operation becomes a simple matter of (iterations / time).&amp;nbsp; I've packaged this testing routine into a class I call the &lt;STRONG&gt;PerformanceTimer&lt;/STRONG&gt; class, which simplifies things even more.&amp;nbsp; The code for the class follows, and an example of how to use the class to test a routine follows even further down.&lt;/P&gt;
&lt;P&gt;
&lt;HR&gt;

&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;using&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;System&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN&gt;namespace&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Rebel.Performance &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Delegate&amp;nbsp;to&amp;nbsp;a&amp;nbsp;testing&amp;nbsp;method &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;public&amp;nbsp;delegate&amp;nbsp;void&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TestingMethodDelegate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;int&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;iterations&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Executes&amp;nbsp;a&amp;nbsp;testing&amp;nbsp;method&amp;nbsp;and&amp;nbsp;stores&amp;nbsp;execution&amp;nbsp;duration &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;public&amp;nbsp;class&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PerformanceTimer &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Property&amp;nbsp;backer&amp;nbsp;for&amp;nbsp;the&amp;nbsp;ExecutionSpan&amp;nbsp;property &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;private&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TimeSpan&amp;nbsp;_propExecutionSpan&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Property&amp;nbsp;backer&amp;nbsp;for&amp;nbsp;the&amp;nbsp;Iterations&amp;nbsp;property &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;private&amp;nbsp;int&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;_propIterations&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Duration&amp;nbsp;of&amp;nbsp;testing&amp;nbsp;method&amp;nbsp;execution &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;public&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TimeSpan&amp;nbsp;ExecutionSpan &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&amp;nbsp;{&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;_propExecutionSpan&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;private&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;set&amp;nbsp;{&amp;nbsp;_propExecutionSpan&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Number&amp;nbsp;of&amp;nbsp;iterations&amp;nbsp;for&amp;nbsp;the&amp;nbsp;test &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;public&amp;nbsp;int&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Iterations &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get&amp;nbsp;{&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;_propIterations&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;private&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;set&amp;nbsp;{&amp;nbsp;_propIterations&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;value&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Executes&amp;nbsp;testing&amp;nbsp;method&amp;nbsp;and&amp;nbsp;determines&amp;nbsp;execution&amp;nbsp;duration &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;param&amp;nbsp;name="testingMethod"&amp;gt;Delegate&amp;nbsp;to&amp;nbsp;the&amp;nbsp;testing&amp;nbsp;method&amp;lt;/param&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;public&amp;nbsp;void&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Run&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;int&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;iterations&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TestingMethodDelegate&amp;nbsp;testingMethod&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Iterations&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;iterations&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;long&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;startTime&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;endTime&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;startTime&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DateTime.Now.Ticks&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;testingMethod.Invoke&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Iterations&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;endTime&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DateTime.Now.Ticks&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ExecutionSpan&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;new&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TimeSpan&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;endTime&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;-&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;startTime&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Number&amp;nbsp;of&amp;nbsp;iterations&amp;nbsp;per&amp;nbsp;second &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;public&amp;nbsp;double&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;IterationsPerSecond &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Iterations&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;/&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ExecutionSpan.TotalSeconds&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Number&amp;nbsp;of&amp;nbsp;iterations&amp;nbsp;per&amp;nbsp;millisecond &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;public&amp;nbsp;double&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;IterationsPerMillisecond &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;get &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;return&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Iterations&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;/&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;ExecutionSpan.TotalMilliseconds&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//class &lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//namespace&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;
&lt;HR&gt;

&lt;P&gt;&lt;/P&gt;
&lt;P&gt;So that's the class, but how do you use it?&amp;nbsp; Here's a simple test application that uses the &lt;STRONG&gt;PerformanceTimer&lt;/STRONG&gt; class to check the speed of concatenation operations.&amp;nbsp; You've always heard that using a StringBuilder to build a string is faster than repeatedly concatenating a string directly?&amp;nbsp; Here's a chance to actually prove it.&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;
&lt;HR&gt;
&lt;SPAN&gt;using&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;System&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&lt;SPAN&gt;using&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;System.Text&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;/SPAN&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN&gt;using&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Rebel.Performance&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN&gt;namespace&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Rebel.PerformanceTest &lt;BR&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Console&amp;nbsp;Application &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;class&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Program &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;{ &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;static&amp;nbsp;void&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Main&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;string&lt;/SPAN&gt;&lt;SPAN&gt;[]&amp;nbsp;args&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;PerformanceTimer&amp;nbsp;timer&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;new&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;PerformanceTimer&lt;/SPAN&gt;&lt;SPAN&gt;(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;int&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;iterations&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;100000&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//Run&amp;nbsp;TestA &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;timer.Run&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;iterations&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;new&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TestingMethodDelegate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TestMethodA&lt;/SPAN&gt;&lt;SPAN&gt;)); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Console.WriteLine&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;timer.IterationsPerMillisecond&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//Run&amp;nbsp;TestB &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;timer.Run&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;iterations&lt;/SPAN&gt;&lt;SPAN&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;new&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TestingMethodDelegate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TestMethodB&lt;/SPAN&gt;&lt;SPAN&gt;)); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Console.WriteLine&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;timer.IterationsPerMillisecond&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;Console.ReadLine&lt;/SPAN&gt;&lt;SPAN&gt;(); &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Concatenation&amp;nbsp;using&amp;nbsp;a&amp;nbsp;StringBuilder &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;static&amp;nbsp;void&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TestMethodA&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;int&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;iterations&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;StringBuilder&amp;nbsp;s&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;new&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;StringBuilder&lt;/SPAN&gt;&lt;SPAN&gt;(); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;int&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;i&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;i&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;iterations&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;i&lt;/SPAN&gt;&lt;SPAN&gt;++) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;s.Append&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"A"&lt;/SPAN&gt;&lt;SPAN&gt;); &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;///&amp;nbsp;&amp;lt;summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;nbsp;&amp;nbsp;Direct&amp;nbsp;concatenation &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;///&amp;nbsp;&amp;lt;/summary&amp;gt; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;static&amp;nbsp;void&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;TestMethodB&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;int&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;iterations&lt;/SPAN&gt;&lt;SPAN&gt;) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;string&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;s&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;""&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;for&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;int&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;i&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;i&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;iterations&lt;/SPAN&gt;&lt;SPAN&gt;;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;i&lt;/SPAN&gt;&lt;SPAN&gt;++) &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;{ &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;s&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;+&lt;/SPAN&gt;&lt;SPAN&gt;=&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;"A"&lt;/SPAN&gt;&lt;SPAN&gt;; &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;} &lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;} &lt;BR&gt;&lt;BR&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//class &lt;BR&gt;&lt;BR&gt;&lt;/SPAN&gt;&lt;SPAN&gt;}&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;//namespace&lt;/SPAN&gt;&lt;/CODE&gt; 
&lt;HR&gt;
&lt;STRONG&gt;&lt;FONT color=#ff0000&gt;WARNING&lt;/FONT&gt;&lt;/STRONG&gt;: You will want to use as large of an iteration count as possible when testing.&amp;nbsp; This performance testing approach does the "best" it can when calculating exact start and end times, so some fluctuations are bound to occur when capturing the start and end times.&amp;nbsp; When they do, the fluctuations throw off the calculations.&amp;nbsp; Larger iteration counts spread out the effect of the fluctuations and minimize the error.&amp;nbsp; Think of it this way:&amp;nbsp; if you are off by 1 in 10, then you have a 10% error.&amp;nbsp; If you are off by 1 in 10000, you have a 0.01% error. 
&lt;P&gt;&lt;/P&gt;
&lt;HR&gt;

&lt;P&gt;On my machine, the StringBuilder operates at 14629 iterations / second and the direct concatenation approach runs at 13 iterations / second.&amp;nbsp; Pretty significant difference.&amp;nbsp;&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=35357" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>Performance: Caching vs. Reading from an In-Memory XML Document</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/08/22/35160.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/08/22/35160.aspx</id><published>2007-08-22T06:01:58Z</published><updated>2007-08-22T06:01:58Z</updated><content type="html">&lt;p&gt;I've been working with a number of XML documents recently.&amp;nbsp; Basically I'm trying to expose configuration values stored in XML configuration files in an object-oriented structure.&amp;nbsp; I'm using an in-memory XML document and just referencing values as needed from that document.&amp;nbsp; The XML reading does not need to be super-high performance because it does not occur very often, but it got me to thinking... what if it did?&lt;/p&gt; &lt;p&gt;So I ran some performance tests to check the difference between accessing a value from an XML document vs. storing the value in cache and accessing it through a standard get property.&amp;nbsp; &lt;/p&gt; &lt;p&gt;The results (at least on my machine) are as follows:&lt;/p&gt; &lt;table cellspacing="0" cellpadding="4"&gt;  &lt;tr&gt; &lt;td&gt;&amp;nbsp;&lt;/td&gt; &lt;td&gt; &lt;p dir="ltr"&gt;Iterations / Millisecond&lt;/p&gt;&lt;/td&gt; &lt;td&gt;Performance Difference&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;XML (attribute value)&lt;/td&gt; &lt;td&gt; &lt;p align="right"&gt;8,648&lt;/p&gt;&lt;/td&gt; &lt;td&gt; &lt;p align="right"&gt;90% slower&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;XML (inner text value)&lt;/td&gt; &lt;td&gt; &lt;p align="right"&gt;21,694&lt;/p&gt;&lt;/td&gt; &lt;td&gt; &lt;p align="right"&gt;76% slower&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt; &lt;tr&gt; &lt;td&gt;Cached Property&lt;/td&gt; &lt;td&gt; &lt;p align="right"&gt;90,140&lt;/p&gt;&lt;/td&gt; &lt;td&gt; &lt;p align="right"&gt;&amp;nbsp;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt; &lt;p&gt;I knew caching would beat out the other two methods since it's very fast to access a direct variable, but I was surprised that there was such a difference.&amp;nbsp; I figured there would be a bit of overhead for the inner text property, and a bit more for the attribute lookup, but I was thinking it would be in the range of 10-20% slower.&amp;nbsp; Live and learn.&amp;nbsp; Of course, reading from an in-memory XML document is still pretty dang fast, it's just that reading from a cached value is faster.&lt;/p&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=35160" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>ADFS - Cookie Error</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/08/16/34835.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/08/16/34835.aspx</id><published>2007-08-16T06:11:11Z</published><updated>2007-08-16T06:11:11Z</updated><content type="html">&lt;p&gt;I've been knee deep in Active Directory Federation Services for the past three months now, and when helping one our clients deploy a single-sign-on (SSO) application, we ran into a nasty error:&lt;/p&gt; &lt;p&gt;&lt;font color="#ff0000"&gt;The request has been rejected because it appears to be a duplicate of a request from this same client browser session within the last 20 seconds&lt;/font&gt;&lt;/p&gt; &lt;p&gt;Here is a quick synopsis of the problem.&amp;nbsp; ADFS works by bouncing users back and forth between federation servers and the application, and somewhere along the way you end up with a cookie containing authentication information (a SAML token to be more precise).&amp;nbsp; One of the options in the web.config is the path to the cookie, which is found in&lt;/p&gt; &lt;p&gt;&amp;lt;configuration&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;web.config&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;websso&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;...&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;cookies writecookies="true"&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ...&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#ff0000"&gt;&amp;lt;path&amp;gt;/CookiePath&amp;lt;/path&amp;gt;&lt;/font&gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;lt;/cookies&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/websso&amp;gt;&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/web.config&amp;gt;&lt;br&gt;&amp;lt;/configuration&amp;gt;&lt;/p&gt; &lt;p&gt;During the deployment, we placed the application in a directory that did not match the cookie path.&amp;nbsp; So, the user was going to the application, the application then sent the user to the federation server for authentication, the federation server issued the cookie, redirected the user back to the application, the cookie was not being sent when the user hit the application a second time, so the application sent the user back to the federation server for authentication, and the federation server doesn't like it when you try to login twice within 20 seconds.&amp;nbsp; So the moral of the story is to make sure you setup your cookie path correctly or you get weird ADFS errors.&lt;/p&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=34835" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>Reclaim Microsoft Virtual PC Console that Displays Outside the Desktop</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/05/30/30072.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/05/30/30072.aspx</id><published>2007-05-31T01:19:55Z</published><updated>2007-05-31T01:19:55Z</updated><content type="html">&lt;p&gt;I ran into a bit of&amp;nbsp;a problem the other day with Microsoft Virtual PC staring outside of my viewable desktop area.&amp;nbsp;&amp;nbsp;And it turns out that it wasn't just a fluke, because it's happened a couple of times since then.&amp;nbsp; And Robby, one of the guys&amp;nbsp;I work with at Cogent, had the same problem.&amp;nbsp; Here's how you get around the issue (I assume this works for any window if you have this issue, not just VPC):&lt;/p&gt; &lt;ol&gt; &lt;li&gt;Right click on the Microsoft Virtual PC Taskbar item and choose "Move" from the context menu&lt;/li&gt; &lt;li&gt;Hold the CTRL button and hit your arrow keys a few times.&amp;nbsp; This makes the title bar of the window "stick" to the mouse.&lt;/li&gt; &lt;li&gt;Wave your moue around wildly until you see the window&lt;/li&gt; &lt;li&gt;Click the left mouse button and the title bar will "unstick"&lt;/li&gt;&lt;/ol&gt; &lt;p&gt;That should get your window back.&lt;/p&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=30072" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>Wordpad may corrupt your SharePoint (and other ASP.NET app's) Web.confg</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/05/18/26970.aspx" /><link rel="enclosure" type="image/gif" length="20389" href="http://www.simple-talk.com/community/blogs/damon_armstrong/attachment/26970.ashx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/05/18/26970.aspx</id><published>2007-05-18T05:08:00Z</published><updated>2007-05-18T05:08:00Z</updated><content type="html">&lt;P&gt;I was remoting into a SharePoint 2007 (MOSS) box yesterday because I needed to update the configuration on a few of the servers in the farm.&amp;nbsp; Like most production systems, the server did not have Visual Studio, so I was using Notepad to edit the configuration.&amp;nbsp; As you may know, navigating through a configuration file in Notepad is a bit of pain compared to Visual Studio because it lacks the finesse of a full featured text editor.&amp;nbsp; My connection was also fairly slow so it was making my configuration task more irksome than normal.&lt;/P&gt;
&lt;P&gt;Hoping to get a bit more control, I made the switch to Wordpad.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;After making a couple of simple configuration changes, I refreshed the SharePoint site to make sure everything was okay.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;I was greeted with an error screen.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Thinking that I must have made a typo, I checked over the configuration changes but didn’t see anything unusual.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;So I decided to start removing things until the error went away.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;Each time I removed a change, I refreshed the screen hoping to identify the issue.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;The error screen persisted.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;Finally, I reverted back to the backup and the page popped back up no problem.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;That’s when I started thinking something was really amiss.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;I opened the working Web.config in Wordpad&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;and saved the file without making any changes.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;The error was back.&lt;/P&gt;
&lt;P&gt;I don’t know why, but Word pad randomly places little questions marks at various intervals throughout the Web.config.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;I saw no rhyme or reason to the madness, but I confirmed it on multiple Windows 2003 servers.&lt;SPAN&gt;&amp;nbsp; &lt;/SPAN&gt;So, if you’re configuring SharePoint, or any .NET application for that matter, on a remote machine, make sure to shy away from Wordpad because you’ll save yourself a headache.&lt;/P&gt;
&lt;P&gt;Click on the following image to see the differences in the files:&lt;/P&gt;&lt;A href="/community/blogs/damon_armstrong/attachment/26970.ashx"&gt;&lt;IMG height="50%" src="/community/blogs/damon_armstrong/attachment/26970.ashx" width="50%" border=0&gt; &lt;/A&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=26970" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>Displaying Debugging Info for SharePoint Errors in Your Browser</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/05/17/SharePoint_Debugging_Messages.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/05/17/SharePoint_Debugging_Messages.aspx</id><published>2007-05-17T17:28:00Z</published><updated>2007-05-17T17:28:00Z</updated><content type="html">&lt;P&gt;SharePoint does a good job of hiding errors from users.&amp;nbsp; Out of the box, unhandled errors in SharePoint result in a fairly non-descript page that says "An Error Occurred" (or something to that effect).&amp;nbsp; Although a good practice for your end-users, it's pretty annoying when you're trying to get a piece of code working or a configuration setting correct.&amp;nbsp; Here's how you can display debugging information in your browser:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Find the following line in your web.config:&lt;BR&gt;&lt;BR&gt;&amp;lt;SafeMode MaxControls="200" CallStack="false" DirectFileDependencies="10" TotalFileDependencies="50" AllowPageLevelTrace="false"&amp;gt;&lt;BR&gt;
&lt;LI&gt;Change the CallStack attribute to true 
&lt;LI&gt;Change the AllowPageLevelTrace to true 
&lt;LI&gt;Find the following line in your web.config:&lt;BR&gt;&lt;BR&gt;&amp;lt;customErrors mode="On" /&amp;gt;&lt;BR&gt;
&lt;LI&gt;Change the mode to "Off"&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;The next time you have an error, it displays the familiar ASP.NET error information page with exception details and the callstack information.&amp;nbsp; Much less frustrating than a blasé error message.&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=26860" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>VS SDK Error Message: CTC : fatal error CTC2013: Can't start preprocessor (2)</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/04/11/22547.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/04/11/22547.aspx</id><published>2007-04-11T13:42:54Z</published><updated>2007-04-11T13:42:54Z</updated><content type="html">&lt;p&gt;After watching some of the demo videos of the&amp;nbsp;latest Visual Studio&amp;nbsp;SDK, I was excited to get started and try out my own add-in.&amp;nbsp; I installed the SDK, fired up Visual Studio, created an integration package, compiled, and got a nasty error:&lt;/p&gt; &lt;p&gt;CTC : fatal error CTC2013: Can't start preprocessor (2)&lt;/p&gt; &lt;p&gt;What does this mean?&amp;nbsp; Apparently, part of the integration package includes something that needs to be compiled by a C++ compiler.&amp;nbsp; When originally looking through the options of my Visual Studio install, I noticed that the C++ compiler likes to take up 1-2 gigs of space, and not being a C++ developer, I choose to forgo that option.&amp;nbsp; Apparently C++ has come back to bite me years after I thought I was done with it forever.&lt;/p&gt; &lt;p&gt;All you have to do to get around the error is go back and install the C++ compiler from your Visual Studio 2005 disc, then compile the project again.&amp;nbsp; It should work.&lt;/p&gt; &lt;p&gt;If you get a "Requires elevation" error during the compilation, remember that you're running Vista and you need to fire up Visual Studio in administrator mode.&lt;/p&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=22547" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>SharePoint Permission Names</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/03/23/21211.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/03/23/21211.aspx</id><published>2007-03-23T18:01:58Z</published><updated>2007-03-23T18:01:58Z</updated><content type="html">&lt;p&gt;SharePoint 2007 has a new control called the SPSecurityTrimmedControl.&amp;nbsp; It's a container control that allows you to hide or display a section of your page depending on whether or not the currently logged-in user has the appropriate permissions.&amp;nbsp; To set the permissions, however, you need to know what SharePoint calls the permissions.&amp;nbsp; Took a little while to drudge it up, but here's the list:&lt;/p&gt; &lt;p&gt;&lt;a href="http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx" target="_blank"&gt;http://msdn2.microsoft.com/en-us/library/microsoft.sharepoint.spbasepermissions.aspx&lt;/a&gt;&lt;/p&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=21211" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>Exciting New .NET Language Features</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/03/16/20861.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/03/16/20861.aspx</id><published>2007-03-16T17:08:23Z</published><updated>2007-03-16T17:08:23Z</updated><content type="html">&lt;p&gt;If you haven't already, check out Scott Guthrie's blog about &lt;a href="http://weblogs.asp.net/scottgu/archive/2007/03/13/new-orcas-language-feature-extension-methods.aspx" target="_blank"&gt;Extension Methods&lt;/a&gt; that will be available when the next version of the .NET framework.&amp;nbsp; It's always cool when they add a completely new feature because it opens up more options for really elegant solutions.&amp;nbsp; And it also opens up new ways for people to really abuse the feature too.&amp;nbsp; And for me, both are fun to watch =]&lt;/p&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=20861" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>It's Called Capitalism, and You're Just as Guilty!</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/03/15/20829.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/03/15/20829.aspx</id><published>2007-03-15T19:35:00Z</published><updated>2007-03-15T19:35:00Z</updated><content type="html">&lt;P&gt;Action 19 News in Ohio was hot on the investigative trail of a Girl Scout cookie scalper today.&amp;nbsp;&amp;nbsp;Apparently, the owner of a Valero gas station in Parma Heights, Ohio bought a LOT of Girl Scout cookie boxes and is selling them in his store for $4 dollars.&amp;nbsp; Girls Scouts, on the other hand, peddle the boxes boxes for $3 dollars door to door.&amp;nbsp; Kate Donahue of the Girl Scouts of Lake Erie called the Valero owner's actions dishonorable and dishonest.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Dishonorable?&amp;nbsp; Dishonest?&amp;nbsp; How so?&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Now, I must concede that I am not in possession of all the facts surrounding the situation because the news clip was about two minutes long and didn't go into much detail.&amp;nbsp; There were only two piece of information that you can really get from it.&amp;nbsp; First, the owner was buying the boxes for $3 and selling them for $4.&amp;nbsp; Second, the boxes say that resale of the boxes is unauthorized.&amp;nbsp; So, I'm running with those two facts.&lt;/P&gt;
&lt;P&gt;From what I understand, the Girl Scouts sell boxes of cookies for $3, and the owner of the store purchased the boxes for $3 dollar a box.&amp;nbsp; Nobody was complaining about non-payment, so it was obviously not an issue.&amp;nbsp; The Girl Scouts received all that they desired for the boxes of cookies.&amp;nbsp; No dishonesty or dishonorable behavior there.&lt;/P&gt;
&lt;P&gt;In his store, he sold the cookies for $4.&amp;nbsp; People paid $4.&amp;nbsp; People got their cookies.&amp;nbsp; From what I understand, there was no misleading signage saying anything about giving every single last dollar to the Girl Scouts.&amp;nbsp; So, no dishonor or dishonesty there.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;But what about making an extra dollar off the box?&amp;nbsp; Dawn Hendrick, the reporter on the case, brought up a good point when she asked why she had to spend $4 on a box of cookies at the Valero when the Girl Scouts were selling them for $3.&amp;nbsp;&amp;nbsp;Here's why Dawn: you bought it from a Valero and not from a Girl Scout!&lt;/P&gt;
&lt;P&gt;There are only two types of people in a purchasing situation.&amp;nbsp; The first type of person is the type who does not know the going rate of an item.&amp;nbsp; This person has to rely on their own perception of value to determine if a price is correct.&amp;nbsp; If they want cookies, see a box, and determine that the prices is reasonable, then they purchase that box of cookies.&amp;nbsp; By purchasing the cookies, they are agreeing that the price is reasonable and correct.&lt;/P&gt;
&lt;P&gt;The second type of person is the type&amp;nbsp;who does know the going rate of an item.&amp;nbsp; If they see a price that is above the going rate, they have a decision to make: is getting the item at the current location worth the additional cost?&amp;nbsp; If it's not, then the buyer can leave.&amp;nbsp; By purchasing the box, however, the buyer is agreeing that the extra cost is justified due to convenience.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;If you can sell and item for more than you bought it for, then you have brought value to the person buying it.&amp;nbsp; It may be perceived value, or convenience value, but you have provided value none-the-less.&amp;nbsp; Pocketing the difference is called profit, and it's how the world works.&amp;nbsp; In fact, I can guarantee you that the Girl Scouts are not spending $3 dollars to MAKE the box of cookies that they are selling for $3.&amp;nbsp; So their stance against someone selling their cookies at a profit seems a bit irrational.&amp;nbsp; And considering that their sales force consists of tens of thousands of unpaid child laborers, I would say that they have a pretty good racket going on themselves.&lt;/P&gt;
&lt;P&gt;My favorite part of the newscast is when&amp;nbsp;a Girl Scout says "We use our money for our troop and other stuff, and he just gets it for himself to spend."&amp;nbsp; It was meant to be a damning condemnation from the mouth of a child, and that's how it comes across in the interview. But the reality is that shows the absurdity of the outrage towards the Valero owner.&amp;nbsp; Basically, the Girl Scouts are out selling cookies because they need money to pay for Scouting related activities.&amp;nbsp; The Valero owner is selling products at his gas station because he needs money to pay for living related activities.&amp;nbsp; So why is the Valero owner being accused of perpetuating some great evil upon the world when the Girl Scouts are engaging in the same act?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Some would then argue that since boxes of Girls Scout Cookies say "Any Resale or Redistribution is Unauthorized" that the owner was in violation of some law.&amp;nbsp; As far as I know, the Girl Scouts do not regular commerce, and the printing on the side of the box does not constitute a binding contract.&amp;nbsp; Re-selling the item is not&amp;nbsp;a legal offense.&amp;nbsp; Since he never claimed to be an "authorized" reseller, I see no dishonesty.&amp;nbsp; Some would go as far as to say that it was unethical to sell the boxes when such a message exists on the box, and thus dishonorable.&amp;nbsp;&amp;nbsp;Ethics is far more subjective than law, but I would still say that this is not beyond the bound of ethics because no official agreement exists.&amp;nbsp; Unless there is an official agreement, the Girl Scouts have no right to dictate how someone uses what they bought.&lt;/P&gt;
&lt;P&gt;I will, however, concede that selling Girl Scout cookies for a profit has the potential to cut into Girl Scout's cookie revenue.&amp;nbsp; When someone pays $12 dollars for Girl Scout cookies from a Girl Scout, they get 4 boxes and $12 goes to the Girl Scouts.&amp;nbsp; At Valero, $12 gets you 3 boxes and only $9 dollars goes to the Girl Scouts.&amp;nbsp; But we are also talking about a luxury item, and most people are going to get however many boxes they want without much regard for the price.&amp;nbsp; As such, the lost revenue angle is not an overly&amp;nbsp;compelling argument.&amp;nbsp; And remember, regardless of where you get the box from, $3 bucks DOES go to the Girl Scouts.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Sounds to me like the Girl Scouts are unhappy because they didn't think to raise the price to $4 a box first.&amp;nbsp; &lt;/P&gt;
&lt;P&gt;Perhaps the real solution to the problem would be for the owner to stockpile cookies until AFTER the Girl Scouts have done all their selling.&amp;nbsp; Then four months later when everyone's supply of Thin Mints, Tagalongs, and Somoas are depleted, put them out on the shelves for $6 per box.&amp;nbsp; I'm addicted to Somoas, so I know I'd be pretty tempted to pony up for a box.&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=20829" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>Vengence via Google Ads</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/01/25/18016.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2007/01/25/18016.aspx</id><published>2007-01-26T05:03:00Z</published><updated>2007-01-26T05:03:00Z</updated><content type="html">&lt;P&gt;I was reading an article today about how GoDaddy removed a customer's domain name from their registry at the request of MySpace.com.&amp;nbsp; You can view it here:&lt;/P&gt;
&lt;P&gt;&lt;A href="http://news.com.com/GoDaddy+pulls+security+site+after+MySpace+complaints/2100-1025_3-6153607.html?tag=nefd.lede"&gt;&lt;FONT color=#800080&gt;GoDaddy Pulls Security Site After MySpace Complaints&lt;/FONT&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Apparently someone had posted usernames and passwords of MySpace users to SecLists.org,&amp;nbsp;and MySpace wanted the offending material to be removed immediately.&amp;nbsp; Instead of contacting the website owner, MySpace contact GoDaddy and requested the domain deletion.&amp;nbsp; This effectively took the entire site offline, not just the offending material.&amp;nbsp;&amp;nbsp; I think there are going to be more than a few people who are a bit miffed at GoDaddy for going along with the request, but what can you do?&lt;/P&gt;
&lt;P&gt;And that's when I saw something interesting.&amp;nbsp; Immediately following the article was a "Sponsored Links" section containing Google ads.&amp;nbsp; And guess who was right at the top of the list?&amp;nbsp; GoDaddy.&amp;nbsp; Check out the article and scroll to the bottom, it will probably be there for you as well. &lt;/P&gt;
&lt;P&gt;This got me thinking.&amp;nbsp; Google Ads, from what I understand, work on a per-click basis.&amp;nbsp; You click on an ad, and Google charges the company for that click.&amp;nbsp; So you can exact some menial form of personal vengeance on companies that you feel deserve your wraith by clicking on their Google Ads with no intention of buying anything.&lt;/P&gt;
&lt;P&gt;Or you employ your friends, family, coworkers, and people on the web to wage an all out vengeance ad click war to broadside the advertising efforts of a company.&lt;/P&gt;
&lt;P&gt;I'm sure the day is comming.&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=18016" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry><entry><title>Pro CSS Techniques</title><link rel="alternate" type="text/html" href="http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2006/12/23/ProCssTechniquesReview.aspx" /><id>http://www.simple-talk.com/community/blogs/damon_armstrong/archive/2006/12/23/ProCssTechniquesReview.aspx</id><published>2006-12-23T07:13:00Z</published><updated>2006-12-23T07:13:00Z</updated><content type="html">&lt;P&gt;As a developer, I’ve had to endure my fair share of designers lecturing on the virtues of Cascading Style Sheets (CSS) and maintaining a strict divide between content elements and their visual layout.&amp;nbsp; It’s a noble pursuit, but for a developer with little design experience the task of getting a page to look just the way you want using CSS can be a difficult and frustrating undertaking that quickly regresses back to the form I know best:&amp;nbsp; using table after table for layouts and haphazardly slapping style strings into various elements until the page comes out looking right.&amp;nbsp; In other words, the approach designers hate.&lt;BR&gt;Instead of abiding in my ignorance of CSS, I decided to pick up a copy of Pro CSS Techniques by Jeff Croft, Ian Lloyd, and Dan Rubin.&amp;nbsp; It’s an intermediate to advanced-level book on CSS that assumes you have some basic knowledge of CSS.&amp;nbsp; If you feel comfortable using styles directly in your HTML, then you’ll be comfortable reading through this book.&amp;nbsp; The authors did a great job of covering the basics enough to inform you if you need it, but not dwelling on it to the point of boredom if you do not.&amp;nbsp; They also did a great job of explaining the “how” and “why” behind some of the most confusing aspects of CSS, which is why I definitely recommend picking up a copy.&lt;/P&gt;
&lt;P&gt;Pro CSS Techniques starts out with a great introduction to Semantic HTML, the concept that HTML should only define what is on the page, not what it should look like.&amp;nbsp; It also discusses why you need to write Semantic HTML if you want to use CSS effectively.&amp;nbsp; After understanding this concept in more detail, I understand why I ran into so many walls trying to use CSS to style my pages:&amp;nbsp; I was fighting an uphill battle against the layout and style information that was already in my HTML document.&amp;nbsp; &lt;BR&gt;After outlining some of the theory behind CSS, the authors discuss the CSS language and syntax.&amp;nbsp; If you are novice with CSS, this will bring you up to speed very quickly.&amp;nbsp; The section discussing CSS selectors was invaluable.&amp;nbsp; I’ve read a number of online tutorials for CSS and none of them ever got into the detail offered by this book.&amp;nbsp; And if you’ve ever wondered about the “Cascading” part of Cascading Style Sheets, then you’ll find a complete overview about the intricacies of that as well.&lt;/P&gt;
&lt;P&gt;You will also find an entire chapter containing valuable information on how the various browsers handle CSS and how to get your pages looking consistent across those browsers without hacks.&amp;nbsp; And when a traditional approach won’t work, you can turn to the chapter entirely dedicated to CSS Hacks that discusses what they are, what they do, when to use them, when to avoid them, and how to use them in your CSS.&lt;BR&gt;As you work with CSS, you can use the book as a guide because it breaks out common tasks into individual chapters.&amp;nbsp; You can easily thumb through to the applicable section as you build the layout, create common page elements (headers, footers, navigation, breadcrumbs, sidebars, etc), style text, tables, forms, and lists.&amp;nbsp; I remember the first time I saw a bulleted list turned into a graphical menu and I attributed it to dark magic.&amp;nbsp; Now I know how it was really done.&lt;/P&gt;
&lt;P&gt;And let’s not forget my favorite chapter, “Everything Falls Apart”, which describes most of my experience with CSS up to now.&amp;nbsp; It covers what to do when things aren’t working, and their solutions are much more elegant than returning to nested table layouts and forgoing the principals of CSS.&lt;/P&gt;
&lt;P&gt;I usually like to know what’s in a book, so there’s a chapter listing in case you’re curious:&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;Chapter 1 - The Promise of CSS&lt;/LI&gt;
&lt;LI&gt;Chapter 2 - The Language of Style Sheets&lt;/LI&gt;
&lt;LI&gt;Chapter 3 - Specificity and the Cascade&lt;/LI&gt;
&lt;LI&gt;Chapter 4 - The Browsers&lt;/LI&gt;
&lt;LI&gt;Chapter 5 - Managing CSS Files&lt;/LI&gt;
&lt;LI&gt;Chapter 6 - Hacks and Workarounds&lt;/LI&gt;
&lt;LI&gt;Chapter 7 - CSS Layouts&lt;/LI&gt;
&lt;LI&gt;Chapter 8 - Creating Common Page Elements&lt;/LI&gt;
&lt;LI&gt;Chapter 9 - Typography&lt;/LI&gt;
&lt;LI&gt;Chapter 10 - Styling Tables&lt;/LI&gt;
&lt;LI&gt;Chapter 11 - Styling Forms&lt;/LI&gt;
&lt;LI&gt;Chapter 12 - Styling Lists&lt;/LI&gt;
&lt;LI&gt;Chapter 13 - Styling for Print and Other Media&lt;/LI&gt;
&lt;LI&gt;Chapter 14 - Everything Falls Apart&lt;/LI&gt;
&lt;LI&gt;Appendix A – CSS Reference&lt;/LI&gt;
&lt;LI&gt;Appendix B – CSS Specificity Chart&lt;/LI&gt;
&lt;LI&gt;Appendix C – Browser Grading Chart&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;All in all, I would highly recommend this book if you have a bit of experience with CSS and really want to solidify your understanding of the technology.&amp;nbsp; It also does well as a reference book, so once you’ve got the concepts down, I would still keep it close to your computer.&lt;/P&gt;&lt;img src="http://www.simple-talk.com/community/aggbug.aspx?PostID=9556" width="1" height="1"&gt;</content><author><name>Damon</name><uri>http://www.simple-talk.com/community/user/Profile.aspx?UserID=2140</uri></author></entry></feed>