<?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>Johnvh.com - online home of John Van Horn</title>
	<atom:link href="http://johnvh.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://johnvh.com</link>
	<description>Online home of Dallas, TX based web developer John Van Horn</description>
	<lastBuildDate>Fri, 13 Nov 2009 05:42:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Note to self: Minimum requirements for hosting</title>
		<link>http://johnvh.com/2009/11/12/note-to-self-minimum-requirements-for-hosting/</link>
		<comments>http://johnvh.com/2009/11/12/note-to-self-minimum-requirements-for-hosting/#comments</comments>
		<pubDate>Fri, 13 Nov 2009 04:53:42 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Web stuff]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[Hosting]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=263</guid>
		<description><![CDATA[While it would be nice have my own fancy server, a private server, or a private vm, I really don&#8217;t need it. I&#8217;ve always opted for shared hosting, because anything else seems like overkill. I currently have a shared plan with Dreamhost and they have served me quite well and meet all my needs. Recently [...]]]></description>
			<content:encoded><![CDATA[<p>While it would be nice have my own fancy server, a private server, or a private vm, I really don&#8217;t need it. I&#8217;ve always opted for shared hosting, because anything else seems like overkill. I currently have a shared plan with <a href="http://www.dreamhost.com/r.cgi?229423">Dreamhost</a> and they have served me quite well and meet all my needs. Recently though, while working with another hosting company, I realized there were some things missing that have become absolutely critical to my workflow. So here is my list of bare-minimum requirements for hosting:</p>
<ul>
<li>
<h3>LAMP</h3>
<p>Linux, Apache, MySql and Php. No Windows please. Not because Windows sucks, but because Windows has no shell access. <acronym title="command line interface">Cli</acronym>&#8217;s for mysql and php are a plus.
</li>
<li>
<h3>Shell access</h3>
<p>For me, there is no better way to work than through ssh and scp. Working through ftp is balls. Also required is <strong>easy-to-set-up</strong> shell access. Let me check a box on a control panel somewhere and wait at the most 10 minutes. Please do not make me enter my phone number, wait for a call, get a confirmation code from the call, enter the code somewhere in the control panel, and then wait 72 hours for my shell access to be &#8220;activated&#8221;.
</li>
<li>
<h3>Source control</h3>
<p>Binaries. <strong>At least</strong> <a href="http://subversion.tigris.org/">Subversion</a>. <a href="http://git-scm.com/">Git</a> would be ok too. Repo hosting is a plus.
</li>
<li>
<h3>Vim</h3>
<p><a href="http://www.vim.org/">The ultimate editor.</a>
</li>
<li>
<h3>Other binaries</h3>
<p>Curl and/or wget. Ant would be nice too. Xmllint and tidy.
</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/11/12/note-to-self-minimum-requirements-for-hosting/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>E4x and as3 gotcha</title>
		<link>http://johnvh.com/2009/06/26/e4x-and-as3-gotcha/</link>
		<comments>http://johnvh.com/2009/06/26/e4x-and-as3-gotcha/#comments</comments>
		<pubDate>Fri, 26 Jun 2009 19:07:42 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Flash & Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[E4X]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=240</guid>
		<description><![CDATA[I love E4X in AS3. It's powerful and fairly simple. If you haven't worked with it yet, check out Roger Braunstein's excellent tutorial. But I was recently annoyed by this gotcha when doing some xml combining. Let's say you have this:
PLAIN TEXT
XML:




&#60;xml&#62;


&#160; &#160; &#60;people&#62;


&#160; &#160; &#160; &#160; &#60;person id="123"&#62;


&#160; &#160; &#160; &#160; &#160; &#160; &#60;name&#62;John&#60;/name&#62;


&#160; [...]]]></description>
			<content:encoded><![CDATA[<p>I love <a href="http://livedocs.adobe.com/flex/3/html/help.html?content=13_Working_with_XML_01.html">E4X</a> in AS3. It's powerful and fairly simple. If you haven't worked with it yet, check out <a href="http://dispatchevent.org/roger/as3-e4x-rundown/">Roger Braunstein's excellent tutorial.</a> But I was recently annoyed by this gotcha when doing some xml combining. Let's say you have this:</p>
<div class="igBar"><span id="lxml-4"><a href="#" onclick="javascript:showPlainTxt('xml-4'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">XML:</span>
<div id="xml-4">
<div class="xml">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;xml<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;people<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;person</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">"123"</span><span style="font-weight: bold; color: black;">&gt;</span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>John<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/person<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;person<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;name<span style="font-weight: bold; color: black;">&gt;</span></span></span>David<span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/name<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/person<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/people<span style="font-weight: bold; color: black;">&gt;</span></span></span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #009900;"><span style="font-weight: bold; color: black;">&lt;/xml<span style="font-weight: bold; color: black;">&gt;</span></span></span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Let's parse with E4X:</p>
<div class="igBar"><span id="lactionscript-5"><a href="#" onclick="javascript:showPlainTxt('actionscript-5'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-5">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// #1</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">people</span>.<span style="color: #006600;">person</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// 2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// #2</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// no animals, but e4x still returns an XMLList</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">people</span>.<span style="color: #006600;">animal</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// 0</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// #3</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// no animals, so no further children, but still returns XMList</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">people</span>.<span style="color: #006600;">animal</span>.<span style="color: #006600;">fur</span>.<span style="color: #0066CC;">color</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// 0</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// #4</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// gotcha</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">people</span>.<span style="color: #006600;">person</span>.<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">"123"</span> == @id <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// thows: ReferenceError: Error #1065: Variable @id is not defined. </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>The first 3 examples work great. Even though there are no <code>&lt;animal&gt;</code> nodes, E4X still returns an XMLList. Even looking for more siblings under nodes that don't exist works great - it always returns an empty (but valid) XMLList. Always returning an XMLList makes it easy to work with because you can always for-each over the result. </p>
<p>What I don't understand is the 4th example. It fails because not every <code>&lt;person&gt;</code> node has an id attribute. But so what? If you look at the 2nd and 3rd examples, not every <code>&lt;people&gt;</code> node has an <code>&lt;animal&gt;</code> node. So why don't we get the same result - an empty XMLList?</p>
<p>Turns out that there is an easy solution/work-around, that Roger mentions in his tutorial:</p>
<div class="igBar"><span id="lactionscript-6"><a href="#" onclick="javascript:showPlainTxt('actionscript-6'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-6">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// will error if every person node does not have an id attribute</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">people</span>.<span style="color: #006600;">person</span>.<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">"123"</span> == @id <span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// use this</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">trace</span><span style="color: #66cc66;">&#40;</span> <span style="color: #0066CC;">xml</span>.<span style="color: #006600;">people</span>.<span style="color: #006600;">person</span>.<span style="color: #66cc66;">&#40;</span> attribute<span style="color: #66cc66;">&#40;</span> <span style="color: #ff0000;">"id"</span> <span style="color: #66cc66;">&#41;</span> == <span style="color: #ff0000;">"123"</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #0066CC;">length</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #808080; font-style: italic;">// 1 </span></div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>A bit <em>wtf</em>, but at least it works like the other examples.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/06/26/e4x-and-as3-gotcha/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Flash&#8217;s secret Javascript API</title>
		<link>http://johnvh.com/2009/04/27/flashs-secret-javascript-api/</link>
		<comments>http://johnvh.com/2009/04/27/flashs-secret-javascript-api/#comments</comments>
		<pubDate>Tue, 28 Apr 2009 03:01:49 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Flash & Actionscript]]></category>
		<category><![CDATA[Flash]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=204</guid>
		<description><![CDATA[Is that a Yahoo! ad in a Youtube player? No. It's a Yahoo! logo in a Youtube player. How did it get there? Via Flash's secret javascript api!
Ok, so it's not really secret. More like old, surely deprecated, and forgotten. I've been working with flash for a good while now, and I had no idea [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_218" class="wp-caption alignleft" style="width: 580px"><img src="http://johnvh.com/wp-content/uploads/2009/04/yahoo-in-youtube2.jpg" alt="Yahoo! invasion" title="yahoo-in-youtube2" width="570" height="381" class="size-full wp-image-218" /><p class="wp-caption-text">Yahoo! invasion</p></div>
<p>Is that a <a href="http://www.yahoo.com">Yahoo!</a> ad in a <a href="http://www.youtube.com">Youtube</a> player? No. It's a Yahoo! logo in a Youtube player. How did it get there? <a href="http://www.adobe.com/support/flash/publishexport/scriptingwithflash/scriptingwithflash_03.html">Via Flash's secret javascript api!</a></p>
<p>Ok, so it's not really secret. More like old, surely deprecated, and forgotten. I've been working with flash for a good while now, and I had <strong>no idea</strong> this existed until my friend <a href="http://robertames.com/">Robert Ames</a> stumbled upon it.</p>
<p>What's cool (or not cool) about this api, is that it's part of the <em>Flash plugin</em> itself and has nothing to do with Actionscript. All you have to do to enable this api is... well... embed a swf. Try going to a youtube video page like <a href="http://www.youtube.com/watch?v=xp9Gm-aRe5A">this one</a>, and then entering this in the address bar:</p>
<div class="igBar"><span id="ljavascript-8"><a href="#" onclick="javascript:showPlainTxt('javascript-8'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">JavaScript:</span>
<div id="javascript-8">
<div class="javascript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">javascript: document.<span style="color: #006600;">getElementById</span><span style="color: #66cc66;">&#40;</span> <span style="color: #3366CC;">"movie_player"</span> <span style="color: #66cc66;">&#41;</span>.<span style="color: #006600;">LoadMovie</span><span style="color: #66cc66;">&#40;</span> <span style="color: #CC0000;color:#800000;">98</span>, <span style="color: #3366CC;">"http://l.yimg.com/a/i/ww/beta/y3.gif"</span> <span style="color: #66cc66;">&#41;</span>; </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>I want to play around with this a bit more... I wouldn't be surprised if some of these API methods bypassed some of the Flash Player's security restrictions.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/04/27/flashs-secret-javascript-api/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Master bathroom progress</title>
		<link>http://johnvh.com/2009/04/22/master-bathroom-progress-4/</link>
		<comments>http://johnvh.com/2009/04/22/master-bathroom-progress-4/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 02:21:04 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=229</guid>
		<description><![CDATA[It's almost done. I just have to cut the trim and do some caulking and touch up painting. A couple more photos are in the full set.
]]></description>
			<content:encoded><![CDATA[<p>It's almost done. I just have to cut the trim and do some caulking and touch up painting. A couple more photos are in <a href="http://www.flickr.com/photos/johnvh/sets/72157617110556739/">the full set.</a></p>
<div class="wp-caption alignnone" style="width: 385px"><a href="http://www.flickr.com/photos/johnvh/3467411062/in/set-72157617110556739/"><img alt="My new vanity." src="http://farm4.static.flickr.com/3526/3467411062_e301cd204f.jpg" title="Vanity" width="375" height="500" /></a><p class="wp-caption-text">My new vanity.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/04/22/master-bathroom-progress-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ignoring files in Flex Builder Navigator</title>
		<link>http://johnvh.com/2009/03/30/ignoring-files-in-flex-builder-navigator/</link>
		<comments>http://johnvh.com/2009/03/30/ignoring-files-in-flex-builder-navigator/#comments</comments>
		<pubDate>Tue, 31 Mar 2009 04:08:53 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Flash & Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Flex]]></category>
		<category><![CDATA[Flex Builder]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=187</guid>
		<description><![CDATA[I don't like seeing .svn or CVS files in my Flex Builder/Eclipse workspace. I'll never need to edit those files directly, and if I do, I won't use Flex Builder to do it. But if they're in your project, they'll show up in the Navigator panel. Everywhere.
Fortunately, Eclipse provides a way to filter files in [...]]]></description>
			<content:encoded><![CDATA[<p>I don't like seeing .svn or CVS files in my Flex Builder/Eclipse workspace. I'll never need to edit those files directly, and if I do, I won't use Flex Builder to do it. But if they're in your project, they'll show up in the Navigator panel. Everywhere.</p>
<div id="attachment_188" class="wp-caption alignleft" style="width: 410px"><img src="http://johnvh.com/wp-content/uploads/2009/03/flex-navigator-before.png" alt="Every directory in your project will have a .svn folder." title="flex-navigator-before" width="400" height="410" class="size-full wp-image-188" /><p class="wp-caption-text">Every directory in your project will have a .svn folder.</p></div>
<p>Fortunately, Eclipse provides a way to filter files in the Navigator, but a) it's rather hidden, and b) it's not obvious how to add filters. In the Navigator panel, hit the down arrow in the top right corner and select "Filters...".</p>
<div id="attachment_192" class="wp-caption alignleft" style="width: 535px"><img src="http://johnvh.com/wp-content/uploads/2009/03/flex-navigator-dropdown.png" alt="Navigator panel options." title="flex-navigator-dropdown" width="525" height="254" class="size-full wp-image-192" /><p class="wp-caption-text">Navigator panel options.</p></div>
<p>Here's the list of filters you get by default:</p>
<div id="attachment_193" class="wp-caption alignleft" style="width: 394px"><img src="http://johnvh.com/wp-content/uploads/2009/03/flex-navigator-filters-default.png" alt="Default Filters" title="flex-navigator-filters-default" width="384" height="472" class="size-full wp-image-193" /><p class="wp-caption-text">Default Filters</p></div>
<p>What? No "add filter" option? No "edit"? I guess you could use the ".*" filter, but that would hide every file or directory whose name starts with ".". That may or may not be acceptable, depending on the type of project or files your working with. What if you had a <code>.htaccess</code> file in your project? </p>
<p>Fortunately again, there is a mechanism for adding additional filters, but it's not obvious. It involves editing the <em>plugins.xml</em> file for the Flex Builder editor plugin. You can find this plugin in the eclipse plugins folder (located in same place as <code>Flex Builder.app</code>) in your Flex Builder install. It's called <code>com.adobe.flexbuilder.standalone_3.0.194161</code>, and it's located for me at:</p>
<div class="igBar"><span id="lcode-11"><a href="#" onclick="javascript:showPlainTxt('code-11'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-11">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">/Applications/Adobe Flex Builder <span style="color:#800000;color:#800000;">3</span>/plugins/com.<span style="">adobe</span>.<span style="">flexbuilder</span>.<span style="">standalone_3</span>.<span style="color:#800000;color:#800000;">0</span>.<span style="color:#800000;color:#800000;">194161</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>So navigate there, and edit <code>plugins.xml</code>.  You're looking for the <code>extension</code> node whose attribute point is "org.eclipse.ui.ide.resourceFilters". Under that node is where the default filters are defined. All you have to do is add another one and save the file:</p>
<div id="attachment_195" class="wp-caption alignleft" style="width: 478px"><img src="http://johnvh.com/wp-content/uploads/2009/03/flex-plugin-xml.png" alt="Flex Builder editor plugin.xml, with svn filter added." title="flex-plugin-xml" width="468" height="359" class="size-full wp-image-195" /><p class="wp-caption-text">Flex Builder editor plugin.xml, with svn filter added.</p></div>
<p>The remaining step is to restart Flex Builder, using the <code>-clean</code> option. Since the plugin.xml file is either cached or compiled in somewhere, using the <code>-clean</code> option tells the Eclipse executable to reload all plugins and configs. This requires use of the Terminal:</p>
<div class="igBar"><span id="lcode-12"><a href="#" onclick="javascript:showPlainTxt('code-12'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-12">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ cd /Applications/Adobe\ Flex\ Builder\ <span style="color:#800000;color:#800000;">3</span>/Flex\ Builder.<span style="">app</span>/Contents/MacOS</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">$ ./FlexBuilder -clean </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>When Flex Builder launches, you should now see the filter you just added in the filters window. Thanks to <a href="http://robertames.com/">Robert Ames</a> for telling me how to launch Flex Builder with arguments.</p>
<div id="attachment_199" class="wp-caption alignleft" style="width: 395px"><img src="http://johnvh.com/wp-content/uploads/2009/03/flex-navigator-after.png" alt="New filter added." title="flex-navigator-after" width="385" height="472" class="size-full wp-image-199" /><p class="wp-caption-text">New filter added.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/03/30/ignoring-files-in-flex-builder-navigator/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Master bathroom progress</title>
		<link>http://johnvh.com/2009/03/23/master-bathroom-progress-3/</link>
		<comments>http://johnvh.com/2009/03/23/master-bathroom-progress-3/#comments</comments>
		<pubDate>Tue, 24 Mar 2009 04:21:11 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Renovations]]></category>
		<category><![CDATA[Master bathroom]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=181</guid>
		<description><![CDATA[I got a lot done this weekend: the shower was grouted, and I got the vanity, medicine cabinet, and lighting installed! Next up, counter top.
More pics on Flickr.
]]></description>
			<content:encoded><![CDATA[<p>I got a lot done this weekend: the shower was grouted, and I got the vanity, medicine cabinet, and lighting installed! Next up, counter top.</p>
<div class="wp-caption alignnone" style="width: 385px"><a href="http://www.flickr.com/photos/johnvh/3381493202/"><img alt="Grouted! All the shower needs is some finished plumbing and little bit of caulk." src="http://farm4.static.flickr.com/3447/3381493202_4b76c7377f.jpg" title="Shower" width="375" height="500" /></a><p class="wp-caption-text">Grouted! All the shower needs is some finished plumbing and little bit of caulk.</p></div>
<div class="wp-caption alignnone" style="width: 385px"><a href="http://www.flickr.com/photos/johnvh/3381493926/"><img alt="Vanity, medicine cabinet and lighting." src="http://farm4.static.flickr.com/3595/3381493926_242f71c2eb.jpg" title="Vanity" width="375" height="500" /></a><p class="wp-caption-text">Vanity, medicine cabinet and lighting.</p></div>
<p><a href="http://www.flickr.com/photos/johnvh/">More pics on Flickr.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/03/23/master-bathroom-progress-3/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Master bathroom progress</title>
		<link>http://johnvh.com/2009/03/18/master-bathroom-progress-2/</link>
		<comments>http://johnvh.com/2009/03/18/master-bathroom-progress-2/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 23:17:45 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Renovations]]></category>
		<category><![CDATA[Master bathroom]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=172</guid>
		<description><![CDATA[Finally finished tiling the shower last weekend. I don't know why it took so long, but it did. I should be able to grout and call the shower area officially done hopefully this weekened.
]]></description>
			<content:encoded><![CDATA[<p>Finally finished tiling the shower last weekend. I don't know why it took so long, but it did. I should be able to grout and call the shower area officially done hopefully this weekened.</p>
<div class="wp-caption alignnone" style="width: 510px"><a href="http://www.flickr.com/photos/johnvh/3361423163/"><img alt="The shower, finally tiled." src="http://farm4.static.flickr.com/3417/3361423163_540bfe10d8.jpg" title="Tiled shower" width="500" height="375" /></a><p class="wp-caption-text">The shower, finally tiled.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/03/18/master-bathroom-progress-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Are your event handlers bad?</title>
		<link>http://johnvh.com/2009/03/16/are-your-event-handlers-bad/</link>
		<comments>http://johnvh.com/2009/03/16/are-your-event-handlers-bad/#comments</comments>
		<pubDate>Tue, 17 Mar 2009 04:42:46 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Flash & Actionscript]]></category>
		<category><![CDATA[AS3]]></category>
		<category><![CDATA[Flash]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=167</guid>
		<description><![CDATA[Event handlers can be bad. They're not intrinsically bad - that's how shit gets done in AS3. It's the way they often get written that can be bad. Consider the following example:
PLAIN TEXT
Actionscript:




package 


&#123;


&#160; &#160; import fl.motion.Color;


&#160; &#160; 


&#160; &#160; import flash.display.DisplayObject;


&#160; &#160; import flash.display.Sprite;


&#160; &#160; import flash.events.Event;


&#160; &#160; import flash.events.MouseEvent;


&#160;


&#160; &#160; public class Nothing [...]]]></description>
			<content:encoded><![CDATA[<p>Event handlers can be bad. They're not intrinsically bad - that's how shit gets done in AS3. It's the way they often get written that can be bad. Consider the following example:</p>
<div class="igBar"><span id="lactionscript-15"><a href="#" onclick="javascript:showPlainTxt('actionscript-15'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-15">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">package </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> fl.<span style="color: #006600;">motion</span>.<span style="color: #0066CC;">Color</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">DisplayObject</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">display</span>.<span style="color: #006600;">Sprite</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">Event</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">import</span> flash.<span style="color: #006600;">events</span>.<span style="color: #006600;">MouseEvent</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">class</span> Nothing <span style="color: #0066CC;">extends</span> Sprite</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">var</span> square:Sprite;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> Nothing<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square = <span style="color: #000000; font-weight: bold;">new</span> Sprite<span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">beginFill</span><span style="color: #66cc66;">&#40;</span> 0xFFFFFF, <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square.<span style="color: #006600;">graphics</span>.<span style="color: #006600;">drawRect</span><span style="color: #66cc66;">&#40;</span> <span style="color: #cc66cc;color:#800000;">0</span>, <span style="color: #cc66cc;color:#800000;">0</span> , <span style="color: #cc66cc;color:#800000;">50</span>, <span style="color: #cc66cc;color:#800000;">50</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square.<span style="color: #006600;">graphics</span>.<span style="color: #0066CC;">endFill</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; square.<span style="color: #006600;">addEventListener</span><span style="color: #66cc66;">&#40;</span> MouseEvent.<span style="color: #006600;">CLICK</span>, click <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; addChild<span style="color: #66cc66;">&#40;</span> square <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> click<span style="color: #66cc66;">&#40;</span> event:MouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> clickedObject:DisplayObject = event.<span style="color: #0066CC;">target</span> as DisplayObject;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> tint:uint = 0xFF0000;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">color</span>:<span style="color: #0066CC;">Color</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Color</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #0066CC;">color</span>.<span style="color: #006600;">setTint</span><span style="color: #66cc66;">&#40;</span> tint, <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; clickedObject.<span style="color: #006600;">transform</span>.<span style="color: #006600;">colorTransform</span> = <span style="color: #0066CC;">color</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Great. So a sprite is tinted red when its clicked. But what happens when you have to tint that sprite at other times, like when the application loads? All the code that does the tinting is locked up inside the event handler - the problem there is that <strong>the event handler needs a <code>MouseEvent</code> to run.</strong></p>
<p>A better, more reusable, and more modular approach would be:</p>
<div class="igBar"><span id="lactionscript-16"><a href="#" onclick="javascript:showPlainTxt('actionscript-16'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">Actionscript:</span>
<div id="actionscript-16">
<div class="actionscript">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">public</span> <span style="color: #000000; font-weight: bold;">function</span> tint<span style="color: #66cc66;">&#40;</span> obj:DisplayObject <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> tint:uint = 0xFF0000; <span style="color: #808080; font-style: italic;">//or better, make this an argument</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> <span style="color: #0066CC;">color</span>:<span style="color: #0066CC;">Color</span> = <span style="color: #000000; font-weight: bold;">new</span> <span style="color: #0066CC;">Color</span><span style="color: #66cc66;">&#40;</span><span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #0066CC;">color</span>.<span style="color: #006600;">setTint</span><span style="color: #66cc66;">&#40;</span> tint, <span style="color: #cc66cc;color:#800000;">1</span> <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; obj.<span style="color: #006600;">transform</span>.<span style="color: #006600;">colorTransform</span> = <span style="color: #0066CC;">color</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #0066CC;">private</span> <span style="color: #000000; font-weight: bold;">function</span> click<span style="color: #66cc66;">&#40;</span> event:MouseEvent <span style="color: #66cc66;">&#41;</span>:<span style="color: #0066CC;">void</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#123;</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; <span style="color: #000000; font-weight: bold;">var</span> clickedObject:DisplayObject = event.<span style="color: #0066CC;">target</span> as DisplayObject;</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">&nbsp; &nbsp; tint<span style="color: #66cc66;">&#40;</span> clickedObject <span style="color: #66cc66;">&#41;</span>;</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;"><span style="color: #66cc66;">&#125;</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>You see? The event handler just notifies us that something needs to be tinted. The actual tinting happens elsewhere. Now, code that does work does not need anything other than a reference to a <code>DisplayObject</code> to run! Now, you can tint an object when the application loads. You can tint an object on a timer. Now, you can tint anything, at anytime! Now its testable and reusable! And, it's a very easy concept to master.</p>
<blockquote><p>
Get what you need from an event object, <strong>and get out.</strong>
</p></blockquote>
<p>When you write event handlers, think about what they are actually doing. What do you actually need from the event object? How would you test the event handler? Or better yet, how would you make the same thing that happens in the event handler, happen without the event?</p>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/03/16/are-your-event-handlers-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Wordpress, mod rewrite, and htaccess nightmare</title>
		<link>http://johnvh.com/2009/02/17/wordpress-mod-rewrite-and-htaccess-nightmare/</link>
		<comments>http://johnvh.com/2009/02/17/wordpress-mod-rewrite-and-htaccess-nightmare/#comments</comments>
		<pubDate>Wed, 18 Feb 2009 05:08:40 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Web stuff]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=157</guid>
		<description><![CDATA[So I recently blogged about using digest authentication instead of basic for securing your wp-admin directory. When implementing this myself, I had it all set up and working on a subdomain. But, I had the authentication directive in the root .htaccess file as well as the wp-admin/.htaccess file. This made it appear to work just [...]]]></description>
			<content:encoded><![CDATA[<p>So I <a href="http://johnvh.com/2009/02/11/use-digest-authentication/">recently blogged</a> about using digest authentication instead of basic for securing your wp-admin directory. When implementing this myself, I had it all set up and working on a subdomain. But, I had the authentication directive in the root <code>.htaccess</code> file as well as the <code>wp-admin/.htaccess</code> file. This made it appear to work just fine. When I went to implement this on here on my live site though, I ran into an issue. The rewrite was being applied no matter what! This resulted in requests to /wp-admin being rewrriten and handled by index.php, and 404'ing.</p>
<p>So save yourself some headaches and searching, and put the following in your root <code>.htaccess</code> file:</p>
<div class="igBar"><span id="lcode-18"><a href="#" onclick="javascript:showPlainTxt('code-18'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-18">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ErrorDocument <span style="color:#800000;color:#800000;">401</span> /error.<span style="">html</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">ErrorDocument <span style="color:#800000;color:#800000;">403</span> /error.<span style="">html</span> </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Just make sure those files (error.html) actually exist.</p>
<p>I don't exactly know why this works, but it does. I also don't know who is to blame. <a href="http://textpattern.com/faq/173/password-protected-directories-with-htaccess">Textpattern blames Apache configurations</a> for not having valid error documents to serve (they also have the solution). <a href="http://wiki.dreamhost.com/index.php/Making_stats_accessible_with_htaccess">Dreamhost blames overly aggressive rewrite conditions,</a> but I don't know about that either. Seems to me the rewrite conditions are being used correctly. Sure, the requested uri needs authentication, <strong>but it exists on disk.</strong> Props to <a href="http://www.ju-ju.com/2006/03/17/wordpress-404-error">other</a> <a href="http://developedtraffic.com/2007/05/27/wordpress-admin-password-protection-404/">folks</a> too for other ideas, and the final solution.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/02/17/wordpress-mod-rewrite-and-htaccess-nightmare/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Master bathroom progress</title>
		<link>http://johnvh.com/2009/02/16/master-bathroom-progress/</link>
		<comments>http://johnvh.com/2009/02/16/master-bathroom-progress/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 01:56:58 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Renovations]]></category>
		<category><![CDATA[Master bathroom]]></category>

		<guid isPermaLink="false">http://staging.johnvh.com/?p=148</guid>
		<description><![CDATA[Just finished up a long day of working on the bathroom. The shower stall is now officially ready to tile. Here are a few pics.
]]></description>
			<content:encoded><![CDATA[<p>Just finished up a long day of working on the bathroom. The shower stall is now officially ready to tile. Here are a few pics.</p>
<div class="wp-caption alignnone" style="width: 385px"><a href="http://flickr.com/photos/johnvh/3285800869/"><img alt="Vapor barrier over sheetrock before backer board is hung" src="http://farm4.static.flickr.com/3412/3285800869_cb1fa5323b.jpg" width="375" height="500" /></a><p class="wp-caption-text">Vapor barrier over sheetrock before backer board is hung</p></div>
<div class="wp-caption alignnone" style="width: 510px"><a href="http://flickr.com/photos/johnvh/3285800763/"><img alt="Backer board done" src="http://farm4.static.flickr.com/3277/3285800763_706b7efe28.jpg" width="500" height="375" /></a><p class="wp-caption-text">Backer board done</p></div>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/02/16/master-bathroom-progress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Use digest authentication</title>
		<link>http://johnvh.com/2009/02/11/use-digest-authentication/</link>
		<comments>http://johnvh.com/2009/02/11/use-digest-authentication/#comments</comments>
		<pubDate>Thu, 12 Feb 2009 03:08:18 +0000</pubDate>
		<dc:creator>johnvh</dc:creator>
				<category><![CDATA[Web stuff]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Wordpress]]></category>

		<guid isPermaLink="false">http://johnvh.com/?p=153</guid>
		<description><![CDATA[I've seen several articles that discuss Wordpress security - just search for it - say that you should password protect the wp-admin directory. You can do this easily with Apache by using authentication directives, which allow you, per directory, to require a valid user name and password from a client before serving up any content. [...]]]></description>
			<content:encoded><![CDATA[<p>I've seen several articles that discuss Wordpress security - just <a href="http://www.google.com/search?&#038;q=wordpress%20security">search for it</a> - say that you should password protect the wp-admin directory. You can do this easily with Apache by using <a href="http://httpd.apache.org/docs/2.0/howto/auth.html">authentication directives,</a> which allow you, per directory, to require a valid user name and password from a client before serving up any content. As of right now, there are two types of authentication that are prevalent out of the box: <a href="http://en.wikipedia.org/wiki/Basic_authentication">basic authentication,</a> and <a href="http://en.wikipedia.org/wiki/Digest_authentication">digest autentication.</a></p>
<p>All the security articles I've read recommend setting up basic authentication. I understand that the <em>point</em> is to have password protected access, but basic authentication is <em>not</em> secure. When your browser is challenged with the basic authorization protocol, the user name and password you enter is just <a href="http://en.wikipedia.org/wiki/Base64">base 64 encoded.</a> If someone intercepted a request header on the way to your server after you've authenticated, there would be <a href="http://www.google.com/search?hl=en&#038;q=base64%20decode">virtually no work at all</a> involved in decoding your user name and password.</p>
<p>Alternatively, and just as easily, you can use <a href="http://en.wikipedia.org/wiki/Digest_authentication">digest authentication</a>, which is considered to be much more secure than basic. It uses <a href="http://en.wikipedia.org/wiki/MD5">MD5 encryption</a>, and other techniques to make the output nearly <a href="http://en.wikipedia.org/wiki/One_way_function">one way.</a></p>
<p>Consider the following exceprts from a <code>.htaccess</code> file:</p>
<div class="igBar"><span id="lcode-21"><a href="#" onclick="javascript:showPlainTxt('code-21'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-21">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#Use digest authentication</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AuthType Digest </div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AuthName <span style="color:#CC0000;">"private"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AuthDigestFile /home/yourusername/.<span style="">htdigest</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Require valid-user </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<div class="igBar"><span id="lcode-22"><a href="#" onclick="javascript:showPlainTxt('code-22'); return false;">PLAIN TEXT</a></span></div>
<div class="syntax_hilite"><span class="langName">CODE:</span>
<div id="code-22">
<div class="code">
<ol>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">#Use basic authentication</div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AuthUserFile /home/yourusername/.<span style="">htpasswd</span></div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AuthName <span style="color:#CC0000;">"restricted"</span></div>
</li>
<li style="font-weight: bold;color:#26536A;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">AuthType Basic</div>
</li>
<li style="font-family: 'Courier New', Courier, monospace; color: black; font-weight: normal; font-style: normal;color:#3A6A8B;">
<div style="font-family: 'Courier New', Courier, monospace; font-weight: normal;">Require valid-user </div>
</li>
</ol>
</div>
</div>
</div>
<p></p>
<p>Both should be fairly easy to setup with the Auth directives, and Apache ships with CLI tools for easily adding users and password files: <code>htpasswd</code>, and <code>htdigest</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://johnvh.com/2009/02/11/use-digest-authentication/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
