<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0">
  <channel>
    <title>Ralph Whitbeck - Blog - How-to</title>
    <link>http://ralphwhitbeck.com/</link>
    <description />
    <language>en-us</language>
    <copyright>Ralph Whitbeck</copyright>
    <lastBuildDate>Tue, 22 Jun 2010 01:24:59 GMT</lastBuildDate>
    <generator>newtelligence dasBlog 1.9.6264.0</generator>
    <managingEditor>ralph.whitbeck@gmail.com</managingEditor>
    <webMaster>ralph.whitbeck@gmail.com</webMaster>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=052711fb-4998-4af2-b597-cbf249d783c9</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,052711fb-4998-4af2-b597-cbf249d783c9.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,052711fb-4998-4af2-b597-cbf249d783c9.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=052711fb-4998-4af2-b597-cbf249d783c9</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <iframe src="http://ralphwhitbeck.com/demos/2010/June/jQuery-Twitter-Template/twitter.html" width="320" height="235" align="right" frameborder="0" scrolling="no">
        </iframe>
        <p>
A while back, I wrote a blog post on <a href="http://ralphwhitbeck.com/2007/11/20/PullingTwitterUpdatesWithJSONAndJQuery.aspx" target="_blank">how
to pull in your last three twitter posts into your web page via jQuery and JSON</a>.
It's still today a very popular post. 
</p>
        <p>
A lot has happened since that post and I wanted to re-address it and show you an alternative
way of pulling in your Twitter feed via jQuery and the new Templating plugin developed
by Microsoft. On the right is a new Twitter widget I put together using the new jQuery
templating plugin.
</p>
        <h3>Microsoft's Templating Plugin
</h3>
        <p>
During <a href="http://live.visitmix.com/MIX10/Sessions/KEY02" target="_blank">MIX10,
John Resig and Microsoft announced that Microsoft would be contributing code back
to the jQuery Project</a>. One of their first contributions was the <a href="http://wiki.github.com/nje/jquery/jquery-templates-proposal" target="_blank">Templating
plugin</a>. Microsoft created templates for jQuery so that JavaScript developers could
use jQuery to easily display a set of data.
</p>
        <p>
The source code for the plugin can be found in the <a href="http://github.com/nje/jquery-tmpl" target="_blank">jQuery-tmpl
GitHub repository</a>. The plugin requires jQuery 1.4.2 or higher.
</p>
        <h3>Getting Setup
</h3>
        <p>
Before we start you'll need the following:
</p>
        <ul>
          <li>
            <a href="http://docs.jquery.com/Downloading_jQuery" target="_blank">Download jQuery
1.4.2</a> or use a CDN version (<a href="http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery" target="_blank">Google</a>, <a href="http://www.asp.net/ajaxlibrary/cdn.ashx" target="_blank">Microsoft</a>, <a href="http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery" target="_blank">jQuery</a>)</li>
          <li>
            <a href="http://github.com/nje/jquery-tmpl" target="_blank">Download the Template
Plugin</a>
          </li>
          <li>
            <a href="http://ralphwhitbeck.com/demos/2010/June/jQuery-Twitter-Template/jQuery-Twitter-Template.zip">Download
the sample code for this post</a>. You'll need <strong>supporting_methods.js</strong> and <strong>style.js</strong>.</li>
          <li>
Twitter account</li>
        </ul>
        <p>
Create a html page, and include jQuery, the template plugin and the supporting_methods.js.
Then include the style.css doc so that your code from the demo we do looks nice.
</p>
        <h3>The HTML
</h3>
        <p>
Since each tweet will be listed as a list item in an unordered list the only required
HTML we need is an empty ul:
</p>
        <pre class="brush: html">
		&lt;ul id="renderTweets"&gt;&lt;/ul&gt;
	</pre>
        <p>
In our demo though we want to make it a complete widget. We need some extra layout
html to be able to provide a heading and a link to take you to more tweets. Here is
the full html we'll use:
</p>
        <pre class="brush: html">
		&lt;div id="Tweets"&gt;
			&lt;h3&gt;@RedWolves Tweets&lt;/h3&gt;
		  	&lt;ul id="renderTweets"&gt;&lt;/ul&gt;
			&lt;div id="more"&gt;
				&lt;a href="http://twitter.com/redwolves"&gt;More &amp;gt;&lt;/a&gt;
			&lt;/div&gt;
		&lt;/div&gt;
	</pre>
        <p>
Make sure you replace my twitter name, RedWolves, with yours. 
</p>
        <h3>Making the Ajax request
</h3>
        <p>
Now let's get the data from Twitter. We'll use a JSONP ajax call to get back the JSON
data of the last three tweets from Twitter. To get the JSON data we will use the <a href="http://dev.twitter.com/doc/get/statuses/user_timeline" target="_blank">user
timeline of the Twitter API</a>.
</p>
        <pre class="brush: js">
		$("document").ready(function(){
			var url = "http://api.twitter.com/1/statuses/user_timeline.json?id=RedWolves&amp;count=3&amp;callback=?"
			$.ajax({
				dataType: 'jsonp',
				url: url,
				jsonpCallback: "renderTweets" 
			});
		});
	</pre>
        <p>
At the end of the Twitter API url that we declare we attach the user id of the user
timeline we want to see, in this case mine, RedWolves, so make sure to update with
the username you wish to see. We then declare the url and call the <a href="http://api.jquery.com/jQuery.ajax/" target="_blank">.ajax()</a> method
and provide it with the dataType 'jsonp' so that we can pull the data via cross-domain.
We set the url and then tell it which function we will call after the data is loaded.
After the data is loaded we will call the function 'renderTweets', defined below,
which will run the data through the template.
</p>
        <h3>Defining the Template
</h3>
        <p>
Now let's define the template that will display the data we get back from the Ajax
request. We define the template in a script tag and we provide it with a type of "text/template"
and a unique ID.
</p>
        <pre class="brush: html">
		&lt;script type="text/template" id="twitterTemplate"&gt;
			&lt;li&gt;
					&lt;img src="${ user['profile_image_url'] }" /&gt; 
					${ text.linkify().atify() } 
					&lt;span class="created_at"&gt;
						${ relative_time(created_at) } via ${ source }
					&lt;/span&gt;
			&lt;/li&gt;
		&lt;/script&gt;
	</pre>
        <p>
On each JSON item we will run it through the template and create an li element with
the profile photo, tweet text, when it was created and what source the tweet came
from (e.g. Twitter for iPhone, web, etc.).
</p>
        <p>
We are using a couple of supporting methods to help us in formatting. .linkify which
will make any link a hyper link, atify which will link up any @screenname to their
twitter profile and relative_time which will turn the created time into Twitter style
time. You can find these methods in the supporting_methods.js file.
</p>
        <h3>Putting it all together
</h3>
        <p>
The last bit of jQuery code we need to do is to actually call the plugin and combine
the template with the data and put it into the DOM. Here we will define the renderTweets
callback function.
</p>
        <pre class="brush: js">
		function renderTweets(data) {
			$("#twitterTemplate")
				.render(data)
				.appendTo("#renderTweets");
		}
	</pre>
        <p>
What we do is select our template, call the template plugin method, .render, which
takes in the data from the Ajax call and renders the results against the template,
and then append the results to the desired element in the HTML, the ul with id of
renderTweets.
</p>
        <h3>The whole HTML
</h3>
        <pre class="brush: html">
		&lt;!DOCTYPE html&gt;
		&lt;html&gt;
			&lt;head&gt;
				&lt;meta charset=utf-8 /&gt;
				&lt;title&gt;twitter&lt;/title&gt;
				&lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&gt;&lt;/script&gt;
				&lt;script src="jquery.tmpl.js"&gt;&lt;/script&gt;
				&lt;script src="supporting_methods.js"&gt;&lt;/script&gt;
				&lt;link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8"&gt;
				&lt;script type="text/template" id="twitterTemplate"&gt;
					&lt;li&gt;
							&lt;img src="${ user['profile_image_url'] }" /&gt; 
							${ text.linkify().atify() } 
							&lt;span class="created_at"&gt;
								${ relative_time(created_at) } via ${ source }
							&lt;/span&gt;
					&lt;/li&gt;
				&lt;/script&gt;
				&lt;script type="text/javascript"&gt;
					$("document").ready(function(){
						var url = "http://api.twitter.com/1/statuses/user_timeline.json?id=RedWolves&amp;count=3&amp;callback=?"
						$.ajax({
							dataType: 'jsonp',
							url: url,
							jsonpCallback: "renderTweets" 
						});
					});

					function renderTweets(data) {
						$("#twitterTemplate")
							.render(data)
							.appendTo("#renderTweets");
					}
				&lt;/script&gt;
			&lt;/head&gt;
		&lt;body&gt;
		  &lt;div id="Tweets"&gt;
			&lt;h3&gt;@RedWolves Tweets&lt;/h3&gt;
		  	&lt;ul id="renderTweets"&gt;&lt;/ul&gt;
			&lt;div id="more"&gt;
				&lt;a href="http://twitter.com/redwolves"&gt;More &gt;&lt;/a&gt;
			&lt;/div&gt;
		  &lt;/div&gt;
		&lt;/body&gt;
		&lt;/html&gt;​
		
	</pre>
        <p>
          <hr />
          <br />
        </p>
        <p>
          <a href="http://ralphwhitbeck.com/demos/2010/June/jQuery-Twitter-Template/jQuery-Twitter-Template.zip" class="button">Source
Code</a>
          <a href="http://ralphwhitbeck.com/demos/2010/June/jQuery-Twitter-Template/twitter.html" class="button">Demo</a>
        </p>
        <img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=052711fb-4998-4af2-b597-cbf249d783c9" />
      </body>
      <title>Using jQuery and Templating to Pull and Display Your Twitter Updates</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,052711fb-4998-4af2-b597-cbf249d783c9.aspx</guid>
      <link>http://ralphwhitbeck.com/2010/06/22/UsingJQueryAndTemplatingToPullAndDisplayYourTwitterUpdates.aspx</link>
      <pubDate>Tue, 22 Jun 2010 01:24:59 GMT</pubDate>
      <description>&lt;iframe src="http://ralphwhitbeck.com/demos/2010/June/jQuery-Twitter-Template/twitter.html" width="320" height="235" align="right" frameborder="0" scrolling="no"&gt;
&lt;/iframe&gt;
&lt;p&gt;
A while back, I wrote a blog post on &lt;a href="http://ralphwhitbeck.com/2007/11/20/PullingTwitterUpdatesWithJSONAndJQuery.aspx" target="_blank"&gt;how
to pull in your last three twitter posts into your web page via jQuery and JSON&lt;/a&gt;.
It's still today a very popular post. 
&lt;/p&gt;
&lt;p&gt;
A lot has happened since that post and I wanted to re-address it and show you an alternative
way of pulling in your Twitter feed via jQuery and the new Templating plugin developed
by Microsoft. On the right is a new Twitter widget I put together using the new jQuery
templating plugin.
&lt;/p&gt;
&lt;h3&gt;Microsoft's Templating Plugin
&lt;/h3&gt;
&lt;p&gt;
During &lt;a href="http://live.visitmix.com/MIX10/Sessions/KEY02" target="_blank"&gt;MIX10,
John Resig and Microsoft announced that Microsoft would be contributing code back
to the jQuery Project&lt;/a&gt;. One of their first contributions was the &lt;a href="http://wiki.github.com/nje/jquery/jquery-templates-proposal" target="_blank"&gt;Templating
plugin&lt;/a&gt;. Microsoft created templates for jQuery so that JavaScript developers could
use jQuery to easily display a set of data.
&lt;/p&gt;
&lt;p&gt;
The source code for the plugin can be found in the &lt;a href="http://github.com/nje/jquery-tmpl" target="_blank"&gt;jQuery-tmpl
GitHub repository&lt;/a&gt;. The plugin requires jQuery 1.4.2 or higher.
&lt;/p&gt;
&lt;h3&gt;Getting Setup
&lt;/h3&gt;
&lt;p&gt;
Before we start you'll need the following:
&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href="http://docs.jquery.com/Downloading_jQuery" target="_blank"&gt;Download jQuery
1.4.2&lt;/a&gt; or use a CDN version (&lt;a href="http://code.google.com/apis/ajaxlibs/documentation/index.html#jquery" target="_blank"&gt;Google&lt;/a&gt;, &lt;a href="http://www.asp.net/ajaxlibrary/cdn.ashx" target="_blank"&gt;Microsoft&lt;/a&gt;, &lt;a href="http://docs.jquery.com/Downloading_jQuery#CDN_Hosted_jQuery" target="_blank"&gt;jQuery&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://github.com/nje/jquery-tmpl" target="_blank"&gt;Download the Template
Plugin&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href="http://ralphwhitbeck.com/demos/2010/June/jQuery-Twitter-Template/jQuery-Twitter-Template.zip"&gt;Download
the sample code for this post&lt;/a&gt;. You'll need &lt;strong&gt;supporting_methods.js&lt;/strong&gt; and &lt;strong&gt;style.js&lt;/strong&gt;.&lt;/li&gt;
&lt;li&gt;
Twitter account&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;
Create a html page, and include jQuery, the template plugin and the supporting_methods.js.
Then include the style.css doc so that your code from the demo we do looks nice.
&lt;/p&gt;
&lt;h3&gt;The HTML
&lt;/h3&gt;
&lt;p&gt;
Since each tweet will be listed as a list item in an unordered list the only required
HTML we need is an empty ul:
&lt;/p&gt;
&lt;pre class="brush: html"&gt;
		&amp;lt;ul id="renderTweets"&amp;gt;&amp;lt;/ul&amp;gt;
	&lt;/pre&gt;
&lt;p&gt;
In our demo though we want to make it a complete widget. We need some extra layout
html to be able to provide a heading and a link to take you to more tweets. Here is
the full html we'll use:
&lt;/p&gt;
&lt;pre class="brush: html"&gt;
		&amp;lt;div id="Tweets"&amp;gt;
			&amp;lt;h3&amp;gt;@RedWolves Tweets&amp;lt;/h3&amp;gt;
		  	&amp;lt;ul id="renderTweets"&amp;gt;&amp;lt;/ul&amp;gt;
			&amp;lt;div id="more"&amp;gt;
				&amp;lt;a href="http://twitter.com/redwolves"&amp;gt;More &amp;amp;gt;&amp;lt;/a&amp;gt;
			&amp;lt;/div&amp;gt;
		&amp;lt;/div&amp;gt;
	&lt;/pre&gt;
&lt;p&gt;
Make sure you replace my twitter name, RedWolves, with yours. 
&lt;/p&gt;
&lt;h3&gt;Making the Ajax request
&lt;/h3&gt;
&lt;p&gt;
Now let's get the data from Twitter. We'll use a JSONP ajax call to get back the JSON
data of the last three tweets from Twitter. To get the JSON data we will use the &lt;a href="http://dev.twitter.com/doc/get/statuses/user_timeline" target="_blank"&gt;user
timeline of the Twitter API&lt;/a&gt;.
&lt;/p&gt;
&lt;pre class="brush: js"&gt;
		$("document").ready(function(){
			var url = "http://api.twitter.com/1/statuses/user_timeline.json?id=RedWolves&amp;amp;count=3&amp;amp;callback=?"
			$.ajax({
				dataType: 'jsonp',
				url: url,
				jsonpCallback: "renderTweets" 
			});
		});
	&lt;/pre&gt;
&lt;p&gt;
At the end of the Twitter API url that we declare we attach the user id of the user
timeline we want to see, in this case mine, RedWolves, so make sure to update with
the username you wish to see. We then declare the url and call the &lt;a href="http://api.jquery.com/jQuery.ajax/" target="_blank"&gt;.ajax()&lt;/a&gt; method
and provide it with the dataType 'jsonp' so that we can pull the data via cross-domain.
We set the url and then tell it which function we will call after the data is loaded.
After the data is loaded we will call the function 'renderTweets', defined below,
which will run the data through the template.
&lt;/p&gt;
&lt;h3&gt;Defining the Template
&lt;/h3&gt;
&lt;p&gt;
Now let's define the template that will display the data we get back from the Ajax
request. We define the template in a script tag and we provide it with a type of "text/template"
and a unique ID.
&lt;/p&gt;
&lt;pre class="brush: html"&gt;
		&amp;lt;script type="text/template" id="twitterTemplate"&amp;gt;
			&amp;lt;li&amp;gt;
					&amp;lt;img src="${ user['profile_image_url'] }" /&amp;gt; 
					${ text.linkify().atify() } 
					&amp;lt;span class="created_at"&amp;gt;
						${ relative_time(created_at) } via ${ source }
					&amp;lt;/span&amp;gt;
			&amp;lt;/li&amp;gt;
		&amp;lt;/script&amp;gt;
	&lt;/pre&gt;
&lt;p&gt;
On each JSON item we will run it through the template and create an li element with
the profile photo, tweet text, when it was created and what source the tweet came
from (e.g. Twitter for iPhone, web, etc.).
&lt;/p&gt;
&lt;p&gt;
We are using a couple of supporting methods to help us in formatting. .linkify which
will make any link a hyper link, atify which will link up any @screenname to their
twitter profile and relative_time which will turn the created time into Twitter style
time. You can find these methods in the supporting_methods.js file.
&lt;/p&gt;
&lt;h3&gt;Putting it all together
&lt;/h3&gt;
&lt;p&gt;
The last bit of jQuery code we need to do is to actually call the plugin and combine
the template with the data and put it into the DOM. Here we will define the renderTweets
callback function.
&lt;/p&gt;
&lt;pre class="brush: js"&gt;
		function renderTweets(data) {
			$("#twitterTemplate")
				.render(data)
				.appendTo("#renderTweets");
		}
	&lt;/pre&gt;
&lt;p&gt;
What we do is select our template, call the template plugin method, .render, which
takes in the data from the Ajax call and renders the results against the template,
and then append the results to the desired element in the HTML, the ul with id of
renderTweets.
&lt;/p&gt;
&lt;h3&gt;The whole HTML
&lt;/h3&gt;
&lt;pre class="brush: html"&gt;
		&amp;lt;!DOCTYPE html&amp;gt;
		&amp;lt;html&amp;gt;
			&amp;lt;head&amp;gt;
				&amp;lt;meta charset=utf-8 /&amp;gt;
				&amp;lt;title&amp;gt;twitter&amp;lt;/title&amp;gt;
				&amp;lt;script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"&amp;gt;&amp;lt;/script&amp;gt;
				&amp;lt;script src="jquery.tmpl.js"&amp;gt;&amp;lt;/script&amp;gt;
				&amp;lt;script src="supporting_methods.js"&amp;gt;&amp;lt;/script&amp;gt;
				&amp;lt;link rel="stylesheet" href="style.css" type="text/css" media="screen" title="no title" charset="utf-8"&amp;gt;
				&amp;lt;script type="text/template" id="twitterTemplate"&amp;gt;
					&amp;lt;li&amp;gt;
							&amp;lt;img src="${ user['profile_image_url'] }" /&amp;gt; 
							${ text.linkify().atify() } 
							&amp;lt;span class="created_at"&amp;gt;
								${ relative_time(created_at) } via ${ source }
							&amp;lt;/span&amp;gt;
					&amp;lt;/li&amp;gt;
				&amp;lt;/script&amp;gt;
				&amp;lt;script type="text/javascript"&amp;gt;
					$("document").ready(function(){
						var url = "http://api.twitter.com/1/statuses/user_timeline.json?id=RedWolves&amp;amp;count=3&amp;amp;callback=?"
						$.ajax({
							dataType: 'jsonp',
							url: url,
							jsonpCallback: "renderTweets" 
						});
					});

					function renderTweets(data) {
						$("#twitterTemplate")
							.render(data)
							.appendTo("#renderTweets");
					}
				&amp;lt;/script&amp;gt;
			&amp;lt;/head&amp;gt;
		&amp;lt;body&amp;gt;
		  &amp;lt;div id="Tweets"&amp;gt;
			&amp;lt;h3&amp;gt;@RedWolves Tweets&amp;lt;/h3&amp;gt;
		  	&amp;lt;ul id="renderTweets"&amp;gt;&amp;lt;/ul&amp;gt;
			&amp;lt;div id="more"&amp;gt;
				&amp;lt;a href="http://twitter.com/redwolves"&amp;gt;More &amp;gt;&amp;lt;/a&amp;gt;
			&amp;lt;/div&amp;gt;
		  &amp;lt;/div&amp;gt;
		&amp;lt;/body&amp;gt;
		&amp;lt;/html&amp;gt;​
		
	&lt;/pre&gt;
&lt;p&gt;
&lt;hr /&gt;
&lt;br /&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://ralphwhitbeck.com/demos/2010/June/jQuery-Twitter-Template/jQuery-Twitter-Template.zip" class="button"&gt;Source
Code&lt;/a&gt; &lt;a href="http://ralphwhitbeck.com/demos/2010/June/jQuery-Twitter-Template/twitter.html" class="button"&gt;Demo&lt;/a&gt; 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=052711fb-4998-4af2-b597-cbf249d783c9" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,052711fb-4998-4af2-b597-cbf249d783c9.aspx</comments>
      <category>How-to;jQuery;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=b444a50f-01a0-4938-8a62-4300967cbce9</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,b444a50f-01a0-4938-8a62-4300967cbce9.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,b444a50f-01a0-4938-8a62-4300967cbce9.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b444a50f-01a0-4938-8a62-4300967cbce9</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <title>jQuery 1.4 Give Us a New Way to Zebra Stripe</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,b444a50f-01a0-4938-8a62-4300967cbce9.aspx</guid>
      <link>http://ralphwhitbeck.com/2010/01/22/jQuery14GiveUsANewWayToZebraStripe.aspx</link>
      <pubDate>Fri, 22 Jan 2010 22:27:10 GMT</pubDate>
      <description>In &lt;a href="http://jquery14.com/day-01"&gt;jQuery 1.4&lt;/a&gt; all setter methods have been
extended to take in a setter function.&amp;nbsp; Before only &lt;a href="http://api.jquery.com/attr"&gt;.attr()&lt;/a&gt; had
the ability to use a function to return the value to set. Now you can pass a setter
function to &lt;a href="http://api.jquery.com/css"&gt;.css()&lt;/a&gt;, &lt;a href="http://api.jquery.com/attr"&gt;.attr()&lt;/a&gt;, &lt;a href="http://api.jquery.com/val"&gt;.val()&lt;/a&gt;, &lt;a href="http://api.jquery.com/html"&gt;.html()&lt;/a&gt;, &lt;a href="http://api.jquery.com/text"&gt;.text()&lt;/a&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/append"&gt;.append()&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/prepend"&gt;.prepend()&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/before"&gt;.before()&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/after"&gt;.after()&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/replaceWith"&gt;.replaceWith()&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/wrap"&gt;.wrap()&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/wrapInner"&gt;.wrapInner()&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/offset"&gt;.offset()&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/addClass"&gt;.addClass()&lt;/a&gt;&lt;/code&gt;, &lt;code&gt;&lt;a href="http://api.jquery.com/removeClass"&gt;.removeClass()&lt;/a&gt;&lt;/code&gt;,
and &lt;code&gt;&lt;a href="http://api.jquery.com/toggleClass"&gt;.toggleClass()&lt;/a&gt;&lt;/code&gt;.&lt;br&gt;
&lt;br&gt;
The setter function can take two arguments, the index position of the element in the
set and the old value of the element. 
&lt;br&gt;
&lt;br&gt;
&lt;blockquote&gt;&lt;b&gt;.css( propertyName, function(index, value))&lt;/b&gt;
&lt;br&gt;
&lt;/blockquote&gt;
&lt;br&gt;
With setter functions now available we can use this in a new way to zebra stripe a
set of elements.&amp;nbsp; In this example we'll stripe a unordered list:&lt;br&gt;
&lt;br&gt;
&lt;strong&gt;HTML:&lt;/strong&gt;&lt;pre&gt;&lt;code&gt;
&lt;br&gt;
&amp;lt;ul&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;item 1&amp;lt;/li&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;item 2&amp;lt;/li&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;item 3&amp;lt;/li&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;item 4&amp;lt;/li&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;item 5&amp;lt;/li&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;item 6&amp;lt;/li&amp;gt;&lt;br&gt;
&amp;lt;li&amp;gt;item 7&amp;lt;/li&amp;gt;&lt;br&gt;
&amp;lt;/ul&amp;gt;&lt;br&gt;
&lt;/code&gt;&lt;/pre&gt;
&lt;strong&gt;jQuery 1.4:&lt;/strong&gt; &lt;pre&gt;&lt;code"&gt;
&lt;br&gt;
$(document).ready(function(){&lt;br&gt;
$("li").css("background-color", function(i){&lt;br&gt;
return (i % 2 === 0) ? "#cccccc": "#FFFFFF";&lt;br&gt;
});&lt;br&gt;
});&lt;br&gt;code"&gt;
&lt;/pre&gt;
&lt;p&gt;
We select all the &lt;code&gt;LI&lt;/code&gt;s and call the &lt;code&gt;.css()&lt;/code&gt; setter method.
We give it the property name we want to update, &lt;code&gt;background-image&lt;/code&gt; and
we pass a function that will return the value we want to set.
&lt;/p&gt;
&lt;p&gt;
The function tests if the index that we passed in &lt;code&gt;i&lt;/code&gt; is MOD 2 (simply
is it even or odd), if even set the color to &lt;code&gt;#cccccc&lt;/code&gt; else set it to &lt;code&gt;#FFFFFF&lt;/code&gt;. 
&lt;/p&gt;
&lt;strong&gt;Demo:&lt;/strong&gt; (&lt;a href="http://jsbin.com/agapu/2/edit"&gt;jsbin&lt;/a&gt;)&lt;br&gt;
&lt;br&gt;
&lt;iframe src="http://jsbin.com/agapu/2" scrollbars="auto" width="668" height="250"&gt;
&lt;/iframe&gt;
&lt;p&gt;
&lt;strong&gt;Note:&lt;/strong&gt; Obviously, this isn't the best way to do zebra stripping with
jQuery but I like to explore different ways to do the same thing to learn the techniques. 
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=b444a50f-01a0-4938-8a62-4300967cbce9" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,b444a50f-01a0-4938-8a62-4300967cbce9.aspx</comments>
      <category>How-to;jQuery;Programming</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=b23c5ac4-f1d8-4e29-a94c-84c7c5c6f20d</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,b23c5ac4-f1d8-4e29-a94c-84c7c5c6f20d.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,b23c5ac4-f1d8-4e29-a94c-84c7c5c6f20d.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b23c5ac4-f1d8-4e29-a94c-84c7c5c6f20d</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <i>I am doing some freelance work with
PHP and I am posting these for my future reference.  This is basic PHP 101 stuff
here.</i>
        <br />
        <br />
The HTML Form:<br /><br /><code class="html"> &lt;form enctype="multipart/form-data" action="upload.php" method="post"&gt;
    Please upload your file:     &lt;div&gt;        
&lt;input id="fileUpload" name="fileUpload" type="file"&gt;        
&lt;input id="submit" name="submit" value="Submit" type="submit"&gt;    
&lt;/div&gt; &lt;/form&gt;</code><br /><br />
The key part to the form is enctype="multipart/form-data" which tells the server to
expect a file on postback.  
<br /><br />
The upload php file to process the file: 
<br /><br /><code class="php"> &lt;?php     $target_path = "uploads/";<br />
    $target_path = $target_path . basename( $_FILES['fileUpload']['name']);
    if (isset($_FILES['fileUpload']))     {        
if(move_uploaded_file($_FILES['fileUpload']['tmp_name'], $target_path)) {            
echo "The file ".  basename( $_FILES['fileUpload']['name']).            
" has been uploaded";              
} else {                  
echo "There was an error uploading the file, please try again!";              
}         } ?&gt;</code><br /><br />
First we test to see if fileUpload has a value if so it attempts to save the file
to the target path.  If all goes well we get a message that the upload passed. 
If not a message that there was a problem.<br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=b23c5ac4-f1d8-4e29-a94c-84c7c5c6f20d" /></body>
      <title>PHP 101: Uploading a file</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,b23c5ac4-f1d8-4e29-a94c-84c7c5c6f20d.aspx</guid>
      <link>http://ralphwhitbeck.com/2009/08/04/PHP101UploadingAFile.aspx</link>
      <pubDate>Tue, 04 Aug 2009 23:51:42 GMT</pubDate>
      <description>&lt;i&gt;I am doing some freelance work with PHP and I am posting these for my future reference.&amp;nbsp;
This is basic PHP 101 stuff here.&lt;/i&gt;
&lt;br&gt;
&lt;br&gt;
The HTML Form:&lt;br&gt;
&lt;br&gt;
&lt;code class="html"&gt; &amp;lt;form enctype="multipart/form-data" action="upload.php" method="post"&amp;gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Please upload your file: &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;div&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;input id="fileUpload" name="fileUpload" type="file"&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;input id="submit" name="submit" value="Submit" type="submit"&amp;gt; &amp;nbsp;&amp;nbsp;&amp;nbsp;
&amp;lt;/div&amp;gt; &amp;lt;/form&amp;gt;&lt;/code&gt;
&lt;br&gt;
&lt;br&gt;
The key part to the form is enctype="multipart/form-data" which tells the server to
expect a file on postback.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
The upload php file to process the file: 
&lt;br&gt;
&lt;br&gt;
&lt;code class="php"&gt; &amp;lt;?php &amp;nbsp;&amp;nbsp;&amp;nbsp; $target_path = "uploads/";&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; $target_path = $target_path . basename( $_FILES['fileUpload']['name']);
&amp;nbsp;&amp;nbsp;&amp;nbsp; if (isset($_FILES['fileUpload'])) &amp;nbsp;&amp;nbsp;&amp;nbsp; { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
if(move_uploaded_file($_FILES['fileUpload']['tmp_name'], $target_path)) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
echo "The file ".&amp;nbsp; basename( $_FILES['fileUpload']['name']). &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
" has been uploaded"; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
} else { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
echo "There was an error uploading the file, please try again!"; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;
} &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } ?&amp;gt;&lt;/code&gt;
&lt;br&gt;
&lt;br&gt;
First we test to see if fileUpload has a value if so it attempts to save the file
to the target path.&amp;nbsp; If all goes well we get a message that the upload passed.&amp;nbsp;
If not a message that there was a problem.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=b23c5ac4-f1d8-4e29-a94c-84c7c5c6f20d" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,b23c5ac4-f1d8-4e29-a94c-84c7c5c6f20d.aspx</comments>
      <category>How-to;PHP;Programming</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=82496236-b3ae-4c7b-b384-caa458bbf643</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,82496236-b3ae-4c7b-b384-caa458bbf643.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,82496236-b3ae-4c7b-b384-caa458bbf643.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=82496236-b3ae-4c7b-b384-caa458bbf643</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I came into work today and turned on web
