<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	>

<channel>
	<title>Thought blog</title>
	<atom:link href="http://www.thoughtblog.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.thoughtblog.com</link>
	<description>I think, therefore I use a Mac! - The random Thoughts of Niels Hansen</description>
	<pubDate>Tue, 13 May 2008 00:51:49 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Introducing Business Intelligence Studio</title>
		<link>http://www.thoughtblog.com/2008/05/08/173/</link>
		<comments>http://www.thoughtblog.com/2008/05/08/173/#comments</comments>
		<pubDate>Thu, 08 May 2008 21:06:46 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[Business Intelligence]]></category>

		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[PerformancePoint Server]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=173</guid>
		<description><![CDATA[
It&#8217;s been a long time coming but I&#8217;m proud to announce Business Intelligence Studio (BIS) from Orange Peel Corporation (OPC).  We&#8217;ve been developing BIS for the last 2 years with the best set of Developers.  I personally want to thank my two core developers: Freddy Castro and Irvin Gomez.  Thanks so much for all your [...]]]></description>
			<content:encoded><![CDATA[<p><img style="border: 0; vertical-align: text-bottom; margin: 10px;" src="http://www.orangepeelcorp.com/Images/logos/bis-logo.png" alt="BIS" width="402" height="93" /></p>
<p>It&#8217;s been a long time coming but I&#8217;m proud to announce <a href="http://www.orangepeelcorp.com/Pages/Public/OurProducts.aspx">Business Intelligence Studio (BIS)</a> from <a href="http://www.orangepeelcorp.com" target="_blank">Orange Peel Corporation (OPC)</a>.  <a href="http://www.veniceconsulting.com" target="_blank">We&#8217;ve</a> been developing BIS for the last 2 years with the best set of Developers.  I personally want to thank my two core developers: Freddy Castro and Irvin Gomez.  Thanks so much for all your hard work and believing in the product.  Without your dedication to the product, it would not have been possible.</p>
<p>I also want to thank Ignacio, Genaro, Alma, Araceli, Marcos and Fernando, !  All Key members that helped get us to the next level. </p>
<p>I may poke fun at Microsoft at times and get frustrated but in the end I truly believe that when it comes to Business Intelligence and development tools, there is no better company!  Our product compliments PerformancePoint Server. Based on Microsoft&#8217;s feedback last week when I was up in Redmond only confirms that!</p>
<p>It&#8217;s been a long and crazy two years but now the real fun begins.  If you&#8217;re looking to take your budget and planning for PerformancePoint to the next level, then you owe it to yourself to check out BIS!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/05/08/173/feed/</wfw:commentRss>
		</item>
		<item>
		<title>This is why I 100% love Apple!</title>
		<link>http://www.thoughtblog.com/2008/04/29/172/</link>
		<comments>http://www.thoughtblog.com/2008/04/29/172/#comments</comments>
		<pubDate>Wed, 30 Apr 2008 05:30:31 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[Apple]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[iMac]]></category>

		<category><![CDATA[switch]]></category>

		<category><![CDATA[apple-care]]></category>

		<category><![CDATA[customer service]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=172</guid>
		<description><![CDATA[OK, yes I&#8217;ve become a Apple Fan-boy but it&#8217;s only because they continue to exceed my expectations.   This week is no exception.  They have gone way beyond my wildest dreams when it comes to making things right!
I just had the company purchase me a new iMac 24 inch, 2.8 GHz a few weeks ago.  I got it [...]]]></description>
			<content:encoded><![CDATA[<p>OK, yes I&#8217;ve become a Apple Fan-boy but it&#8217;s only because they continue to exceed my expectations.   This week is no exception.  They have gone way beyond my wildest dreams when it comes to making things right!</p>
<p>I just had the company purchase me a new iMac 24 inch, 2.8 GHz a few weeks ago.  I got it all configured as I wanted but when it was delivered to me I had some hard drive issues.  I purchased Disk Warrior and for the most part I was able to get the drive fixed.  However there was some Graphic card issues where the computer would lock up after a few hours of heavy GPU usage.  This was really starting to get on my nerves because I purchased 4 macs over the years I&#8217;d never experienced these issues ever before. (I still have my G5 from 2003 and its been my work horse, but that is why I got the iMac to finally replace it).</p>
<p>We&#8217;ll I was going to wait and see if the next build of OS X 10.5.3 would fix some of the issues.  However, on Monday I get an email from Apple telling me about their great new iMacs!  Damn it! I just purchased a new iMac, and I&#8217;m having issues with it and to rub it in my face they release a new one with a ton of upgrades and it&#8217;s only $80 more.</p>
<p>So now I&#8217;m really upset!  So I decided to call Apple Care and to see if they can do something about this iMac that&#8217;s not running as good as it should.  I&#8217;m expecting that I&#8217;m going to have a fight on my hands.</p>
<p>Ahh&#8230;..nope!  I call Apple Care and I actually get a person in less than 1 minute! (At its 1pm PST) I can&#8217;t tell you the last time I got anyone at Dell in under 30 minutes!  I tell the rep the problem I&#8217;m having and she tells me &#8220;no problem! Let&#8217;s see if we can get this resolved for you&#8221;.  She puts me on hold for a few minutes and comes back on the phone and tells me that she&#8217;s going to redirect my call to the sales department and they will get me a full refund.  So I talk to them and they tell me they are going to email me a fedex return code and when they receive the computer back I will get a full refund!</p>
<p>So that&#8217;s not even the best part.  I get the FedEx return code and I&#8217;m able to print out the label so that FedEx can come pick up the defective computer.  I then get another email from Apple with a $50 coupon off my next purchase! WOW! I never even asked for that and they they sent this to me for my problems.  Then around 8:00 at night I get a call from Apple (It went to voicemail)! Holy Crap! When have you ever had Dell call you back?  She tells me she wants to make this right.  She gives me a direct number to call them in the morning and to see if they can get me a new computer.</p>
<p>I call her back but it goes to voice mail. I leave my message.  2 hours later I get a call back from her and she offers to exchange the bad iMac that I&#8217;m sending back for a brand new one and they will wave the $80 difference.  She also tells me that I can still use my coupon later for anything I want from Apple!</p>
<p>Because the old Mac was already being sent back via FedEx, she immediately released the new iMac and changed the delivery from ground to over night  and it will be here tomorrow! (Which she did not have to do either!)</p>
<p>Apple fan or not, this is the BEST customer service I&#8217;ve EVER encountered!</p>
<p>If you&#8217;ve not joined the Apple family, and if this does not convince you why you should, nothing will!</p>
<p>This is one of many reasons I made the switch a few years ago and this is why I&#8217;m an Apple user for life!!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/04/29/172/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AJAX Demystified Part 3 of 3</title>
		<link>http://www.thoughtblog.com/2008/04/28/162/</link>
		<comments>http://www.thoughtblog.com/2008/04/28/162/#comments</comments>
		<pubDate>Mon, 28 Apr 2008 13:08:02 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[ajax]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=162</guid>
		<description><![CDATA[Part 1 of AJAX Demystified we discussed what is AJAX and gave a high level overview of how it all works.
Part 2 we discussed in more detail on how to use the xmlhttprequest object and how to dynamically load content onto the web page without the round trip.  Part 3 we&#8217;ll get into some [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Part 1" href="http://www.thoughtblog.com/2008/04/22/154/">Part 1 </a>of AJAX Demystified we discussed what is AJAX and gave a high level overview of how it all works.</p>
<p><a title="Part 2" href="http://www.thoughtblog.com/2008/04/24/157/">Part 2</a> we discussed in more detail on how to use the <strong>xmlhttprequest </strong>object and how to dynamically load content onto the web page without the round trip.  Part 3 we&#8217;ll get into some more detail that will give you a really good understanding on AJAX and its plumbing.</p>
<h3>Opening the Request Object</h3>
<p>The next line takes a bit of understanding. It takes three (3) arguments and depending on the arguments the outcome can vary greatly.</p>
<p><strong>Open method Argument #1</strong></p>
<p>. open<strong>(“GET”,</strong> sUrl, true);</p>
<p><strong>Available input</strong>: GET or POST</p>
<p><strong>Type</strong>: string</p>
<p>The first argument takes a string. It can be either “GET” or “POST”. A “POST” is usually used when you’re sending the server data such as a form submit. Since we’re not sending any data, it’s easier to use “GET”.</p>
<p><strong>Open method Argument #2</strong></p>
<p>.open(“GET”, <strong>sUrl</strong>, true);</p>
<p><strong>Available input:</strong> a valid URL to the server page</p>
<p><strong>Type</strong>: string</p>
<p>The second argument is the URL where to send the request. This is also a string. However it’s easier to create a variable beforehand with the <em>sUrl</em> variable. If the URL is not valid or it’s not pointing to the right location, the call will fail.</p>
<p>Our example we’re sending the request to a PHP page. However, we could have sent the request to any page that your server can understand. We could have used an asp.net page just as easily.</p>
<p><strong>Open method Argument #3</strong></p>
<p>.open(“GET”, sUrl, <strong>true</strong>);</p>
<p><strong>Available input</strong>: true or false</p>
<p><strong>Type</strong>: Boolean</p>
<p>The last argument tells the browser if we are sending the information asynchronously or not. If it’s set as true, then it’s set asynchronously. If it’s set to false, then the call is synchronous and will wait until the server returns with the response.</p>
<p>You may be asking yourself “why would I ever make a synchronous call?” There are several times where you don’t want the user to continue to use the application until the call is returned such as if the user submitted a transaction type of call. For example what if the page was allowing the user to submit an order? We would want to wait for the response before allowing them to continue.</p>
<h3>Setting the Ready State of the Request Object</h3>
<p>The next line is vital to making an asynchronous call.</p>
<p><strong>requestObj.onreadystatechange = updateDateTime;</strong></p>
<p>The <strong><em>onreadystatechange</em></strong> property needs to know what client side JavaScript function to call returning the response data from the server. This is the callback function. Without it we would have to wait until the response comes back from the server to continue. Remember the third argument of the open method needs to be set to true for this to properly work.</p>
<p>It’s vital that the <strong><em>onreadystatechange</em></strong> property is set before calling the <strong><em>send</em></strong> method of the request object. If not, the callback function can’t be called since the request object did not know until it was too late.</p>
<p>The last thing to remember is not to add the parentheses at the end of the function name when setting it to the <strong><em>onreadystatechange</em></strong> property. In JavaScript the <em>updateDateTime</em> would look like so:</p>
<p>function updateDateTime()</p>
<p>{</p>
<p>…</p>
<p>…</p>
<p>}</p>
<h3>Sending the Request to the Server</h3>
<p>The request object has been initialized, opened, set with what it needs to do, where to go get the information and what callback function to return the response. Now all that is left is to send the request.</p>
<p><strong>requestObj.send(null);</strong></p>
<p>Ok that seems simple enough but why are we sending a null? The reason is we are not sending any information to the server. The default then is to pass in a null object. A null is an empty value. We are sending nothing to the server because we are not required to pass any information.</p>
<p>The key to remember is that AJAX sends information to the server asynchronously and does not use the traditional form submit as we’ve done in the past. When the send method is called the user can continue working on the site. (However more than likely you should get a response almost instantly)</p>
<p>Nonetheless, if you’re having the server do a complex task that may take time, they are free to do other things with the page while waiting for the response back from the server. When the server is ready to send back the response, it makes the call to the callback function we setup with the <em>onreadystatechange</em> property of the request object.</p>
<h3>HTML: Calling the request method</h3>
<p>&lt;BODY&gt;</p>
<p>&lt;H1&gt;Get The Server’s Date and Time&lt;/H1&gt;</p>
<p><strong>&lt;a href=”<span style="color: #ff0000;">javascript: getServerDateTime()</span></strong><strong>”&gt;Make AJAX Call&lt;/a&gt;</strong></p>
<p>&lt;/BODY&gt;</p>
<p>This is a very simple HTML body. All we have here is a header telling the user what the page is doing and a hyperlink.</p>
<p>One thing that you will notice with the hyperlink is that we are making a JavaScript call. It’s calling our AJAX function that will make a request to the server to get the server’s date and time.</p>
<p>We could have used a button or even a timer to go get the time of the server every X seconds. It doesn’t matter. However, notice that we are NOT using a form tag with a submit button. The JavaScript and the request object will handle all the request/response features that normally would have been done with the form tag.</p>
<h3>HTML: Place holder for the Response from the server</h3>
<p>&lt;BODY&gt;</p>
<p>&lt;H1&gt;Get The Server’s Date and Time&lt;/H1&gt;</p>
<p>&lt;a href=”javascript: getServerDateTime()”&gt;Make AJAX Call&lt;/a&gt;</p>
<p><strong>&lt;/br&gt;</strong></p>
<p><strong>&lt;div id=”divDateTime”&gt;&lt;/div&gt;</strong></p>
<p>&lt;/BODY&gt;</p>
<p>We added two (2) more lines of HTML. The first is a line break so that we have a space. The other is a div tag with an id of <em>divDateTime</em>. Notice that we have nothing in between the start and end of the div tag. We could have any text in there if we wanted to. When the server returns the current date and time, the date will be inserted between the start and end tags of <em>divDateTime</em>.</p>
<p>This is how we can update the HTML dynamically. Instead of a round trip with the entire HTML sent back again, only the server’s date will be sent. The browser’s callback function (that we set with the <em>onreadystatechange</em> property of the request object) is responsible for finding this tag and entering in the response from the server.</p>
<h3>Server Side Code</h3>
<p>&lt;?php</p>
<p>$today =date(&#8217;l dS \of F Y h:i:s A&#8217;);</p>
<p><strong>echo</strong> $today</p>
<p>?&gt;</p>
<p>The PHP code above has a very simple task. It creates a date string and returns the response. Instead of sending back HTML like a PHP page normally would do, it sends back a fully formatted date.</p>
<p>If today’s date is Feb 22nd, 2007, it will return back Monday 22nd of February 2007 10:05 AM.</p>
<p>The PHP code could have been complex call like going to the database and retrieving information and then sending back a snippet of XML or HTML. We used this minimal snippet of code to show that it does not always have to be HTML or XML that it returns.</p>
<h3>Handling the Callback function (Server’s Response)</h3>
<p>After the server has completed receiving the request and is ready to return back a response, the callback function set up with the <strong><em>onreadystatechange</em></strong> property is called. The web browser handles this. It knows that the request object made the call and what function to call based on the callback that was setup.</p>
<p>function <strong>updateTime</strong>()<br />
{</p>
<p style="padding-left: 30px;">if (requestObj.<strong>readyState </strong>== 4)<br />
{<br />
var sNewServerDateTime = requestObj.<strong>responseText</strong>;<br />
var elDivDateTime = document.<strong>getElementById</strong>(“divDateTime”);<br />
elDivDateTime.<strong>innerHTML</strong> = “The Server’s current time is:”  +sNewServerDateTime;<br />
}</p>
<p>}</p>
<p><strong>Request readyState Property</strong></p>
<p><strong>Available output</strong>:</p>
<p>0 = <strong>Object not initialized</strong></p>
<p>1 =<strong> Loading</strong></p>
<p>2 =<strong> Loaded</strong></p>
<p>3 = <strong>Interactive</strong></p>
<p>4 = <strong>Complete</strong></p>
<p><strong>Type</strong>: Integer</p>
<p>The <em>readyState</em> property can be used to get the current state of the Request object. The return value that is important in the callback function is the value 4. The property returns that the request object has completed and we should be able to retrieve the response text returned from the server.</p>
<p><strong>Request responseText Method</strong></p>
<p><strong> Available output: </strong> The response from the server</p>
<p><strong>Type</strong>: String</p>
<p>Even though the <em>readyState</em> property has been set to Complete (4), we should have checked the status of the request object. If there was a problem the code should handle it. However for this sample we’re just going to assume that it worked.</p>
<p>(BTW you should never assume anything when writing real software! The only thing you should assume is that it could fail and should always check the state of any object you use)</p>
<p>If all is good we should have received the Date and Time Stamp value from the server. However this could have been a full set of HTML, XML or any data we wished to be returned to the user’s browser.</p>
<p><strong>Document getElementById Method</strong></p>
<p>This method is used to find an Element by its Id.  We are looking for the element with the Id of “divDateTime”.  If it’s found, we have a reference to the element.</p>
<p><strong>innerHTML Method</strong></p>
<p>The <em>innerHTML</em> method allows you to change the inner HTML of an element.  We used the getElementById to find the div tag that we will use to dynamically show the server’s date and Time.  This allows us to change the HTML of the page without reloading the entire page.  Of course this was a very simple update, but it could have easily have been an entire HTML table of information.</p>
<h3>Conclusion</h3>
<p>The sample is very simple but it does show how easy it is to make an AJAX call and update the web page without having to update the entire page. Now that you have a better understanding of how AJAX works, you’ll have a good foundation to build upon</p>
<p>Check out the original PDF article I wrote over at <a title="VCG" href="http://www.veniceconsulting.com/NewsSurveyDet.aspx?id=708" target="_blank">Venice Consulting Group&#8217;s</a> website.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/04/28/162/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Using Subversion Property feature to add Commit Comments</title>
		<link>http://www.thoughtblog.com/2008/04/25/163/</link>
		<comments>http://www.thoughtblog.com/2008/04/25/163/#comments</comments>
		<pubDate>Fri, 25 Apr 2008 22:48:11 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[agile development]]></category>

		<category><![CDATA[subversion]]></category>

		<category><![CDATA[Agile]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=163</guid>
		<description><![CDATA[One of the features I remember using in Visual Source Safe was the ability to put in custom keywords within my comments that would automatically be updated each time I did a check-in. I thought this feature was not available in Subversion, but I was wrong!  Subversion uses Properties!
Subversion Properties
One of the features of Subversion [...]]]></description>
			<content:encoded><![CDATA[<p>One of the features I remember using in Visual Source Safe was the ability to put in custom keywords within my comments that would automatically be updated each time I did a check-in. I thought this feature was not available in Subversion, but I was wrong!  Subversion uses Properties!</p>
<p><strong>Subversion Properties</strong></p>
<p>One of the features of Subversion is the ability to add your own Metadata to a file that goes along with the file each time it&#8217;s committed. Metadata can be changed for each commit and works the same way when your source code or document is committed.  Subversion provides it&#8217;s own set of properties.  One of the properties is  <strong><em>svn:keywords</em></strong>.</p>
<p><strong>svn:keywords Property</strong></p>
<p>svn:keywords property allows specific keywords to be replaced when ever commit to file happens.  This is great for leaving comments in your code that are updated each time a commit is done.  In our latest project we want to update the Author, the Revision Number and the URL (Branch, Trunk or Tag) on each committed.  This gives us a quick status of who last updated the file, what revision number was and where in the Repository.  Thinking now, we should add the date as well.</p>
<p><strong>So how do you set SVN Properties? </strong></p>
<p>There is a couple of ways. One way is to go into the <em>config</em> file on the server where the repository is located and make the pattern change there to use it. So each time a file of that pattern is added to the repository the <em>svn:keywords</em> property is added. By default this is turned off.</p>
<p>The other way is add the property to each file through <strong>TortoiseSVN</strong>.  This can be a pain if you have several files to do, but if you select all your files in your workspace, and then select the properties of the files, you are able to recursively add the property. However the drawback to this is that you need to add the property to any new files that you add to the repository.  Sometimes you don&#8217;t have access to the repository config file so this is the only way to do then.</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-2.png"><img class="alignnone size-full wp-image-165" title="SVN Selecting Properties" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-2.png" alt="Selecting Properties of a SVN file" width="444" height="574" /></a></p>
<p>Once you&#8217;ve selected the properties of the file(s), you&#8217;ll see Subversion tab within the file&#8217;s property sheet. Select the tab and click the <em>Properties</em>&#8230; button.</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-3.png"><img class="alignnone size-full wp-image-166" title="SVN Properties" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-3.png" alt="" width="402" height="555" /></a></p>
<p>A property window opens where you can edit or select a new property for the file(s).</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-41.png"><img class="alignnone size-full wp-image-167" title="SVN Property Window" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-41.png" alt="" width="420" height="557" /></a></p>
<p>Here I have already set up the <em>svn:keywords</em>.  I have decided that for this file the only three (3) keyword values to replace are Author, URL and Rev.  If I wanted to add/remove values, highlight the <em>Property</em> and click the Edit.. button.</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-5.png"><img class="alignleft" style="float: left; border: 0; margin: 5px;" title="SVN Edit Properties" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-5-300x273.png" alt="" width="300" height="273" /></a></p>
<p>I can then add or remove the property values.  Currently there are five (5) values that <em>svn:keywords</em> will search and replace.</p>
<p><strong>Author</strong>: The developer who last committed</p>
<p><strong>Rev:</strong> The revision number when last committed</p>
<p><strong>Date:</strong> The Date of when it was committed.</p>
<p><strong>URL: </strong>the full URL to the latest                 version of the file in the repository.</p>
<p>I<strong>d</strong>: A combination of Author, Rev and Date</p>
<p>Once the keyword values for the <em>svn:keywords</em> property has been set to the file(s), subversion will look for these keywords and replace them with the information from the repository each time a commit happens.</p>
<p><strong>Adding the Comment in your code that will be replaced by the svn:keywords</strong></p>
<p>I&#8217;m doing this in C# but it really does not matter what programming language or file you are adding these keywords to.  As long as it starts and ends with a $</p>
<p>In mode code I added the following 2 comment lines (It could have also been on the same line)</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-7.png"><img class="alignnone size-full wp-image-170" title="SVN Comments before first comment" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-7.png" alt="" width="499" height="327" /></a></p>
<p>Here you see I have // $Author$ , //$Rev$ and //$URL$</p>
<p>Now if I commit the file the keywords will be replaced with the following information:</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-6.png"><img class="alignnone size-full wp-image-169" title="picture-6" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-6.png" alt="" width="500" height="193" /></a></p>
<p>The SVN Commit replaced the $Author$ with $Author: nhansen$.  If the next time someone else on the team commits the change, their name will show up here.</p>
<p>You can see that the revision number has jumped to 1290 when I commit some changes. (Several commits happened between when I first started working on this blog post)</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-8.png"><img class="alignnone size-full wp-image-171" title="SVN before Commit" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/picture-8.png" alt="" width="500" height="290" /></a></p>
<p>This is a very cool feature of Subversion that happens to be hidden to most developers.  Many don&#8217;t even realize that they have this option available to them.  At <a title="VCG" href="http://www.veniceconsulting.com">Venice Consulting Group</a>, we&#8217;ve begun using these new features on a few projects and I can say this has been a very positive experience so far.</p>
<p>If you have any other way of using the Subversion property feature, I&#8217;d love to hear them. Please add them to the comments section.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/04/25/163/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AJAX Demystified Part 2 of 3</title>
		<link>http://www.thoughtblog.com/2008/04/24/157/</link>
		<comments>http://www.thoughtblog.com/2008/04/24/157/#comments</comments>
		<pubDate>Thu, 24 Apr 2008 13:24:34 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[ajax]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[development]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=157</guid>
		<description><![CDATA[Part 1 of AJAX Demystified we discussed what is AJAX and gave a high level overview of how it all works.
Part 2 we are going to get into more detail and actually show you some examples of how it all works.
No more reloading the page!
 
Let’s say we have a site that contains a list [...]]]></description>
			<content:encoded><![CDATA[<p><a title="Part 1" href="http://www.thoughtblog.com/2008/04/22/154/" target="_blank">Part 1 of AJAX Demystified</a> we discussed what is AJAX and gave a high level overview of how it all works.</p>
<p>Part 2 we are going to get into more detail and actually show you some examples of how it all works.</p>
<div class="MsoNormal"><strong><span style="font-family: ">No more reloading the page!</span></strong></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: ">Let’s say we have a site that contains a list of all clients.<span> </span>We may have a search page that uses AJAX to select the clients from the list.</span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"><span style="font-family: "> </span><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/ajax-sample1.jpg"><img class="alignnone size-full wp-image-158" title="ajax-sample1" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/ajax-sample1.jpg" alt="" width="500" height="406" /></a></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: "><br />
</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: ">When the company name is entered we don’t want to reload the entire web page again. Instead we will make an AJAX call to retrieve the clients that match the search criteria.<span> </span>When the request comes back from the server, instead of reloading the page again, we only render the results under the search input area.</span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"><span style="font-family: "> </span><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/ajax-sample2.jpg"><img class="alignnone size-full wp-image-159" title="ajax-sample2" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/ajax-sample2.jpg" alt="" width="500" height="352" /></a></div>
<div class="MsoNormal"><span style="font-family: "><br />
</span></div>
<div class="MsoNormal"><span style="font-family: ">The way this all works is by updating the content of placed div tags within the HTML.<span> </span>We’ll get into the details in a second.</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: ">This image shows before the call is made and where we have the div tag placed</span></div>
<div class="MsoNormal"><span style="font-family: "><br />
</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/ajax-sample1-div-highlight.jpg"><img class="alignnone size-full wp-image-160" title="ajax-sample1-div-highlight" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/ajax-sample1-div-highlight.jpg" alt="" width="500" height="406" /></a></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"><span style="font-family: ">And after the callback is made back to the page:</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/ajax-sample2-div-highlight.jpg"><img class="alignnone size-full wp-image-161" title="ajax-sample2-div-highlight" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/ajax-sample2-div-highlight.jpg" alt="" width="500" height="352" /></a></div>
<div class="MsoNormal"><span style="font-family: "><br />
</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<h3><span style="font-family: ">AJAX: Do it yourself (DIY)<br />
</span></h3>
<div class="MsoNormal"><span style="font-family: ">OK enough you say. Show us how to make an AJAX Call. That sounds fair.<span> </span>You could use one of the frameworks available, but I think to truly understand AJAX, you need to at least understand how to do it yourself without using a framework. Once you feel comfortable with this, I do suggest using one of the frameworks because the “heavy lifting” will be handled for you. By understanding the core of AJAX, I believe you will be less likely to make big mistakes with an AJAX framework.</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"><span style="font-family: ">There are a couple of things that I won’t cover while explaining how to use AJAX:</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal" style="margin-left: 60pt; text-indent: -0.25in;"><strong><span style="font-family: ">HTML</span></strong><span style="font-family: ">:<span> </span>If you don’t understand the basics of HTML, this will be beyond your expertise.<span> </span>I would recommend getting a good handle of HTML first. I would recommend the <a href="http://www.amazon.com/XHTML-Sixth-Visual-Quickstart-Guide/dp/0321430840/sr=8-1/qid=1172172221/ref=pd_bbs_sr_1/105-9652400-7196425?ie=UTF8&amp;s=books">Visual Start Guide</a>.</span></div>
<div class="MsoNormal" style="margin-left: 60pt; text-indent: -0.25in;"><span style="font-family: "> </span></div>
<div class="MsoNormal" style="margin-left: 60pt; text-indent: -0.25in;"><strong><span style="font-family: ">JavaScript</span></strong><span style="font-family: ">: I don’t expect you to be an expert, but you need to know some of the basics of the scripting language.</span></div>
<div class="MsoNormal" style="margin-left: 60pt; text-indent: -0.25in;"><strong><span style="font-family: ">Document Object Model (DOM</span></strong><span style="font-family: ">): I won’t go much into the DOM, but I will be using some of the DOM to find Elements of the HTML.</span></div>
<div class="MsoNormal" style="margin-left: 60pt; text-indent: -0.25in;"><strong><span style="font-family: ">Server side Development</span></strong><span style="font-family: ">. The example will use PHP for the server side.<span> </span>I will try to explain what is going on the back end. It’s not necessary to understand PHP, but if you’ve done any server side development, you’ll probably understand what is going on.</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<h3><span style="font-family: ">The Request Object (XMLHTTPRequest) – The core object of AJAX</span></h3>
<div class="MsoNormal"><span style="font-family: ">Most modern browsers have the ability to do AJAX development through the request object.<span> </span>Without the request object we’re not able to do AJAX development. This request object is responsible for the calls between the browser and the server.</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: ">On the other hand I wish life was that simple.<span> </span>The JavaScript function will need to determine which version to use.<span> </span>Internet Explorer 6 requires the ActiveX request object, but the other browsers don’t understand ActiveX, so they require making use of <strong><em>XMLHTTPRequest</em></strong> object.<span> </span>The good news is that JavaScript has a nice feature:<span> </span>the <strong><em>try&#8230;catch</em></strong> exception handling commands.<span> </span>If the browser fails trying to create one, we can try initializing the request object with another call.</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"><span style="font-family: ">NOTE:</span></div>
<div class="MsoNormal" style="margin-left: 0.5in;"><em><span style="font-family: ">The actual name of the object is <strong>XMLHTTPRequest</strong>.<span> </span>To keep it simple I am going to call it the request object. This refers to the <strong>XMLHTTPRequest</strong> object in FireFox, Safari and Opera. If the browser is Microsoft’s Internet Explorer, then I am referring to the </span></em><strong><em><span style="font-family: ">Msxml2</span></em></strong><em><span style="font-family: ">.<strong>XMLHTTP</strong> or the <strong>Microsoft</strong>.<strong>XMLHTTP</strong> ActiveX Controls.</span></em></div>
<div class="MsoNormal" style="margin-left: 0.5in;">
</div>
<div class="MsoNormal" style="margin-left: 0.5in;"></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: ">For this example let’s start by inserting some JavaScript into a normal HTML page. We’re going to create a JavaScript function called <em>initRequest</em>().<span> </span>Add this in the HEAD Tag of the HTML</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: ">&lt;head&gt;</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: "><span> </span>&lt;title&gt;My First AJAX App&lt;/title&gt;</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: "><span> </span>&lt;script&gt;</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><span style="font-size: 10pt; font-family: "><span> </span></span><strong><span style="font-size: 10pt; font-family: ">var requestObj = null;</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: "><span> </span>function </span></strong><strong><span style="font-size: 10pt; font-family: ">initRequest</span></strong><strong><span style="font-size: 10pt; font-family: "> ()</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: "><span> </span>{</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>try</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>{</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>requestObj = new </span></strong><strong><span style="font-size: 10pt; font-family: "><span style="color: #ff0000;">XMLHttpRequest</span>();</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>}</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>catch (failedNoramlRequest)</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>{</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>try</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>{</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 90px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>requestObj = new<span> </span></span></strong><strong><span style="font-size: 10pt; font-family: "><span style="color: #ff0000;">ActiveXObject(“Msxml2.XMLHTTP”)</span>;</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span><span> </span>}</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>catch (tryotherObject)</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>{</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 90px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>try</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 90px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>{</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 120px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>requestObj = new <span style="color: #ff0000;">ActiveXObject(“Microsoft.XMLHTTP”)</span>;</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 90px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>}</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 90px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>catch (failed)</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 90px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>{</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 120px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>requestObj = null;</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 90px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>}</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>}</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>}</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;">
</div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>if (requestObj == null) </span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>alert(“You’re browser does not support AJAX!”);</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: "><span> </span>}</span></strong><strong></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><span style="font-size: 10pt; font-family: "><span> </span><strong>&lt;/script&gt;</strong></span></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: ">&lt;/head&gt;</span></strong></div>
<div class="MsoNormal"></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"><span style="font-family: ">The first variable that is created is the request object outside of the function. This is a global variable. It’s global because we’ll be using the same object when receiving data back from the server in a different function. The function needs to initialize the request object. The correct <em>XMLHttpRequest</em> object needs to be initialized based on the user’s browser they are using. </span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: ">If an exception is thrown, the code checks to see if it can use the <em>Msxml2.XMLHTTP</em> ActiveX control from Microsoft. (This object only works on Microsoft browsers running on Microsoft Windows) If that fails, then our last resort is to try the older <em>Microsoft.XMLHTTP</em> object.</span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<div class="MsoNormal"><span style="font-family: ">Finally if the last exception is thrown, the user is out of luck!<span> </span>On the other hand this will be VERY unlikely.<span> </span>Their browser would have been several years old and probably could not use most of the websites created today. One solution you could offer is the ability to redirect them to the Molliza or Microsoft website to download the latest browser.</span></div>
<div class="MsoNormal"><span style="font-family: "> </span></div>
<h3>Calling the Request Object</h3>
<div class="MsoNormal"><span style="font-family: ">Now that the function has created the Request object, it’s time to try it out and make a request to the server. Let’s start by creating a new JavaScript function that we will call from a hyperlink.<span> </span>Add the following code after the <em>initRequest</em>() function: (make sure it’s still within the script tag of the HTML Page.)</span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: ">function </span></strong><strong><span style="font-size: 10pt; font-family: ">getServerDateTime</span></strong><strong><span style="font-size: 10pt; font-family: ">()</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: ">{</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>initRequest();</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>if (requestObj != null)</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>{</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>var sUrl = “ajax_getServerDateTime.php”;</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>requestObj.</span></strong><strong><span style="font-size: 10pt; font-family: ">open</span></strong><strong><span style="font-size: 10pt; font-family: ">(“GET”,sUrl,true);</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>requestObj.</span></strong><span style="color: #ff0000;"><strong><span style="font-size: 10pt; font-family: ">onreadystatechange</span></strong></span><strong><span style="font-size: 10pt; font-family: "><span style="color: #ff0000;"> </span>= updateDateTime;</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 60px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>requestObj.</span></strong><strong><span style="font-size: 10pt; font-family: ">send</span></strong><strong><span style="font-size: 10pt; font-family: ">(null);</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial; padding-left: 30px;"><strong><span style="font-size: 10pt; font-family: "><span> </span>}</span></strong></div>
<div class="MsoNormal" style="background: #e0e0e0 none repeat scroll 0% 0%; -moz-background-clip: -moz-initial; -moz-background-origin: -moz-initial; -moz-background-inline-policy: -moz-initial;"><strong><span style="font-size: 10pt; font-family: ">}</span></strong></div>
<div class="MsoNormal"></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"><span style="font-family: ">The first line in the function takes care of creating the new Request object.</span></div>
<div class="MsoNormal"><span style="font-family: ">If the request object is not null then the request object can be used. Next a variable is created that contains the URL string.<span> </span>The URL must point to the server page that will be receiving the request from the browser.</span></div>
<div class="MsoNormal">
</div>
<div class="MsoNormal"></div>
<div><span style="font-size: 12pt; font-family: "><strong> </strong></span></div>
<div>This concludes Part 2.
</div>
<div><a href="http://www.thoughtblog.com/2008/04/28/162/">Part 3</a> wraps up our series on Ajax Demystified.
</div>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/04/24/157/feed/</wfw:commentRss>
		</item>
		<item>
		<title>AJAX Demystified Part 1 of 3</title>
		<link>http://www.thoughtblog.com/2008/04/22/154/</link>
		<comments>http://www.thoughtblog.com/2008/04/22/154/#comments</comments>
		<pubDate>Tue, 22 Apr 2008 13:05:32 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[PHP]]></category>

		<category><![CDATA[Technology]]></category>

		<category><![CDATA[ajax]]></category>

		<category><![CDATA[javascript]]></category>

		<category><![CDATA[ruby]]></category>

		<category><![CDATA[development]]></category>

		<category><![CDATA[web]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=154</guid>
		<description><![CDATA[What is AJAX?
If you think that AJAX is a cleaning product then you your reading the wrong article and you should stop immediately. However if the people you talk to on a regular basis keep using words like AJAX and web 2.0, then this article is for you.
The acronym AJAX stands for Asynchronous JavaScript And [...]]]></description>
			<content:encoded><![CDATA[<h3><span style="font-family: ">What is AJAX?</span></h3>
<p>If you think that AJAX is a cleaning product then you your reading the wrong article and you should stop immediately. However if the people you talk to on a regular basis keep using words like AJAX and web 2.0, then this article is for you.</p>
<p>The acronym AJAX stands for <strong>A</strong>synchronous <strong>J</strong>avaScript <strong>A</strong>nd (+) <strong>X</strong>ML.</p>
<h3>OK…. But what does AJAX really mean?</h3>
<p>AJAX has been described as way to build rich/dynamic Internet applications that are interactive and responsive.  Rich and dynamic Web Sites and Internet Applications typically have one thing in common – they are heavy. Heavy in the sense that that entire rich content means larger downloads and slower performance for the end user. So, how does AJAX help to make sites more responsive? One of the primary ways is to render the page once and then update sections of the page without having to reload the entire page again. So now, with AJAX, every time a content element changes, we no longer have to reload the entire page, just that particular piece of content.</p>
<h3>Where did the catch-phrase “AJAX” come from?</h3>
<p>Back in early 2005, Jesse James Garrett came up with acronym AJAX. Looking back this is not the best acronym for the technology described but the Internet community adopted it and the rest is history. The irony of it all is Jesse did not mean for it be an acronym.</p>
<h3>Do I have to know or use JavaScript to develop an AJAX App?</h3>
<p>The short answer is no.  There are many AJAX enabled languages/frameworks that require the developer to use little or no JavaScript.  A few popular frameworks include Ruby on Rails, Microsoft’s ASP.NET AJAX 1.0, Sun’s Java and Adobe Flash. Each requires little or no knowledge of JavaScript to build an AJAX enabled web app.  Most of the frameworks listed above create the JavaScript for you.</p>
<p>Nevertheless, if you don’t want to use a specific framework on the back end, then doing your own AJAX implementation gives you the greatest flexibility.  The other possibility is to use a JavaScript framework that supports AJAX, one of the most popular being Prototype JS.  In fact Ruby on Rails has integrated Prototype directly into its own framework.  In our experience, using the Prototype framework still gives you the greatest flexibility without locking you to specific back end framework.</p>
<h3>Do I have to use XML?</h3>
<p>The XML part of AJAX acronym can be the most confusing part. At times you will use XML to send and receive data between the browser and the server, however most of the time you’ll probably be receiving HTML content and using the DOM (document object model) to update a specific section of the page. Don’t feel guilty if you’re not using XML, it’s not a requirement. This is another reason why AJAX is probably not the best name to describe the technology.   You could create an entire AJAX enabled site and NEVER use XML!</p>
<h3>Before AJAX we had the Postback! (Rinse and repeat)</h3>
<p>Before AJAX enabled web applications, the process was simple:</p>
<p>A User’s browser makes a request to the Website.</p>
<p>The server receives the request.</p>
<p>The server processes the request and resends back the entire page.</p>
<p>A User’s browser receives the request and renders the HTML.</p>
<p>User enters some data, clicks a button or hyperlink and then sends the request back to the server.</p>
<p>Repeat the process.</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/serverrequestresponse.png"></a></p>
<p style="text-align: center;"><img class="alignnone size-full wp-image-155" title="serverrequestresponse" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/serverrequestresponse.png" alt="" width="500" height="342" /></p>
<p>However, there are a couple of problems with this approach:</p>
<p>The server is doing all the work.  The server is sending the entire HTML of the page each time there is a request for the web page.</p>
<p>The amount of data sent back can be large and when it’s been sent back several times it compounds the problem.</p>
<p>The browser has to completely render the page each time it receives the content from the server.</p>
<p>The application does not feel responsive. You’re waiting for the server to give an update.</p>
<p>The site is not very interactive. If you don’t do anything with the page you’re not getting any feedback from the server.</p>
<p>When the first browser was created for rendering HTML, it was just that, a browser. New innovations were introduced for modern browsers (Fire Fox, Internet explorer 6+, Safari, and Opera) such as client side scripting languages (JavaScript, VBScript) and the availability of the Document Object Model (DOM).<span> </span>The average computer today and its browser are extremely powerful and are capable of doing more of the work that was traditionally done on the server side.</p>
<p>Finally, the number of potential people browsing your web application has increased and will continue to grow causing more work for your server(s). Reducing the workload by sending less content for each request, your web application will feel more responsive and will be capable of handling more users requesting content.</p>
<h3>Let JavaScript and the browser do the talking!</h3>
<p>Now let’s talk about the AJAX way. Instead of using the Form Tag to do the send requests to the server, we are going to use JavaScript to make the request. When the server sends back the information we use JavaScript to dynamically update the page without having to render the entire page all over again.</p>
<p>Another advantage is that the request is being made asynchronously (Hence the Asynchronous in AJAX).The user is still able to interact with the web application while the request is being made to the server. When the response from the server is returned to the browser, a call is made to a JavaScript function that handles the response. This is called a callback function. The advantage is that you’re not waiting around for updates to occur; this is what makes AJAX enabled web applications so powerful!</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/xmlhttprequest.png"><img class="alignnone size-full wp-image-156" title="xmlhttprequest" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/xmlhttprequest.png" alt="" width="500" height="178" /></a></p>
<p><strong>This concludes part 1 of 3 on Ajax Demystified.</strong></p>
<p><a href="http://www.thoughtblog.com/2008/04/24/157/" target="_blank">Check out Part 2</a> where we go into more detail on how to actually write a simple AJAX app.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/04/22/154/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Need to Monitor your SVN projects? Use CommitMonitor</title>
		<link>http://www.thoughtblog.com/2008/04/21/148/</link>
		<comments>http://www.thoughtblog.com/2008/04/21/148/#comments</comments>
		<pubDate>Mon, 21 Apr 2008 12:26:29 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[Technology]]></category>

		<category><![CDATA[agile development]]></category>

		<category><![CDATA[subversion]]></category>

		<category><![CDATA[Agile]]></category>

		<category><![CDATA[Commit Monitor]]></category>

		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=148</guid>
		<description><![CDATA[of those cool applications that I&#8217;ve found on the internet is a product call Commit Monitor.  It&#8217;s a great little tool that runs inside your task tray for Windows.  When ever a commit has happened you&#8217;ll be notified (based on the time you set to check the Repository)
This is very helpful for me as the [...]]]></description>
			<content:encoded><![CDATA[<p>of those cool applications that I&#8217;ve found on the internet is a product call <a title="Commit Monitor" href="http://tools.tortoisesvn.net/CommitMonitor" target="_blank">Commit Monitor</a>.  It&#8217;s a great little tool that runs inside your task tray for Windows.  When ever a commit has happened you&#8217;ll be notified (based on the time you set to check the Repository)</p>
<p>This is very helpful for me as the CTO to know that the teams are actually committing their work and I can review each project without having to get a local copy on my machine.  This is also VERY helpful when your on a time and need to know if others on the team have committed any new changes that you may need to get to keep current.</p>
<p>Here is a screen shot of what it looks like. This is snapshot of one of our Servers that contains the current active projects we have going on at the time.  I have blacked out the names of the projects to protect the innocent.</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/svncommitmonitor.png"><img class="alignnone size-full wp-image-149" title="svncommitmonitor" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/svncommitmonitor.png" alt="" width="500" height="420" /></a></p>
<p>This is the main screen for the application. On the left you can see all the repositories from a specific server. If you had other projects your working on from different servers, you could also add them there too. I have not seen a limation.  On the right pane, you have all the revisions, the date and the author of who checked in.</p>
<p>If you needed to get a diff on a what has changed, its just as easy as selecting the two revisions in the repository and clicking the show Diff.  If you have a specific Diff Program you like to use, simply select it in the options area of the application and it will use that tool.</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/svncommit.png"><img class="alignleft size-full wp-image-150" style="float: left; border: 0; margin: 3px;" title="svncommit" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/svncommit.png" alt="" width="192" height="31" /></a></p>
<p>When the application goes and checks to see if a anything is commited, you will see that that the icon on the tray is animating. (if you don&#8217;t like the animation you can also turn this off too.)</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/svncommit2.png"><img class="alignright size-full wp-image-152" style="float: right;" title="svncommit2" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/svncommit2.png" alt="" width="205" height="119" /></a></p>
<p>If you happen to be at the computer when the commit has changed, you&#8217;ll also hear a sound (same one as exchange so I had to change it because I thought I was getting email) and a message alert telling you the project, how many commits since you last checked the main screen for that repository, and the author who made the change.</p>
<p>To view the changes double click on the icon in the tray.  It will bring up the window that shows you all the projects your monitoring and any new updates since you last checked will be in bold with a number in parentheses telling you how many commits.</p>
<p><a href="http://www.thoughtblog.com/wp-content/uploads/2008/04/svncommit3.png"><img class="alignnone size-full wp-image-153" title="svncommit3" src="http://www.thoughtblog.com/wp-content/uploads/2008/04/svncommit3.png" alt="" width="439" height="318" /></a></p>
<p>So that&#8217;s Commit Monitor in a nut shell. If think this tool would be as valuable as I have, download it and donate some money to the developer. I gave some money so if everyone did, we can support him to continue to make great tools like this one!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/04/21/148/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Want to see your youTube Videos in Higher Resolution?</title>
		<link>http://www.thoughtblog.com/2008/04/18/147/</link>
		<comments>http://www.thoughtblog.com/2008/04/18/147/#comments</comments>
		<pubDate>Fri, 18 Apr 2008 14:12:41 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[youtube]]></category>

		<category><![CDATA[youtube HD]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=147</guid>
		<description><![CDATA[One of the things that I don&#8217;t like about youtube sometimes is the quality of the video when it is encoded.   I have a HD camera and the quality is pretty good for the most part.  However when its encoded on youtube the quality goes south. 
The other day I was told about this trick you [...]]]></description>
			<content:encoded><![CDATA[<p>One of the things that I don&#8217;t like about youtube sometimes is the quality of the video when it is encoded.   I have a HD camera and the quality is pretty good for the most part.  However when its encoded on youtube the quality goes south. </p>
<p>The other day I was told about this trick you can do to watch your videos in higher resolution. I don&#8217;t know if this is a new feature coming soon and they don&#8217;t want to release it yet but it does work.</p>
<p>For example this video of mine</p>
<p><a href="http://www.youtube.com/watch?v=V7y0Zt3X-zo">http://www.youtube.com/watch?v=V7y0Zt3X-zo</a><br />
 <br />
The titles are distored and hard to read.</p>
<p>however look at this</p>
<p><a href="http://www.youtube.com/watch?v=V7y0Zt3X-zo&amp;fmt=18">http://www.youtube.com/watch?v=V7y0Zt3X-zo&amp;fmt=18</a></p>
<p>The quality is much better!</p>
<p>So append to the url &amp;fmt=18 and you get the better resolution. I&#8217;m not sure how far back this will work on the videos but I have some video from May of 2007 that it works on.</p>
<p>You&#8217;ll also notice that there is a new icon that allows you to switch back and forth on the player. It only shows up when you add the &amp;fmt=18</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/04/18/147/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Apple replaced my iPhone with no questions asked</title>
		<link>http://www.thoughtblog.com/2008/04/17/146/</link>
		<comments>http://www.thoughtblog.com/2008/04/17/146/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 13:15:55 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[Apple]]></category>

		<category><![CDATA[iPhone]]></category>

		<category><![CDATA[ATT]]></category>

		<category><![CDATA[Sprint]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=146</guid>
		<description><![CDATA[I&#8217;ve had my iPhone for about 8 months now and there was an issue with the side buttons on the phone that controlled the volumne and the mute.  They stopped working one day for reasons unknown. So I headed down to San Diego to the Apple store fearing the worst. I&#8217;d figure I&#8217;d have to fight [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve had my iPhone for about 8 months now and there was an issue with the side buttons on the phone that controlled the volumne and the mute.  They stopped working one day for reasons unknown. So I headed down to San Diego to the Apple store fearing the worst. I&#8217;d figure I&#8217;d have to fight to get them to fix it.  Well I got into the store, talked the Genious Bar dude.  He took a look, told me hold on a second and came out with a new iPhone and put my SIM chip into the new phone!  Wow. I thought they were going to send it in, I&#8217;d be out without a phone a while. Nope. Brand new phone!  Now that&#8217;s what I like.</p>
<p>I remember having an issue with my phone when I was with Sprint and they would find any excuse not to replace the phone. I had a minor scratch on the phone (normal wear and tear) and the guy said I must have damaged it on purpose so they are not going to replacement. My wife also had an issue and they would not replace it for free because they said she had split Coke on it.  WTF. She does not even drink Soda!  That is why the phone carriers should be very worried about Apple getting into their market because the days of screwing over the consumer are over.  Now the ultimate would be for them to get off of AT&amp;T and become their own provider!! (one can only dream)</p>
<p> </p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/04/17/146/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Classic Microsoft internal Sales Video on Vista SP1</title>
		<link>http://www.thoughtblog.com/2008/04/16/145/</link>
		<comments>http://www.thoughtblog.com/2008/04/16/145/#comments</comments>
		<pubDate>Thu, 17 Apr 2008 05:02:16 +0000</pubDate>
		<dc:creator>Niels Hansen</dc:creator>
		
		<category><![CDATA[Microsoft]]></category>

		<category><![CDATA[Vista]]></category>

		<category><![CDATA[Apple]]></category>

		<category><![CDATA[OSX]]></category>

		<category><![CDATA[Vista SP1]]></category>

		<category><![CDATA[Windows]]></category>

		<category><![CDATA[XP]]></category>

		<guid isPermaLink="false">http://www.thoughtblog.com/?p=145</guid>
		<description><![CDATA[Microsoft internal video on Windows Vista SP1

 What I was laughing my ass off about this video is a few months back I was chatting with a Microsoft Employee who happens to be in Sales.  He said the almost the exact same line as the video.  He said in so many words  &#8221;Some Enterprises did not deploy [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.youtube.com/watch?v=sPv8PPl7ANU">Microsoft internal video on Windows Vista SP1</a><br />
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="425" height="355" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="wmode" value="transparent" /><param name="src" value="http://www.youtube.com/v/sPv8PPl7ANU&amp;hl=en" /><embed type="application/x-shockwave-flash" width="425" height="355" src="http://www.youtube.com/v/sPv8PPl7ANU&amp;hl=en" wmode="transparent"></embed></object></p>
<p> What I was laughing my ass off about this video is a few months back I was chatting with a Microsoft Employee who happens to be in Sales.  He said the almost the exact same line as the video.  He said in so many words  &#8221;Some Enterprises did not deploy Vista because they don&#8217;t want to Adopt early but that going to be over with SP1&#8243;.  When he said it to me, I was thinking then, Man he is really drinking the Microsoft Kool-aid.  Now after watching this video I&#8217;m convinced its now a PIC line directly to the heart. I also had to bit by tongue and not ask him about all the people who have rolled back to XP. </p>
<p>I used both OS X and I&#8217;m a switcher (no not to OS X, I did that already, but back to XP) but I still have one machine running Vista.  What&#8217;s even more depressing is that the machine has still not done the auto update to SP1.  I talked to another Microsoft employee who works there for a long time now but does not always give me the company line told me it will not update my computer until the issues for certain drivers on my machine have been resolved.  If I try to update SP1 on its own it will fail!  Some Service Pack!  All the more reason to stay with XP and wait for XP SP3.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.thoughtblog.com/2008/04/16/145/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
