﻿<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title>JOHNBIERMAN.NET</title>
	<updated>2012-02-23T06:37:46Z</updated>
	<id>http://johnbierman.net/atom.aspx</id>
	<link href="http://johnbierman.net/atom.aspx" rel="self" type="application/rss+xml" />
	<link href="http://johnbierman.net" rel="alternate" type="application/rss+xml" />
	<generator uri="http://app.onlinequickblog.com/" version="2.6.7">Quick Blogcast</generator>
	<entry>
		<title>Http Traffic Monitoring via &amp;quot;HttpWatch&amp;quot;</title>
		<link rel="alternate" href="http://johnbierman.net/2010/02/03/http-traffic-monitoring-via-quothttpwatchquot.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2010-02-03:a5e582cf-1fd8-4b41-ae1d-65a0dcd10e9f</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2010-02-03T16:36:52Z</updated>
		<published>2010-02-03T16:36:52Z</published>
		<content type="html">&lt;p&gt;A great utility! Here's what they say about themselves:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;em&gt;&amp;quot;HttpWatch integrates with Internet Explorer and Firefox browsers to show you exactly what HTTP traffic is triggered when you access a web page. If you access a site that uses secure HTTPS connections, HttpWatch automatically displays the decrypted form of the network traffic&amp;quot;&lt;/em&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Thanks to Travis Rogers for showing this to me.&lt;/p&gt;  &lt;p&gt;&lt;a href="http://www.httpwatch.com"&gt;http://www.httpwatch.com&lt;/a&gt;&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>EntityFramework 3.5: Adding a New Entity to an Existing .Edmx File</title>
		<link rel="alternate" href="http://johnbierman.net/2009/12/14/entityframework-35-adding-a-new-entity-to-an-existing-edmx-file.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-12-14:c027cd78-a550-4fd0-900a-082bea904add</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-12-15T05:44:08Z</updated>
		<published>2009-12-15T05:44:08Z</published>
		<content type="html">&lt;p&gt;It's been awhile since my last blog posting. To rekindle the *blogging fire* I want to share a little trick that I learned today that will hopefully help the community at large (or at least those EntityFramework fellow compatriots).&lt;/p&gt;  &lt;p&gt;The EntityFramework is a great technology framework that raises the level of abstraction for data programming. It offers a great graphical user interface for defining either simple or complex representation of your data. While the GUI is a great tool, some of the kinks have yet to be worked out of the 3.5 version of the framework.&lt;/p&gt;  &lt;p&gt;And while it is extremely simple to create a new edmx file and define your entities, this posting will not cover how to do this. I will try to zero in on the *trick* that I learned today&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Define the problem:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;While creating a new edmx file and defining the entities is easy, it's a whole 'nother animal to update and existing edmx file. What would seem rather simple is not quite as straight forward in this version of the framework (at least in my experience). It would appear that you would only need to open the edmx file, right click on its design surface, and select the &amp;quot;Update Model from Database&amp;quot; menu item. I mean, after all, this launches a nice little &amp;quot;Update Wizard&amp;quot; that allows you to select the tables that you either want to add, update or delete.&lt;/p&gt;  &lt;p&gt;Not so fast my friend! If you have an edmx file that has a modicum of complexity I have found this to be a painfully frustrating way to add a new data model to the file. I have spun many-a-cycle and invested many hours in trying to coerce the wizard to play nice, only to alas, nearly fall down, quivering in humble defeat.&lt;/p&gt;  &lt;p&gt;But, my pride never allows me to succumb to such a challenge... defeat isn't an option!&lt;/p&gt;  &lt;p&gt;What I have done in the past to add a new entity to an existing edmx file was to right click on the edmx file in Visual Studio Solution Explorer and select the &amp;quot;Open With&amp;quot; menu option. This opens the edmx file in an XML editor. I would then painstakingly&amp;#160; go through the file and add all of the appropriate entity definition declarative code that would not only define the conceptual .Net entity, but also define the data store and how it would be mapped over to my .Net entity.    &lt;br /&gt;This was a long, arduous process, and highly prone to error. I knew that there had to be a better way...&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;Trick/Lesson Learned:&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;Well, today I had an epiphany (or at least I like to think it was). Instead of fretting over the quirkiness of using the less that effective &amp;quot;Update Wizard&amp;quot;, I decided to take a different approach...&lt;/p&gt;  &lt;p&gt;I created a new edmx file (again, this posting does not describe the process of creating and edmx file) and added to this new edmx file &lt;em&gt;only those entities that I eventually wanted to add to my existing edmx file&lt;/em&gt;. This allowed me to rely on the framework's creation wizard to create and edmx file. This wizard is rock solid, so why not allow it to generate all of the XML that I will eventually need to add to my existing edmx file; because after all, all an edmx file is, under the covers, is an XML file...&lt;/p&gt;  &lt;p&gt;After creating the new file with the creation wizard, I then opened it up in the XML Editor. Then, after opening the newly created file in the XML Editor, I opened up my existing edmx file in a separate XML Editor (this is the file to which I wanted to add the new entities). &lt;/p&gt;  &lt;p&gt;At this point, it was very straightforward: I simply added all of the appropriate XML markup from the newly created edmx file to the existing edmx file. It took only a matter of minutes. &lt;/p&gt;  &lt;p&gt;Woohoo!! &lt;/p&gt; &lt;strong&gt;Conclusion:&lt;/strong&gt;   &lt;br /&gt;  &lt;p&gt;While there may be a more reliable way to add new entities to an existing edmx file that I'm not aware of, I have found that the current &amp;quot;Update Wizard&amp;quot; is less than reliable...and sometimes you need to roll up your sleeves and work with some good 'ol XML. And a surefire way to get it right first time, is to create a staging edmx file whose only purpose in life is to act as a surrogate for your existing edmx file. You can then use this staging file to add the appropriate XML to the existing edmx file, and continue on with your day.&lt;/p&gt;  &lt;p&gt;Happy coding!&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Using a Lambda Expression to Determine if a Number is Odd or Even</title>
		<link rel="alternate" href="http://johnbierman.net/2009/10/08/using-a-lambda-expression-to-determine-if-a-number-is-odd-or-even.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-12-03:31249661-6dd8-49ef-992c-5f5d2dcff34d</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-12-03T16:02:26Z</updated>
		<published>2009-12-03T16:02:26Z</published>
		<content type="html">&lt;p&gt;&lt;/p&gt;  &lt;p&gt;There's a simple way to use a lambda expression to determine if a number is either odd or even. Here's an example of how you can do this while iterating over a list of integers:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://johnbierman.net/images/9/6/1/6/3/145395-136169/clip_image001_2.png"&gt;&lt;img style="border-top-width: 0px; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="365" alt="clip_image001" src="http://johnbierman.net/images/9/6/1/6/3/145395-136169/clip_image001_thumb.png" width="513" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The key algorithm is &lt;em&gt;n % 2 == 1&lt;/em&gt;. Simple is as simple does.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Great Visual of RIA Development</title>
		<link rel="alternate" href="http://johnbierman.net/2009/10/02/great-visual-of-ria-development.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-10-02:3f0aa922-74eb-4cf6-ada6-cb572e1137f1</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-10-03T00:20:55Z</updated>
		<published>2009-10-03T00:20:55Z</published>
		<content type="html">&lt;p&gt;I recently saw this depiction of RIA development...&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://johnbierman.net/images/9/6/1/6/3/145395-136169/clip_image002_2.gif"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="380" alt="clip_image002" src="http://johnbierman.net/images/9/6/1/6/3/145395-136169/clip_image002_thumb.gif" width="487" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;A picture is worth a thousand words!&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Anonymous Methods as Parameters</title>
		<link rel="alternate" href="http://johnbierman.net/2009/07/23/anonymous-methods-as-parameters.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-09-22:3da204a3-3929-4cc8-9214-55003a2df7f7</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-09-23T04:59:05Z</updated>
		<published>2009-09-23T04:59:05Z</published>
		<content type="html">&lt;p&gt;If you are like me you hate writing the same mundane code over and over and over...puke!! You see this a lot when it comes to querying data from a database. There are a lot of nifty frameworks that consolidate this type of functionality and allows you, as a developer, to focus on the needs of the business.&lt;/p&gt;  &lt;p&gt;If you are ever in a situation, however, wherein the powers that be do not condone the use of frameworks (as odd as that might be), here's a nifty little way to harness the power of Anonymous Methods as parameters in an attempt to isolate the mundane code in one single implementation (buckle up).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To retrieve a result set from a database, for example, all you need is a helper class that has one simple method with a signature like the following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;DbHelper.ExecuteReader(DataReaderHandler dataReaderHandler,      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; IEnumerable&amp;lt;IDbDataParameter&amp;gt; parameters,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; string procedureName)&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Notice the DataReaderHandler parameter. This is reference to a delegate that is declared inside the DbHelper class:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public delegate void DataReaderHandler(IDataReader reader);&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If you wanted retrieve a list of user ids from a database, for example, the calling code that exercises the &amp;quot;ExecuteReader&amp;quot; method would look like this:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public List&amp;lt;int&amp;gt; GetUserIds()&lt;/p&gt;    &lt;p&gt;{&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160; List&amp;lt;int&amp;gt; ids = new List&amp;lt;int&amp;gt;();&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160; List&amp;lt;IDbDataParameter&amp;gt; parameters = new List&amp;lt;IDbDataParameter&amp;gt;(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160; // populate parameters (you can use a helper class to do this as well -- but I'm not going to cover that in this posting)&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160; DbHelper.ExecuteReader(      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; delegate(IDataReader reader) { ids = PopulateUserIds(reader); },       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; parameters,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &amp;quot;SelectUserIds&amp;quot; ) ; &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160; return ids;&lt;/p&gt;    &lt;p&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;The magic happens when the executing code declares an anonymous method in-line:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;delegate(IDataReader reader) { ids = PopulateUserIds(reader); }&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;When the code is executed the runtime passes the anonymous method as the first parameter. This delegate reference is used by the &amp;quot;DbHelper.ExecuteReader&amp;quot; method as follows:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;public static void ExecuteReader(DataReaderHandler dataReaderHandler,      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; IEnumerable&amp;lt;IDbDataParameter&amp;gt; parameters,       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; string procedureName)       &lt;br /&gt;{ &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160; using (IDbConnection connection = new SqlConnection(connectionString))      &lt;br /&gt;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; using (IDbCommand command = new SqlCommand(procedureName, connection))       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; command.CommandType = CommandType.StoredProcedure;&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; foreach (IDbDataParameter parameter in parameters)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; command.Parameters.Add(parameter);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; } &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; connection.Open(); &lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; using (IDataReader reader = command.ExecuteReader())      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; dataReaderHandler(reader);       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160; }       &lt;br /&gt;&amp;#160;&amp;#160; }&lt;/p&gt;    &lt;p&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Things to note:&lt;/p&gt;  &lt;ol&gt;   &lt;li&gt;The &amp;quot;connectionString&amp;quot; will ideally be read from a configuration file. &lt;/li&gt;    &lt;li&gt;This example uses both SqlCommand and SqlConnection objects. You can implement a different database provider depending upon your applications requirements. &lt;/li&gt;    &lt;li&gt;The ExecuteReader method has a &amp;quot;void&amp;quot; return type. &lt;/li&gt;    &lt;li&gt;The use of &amp;quot;using&amp;quot; statements ensures that connections are closed and that all objects are properly disposed of by the .Net garbage collector. &lt;/li&gt; &lt;/ol&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To cap off this little example, when the &amp;quot;dataReaderHandler(reader)&amp;quot; delegate is invoked inside the &amp;quot;ExecuteReader&amp;quot; method, the runtime routes the call to the &amp;quot;PopulateUserIds&amp;quot; method that was specified when the &amp;quot;DbHelper.ExectureReader&amp;quot; method was called. The &amp;quot;PopulateUserIds&amp;quot; method signature calls for one input parameter of type IDataReader. It uses this reader object to parse the result set and return the desired collection of user ids:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;private static List&amp;lt;int&amp;gt; PopulateUserIds(IDataReader reader)      &lt;br /&gt;{       &lt;br /&gt;&amp;#160; List&amp;lt;int&amp;gt; ids = new List&amp;lt;int&amp;gt;(); &lt;/p&gt;    &lt;p&gt;&amp;#160; while (reader.Read())      &lt;br /&gt;&amp;#160; {       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ids.Add(int.Parse(reader[&amp;quot;USER_ID&amp;quot;].ToString()));       &lt;br /&gt;&amp;#160; } &lt;/p&gt;    &lt;p&gt;&amp;#160; return ids;      &lt;br /&gt;} &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Now, as you can imagine, there is more database interaction then simply retrieving a result set. You can build out the DbHelper class to account for the return of scalar values, execute non-query procedures, inserting, updating, even interact with different database providers, etc...&lt;/p&gt;  &lt;p&gt;The nice part about leveraging Anonymous Methods as parameters to framework level components is that it allows the framework to do all of the heavy lifting, while allowing you to have control over how the operation needs to be handled from a business perspective.&lt;/p&gt;  &lt;p&gt;Applying this same technique to non-database centric activities helps you write less code and ultimately be more productive (IMHO).&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>We understood things 50 years ago...what about today?</title>
		<link rel="alternate" href="http://johnbierman.net/2009/09/19/we-understood-things-50-years-agowhat-about-today.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-09-19:7449b070-00ae-45dd-aca2-f7025df31ed5</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-09-19T17:49:55Z</updated>
		<published>2009-09-19T17:49:55Z</published>
		<content type="html">&lt;p&gt;This is a cartoon that was created 50 years ago about freedom...amazing the insight!&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:c4f7a787-c912-49a8-85b1-1e32653ec086" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div id="d7406af2-dd9f-4943-8737-a7437655c2fa" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=WB6p5QPVhPI&amp;amp;hl=en&amp;amp;fs=1&amp;amp;" target="_new"&gt;&lt;img src="http://johnbierman.net/images/9/6/1/6/3/145395-136169/video8a6eadacb493.jpg" galleryimg="no" onload="var downlevelDiv = document.getElementById('d7406af2-dd9f-4943-8737-a7437655c2fa'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/WB6p5QPVhPI&amp;amp;hl=en&amp;amp;fs=1&amp;amp;\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;param name=\&amp;quot;wmode\&amp;quot; value=\&amp;quot;transparent\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/WB6p5QPVhPI&amp;amp;hl=en&amp;amp;fs=1&amp;amp;\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; wmode=\&amp;quot;transparent\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content>
	</entry>
	<entry>
		<title>Impersonating IE from Firefox</title>
		<link rel="alternate" href="http://johnbierman.net/2009/08/31/impersonating-ie-from-firefox.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-08-31:73e97474-dfac-4832-a93b-95cd76feb15d</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-09-01T00:15:22Z</updated>
		<published>2009-09-01T00:15:22Z</published>
		<content type="html">&lt;p&gt;Firefox allows you to impersonate IE. I&amp;#8217;m currently running Firefox version 3.5.2.&lt;/p&gt;  &lt;p&gt;To get &amp;quot;IE Tabs&amp;quot; you first need to open Firefox. Then, if you go to the &amp;#8220;Tools &amp;gt;&amp;gt; Add-ons&amp;#8221; section you can do a search for &amp;#8220;IE Tab&amp;#8221; by clicking the &amp;#8220;Get Add-ons&amp;#8221; menu option. When you include this add-on you will get a little icon in the lower right corner of the browser. By clicking the little icon you change the browsers engine from IE to Mozilla Firefox.&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Firefox in &amp;#8220;Mozilla&amp;#8221; mode:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://johnbierman.net/images/9/6/1/6/3/145395-136169/image_8.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="376" alt="image" src="http://johnbierman.net/images/9/6/1/6/3/145395-136169/image_thumb_3.png" width="604" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Firefox in &amp;#8220;IE&amp;#8221; mode:&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;a href="http://johnbierman.net/images/9/6/1/6/3/145395-136169/image_10.png"&gt;&lt;img style="border-right: 0px; border-top: 0px; border-left: 0px; border-bottom: 0px" height="376" alt="image" src="http://johnbierman.net/images/9/6/1/6/3/145395-136169/image_thumb_4.png" width="607" border="0" /&gt;&lt;/a&gt; &lt;/p&gt;  &lt;p&gt;The only visual difference is the little icon in the lower right corner of the browser and the subtle (and at times not-so-subtle) differences in CSS.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Microsoft SharedView</title>
		<link rel="alternate" href="http://johnbierman.net/2009/08/18/microsoft-sharedview.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-08-18:a1cf5d74-45d4-45bd-9b77-3e13693177d3</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-08-18T22:28:17Z</updated>
		<published>2009-08-18T22:28:17Z</published>
		<content type="html">&lt;p&gt;If you're looking for a poor-man's version of a desktop sharing application look no further than Microsoft SharedView. It is a really nice, lightweight desktop sharing application that not only allows you to easily create a sharing session and invite participants, but it also allows you to turn over control to another user (but be careful with this, of course &lt;img src="http://johnbierman.net/emoticons/smile.png" border="0" /&gt; ).&lt;/p&gt;  &lt;p&gt;You can download Microsoft SharedView here:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://www.connect.microsoft.com/site/sitehome.aspx?SiteID=94" href="http://www.connect.microsoft.com/site/sitehome.aspx?SiteID=94"&gt;http://www.connect.microsoft.com/site/sitehome.aspx?SiteID=94&lt;/a&gt;&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>The Story of the Old Assembly...</title>
		<link rel="alternate" href="http://johnbierman.net/2009/08/17/the-story-of-the-old-assembly.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-08-17:5d3fd72e-2fe5-4979-bf3a-0776c6ce02bb</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-08-17T21:27:17Z</updated>
		<published>2009-08-17T21:27:17Z</published>
		<content type="html">&lt;p&gt;Once upon at time there was an assembly. It was a good assembly. It did it's job very, very well. It was an assembly that was very important to its fellow assemblies. It not only contained business related logic, but it also served as an implementation boundary to other satellite assemblies.&lt;/p&gt;  &lt;p&gt;Well, one day, as the application was being tested by the thorough QA technician, things weren't behaving as they should. The ever important assembly seemed to be having &amp;quot;issues&amp;quot;. The QA technician was testing specific scenarios that surely the ever important assembly could perform; but alas, the technician had to enter a &amp;quot;failure&amp;quot; report on the test cases that he was testing. The ever important assembly was devastated. It didn't know what went wrong. Surely the master developers who created him had done their job well. Surely the QA technician was testing as good as he had before... What was the problem??&lt;/p&gt;  &lt;p&gt;Well, as time went on the assembly had to rely on the helpful hand of the development team to find out what it's problem was. Turns out, that the problem was simple once the symptoms were clearly understood.&lt;/p&gt;  &lt;p&gt;The symptoms were somewhat puzzling, however. The nightly build process was working fine. The code compiled on every machine that it ran on. But something very interesting occurred: the timestamp of the assembly was almost 2 weeks old on the QA box. Hmmm...what could this mean? &amp;quot;Perhaps something was wrong with the build server&amp;quot;, the assembly thought. Well, after hours of looking into the issue, and pouring through the build process, it became apparent what the problem was....&lt;/p&gt;  &lt;p&gt;A little over a week prior, in the dark of night, a little gremlin snuck into the application solution and decided to mess with this ever important assembly. It opened up Visual Studio 2008, opened up the parent project, expanded the &amp;quot;References&amp;quot; folder, and right clicked on the assembly while it slept, and clicked &amp;quot;properties&amp;quot;. While inside the &amp;quot;Properties&amp;quot; view the little nefarious gremlin changed the &amp;quot;Copy Local&amp;quot; value to &amp;quot;False&amp;quot;.&lt;/p&gt;  &lt;p&gt;Nearly two weeks passed before it became apparent that something was awry with the ever important assembly. Well, the developers came to save the day and changed the &amp;quot;Copy Local&amp;quot; value back to &amp;quot;True&amp;quot;. The build ran successfully, and the old assembly was old no more...&lt;/p&gt;  &lt;p&gt;Cheers filled the office air as the QA technician retested his scenarios! Pass, Pass Pass...was the chant!! All was well!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;OK, the moral of the story, if you try to publish a project, and an assembly is not being updated (and it's satellite assemblies don't get published either), the FIRST thing that look at is the &amp;quot;Copy Local&amp;quot; property of&amp;#160; the assembly reference from within the parent application.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>My How History Tends to Repeat</title>
		<link rel="alternate" href="http://johnbierman.net/2009/08/14/my-how-history-tends-to-repeat.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-08-14:13398f1f-e23c-4889-b808-779115d61644</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-08-14T18:10:37Z</updated>
		<published>2009-08-14T18:10:37Z</published>
		<content type="html">&lt;p&gt;In 1961 the late great Ronald Reagan spoke out against socialized medicine. He was almost prophetic in his interpretation of government intentions. The arguments that he put forth so many years ago are before us again today. How can we not see that what he spoke back then is relevant today? And how is it that some in our society can look at our Founding Fathers as &amp;quot;antiquated&amp;quot; and &amp;quot;out of touch&amp;quot; with what our society needs today?&lt;/p&gt;  &lt;p&gt;It will be hard to argue that times haven't changed since 1961. Technology, for example, has completely changed how the &lt;em&gt;world &lt;/em&gt;does business. We are now more connected than ever before. Yet, the intentions of power hungry leaders and the corruption that enters the hearts of ill-willed men hasn't changed from the beginning of time. And if Ronald Reagan had it right so many decades ago, surely our Founding Fathers had it right when they penned our inspired Constitution.&lt;/p&gt;  &lt;p&gt;Let us not look beyond the mark that they, our Founding Fathers, blazed for our generation, and let us look to the future with a learning eye always gazing on the past. It's amazing to me how middle-aged men and women, who have &lt;em&gt;never&lt;/em&gt; lived under a tyrannical government like that of our fore-fathers, seem to &amp;quot;know better&amp;quot;. The shear experiences that our predecessors lived through should not only garner our admiration, but also our learning eyes and ears; and I even dare say that we should pledge our lives, liberty, and our sacred honor to the principles that they forged in the Constitution by virtue of living through experiences that &lt;em&gt;no one born and raised in the United States of America&lt;/em&gt; &lt;em&gt;today has gone through&lt;/em&gt;. How arrogant a people we have become. To dismiss the lessons learned by our Founding Fathers in the refiners fire is a grave mistake indeed!&lt;/p&gt;  &lt;p&gt;Please listen to what Mr. Reagan said so long ago, and search your heart as to whether or not there isn't a message for us here today in 2009.&lt;/p&gt;  &lt;div class="wlWriterSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:b0724ecd-54b6-4365-b74b-499cf3c41181" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div id="3cb77fea-b1ba-4d98-b870-d466e5b9d432" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=fRdLpem-AAs" target="_new"&gt;&lt;img src="http://johnbierman.net/images/9/6/1/6/3/145395-136169/video9d6a76c7b214.jpg" galleryimg="no" onload="var downlevelDiv = document.getElementById('3cb77fea-b1ba-4d98-b870-d466e5b9d432'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/fRdLpem-AAs\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;param name=\&amp;quot;wmode\&amp;quot; value=\&amp;quot;transparent\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/fRdLpem-AAs\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; wmode=\&amp;quot;transparent\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content>
	</entry>
	<entry>
		<title>Adding Web Reference in Visual Studio 2008</title>
		<link rel="alternate" href="http://johnbierman.net/2009/02/25/adding-web-reference-in-visual-studio-2008.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-07-30:c3412a55-8dba-4c28-b233-c367a2bdb5f4</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-07-30T15:55:36Z</updated>
		<published>2009-07-30T15:55:36Z</published>
		<content type="html">&lt;p&gt;In case you've ever ran into the same issue that I have on occasion, where in Visual Studio 2008 you right click on a project and no longer see the &amp;quot;Add Web Reference&amp;quot; option... you need to read the following blog post:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;&lt;a title="http://devnet.asna.com/KB/Pages/470.aspx" href="http://devnet.asna.com/KB/Pages/470.aspx"&gt;http://devnet.asna.com/KB/Pages/470.aspx&lt;/a&gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It explains how to add a web reference (as opposed to a &amp;quot;Service Reference&amp;quot; ) if you are experiencing the same thing.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Thank you Microsoft for making this work-around sooo easy to find &lt;img src="http://johnbierman.net/emoticons/normal.png" border="0" /&gt; (yuk)&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>ValidatorEnable</title>
		<link rel="alternate" href="http://johnbierman.net/2009/05/06/validatorenable.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-05-06:b7dd355e-67d4-44ef-9a20-aeb60268ae8e</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-05-06T19:13:55Z</updated>
		<published>2009-05-06T19:13:55Z</published>
		<content type="html">&lt;p&gt;A nifty way to enable and disable all .Net validator controls is the use the ValidatorEnable() method. There are two parameters that constitute the method signature:&lt;/p&gt;  &lt;p&gt;parm 1: instance of the validator control to be enabled/disabled.&lt;/p&gt;  &lt;p&gt;parm 2: enabled indicator (true = enabled, false = disabled).&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;If I had the following validation control:&lt;/p&gt;  &lt;p&gt;&amp;lt;asp:RequiredFieldValidator ID=&amp;quot;vldCustName&amp;quot; runat=&amp;quot;server&amp;quot;   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ControlToValidate=&amp;quot;txtCustomerName&amp;quot;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; ErrorMessage=&amp;quot;Customer Name Required&amp;quot;&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;lt;/asp:RequiredFieldValidator&amp;gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I can disable the control like so:&lt;/p&gt;  &lt;p&gt;ValidatorEnable($get('&amp;lt;%= txtCustomerName.ClientID %&amp;gt;'), false);&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Please note that this is using the ASP.Net Ajax Framework to access the server control, hence the &amp;quot;$get('&amp;lt;%= txtCustomerName.ClientID %&amp;gt;')&amp;quot; line of code.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Fantastic Easter Message</title>
		<link rel="alternate" href="http://johnbierman.net/2009/04/22/fantastic-easter-message.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-04-22:aeabe232-4267-46ec-a349-8a1098271e1f</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-04-22T15:55:40Z</updated>
		<published>2009-04-22T15:55:40Z</published>
		<content type="html">&lt;p&gt;When it all is said and done, when we're old and gray, what will be the legacy of our lives?&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;    &lt;div class="wlWriterSmartContent" id="scid:5737277B-5D6D-4f48-ABFC-DD9C333F4C5D:26c6c27d-d9f0-422b-b7a1-4bd4f7512abe" style="padding-right: 0px; display: inline; padding-left: 0px; padding-bottom: 0px; margin: 0px; padding-top: 0px"&gt;&lt;div id="283fabde-4300-40c3-9f21-ecd117da2a61" style="margin: 0px; padding: 0px; display: inline;"&gt;&lt;div&gt;&lt;a href="http://www.youtube.com/watch?v=EpFhS0dAduc" target="_new"&gt;&lt;img src="http://johnbierman.net/images/9/6/1/6/3/145395-136169/videoa3c419f7aa8e.jpg" galleryimg="no" onload="var downlevelDiv = document.getElementById('283fabde-4300-40c3-9f21-ecd117da2a61'); downlevelDiv.innerHTML = &amp;quot;&amp;lt;div&amp;gt;&amp;lt;object width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;param name=\&amp;quot;movie\&amp;quot; value=\&amp;quot;http://www.youtube.com/v/EpFhS0dAduc\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;param name=\&amp;quot;wmode\&amp;quot; value=\&amp;quot;transparent\&amp;quot;&amp;gt;&amp;lt;\/param&amp;gt;&amp;lt;embed src=\&amp;quot;http://www.youtube.com/v/EpFhS0dAduc\&amp;quot; type=\&amp;quot;application/x-shockwave-flash\&amp;quot; wmode=\&amp;quot;transparent\&amp;quot; width=\&amp;quot;425\&amp;quot; height=\&amp;quot;355\&amp;quot;&amp;gt;&amp;lt;\/embed&amp;gt;&amp;lt;\/object&amp;gt;&amp;lt;\/div&amp;gt;&amp;quot;;" alt=""&gt;&lt;/a&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Simple way to FTP a file...</title>
		<link rel="alternate" href="http://johnbierman.net/2009/03/11/simple-way-to-ftp-a-file.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-03-11:a3eea42c-e8e1-489e-b2df-b2d9783ac25f</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-03-11T21:02:52Z</updated>
		<published>2009-03-11T21:02:52Z</published>
		<content type="html">&lt;p&gt;You can use the WebClient class to FTP a file...and it's super simple.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;WebClient wc = new WebClient();      &lt;br /&gt;wc.Credentials = new NetworkCredential(ftpUserName, ftpPassword);       &lt;br /&gt;wc.UploadFile(&lt;a href="ftp://url.com/somefile.txt"&gt;ftp://url.com/somefile.txt&lt;/a&gt;, @&amp;quot;C:\somefile.txt&amp;quot; );&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;There are also a number of overloads for the UploadFile() method. Check 'em out...it's pretty useful.&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Formatting string to phone number...</title>
		<link rel="alternate" href="http://johnbierman.net/2009/02/27/formatting-string-to-phone-number.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-02-27:5bdc0660-4817-4a14-a8f9-4bfe9b749f9b</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-02-27T18:06:20Z</updated>
		<published>2009-02-27T18:06:20Z</published>
		<content type="html">&lt;p&gt;I simple way to format a string to a phone number is by doing to following:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;double result = default(double);      &lt;br /&gt;if (double.TryParse(from.PhoneNumber, out result))       &lt;br /&gt;{       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; to.PhoneNumber = string.Format(&amp;quot;{0: (###) ###-####}&amp;quot;, result);       &lt;br /&gt;} &lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;This format will &amp;quot;9908675309&amp;quot; to &amp;quot;(990) 867-5309&amp;quot;. In order for the string formatting to work the string to be formatted must be converted to a decimal data type.&lt;/p&gt;  &lt;p&gt;Now, I'll admit, there are many ways to skin the proverbial cat (like using a regular expression)...but this is just another way of doing this...&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Cloning a JavaScript Object</title>
		<link rel="alternate" href="http://johnbierman.net/2009/02/19/cloning-a-javascript-object.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-02-19:dbd4a936-df0a-413e-9329-5d591df0365b</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-02-20T00:19:39Z</updated>
		<published>2009-02-20T00:19:39Z</published>
		<content type="html">&lt;p&gt;A simple way to clone a JavaScript object is by creating a new instance of the original object...pretty simple right? All you have to do is something like so:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;var myObj = { FirstName : 'John', LastName : 'Doe' }; &lt;/p&gt;    &lt;p&gt;var myNewObj = myObj;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Wrong &lt;img src="http://johnbierman.net/emoticons/smile.png" border="0" /&gt;! This will create a reference type object that can (and more than likely will) drive you crazy...for example, if you did what I did above, then when you change a value in myNewObj, the same property will be updated with the new value in myObj. Yikes!&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;&lt;strong&gt;&lt;u&gt;Part 1&lt;/u&gt;&lt;/strong&gt;&lt;/p&gt;  &lt;p&gt;The best way to create a cloned copy of an object is by using the &amp;quot;constructor()&amp;quot; method. Once you do this you can iterate through the original object's properties and then assign them to the newly created object. &lt;/p&gt;  &lt;p&gt;The following method illustrates this concept. Please note that there is an additional parameter that specifies whether or not the cloning is to be done on properties that are objects in and of themselves. If a deep clone is being requested, then the method simply recursively calls itself and walks all the way down the object stack.&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;function clone (obj, deep) {     &lt;br /&gt;&amp;#160; var objectClone = new obj.constructor();      &lt;br /&gt;&amp;#160; for (var property in obj)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (!deep)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; objectClone[property] = obj[property];      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; else if (typeof obj[property] == 'object')      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; objectClone[property] = obj[property].clone(deep);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; else      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; objectClone[property] = obj[property];      &lt;br /&gt;&amp;#160; return objectClone;      &lt;br /&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;You can call this method like so:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;var myObj = { FirstName : 'John', LastName : 'Doe' };&lt;/p&gt;    &lt;p&gt;var myNewObj = clone(myObj, false);&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;It's worth nothing that the key to making this work is the &lt;em&gt;new obj.constuctor()&lt;/em&gt; statement. This creates a new JavaScript object that is no longer a reference to the original object, but that will be constructed the exact same.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;&lt;u&gt;&lt;strong&gt;Part 2&lt;/strong&gt;&lt;/u&gt;&lt;/p&gt;  &lt;p&gt;Now, if you're feeling really ambitious, then you can modify the method a bit by getting rid of the &amp;quot;obj&amp;quot; parameter, and then associating the method with the grand-daddy of 'em all: JavaScript base &amp;quot;Object&amp;quot; class...see below:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;function clone (deep) {     &lt;br /&gt;&amp;#160; var objectClone = new this.constructor();      &lt;br /&gt;&amp;#160; for (var property in this)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (!deep)      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; objectClone[property] = this[property];      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; else if (typeof this[property] == 'object')      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; objectClone[property] = this[property].clone(deep);      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; else      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; objectClone[property] = this[property];      &lt;br /&gt;&amp;#160; return objectClone;      &lt;br /&gt;}&lt;/p&gt;    &lt;p&gt;Object.prototype.clone =&amp;#160; clone;&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Notice the method now uses the &amp;quot;this&amp;quot; keyword (i.e. var objectClone = new &lt;em&gt;this.constructor(), this[property], etc&lt;/em&gt;). This is because the method will now be available for any JavaScript object...pretty cool eh.&lt;/p&gt;  &lt;p&gt;You can use this prototype like so:&lt;/p&gt;  &lt;blockquote&gt;   &lt;p&gt;var myObj = { FirstName : 'John', LastName : 'Doe' }; &lt;/p&gt;    &lt;p&gt;var myNewObj = myObj.clone(false);&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Happy coding!!&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Nifty JavaScript Date Comparison</title>
		<link rel="alternate" href="http://johnbierman.net/2009/02/17/nifty-javascript-date-comparison.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-02-17:357153b0-ed03-42e8-b6b4-83d0307f707c</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-02-17T16:37:57Z</updated>
		<published>2009-02-17T16:37:57Z</published>
		<content type="html">&lt;p&gt;Comparing dates and times in JavaScript is pretty simple really. The following little code snippet illustrates how simple it really is:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;/* Returns the number of minutes between the two dates.    &lt;br /&gt;* Understanding the result:     &lt;br /&gt;*&amp;#160; - If less than zero then dateB is earlier than dateA.     &lt;br /&gt;*&amp;#160; - If zero then the dates are the same.     &lt;br /&gt;*&amp;#160; - If greater than zero then dateA is early than dataB.     &lt;br /&gt;*/     &lt;br /&gt;function compareDates(dateA, dateB ) {     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; var difference = 0,     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _dateB = new Date(dateB ),     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; _dateA = new Date(dateA);&lt;/p&gt;  &lt;p&gt;   &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; difference = _dateB - _dateA;     &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return Math.round(difference/(1000*60)); // compute minutes     &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;There isn't much to elaborate on this topic...it's pretty straight forward. This is a helpful function that is worth adding to any JavaScript utility file.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Happy coding!&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>TryParse and Generics...Awesome!</title>
		<link rel="alternate" href="http://johnbierman.net/2009/01/16/tryparse-and-genericsawesome.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2009-01-16:f7c005a6-31d2-4b19-92d8-ddc2eceae305</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2009-01-17T00:08:54Z</updated>
		<published>2009-01-17T00:08:54Z</published>
		<content type="html">&lt;p&gt;Here's a fantastic way to write a generic method that will TryParse any struct that implements this type check. I hate writing the same three lines of code over and over to try and parse a value...so, here's a way of doing it. I placed this method into a helper class that contains helper APIs.&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;public delegate bool ParseDelegate&amp;lt;T&amp;gt;(string value, out T result);   &lt;br /&gt;public static T TryParse&amp;lt;T&amp;gt;(string value, ParseDelegate&amp;lt;T&amp;gt; parse) where T : struct    &lt;br /&gt;{    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; T result;    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; parse(value, out result);    &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; return result;    &lt;br /&gt;}&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I will give credit where credit is due... I found this little ditty on Steve Michelotti's blog:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://geekswithblogs.net/michelotti/Default.aspx" href="http://geekswithblogs.net/michelotti/Default.aspx"&gt;http://geekswithblogs.net/michelotti/Default.aspx&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Good stuff Steve!!&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Removing Items from a Javascript Array</title>
		<link rel="alternate" href="http://johnbierman.net/2008/12/30/removing-items-from-a-javascript-array.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2008-12-30:9d3c48f2-23a4-4f47-9524-ccffdfadd7b0</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2008-12-30T18:32:10Z</updated>
		<published>2008-12-30T18:32:10Z</published>
		<content type="html">&lt;p&gt;The most simple way to remove an item from a Javascript array is by using the &amp;quot;splice()&amp;quot; function. It not only removes the item, but maintains the index position of the newly updated array. This function allows you to define the index position of the element you want to remove, but also allows you to define the range of items to be removed as well.&lt;/p&gt;  &lt;p&gt;Example:&lt;/p&gt;  &lt;p&gt;var myArray = new Array();&lt;/p&gt;  &lt;p&gt;myArray[0] = &amp;quot;Pizza&amp;quot;;&lt;/p&gt;  &lt;p&gt;myArray[1] = &amp;quot;Cereal&amp;quot;;&lt;/p&gt;  &lt;p&gt;myArray[2] = &amp;quot;Hot Dog&amp;quot;;&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;To remove the &amp;quot;Cereal&amp;quot; array element, simply do the following&lt;/p&gt;  &lt;p&gt;myArray.splice(1, 1);&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;I found out about this function by reading the following blog:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://codepunk.hardwar.org.uk/ajs44.htm" href="http://codepunk.hardwar.org.uk/ajs44.htm"&gt;http://codepunk.hardwar.org.uk/ajs44.htm&lt;/a&gt;&lt;/p&gt;</content>
	</entry>
	<entry>
		<title>Force Page Validation from Javascript</title>
		<link rel="alternate" href="http://johnbierman.net/2008/12/16/force-page-validation-from-javascript.aspx?ref=rss" />
		<id>tag:www.johnbierman.net,2008-12-29:18d512d6-1a90-4277-bc9e-b92426c0eea5</id>
		<author>
			<name>JohnBierman.NET</name>
		</author>
		<updated>2008-12-29T20:39:51Z</updated>
		<published>2008-12-29T20:39:51Z</published>
		<content type="html">&lt;p&gt;There have been those times wherein I needed to force page validation client-side. In these scenarios I want to avoid the annoying effort of writing a bunch of code to check for empty values or certain selections yadda yadda yadda...I also want to take advantage of all of the nifty ASP.NET validation controls that come with Visual Studio (i.e. RequiredFieldValidator, CompareValidator, etc).&lt;/p&gt;  &lt;p&gt;In a high-octane Ajax enable web application manually invoking these validation controls to fire on the client instead of allowing .NET to manage their execution is crucial.&lt;/p&gt;  &lt;p&gt;The last thing I want to do is write a bunch of code to check for certain values...this is a pain. It's much easier to wire up a .NET validator to a server control. So, it turns out that the way to execute page validation on demand from Javascript is by manually calling the Page_ClientValidate() function. It works like this:&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;ul&gt;   &lt;li&gt;Create your server controls (the TextBox will be validated by a required field validator to&amp;#160; ensure that a value has been entered by a user, and the Input:Button will be used to fire the Javascript SaveData() function): &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;asp:TextBox ID=&amp;quot;TextBox1&amp;quot; runat=&amp;quot;server&amp;quot; /&amp;gt; &lt;/p&gt;    &lt;p&gt;&amp;lt;input type=&amp;quot;button&amp;quot; value=&amp;quot;Save&amp;quot; onclick=&amp;quot;SaveData()&amp;quot; /&amp;gt; &lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;Create your validation control and associate with the server control: &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;&amp;lt;asp:RequiredFieldValidator ID=&amp;quot;Validator1&amp;quot; runat=&amp;quot;server&amp;quot;      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ControlToValidate=&amp;quot;TextBox1&amp;quot;       &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; ErrorMessage=&amp;quot;You must enter a value into the textbox.&amp;quot; /&amp;gt;&lt;/p&gt; &lt;/blockquote&gt;  &lt;ul&gt;   &lt;li&gt;In Javascript call the Page_ClientValidate() function: &lt;/li&gt; &lt;/ul&gt;  &lt;blockquote&gt;   &lt;p&gt;function SaveData() {      &lt;br /&gt;&amp;#160;&amp;#160;&amp;#160; if (Page_ClientValidate()) {       &lt;br /&gt;&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; // Do something Ajaxie      &lt;br /&gt;&amp;#160;&lt;/p&gt;    &lt;p&gt;&amp;#160;&amp;#160;&amp;#160; }      &lt;br /&gt;}&lt;/p&gt; &lt;/blockquote&gt;  &lt;p&gt;Whala...it's that simple. The SaveData() function will fire and the validation error message will be displayed to the user. If the user did enter a value into the textbox, then your code is free to make whatever Ajax call that it needs to...this is high-octane...no server round trips!&lt;/p&gt;  &lt;p&gt;&amp;#160;&lt;/p&gt;  &lt;p&gt;Also, I recently learned that you the Page_ClientValidate() javascript function has an overload wherein you can pass the ValidationGroup that is assigned to a validator (if this has been defined), and the validation will only be executed for that group. Here's a link to the blog that I *learnt* that from:&lt;/p&gt;  &lt;p&gt;&lt;a title="http://magmainteractive.net/weblogs/post/Client-side-validation-with-AJAX.aspx" href="http://magmainteractive.net/weblogs/post/Client-side-validation-with-AJAX.aspx"&gt;http://magmainteractive.net/weblogs/post/Client-side-validation-with-AJAX.aspx&lt;/a&gt;&lt;/p&gt;</content>
	</entry>
</feed>