sharing and got a 403 Permissions Denied error.<br /><br />
I followed the <a href="http://support.apple.com/kb/TA25038">typical procedure to
fix this</a>, to no avail.<br /><br />
The fix was to set the user home directory permissions so everyone had read access. 
It currently was set so everyone had no access. 
<br /><br />
Hope that helps someone someday.<br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=82496236-b3ae-4c7b-b384-caa458bbf643" /></body>
      <title>403 Permissions Denied on your users Site in OSX</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,82496236-b3ae-4c7b-b384-caa458bbf643.aspx</guid>
      <link>http://ralphwhitbeck.com/2009/07/13/403PermissionsDeniedOnYourUsersSiteInOSX.aspx</link>
      <pubDate>Mon, 13 Jul 2009 14:27:10 GMT</pubDate>
      <description>I came into work today and turned on web sharing and got a 403 Permissions Denied error.&lt;br&gt;
&lt;br&gt;
I followed the &lt;a href="http://support.apple.com/kb/TA25038"&gt;typical procedure to
fix this&lt;/a&gt;, to no avail.&lt;br&gt;
&lt;br&gt;
The fix was to set the user home directory permissions so everyone had read access.&amp;nbsp;
It currently was set so everyone had no access. 
&lt;br&gt;
&lt;br&gt;
Hope that helps someone someday.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=82496236-b3ae-4c7b-b384-caa458bbf643" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,82496236-b3ae-4c7b-b384-caa458bbf643.aspx</comments>
      <category>How-to;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=1a1d18bf-f423-45b2-9c55-8c574474d39a</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,1a1d18bf-f423-45b2-9c55-8c574474d39a.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,1a1d18bf-f423-45b2-9c55-8c574474d39a.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=1a1d18bf-f423-45b2-9c55-8c574474d39a</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I was working this morning on setting up
a LAMP environment in OSX.  I found <a href="http://devworld.apple.com/mac/articles/internet/phpeasyway.html">this
tutorial</a>  from Apple's Developer Connection. As I haven't set up PHP on a
Mac in quite a while i felt I needed a refresher.<br /><br />
It was going good till I got to the section "Enabling PHP in Apache."  They outline
a script you need to run but to a new Mac user this isn't readily apparent how to
do.  Obviously this is geared towards the advanced Mac Developer even though
the topic is for a beginner.  I finally deduce from past experience that this
needs to be run like a batch script on Windows.   I do a search on Google
for "shell scripting in osx" and found that I needed to run "sh filename.sh" in the
terminal window.  So I created a file and copy/pasted the script into the file,
saved and switched to the terminal.  Here is the script I pasted, <b><font color="#ff0000">DO
NOT RUN THIS</font></b>:<br /><br /><blockquote><pre>set admin_email to (do shell script "defaults read AddressBookMe ExistingEmailAddress")<br />
user_www=$HOME/Sites<br />
filename=php-test<br />
user_index=${user_www}/${filename}.php<br />
user_db=${user_www}/${filename}-db.sqlite3<br />
# NOTE: Having a writeable database in your home directory can be a security risk!<br /><br />
conf=`apachectl -V | awk -F= '/SERVER_CONFIG/ {print \$2}'| sed 's/"//g'`<br />
conf_old=$conf.$$<br />
conf_new=/tmp/php_conf.new<br /><br />
touch $user_db<br />
chmod a+r $user_index<br />
chmod a+w $user_db<br />
chmod a+w $user_www<br /><br />
echo "Enabling PHP in $conf ..."<br />
sed '/#LoadModule php5_module/s/#LoadModule/LoadModule/' $conf | sed<br />
"s^you@example.com^&lt;b&gt;\$admin_email&lt;/b&gt;^" &gt; $conf_new<br /><br />
echo "(Re)Starting Apache ..."<br />
osascript &lt;&lt;EOF<br />
do shell script "/bin/mv -f $conf $conf_old; /bin/mv $conf_new $conf;<br />
/usr/sbin/apachectl restart" with administrator privileges 
<br /><br />
EOF<br /></pre></blockquote>The first time I run it I am asked for the administrative password which
I provide.  After I see that the script had a few errors.  But the instructions
on the tutorial say I should be able to create phpinfo page and see the phpinfo data. 
I create the file try to run it and the web server isn't running.<br /><br />
I do some troubleshooting and eventually figure out that httpd.conf has not no data
in it anymore.  There is an older file with a version number attached but I can't
copy or write to httpd.conf cause I don't have su priv on this computer. 
<br /><br />
I go back to the script file and try to figure out what happened. First I need to
fix my apache.  I hack together a shell script to fix my httpd.conf and I come
up with this:<br /><br /><blockquote>osascript &lt;&lt;EOF<br /><br />
do shell script "/bin/mv -f /private/etc/apache2/httpd.conf.9002 /private/etc/apache2/httpd.conf"
with administrator privileges<br /><br />
EOF<br /><br /></blockquote>This restores the original httpd.conf that was made as a back up. 
Retry to access a file in apache and it serves it.  Success!  At this point
I want to make my own backup file of httpd.conf in case the script screws it up more.  
<br /><br /><blockquote>osascript &lt;&lt;EOF<br /><br />
do shell script "/bin/cp -f /private/etc/apache2/httpd.conf /private/etc/apache2/httpd.conf.bak"
with administrator privileges<br /><br />
EOF<br /><br /></blockquote>So why did httpd.conf have no data in it?  Looking over the script
it seems that it is uncommenting the line for the PHP module and sending the output
to conf_new.  But it seems the file specified in conf_new is never created in
the script.  So when the final line is called to copy the new file over httpd.conf
there is nothing to copy.  I solve this by adding another line: touch $conf_new<br /><br />
Now let's tackle the script, the first error I see is that a file doesn't exist: chmod:
/Users/ralph/Sites/php-test.php: No such file or directory<br /><br />
The file doesn't exist apparently touch $user_index isn't included in the script. 
Which is funny cause nothing else in the script requires the $user_index.  The
script is basically just trying to create a php file.  I also add touch $user_index
to the script.<br /><br />
Next error is: s^you@example.com^&lt;b&gt;$admin_email&lt;/b&gt;^: No such file or
directory 
<br /><br />
I wasn't quite sure what was causing this error and I couldn't solve fixing it but
I determined that it was trying to replace the default admin e-mail with the one I
specified earlier.  I took out that part of the command.  So the new line
now looks like: sed '/#LoadModule php5_module/s/#LoadModule/LoadModule/' $conf &gt;
$conf_new<br /><br />
The final script looks like this:<br /><br /><blockquote>user_www=$HOME/Sites<br />
filename=php-test<br />
user_index=${user_www}/${filename}.php<br />
user_db=${user_www}/${filename}-db.sqlite3<br />
# NOTE: Having a writeable database in your home directory can be a security risk!<br /><br />
conf=`apachectl -V | awk -F= '/SERVER_CONFIG/ {print \$2}'| sed 's/"//g'`<br />
conf_old=$conf.$$<br />
conf_new=/tmp/php_conf.new<br /><br />
touch $user_index<br />
touch $user_db<br />
touch $conf_new<br />
chmod a+r $user_index<br />
chmod a+w $user_db<br />
chmod a+w $user_www<br />
chmod a+w $conf_new<br /><br />
echo "Enabling PHP in $conf ..."<br />
sed '/#LoadModule php5_module/s/#LoadModule/LoadModule/' $conf &gt; $conf_new<br /><br />
echo "(Re)Starting Apache ..."<br />
osascript &lt;&lt;EOF<br />
do shell script "/bin/mv -f $conf $conf_old; /bin/mv $conf_new $conf;<br />
/usr/sbin/apachectl restart" with administrator privileges<br /><br />
EOF<br /><br /></blockquote>I feel like the script written in the Developers Connection article was
just written and not tested.  But what is really concerning is there is no way
to provide feedback on the article on the page.  MSDN provides a way on every
page asking if the tutorial was helpful and provides an area to comment.  
<br /><br />
Needless to say I did not finish the tutorial.  
<br /><br /><br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=1a1d18bf-f423-45b2-9c55-8c574474d39a" /></body>
      <title>Apples Developer Connection Documentation is buggy</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,1a1d18bf-f423-45b2-9c55-8c574474d39a.aspx</guid>
      <link>http://ralphwhitbeck.com/2009/07/12/ApplesDeveloperConnectionDocumentationIsBuggy.aspx</link>
      <pubDate>Sun, 12 Jul 2009 17:40:09 GMT</pubDate>
      <description>I was working this morning on setting up a LAMP environment in OSX.&amp;nbsp; I found &lt;a href="http://devworld.apple.com/mac/articles/internet/phpeasyway.html"&gt;this
tutorial&lt;/a&gt;&amp;nbsp; from Apple's Developer Connection. As I haven't set up PHP on a
Mac in quite a while i felt I needed a refresher.&lt;br&gt;
&lt;br&gt;
It was going good till I got to the section "Enabling PHP in Apache."&amp;nbsp; They outline
a script you need to run but to a new Mac user this isn't readily apparent how to
do.&amp;nbsp; Obviously this is geared towards the advanced Mac Developer even though
the topic is for a beginner.&amp;nbsp; I finally deduce from past experience that this
needs to be run like a batch script on Windows.&amp;nbsp;&amp;nbsp; I do a search on Google
for "shell scripting in osx" and found that I needed to run "sh filename.sh" in the
terminal window.&amp;nbsp; So I created a file and copy/pasted the script into the file,
saved and switched to the terminal.&amp;nbsp; Here is the script I pasted, &lt;b&gt;&lt;font color="#ff0000"&gt;DO
NOT RUN THIS&lt;/font&gt;&lt;/b&gt;:&lt;br&gt;
&lt;br&gt;
&lt;blockquote&gt;&lt;pre&gt;set admin_email to (do shell script "defaults read AddressBookMe ExistingEmailAddress")&lt;br&gt;
user_www=$HOME/Sites&lt;br&gt;
filename=php-test&lt;br&gt;
user_index=${user_www}/${filename}.php&lt;br&gt;
user_db=${user_www}/${filename}-db.sqlite3&lt;br&gt;
# NOTE: Having a writeable database in your home directory can be a security risk!&lt;br&gt;
&lt;br&gt;
conf=`apachectl -V | awk -F= '/SERVER_CONFIG/ {print \$2}'| sed 's/"//g'`&lt;br&gt;
conf_old=$conf.$$&lt;br&gt;
conf_new=/tmp/php_conf.new&lt;br&gt;
&lt;br&gt;
touch $user_db&lt;br&gt;
chmod a+r $user_index&lt;br&gt;
chmod a+w $user_db&lt;br&gt;
chmod a+w $user_www&lt;br&gt;
&lt;br&gt;
echo "Enabling PHP in $conf ..."&lt;br&gt;
sed '/#LoadModule php5_module/s/#LoadModule/LoadModule/' $conf | sed&lt;br&gt;
"s^you@example.com^&amp;lt;b&amp;gt;\$admin_email&amp;lt;/b&amp;gt;^" &amp;gt; $conf_new&lt;br&gt;
&lt;br&gt;
echo "(Re)Starting Apache ..."&lt;br&gt;
osascript &amp;lt;&amp;lt;EOF&lt;br&gt;
do shell script "/bin/mv -f $conf $conf_old; /bin/mv $conf_new $conf;&lt;br&gt;
/usr/sbin/apachectl restart" with administrator privileges 
&lt;br&gt;
&lt;br&gt;
EOF&lt;br&gt;
&lt;/pre&gt;
&lt;/blockquote&gt;The first time I run it I am asked for the administrative password which
I provide.&amp;nbsp; After I see that the script had a few errors.&amp;nbsp; But the instructions
on the tutorial say I should be able to create phpinfo page and see the phpinfo data.&amp;nbsp;
I create the file try to run it and the web server isn't running.&lt;br&gt;
&lt;br&gt;
I do some troubleshooting and eventually figure out that httpd.conf has not no data
in it anymore.&amp;nbsp; There is an older file with a version number attached but I can't
copy or write to httpd.conf cause I don't have su priv on this computer. 
&lt;br&gt;
&lt;br&gt;
I go back to the script file and try to figure out what happened. First I need to
fix my apache.&amp;nbsp; I hack together a shell script to fix my httpd.conf and I come
up with this:&lt;br&gt;
&lt;br&gt;
&lt;blockquote&gt;osascript &amp;lt;&amp;lt;EOF&lt;br&gt;
&lt;br&gt;
do shell script "/bin/mv -f /private/etc/apache2/httpd.conf.9002 /private/etc/apache2/httpd.conf"
with administrator privileges&lt;br&gt;
&lt;br&gt;
EOF&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;This restores the original httpd.conf that was made as a back up.&amp;nbsp;
Retry to access a file in apache and it serves it.&amp;nbsp; Success!&amp;nbsp; At this point
I want to make my own backup file of httpd.conf in case the script screws it up more.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
&lt;blockquote&gt;osascript &amp;lt;&amp;lt;EOF&lt;br&gt;
&lt;br&gt;
do shell script "/bin/cp -f /private/etc/apache2/httpd.conf /private/etc/apache2/httpd.conf.bak"
with administrator privileges&lt;br&gt;
&lt;br&gt;
EOF&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;So why did httpd.conf have no data in it?&amp;nbsp; Looking over the script
it seems that it is uncommenting the line for the PHP module and sending the output
to conf_new.&amp;nbsp; But it seems the file specified in conf_new is never created in
the script.&amp;nbsp; So when the final line is called to copy the new file over httpd.conf
there is nothing to copy.&amp;nbsp; I solve this by adding another line: touch $conf_new&lt;br&gt;
&lt;br&gt;
Now let's tackle the script, the first error I see is that a file doesn't exist: chmod:
/Users/ralph/Sites/php-test.php: No such file or directory&lt;br&gt;
&lt;br&gt;
The file doesn't exist apparently touch $user_index isn't included in the script.&amp;nbsp;
Which is funny cause nothing else in the script requires the $user_index.&amp;nbsp; The
script is basically just trying to create a php file.&amp;nbsp; I also add touch $user_index
to the script.&lt;br&gt;
&lt;br&gt;
Next error is: s^you@example.com^&amp;lt;b&amp;gt;$admin_email&amp;lt;/b&amp;gt;^: No such file or
directory 
&lt;br&gt;
&lt;br&gt;
I wasn't quite sure what was causing this error and I couldn't solve fixing it but
I determined that it was trying to replace the default admin e-mail with the one I
specified earlier.&amp;nbsp; I took out that part of the command.&amp;nbsp; So the new line
now looks like: sed '/#LoadModule php5_module/s/#LoadModule/LoadModule/' $conf &amp;gt;
$conf_new&lt;br&gt;
&lt;br&gt;
The final script looks like this:&lt;br&gt;
&lt;br&gt;
&lt;blockquote&gt;user_www=$HOME/Sites&lt;br&gt;
filename=php-test&lt;br&gt;
user_index=${user_www}/${filename}.php&lt;br&gt;
user_db=${user_www}/${filename}-db.sqlite3&lt;br&gt;
# NOTE: Having a writeable database in your home directory can be a security risk!&lt;br&gt;
&lt;br&gt;
conf=`apachectl -V | awk -F= '/SERVER_CONFIG/ {print \$2}'| sed 's/"//g'`&lt;br&gt;
conf_old=$conf.$$&lt;br&gt;
conf_new=/tmp/php_conf.new&lt;br&gt;
&lt;br&gt;
touch $user_index&lt;br&gt;
touch $user_db&lt;br&gt;
touch $conf_new&lt;br&gt;
chmod a+r $user_index&lt;br&gt;
chmod a+w $user_db&lt;br&gt;
chmod a+w $user_www&lt;br&gt;
chmod a+w $conf_new&lt;br&gt;
&lt;br&gt;
echo "Enabling PHP in $conf ..."&lt;br&gt;
sed '/#LoadModule php5_module/s/#LoadModule/LoadModule/' $conf &amp;gt; $conf_new&lt;br&gt;
&lt;br&gt;
echo "(Re)Starting Apache ..."&lt;br&gt;
osascript &amp;lt;&amp;lt;EOF&lt;br&gt;
do shell script "/bin/mv -f $conf $conf_old; /bin/mv $conf_new $conf;&lt;br&gt;
/usr/sbin/apachectl restart" with administrator privileges&lt;br&gt;
&lt;br&gt;
EOF&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;I feel like the script written in the Developers Connection article was
just written and not tested.&amp;nbsp; But what is really concerning is there is no way
to provide feedback on the article on the page.&amp;nbsp; MSDN provides a way on every
page asking if the tutorial was helpful and provides an area to comment.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
Needless to say I did not finish the tutorial.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=1a1d18bf-f423-45b2-9c55-8c574474d39a" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,1a1d18bf-f423-45b2-9c55-8c574474d39a.aspx</comments>
      <category>How-to;Programming</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=13c03889-f4f1-4383-b80b-d76e1c32fa47</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,13c03889-f4f1-4383-b80b-d76e1c32fa47.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,13c03889-f4f1-4383-b80b-d76e1c32fa47.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=13c03889-f4f1-4383-b80b-d76e1c32fa47</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">IE 6 doesn't have native support for the
