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

<channel>
	<title>David James Whitely</title>
	<atom:link href="http://davidwhitely.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://davidwhitely.com</link>
	<description></description>
	<lastBuildDate>Fri, 24 Feb 2012 19:31:33 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Sanitizing Input Fields on the Client Side</title>
		<link>http://davidwhitely.com/2011/01/sanitizing-javascript-input-fields/</link>
		<comments>http://davidwhitely.com/2011/01/sanitizing-javascript-input-fields/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 16:26:39 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=453</guid>
		<description><![CDATA[Some example code for stripping out all non word characters. So only letters, underscores/spaces, and numbers. This would not be good for email sanitization, but could be good for other input fields. var search_term = $('.search_tag_input').val(); // strip tags search_term = search_term.replace(/(&#60;([^&#62;]+)&#62;)/ig,""); //spaces as underscores search_term = search_term.replace(' ', '_'); //remove nonword characters (and underscores) [...]]]></description>
			<content:encoded><![CDATA[<p>Some example code for stripping out all non word characters. So only letters, underscores/spaces, and numbers. This would not be good for email sanitization, but could be good for other input fields.</p>
<p><code>var search_term = $('.search_tag_input').val();<br />
// strip tags<br />
search_term = search_term.replace(/(&lt;([^&gt;]+)&gt;)/ig,"");<br />
//spaces as underscores<br />
search_term = search_term.replace(' ', '_');<br />
//remove nonword characters (and underscores)<br />
search_term = search_term.replace(/\W/ig, '');<br />
//underscores to dashes (or whatever is needed)<br />
search_term = search_term.replace('_', '-');</code></p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2011/01/sanitizing-javascript-input-fields/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Best Way to Handle Scroll Events</title>
		<link>http://davidwhitely.com/2011/01/the-best-way-to-handle-scroll-events/</link>
		<comments>http://davidwhitely.com/2011/01/the-best-way-to-handle-scroll-events/#comments</comments>
		<pubDate>Mon, 31 Jan 2011 16:23:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[scrolling]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=456</guid>
		<description><![CDATA[John Resig has an excellent post on his blog about scroll events, efficiancy, and how that recently affected twitter. Below is some example code he wrote for working with scroll events. var outerPane = $details.find(".details-pane-outer"), didScroll = false; $(window).scroll(function() { didScroll = true; }); setInterval(function() { if ( didScroll ) { didScroll = false; // [...]]]></description>
			<content:encoded><![CDATA[<p>John Resig has an excellent post on his blog about scroll events, efficiancy, and how that recently affected twitter. Below is some example code he wrote for working with scroll events.<br />
<span id="more-456"></span></p>
<p><code>var outerPane = $details.find(".details-pane-outer"),<br />
    didScroll = false;<br />
$(window).scroll(function() {<br />
    didScroll = true;<br />
});</p>
<p>setInterval(function() {<br />
    if ( didScroll ) {<br />
        didScroll = false;<br />
        // Check your page position and then<br />
        // Load in more results<br />
    }<br />
}, 250);</code></p>
<p>See <a href="http://ejohn.org/blog/learning-from-twitter/">ejohn.org/blog/learning-from-twitter/</a></p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2011/01/the-best-way-to-handle-scroll-events/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cross Browser CSS3 and MS Filter Matrix Transform Rotation Using jQuery</title>
		<link>http://davidwhitely.com/2010/12/cross-browser-css3-and-ms-filter-matrix-transform-rotation-using-jquery/</link>
		<comments>http://davidwhitely.com/2010/12/cross-browser-css3-and-ms-filter-matrix-transform-rotation-using-jquery/#comments</comments>
		<pubDate>Wed, 22 Dec 2010 00:07:08 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[IE]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[rotation]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=346</guid>
		<description><![CDATA[Drag the waves.Click the waves to disable mouse rotating. Flip the waves 90 degrees clockwise Flip the waves 90 degrees counter-clockwise Flip the waves 270 degrees clockwise (same as above) Flip the waves 26 degrees clockwise Flip the waves 84 degrees counter-clockwise Flip the waves 108 degrees counter-clockwise Flip the waves 180 degrees either direction [...]]]></description>
			<content:encoded><![CDATA[<style>
body { background:transparent; }
</style>
<div class="draggableContainer">Drag the waves.<br/>Click the waves to disable mouse rotating.
<div class="wavesContainer"><img class="size-full wp-image-347 waves" title="waves" src="http://davidwhitely.com/wp-content/uploads/2010/12/waves.gif" alt="" width="300" height="225" onclick="$('.draggerContainer').unbind('mousemove');" /></div>
</div>
<p><a href="#" onclick="rotate($('.waves'),90); return false;">Flip the waves 90 degrees clockwise</a><br />
<a href="#" onclick="rotate($('.waves'),-90); return false;">Flip the waves 90 degrees counter-clockwise</a><br />
<a href="#" onclick="rotate($('.waves'),270); return false;">Flip the waves 270 degrees clockwise (same as above)</a><br />
<a href="#" onclick="rotate($('.waves'),26); return false;">Flip the waves 26 degrees clockwise</a><br />
<a href="#" onclick="rotate($('.waves'),-84); return false;">Flip the waves 84 degrees counter-clockwise</a><br />
<a href="#" onclick="rotate($('.waves'),-108); return false;">Flip the waves 108 degrees counter-clockwise</a><br />
<a href="#" onclick="rotate($('.waves'),180); return false;">Flip the waves 180 degrees either direction</a><br />
<a href="#" onclick="rotate($('.wavesContainer'),90); return false;">Flip the waves container 90 degrees clockwise</a><br />
<a href="#" onclick="rotate($('.draggableContainer'),90); return false;">Flip the draggable container 90 degrees clockwise</a><br />
<a href="#" onclick="rotate($('.waves')); return false;">Enable mouse following</a><br />
<a href="#" onclick="$('.draggerContainer').unbind('mousemove'); return false;">Disable mouse following</a></p>
<p>The borders and markup above are meant to display behavior of various browsers when applying a CSS3 transform. Try flipping the draggableContainer and moving the waves around. IE has serious performance issues when applying the mouse following rotation, unless you click and hold within the draggableContainer while mouse following is enabled. Perhaps this can be helped tying the mouse following behavior to an absolutely positioned element within waveContainer div.</p>
<p><br/><br />
<span id="more-346"></span></p>
<h1>The markup:</h1>
<pre>
<code><span style="color:green">&lt;div class="draggableContainer"&gt;</span>
    Drag the waves.&lt;br/&gt;
    Click the waves to disable mouse rotating.
<span style="color:#C60104">    &lt;div class="wavesContainer"&gt;</span>
        &lt;img class="size-full wp-image-347 <span style="color:purple;">waves</span>"
            title="waves"
            src="http://davidwhitely.com/wp-content/uploads/2010/12/waves.gif"
            width="300"
            height="225"
            onclick="$('.draggerContainer').unbind('mousemove');"
        /&gt;
<span style="color:#C60104">    &lt;/div&gt;</span>
<span style="color:green">&lt;/div&gt;</span></code>
</pre>
<p><br/></p>
<h1>The CSS:</h1>
<pre>
<code markup:none>.draggableContainer{
	position:relative;
	width:95%;
	height:315px;
	border:1px solid green;
}

.wavesContainer{
	border:1px solid #C60104;
	width:310px;
	padding:5px;
	display:block;
	position:absolute;
	top:35px;
	left:25px;
}

.waves {
	padding:5px;
	border:1px solid #CCC;
}
.rotateHandle{
	position:absolute;
	top:-10px;
	left:50%;
	height:5px;
	width:5px;
	border:1px solid black;
	background:white;
}</code>
</pre>
<p><br/></p>
<h1>The Javascript</h1>
<pre>
<code><span style="color:purple;">//Let's make it draggable, for fun!	</span>
$(document).ready(function(){
	$('.wavesContainer').draggable({ containment: 'parent' });
});

<span style="color:purple;">//rotate an element by a supplied degrees argument
//if no degrees argument, default to mouse following</span>
function rotate(element, a){
	var sin;
	var cos;

	<span style="color:purple;">//roation markup for all browsers</span>
	function normalizedRotate(sin, cos){
		<span style="color:purple;">//javascript sin in degress</span>
		sin = Math.sin(a * Math.PI/180);
		cos = Math.cos(a * Math.PI/180);

		<span style="color:purple;">//rounds to 3 decimal points</span>
		sin = Math.round(sin*10000)/10000;
		cos = Math.round(cos*10000)/10000;

		<span style="color:purple;">//need to update this to use $.support</span>
		if (!$.browser.msie) {
			element.css('-webkit-transform', 'matrix('+cos+','+sin+','+-sin+','+cos+', 0, 0)');
			element.css('-moz-transform', 'matrix('+cos+','+sin+','+-sin+','+cos+', 0, 0)');
			element.css('-o-transform', 'matrix('+cos+','+sin+','+-sin+','+cos+', 0, 0)');
			element.css('transform', 'matrix('+cos+','+sin+','+-sin+','+cos+', 0, 0)');
		} else {
element.css('filter', 'progid:DXImageTransform.Microsoft.Matrix(sizingMethod="auto expand", FilterType="nearest neighbor", M11='+cos+', M12='+-sin+', M21='+sin+', M22='+cos+')');
		}
	}

	if(!a){
		$('.draggableContainer').mousemove(function(e){
			<span style="color:purple;">//get the X Y position of the mouse relative to the center of the selected element</span>
			var difX = e.pageX - element.offset().left - (element.width()/2.0);
			var difY = e.pageY - element.offset().top - (element.height()/2.0);

			a = Math.atan2(difY, difX);
			<span style="color:purple;">//convert radial mouse value to a value of 0 to 360
			//add 90 so that it acts as if it's calculating from the top of the selected element </span>
			a = (a/Math.PI*180) + (a &gt; 0 ? 0 : 360)+90;

			normalizedRotate(sin, cos);
		});

	} else {
		normalizedRotate(sin, cos);
	}
}
</code>
</pre>
<p><br/><br />
Image from <a href="http://m.pimpmyspace.org/pimp/1/d4/d41504d2b63805059fc7.gif">http://m.pimpmyspace.org/pimp/1/d4/d41504d2b63805059fc7.gif</a></p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2010/12/cross-browser-css3-and-ms-filter-matrix-transform-rotation-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Universal Clearfix Hack</title>
		<link>http://davidwhitely.com/2010/10/universal-clearfix-hack/</link>
		<comments>http://davidwhitely.com/2010/10/universal-clearfix-hack/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 14:57:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IE]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=342</guid>
		<description><![CDATA[I&#8217;ve been using this little piece of code all over the place for months now. Tracked down the original use here: /* CLEARFIX !! -- slightly enhanced, universal clearfix hack */ .clearfix:after { visibility:hidden; display:block; font-size:0; content:" "; clear:both; height:0; } .clearfix { display:inline-block; } /* start commented backslash hack \*/ * html .clearfix { [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been using this little piece of code all over the place for months now. </p>
<p>Tracked down the original use <a href="http://perishablepress.com/press/2008/06/18/css-hackz-series-clearing-floats-with-the-clearfix-hack/">here</a>:</p>
<p><code>/* CLEARFIX !! -- slightly enhanced, universal clearfix hack */<br />
.clearfix:after 	{ visibility:hidden; display:block; font-size:0; content:" "; clear:both; height:0; }<br />
.clearfix			{ display:inline-block; }<br />
/* start commented backslash hack \*/<br />
* html .clearfix	{ height:1%; }<br />
.clearfix			{ display:block; }<br />
/* close commented backslash hack */</code></p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2010/10/universal-clearfix-hack/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Detecting IE6 in jQuery</title>
		<link>http://davidwhitely.com/2010/07/detecting-ie6-in-jquery/</link>
		<comments>http://davidwhitely.com/2010/07/detecting-ie6-in-jquery/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 13:33:54 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[IE]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=338</guid>
		<description><![CDATA[if ($.browser.msie &#038;&#038; parseInt($.browser.version)< 7) { //code goes here }]]></description>
			<content:encoded><![CDATA[<p>if ($.browser.msie &#038;&#038; parseInt($.browser.version)< 7) {<br />
    //code goes here<br />
}</p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2010/07/detecting-ie6-in-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>position:fixed; cross browser solution using jQuery</title>
		<link>http://davidwhitely.com/2010/03/positionfixed-cross-browser-solution-using-jquery/</link>
		<comments>http://davidwhitely.com/2010/03/positionfixed-cross-browser-solution-using-jquery/#comments</comments>
		<pubDate>Tue, 16 Mar 2010 16:38:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[CSS]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=330</guid>
		<description><![CDATA[This is an easy way to accomplish position:fixed; across all browsers using jQuery. Works in IE6. $(window).scroll(function() { $('#elementName').css('top', $(this).scrollTop() + "px"); });]]></description>
			<content:encoded><![CDATA[<p>This is an easy way to accomplish position:fixed; across all browsers using jQuery. Works in IE6.<br />
<code>$(window).scroll(function() {<br />
    $('#elementName').css('top', $(this).scrollTop() + "px");<br />
});</code></p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2010/03/positionfixed-cross-browser-solution-using-jquery/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>holographic principle, calabi yau</title>
		<link>http://davidwhitely.com/2010/01/holographic-priciple-calabi-yau/</link>
		<comments>http://davidwhitely.com/2010/01/holographic-priciple-calabi-yau/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 23:09:43 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Image Blog]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=326</guid>
		<description><![CDATA[From http://upload.wikimedia.org/wikipedia/commons/d/d4/Calabi-Yau.png]]></description>
			<content:encoded><![CDATA[<p><a href="http://davidwhitely.com/wp-content/uploads/2010/01/Calabi-Yau.png"><img src="http://davidwhitely.com/wp-content/uploads/2010/01/Calabi-Yau.png" alt="Calabi-Yau" title="Calabi-Yau" width="840" height="840" class="alignnone size-full wp-image-327" /></a></p>
<p>From <a href="http://upload.wikimedia.org/wikipedia/commons/d/d4/Calabi-Yau.png">http://upload.wikimedia.org/wikipedia/commons/d/d4/Calabi-Yau.png</a></p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2010/01/holographic-priciple-calabi-yau/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>cell radiation</title>
		<link>http://davidwhitely.com/2010/01/cell-radiation/</link>
		<comments>http://davidwhitely.com/2010/01/cell-radiation/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 19:30:34 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Image Blog]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=322</guid>
		<description><![CDATA[From http://www.blogcdn.com/www.engadget.com/media/2010/01/cell-radiation-01-09-2010.jpg]]></description>
			<content:encoded><![CDATA[<p><a href="http://davidwhitely.com/wp-content/uploads/2010/01/cell-radiation-01-09-2010.jpg"><img src="http://davidwhitely.com/wp-content/uploads/2010/01/cell-radiation-01-09-2010.jpg" alt="cell-radiation-01-09-2010" title="cell-radiation-01-09-2010" width="210" height="250" class="alignnone size-full wp-image-323" /></a></p>
<p>From <a target="_blank" href="http://www.blogcdn.com/www.engadget.com/media/2010/01/cell-radiation-01-09-2010.jpg">http://www.blogcdn.com/www.engadget.com/media/2010/01/cell-radiation-01-09-2010.jpg</a></p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2010/01/cell-radiation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Suckerfish Menus, Flash and wmode</title>
		<link>http://davidwhitely.com/2009/12/suckerfish-menus-flash-and-wmode/</link>
		<comments>http://davidwhitely.com/2009/12/suckerfish-menus-flash-and-wmode/#comments</comments>
		<pubDate>Thu, 17 Dec 2009 20:26:16 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Flash]]></category>
		<category><![CDATA[Notes]]></category>
		<category><![CDATA[Suckerfish]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=317</guid>
		<description><![CDATA[So in some versions of IE, Suckerfish drop down menus show up behind Flash videos unless you add the WMODE parameters to the HTML code. Add the following parameter to the OBJECT tag: &#60;param name=&#8221;wmode&#8221; value=&#8221;transparent&#8221;&#62; Add the following parameter to the EMBED tag: wmode=&#8221;transparent&#8221;]]></description>
			<content:encoded><![CDATA[<p>So in some versions of IE, <a href="http://htmldog.com/articles/suckerfish/dropdowns/" target="_blank">Suckerfish</a> drop down menus show up behind Flash videos unless you add the WMODE parameters to the HTML code.</p>
<p>Add the following parameter to the OBJECT tag:<br />
&lt;param name=&#8221;wmode&#8221; value=&#8221;transparent&#8221;&gt;<br />
Add the following parameter to the EMBED tag:<br />
wmode=&#8221;transparent&#8221;</p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2009/12/suckerfish-menus-flash-and-wmode/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>BizDev 2.0</title>
		<link>http://davidwhitely.com/2009/12/bizdev-2-0/</link>
		<comments>http://davidwhitely.com/2009/12/bizdev-2-0/#comments</comments>
		<pubDate>Sun, 13 Dec 2009 08:38:11 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[api]]></category>
		<category><![CDATA[biz dev 2.0]]></category>
		<category><![CDATA[flickr]]></category>
		<category><![CDATA[Notes]]></category>

		<guid isPermaLink="false">http://davidwhitely.com/?p=310</guid>
		<description><![CDATA[Or Business Development 2.0. This idea falls into the &#8220;ask for forgiveness, not permission&#8221; style of work, which I personally subscribe to. It&#8217;s an interesting article, my favorite paragraph is in the end: Traditional business development meant spending a lot of money on dry cleaning, animating your powerpoint, drinking stale coffee in windowless conference rooms [...]]]></description>
			<content:encoded><![CDATA[<p>Or <a href="http://www.caterina.net/archive/000996.html" target="_blank">Business Development 2.0.</a> This idea falls into the &#8220;ask for forgiveness, not permission&#8221; style of work, which I personally subscribe to. It&#8217;s an interesting article, my favorite paragraph is in the end:</p>
<blockquote><p>
Traditional business development meant spending a lot of money on dry cleaning, animating your powerpoint, drinking stale coffee in windowless conference rooms and scouring the thesaurus looking for synonyms for &#8220;synergy&#8221;. Not to mention trying to get hopelessly overbooked people to return your email. And then after the deal was done, squabbling over who dealt with the customer service. Much, much better this way!
</p></blockquote>
<p><span id="more-310"></span></p>
<p>Article link <a href="http://www.caterina.net/archive/000996.html" target="_blank">here,</a> from <a href="http://en.blog.wordpress.com/2009/12/12/twitter-api/" target="_blank">this article</a> on WordPress implementing the Twitter API.</p>
]]></content:encoded>
			<wfw:commentRss>http://davidwhitely.com/2009/12/bizdev-2-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