Alpha channel that make PNG's transparent.  This can make PNG's look very ugly
in IE6 when they are transparent. 
<br /><br />
Asking around the office today, I got a <a href="http://www.twinhelix.com/css/iepngfix/">cool
solution</a> that uses IE's proprietary <i><b>behavior</b></i> css attribute to call
a Compiled HTML document that applies filters to the PNG to behave correctly.<br /><br />
It's pretty easy to install:<br /><br /><blockquote><h3>How To Use
</h3><p>
Follow these simple steps to add this to your page:
</p><ol><li>
Copy and paste <code>iepngfix.htc</code> and <code>blank.gif</code> into your website
folder.</li><li>
Copy and paste this into your website's CSS or HTML: <blockquote><code> &lt;style
type="text/css"&gt;<br />
img, div { behavior: url(iepngfix.htc) }<br />
&lt;/style&gt; </code></blockquote> That CSS selector must include the tags/elements
on which you want PNG support -- basically, give it a comma-separated list of tags
you use. It must also include the correct path to the .HTC <em>relative to the HTML
document location</em> (not relative to the CSS document!). For instance, yours may
look like this: <blockquote><code> &lt;style type="text/css"&gt;<br />
img, div, a, input { behavior: url(/css/resources/iepngfix.htc) }<br />
&lt;/style&gt; </code></blockquote></li><li>
If your site uses subfolders, open the .HTC file in a text editor like Windows Notepad
and change the <code>blankImg</code> variable to include a correct path to blank.gif
like so: <blockquote><code> var blankImg = '/images/blank.gif'; </code></blockquote> Again
the path is relative to the HTML file. Otherwise, you will see a "broken image" graphic!</li></ol></blockquote><br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=13c03889-f4f1-4383-b80b-d76e1c32fa47" /></body>
      <title>Transparent PNG's and IE 6</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,13c03889-f4f1-4383-b80b-d76e1c32fa47.aspx</guid>
      <link>http://ralphwhitbeck.com/2009/06/22/TransparentPNGsAndIE6.aspx</link>
      <pubDate>Mon, 22 Jun 2009 17:07:45 GMT</pubDate>
      <description>IE 6 doesn't have native support for the Alpha channel that make PNG's transparent.&amp;nbsp; This can make PNG's look very ugly in IE6 when they are transparent. &lt;br&gt;
&lt;br&gt;
Asking around the office today, I got a &lt;a href="http://www.twinhelix.com/css/iepngfix/"&gt;cool
solution&lt;/a&gt; that uses IE's proprietary &lt;i&gt;&lt;b&gt;behavior&lt;/b&gt;&lt;/i&gt; css attribute to call
a Compiled HTML document that applies filters to the PNG to behave correctly.&lt;br&gt;
&lt;br&gt;
It's pretty easy to install:&lt;br&gt;
&lt;br&gt;
&lt;blockquote&gt;
&lt;h3&gt;How To Use
&lt;/h3&gt;
&lt;p&gt;
Follow these simple steps to add this to your page:
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Copy and paste &lt;code&gt;iepngfix.htc&lt;/code&gt; and &lt;code&gt;blank.gif&lt;/code&gt; into your website
folder.&lt;/li&gt;
&lt;li&gt;
Copy and paste this into your website's CSS or HTML: &lt;blockquote&gt; &lt;code&gt; &amp;lt;style
type="text/css"&amp;gt;&lt;br&gt;
img, div { behavior: url(iepngfix.htc) }&lt;br&gt;
&amp;lt;/style&amp;gt; &lt;/code&gt; &lt;/blockquote&gt; That CSS selector must include the tags/elements
on which you want PNG support -- basically, give it a comma-separated list of tags
you use. It must also include the correct path to the .HTC &lt;em&gt;relative to the HTML
document location&lt;/em&gt; (not relative to the CSS document!). For instance, yours may
look like this: &lt;blockquote&gt; &lt;code&gt; &amp;lt;style type="text/css"&amp;gt;&lt;br&gt;
img, div, a, input { behavior: url(/css/resources/iepngfix.htc) }&lt;br&gt;
&amp;lt;/style&amp;gt; &lt;/code&gt; &lt;/blockquote&gt; 
&lt;/li&gt;
&lt;li&gt;
If your site uses subfolders, open the .HTC file in a text editor like Windows Notepad
and change the &lt;code&gt;blankImg&lt;/code&gt; variable to include a correct path to blank.gif
like so: &lt;blockquote&gt; &lt;code&gt; var blankImg = '/images/blank.gif'; &lt;/code&gt; &lt;/blockquote&gt; Again
the path is relative to the HTML file. Otherwise, you will see a "broken image" graphic!&lt;/li&gt;
&lt;/ol&gt;
&lt;/blockquote&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=13c03889-f4f1-4383-b80b-d76e1c32fa47" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,13c03889-f4f1-4383-b80b-d76e1c32fa47.aspx</comments>
      <category>How-to;Interesting Links;Programming</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=b0349b0d-4994-4ee6-8670-920fa22759d9</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,b0349b0d-4994-4ee6-8670-920fa22759d9.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,b0349b0d-4994-4ee6-8670-920fa22759d9.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=b0349b0d-4994-4ee6-8670-920fa22759d9</wfw:commentRss>
      <slash:comments>5</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <img src="http://ralphwhitbeck.com/content/binary/Firebug-profile-not-first.png" align="right" border="0" />Today
I needed to select all the h3's within a div and set a margin-top property on all
items in the returned set except the first.<br /><br />
I came up with a few ways to return the results I was looking for (here are some <a href="http://jquery.com">jQuery</a> examples):<br /><br /><code class="javascript">$("#div h3").slice(1);</code><br /><br /><code class="javascript">$("#div h3:not(:first)");</code><br /><br /><code class="javascript">$("#div h3:gt(0)");</code><br /><br />
I've been reading a lot about <a href="http://bit.ly/rbuJU">how your selection can
be optimized based on how you structure your query</a>. So I ran each query through
Firebug Profile to see which selector query was the fastest. Load the page, click
on the "Profile" button at the top, run your query in the console, click the "Profile"
button again to stop the profile.  You'll get the time it took to execute that
statement.  Here are the results for each:<br /><br /><code class="javascript">$("#div h3").slice(1);</code><b>3.305ms</b><br /><br /><code class="javascript">$("#div h3:not(:first)");</code><font color="#ff0000"><b>0.705ms</b></font><br /><br /><code class="javascript">$("#div h3:gt(0)");</code><b>2.347ms</b><br /><br />
It's clear from my testing that the second query is 2-3 times faster then the rest
for my page and my specific uses.  Your specific profile times may vary based
on HTML structure and selector query. So it's always good practice to test the speed
of your selector if there is more then one way to get your results so that you are
using the most efficient selector for your situation.  
<br /><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=b0349b0d-4994-4ee6-8670-920fa22759d9" /></body>
      <title>Selecting the fastest selector for jQuery using Firebug Profile</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,b0349b0d-4994-4ee6-8670-920fa22759d9.aspx</guid>
      <link>http://ralphwhitbeck.com/2009/06/16/SelectingTheFastestSelectorForJQueryUsingFirebugProfile.aspx</link>
      <pubDate>Tue, 16 Jun 2009 14:47:07 GMT</pubDate>
      <description>&lt;img src="http://ralphwhitbeck.com/content/binary/Firebug-profile-not-first.png" align="right" border="0"&gt;Today
I needed to select all the h3's within a div and set a margin-top property on all
items in the returned set except the first.&lt;br&gt;
&lt;br&gt;
I came up with a few ways to return the results I was looking for (here are some &lt;a href="http://jquery.com"&gt;jQuery&lt;/a&gt; examples):&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt;$("#div h3").slice(1);&lt;/code&gt; 
&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt;$("#div h3:not(:first)");&lt;/code&gt; 
&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt;$("#div h3:gt(0)");&lt;/code&gt;
&lt;br&gt;
&lt;br&gt;
I've been reading a lot about &lt;a href="http://bit.ly/rbuJU"&gt;how your selection can
be optimized based on how you structure your query&lt;/a&gt;. So I ran each query through
Firebug Profile to see which selector query was the fastest. Load the page, click
on the "Profile" button at the top, run your query in the console, click the "Profile"
button again to stop the profile.&amp;nbsp; You'll get the time it took to execute that
statement.&amp;nbsp; Here are the results for each:&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt;$("#div h3").slice(1);&lt;/code&gt; &lt;b&gt;3.305ms&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt;$("#div h3:not(:first)");&lt;/code&gt;&lt;font color="#ff0000"&gt; &lt;b&gt;0.705ms&lt;/b&gt;&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt;$("#div h3:gt(0)");&lt;/code&gt; &lt;b&gt;2.347ms&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
It's clear from my testing that the second query is 2-3 times faster then the rest
for my page and my specific uses.&amp;nbsp; Your specific profile times may vary based
on HTML structure and selector query. So it's always good practice to test the speed
of your selector if there is more then one way to get your results so that you are
using the most efficient selector for your situation.&amp;nbsp; 
&lt;br&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=b0349b0d-4994-4ee6-8670-920fa22759d9" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,b0349b0d-4994-4ee6-8670-920fa22759d9.aspx</comments>
      <category>How-to;jQuery;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=bba3c108-c419-4635-abaf-363d07fccd4e</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,bba3c108-c419-4635-abaf-363d07fccd4e.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,bba3c108-c419-4635-abaf-363d07fccd4e.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=bba3c108-c419-4635-abaf-363d07fccd4e</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">You can create an alias to a long namespace
or a type like so:<br /><br /><code class="csharp">using Project = SolutionName.Data.Project;</code><br /><br />
Then you use the Alias in place of the namespace:<br /><br /><code class="csharp">Project p = new Project();</code><br /><br />
I wish I would of known about this last summer, probably could of shaved a month off
my project just from not having to type in the long namespaces to our data layer.<br /><br /><b>Related Links:</b><br /><br /><a href="http://msdn.microsoft.com/en-us/library/sf0df423.aspx">using Directive (C#
Reference)</a><br /><a href="http://stackoverflow.com/questions/9033/hidden-features-of-c">Hidden Features
of C#</a><br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=bba3c108-c419-4635-abaf-363d07fccd4e" /></body>
      <title>Hidden C# Feature: Using Alias Directive</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,bba3c108-c419-4635-abaf-363d07fccd4e.aspx</guid>
      <link>http://ralphwhitbeck.com/2009/06/08/HiddenCFeatureUsingAliasDirective.aspx</link>
      <pubDate>Mon, 08 Jun 2009 02:41:54 GMT</pubDate>
      <description>You can create an alias to a long namespace or a type like so:&lt;br&gt;
&lt;br&gt;
&lt;code class="csharp"&gt;using Project = SolutionName.Data.Project;&lt;/code&gt;
&lt;br&gt;
&lt;br&gt;
Then you use the Alias in place of the namespace:&lt;br&gt;
&lt;br&gt;
&lt;code class="csharp"&gt;Project p = new Project();&lt;/code&gt;
&lt;br&gt;
&lt;br&gt;
I wish I would of known about this last summer, probably could of shaved a month off
my project just from not having to type in the long namespaces to our data layer.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Related Links:&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://msdn.microsoft.com/en-us/library/sf0df423.aspx"&gt;using Directive (C#
Reference)&lt;/a&gt;
&lt;br&gt;
&lt;a href="http://stackoverflow.com/questions/9033/hidden-features-of-c"&gt;Hidden Features
of C#&lt;/a&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=bba3c108-c419-4635-abaf-363d07fccd4e" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,bba3c108-c419-4635-abaf-363d07fccd4e.aspx</comments>
      <category>How-to;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=5180f7aa-519c-4313-8f01-0b63a0bc61c2</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,5180f7aa-519c-4313-8f01-0b63a0bc61c2.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,5180f7aa-519c-4313-8f01-0b63a0bc61c2.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=5180f7aa-519c-4313-8f01-0b63a0bc61c2</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">NETTUTS had a great tutorial by Dan Wellman
called "<a title="Building a jQuery-Powered Tag-Cloud" href="http://nettuts.com/tutorials/javascript-ajax/building-a-jquery-powered-tag-cloud/" id="zbuh">Building
a jQuery-Powered Tag-Cloud</a>" The problem for me was that the tutorial showed you
how to connect to the database and pull tags and frequencies via PHP.<br /><br />
Because I am currently learning ASP.NET MVC I thought I would try to duplicate the
results of the tutorial but with using ASP.NET MVC RC instread of PHP.  Here
is how I did it.<br /><br />
I started by creating a Home Controller class.<br /><br />
HomeController.cs<br /><br /><!-- code formatted by http://manoli.net/csharpformat/ --><style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }
</style><div class="csharpcode"><pre class="alt"><span class="lnum"> 1: </span><span class="kwrd">using</span> System;</pre><pre><span class="lnum"> 2: </span><span class="kwrd">using</span> System.Collections.Generic;</pre><pre class="alt"><span class="lnum"> 3: </span><span class="kwrd">using</span> System.Linq;</pre><pre><span class="lnum"> 4: </span><span class="kwrd">using</span> System.Web;</pre><pre class="alt"><span class="lnum"> 5: </span><span class="kwrd">using</span> System.Web.Mvc;</pre><pre><span class="lnum"> 6: </span><span class="kwrd">using</span> System.Web.Mvc.Ajax;</pre><pre class="alt"><span class="lnum"> 7: </span> </pre><pre><span class="lnum"> 8: </span><span class="kwrd">namespace</span> MvcApplication5.Controllers</pre><pre class="alt"><span class="lnum"> 9: </span>{</pre><pre><span class="lnum"> 10: </span><span class="kwrd">public</span><span class="kwrd">class</span> HomeController
: Controller</pre><pre class="alt"><span class="lnum"> 11: </span> {</pre><pre><span class="lnum"> 12: </span><span class="rem">//</span></pre><pre class="alt"><span class="lnum"> 13: </span><span class="rem">// GET: /Home/</span></pre><pre><span class="lnum"> 14: </span><span class="kwrd">public</span> ActionResult
TagCloud()</pre><pre class="alt"><span class="lnum"> 15: </span> {</pre><pre><span class="lnum"> 16: </span><span class="kwrd">return</span> View();</pre><pre class="alt"><span class="lnum"> 17: </span> }</pre><pre><span class="lnum"> 18: </span> </pre><pre class="alt"><span class="lnum"> 19: </span><span class="kwrd">public</span> JsonResult
JSON()</pre><pre><span class="lnum"> 20: </span> {</pre><pre class="alt"><span class="lnum"> 21: </span> List&lt;<span class="kwrd">object</span>&gt;
tagcloud = <span class="kwrd">new</span> List&lt;<span class="kwrd">object</span>&gt;</pre><pre><span class="lnum"> 22: </span> {</pre><pre class="alt"><span class="lnum"> 23: </span><span class="kwrd">new</span> { tag
= <span class="str">"jQuery"</span>, freq = <span class="str">"10"</span> },</pre><pre><span class="lnum"> 24: </span><span class="kwrd">new</span> { tag = <span class="str">"asp.net"</span>,
freq = <span class="str">"3"</span>},</pre><pre class="alt"><span class="lnum"> 25: </span><span class="kwrd">new</span> { tag
= <span class="str">"programming"</span>, freq = <span class="str">"183"</span>},</pre><pre><span class="lnum"> 26: </span><span class="kwrd">new</span> { tag = <span class="str">"code"</span>,
freq = <span class="str">"34"</span> },</pre><pre class="alt"><span class="lnum"> 27: </span><span class="kwrd">new</span> { tag
= <span class="str">"HTML"</span>, freq = <span class="str">"58"</span>},</pre><pre><span class="lnum"> 28: </span><span class="kwrd">new</span> { tag = <span class="str">"javascript"</span>,
freq = <span class="str">"23"</span>},</pre><pre class="alt"><span class="lnum"> 29: </span><span class="kwrd">new</span> { tag
= <span class="str">"people"</span>, freq = <span class="str">"43"</span> },</pre><pre><span class="lnum"> 30: </span><span class="kwrd">new</span> { tag = <span class="str">"Google"</span>,
freq = <span class="str">"3"</span>},</pre><pre class="alt"><span class="lnum"> 31: </span><span class="kwrd">new</span> { tag
= <span class="str">"Microsoft"</span>, freq = <span class="str">"1"</span>},</pre><pre><span class="lnum"> 32: </span><span class="kwrd">new</span> { tag = <span class="str">"Apple"</span>,
freq = <span class="str">"10"</span> },</pre><pre class="alt"><span class="lnum"> 33: </span><span class="kwrd">new</span> { tag
= <span class="str">"iPhone"</span>, freq = <span class="str">"38"</span>},</pre><pre><span class="lnum"> 34: </span><span class="kwrd">new</span> { tag = <span class="str">"MVC"</span>,
freq = <span class="str">"1"</span>}</pre><pre class="alt"><span class="lnum"> 35: </span> };</pre><pre><span class="lnum"> 36: </span><span class="kwrd">return</span> Json(tagcloud); </pre><pre class="alt"><span class="lnum"> 37: </span> }</pre><pre><span class="lnum"> 38: </span> </pre><pre class="alt"><span class="lnum"> 39: </span> }</pre><pre><span class="lnum"> 40: </span>}</pre></div><br /><span> What's happening here is that we are making a action for the View we will create
and I am calling it TagCloud.  This action isn't going to provide us any data
so it's a stub action.  The next Action we create is to provide TagCloud the
JSON data.  In here I am creating a static List to send back serialized as JSON. 
You could also tie it to a model and use Linq to SQL to build the List. 
<br /><br />
Our URL for the .getJSON method will be: /Home/JSON 
<br /><br />
This will return JSON data that looks like this:<br /><br /></span><img src="http://ralphwhitbeck.com/content/binary/JSON-Data-ASPNET-MVC.png" border="0" /><span></span><span><br /><br />
Notice the difference in the JSON I am bringing back and the one Dan was bringing
back.  I don't have a tags: with the rest of the data nested under it. 
We'll need to update a line in the jQuery to make this work now.<br /><br />
Let's create the View for TagCloud.</span><br /><span><br />
TagCloud.aspx<br /><br /></span><!-- code formatted by http://manoli.net/csharpformat/ --><style type="text/css">
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }
</style><div class="csharpcode"><pre class="alt"><span class="lnum"> 1: </span><span class="asp">&lt;%@ Page Language="C#"
Inherits="System.Web.Mvc.ViewPage" %&gt;</span></pre><pre><span class="lnum"> 2: </span> </pre><pre class="alt"><span class="lnum"> 3: </span><span class="kwrd">&lt;!</span><span class="html">DOCTYPE</span><span class="attr">HTML</span><span class="attr">PUBLIC</span><span class="kwrd">"-//W3C//DTD
HTML 4.01//EN"</span><span class="kwrd">"http://www.w3.org/TR/html4/strict.dtd"</span><span class="kwrd">&gt;</span></pre><pre><span class="lnum"> 4: </span><span class="kwrd">&lt;</span><span class="html">html</span><span class="kwrd">&gt;</span></pre><pre class="alt"><span class="lnum"> 5: </span><span class="kwrd">&lt;</span><span class="html">head</span><span class="kwrd">&gt;</span></pre><pre><span class="lnum"> 6: </span><span class="kwrd">&lt;</span><span class="html">link</span><span class="attr">rel</span><span class="kwrd">="stylesheet"</span><span class="attr">type</span><span class="kwrd">="text/css"</span><span class="attr">href</span><span class="kwrd">="/content/tagcloud.css"</span><span class="kwrd">/&gt;</span></pre><pre class="alt"><span class="lnum"> 7: </span><span class="kwrd">&lt;</span><span class="html">meta</span><span class="attr">http-equiv</span><span class="kwrd">="Content-Type"</span><span class="attr">content</span><span class="kwrd">="text/html;
charset=utf-8"</span><span class="kwrd">/&gt;</span></pre><pre><span class="lnum"> 8: </span><span class="kwrd">&lt;</span><span class="html">title</span><span class="kwrd">&gt;</span>jQuery
Tag Cloud<span class="kwrd">&lt;/</span><span class="html">title</span><span class="kwrd">&gt;</span></pre><pre class="alt"><span class="lnum"> 9: </span><span class="kwrd">&lt;/</span><span class="html">head</span><span class="kwrd">&gt;</span></pre><pre><span class="lnum"> 10: </span><span class="kwrd">&lt;</span><span class="html">body</span><span class="kwrd">&gt;</span></pre><pre class="alt"><span class="lnum"> 11: </span><span class="kwrd">&lt;</span><span class="html">div</span><span class="attr">id</span><span class="kwrd">="tagCloud"</span><span class="kwrd">&gt;</span></pre><pre><span class="lnum"> 12: </span><span class="kwrd">&lt;</span><span class="html">h2</span><span class="kwrd">&gt;</span>Tag
Cloud<span class="kwrd">&lt;/</span><span class="html">h2</span><span class="kwrd">&gt;</span></pre><pre class="alt"><span class="lnum"> 13: </span><span class="kwrd">&lt;/</span><span class="html">div</span><span class="kwrd">&gt;</span></pre><pre><span class="lnum"> 14: </span><span class="kwrd">&lt;</span><span class="html">script</span><span class="attr">type</span><span class="kwrd">="text/javascript"</span><span class="attr">src</span><span class="kwrd">="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"</span><span class="kwrd">&gt;&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span></pre><pre class="alt"><span class="lnum"> 15: </span> &lt;script type=<span class="str">"text/javascript"</span>&gt;</pre><pre><span class="lnum"> 16: </span> $(<span class="kwrd">function</span>() {</pre><pre class="alt"><span class="lnum"> 17: </span><span class="rem">//get tag feed </span></pre><pre><span class="lnum"> 18: </span> $.getJSON(<span class="str">"/Home/JSON"</span>,<span class="kwrd">null</span>, <span class="kwrd">function</span>(data)
{</pre><pre class="alt"><span class="lnum"> 19: </span><span class="rem">//create list for
tag links </span></pre><pre><span class="lnum"> 20: </span> $(<span class="str">"&lt;ul&gt;"</span>).attr(<span class="str">"id"</span>, <span class="str">"tagList"</span>).appendTo(<span class="str">"#tagCloud"</span>);</pre><pre class="alt"><span class="lnum"> 21: </span> </pre><pre><span class="lnum"> 22: </span><span class="rem">//create tags </span></pre><pre class="alt"><span class="lnum"> 23: </span> $.each(data, <span class="kwrd">function</span>(i,
val) {</pre><pre><span class="lnum"> 24: </span> </pre><pre class="alt"><span class="lnum"> 25: </span><span class="rem">//create item </span></pre><pre><span class="lnum"> 26: </span><span class="kwrd">var</span> li = $(<span class="str">"&lt;li&gt;"</span>);</pre><pre class="alt"><span class="lnum"> 27: </span> </pre><pre><span class="lnum"> 28: </span><span class="rem">//create link </span></pre><pre class="alt"><span class="lnum"> 29: </span> $(<span class="str">"&lt;a&gt;"</span>).text(val.tag).attr({
title: <span class="str">"See all pages tagged with "</span> + val.tag, href: <span class="str">"http://localhost/tags/"</span> +
val.tag + <span class="str">".html"</span> }).appendTo(li);</pre><pre><span class="lnum"> 30: </span> </pre><pre class="alt"><span class="lnum"> 31: </span><span class="rem">//add to list</span></pre><pre><span class="lnum"> 32: </span> li.appendTo(<span class="str">"#tagList"</span>);</pre><pre class="alt"><span class="lnum"> 33: </span><span class="rem">//set tag size </span></pre><pre><span class="lnum"> 34: </span> li.children().css(<span class="str">"fontSize"</span>,
(val.freq / 10 &lt; 1) ? val.freq / 10 + 1 + <span class="str">"em"</span> : (val.freq
/ 10 &gt; 2) ? <span class="str">"2em"</span> : val.freq / 10 + <span class="str">"em"</span>); </pre><pre class="alt"><span class="lnum"> 35: </span></pre><pre><span class="lnum"> 36: </span> });</pre><pre class="alt"><span class="lnum"> 37: </span> });</pre><pre><span class="lnum"> 38: </span> }); </pre><pre class="alt"><span class="lnum"> 39: </span><span class="kwrd">&lt;/</span><span class="html">script</span><span class="kwrd">&gt;</span></pre><pre><span class="lnum"> 40: </span><span class="kwrd">&lt;/</span><span class="html">body</span><span class="kwrd">&gt;</span></pre><pre class="alt"><span class="lnum"> 41: </span><span class="kwrd">&lt;/</span><span class="html">html</span><span class="kwrd">&gt;</span></pre></div><br /><span>As we start to loop through the JSON data Dan was telling jQuery to start inside
tags with data.tags, since we don't have tags we can just use the variable data like
so: </span><span>$.each(data, function(i, val) {<br /><br />
The rest of setting this up is the same as NETTUTS article.  All that remains
is the css.<br /><br /></span><img src="http://ralphwhitbeck.com/content/binary/tagcloud-preview.png" border="0" /><br /><br /><br /><b>Download the Source</b><br /><br /><a href="http://ralphwhitbeck.com/content/binary/jQuery-TagCloud_source.zip">jQuery-TagCloud_source.zip
(44.82 KB)</a><br /><br /><br /><br /><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=5180f7aa-519c-4313-8f01-0b63a0bc61c2" /></body>
      <title>Building a jQuery-Powered Tag-Cloud with an ASP.NET MVC backend</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,5180f7aa-519c-4313-8f01-0b63a0bc61c2.aspx</guid>
      <link>http://ralphwhitbeck.com/2009/01/30/BuildingAJQueryPoweredTagCloudWithAnASPNETMVCBackend.aspx</link>
      <pubDate>Fri, 30 Jan 2009 04:02:13 GMT</pubDate>
      <description>NETTUTS had a great tutorial by Dan Wellman called "&lt;a title="Building a jQuery-Powered Tag-Cloud" href="http://nettuts.com/tutorials/javascript-ajax/building-a-jquery-powered-tag-cloud/" id="zbuh"&gt;Building
a jQuery-Powered Tag-Cloud&lt;/a&gt;" The problem for me was that the tutorial showed you
how to connect to the database and pull tags and frequencies via PHP.&lt;br&gt;
&lt;br&gt;
Because I am currently learning ASP.NET MVC I thought I would try to duplicate the
results of the tutorial but with using ASP.NET MVC RC instread of PHP.&amp;nbsp; Here
is how I did it.&lt;br&gt;
&lt;br&gt;
I started by creating a Home Controller class.&lt;br&gt;
&lt;br&gt;
HomeController.cs&lt;br&gt;
&lt;br&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Collections.Generic;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Linq;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web.Mvc;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web.Mvc.Ajax;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt;&lt;span class="kwrd"&gt;namespace&lt;/span&gt; MvcApplication5.Controllers&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt;{&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; HomeController
: Controller&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 12: &lt;/span&gt; &lt;span class="rem"&gt;//&lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 13: &lt;/span&gt; &lt;span class="rem"&gt;// GET: /Home/&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 14: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; ActionResult
TagCloud()&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 15: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 16: &lt;/span&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; View();&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 17: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 18: &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 19: &lt;/span&gt; &lt;span class="kwrd"&gt;public&lt;/span&gt; JsonResult
JSON()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 20: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 21: &lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt;
tagcloud = &lt;span class="kwrd"&gt;new&lt;/span&gt; List&amp;lt;&lt;span class="kwrd"&gt;object&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 22: &lt;/span&gt; {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 23: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag
= &lt;span class="str"&gt;"jQuery"&lt;/span&gt;, freq = &lt;span class="str"&gt;"10"&lt;/span&gt; },&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 24: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag = &lt;span class="str"&gt;"asp.net"&lt;/span&gt;,
freq = &lt;span class="str"&gt;"3"&lt;/span&gt;},&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 25: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag
= &lt;span class="str"&gt;"programming"&lt;/span&gt;, freq = &lt;span class="str"&gt;"183"&lt;/span&gt;},&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 26: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag = &lt;span class="str"&gt;"code"&lt;/span&gt;,
freq = &lt;span class="str"&gt;"34"&lt;/span&gt; },&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 27: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag
= &lt;span class="str"&gt;"HTML"&lt;/span&gt;, freq = &lt;span class="str"&gt;"58"&lt;/span&gt;},&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 28: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag = &lt;span class="str"&gt;"javascript"&lt;/span&gt;,
freq = &lt;span class="str"&gt;"23"&lt;/span&gt;},&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 29: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag
= &lt;span class="str"&gt;"people"&lt;/span&gt;, freq = &lt;span class="str"&gt;"43"&lt;/span&gt; },&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 30: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag = &lt;span class="str"&gt;"Google"&lt;/span&gt;,
freq = &lt;span class="str"&gt;"3"&lt;/span&gt;},&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 31: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag
= &lt;span class="str"&gt;"Microsoft"&lt;/span&gt;, freq = &lt;span class="str"&gt;"1"&lt;/span&gt;},&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 32: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag = &lt;span class="str"&gt;"Apple"&lt;/span&gt;,
freq = &lt;span class="str"&gt;"10"&lt;/span&gt; },&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 33: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag
= &lt;span class="str"&gt;"iPhone"&lt;/span&gt;, freq = &lt;span class="str"&gt;"38"&lt;/span&gt;},&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 34: &lt;/span&gt; &lt;span class="kwrd"&gt;new&lt;/span&gt; { tag = &lt;span class="str"&gt;"MVC"&lt;/span&gt;,
freq = &lt;span class="str"&gt;"1"&lt;/span&gt;}&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 35: &lt;/span&gt; };&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 36: &lt;/span&gt; &lt;span class="kwrd"&gt;return&lt;/span&gt; Json(tagcloud); &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 37: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 38: &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 39: &lt;/span&gt; }&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 40: &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;span&gt; What's happening here is that we are making a action for the View we will create
and I am calling it TagCloud.&amp;nbsp; This action isn't going to provide us any data
so it's a stub action.&amp;nbsp; The next Action we create is to provide TagCloud the
JSON data.&amp;nbsp; In here I am creating a static List to send back serialized as JSON.&amp;nbsp;
You could also tie it to a model and use Linq to SQL to build the List. 
&lt;br&gt;
&lt;br&gt;
Our URL for the .getJSON method will be: /Home/JSON 
&lt;br&gt;
&lt;br&gt;
This will return JSON data that looks like this:&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;&lt;img src="http://ralphwhitbeck.com/content/binary/JSON-Data-ASPNET-MVC.png" border="0"&gt;&lt;span&gt;&lt;/span&gt;&lt;span&gt;
&lt;br&gt;
&lt;br&gt;
Notice the difference in the JSON I am bringing back and the one Dan was bringing
back.&amp;nbsp; I don't have a tags: with the rest of the data nested under it.&amp;nbsp;
We'll need to update a line in the jQuery to make this work now.&lt;br&gt;
&lt;br&gt;
Let's create the View for TagCloud.&lt;/span&gt;
&lt;br&gt;
&lt;span&gt; 
&lt;br&gt;
TagCloud.aspx&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;style type="text/css"&gt;
.csharpcode, .csharpcode pre
{
	font-size: small;
	color: black;
	font-family: Consolas, "Courier New", Courier, Monospace;
	background-color: #ffffff;
	/*white-space: pre;*/
}

.csharpcode pre { margin: 0em; }

.csharpcode .rem { color: #008000; }

.csharpcode .kwrd { color: #0000ff; }

.csharpcode .str { color: #006080; }

.csharpcode .op { color: #0000c0; }

.csharpcode .preproc { color: #cc6633; }

.csharpcode .asp { background-color: #ffff00; }

.csharpcode .html { color: #800000; }

.csharpcode .attr { color: #ff0000; }

.csharpcode .alt 
{
	background-color: #f4f4f4;
	width: 100%;
	margin: 0em;
}

.csharpcode .lnum { color: #606060; }
&lt;/style&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 1: &lt;/span&gt;&lt;span class="asp"&gt;&amp;lt;%@ Page Language="C#"
Inherits="System.Web.Mvc.ViewPage" %&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 2: &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 3: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="html"&gt;DOCTYPE&lt;/span&gt; &lt;span class="attr"&gt;HTML&lt;/span&gt; &lt;span class="attr"&gt;PUBLIC&lt;/span&gt; &lt;span class="kwrd"&gt;"-//W3C//DTD
HTML 4.01//EN"&lt;/span&gt; &lt;span class="kwrd"&gt;"http://www.w3.org/TR/html4/strict.dtd"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 4: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 5: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 6: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;link&lt;/span&gt; &lt;span class="attr"&gt;rel&lt;/span&gt;&lt;span class="kwrd"&gt;="stylesheet"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/css"&lt;/span&gt; &lt;span class="attr"&gt;href&lt;/span&gt;&lt;span class="kwrd"&gt;="/content/tagcloud.css"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 7: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;meta&lt;/span&gt; &lt;span class="attr"&gt;http-equiv&lt;/span&gt;&lt;span class="kwrd"&gt;="Content-Type"&lt;/span&gt; &lt;span class="attr"&gt;content&lt;/span&gt;&lt;span class="kwrd"&gt;="text/html;
charset=utf-8"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 8: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;jQuery
Tag Cloud&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 9: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 10: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 11: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="tagCloud"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 12: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;h2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Tag
Cloud&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;h2&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 13: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 14: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/javascript"&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;="http://ajax.googleapis.com/ajax/libs/jquery/1.3.1/jquery.min.js"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 15: &lt;/span&gt; &amp;lt;script type=&lt;span class="str"&gt;"text/javascript"&lt;/span&gt;&amp;gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 16: &lt;/span&gt; $(&lt;span class="kwrd"&gt;function&lt;/span&gt;() {&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 17: &lt;/span&gt; &lt;span class="rem"&gt;//get tag feed &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 18: &lt;/span&gt; $.getJSON(&lt;span class="str"&gt;"/Home/JSON"&lt;/span&gt;,&lt;span class="kwrd"&gt;null&lt;/span&gt;, &lt;span class="kwrd"&gt;function&lt;/span&gt;(data)
{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 19: &lt;/span&gt; &lt;span class="rem"&gt;//create list for
tag links &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 20: &lt;/span&gt; $(&lt;span class="str"&gt;"&amp;lt;ul&amp;gt;"&lt;/span&gt;).attr(&lt;span class="str"&gt;"id"&lt;/span&gt;, &lt;span class="str"&gt;"tagList"&lt;/span&gt;).appendTo(&lt;span class="str"&gt;"#tagCloud"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 21: &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 22: &lt;/span&gt; &lt;span class="rem"&gt;//create tags &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 23: &lt;/span&gt; $.each(data, &lt;span class="kwrd"&gt;function&lt;/span&gt;(i,
val) {&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 24: &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 25: &lt;/span&gt; &lt;span class="rem"&gt;//create item &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 26: &lt;/span&gt; &lt;span class="kwrd"&gt;var&lt;/span&gt; li = $(&lt;span class="str"&gt;"&amp;lt;li&amp;gt;"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 27: &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 28: &lt;/span&gt; &lt;span class="rem"&gt;//create link &lt;/span&gt;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 29: &lt;/span&gt; $(&lt;span class="str"&gt;"&amp;lt;a&amp;gt;"&lt;/span&gt;).text(val.tag).attr({
title: &lt;span class="str"&gt;"See all pages tagged with "&lt;/span&gt; + val.tag, href: &lt;span class="str"&gt;"http://localhost/tags/"&lt;/span&gt; +
val.tag + &lt;span class="str"&gt;".html"&lt;/span&gt; }).appendTo(li);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 30: &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 31: &lt;/span&gt; &lt;span class="rem"&gt;//add to list&lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 32: &lt;/span&gt; li.appendTo(&lt;span class="str"&gt;"#tagList"&lt;/span&gt;);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 33: &lt;/span&gt; &lt;span class="rem"&gt;//set tag size &lt;/span&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 34: &lt;/span&gt; li.children().css(&lt;span class="str"&gt;"fontSize"&lt;/span&gt;,
(val.freq / 10 &amp;lt; 1) ? val.freq / 10 + 1 + &lt;span class="str"&gt;"em"&lt;/span&gt; : (val.freq
/ 10 &amp;gt; 2) ? &lt;span class="str"&gt;"2em"&lt;/span&gt; : val.freq / 10 + &lt;span class="str"&gt;"em"&lt;/span&gt;); &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 35: &lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 36: &lt;/span&gt; });&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 37: &lt;/span&gt; });&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 38: &lt;/span&gt; }); &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 39: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt; 40: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt; 41: &lt;/span&gt; &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; &lt;/pre&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;span&gt;As we start to loop through the JSON data Dan was telling jQuery to start inside
tags with data.tags, since we don't have tags we can just use the variable data like
so: &lt;/span&gt;&lt;span&gt;$.each(data, function(i, val) {&lt;br&gt;
&lt;br&gt;
The rest of setting this up is the same as NETTUTS article.&amp;nbsp; All that remains
is the css.&lt;br&gt;
&lt;br&gt;
&lt;/span&gt;&lt;img src="http://ralphwhitbeck.com/content/binary/tagcloud-preview.png" border="0"&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Download the Source&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&lt;a href="http://ralphwhitbeck.com/content/binary/jQuery-TagCloud_source.zip"&gt;jQuery-TagCloud_source.zip
(44.82 KB)&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=5180f7aa-519c-4313-8f01-0b63a0bc61c2" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,5180f7aa-519c-4313-8f01-0b63a0bc61c2.aspx</comments>
      <category>ASP.NET MVC;How-to;jQuery;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=7781da1e-88f2-491f-9de2-77df2ed4a5a8</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,7781da1e-88f2-491f-9de2-77df2ed4a5a8.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=7781da1e-88f2-491f-9de2-77df2ed4a5a8</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">My #jQuery related twitter posts for the
week of January 13th - January 19th:<br /><br /><ul><li><span id="msgtxt1116858867" class="msgtxt en">RT: How To Build A Custom jQuery Selector <a href="http://tinyurl.com/6vjwjt" onclick="pageTracker._trackPageview('/exit/link/1116858867')" target="_blank">http://tinyurl.com/6vjwjt</a> (via <a href="http://twitter.com/jquery" onclick="pageTracker._trackPageview('/exit/to/jquery')" target="_blank">@jquery</a>) <a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a></span> Jan
13, 2009 10:55 PM GMT</li><li><span id="msgtxt1118302624" class="msgtxt en">Awesome, I made a "Top 20 jQuery Tweeple
to Follow" list. <a href="http://bit.ly/V8hs" onclick="pageTracker._trackPageview('/exit/link/1118302624')" target="_blank">http://bit.ly/V8hs</a><span class="expand"></span><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a></span> Jan
14, 2009 02:14 PM GMT</li><li><span id="msgtxt1118351619" class="msgtxt en">Damn look at the performance gains of
jQuery 1.3 <a href="http://bit.ly/5GqX" onclick="pageTracker._trackPageview('/exit/link/1118351619')" target="_blank">http://bit.ly/5GqX</a><span class="expand"></span><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a></span> Jan
14, 2009 02:37 PM GMT</li><li><span id="msgtxt1118355376" class="msgtxt en">Official announcement jQuery 1.3 released <a href="http://bit.ly/xBIP" onclick="pageTracker._trackPageview('/exit/link/1118355376')" target="_blank">http://bit.ly/xBIP</a><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a></span> Jan
14, 2009 02:38 PM GMT</li><li><span id="msgtxt1118393349" class="msgtxt en">New jQuery API Browser <a href="http://api.jquery.com/" onclick="pageTracker._trackPageview('/exit/link/1118393349')" target="_blank">http://api.jquery.com/</a><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a></span> Jan
14, 2009 02:55 PM GMT</li><li><span id="msgtxt1119199552" class="msgtxt en">"Select Cuts Off Options In IE (Fix)" <a href="http://bit.ly/13fJY" onclick="pageTracker._trackPageview('/exit/link/1119199552')" target="_blank">http://bit.ly/13fJY</a><span class="expand"></span><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a><a href="http://search.twitter.com/search?q=%23css">#css</a><a href="http://search.twitter.com/search?q=%23ie">#ie</a><a href="http://search.twitter.com/search?q=%23hack">#hack</a></span> Jan
14, 2009 08:31 PM GMT</li><li><span id="msgtxt1119758383" class="msgtxt en">"Building a reusabe font size controller
interface using jQuery" <a href="http://bit.ly/QHLS" onclick="pageTracker._trackPageview('/exit/link/1119758383')" target="_blank">http://bit.ly/QHLS</a><span class="expand"></span><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a></span> Jan
15, 2009 12:35 AM GMT</li><li><span id="msgtxt1119792460" class="msgtxt en">"XML Parsing with jQuery" <a href="http://bit.ly/1cynCX" onclick="pageTracker._trackPageview('/exit/link/1119792460')" target="_blank">http://bit.ly/1cynCX</a><span class="expand"></span><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a><a href="http://search.twitter.com/search?q=%23xml">#xml</a></span> Jan
15, 2009 12:53 AM GMT</li><li><span id="msgtxt1123917142" class="msgtxt en">Unofficial jQuery 1.3 and VS 2008 Intellisense
vsdoc file <a href="http://bit.ly/zOr7" onclick="pageTracker._trackPageview('/exit/link/1123917142')" target="_blank">http://bit.ly/zOr7</a><span class="expand"></span><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a><a href="http://search.twitter.com/search?q=%23visualstudio">#visualstudio</a></span> Jan
16, 2009 03:34 PM GMT</li><li><span id="msgtxt1123982740" class="msgtxt en">"45+ New jQuery Techniques For Good
User Experience" <a href="http://bit.ly/ati4" onclick="pageTracker._trackPageview('/exit/link/1123982740')" target="_blank">http://bit.ly/ati4</a><span class="expand"></span><a href="http://search.twitter.com/search?q=%23jQuery"><b>#jQuery</b></a></span> Jan
16, 2009 04:00 PM GMT</li><li><span id="msgtxt1124210067" class="msgtxt en">"jQuery UI 1.6rc5 Compatible with jQuery
1.3" <a href="http://bit.ly/o6A" onclick="pageTracker._trackPageview('/exit/link/1124210067')" target="_blank">http://bit.ly/o6A</a><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a><a href="http://search.twitter.com/search?q=%23jqueryui">#jqueryui</a></span> Jan
16, 2009 05:31 PM GMT</li><li><span id="msgtxt1124219261" class="msgtxt en">Interesting feature of the jQuery API
Browser <a href="http://bit.ly/24rC" onclick="pageTracker._trackPageview('/exit/link/1124219261')" target="_blank">http://bit.ly/24rC</a><span class="expand"></span> view
only the new 1.3 features <a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a></span> Jan
16, 2009 05:35 PM GMT</li><li><span id="msgtxt1124689797" class="msgtxt en">RT <a href="http://twitter.com/jquery" onclick="pageTracker._trackPageview('/exit/to/jquery')" target="_blank">@jquery</a>:
Adding the nofollow attribute to external links with jQuery <a href="http://is.gd/g9Kr" onclick="pageTracker._trackPageview('/exit/link/1124689797')" target="_blank">http://is.gd/g9Kr</a><span class="expand"></span><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a></span> Jan
16, 2009 08:56 PM GMT</li><li><span id="msgtxt1125089013" class="msgtxt en">FaceBox - Lightbox for everything and
images <a href="http://famspam.com/facebox" onclick="pageTracker._trackPageview('/exit/link/1125089013')" target="_blank">http://famspam.com/facebox</a><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a><a href="http://search.twitter.com/search?q=%23plugin">#plugin</a></span> Jan
17, 2009 12:13 AM GMT</li><li><span id="msgtxt1125245137" class="msgtxt en">RT <a href="http://twitter.com/rmurphey" onclick="pageTracker._trackPageview('/exit/to/rmurphey')" target="_blank">@rmurphey</a>: <a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a> how
to fix fade glitch in ie using $.support instead of $.browser? <a href="http://tinyurl.com/3gwlwy" onclick="pageTracker._trackPageview('/exit/link/1125245137')" target="_blank">http://tinyurl.com/3gwlwy</a><span class="expand"></span> ...</span> Jan
17, 2009 01:37 AM GMT</li><li><span id="msgtxt1130776330" class="msgtxt en">"The Sexy Curls jQuery Plugin for a
nice page fold" <a href="http://tinyurl.com/a46cpf" onclick="pageTracker._trackPageview('/exit/link/1130776330')" target="_blank">http://tinyurl.com/a46cpf</a><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a><a href="http://search.twitter.com/search?q=%23plugin">#plugin</a></span> Jan
19, 2009 04:32 PM GMT</li><li><span id="msgtxt1131634274" class="msgtxt en">RT <a href="http://twitter.com/mlane" onclick="pageTracker._trackPageview('/exit/to/mlane')" target="_blank">@mlane</a>:
Build a Tabbed Box with CSS and jQuery - <a href="http://bit.ly/13Zkz" onclick="pageTracker._trackPageview('/exit/link/1131634274')" target="_blank">http://bit.ly/13Zkz</a><span class="expand"></span><a href="http://search.twitter.com/search?q=%23tutorial">#tutorial</a><a href="http://search.twitter.com/search?q=%23jquery"><b>#jquery</b></a></span> Jan
19, 2009 10:39 PM GMT</li></ul><a href="http://twitter.com/redwolves">Follow me</a> to see what I'll twitter next
about jQuery.<br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=7781da1e-88f2-491f-9de2-77df2ed4a5a8" /></body>
      <title>In Case you Missed it: #jQuery Twitter posts</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,7781da1e-88f2-491f-9de2-77df2ed4a5a8.aspx</guid>
      <link>http://ralphwhitbeck.com/2009/01/20/InCaseYouMissedItJQueryTwitterPosts.aspx</link>
      <pubDate>Tue, 20 Jan 2009 18:45:25 GMT</pubDate>
      <description>My #jQuery related twitter posts for the week of January 13th - January 19th:&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;span id="msgtxt1116858867" class="msgtxt en"&gt;RT: How To Build A Custom jQuery Selector &lt;a href="http://tinyurl.com/6vjwjt" onclick="pageTracker._trackPageview('/exit/link/1116858867')" target="_blank"&gt;http://tinyurl.com/6vjwjt&lt;/a&gt; (via &lt;a href="http://twitter.com/jquery" onclick="pageTracker._trackPageview('/exit/to/jquery')" target="_blank"&gt;@jquery&lt;/a&gt;) &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
13, 2009 10:55 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1118302624" class="msgtxt en"&gt;Awesome, I made a "Top 20 jQuery Tweeple
to Follow" list. &lt;a href="http://bit.ly/V8hs" onclick="pageTracker._trackPageview('/exit/link/1118302624')" target="_blank"&gt;http://bit.ly/V8hs&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
14, 2009 02:14 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1118351619" class="msgtxt en"&gt;Damn look at the performance gains of
jQuery 1.3 &lt;a href="http://bit.ly/5GqX" onclick="pageTracker._trackPageview('/exit/link/1118351619')" target="_blank"&gt;http://bit.ly/5GqX&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
14, 2009 02:37 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1118355376" class="msgtxt en"&gt;Official announcement jQuery 1.3 released &lt;a href="http://bit.ly/xBIP" onclick="pageTracker._trackPageview('/exit/link/1118355376')" target="_blank"&gt;http://bit.ly/xBIP&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
14, 2009 02:38 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1118393349" class="msgtxt en"&gt;New jQuery API Browser &lt;a href="http://api.jquery.com/" onclick="pageTracker._trackPageview('/exit/link/1118393349')" target="_blank"&gt;http://api.jquery.com/&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
14, 2009 02:55 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1119199552" class="msgtxt en"&gt;"Select Cuts Off Options In IE (Fix)" &lt;a href="http://bit.ly/13fJY" onclick="pageTracker._trackPageview('/exit/link/1119199552')" target="_blank"&gt;http://bit.ly/13fJY&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23css"&gt;#css&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23ie"&gt;#ie&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23hack"&gt;#hack&lt;/a&gt;&lt;/span&gt; Jan
14, 2009 08:31 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1119758383" class="msgtxt en"&gt;"Building a reusabe font size controller
interface using jQuery" &lt;a href="http://bit.ly/QHLS" onclick="pageTracker._trackPageview('/exit/link/1119758383')" target="_blank"&gt;http://bit.ly/QHLS&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
15, 2009 12:35 AM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1119792460" class="msgtxt en"&gt;"XML Parsing with jQuery" &lt;a href="http://bit.ly/1cynCX" onclick="pageTracker._trackPageview('/exit/link/1119792460')" target="_blank"&gt;http://bit.ly/1cynCX&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23xml"&gt;#xml&lt;/a&gt;&lt;/span&gt; Jan
15, 2009 12:53 AM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1123917142" class="msgtxt en"&gt;Unofficial jQuery 1.3 and VS 2008 Intellisense
vsdoc file &lt;a href="http://bit.ly/zOr7" onclick="pageTracker._trackPageview('/exit/link/1123917142')" target="_blank"&gt;http://bit.ly/zOr7&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23visualstudio"&gt;#visualstudio&lt;/a&gt;&lt;/span&gt; Jan
16, 2009 03:34 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1123982740" class="msgtxt en"&gt;"45+ New jQuery Techniques For Good
User Experience" &lt;a href="http://bit.ly/ati4" onclick="pageTracker._trackPageview('/exit/link/1123982740')" target="_blank"&gt;http://bit.ly/ati4&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; &lt;a href="http://search.twitter.com/search?q=%23jQuery"&gt;&lt;b&gt;#jQuery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
16, 2009 04:00 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1124210067" class="msgtxt en"&gt;"jQuery UI 1.6rc5 Compatible with jQuery
1.3" &lt;a href="http://bit.ly/o6A" onclick="pageTracker._trackPageview('/exit/link/1124210067')" target="_blank"&gt;http://bit.ly/o6A&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23jqueryui"&gt;#jqueryui&lt;/a&gt;&lt;/span&gt; Jan
16, 2009 05:31 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1124219261" class="msgtxt en"&gt;Interesting feature of the jQuery API
Browser &lt;a href="http://bit.ly/24rC" onclick="pageTracker._trackPageview('/exit/link/1124219261')" target="_blank"&gt;http://bit.ly/24rC&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; view
only the new 1.3 features &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
16, 2009 05:35 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1124689797" class="msgtxt en"&gt;RT &lt;a href="http://twitter.com/jquery" onclick="pageTracker._trackPageview('/exit/to/jquery')" target="_blank"&gt;@jquery&lt;/a&gt;:
Adding the nofollow attribute to external links with jQuery &lt;a href="http://is.gd/g9Kr" onclick="pageTracker._trackPageview('/exit/link/1124689797')" target="_blank"&gt;http://is.gd/g9Kr&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
16, 2009 08:56 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1125089013" class="msgtxt en"&gt;FaceBox - Lightbox for everything and
images &lt;a href="http://famspam.com/facebox" onclick="pageTracker._trackPageview('/exit/link/1125089013')" target="_blank"&gt;http://famspam.com/facebox&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23plugin"&gt;#plugin&lt;/a&gt;&lt;/span&gt; Jan
17, 2009 12:13 AM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1125245137" class="msgtxt en"&gt;RT &lt;a href="http://twitter.com/rmurphey" onclick="pageTracker._trackPageview('/exit/to/rmurphey')" target="_blank"&gt;@rmurphey&lt;/a&gt;: &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt; how
to fix fade glitch in ie using $.support instead of $.browser? &lt;a href="http://tinyurl.com/3gwlwy" onclick="pageTracker._trackPageview('/exit/link/1125245137')" target="_blank"&gt;http://tinyurl.com/3gwlwy&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; ...&lt;/span&gt; Jan
17, 2009 01:37 AM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1130776330" class="msgtxt en"&gt;"The Sexy Curls jQuery Plugin for a
nice page fold" &lt;a href="http://tinyurl.com/a46cpf" onclick="pageTracker._trackPageview('/exit/link/1130776330')" target="_blank"&gt;http://tinyurl.com/a46cpf&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23plugin"&gt;#plugin&lt;/a&gt;&lt;/span&gt; Jan
19, 2009 04:32 PM GMT&lt;/li&gt;
&lt;li&gt;
&lt;span id="msgtxt1131634274" class="msgtxt en"&gt;RT &lt;a href="http://twitter.com/mlane" onclick="pageTracker._trackPageview('/exit/to/mlane')" target="_blank"&gt;@mlane&lt;/a&gt;:
Build a Tabbed Box with CSS and jQuery - &lt;a href="http://bit.ly/13Zkz" onclick="pageTracker._trackPageview('/exit/link/1131634274')" target="_blank"&gt;http://bit.ly/13Zkz&lt;/a&gt;&lt;span class="expand"&gt;&lt;/span&gt; &lt;a href="http://search.twitter.com/search?q=%23tutorial"&gt;#tutorial&lt;/a&gt; &lt;a href="http://search.twitter.com/search?q=%23jquery"&gt;&lt;b&gt;#jquery&lt;/b&gt;&lt;/a&gt;&lt;/span&gt; Jan
19, 2009 10:39 PM GMT&lt;/li&gt;
&lt;/ul&gt;
&lt;a href="http://twitter.com/redwolves"&gt;Follow me&lt;/a&gt; to see what I'll twitter next
about jQuery.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=7781da1e-88f2-491f-9de2-77df2ed4a5a8" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,7781da1e-88f2-491f-9de2-77df2ed4a5a8.aspx</comments>
      <category>How-to;Interesting Links;jQuery;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=5e3ca8bd-40d2-4679-90a5-f10430763a57</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,5e3ca8bd-40d2-4679-90a5-f10430763a57.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,5e3ca8bd-40d2-4679-90a5-f10430763a57.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=5e3ca8bd-40d2-4679-90a5-f10430763a57</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <div>
          <div>
            <div>
    Database mirroring is a software solution, provided by SQL Server
2005, that gives you the ability to replicate your data in real-time.  Mirroring
allows for increased database availability and data protection and works at the database
level on databases that are set to full recovery mode.  You need two instances
ofSQL Server to set up mirroring because it maintains separate copies of data of a
single database across both servers. 
<br /><br />
    Let's look at a common scenario for database mirroring. Take a
company that has their customer database in a data center in New York City. 
They also have a backup data center in Houston. The database in NY is mirroring the
data to the database in Houston.  Let's say the data center in NY loses power
and they need to shut the server down.  With a "flip of a switch" they can move
the database to Houston and continue as if nothing happened.  When the data center
gets power again they can switch to the NY city database as soon as it's resynchronized.<br /><br /><b>Benefits</b><br /><br />
    One benefit of database mirroring is the increased data protection
of your data.  As each transaction is being written to your principle database
it is sending that exact transaction to the mirror database.  This provides complete
or almost complete (depending on which mode you set up; I'll get into this later)
data redundancy in real time.<br /><br />
    High-availability, this is a huge benefit for mission critical
data.  Hardware failures happen and network issues arise, with a "flip of a switch'
you can send the responsibility to the mirrored server to become the principled server
at any time.  You can also set up automatic failover with the addition of a witness
server to monitor the servers.<br /><br />
    Another benefit is that you have the flexibility to install updates
on your server without data disruption.  Because you can manually failover to
the mirror server at any time you can failover, install the updates and reboot if
necessary. When you are done you can then have the new principle server failover again
to restore the principle on to the primary server without any data loss or downtime
and upgrade the mirror server.<br /><br />
    Finally, you can set up mirroring to sync in synchronous or asynchronous
modes.  Synchronous or high-safety mode will write a transaction to the principle
database and send that exact transaction to the mirror and then wait for it to finish
committing that transaction before moving on. With high-safety you are assured that
the data that is on the principle is on the mirror at the exact same time. In that
you trade some latency waiting for the transaction for the true redundancy of the
data.  Automatic and manualfailovers, explained more below, require the use of
high-safety mode. 
<br /><br />
    Asynchronous or high-performance mode will send the stream of transactions
at the mirror server and the mirror will try to keep up.  With high-performance
there can be a gap where the mirror has a back log of transactions to complete that
the principle already has completed.  This gap can become pretty big with heavy
loads on the principle.  
<br /><br /><b>Requirements</b><br /><br />
    Database mirroring requires two servers. With SQL Server 2005 you
can set up mirroring with Standard or Enterprise editions.  It's very important
that both servers are running the same edition.  It is also recommended that
the hardware for both servers be near identical and have the ability to handle the
same load.<br /><br /><b>Setting up a Database Mirror</b><br /><br />
    Let's start with some simple preparation:<br /><br /></div>
            <ol>
              <li>
Make sure that you have the proper logins created on the mirror server. 
</li>
              <li>
Create the mirror database by restoring with NORECOVERY a recent full backup of the
principle database. The principle database must have been set-up with full recovery
when the backup was created.<br /></li>
              <li>
You must also restore all log backups since the full backup was made. Create a backup
of the transaction logs and restore on the mirror server.  You'll want to start
the mirror session as soon as you can after taking the log backup. 
</li>
            </ol>
            <br />
    Configuring Database mirroring:<br /><br /><ol><li>
Connect to the principle database. Select the database you wish to mirror. 
</li><li>
Right-click &gt; Tasks &gt; Mirror; this will bring you to the Mirror tab on the database
properties pop-up. 
</li><li>
Select the Configure Security button to configure the mirror session through the Configure
Database Mirroring Security Wizard (only in this wizard you can add or change the
witness server instance). 
</li><li>
Upon completion of the security wizard and you are still connected to the principle
server click on Start Mirroring.<br /></li></ol><br /><b>Client Connections (Connection Strings)</b><br /><br />
    I am going to assume that you as the reader already know how to
connect to a database in your application code in order to access it.  What I'll
cover here are the required key strings needed in the connection string to handle
connecting to both database servers in a mirror session depending on which one is
acting as the principle at the moment.<br /><br />
    Just as you would with a normal connection string you need to provide
a initial partner name.  This will be the principle server.  If you are
usingTCP/IP then enter in the IP, if you are using named pipes then enter in the name
of your server. Additionally, if your SQL Server is using a Instance Name then you
will need to add that as well (example: 10.10.2.1\InstanceName.  Now we need
to provide the failover partner.  This will be the mirror server.  Add this
information similarly as you would for the initial partner name.<br /><br /><span>    </span>The other item you will need to provide in your connection
string is the network attribute.  This will specify the network protocol to be
used and ensures that the proper network protocol persists between connections to
different partners. ForTCP/IP use the following: 
<br /><br /><div style="margin-left: 40px;"><i>Network=dbmssocn;</i><br /></div><br />
    Named Pipes use:<br /><br /><div style="margin-left: 40px;"><i>Network=dbnmpntw;</i><br /></div><br />
    Putting it all together in a sample connection string, you
can get <a href="http://msdn.microsoft.com/en-us/library/ms130822.aspx" id="uyt." target="_blank" title="more info on connection string keywords here">more
info on connection string keywords here</a>:<br /><i><br /></i><div style="margin-left: 40px;"><i>Data Source = 10.10.2.10/InstanceName; Failover partner = 10.10.2.11\InstanceName;
Initial Catalog = databaseName; User ID = sa; Password = 12345; Network = dbmssocn;</i><br /></div><br /><b>Failover</b><br /><br />
    There are three types of failover: automatic, manual and forced. 
Automatic requires a witness server and the mirror set-up in high-safety mode. 
Manual failover does not use a witness server and also requires the mirror set-up
to be in high-safety mode. Forced is usually used because the principle server has
been disconnected somehow.  Using forced service may result in data lose as all
transactions may not have made it to the mirrored server.  Forced service is
supported on high-availability and high-safety mirrored set-up modes.<br /><br /><i>Automatic Failover</i><br /><br />
    For automatic failover to occur the following conditions are required:<br /><br /><ul><li>
Mirroring sessions must be running high-safety mode and posses a witness server.<br /></li><li>
The mirror database must be synchronised. 
</li><li>
The principle server has lost communication with the witness and mirror servers but
the witness and mirror server are still online.  Note: If all servers lose connectivity
but then the witness and mirror server comes online automatic failover does not occur. 
</li><li>
The mirror server detects the loss of the principle server. 
</li></ul><br />
    How it works<br /><br /><ul><li>
If the principle server is still online and changes it's state to DISCONNECTED and
disconnects all clients. 
</li><li>
The mirror and witness server both register that the principle server is unavailable. 
</li><li>
The mirror server waits for all logs to be written from the redo queue before rolling
forward the mirror database. 
</li><li>
The former mirror server now moves online to be the principle. Recovery will roll
back any uncommitted transactions, locks isolate those transactions. 
</li><li>
When the former principle server comes back online and sees that the mirror has moved
to principle the former principle server will become the new mirror and start synchronising.
Once synchronising is complete failover is possible again. 
</li></ul><br /><i>Manual Failover</i><br /><br />
    With manual failover it's possible to failover to the mirror server
so that updates and upgrades can be performed on the principle server. Manual failover
requires the mirror set-up to be in high-safety mode (transaction safety set to FULL).
The partners need to be connected and synchronised.<br /><br />
    How it works:<br /><br /><ul><li>
Principle server disconnects, sends the last log message to the mirror and switches
to be the mirror server. 
</li><li>
The mirror server records the last log message as the failover log. 
</li><li>
The mirror server waits for all logs to be written from the redo queue before rolling
forward the mirror database. 
</li><li>
The mirror server becomes the principle server and the principle becomes the new mirror. 
</li><li>
The new mirror server quickly resynchronizes with the new principle server. Once complete
failover is possible again. 
</li></ul><br />
    Initiate Manual failover:<br /><br /></div>
          <ol>
            <li>
Connect to the principle server. Choose your database. 
</li>
            <li>
Right-click &gt; Tasks &gt; Mirror; this will bring you to the Mirror tab on the database
properties pop-up. 
</li>
            <li>
Click Failover.  Confirm that you want to failover to the mirror server. 
</li>
          </ol>
          <br />
Note: The client will need to see that the connection to the primary has failed before
it will try to connect to the failover partner.<br /><br /><i>Forced Service</i><br /><br />
    If the Principle server goes down due to hardware issues or is
unreachable you can use forced service to bring the mirror to principle state. 
Doing this may cause data loss as the mirror may not have received all of the transaction
logs from the principle. <a title="Read this Microsoft TechNet article for more information on forced service" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189977.aspx" id="wgqo">Read
this Microsoft TechNet article for more information on forced service</a>. 
<br /><br />
    Initiate Forced Service<br /><br /><ol><li>
Connect to the mirror server.</li><li>
Run the following T-SQL:<br />
ALTER DATABASE <i>&lt;database_name&gt;</i> SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS<br /><br />
The mirror will take over as principle and mirroring will be suspended.</li></ol><br /><b>Summary and Online Resources</b><br /><br />
    Database mirroring has many options and ways to be effective in
maintaining a high-availability database.  This article is my collected research
as I was learning how to set up mirroring. If you would like more information on setting
up database mirroring please look at the following resources:<br /><br /><ul><li><a title="Database Mirroring Overview" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189852.aspx" id="dx3l">Database
Mirroring Overview</a></li><li><a title="How to: Configure a Database Mirroring Session (SQL Server Management Studio)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms188712.aspx" id="srk9">How
to: Configure a Database Mirroring Session (SQL Server Management Studio)</a></li><li><a title="How to: Add or Replace a Database Mirroring Witness (SQL Server Management Studio)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms365603.aspx" id="z3z0">How
to: Add or Replace a Database Mirroring Witness (SQL Server Management Studio)</a></li><li><a title="Making the Initial Connection to a Database Mirroring Session" target="_blank" href="http://msdn.microsoft.com/en-us/library/ms366348.aspx" id="ulmn">Making
the Initial Connection to a Database Mirroring Session</a></li><li><a title="Using Connection String Keywords with SQL Server Native Client" target="_blank" href="http://msdn.microsoft.com/en-us/library/ms130822.aspx" id="gevf">Using
Connection String Keywords with SQL Server Native Client</a></li><li><a title="Role Switching During a Database Mirroring Session" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189850.aspx" id="c93v">Role
Switching During a Database Mirroring Session</a></li><li><a title="Automatic Failover" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189590.aspx" id="apze">Automatic
Failover</a> </li><li><a title="Manual Failover" target="_blank" href="http://technet.microsoft.com/en-us/library/ms191449.aspx" id="f-zj">Manual
Failover</a></li><li><a title="How to: Manually Fail Over a Database Mirroring Session (SQL Server Management Studio)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms186348.aspx" id="q50l">How
to: Manually Fail Over a Database Mirroring Session (SQL Server Management Studio)</a></li><li><a title="Forced Service (with Possible Data Loss)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189977.aspx" id="x.eu">Forced
Service (with Possible Data Loss)</a></li><li><a title="How to: Force Service in a Database Mirroring Session (Transact-SQL)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189270.aspx" id="n-8w">How
to: Force Service in a Database Mirroring Session (Transact-SQL)</a></li></ul></div>
        <br />
        <img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=5e3ca8bd-40d2-4679-90a5-f10430763a57" />
      </body>
      <title>Database Mirroring with SQL Server 2005</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,5e3ca8bd-40d2-4679-90a5-f10430763a57.aspx</guid>
      <link>http://ralphwhitbeck.com/2008/10/13/DatabaseMirroringWithSQLServer2005.aspx</link>
      <pubDate>Mon, 13 Oct 2008 03:15:25 GMT</pubDate>
      <description>    
    
    
&lt;div&gt;
&lt;div&gt;
&lt;div&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Database mirroring is a software solution, provided by SQL Server
2005, that gives you the ability to replicate your data in real-time.&amp;nbsp; Mirroring
allows for increased database availability and data protection and works at the database
level on databases that are set to full recovery mode.&amp;nbsp; You need two instances
ofSQL Server to set up mirroring because it maintains separate copies of data of a
single database across both servers. 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Let's look at a common scenario for database mirroring. Take a
company that has their customer database in a data center in New York City.&amp;nbsp;
They also have a backup data center in Houston. The database in NY is mirroring the
data to the database in Houston.&amp;nbsp; Let's say the data center in NY loses power
and they need to shut the server down.&amp;nbsp; With a "flip of a switch" they can move
the database to Houston and continue as if nothing happened.&amp;nbsp; When the data center
gets power again they can switch to the NY city database as soon as it's resynchronized.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Benefits&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;One benefit of database mirroring is the increased data protection
of your data.&amp;nbsp; As each transaction is being written to your principle database
it is sending that exact transaction to the mirror database.&amp;nbsp; This provides complete
or almost complete (depending on which mode you set up; I'll get into this later)
data redundancy in real time.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;High-availability, this is a huge benefit for mission critical
data.&amp;nbsp; Hardware failures happen and network issues arise, with a "flip of a switch'
you can send the responsibility to the mirrored server to become the principled server
at any time.&amp;nbsp; You can also set up automatic failover with the addition of a witness
server to monitor the servers.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Another benefit is that you have the flexibility to install updates
on your server without data disruption.&amp;nbsp; Because you can manually failover to
the mirror server at any time you can failover, install the updates and reboot if
necessary. When you are done you can then have the new principle server failover again
to restore the principle on to the primary server without any data loss or downtime
and upgrade the mirror server.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Finally, you can set up mirroring to sync in synchronous or asynchronous
modes.&amp;nbsp; Synchronous or high-safety mode will write a transaction to the principle
database and send that exact transaction to the mirror and then wait for it to finish
committing that transaction before moving on. With high-safety you are assured that
the data that is on the principle is on the mirror at the exact same time. In that
you trade some latency waiting for the transaction for the true redundancy of the
data.&amp;nbsp; Automatic and manualfailovers, explained more below, require the use of
high-safety mode. 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Asynchronous or high-performance mode will send the stream of transactions
at the mirror server and the mirror will try to keep up.&amp;nbsp; With high-performance
there can be a gap where the mirror has a back log of transactions to complete that
the principle already has completed.&amp;nbsp; This gap can become pretty big with heavy
loads on the principle.&amp;nbsp; 
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Requirements&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Database mirroring requires two servers. With SQL Server 2005 you
can set up mirroring with Standard or Enterprise editions.&amp;nbsp; It's very important
that both servers are running the same edition.&amp;nbsp; It is also recommended that
the hardware for both servers be near identical and have the ability to handle the
same load.&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Setting up a Database Mirror&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Let's start with some simple preparation:&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
Make sure that you have the proper logins created on the mirror server. 
&lt;/li&gt;
&lt;li&gt;
Create the mirror database by restoring with NORECOVERY a recent full backup of the
principle database. The principle database must have been set-up with full recovery
when the backup was created.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
You must also restore all log backups since the full backup was made. Create a backup
of the transaction logs and restore on the mirror server.&amp;nbsp; You'll want to start
the mirror session as soon as you can after taking the log backup. 
&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Configuring Database mirroring:&lt;br&gt;
&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;
Connect to the principle database. Select the database you wish to mirror. 
&lt;/li&gt;
&lt;li&gt;
Right-click &amp;gt; Tasks &amp;gt; Mirror; this will bring you to the Mirror tab on the database
properties pop-up. 
&lt;/li&gt;
&lt;li&gt;
Select the Configure Security button to configure the mirror session through the Configure
Database Mirroring Security Wizard (only in this wizard you can add or change the
witness server instance). 
&lt;/li&gt;
&lt;li&gt;
Upon completion of the security wizard and you are still connected to the principle
server click on Start Mirroring.&lt;br&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;
&lt;b&gt;Client Connections (Connection Strings)&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; I am going to assume that you as the reader already know how to
connect to a database in your application code in order to access it.&amp;nbsp; What I'll
cover here are the required key strings needed in the connection string to handle
connecting to both database servers in a mirror session depending on which one is
acting as the principle at the moment.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Just as you would with a normal connection string you need to provide
a initial partner name.&amp;nbsp; This will be the principle server.&amp;nbsp; If you are
usingTCP/IP then enter in the IP, if you are using named pipes then enter in the name
of your server. Additionally, if your SQL Server is using a Instance Name then you
will need to add that as well (example: 10.10.2.1\InstanceName.&amp;nbsp; Now we need
to provide the failover partner.&amp;nbsp; This will be the mirror server.&amp;nbsp; Add this
information similarly as you would for the initial partner name.&lt;br&gt;
&lt;br&gt;
&lt;span&gt;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;/span&gt;The other item you will need to provide in your connection
string is the network attribute.&amp;nbsp; This will specify the network protocol to be
used and ensures that the proper network protocol persists between connections to
different partners. ForTCP/IP use the following: 
&lt;br&gt;
&lt;br&gt;
&lt;div style="margin-left: 40px;"&gt;
&lt;i&gt;Network=dbmssocn;&lt;/i&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Named Pipes use:&lt;br&gt;
&lt;br&gt;
&lt;div style="margin-left: 40px;"&gt;
&lt;i&gt;Network=dbnmpntw;&lt;/i&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Putting it all together in a sample connection string, you
can get &lt;a href="http://msdn.microsoft.com/en-us/library/ms130822.aspx" id="uyt." target="_blank" title="more info on connection string keywords here"&gt;more
info on connection string keywords here&lt;/a&gt;:&lt;br&gt;
&lt;i&gt;
&lt;br&gt;
&lt;/i&gt; 
&lt;div style="margin-left: 40px;"&gt;
&lt;i&gt;Data Source = 10.10.2.10/InstanceName; Failover partner = 10.10.2.11\InstanceName;
Initial Catalog = databaseName; User ID = sa; Password = 12345; Network = dbmssocn;&lt;/i&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;b&gt;Failover&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; There are three types of failover: automatic, manual and forced.&amp;nbsp;
Automatic requires a witness server and the mirror set-up in high-safety mode.&amp;nbsp;
Manual failover does not use a witness server and also requires the mirror set-up
to be in high-safety mode. Forced is usually used because the principle server has
been disconnected somehow.&amp;nbsp; Using forced service may result in data lose as all
transactions may not have made it to the mirrored server.&amp;nbsp; Forced service is
supported on high-availability and high-safety mirrored set-up modes.&lt;br&gt;
&lt;br&gt;
&lt;i&gt;Automatic Failover&lt;/i&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; For automatic failover to occur the following conditions are required:&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
Mirroring sessions must be running high-safety mode and posses a witness server.&lt;br&gt;
&lt;/li&gt;
&lt;li&gt;
The mirror database must be synchronised. 
&lt;/li&gt;
&lt;li&gt;
The principle server has lost communication with the witness and mirror servers but
the witness and mirror server are still online.&amp;nbsp; Note: If all servers lose connectivity
but then the witness and mirror server comes online automatic failover does not occur. 
&lt;/li&gt;
&lt;li&gt;
The mirror server detects the loss of the principle server. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; How it works&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
If the principle server is still online and changes it's state to DISCONNECTED and
disconnects all clients. 
&lt;/li&gt;
&lt;li&gt;
The mirror and witness server both register that the principle server is unavailable. 
&lt;/li&gt;
&lt;li&gt;
The mirror server waits for all logs to be written from the redo queue before rolling
forward the mirror database. 
&lt;/li&gt;
&lt;li&gt;
The former mirror server now moves online to be the principle. Recovery will roll
back any uncommitted transactions, locks isolate those transactions. 
&lt;/li&gt;
&lt;li&gt;
When the former principle server comes back online and sees that the mirror has moved
to principle the former principle server will become the new mirror and start synchronising.
Once synchronising is complete failover is possible again. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
&lt;i&gt;Manual Failover&lt;/i&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; With manual failover it's possible to failover to the mirror server
so that updates and upgrades can be performed on the principle server. Manual failover
requires the mirror set-up to be in high-safety mode (transaction safety set to FULL).
The partners need to be connected and synchronised.&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; How it works:&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
Principle server disconnects, sends the last log message to the mirror and switches
to be the mirror server. 
&lt;/li&gt;
&lt;li&gt;
The mirror server records the last log message as the failover log. 
&lt;/li&gt;
&lt;li&gt;
The mirror server waits for all logs to be written from the redo queue before rolling
forward the mirror database. 
&lt;/li&gt;
&lt;li&gt;
The mirror server becomes the principle server and the principle becomes the new mirror. 
&lt;/li&gt;
&lt;li&gt;
The new mirror server quickly resynchronizes with the new principle server. Once complete
failover is possible again. 
&lt;/li&gt;
&lt;/ul&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Initiate Manual failover:&lt;br&gt;
&lt;br&gt;
&lt;/div&gt;
&lt;ol&gt;
&lt;li&gt;
Connect to the principle server. Choose your database. 
&lt;/li&gt;
&lt;li&gt;
Right-click &amp;gt; Tasks &amp;gt; Mirror; this will bring you to the Mirror tab on the database
properties pop-up. 
&lt;/li&gt;
&lt;li&gt;
Click Failover.&amp;nbsp; Confirm that you want to failover to the mirror server. 
&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;
Note: The client will need to see that the connection to the primary has failed before
it will try to connect to the failover partner.&lt;br&gt;
&lt;br&gt;
&lt;i&gt;Forced Service&lt;/i&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; If the Principle server goes down due to hardware issues or is
unreachable you can use forced service to bring the mirror to principle state.&amp;nbsp;
Doing this may cause data loss as the mirror may not have received all of the transaction
logs from the principle. &lt;a title="Read this Microsoft TechNet article for more information on forced service" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189977.aspx" id="wgqo"&gt;Read
this Microsoft TechNet article for more information on forced service&lt;/a&gt;. 
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp; &amp;nbsp;Initiate Forced Service&lt;br&gt;
&lt;br&gt;
&lt;ol&gt;
&lt;li&gt;
Connect to the mirror server.&lt;/li&gt;
&lt;li&gt;
Run the following T-SQL:&lt;br&gt;
ALTER DATABASE &lt;i&gt;&amp;lt;database_name&amp;gt;&lt;/i&gt; SET PARTNER FORCE_SERVICE_ALLOW_DATA_LOSS&lt;br&gt;
&lt;br&gt;
The mirror will take over as principle and mirroring will be suspended.&lt;/li&gt;
&lt;/ol&gt;
&lt;br&gt;
&lt;b&gt;Summary and Online Resources&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; Database mirroring has many options and ways to be effective in
maintaining a high-availability database.&amp;nbsp; This article is my collected research
as I was learning how to set up mirroring. If you would like more information on setting
up database mirroring please look at the following resources:&lt;br&gt;
&lt;br&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a title="Database Mirroring Overview" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189852.aspx" id="dx3l"&gt;Database
Mirroring Overview&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a title="How to: Configure a Database Mirroring Session (SQL Server Management Studio)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms188712.aspx" id="srk9"&gt;How
to: Configure a Database Mirroring Session (SQL Server Management Studio)&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a title="How to: Add or Replace a Database Mirroring Witness (SQL Server Management Studio)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms365603.aspx" id="z3z0"&gt;How
to: Add or Replace a Database Mirroring Witness (SQL Server Management Studio)&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a title="Making the Initial Connection to a Database Mirroring Session" target="_blank" href="http://msdn.microsoft.com/en-us/library/ms366348.aspx" id="ulmn"&gt;Making
the Initial Connection to a Database Mirroring Session&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a title="Using Connection String Keywords with SQL Server Native Client" target="_blank" href="http://msdn.microsoft.com/en-us/library/ms130822.aspx" id="gevf"&gt;Using
Connection String Keywords with SQL Server Native Client&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a title="Role Switching During a Database Mirroring Session" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189850.aspx" id="c93v"&gt;Role
Switching During a Database Mirroring Session&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a title="Automatic Failover" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189590.aspx" id="apze"&gt;Automatic
Failover&lt;/a&gt;&amp;nbsp;&lt;/li&gt;
&lt;li&gt;
&lt;a title="Manual Failover" target="_blank" href="http://technet.microsoft.com/en-us/library/ms191449.aspx" id="f-zj"&gt;Manual
Failover&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a title="How to: Manually Fail Over a Database Mirroring Session (SQL Server Management Studio)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms186348.aspx" id="q50l"&gt;How
to: Manually Fail Over a Database Mirroring Session (SQL Server Management Studio)&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a title="Forced Service (with Possible Data Loss)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189977.aspx" id="x.eu"&gt;Forced
Service (with Possible Data Loss)&lt;/a&gt; 
&lt;/li&gt;
&lt;li&gt;
&lt;a title="How to: Force Service in a Database Mirroring Session (Transact-SQL)" target="_blank" href="http://technet.microsoft.com/en-us/library/ms189270.aspx" id="n-8w"&gt;How
to: Force Service in a Database Mirroring Session (Transact-SQL)&lt;/a&gt; 
&lt;/li&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;br&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=5e3ca8bd-40d2-4679-90a5-f10430763a57" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,5e3ca8bd-40d2-4679-90a5-f10430763a57.aspx</comments>
      <category>How-to;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=1d6a02d9-22d2-4c29-aa18-f3654ab6fc65</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,1d6a02d9-22d2-4c29-aa18-f3654ab6fc65.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,1d6a02d9-22d2-4c29-aa18-f3654ab6fc65.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=1d6a02d9-22d2-4c29-aa18-f3654ab6fc65</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <p>
Usually, whenever I restore a backup of my database in SQL Server I am presented with
the following error:
</p>
        <blockquote>
          <p>
            <font size="2" color="#ff0000" face="Courier New">Msg 3101, Level 16, State 1, Line
1<br />
Exclusive access could not be obtained because the database is in use.<br />
Msg 3013, Level 16, State 1, Line 1<br />
RESTORE DATABASE is terminating abnormally.</font>
            <br />
          </p>
        </blockquote>
        <p>
Usually, to get around this I just restart the server. This was fine when we were
developing on our local server instance on our development machines. But we have a
few programmers that need to make changes to the database and the logistics of having
everyone script their changes and drop them into Subversion was becoming a nightmare.
Regardless our simple solution was to put it on a shared server in the office and
backup the server occasionally, in case someone screwed up the data. 
<br /></p>
        <p>
Well I screwed up some data and needed to restore. Unfortunately, I have another co-worker
in the office who is working on another project and is using the same database server
(different database) for development. To be nice I'd want to restore without restarting
the SQL Server and possibly disrupting his work.
</p>
        <p>
What I need to do is find all the connection processes to the database and kill them:
</p>
        <blockquote>
          <p>
            <font color="#0000ff">Use Master</font>
            <br />
Go<br /><br /><font color="#0000ff">Declare</font> @dbname <font color="#0000ff">sysname</font><br /><br /><font color="#0000ff">Set</font> @dbname = <font color="#ff0000">'databaseName'</font><br /><br /><font color="#0000ff">Declare</font> @spid <font color="#0000ff">int</font><br /><font color="#0000ff">Select</font> @spid = <font color="#ee82ee">min</font>(spid) <font color="#0000ff">from</font> master.dbo.sysprocesses<br /><font color="#0000ff">where dbid</font> = <font color="#ee82ee">db_id</font>(@dbname)<br /><font color="#0000ff">While</font> @spid <font color="#a9a9a9">Is Not Null</font><br /><font color="#0000ff">Begin</font><br />
        <font color="#0000ff">Execute</font> (<font color="#ff0000">'Kill
'</font> + @spid)<br />
        <font color="#0000ff">Select</font> @spid
= <font color="#ee82ee">min</font>(spid) <font color="#0000ff">from</font> master.dbo.sysprocesses<br />
        <font color="#0000ff">where</font> dbid
= <font color="#ee82ee">db_id</font>(@dbname) and spid &gt; @spid<br /><font color="#0000ff">End</font></p>
        </blockquote>
        <p>
Now I can immediately restore:
</p>
        <blockquote>
          <p>
            <font color="#0000ff">USE Master</font>
            <br />
GO<br /><font color="#0000ff">RESTORE DATABASE</font> [databaseName] 
<br /><font color="#0000ff">FROM  DISK</font> = N<font color="#008000"><font color="#ff0000">'physical
disk path to the backup file.bak'</font> --example path: c:\program files\microsoft
sql server\mssql\backup\databaseName.bak</font><br /><font color="#0000ff">WITH  FILE</font> = 1,  <font color="#0000ff">NOUNLOAD</font>,  <font color="#ee82ee">REPLACE</font>,  <font color="#0000ff">STATS</font> =
10<br />
GO
</p>
        </blockquote>
        <p>
This method works best in a development environment with minimum developer connections.
In production/staging environments refer to your database administrator for best practices.
</p>
        <p>
          <br />
        </p>
        <p>
          <b>Related Links</b>
        </p>
        <p>
          <a href="http://stackoverflow.com/questions/183686/how-to-gain-exclusive-access-to-sql-server-2005-db-to-restore">How
to Gain Exclusive Access to SQL Server 2005 DB to restore?</a>
          <br />
        </p>
        <p>
        </p>
        <img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=1d6a02d9-22d2-4c29-aa18-f3654ab6fc65" />
      </body>
      <title>Gaining Exclusive Access to database in SQL Server 2005 via T-SQL</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,1d6a02d9-22d2-4c29-aa18-f3654ab6fc65.aspx</guid>
      <link>http://ralphwhitbeck.com/2008/10/08/GainingExclusiveAccessToDatabaseInSQLServer2005ViaTSQL.aspx</link>
      <pubDate>Wed, 08 Oct 2008 18:01:06 GMT</pubDate>
      <description>&lt;p&gt;
Usually, whenever I restore a backup of my database in SQL Server I am presented with
the following error:
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
&lt;font size="2" color="#ff0000" face="Courier New"&gt;Msg 3101, Level 16, State 1, Line
1&lt;br&gt;
Exclusive access could not be obtained because the database is in use.&lt;br&gt;
Msg 3013, Level 16, State 1, Line 1&lt;br&gt;
RESTORE DATABASE is terminating abnormally.&lt;/font&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt; 
&lt;p&gt;
Usually, to get around this I just restart the server. This was fine when we were
developing on our local server instance on our development machines. But we have a
few programmers that need to make changes to the database and the logistics of having
everyone script their changes and drop them into Subversion was becoming a nightmare.
Regardless our simple solution was to put it on a shared server in the office and
backup the server occasionally, in case someone screwed up the data. 
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Well I screwed up some data and needed to restore. Unfortunately, I have another co-worker
in the office who is working on another project and is using the same database server
(different database) for development. To be nice I'd want to restore without restarting
the SQL Server and possibly disrupting his work.
&lt;/p&gt;
&lt;p&gt;
What I need to do is find all the connection processes to the database and kill them:
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
&lt;font color="#0000ff"&gt;Use Master&lt;/font&gt;
&lt;br&gt;
Go&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;Declare&lt;/font&gt; @dbname &lt;font color="#0000ff"&gt;sysname&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;Set&lt;/font&gt; @dbname = &lt;font color="#ff0000"&gt;'databaseName'&lt;/font&gt;
&lt;br&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;Declare&lt;/font&gt; @spid &lt;font color="#0000ff"&gt;int&lt;/font&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;Select&lt;/font&gt; @spid = &lt;font color="#ee82ee"&gt;min&lt;/font&gt;(spid) &lt;font color="#0000ff"&gt;from&lt;/font&gt; master.dbo.sysprocesses&lt;br&gt;
&lt;font color="#0000ff"&gt;where dbid&lt;/font&gt; = &lt;font color="#ee82ee"&gt;db_id&lt;/font&gt;(@dbname)&lt;br&gt;
&lt;font color="#0000ff"&gt;While&lt;/font&gt; @spid &lt;font color="#a9a9a9"&gt;Is Not Null&lt;/font&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;Begin&lt;/font&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;Execute&lt;/font&gt; (&lt;font color="#ff0000"&gt;'Kill
'&lt;/font&gt; + @spid)&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;Select&lt;/font&gt; @spid
= &lt;font color="#ee82ee"&gt;min&lt;/font&gt;(spid) &lt;font color="#0000ff"&gt;from&lt;/font&gt; master.dbo.sysprocesses&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font color="#0000ff"&gt;where&lt;/font&gt; dbid
= &lt;font color="#ee82ee"&gt;db_id&lt;/font&gt;(@dbname) and spid &amp;gt; @spid&lt;br&gt;
&lt;font color="#0000ff"&gt;End&lt;/font&gt;
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Now I can immediately restore:
&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;
&lt;font color="#0000ff"&gt;USE Master&lt;/font&gt;
&lt;br&gt;
GO&lt;br&gt;
&lt;font color="#0000ff"&gt;RESTORE DATABASE&lt;/font&gt; [databaseName] 
&lt;br&gt;
&lt;font color="#0000ff"&gt;FROM&amp;nbsp; DISK&lt;/font&gt; = N&lt;font color="#008000"&gt;&lt;font color="#ff0000"&gt;'physical
disk path to the backup file.bak'&lt;/font&gt; --example path: c:\program files\microsoft
sql server\mssql\backup\databaseName.bak&lt;/font&gt;
&lt;br&gt;
&lt;font color="#0000ff"&gt;WITH&amp;nbsp; FILE&lt;/font&gt; = 1,&amp;nbsp; &lt;font color="#0000ff"&gt;NOUNLOAD&lt;/font&gt;,&amp;nbsp; &lt;font color="#ee82ee"&gt;REPLACE&lt;/font&gt;,&amp;nbsp; &lt;font color="#0000ff"&gt;STATS&lt;/font&gt; =
10&lt;br&gt;
GO
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
This method works best in a development environment with minimum developer connections.
In production/staging environments refer to your database administrator for best practices.
&lt;/p&gt;
&lt;p&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Related Links&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://stackoverflow.com/questions/183686/how-to-gain-exclusive-access-to-sql-server-2005-db-to-restore"&gt;How
to Gain Exclusive Access to SQL Server 2005 DB to restore?&lt;/a&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=1d6a02d9-22d2-4c29-aa18-f3654ab6fc65" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,1d6a02d9-22d2-4c29-aa18-f3654ab6fc65.aspx</comments>
      <category>How-to;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=04326ce0-3d4c-4bcd-9d9b-a0f8564ad7b6</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,04326ce0-3d4c-4bcd-9d9b-a0f8564ad7b6.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,04326ce0-3d4c-4bcd-9d9b-a0f8564ad7b6.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=04326ce0-3d4c-4bcd-9d9b-a0f8564ad7b6</wfw:commentRss>
      <slash:comments>2</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <b>UPDATE:</b> Simple Shadow has been set
up on Google Code. <a href="http://code.google.com/p/jquerysimpleshadow/">You can
get the latest here</a>.<br /><br />
We've been researching and trying out javascript shadow solutions for quite sometime.
Our designers are really liking to add subtle dropshadows to elements in their designs. <a href="http://ui.jquery.com/">jQuery
UI</a> had a shadow plugin and it looked promising. I even submitted some bug reports
to help it along. But it's been officially removed from the project for the time being.<br /><br />
We've been using <a href="http://www.ruzee.com/blog/shadedborder/">RUZEE.shadedborder</a> to
handle our shadow needs. It works but adds a lot of undesired div tags to make the
gradient color. But the biggest problem was it was really slow and caused IE to crash
when I had six items on a page RUZZEEIFIED.<br /><br />
I finally gave in and decided to write my own shadow plugin to handle my specific
needs which were to display a shadow of 10px width on the right and bottom sides.
I needed it to be easy as well so it uses graphics to accomplish the shadow.<br /><br />
This will work on any element that has a width and height specified in css. It requires
three image files that are included in the complete zip file below. <a href="http://ralphwhitbeck.com/simpleshadow/test-doc.html">See
demo</a>.<br /><br />
Here is the code to make the shadow:<br /><br /><code class="javascript">$(document).ready(function() { $("div").shadow(); });</code><br /><b><br />
Download</b><br /><br /><b>UPDATE:</b> Simple Shadow has been set up on Google Code. <a href="http://code.google.com/p/jquerysimpleshadow/">You
can get the latest here</a>.<br /><br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=04326ce0-3d4c-4bcd-9d9b-a0f8564ad7b6" /></body>
      <title>jQuery Plugin - Simple Shadow</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,04326ce0-3d4c-4bcd-9d9b-a0f8564ad7b6.aspx</guid>
      <link>http://ralphwhitbeck.com/2008/08/27/jQueryPluginSimpleShadow.aspx</link>
      <pubDate>Wed, 27 Aug 2008 02:08:01 GMT</pubDate>
      <description>&lt;b&gt;UPDATE:&lt;/b&gt; Simple Shadow has been set up on Google Code. &lt;a href="http://code.google.com/p/jquerysimpleshadow/"&gt;You
can get the latest here&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
We've been researching and trying out javascript shadow solutions for quite sometime.
Our designers are really liking to add subtle dropshadows to elements in their designs. &lt;a href="http://ui.jquery.com/"&gt;jQuery
UI&lt;/a&gt; had a shadow plugin and it looked promising. I even submitted some bug reports
to help it along. But it's been officially removed from the project for the time being.&lt;br&gt;
&lt;br&gt;
We've been using &lt;a href="http://www.ruzee.com/blog/shadedborder/"&gt;RUZEE.shadedborder&lt;/a&gt; to
handle our shadow needs. It works but adds a lot of undesired div tags to make the
gradient color. But the biggest problem was it was really slow and caused IE to crash
when I had six items on a page RUZZEEIFIED.&lt;br&gt;
&lt;br&gt;
I finally gave in and decided to write my own shadow plugin to handle my specific
needs which were to display a shadow of 10px width on the right and bottom sides.
I needed it to be easy as well so it uses graphics to accomplish the shadow.&lt;br&gt;
&lt;br&gt;
This will work on any element that has a width and height specified in css. It requires
three image files that are included in the complete zip file below. &lt;a href="http://ralphwhitbeck.com/simpleshadow/test-doc.html"&gt;See
demo&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
Here is the code to make the shadow:&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt;$(document).ready(function() { $("div").shadow(); });&lt;/code&gt;
&lt;br&gt;
&lt;b&gt;
&lt;br&gt;
Download&lt;/b&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;UPDATE:&lt;/b&gt; Simple Shadow has been set up on Google Code. &lt;a href="http://code.google.com/p/jquerysimpleshadow/"&gt;You
can get the latest here&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=04326ce0-3d4c-4bcd-9d9b-a0f8564ad7b6" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,04326ce0-3d4c-4bcd-9d9b-a0f8564ad7b6.aspx</comments>
      <category>How-to;Programming;Simple Shadow;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=bb29c07c-03cf-42c9-9e2c-d4280d471c3b</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,bb29c07c-03cf-42c9-9e2c-d4280d471c3b.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,bb29c07c-03cf-42c9-9e2c-d4280d471c3b.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=bb29c07c-03cf-42c9-9e2c-d4280d471c3b</wfw:commentRss>
      <slash:comments>4</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">I figured out how to easily add a separator
to a inline displayed unordered list of links using jQuery and so I'd thought I share.<br /><br />
So for a list like so:<br /><br /><code class="html"></code><ul class="subnavigation"><br />
    
<li><a href="http://http://ralphwhitbeck.com" ralph="" whitbeck="">Ralph Whitbeck</a></li><br />
    
<li><a href="http://jquery.com">jQuery</a></li><br />
    
<li><a href="http://brandensemble.com">BrandEnsemble</a></li><br /></ul><br /><br />
I wanted it to display like this:<br /><br /><a href="http://ralphwhitbeck.com">Ralph Whitbeck</a> | <a href="http://jquery.com">jQuery</a> | <a href="http://brandensemble.com">BrandEnsemble</a><br /><br />
Notice that the separator (|) is only between the links and not at either the beginning
or end.  I should also note that when I was rendering the list it was coming
from a dynamic source so I didn't have a set list to work from.<br /><br />
I wrote this jQuery:<br /><br /><code class="javascript">$(document).ready(function(){<br />
   $(".subnavigation li:lt(" + ($(".subnavigation li").length - 1) + ")").append("
| "); 
<br />
});</code><br /><br />
So basically I used the <a href="http://docs.jquery.com/Selectors/lt#index">:lt(index)</a> selector
to match against all the matches that were less then the index value.  I do that
by figuring out the <a href="http://docs.jquery.com/Core/length">length</a> of how
many are selected and subtracting one.  Then finally I <a href="http://docs.jquery.com/Manipulation/append#content">append</a> my
selector to all of my matches.<br /><br /><br /><b>Update: </b><a href="http://ejohn.org/">John Resig</a> (creator of jQuery) chimes
in with an easier way to do the same thing in the comments.<br /><br /><code class="javascript">$(document).ready(function(){<br />
   $(".subnavigation li:not(:last-child)").append(" | "); 
<br />
});</code><br /><p>
This works by selecting all the li's except the last child (or the last li) in the
container. This will work with multiple containers on a page if there are more then
one.  Thanks John for the tip.<br /></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=bb29c07c-03cf-42c9-9e2c-d4280d471c3b" /></body>
      <title>Adding link separators to a unordered list using jQuery</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,bb29c07c-03cf-42c9-9e2c-d4280d471c3b.aspx</guid>
      <link>http://ralphwhitbeck.com/2008/07/15/AddingLinkSeparatorsToAUnorderedListUsingJQuery.aspx</link>
      <pubDate>Tue, 15 Jul 2008 03:24:16 GMT</pubDate>
      <description>I figured out how to easily add a separator to a inline displayed unordered list of links using jQuery and so I'd thought I share.&lt;br&gt;
&lt;br&gt;
So for a list like so:&lt;br&gt;
&lt;br&gt;
&lt;code class="html"&gt;&lt;/code&gt;
&lt;ul class="subnavigation"&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;li&gt;
&lt;a href="http://http://ralphwhitbeck.com" ralph="" whitbeck=""&gt;Ralph Whitbeck&lt;/a&gt;
&lt;/li&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;li&gt;
&lt;a href="http://jquery.com"&gt;jQuery&lt;/a&gt;
&lt;/li&gt;
&lt;br&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; 
&lt;li&gt;
&lt;a href="http://brandensemble.com"&gt;BrandEnsemble&lt;/a&gt;
&lt;/li&gt;
&lt;br&gt;
&lt;/ul&gt;
&lt;br&gt;
&lt;br&gt;
I wanted it to display like this:&lt;br&gt;
&lt;br&gt;
&lt;a href="http://ralphwhitbeck.com"&gt;Ralph Whitbeck&lt;/a&gt; | &lt;a href="http://jquery.com"&gt;jQuery&lt;/a&gt; | &lt;a href="http://brandensemble.com"&gt;BrandEnsemble&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
Notice that the separator (|) is only between the links and not at either the beginning
or end.&amp;nbsp; I should also note that when I was rendering the list it was coming
from a dynamic source so I didn't have a set list to work from.&lt;br&gt;
&lt;br&gt;
I wrote this jQuery:&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt;$(document).ready(function(){&lt;br&gt;
&amp;nbsp;&amp;nbsp; $(".subnavigation li:lt(" + ($(".subnavigation li").length - 1) + ")").append("
| "); 
&lt;br&gt;
});&lt;/code&gt;
&lt;br&gt;
&lt;br&gt;
So basically I used the &lt;a href="http://docs.jquery.com/Selectors/lt#index"&gt;:lt(index)&lt;/a&gt; selector
to match against all the matches that were less then the index value.&amp;nbsp; I do that
by figuring out the &lt;a href="http://docs.jquery.com/Core/length"&gt;length&lt;/a&gt; of how
many are selected and subtracting one.&amp;nbsp; Then finally I &lt;a href="http://docs.jquery.com/Manipulation/append#content"&gt;append&lt;/a&gt; my
selector to all of my matches.&lt;br&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Update: &lt;/b&gt;&lt;a href="http://ejohn.org/"&gt;John Resig&lt;/a&gt; (creator of jQuery) chimes
in with an easier way to do the same thing in the comments.&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt;$(document).ready(function(){&lt;br&gt;
&amp;nbsp;&amp;nbsp; $(".subnavigation li:not(:last-child)").append(" | "); 
&lt;br&gt;
});&lt;/code&gt;
&lt;br&gt;
&lt;p&gt;
This works by selecting all the li's except the last child (or the last li) in the
container. This will work with multiple containers on a page if there are more then
one.&amp;nbsp; Thanks John for the tip.&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=bb29c07c-03cf-42c9-9e2c-d4280d471c3b" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,bb29c07c-03cf-42c9-9e2c-d4280d471c3b.aspx</comments>
      <category>How-to;jQuery;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=c3d98d8e-2984-4bb3-a52c-64e325e803b9</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,c3d98d8e-2984-4bb3-a52c-64e325e803b9.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,c3d98d8e-2984-4bb3-a52c-64e325e803b9.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=c3d98d8e-2984-4bb3-a52c-64e325e803b9</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <title>How to target="_blank" a link while keeping it XHTML compliant with jQuery</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,c3d98d8e-2984-4bb3-a52c-64e325e803b9.aspx</guid>
      <link>http://ralphwhitbeck.com/2008/06/29/HowToTargetblankALinkWhileKeepingItXHTMLCompliantWithJQuery.aspx</link>
      <pubDate>Sun, 29 Jun 2008 02:25:09 GMT</pubDate>
      <description>I had to make a bunch of links for a site I am working on for a client
at work open in a new window.  It's not ideal but it was what was
requested.&lt;br&gt;
&lt;br&gt;
So I set up my links like such:&lt;br&gt;
&lt;br&gt;
&lt;code class="html"&gt;&lt;a href="http://ralphwhitbeck.com" target="_blank"&gt;http://ralphwhitbeck.com&lt;/a&gt;&lt;/code&gt;
&lt;p&gt;
I run my page though a HTML validator and am quickly reminded that the target attibute
is not allowed in the XHTML 1.0 Strict standard. I do a quick Google Search and the
first couple of results bring back the following function to make it compliant:
&lt;/p&gt;
&lt;p&gt;
&lt;code class="javascript"&gt;function externalLinks() { 
&lt;br&gt;
if (!document.getElementsByTagName) return; 
&lt;br&gt;
var anchors = document.getElementsByTagName("a"); 
&lt;br&gt;&lt;anchors.length; i++) { &lt;br&gt;
for (var i=0; i var anchor = anchors[i]; 
&lt;br&gt;
if (anchor.getAttribute("href") &amp;&amp; 
&lt;br&gt;
anchor.getAttribute("rel") == "external") 
&lt;br&gt;
anchor.target = "_blank"; 
&lt;br&gt;
} 
&lt;br&gt;
} 
&lt;br&gt;
window.onload = externalLinks;&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
This function expects there to be a rel="external" attribute inside the links you
want to open in a new window.
&lt;/p&gt;
&lt;p&gt;
That function to me looks scary and ugly. jQuery to the rescue.
&lt;/p&gt;
&lt;p&gt;
&lt;code class="javascript"&gt;$(document).ready(function(){&lt;br&gt;
$("a[rel='external']").attr("target","_blank");&lt;br&gt;
});&lt;br&gt;
&lt;/code&gt; 
&lt;/p&gt;
&lt;p&gt;
I was able to shrink all that down to one line of jQuery. And it's a lot easier to
read and more importantly it now makes the document XHTML compliant.
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Note:&lt;/b&gt; I did notice a huge argument/discussion on if this is really truely standards
compliant. As when you take the generated html code and run that through the validator
you still get the same compliance error. While others say that you are separating
the action from the presentation and that satisfies the standard. Thirdly others say
that target was depricated and as such we should never use it because the standards
people think we shouldn't open new windows on people. I don't know whose right or
whose wrong but I did find the discussion interesting. Thoughts?&lt;br&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=c3d98d8e-2984-4bb3-a52c-64e325e803b9" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,c3d98d8e-2984-4bb3-a52c-64e325e803b9.aspx</comments>
      <category>How-to;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=32f03b71-4da8-4653-9044-3a6cca481e0f</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,32f03b71-4da8-4653-9044-3a6cca481e0f.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,32f03b71-4da8-4653-9044-3a6cca481e0f.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=32f03b71-4da8-4653-9044-3a6cca481e0f</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">I wanted to share my first real use of
JSON (JavaScript Object Notation) I created today at work. The reason I find this
exciting is cause I never really understood the use of JSON or how to create and use
it. I found a simple use when I <a title="wrote about pulling in twitter updated into my blog using jQuery and the Twitter API using the JSON data" href="http://ralphwhitbeck.com/2007/11/20/PullingTwitterUpdatesWithJSONAndJQuery.aspx" id="rqmi">wrote
about pulling in twitter updated into my blog using jQuery and the Twitter API using
the JSON data</a>, but I didn't create the JSON and was just consumming it.<br id="gfq10" /><br id="gfq11" />
Well today I was tasked with creating a JavaScript array that could be easily updated
by an administrator of a web site and the data would be used to populate a dropdown
box. Yes there are probably better solutions to populate a dropdown box but this was
what I was tasked with. 
<br id="ne9x0" /><br id="ne9x1" />
Now a year ago, I would have probably created an XML file to hold onto this data but
a recent blog post from <a title="Jeff Atwood over at Coding Horror" href="http://www.codinghorror.com/blog/archives/001114.html" id="nq48">Jeff
Atwood over at Coding Horror</a> made me realize that XML is ugly. From that article
JSON seemed like a cleaner choice.<br id="jca_0" /><br id="jca_1" />
So basically my data needed to hold geographical regions of the US with sections or
cities for each region. Each region/city would have a url associated with it. So in
a separate js file I created this:<br id="d6:00" /><br id="d6:01" /><code class="javascript"> { regions: [<br id="d6:02" />
{<br id="d6:03" />
text: "NorthEast",<br id="d6:04" />
value: "http://ralphwhitbeck.com/northeast",<br id="d6:05" />
sections: [<br id="d6:06" />
{<br id="d6:07" />
text: "New York",<br id="ww5m0" />
value: "http://ralphwhitbeck.com/newyork"<br id="ww5m1" />
},<br id="fmw-0" />
{<br id="d6:07" />
text: "Boston",<br id="ww5m0" />
value: "http://ralphwhitbeck.com/boston"<br id="ww5m1" />
}<br id="q83_0" />
]<br id="d6:011" />
},<br id="wdpp0" />
{<br id="wdpp1" />
text: "South East",<br id="wdpp2" />
value: "http://ralphwhitbeck.com/southeast",<br id="wdpp3" />
sections: [<br id="wdpp4" />
{<br id="wdpp5" />
text: "Orlando",<br id="wdpp6" />
value: "http://ralphwhitbeck.com/southeast"<br id="wdpp7" />
}<br id="wdpp8" />
]<br id="li4_0" />
}<br id="d6:012" /><br id="d6:013" />
]<br id="d6:014" /><br id="d6:015" />
}<br id="dgv30" /><br id="dgv31" /></code> So looking at this you can see that it's very clean and easy to read. We can
see that it's two levels deep and we can see which sections are related to which regions
at a quick glance.<br id="xm1l0" /><br id="xm1l1" />
Now I needed to take this JSON data and consume it and populate a dropdown. I turn
to jQuery to help me out (which was very slow today due to the 1.5 release of the
UI plugin). Here is the code to consume display it:<br id="ydab0" /><br id="ydab1" /><code class="javascript"> $(document).ready(function(){<br id="ydab2" />
$.getJSON("sections.js",function(json){<br id="ydab3" />
$.each(json.regions, function(i,ritem){<br id="u4:u0" />
$("#select_dropdown").append("<option value=" + ritem.value + ">" + ritem.text + "</option>");<br id="zye30" />
$.each(ritem.sections, function(i,sitem){<br id="zye31" />
$("#select_dropdown").append("<option value=" + sitem.value + ">--" + sitem.text +
"</option>");<br id="zye32" />
});<br id="u4:u1" />
});<br id="ydab4" />
});<br id="ydab5" />
});<br id="hqir0" /></code><br id="hqir1" />
This requires a select element on the page with an id of select_dropdown. 
<br /><br />
Download the example code <a href="http://ralphwhitbeck.com/content/binary/JSON_Example-DamnRalph.zip">JSON_Example-DamnRalph.zip
(1.24 KB)</a><br /><br /><b>Update:</b> So an interesting problem came up at work today where we needed to
validate the JSON because the data we entered had a syntax error (we figure this was
the case cause it wasn't working as expected) and so we needed a validator to validate
the JSON data. Unfortunately the way we are consumming the JSON if it tries to parse
it and it's not valid then the user doesn't get an error (is this the desired choice
in jQuery's getJSON method?) so there is no feedback to what the sytax problem might
be. We found this online <a href="http://www.jsonlint.com/">JSON Validator</a> that
worked to help us identify the syntax errors.<br /><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=32f03b71-4da8-4653-9044-3a6cca481e0f" /></body>
      <title>My first JSON Implementation</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,32f03b71-4da8-4653-9044-3a6cca481e0f.aspx</guid>
      <link>http://ralphwhitbeck.com/2008/06/10/MyFirstJSONImplementation.aspx</link>
      <pubDate>Tue, 10 Jun 2008 01:09:13 GMT</pubDate>
      <description>I wanted to share my first real use of JSON (JavaScript Object
Notation) I created today at work.  The reason I find this exciting is
cause I never really understood the use of JSON or how to create and
use it.  I found a simple use when I &lt;a title="wrote about pulling in twitter updated into my blog using jQuery and the Twitter API using the JSON data" href="http://ralphwhitbeck.com/2007/11/20/PullingTwitterUpdatesWithJSONAndJQuery.aspx" id="rqmi"&gt;wrote
about pulling in twitter updated into my blog using jQuery and the Twitter API using
the JSON data&lt;/a&gt;, but I didn't create the JSON and was just consumming it.&lt;br id="gfq10"&gt;
&lt;br id="gfq11"&gt;
Well today I was tasked with creating a JavaScript array that could be easily updated
by an administrator of a web site and the data would be used to populate a dropdown
box. Yes there are probably better solutions to populate a dropdown box but this was
what I was tasked with. 
&lt;br id="ne9x0"&gt;
&lt;br id="ne9x1"&gt;
Now a year ago, I would have probably created an XML file to hold onto this data but
a recent blog post from &lt;a title="Jeff Atwood over at Coding Horror" href="http://www.codinghorror.com/blog/archives/001114.html" id="nq48"&gt;Jeff
Atwood over at Coding Horror&lt;/a&gt; made me realize that XML is ugly. From that article
JSON seemed like a cleaner choice.&lt;br id="jca_0"&gt;
&lt;br id="jca_1"&gt;
So basically my data needed to hold geographical regions of the US with sections or
cities for each region. Each region/city would have a url associated with it. So in
a separate js file I created this:&lt;br id="d6:00"&gt;
&lt;br id="d6:01"&gt;
&lt;code class="javascript"&gt; { regions: [&lt;br id="d6:02"&gt;
{&lt;br id="d6:03"&gt;
text: "NorthEast",&lt;br id="d6:04"&gt;
value: "http://ralphwhitbeck.com/northeast",&lt;br id="d6:05"&gt;
sections: [&lt;br id="d6:06"&gt;
{&lt;br id="d6:07"&gt;
text: "New York",&lt;br id="ww5m0"&gt;
value: "http://ralphwhitbeck.com/newyork"&lt;br id="ww5m1"&gt;
},&lt;br id="fmw-0"&gt;
{&lt;br id="d6:07"&gt;
text: "Boston",&lt;br id="ww5m0"&gt;
value: "http://ralphwhitbeck.com/boston"&lt;br id="ww5m1"&gt;
}&lt;br id="q83_0"&gt;
]&lt;br id="d6:011"&gt;
},&lt;br id="wdpp0"&gt;
{&lt;br id="wdpp1"&gt;
text: "South East",&lt;br id="wdpp2"&gt;
value: "http://ralphwhitbeck.com/southeast",&lt;br id="wdpp3"&gt;
sections: [&lt;br id="wdpp4"&gt;
{&lt;br id="wdpp5"&gt;
text: "Orlando",&lt;br id="wdpp6"&gt;
value: "http://ralphwhitbeck.com/southeast"&lt;br id="wdpp7"&gt;
}&lt;br id="wdpp8"&gt;
]&lt;br id="li4_0"&gt;
}&lt;br id="d6:012"&gt;
&lt;br id="d6:013"&gt;
]&lt;br id="d6:014"&gt;
&lt;br id="d6:015"&gt;
}&lt;br id="dgv30"&gt;
&lt;br id="dgv31"&gt;
&lt;/code&gt; So looking at this you can see that it's very clean and easy to read. We can
see that it's two levels deep and we can see which sections are related to which regions
at a quick glance.&lt;br id="xm1l0"&gt;
&lt;br id="xm1l1"&gt;
Now I needed to take this JSON data and consume it and populate a dropdown. I turn
to jQuery to help me out (which was very slow today due to the 1.5 release of the
UI plugin). Here is the code to consume display it:&lt;br id="ydab0"&gt;
&lt;br id="ydab1"&gt;
&lt;code class="javascript"&gt; $(document).ready(function(){&lt;br id="ydab2"&gt;
$.getJSON("sections.js",function(json){&lt;br id="ydab3"&gt;
$.each(json.regions, function(i,ritem){&lt;br id="u4:u0"&gt;
$("#select_dropdown").append("&lt;option value=" + ritem.value + "&gt;" + ritem.text + "&lt;/option&gt;");&lt;br id="zye30"&gt;
$.each(ritem.sections, function(i,sitem){&lt;br id="zye31"&gt;
$("#select_dropdown").append("&lt;option value=" + sitem.value + "&gt;--" + sitem.text +
"&lt;/option&gt;");&lt;br id="zye32"&gt;
});&lt;br id="u4:u1"&gt;
});&lt;br id="ydab4"&gt;
});&lt;br id="ydab5"&gt;
});&lt;br id="hqir0"&gt;
&lt;/code&gt; 
&lt;br id="hqir1"&gt;
This requires a select element on the page with an id of select_dropdown. 
&lt;br&gt;
&lt;br&gt;
Download the example code &lt;a href="http://ralphwhitbeck.com/content/binary/JSON_Example-DamnRalph.zip"&gt;JSON_Example-DamnRalph.zip
(1.24 KB)&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;b&gt;Update:&lt;/b&gt; So an interesting problem came up at work today where we needed to
validate the JSON because the data we entered had a syntax error (we figure this was
the case cause it wasn't working as expected) and so we needed a validator to validate
the JSON data. Unfortunately the way we are consumming the JSON if it tries to parse
it and it's not valid then the user doesn't get an error (is this the desired choice
in jQuery's getJSON method?) so there is no feedback to what the sytax problem might
be. We found this online &lt;a href="http://www.jsonlint.com/"&gt;JSON Validator&lt;/a&gt; that
worked to help us identify the syntax errors.&lt;br&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=32f03b71-4da8-4653-9044-3a6cca481e0f" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,32f03b71-4da8-4653-9044-3a6cca481e0f.aspx</comments>
      <category>How-to;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=59798f12-3f21-4b31-a376-24b0ebdf7bb7</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,59798f12-3f21-4b31-a376-24b0ebdf7bb7.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,59798f12-3f21-4b31-a376-24b0ebdf7bb7.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=59798f12-3f21-4b31-a376-24b0ebdf7bb7</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <title>Gary Vaynerchuk @ Tech Cocktail Chicago</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,59798f12-3f21-4b31-a376-24b0ebdf7bb7.aspx</guid>
      <link>http://ralphwhitbeck.com/2008/05/30/GaryVaynerchukTechCocktailChicago.aspx</link>
      <pubDate>Fri, 30 May 2008 01:56:23 GMT</pubDate>
      <description>&lt;a href="http://twitpic.com/1m5r"&gt;&lt;img src="http://ralphwhitbeck.com/content/binary/1m5r-a6f3af1c49fb26e2ff949afcde5497cf.483f6112.jpg" align="left" border="0" hspace="4" vspace="4" width="250"&gt;&lt;/a&gt;&lt;a href="http://techcocktail.com/home/tech-cocktail-conference/"&gt;TECH
cocktail&lt;/a&gt;, a community building startup founded in May 2006 by Frank Gruber and
Eric Olson, offers events and community-powered projects open to bloggers, technology
enthusiasts, entrepreneurs &amp; professionals interested in technology in under served
technology communities.&lt;br&gt;
&lt;br&gt;
Today, Loyola University hosted a bunch of speakers the one I was most interested
in hearing was &lt;a href="http://garyvaynerchuk.com/"&gt;Gary Vaynerchuk&lt;/a&gt; of &lt;a href="http://tv.winelibrary.com/"&gt;Wine
Library TV&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
I found a short summary of the talk from &lt;a href="http://www.timcourtney.net/2008/05/29/highlights-from-the-first-tech-cocktail-conference-in-chicago/"&gt;Tim
Courtney&lt;/a&gt;:&lt;br&gt;
&lt;br&gt;
&lt;blockquote&gt;&lt;a href="http://www.garyvaynerchuk.com" target="_blank"&gt;Gary Vaynerchuk&lt;/a&gt; said
definitively on community, “It’s irrelevant whether you’re a traditional business
or a new media business, it’s all about the community. The community is the entire
thing you should care about 24/7/365. What you need to become is a rat. Real, Authentic,
and Transparent. Because you can’t hide anymore, everything you do is documented.” &lt;strong&gt;The
core of his message is that people, marketers, companies, everyone — needs to be real
with their audience or they will be exposed and leave open a vulnerability for smaller
players &lt;em&gt;who are authentic&lt;/em&gt; to come up and usurp your leadership position.&lt;/strong&gt; My
thoughts: Your character is who you are when no one is watching. Gary observes that
the times when “no one is watching” are getting fewer and fewer as people adopt social
tools. This doesn’t make character any more important, but your actions are becoming
far more public so character flaws and inauthenticity is now more exposed.&lt;br&gt;
&lt;br&gt;
&lt;/blockquote&gt;But more importantly qik user &lt;a href="http://qik.com/bryanthatcher"&gt;bryanthatcher&lt;/a&gt; streamed
it for us. The sound quality is poor but you can still make out most of what he is
saying.&lt;br&gt;
&lt;br&gt;
&lt;object height="280" width="320"&gt;
&lt;param name="movie" value="http://qik.com/player.swf?streamname=4fe362a565c04387982425747119c576&amp;vid=89681&amp;playback=false&amp;polling=false&amp;user=bryanthatcher&amp;userlock=true&amp;islive=&amp;username=anonymous"&gt;
&lt;param name="wmode" value="transparent"&gt;
&lt;param name="allowScriptAccess" value="always"&gt;&lt;embed src="http://qik.com/player.swf?streamname=4fe362a565c04387982425747119c576&amp;vid=89681&amp;playback=false&amp;polling=false&amp;user=bryanthatcher&amp;userlock=true&amp;islive=&amp;username=anonymous" type="application/x-shockwave-flash" wmode="transparent" allowscriptaccess="always" height="280" width="320"&gt;
&lt;/object&gt;
&lt;br&gt;
&lt;br&gt;
&lt;i&gt;(image from twitpic user &lt;a href="http://twitpic.com/photos/timcourtney"&gt;timcourtney&lt;/a&gt;)&lt;/i&gt;&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=59798f12-3f21-4b31-a376-24b0ebdf7bb7" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,59798f12-3f21-4b31-a376-24b0ebdf7bb7.aspx</comments>
      <category>Entertainment;How-to</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=cd8e241c-11d1-43ff-9557-70fab698ea1f</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,cd8e241c-11d1-43ff-9557-70fab698ea1f.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,cd8e241c-11d1-43ff-9557-70fab698ea1f.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=cd8e241c-11d1-43ff-9557-70fab698ea1f</wfw:commentRss>
      <slash:comments>14</slash:comments>
      <title>Pulling twitter updates with JSON and jQuery</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,cd8e241c-11d1-43ff-9557-70fab698ea1f.aspx</guid>
      <link>http://ralphwhitbeck.com/2007/11/20/PullingTwitterUpdatesWithJSONAndJQuery.aspx</link>
      <pubDate>Tue, 20 Nov 2007 03:32:15 GMT</pubDate>
      <description>I wrote a little script tonight to pull in my latest 3 tweets from twitter and display them on my blog.  You can see it in action on the right.&lt;br&gt;
&lt;br&gt;
Here is how I did it. I used the Twitter's API and called my timeline with a JSON
call and comsummed it with jQuery and outputted it to a blank div.&lt;br&gt;
&lt;br&gt;
&lt;code class="javascript"&gt; var url = "http://twitter.com/status/user_timeline/RedWolves.json?count=3&amp;callback=?";
$.getJSON(url, function(data){ $.each(data, function(i, item) { $("img#profile").attr("src",
item.user["profile_image_url"]); $("#tweets ul").append("&lt;li&gt;
" + item.text.linkify() + " &lt;span class='created_at'&gt;" + relative_time(item.created_at)
+ " via " + item.source + "&lt;/span&gt;
&lt;/li&gt;"); }); }); &lt;/code&gt;
&lt;p&gt;
Basically what this does is pulls in the data from twitter and makes them available
as objects. I then loop through each item and pull out the data I want and write it
out to a unordered list. &lt;b&gt;Update:&lt;/b&gt; &lt;i&gt;make sure to look at the complete working
example below as it has the two functions this code block is using (linkify and relative_time)
to transform the JSON data into how I'd like it to look.&lt;/i&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;p&gt;
Here is the HTML stub it's going to:&lt;br&gt;
&lt;br&gt;
&lt;code class="html"&gt; 
&lt;div id="tweets"&gt;
&lt;img id="profile"&gt; 
&lt;ul&gt;
&lt;/ul&gt;
&lt;/div&gt;
&lt;/code&gt;
&lt;/p&gt;
&lt;p&gt;
You can download a working example here: &lt;a href="http://ralphwhitbeck.com/content/binary/twitter-json-jquery.html"&gt;twitter-json-jquery.html
(1.79 KB)&lt;/a&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=cd8e241c-11d1-43ff-9557-70fab698ea1f" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,cd8e241c-11d1-43ff-9557-70fab698ea1f.aspx</comments>
      <category>How-to;Programming</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=ef3661a9-f3ee-44fa-b6ef-2f56c17932f6</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,ef3661a9-f3ee-44fa-b6ef-2f56c17932f6.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,ef3661a9-f3ee-44fa-b6ef-2f56c17932f6.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=ef3661a9-f3ee-44fa-b6ef-2f56c17932f6</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">Sometimes in VS.NET 2005 the codebehind
for the aspx file show up in the solution explorer not connected.<br /><p>
To Solve this problem: 
</p><ol><li>
Close Visual Studio 
</li><li>
Open up the proj file with a text/XML editor. 
</li><li>
Scroll down till you find the &lt;EmbeddedResource&gt; section. 
</li><li>
Find around where you need to enter in a new resource in relation to the file you're
having issues with. 
</li><li>
add this for each file except the aspx file: 
</li></ol><pre>    &lt;EmbeddedResource Include="Admin\Author\MassUpload\upload.aspx.cs"&gt;<br />
&lt;DependentUpon&gt;upload.aspx&lt;/DependentUpon&gt;<br />
&lt;/EmbeddedResource&gt;<br />
&lt;EmbeddedResource Include="Admin\Author\MassUpload\upload.aspx.resx"&gt;<br />
&lt;DependentUpon&gt;upload.aspx.cs&lt;/DependentUpon&gt;<br />
&lt;/EmbeddedResource&gt;<br /><br /></pre><p><b>Related Links</b></p><p><a href="http://www.thescripts.com/forum/thread538321.html">Form &amp; Designer File
Becoming Separated</a><br /></p><br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=ef3661a9-f3ee-44fa-b6ef-2f56c17932f6" /></body>
      <title>VS.NET IDE Issue - ASPX gets separated from codebehind</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,ef3661a9-f3ee-44fa-b6ef-2f56c17932f6.aspx</guid>
      <link>http://ralphwhitbeck.com/2007/11/05/VSNETIDEIssueASPXGetsSeparatedFromCodebehind.aspx</link>
      <pubDate>Mon, 05 Nov 2007 21:05:23 GMT</pubDate>
      <description>Sometimes in VS.NET 2005 the codebehind for the aspx file show up in the solution explorer not connected.&lt;br&gt;
&lt;p&gt;
To Solve this problem: 
&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;
Close Visual Studio 
&lt;/li&gt;
&lt;li&gt;
Open up the proj file with a text/XML editor. 
&lt;/li&gt;
&lt;li&gt;
Scroll down till you find the &amp;lt;EmbeddedResource&amp;gt; section. 
&lt;/li&gt;
&lt;li&gt;
Find around where you need to enter in a new resource in relation to the file you're
having issues with. 
&lt;/li&gt;
&lt;li&gt;
add this for each file except the aspx file: 
&lt;/li&gt;
&lt;/ol&gt;
&lt;pre&gt;    &amp;lt;EmbeddedResource Include="Admin\Author\MassUpload\upload.aspx.cs"&amp;gt;&lt;br&gt;
&amp;lt;DependentUpon&amp;gt;upload.aspx&amp;lt;/DependentUpon&amp;gt;&lt;br&gt;
&amp;lt;/EmbeddedResource&amp;gt;&lt;br&gt;
&amp;lt;EmbeddedResource Include="Admin\Author\MassUpload\upload.aspx.resx"&amp;gt;&lt;br&gt;
&amp;lt;DependentUpon&amp;gt;upload.aspx.cs&amp;lt;/DependentUpon&amp;gt;&lt;br&gt;
&amp;lt;/EmbeddedResource&amp;gt;&lt;br&gt;
&lt;br&gt;
&lt;/pre&gt;
&lt;p&gt;
&lt;b&gt;Related Links&lt;/b&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;a href="http://www.thescripts.com/forum/thread538321.html"&gt;Form &amp;amp; Designer File
Becoming Separated&lt;/a&gt;
&lt;br&gt;
&lt;/p&gt;
&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=ef3661a9-f3ee-44fa-b6ef-2f56c17932f6" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,ef3661a9-f3ee-44fa-b6ef-2f56c17932f6.aspx</comments>
      <category>How-to;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=db5ed8e7-cab1-43f4-a8e3-6c19eb4ccf82</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,db5ed8e7-cab1-43f4-a8e3-6c19eb4ccf82.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,db5ed8e7-cab1-43f4-a8e3-6c19eb4ccf82.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=db5ed8e7-cab1-43f4-a8e3-6c19eb4ccf82</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <img src="http://ralphwhitbeck.com/content/binary/rails_logo.gif" align="left" border="0" />I
installed Ruby on Rails,I think ;), on a VMWare Server installation of Ubuntu 7.10
using the following tutorials.<br /><br />
To install VMWare Server and Ubuntu: <a href="http://cmsproducer.com/Ubuntu-Linux-Windows-VMware-Server">http://cmsproducer.com/Ubuntu-Linux-Windows-VMware-Server</a><br /><br />
To install Ruby on Rails on Ubuntu: <a href="http://paulgoscicki.com/archives/2005/09/ruby-on-rails-on-ubuntu/">http://paulgoscicki.com/archives/2005/09/ruby-on-rails-on-ubuntu/</a><br /><br />
Total installation time took me about two hours from the start of downloading Ubuntu
to finishing the last step.<br /><br />
Now let's see if I can figure out how to program Ruby on Rails.<br /><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=db5ed8e7-cab1-43f4-a8e3-6c19eb4ccf82" /></body>
      <title>Installing Rails on Ubuntu using VMWare Server</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,db5ed8e7-cab1-43f4-a8e3-6c19eb4ccf82.aspx</guid>
      <link>http://ralphwhitbeck.com/2007/10/28/InstallingRailsOnUbuntuUsingVMWareServer.aspx</link>
      <pubDate>Sun, 28 Oct 2007 00:48:36 GMT</pubDate>
      <description>&lt;img src="http://ralphwhitbeck.com/content/binary/rails_logo.gif" align="left" border="0"&gt;I
installed Ruby on Rails,I think ;), on a VMWare Server installation of Ubuntu 7.10
using the following tutorials.&lt;br&gt;
&lt;br&gt;
To install VMWare Server and Ubuntu: &lt;a href="http://cmsproducer.com/Ubuntu-Linux-Windows-VMware-Server"&gt;http://cmsproducer.com/Ubuntu-Linux-Windows-VMware-Server&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
To install Ruby on Rails on Ubuntu: &lt;a href="http://paulgoscicki.com/archives/2005/09/ruby-on-rails-on-ubuntu/"&gt;http://paulgoscicki.com/archives/2005/09/ruby-on-rails-on-ubuntu/&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
Total installation time took me about two hours from the start of downloading Ubuntu
to finishing the last step.&lt;br&gt;
&lt;br&gt;
Now let's see if I can figure out how to program Ruby on Rails.&lt;br&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=db5ed8e7-cab1-43f4-a8e3-6c19eb4ccf82" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,db5ed8e7-cab1-43f4-a8e3-6c19eb4ccf82.aspx</comments>
      <category>How-to;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=124900f7-ff10-4813-af32-f26288dc8ab1</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,124900f7-ff10-4813-af32-f26288dc8ab1.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,124900f7-ff10-4813-af32-f26288dc8ab1.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=124900f7-ff10-4813-af32-f26288dc8ab1</wfw:commentRss>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <a href="http://weblogs.asp.net/lkempe/archive/2007/10/11/testing-your-google-adsense.aspx">Laurent
Kempé</a> writes:<br /><blockquote><p>
If you are developing a site containing <a href="http://www.google.com/adsense/" target="_blank">Google
Adsense</a> you might know that clicking on your own ad is not allowed.
</p><p>
To be able to test and click on your own ad and still follow <a href="https://www.google.com/adsense/support/bin/answer.py?answer=48182&amp;sourceid=aso&amp;subid=ww-ww-et-asui&amp;medium=link" target="_blank">Google
AdSense Program Policies</a>, just add following to your pages: 
</p><p><span style="color: rgb(0, 0, 255);">&lt;</span><span style="color: rgb(128, 0, 0);">script</span><span style="color: rgb(255, 0, 0);">type</span>=<span style="color: rgb(0, 0, 255);">"text/javascript"</span><span style="color: rgb(0, 0, 255);">&gt;</span><strong>google_adtest</strong> =
'on';<span style="color: rgb(0, 0, 255);">&lt;/</span><span style="color: rgb(128, 0, 0);">script</span><span style="color: rgb(0, 0, 255);">&gt;</span></p><p>
Don't forget to remove it on your production server! ;)
</p></blockquote><p>
That's cool! The biggest worry of any Google Adsense participant is getting dropped
from the program for clicking on your own links.<br /><span style="color: rgb(0, 0, 255);"></span></p><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=124900f7-ff10-4813-af32-f26288dc8ab1" /></body>
      <title>Click on your own Google Adsense links without breaking policy</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,124900f7-ff10-4813-af32-f26288dc8ab1.aspx</guid>
      <link>http://ralphwhitbeck.com/2007/10/12/ClickOnYourOwnGoogleAdsenseLinksWithoutBreakingPolicy.aspx</link>
      <pubDate>Fri, 12 Oct 2007 00:15:08 GMT</pubDate>
      <description>&lt;a href="http://weblogs.asp.net/lkempe/archive/2007/10/11/testing-your-google-adsense.aspx"&gt;Laurent
Kempé&lt;/a&gt; writes:&lt;br&gt;
&lt;blockquote&gt;
&lt;p&gt;
If you are developing a site containing &lt;a href="http://www.google.com/adsense/" target="_blank"&gt;Google
Adsense&lt;/a&gt; you might know that clicking on your own ad is not allowed.
&lt;/p&gt;
&lt;p&gt;
To be able to test and click on your own ad and still follow &lt;a href="https://www.google.com/adsense/support/bin/answer.py?answer=48182&amp;amp;sourceid=aso&amp;amp;subid=ww-ww-et-asui&amp;amp;medium=link" target="_blank"&gt;Google
AdSense Program Policies&lt;/a&gt;, just add following to your pages: 
&lt;/p&gt;
&lt;p&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;script&lt;/span&gt; &lt;span style="color: rgb(255, 0, 0);"&gt;type&lt;/span&gt;=&lt;span style="color: rgb(0, 0, 255);"&gt;"text/javascript"&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;&lt;strong&gt;google_adtest&lt;/strong&gt; =
'on';&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;lt;/&lt;/span&gt;&lt;span style="color: rgb(128, 0, 0);"&gt;script&lt;/span&gt;&lt;span style="color: rgb(0, 0, 255);"&gt;&amp;gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
Don't forget to remove it on your production server! ;)
&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;
That's cool! The biggest worry of any Google Adsense participant is getting dropped
from the program for clicking on your own links.&lt;br&gt;
&lt;span style="color: rgb(0, 0, 255);"&gt;&lt;/span&gt;
&lt;/p&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=124900f7-ff10-4813-af32-f26288dc8ab1" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,124900f7-ff10-4813-af32-f26288dc8ab1.aspx</comments>
      <category>How-to;Interesting Links;Programming;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=4ab62f8b-c0bc-4b3e-a965-3033d0d5e018</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,4ab62f8b-c0bc-4b3e-a965-3033d0d5e018.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,4ab62f8b-c0bc-4b3e-a965-3033d0d5e018.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=4ab62f8b-c0bc-4b3e-a965-3033d0d5e018</wfw:commentRss>
      <slash:comments>20</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">
        <h2>Symptoms
</h2>
        <p>
On starting the computer the computers internet access will work normally for a short
period of time. Then access to normal websites will be down. Access to https sites,
internet application such as instant messaging and e-mail are still accessible. 
</p>
        <a name="Cause">
        </a>
        <h2>Cause
</h2>
        <p>
Uninstalling Cisco VPN 4.0 client doesn't fully uninstall hidden Zone Alarm Firewall
which causes a block in port 80 on the computer. 
</p>
        <a name="Resolution">
        </a>
        <h2>Resolution
</h2>
        <p>
Cisco VPN client version 4.0 includes firewall functionality from Zone Labs Inc. It
is possible that a failed Zone Labs uninstall left an incorrect value in the systems
registry and must be changed. To resolve the problem follow these steps. 
</p>
        <p>
          <b>Caution</b>
          <i>This procedure contains information about editing the registry.
Before you edit the registry, make sure you understand how to restore it if a problem
occurs.</i>
        </p>
        <p>
          <b>Step 1</b> Restart the computer and when your computer screen displays the startup
message like "Starting Windows..." and a progress bar at the bottom of the screen,
press the F8 key on the keyboard. This should display an advanced options screen. 
</p>
        <p>
          <b>Step 2</b> At the advanced options screen select "Safe Mode" as a startup method. 
</p>
        <p>
          <b>Step 3</b> If prompted, login to the PC once it is booted (you must have Administrator
rights to login in Safe Mode). 
</p>
        <p>
          <b>Step 4</b> Click Start &gt; Run and type "regedit" in the Open: box (without the
quotes) and click OK. This launches the Windows registry editor. 
</p>
        <p>
          <b>Step 5</b> In the registry editor, browse to the following path: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\vsdatant
and select the Start parameter in the right pane. 
</p>
        <p>
          <b>Step 6</b> Right-click Start and select Modify. In the Value data: field enter
the number 3. 
</p>
        <p>
          <b>Step 7</b> Click OK and exit the registry editor. 
</p>
        <p>
          <b>Step 8</b> Restart the computer and boot normally; the problem should be resolved. 
</p>
        <a name="Related_Links">
        </a>
        <h2>Related Links
</h2>
        <a href="http://www.cisco.com/univercd/cc/td/doc/product/vpn/client/rel401/401_clnt.htm#wp1237870" class="external" title="http://www.cisco.com/univercd/cc/td/doc/product/vpn/client/rel401/401 clnt.htm#wp1237870" rel="nofollow">Release
Notes for VPN Client, Release 4.0.1</a>
        <br />
        <br />
        <h2>Author notes
</h2>
        <br />
I spent a considerate amount of time looking for a resolution to this problem..I post
it up here in hopes that it helps someone else a little easier.  If it helps
you please post a comment to let me know.<br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=4ab62f8b-c0bc-4b3e-a965-3033d0d5e018" /></body>
      <title>Uninstalling Cisco VPN client kills internet access</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,4ab62f8b-c0bc-4b3e-a965-3033d0d5e018.aspx</guid>
      <link>http://ralphwhitbeck.com/2007/07/10/UninstallingCiscoVPNClientKillsInternetAccess.aspx</link>
      <pubDate>Tue, 10 Jul 2007 18:03:39 GMT</pubDate>
      <description>&lt;h2&gt;Symptoms
&lt;/h2&gt;
&lt;p&gt;
On starting the computer the computers internet access will work normally for a short
period of time. Then access to normal websites will be down. Access to https sites,
internet application such as instant messaging and e-mail are still accessible. 
&lt;/p&gt;
&lt;a name="Cause"&gt;&lt;/a&gt;
&lt;h2&gt;Cause
&lt;/h2&gt;
&lt;p&gt;
Uninstalling Cisco VPN 4.0 client doesn't fully uninstall hidden Zone Alarm Firewall
which causes a block in port 80 on the computer. 
&lt;/p&gt;
&lt;a name="Resolution"&gt;&lt;/a&gt;
&lt;h2&gt;Resolution
&lt;/h2&gt;
&lt;p&gt;
Cisco VPN client version 4.0 includes firewall functionality from Zone Labs Inc. It
is possible that a failed Zone Labs uninstall left an incorrect value in the systems
registry and must be changed. To resolve the problem follow these steps. 
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Caution&lt;/b&gt; &lt;i&gt;This procedure contains information about editing the registry.
Before you edit the registry, make sure you understand how to restore it if a problem
occurs.&lt;/i&gt; 
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Step 1&lt;/b&gt; Restart the computer and when your computer screen displays the startup
message like "Starting Windows..." and a progress bar at the bottom of the screen,
press the F8 key on the keyboard. This should display an advanced options screen. 
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Step 2&lt;/b&gt; At the advanced options screen select "Safe Mode" as a startup method. 
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Step 3&lt;/b&gt; If prompted, login to the PC once it is booted (you must have Administrator
rights to login in Safe Mode). 
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Step 4&lt;/b&gt; Click Start &amp;gt; Run and type "regedit" in the Open: box (without the
quotes) and click OK. This launches the Windows registry editor. 
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Step 5&lt;/b&gt; In the registry editor, browse to the following path: HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\vsdatant
and select the Start parameter in the right pane. 
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Step 6&lt;/b&gt; Right-click Start and select Modify. In the Value data: field enter
the number 3. 
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Step 7&lt;/b&gt; Click OK and exit the registry editor. 
&lt;/p&gt;
&lt;p&gt;
&lt;b&gt;Step 8&lt;/b&gt; Restart the computer and boot normally; the problem should be resolved. 
&lt;/p&gt;
&lt;a name="Related_Links"&gt;&lt;/a&gt;
&lt;h2&gt;Related Links
&lt;/h2&gt;
&lt;a href="http://www.cisco.com/univercd/cc/td/doc/product/vpn/client/rel401/401_clnt.htm#wp1237870" class="external" title="http://www.cisco.com/univercd/cc/td/doc/product/vpn/client/rel401/401 clnt.htm#wp1237870" rel="nofollow"&gt;Release
Notes for VPN Client, Release 4.0.1&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
&lt;h2&gt;Author notes
&lt;/h2&gt;
&lt;br&gt;
I spent a considerate amount of time looking for a resolution to this problem..I post
it up here in hopes that it helps someone else a little easier.&amp;nbsp; If it helps
you please post a comment to let me know.&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=4ab62f8b-c0bc-4b3e-a965-3033d0d5e018" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,4ab62f8b-c0bc-4b3e-a965-3033d0d5e018.aspx</comments>
      <category>How-to;Technology</category>
    </item>
    <item>
      <trackback:ping>http://ralphwhitbeck.com/Trackback.aspx?guid=16bc5844-75e2-4c84-97d3-f718c0911afe</trackback:ping>
      <pingback:server>http://ralphwhitbeck.com/pingback.aspx</pingback:server>
      <pingback:target>http://ralphwhitbeck.com/PermaLink,guid,16bc5844-75e2-4c84-97d3-f718c0911afe.aspx</pingback:target>
      <dc:creator>Ralph Whitbeck</dc:creator>
      <wfw:comment>http://ralphwhitbeck.com/CommentView,guid,16bc5844-75e2-4c84-97d3-f718c0911afe.aspx</wfw:comment>
      <wfw:commentRss>http://ralphwhitbeck.com/SyndicationService.asmx/GetEntryCommentsRss?guid=16bc5844-75e2-4c84-97d3-f718c0911afe</wfw:commentRss>
      <slash:comments>1</slash:comments>
      <body xmlns="http://www.w3.org/1999/xhtml">My brakes started grinding this week so
I needed to get that fixed...I bought the parts Brake pads and rotors and went over
to my cousins house and he helped my put them on....I swear to god it was so easy...I
am going to do it myself next time.<br /><br />
I found instructions online for my type of brakes so I can do it next time.<br /><br /><a href="http://www.2carpros.com/how_to/how_to_replace_brakes.htm">http://www.2carpros.com/how_to/how_to_replace_brakes.htm</a><br /><br />
tools I'll need to get the job done:<br /><br />
14 mm socket<br />
18 mm socket<br />
C-Clamp<br />
Mallet or hammer (in case the bolts are tight)<br />
Jack 
<br />
Brake pads<br />
Rotors (if worn)<br /><p></p><img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=16bc5844-75e2-4c84-97d3-f718c0911afe" /></body>
      <title>Brakes and Rotors</title>
      <guid isPermaLink="false">http://ralphwhitbeck.com/PermaLink,guid,16bc5844-75e2-4c84-97d3-f718c0911afe.aspx</guid>
      <link>http://ralphwhitbeck.com/2007/05/28/BrakesAndRotors.aspx</link>
      <pubDate>Mon, 28 May 2007 04:50:23 GMT</pubDate>
      <description>My brakes started grinding this week so I needed to get that fixed...I bought the parts Brake pads and rotors and went over to my cousins house and he helped my put them on....I swear to god it was so easy...I am going to do it myself next time.&lt;br&gt;
&lt;br&gt;
I found instructions online for my type of brakes so I can do it next time.&lt;br&gt;
&lt;br&gt;
&lt;a href="http://www.2carpros.com/how_to/how_to_replace_brakes.htm"&gt;http://www.2carpros.com/how_to/how_to_replace_brakes.htm&lt;/a&gt;
&lt;br&gt;
&lt;br&gt;
tools I'll need to get the job done:&lt;br&gt;
&lt;br&gt;
14 mm socket&lt;br&gt;
18 mm socket&lt;br&gt;
C-Clamp&lt;br&gt;
Mallet or hammer (in case the bolts are tight)&lt;br&gt;
Jack 
&lt;br&gt;
Brake pads&lt;br&gt;
Rotors (if worn)&lt;br&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://ralphwhitbeck.com/aggbug.ashx?id=16bc5844-75e2-4c84-97d3-f718c0911afe" /&gt;</description>
      <comments>http://ralphwhitbeck.com/CommentView,guid,16bc5844-75e2-4c84-97d3-f718c0911afe.aspx</comments>
      <category>Mussings;Personal Finance;Technology;How-to</category>
    </item>
  </channel>
</rss>