<?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>found_drama &#187; Code</title>
	<atom:link href="http://blog.founddrama.net/category/tech/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.founddrama.net</link>
	<description>getOblique();</description>
	<lastBuildDate>Fri, 30 Jul 2010 02:00:11 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>why you should basically never use the Number constructor</title>
		<link>http://blog.founddrama.net/2010/07/why-you-should-basically-never-use-the-number-constructor/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=why-you-should-basically-never-use-the-number-constructor</link>
		<comments>http://blog.founddrama.net/2010/07/why-you-should-basically-never-use-the-number-constructor/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 00:55:40 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Number]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=4723</guid>
		<description><![CDATA[Inspired by some recent entanglements with a vendor&#8217;s API: var n = new Number(1); alert(n); // 1 typeof n; // object n instanceof Number; // true var nn = 1; alert(nn); // 1 typeof nn; // number n instanceof Number; // false n == nn; // true typeof n == typeof nn; // false n++; [...]]]></description>
			<content:encoded><![CDATA[<p>Inspired by some recent entanglements with a vendor&#8217;s API:</p>
<pre name="code" class="js">
var n = new Number(1);
alert(n);				// 1
typeof n;				// object
n instanceof Number;	// true

var nn = 1;
alert(nn);				// 1
typeof nn;				// number
n instanceof Number;	// false

n == nn;				// true

typeof n == typeof nn;	// false

n++;
nn++;
alert(n);				// 2
alert(nn);				// 2

n == nn;				// true

typeof n;				// number
typeof nn;				// number
typeof n == typeof nn;	// true
</pre>
<p>The type coercion will ultimately work in your favor but the main point is that the type coercion has to take place in the first place.  Granted, it is probably an edge case to do something like:</p>
<pre name="code" class="js">
var n = new Number(x); // where x is a global storing an incrementer

function doMath(a){
	if (typeof a == "number") {
		return a + x;
	}
}
</pre>
<p>&#8230;but you never know.  There&#8217;s some strange code out there.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2010/07/why-you-should-basically-never-use-the-number-constructor/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>faking it: static method calls in JavaScript</title>
		<link>http://blog.founddrama.net/2010/06/faking-it/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=faking-it</link>
		<comments>http://blog.founddrama.net/2010/06/faking-it/#comments</comments>
		<pubDate>Sun, 06 Jun 2010 13:21:47 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[functions]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[methods]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=4645</guid>
		<description><![CDATA[Have you ever wanted (as an object-oriented JavaScript developer) to work with an object before you had an instance of it? For example, perhaps there&#8217;s a method that you would like to call without going through the overhead of instantiating the object. How would you go about doing this? Can you invoke myWidget.doSomeStuff() if you [...]]]></description>
			<content:encoded><![CDATA[<p>Have you ever wanted (as an object-oriented JavaScript developer) to work with an object before you had an instance of it?  For example, perhaps there&#8217;s a method that you would like to call without going through the overhead of instantiating the object.  How would you go about doing this?  Can you invoke <code>myWidget.doSomeStuff()</code> if you don&#8217;t have an instance of <code>myWidget</code> yet?  Do we have static methods in JavaScript like we do in (<em>for example</em>) Java?  (<b>HINT:</b> the short answer is &#8220;not exactly&#8221;.)</p>
<p>First:  what are the more traditional options?</p>
<p><strong>A global function.</strong>  If the mechanics of the function are not specific to the object&#8217;s implementation, then this might be a perfectly acceptable approach.  If your function is just &#8220;doing stuff to&#8221; (or &#8220;&#8230;with&#8221;) some arguments then this might be fine.  Performing some mathematical operations?  Who needs an object-oriented approach for determining Fibonacci numbers?  Or trimming whitespace from strings?  Certainly that would be overkill.</p>
<p><strong>A namespaced util method.</strong>  Not too dissimilar from the global function approach; but if you&#8217;re namespacing, you&#8217;re less likely to have collisions in your variable and function names, and maybe some better sharing of common code, <em>etc</em>.  As far as &#8220;static methods&#8221; go, we&#8217;re just calling these methods off a singleton—fine (for example) for converting constants, or otherwise working with and manipulating known quantities.</p>
<p>But what about something more sophisticated?  What if you have a family of classes (<em>e.g.</em>, widget editors) that are all related but may each require an <em>ever so slightly different</em> approach to the context inspection?  A global function or namespaced util won&#8217;t quite cut it here.  What are we to do?</p>
<p>Now it turns out that JavaScript&#8217;s prototypal inheritance apparatus provides us with a way to do this.  Depending on how you&#8217;ve designed and implemented your object classes, this could be a relatively trivial operation.</p>
<p>Observe (using our suggested example above):</p>
<pre name="code" class="js">// the "usual" way...

// (1a) init your class and assign to a variable:
var myWidget = new net.fd.SomeWidget();
	// now we have our instance

// (1b) call the method from your instance:
myWidget.inspectContext();
	// ...except inspectContext() tells returns false
	// meaning that we created myWidget for nothing

// (2) try something a little different
net.fd.SomeWidget.inspectContext();
	// error! - "inspectContext" is undefined
	// ...because "net.fd.SomeWidget" is the constructor

// (3) try it again, with a twist
net.fd.SomeWidget.prototype.inspectContext();
	// still returns false but this time we didn't have
	// the extra overhead of creating the instance</pre>
<p>Nifty, eh?</p>
<p>Imagine a scenario where you have a few dozen classes like this (<em>e.g.</em>, each class representing an editor for a specific widget that you might deploy to your WordPress-based blog)—using this technique, each class could perform its own inspection of the context (<em>e.g.</em>, the DOM fragment representing the widget) and depending on the outcome of the inspection, assign itself as the appropriate handler—and all without creating an instance of a given class until it is needed.  Marvelous!</p>
<p>But this approach is not without some dangers and does require careful attention to detail and some discipline.  Because you&#8217;re invoking the specified method from the prototype, you should assume that the method is <em>not</em> &#8220;scope safe&#8221;.  This is not to say that <code>this</code> is unsafe; but <code>this</code> might not be what you think it is.  You can still tap into <code>this</code> in your &#8220;static&#8221; method, but you better be damn certain that your <code>this</code> is what you need it to be and that whatever it is you&#8217;re trying to access was declared as part of that object&#8217;s prototype.  As for the method itself, the arguments passed to the function become of critical importance for how the method returns.  But, if you are aware of the possible scope issues, and engineer the &#8220;static&#8221; method in such a way that it is sufficiently scope agnostic, then invoking methods from the prototype in this manner can be a powerful technique to add to your JavaScript repertoire.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2010/06/faking-it/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>my remarkable ability to summarize</title>
		<link>http://blog.founddrama.net/2010/04/my-remarkable-ability-to-summarize/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=my-remarkable-ability-to-summarize</link>
		<comments>http://blog.founddrama.net/2010/04/my-remarkable-ability-to-summarize/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 23:02:22 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[summary]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=4553</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p align="center"><a title="The product of the last two months of programming, depicted h... on Twitpic" href="http://twitpic.com/1g2dmk"><img src="http://twitpic.com/show/full/1g2dmk.jpg" alt="The product of the last two months of programming, depicted h... on Twitpic" width="320" height="240" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2010/04/my-remarkable-ability-to-summarize/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>review: High Performance JavaScript</title>
		<link>http://blog.founddrama.net/2010/04/review-high-performance-javascript/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=review-high-performance-javascript</link>
		<comments>http://blog.founddrama.net/2010/04/review-high-performance-javascript/#comments</comments>
		<pubDate>Wed, 14 Apr 2010 00:32:05 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[High Performance JavaScript]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nicholas Zakas]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=4545</guid>
		<description><![CDATA[While reading Nicholas Zakas&#8217; High Performance JavaScript, it occurred to me that there were actually two different reviews that I wanted to write. So, rather than try to reconcile them into one review, I&#8217;ll simply apply them here as an ordered list. (1) To continue with the JavaScript University metaphor (from my review of Zakas&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/059680279X?ie=UTF8&amp;tag=founddramadot-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=059680279X"><img class="alignright size-full wp-image-4546" title="High Performance JavaScript by Nicholas Zakas et al." src="http://blog.founddrama.net/wp-content/uploads/2010/04/059680279X.jpeg" alt="" width="122" height="160" /></a><img class="amazon-beacon" src="http://www.assoc-amazon.com/e/ir?t=founddramadot-20&amp;l=as2&amp;o=1&amp;a=059680279X" border="0" alt="" width="1" height="1" />While reading Nicholas Zakas&#8217; <em><a href="http://www.amazon.com/gp/product/059680279X?ie=UTF8&amp;tag=founddramadot-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=059680279X">High Performance JavaScript</a></em>, it occurred to me that there were actually two different reviews that I wanted to write.  So, rather than try to reconcile them into one review, I&#8217;ll simply apply them here as an ordered list.</p>
<p>(1)  To continue with the JavaScript University metaphor (from <a href="http://blog.founddrama.net/2010/02/my-new-javascript-vade-mecum/">my review</a> of Zakas&#8217; <em><a href="http://www.amazon.com/gp/product/047022780X?ie=UTF8&amp;tag=founddramadot-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=047022780X">Professional JavaScript for Web Developers</a><img class="amazon-beacon" src="http://www.assoc-amazon.com/e/ir?t=founddramadot-20&amp;l=as2&amp;o=1&amp;a=047022780X" border="0" alt="" width="1" height="1" /></em>):  Finals are coming up in <a href="http://www.amazon.com/gp/product/0596517742?ie=UTF8&amp;tag=founddramadot-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596517742">Prof. Crockford&#8217;s upper-division JavaScript class</a><img class="amazon-beacon" src="http://www.assoc-amazon.com/e/ir?t=founddramadot-20&amp;l=as2&amp;o=1&amp;a=0596517742" border="0" alt="" width="1" height="1" />.  You&#8217;ve been a diligent student all semester and although you&#8217;re not failing, it always seems like you&#8217;re somewhere in the middle of the pack.  You want desperately to ace the final exam, so you reach out for some help.  Zakas (the graduate student/teaching assistant for the class) offers to show you the thesis he is working on.  Then <em>It</em> hits you like a bolt from the blue &#8212; every bit of it resonates with you.  &#8220;It&#8217;s so simple! so clear!&#8221; you exclaim.  The inner machinations of the language snap together in a way that makes it all feel new and exciting &#8212; the possibilities are boundless!  You go back over your notes.  You were close &#8212; oh so close &#8212; the whole time.  But the last little bits drop in.  A refinement here, a re-factor there&#8230; and the next thing you know, things are blazing.  Your pages load 60% faster, execution time is down an average of 40%.  You&#8217;re amazed at yourself.  And when the grades for the final exam come back, you&#8217;re pleased to see that you aced it (aside from that little Oops on scoping closures &#8212; but you try to think of that as a conscious trade-off).  Prof. Crockford is pleased (if a little disappointed that it took you this long to <em>Get It</em>) and you&#8217;re the envy of your peers.  At least until <a href="http://www.amazon.com/gp/product/0596520689?ie=UTF8&amp;tag=founddramadot-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596520689">next semester&#8217;s RegEx class with Prof. Levithan</a><img class="amazon-beacon" src="http://www.assoc-amazon.com/e/ir?t=founddramadot-20&amp;l=as2&amp;o=1&amp;a=0596520689" border="0" alt="" width="1" height="1" />.  [Rated:  ★★★★★]</p>
<p>(2)  The frustrating part about working at a well-organized shop is that you get yourself all excited for a book like this and then half the recommendations in there are things that you&#8217;re already doing.  Put scripts at the bottom of the document?  Check.  <a href="http://developer.yahoo.com/yui/compressor/">Minify</a> and <a href="http://www.gzip.org/">compress</a>?  Check.  Concatenate and package?  Check.  So on the one hand you say:  &#8220;I guess I can sleep a little easier at night knowing that our build system adheres to the best practices recommended by the experts out there.&#8221;  But on the other hand, you&#8217;re a little disappointed because you were hoping for some startling revelations.  Again:  not that this makes it without merit.  From this perspective, what is noteworthy about this book is that these best practices and techniques are all gathered up in one place and presented in a logical order; even if &#8220;you&#8217;re already doing it right&#8221;, it is still a worthwhile exercise to meditate on the specifics, and to really go deep on why these best practices are important.  (Plus, it&#8217;s great to see the data &#8212; nothing beats a little chartporn for proving the point.) [Rated:  ★★★★]</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2010/04/review-high-performance-javascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>my new JavaScript vade mecum</title>
		<link>http://blog.founddrama.net/2010/02/my-new-javascript-vade-mecum/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=my-new-javascript-vade-mecum</link>
		<comments>http://blog.founddrama.net/2010/02/my-new-javascript-vade-mecum/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 01:34:16 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[book]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Nicholas P. Zakas]]></category>
		<category><![CDATA[review]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=4418</guid>
		<description><![CDATA[While I was reading this, I liked to imagine that I was at university and that Douglas Crockford was the insanely popular genius professor that showed up late for lectures, and then either spoke too fast or else mumbled a lot, and then locked himself in his office refusing to answer the door during office [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.amazon.com/gp/product/047022780X?ie=UTF8&amp;tag=founddramadot-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=047022780X"><img class="alignright size-full wp-image-4419" title="Zakas' Professional JavaScript for Web Developers" src="http://blog.founddrama.net/wp-content/uploads/2010/02/047022780X.jpeg" alt="" width="127" height="160" /></a><img class="amazon-beacon" src="http://www.assoc-amazon.com/e/ir?t=founddramadot-20&amp;l=as2&amp;o=1&amp;a=047022780X" border="0" alt="" width="1" height="1" />While I was reading this, I liked to imagine that I was at university and that Douglas Crockford was the insanely popular genius professor that showed up late for lectures, and then either spoke too fast or else mumbled a lot, and then locked himself in his office refusing to answer the door during office hours while he worked on his Next Big Thing that would make everyone oooh and aaah and validate his brilliance.  Meanwhile, in that same imaginary university, Nicholas Zakas was the graduate student that served as the TA to that class—and he happened to be equally brilliant and super-accessible and willing to take the time out to explain it all in a way that was thorough and comprehensible.</p>
<p>So that being said, if you consider yourself or would like to consider yourself a professional front-end engineer for web applications (or in any way want to become a JavaScript expert), I cannot recommend this book enough.  On the one hand, you have Crockford&#8217;s <em><a href="http://www.amazon.com/gp/product/0596517742?ie=UTF8&amp;tag=founddramadot-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=0596517742">The Good Parts</a><img style="border: none !important; margin: 0px !important; padding: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=founddramadot-20&amp;l=as2&amp;o=1&amp;a=0596517742" border="0" alt="" width="1" height="1" /></em>—which does a great job of eviscerating JavaScript while at the same time extracting its (well&#8230;) its Good Parts—but it&#8217;s like someone ran the text through a minification utility and made it tokenized and super-dense and stripped out all the comments.  And on the other hand, you have Zakas&#8217; <em><a href="http://www.amazon.com/gp/product/047022780X?ie=UTF8&amp;tag=founddramadot-20&amp;linkCode=as2&amp;camp=1789&amp;creative=390957&amp;creativeASIN=047022780X">Professional JavaScript for Web Developers</a><img style="border: none !important; margin: 0px !important; padding: 0px !important;" src="http://www.assoc-amazon.com/e/ir?t=founddramadot-20&amp;l=as2&amp;o=1&amp;a=047022780X" border="0" alt="" width="1" height="1" /></em> which one might describe as <em>The Good Parts (the long version)</em>.</p>
<p>What Zakas gives us—while assuming that you are already doing some professional JavaScript web development—is a good overview of JavaScript/ECMAScript, with special care given to make the text practical.  This is not strictly an academic exercise; he is careful to make sure that each example applies to real world scenarios (<em>i.e.</em>, web apps running in a browser) and that you are able to take away something useful and meaningful from the text&#8217;s discussion.  In other words, he provides a road map for how to make the most of JavaScript as a language and how to make it work in all the convoluted, counter-intuitive situations that you are basically guaranteed to encounter.</p>
<p>In a nutshell, if you are doing professional web development on the front end, this book needs to be on your desk.  I can&#8217;t wait to check out his next book&#8230;</p>
<p><strong>BONUS ROUND:</strong> <a href="http://twitter.com/slicknet/status/8646359042">Zakas says</a> that <a href="http://p2p.wrox.com/content/blogs/jminatel/24-wrox-drm-free-ebooks-available-now-introductory-discount">Wrox has made this book available</a> as a DRM-free ebook.</p>
<p><strong>DOUBLE BONUS ROUND:</strong> Apparently, <a href="http://twitter.com/slicknet/status/8690438163">I made the man laugh</a>.</p>
<p><strong>TRIPLE BONUS ROUND:</strong> <a href="http://twitter.com/slicknet/status/11154692061">Shout from the man himself</a>, albeit with a pointer to this review as it appears on Amazon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2010/02/my-new-javascript-vade-mecum/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>getting academic on the JavaScript Array</title>
		<link>http://blog.founddrama.net/2010/02/getting-academic-on-the-javascript-array/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=getting-academic-on-the-javascript-array</link>
		<comments>http://blog.founddrama.net/2010/02/getting-academic-on-the-javascript-array/#comments</comments>
		<pubDate>Fri, 05 Feb 2010 04:01:28 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Array]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=4405</guid>
		<description><![CDATA[An experiment (in part to settle something of academic debate); what is faster new Array() or []?  The function for the test case: function makeSomeArrays(){ var outputter = function(fn){ var ts = new Date().getTime(); fn(); var te = new Date().getTime(); console.log("total time: " + (te-ts)/1000 + " seconds"); }; // 1 million: var L = [...]]]></description>
			<content:encoded><![CDATA[<p>An experiment (in part to settle something of academic debate); what is faster <tt>new Array()</tt> or <tt>[]</tt>?  The function for the test case:</p>
<pre name="code" class="js">function makeSomeArrays(){
	var outputter = function(fn){
		var ts = new Date().getTime();
		fn();
		var te = new Date().getTime();
		console.log("total time: " + (te-ts)/1000 + " seconds");
	};

	// 1 million:
	var L = 1000000;

	// use Array constructor; push L new arrays...
	var test1 = function(){
		var a = new Array();
		for (var i=0; i&lt;l ; i++) {
			a.push(new Array());
		}
	};

	// same as above - but in each case, declare a length to the array
	var test2 = function(){
		var a = new Array(L);
		for (var i=0; i&lt;L; i++) {
			a.push(new Array(0));
		}
	};

	// same as above but via index assignment
	var test3 = function(){
		var a = new Array(L);
		for (var i=0; i&lt;L; i++) {
			a[i] = new Array(0);
		}
	};

	// for 4-6: replace Array constructor w/ Array literal notation
	// except where declaring a length (container array, 5 + 6)
	var test4 = function(){
		var a = [];
		for (var i=0; i&lt;L; i++) {
			a.push([]);
		}
	};

	var test5 = function(){
		var a = new Array(L);
		for (var i=0; i&lt;L; i++) {
			a.push([]);
		}
	};

	var test6 = function(){
		var a = new Array(L);
		for (var i=0; i&lt;L; i++) {
			a[i] = [];
		}
	};

	var tests = [test1, test2, test3, test4, test5, test6];

	for (var j=0; j&lt;tests.length; j++) {
		console.info("test #" + (j+1) + ":");
		outputter(tests[j]);
	}
}</pre>
<p>Yes, I realize that test #2 and test #5 result in an array with a length of 2,000,000 (vs. 1,000,000 for the other 4 tests).</p>
<p>Now for some chart porn; results:</p>
<p style="text-align: center;"><a href="http://blog.founddrama.net/wp-content/uploads/2010/02/how-fast-is-your-array1.png"><img class="alignnone size-medium wp-image-4412" title="How fast is your Array()?" src="http://blog.founddrama.net/wp-content/uploads/2010/02/how-fast-is-your-array1-299x168.png" alt="" width="299" height="168" /></a></p>
<p>As usual in these kinds of performance tests, shorter bars mean better/faster performance.  (And yes, test case #5 was wildly out-of-scale when run in Firefox.)</p>
<p>Test case #3 wins out in Firefox (1.536 seconds), but test case #6 wins in both Chrome and Safari (0.313 and 0.397 seconds, respectively).  Interestingly, Safari out-performed Chrome in 4 of the 6 test cases; but Chrome came out on top overall with that 0.313 second figure for test case #6.  The trick seems to be in assigning a length to the array and then assigning values to the indices instead of just pushing the values onto the end.</p>
<p>But this seems to wind up not answering the original question about <tt>Array()</tt> vs. <tt>[]</tt>.  So really quickly (in Chrome), I re-ran test #6 with a new &#8220;test #7&#8243; that replaced <tt>a[i] = []</tt> with <tt>a[i] = new Array()</tt>.  Console output:</p>
<blockquote>
<pre>test #6:
total time: 0.405 seconds
test #7:
total time: 0.892 seconds</pre>
</blockquote>
<p>Oh wait&#8230; that was basically the same as test #3&#8230;  Hooray for Array literals!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2010/02/getting-academic-on-the-javascript-array/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>too many titles, or: AppleScript&#8217;s greedy tab title setting in the Terminal</title>
		<link>http://blog.founddrama.net/2010/01/applescripts-greedy-tab-title-setting-in-the-terminal/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=applescripts-greedy-tab-title-setting-in-the-terminal</link>
		<comments>http://blog.founddrama.net/2010/01/applescripts-greedy-tab-title-setting-in-the-terminal/#comments</comments>
		<pubDate>Sun, 10 Jan 2010 00:43:55 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[osascript]]></category>
		<category><![CDATA[shell script]]></category>
		<category><![CDATA[Terminal]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=4346</guid>
		<description><![CDATA[On a regular basis (talking &#8220;daily, all day&#8221; here), I run n tabs in an open Terminal window where n &#62; 1 (and usually n &#62; 4).  And so each time I open up on these tabs and cd into the directory I need, I&#8217;m hitting ⌘⇧i to set a custom title on that tab; [...]]]></description>
			<content:encoded><![CDATA[<p>On a regular basis (talking &#8220;daily, all day&#8221; here), I run <em>n</em> tabs in an open Terminal window where <em>n</em> &gt; 1 (and usually <em>n</em> &gt; 4).  And so each time I open up on these tabs and <tt>cd</tt> into the directory I need, I&#8217;m hitting <tt>⌘⇧i</tt> to set a custom title on that tab; and 99% of the time, that custom title is the last node in the <tt>pwd</tt> output.  So what I was thinking was to set up a little shell script, backed by an AppleScript to:</p>
<ol>
<li><tt>cd</tt> into a specified directory;</li>
<li>get the title I want via <tt>pwd | cut -d'/' -f5</tt>;</li>
<li>and pass that as an argument to AppleScript (via <tt>osascript</tt> in the shell script) to have it set as the title of the tab.</li>
</ol>
<p>The shell script piece ought to be easy enough:</p>
<blockquote><p><tt> </tt></p>
<p><tt></tt></p>
<p><tt></tt></p>
<p><tt></tt></p>
<p><tt></tt></p>
<p><tt></p>
<pre>alias mycd="cd /path/to/directory/of/interest;
    osascript ~/Library/Scripts/set-terminal-tab-title.scpt
    `pwd | cut -d'/' -f5`;"</pre>
<p></tt></p></blockquote>
<p>And the AppleScript ought to look something like:</p>
<blockquote><p><tt></tt></p>
<p><tt></tt></p>
<p><tt></tt></p>
<p><tt></tt></p>
<p><tt></tt></p>
<p><tt></p>
<pre>on run argv
  tell application "Terminal"
    set terms to every window in application "Terminal"
    repeat with term in terms
      if term is frontmost then
        set tTabs to every tab in term
        repeat with tTab in tTabs
          if tTab is selected then
            set cTitle to item 1 of argv
            set custom title of tTab to cTitle
          end if
        end repeat
      end if
    end repeat
  end tell
end run</pre>
<p></tt></p></blockquote>
<p>&#8230;and this almost works.  Almost but not quite.</p>
<p>First:  let&#8217;s gripe about how verbose AppleScript is.  Loop through every window to find the frontmost?  And then loop through every tab to find the selected tab?  Apparently this is what I need to do.  Now, accepting that and moving on&#8230;</p>
<p>The first thing that breaks down in practice is the <tt>pwd</tt> code cribbed from Stack Overflow.  Throwing that into the command line gives me what I want.  And executing that within backticks to generate the output to the osascript&#8217;s argument works.  But it doesn&#8217;t work when wrapped up in the alias.  What&#8217;s frustrating though is if I pass a string literal there, the AppleScript accepts that.</p>
<p>Rock and roll, right?  Wrong.</p>
<p>Doing this for the first tab (let&#8217;s call it &#8220;interest&#8221;) seems just fine.  Start the second tab (let&#8217;s call it &#8220;interest2&#8243;) and do it there and both tabs are now named the same thing (&#8220;interest2&#8243;).  Do a third tab (&#8220;interest3&#8243;) and now they&#8217;re all &#8220;interest3&#8243;.  Well this is a drag!</p>
<p>Quit Terminal and start over&#8230;  What?  The new window is named &#8220;interest3&#8243;?  How can this be?  It would appear that setting the custom title on the selected tab is actually reaching into the application&#8217;s preferences and setting a custom title there and applying it app-wide and then <em>permanently saving it</em> as a preference.  So it seems I have two problems.</p>
<ol>
<li>How do I get the standard output actually passed as the argument to the osascript?</li>
<li>How do I get it to only set the title on the tab?</li>
</ol>
<p>Any takers?  Thoughts?  Suggestions?</p>
<p><b>UPDATED 7/7/2010:</b>  Thanks to all the helpful suggestions.  Turns out however that AppleScript was not the way to go at all.  Setting <code>PS1</code> in my <code>.profile</code> turned out to be the winner:</p>
<pre name="code">PS1='\[\033]0;`(basename $(pwd))`\007\]\n[\t \w]\n\u@\h $ '</pre>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2010/01/applescripts-greedy-tab-title-setting-in-the-terminal/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>&#8220;Is it a button?&#8221;</title>
		<link>http://blog.founddrama.net/2009/12/is-it-a-button/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=is-it-a-button</link>
		<comments>http://blog.founddrama.net/2009/12/is-it-a-button/#comments</comments>
		<pubDate>Tue, 08 Dec 2009 17:24:53 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[button]]></category>
		<category><![CDATA[buttons]]></category>
		<category><![CDATA[gui]]></category>
		<category><![CDATA[ui]]></category>
		<category><![CDATA[user experience]]></category>
		<category><![CDATA[user interface]]></category>
		<category><![CDATA[ux]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=4230</guid>
		<description><![CDATA[It started simply enough.  A simple question:  &#8221;Is it a button?&#8221;  Referring to this: This is (of course) the &#8220;All Sizes&#8221; button for any given photo on Flickr.  And (also &#8220;of course&#8221;) depending on how pedantic you want to get and/or how technical, it&#8217;s arguably not a button at all: &#8230;it&#8217;s an &#60;a&#62; masquerading as [...]]]></description>
			<content:encoded><![CDATA[<p>It started simply enough.  A simple question:  &#8221;Is it a button?&#8221;  Referring to this:</p>
<p align="center"><img class="alignnone size-full wp-image-4243" title="Flickr's &quot;All Sizes&quot; button" src="http://blog.founddrama.net/wp-content/uploads/2009/12/flickr-all-sizes-button.png" alt="Flickr's &quot;All Sizes&quot; button" width="103" height="71" /></p>
<p>This is (of course) the &#8220;All Sizes&#8221; button for any given photo on Flickr.  And (also &#8220;of course&#8221;) depending on how pedantic you want to get and/or how technical, it&#8217;s arguably not a button at all:</p>
<p align="center"><a href="http://blog.founddrama.net/wp-content/uploads/2009/12/flickr-anchor-as-button.png"><img class="alignnone size-medium wp-image-4245" title="Flickr &lt;a&gt; as button" src="http://blog.founddrama.net/wp-content/uploads/2009/12/flickr-anchor-as-button-300x187.png" alt="Flickr &lt;a&gt; as button" width="300" height="187" /></a></p>
<p>&#8230;it&#8217;s an <tt>&lt;a&gt;</tt> masquerading as a <tt>&lt;button&gt;</tt>?  Or is its &#8220;buttonness&#8221; defined by its appearance?  Or is it defined by its function?  Or by some other, harder to define, harder to quantify quality?<span id="more-4230"></span></p>
<p>It&#8217;s an interesting question.  On the web—where anything can &#8220;be a button&#8221;—what makes something a button?  What instills an object with &#8220;buttonness&#8221;?  Let&#8217;s try a few definitions on for size:</p>
<ol>
<li><strong>Only a </strong><tt><strong>&lt;button&gt;</strong></tt><strong> is a button.</strong> If we wanted to be strict about it, this gives us a good baseline.  Only that won&#8217;t work in any practical sense because then hardly any modern site actually has a button.</li>
<li><strong>Any </strong><tt><strong>&lt;input&gt;</strong></tt><strong> element in the DOM with a </strong><tt><strong>type</strong></tt><strong> of </strong><tt><strong>button</strong></tt><strong>, </strong><tt><strong>reset</strong></tt><strong>, or </strong><tt><strong>submit</strong></tt><strong>.</strong> (And maybe also <tt>type</tt> of <tt>image</tt>?)  Again, this is a decent &#8220;strict&#8221; definition to use as a baseline but probably not one that is terribly practical.  But certainly this gets us closer.  Some flexibility in the input types.  But still, when I looked at Amazon.com&#8217;s homepage, I saw only two <tt>&lt;input&gt;</tt> elements in the mark-up—and neither was a button.  But this arguably isn&#8217;t a terribly good definition for a button anyway because you&#8217;re still just one line of CSS away from having an invisible button.  (And what good is an invisible button?)</li>
<li><strong>If it looks like a button (and quacks like a button?) then it must be a button.</strong> Sufficiently vague?  This starts to feel more correct though.  Someone needs to be able to look at something and say &#8220;when I click on this, something will happen&#8221;.</li>
</ol>
<p>But that brings us around to our original question:  is it more the <em>look</em> of the thing that makes it a button? or is it the <em>action</em> of the thing that makes it a button?  We know that it can&#8217;t be a strictly technical, strictly mark-up definition—because then hardly anyone would have buttons.  Where then is the middle ground?  What bastardized hybridization of links and graphics and input mark-up and JavaScript turn a &#8220;simple link&#8221; into button?</p>
<p>Because a link isn&#8217;t a button, right?  Unless it <em>is</em> a button?</p>
<p>Let&#8217;s agree to disagree here; let&#8217;s at least settle on this much:  there are going to be some times when a link and a button are visually indistinguishable from each other; and there will be times when a link and a button will be behaviorally indistinguishable from each other.  So perhaps we can start with this premise to at least differentiate these two concept (maybe un-muddy the waters a little bit):</p>
<blockquote><p>A <strong>link</strong> is a navigational tool that moves the user between separate pages (and not necessarily within a given site) with no expectation other than acting on that navigation; a <strong>button</strong> acts on an object within the page and the user expects some non-abstract contextual change as a consequence of acting through that button.</p></blockquote>
<p>That being said, from a functional perspective, &#8220;buttonness&#8221; comes from performing an action.  (Any action?)  What about format then?  What is the shape that a button takes?</p>
<p>A couple of questions come to mind almost immediately:</p>
<ul>
<li><em>Must</em> a button have a border?  If not, do you embellish in some other way?</li>
<li>Will your buttons have icons?  Always?</li>
<li>Will your buttons have text?  Always?</li>
<li>Do your buttons ever contain (or is it &#8220;conceal&#8221;?) a menu of additional/alternate/secondary actions?</li>
<li>Are buttons always bound to toolbars?  Or can they show up anywhere?</li>
</ul>
<p>In other words:  not so obvious, not so straightforward.</p>
<p>A few cases to consider:</p>
<p><strong>Flickr.com</strong></p>
<p>It was their button example that started this whole thing; <em>vide supra</em>.  Their design seems to eschew &#8220;buttons&#8221; in favor of action-bound &#8220;links&#8221; (<em>e.g.</em>, &#8220;Add a Person&#8221;, or &#8220;Add a Tag&#8221;).  Where they have buttons (which are not actually <tt>&lt;button&gt;</tt> elements but <tt>&lt;a&gt;</tt> elements), the buttons are borderless and ghosted until you hover over them; and they&#8217;re lined up as though they are in a toolbar but—if you have a portrait-oriented image—that invisible toolbar may extend beyond the boundary of the image (<em>i.e.</em>, the object that those buttons act upon).  And then there&#8217;s the buttons bound to the comment form—which are blue and have no border but are <tt>&lt;input&gt;</tt> elements.  But OK—I&#8217;ve heard that the Flickr team are heretics.</p>
<p><strong>Amazon.com</strong></p>
<p>Again, a design that seems to eschew buttons in favor of links.  But where we do have buttons, they appear to be graphics that are both bordered and embellished in such a way that they &#8220;come off&#8221; the page (<em>i.e.</em>, with that raised plasticky 3D look) and they&#8217;re bound to specific <a href="http://blog.founddrama.net/wp-content/uploads/2009/12/amazon-carousel-button.png"> widgets like the carousel</a> (bordered, with icon, no text) or else they are bound to major actions like <a href="http://blog.founddrama.net/wp-content/uploads/2009/12/amazon-shopping-cart.png"> adding an item to the shopping cart</a> (bordered, with icon, with text).</p>
<p><strong>Facebook</strong></p>
<p>Hmm&#8230;  I see a lot of &#8220;<a href="http://blog.founddrama.net/wp-content/uploads/2009/12/facebook-links.png">links</a>&#8221; and a few &#8220;<a href="http://blog.founddrama.net/wp-content/uploads/2009/12/facebook-icons.png">icons</a>&#8221; but no&#8230;  Oh wait, there&#8217;s a <a href="http://blog.founddrama.net/wp-content/uploads/2009/12/facebook-button.png">button</a>.  (And for those keeping score: bordered, no icon, with text.)</p>
<p><strong>Google</strong></p>
<p>A <a href="http://blog.founddrama.net/wp-content/uploads/2009/12/google-naked.png">canonical example</a>?  Bordered (and with simple corners!), no icons, just the text—and no real special embellishments of any kind save for a little light gradient.  (They&#8217;re even <tt>&lt;input type="submit"&gt;</tt> elements.)</p>
<p><em>Hmm&#8230;</em> And <em>hmm</em> again.  A pattern emerges?  But does the border really make it a button?</p>
<p>Perhaps the whole thought experiment is a bit pedantic but in considering usability and user experience, the button ought to be (instantly?) recognizable.  Ultimately it comes down to having a consistent and predictable scheme across your application/site—so if you really aren&#8217;t interested in putting borders around every button then I suppose you don&#8217;t need to; perhaps always pairing icons with text is enough.  But if you&#8217;re to crib from the big successful players then we can infer that there is some magic fairy dust sprinkled onto the border.</p>
<p>For my money, I&#8217;m not a fan of the &#8220;ever-present&#8221; border—buttons are usually in toolbars (right? no?) and that ought to be enough to give away its intended purpose.  But I think I can come around on the borders.  What about you?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2009/12/is-it-a-button/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>a note about Java and OS X 10.6</title>
		<link>http://blog.founddrama.net/2009/09/a-note-about-java-and-os-x-10-6/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=a-note-about-java-and-os-x-10-6</link>
		<comments>http://blog.founddrama.net/2009/09/a-note-about-java-and-os-x-10-6/#comments</comments>
		<pubDate>Sat, 05 Sep 2009 02:59:25 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[java]]></category>
		<category><![CDATA[Snow Leopard]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=4000</guid>
		<description><![CDATA[Snow Leopard (OS X 10.6) is here, and that&#8217;s plenty exciting. All the refinements—in the UI and under the good—are getting their due play. One of those refinements: all of Java&#8217;s roads lead to 64-bit Java SE 6. If you&#8217;re not panicking (or at least a little alarmed) then don&#8217;t bother reading onward. If (however) [...]]]></description>
			<content:encoded><![CDATA[<p>Snow Leopard (OS X 10.6) is here, and that&#8217;s plenty exciting.  All the refinements—in the UI and under the good—are getting their due play.  One of those refinements:  all of Java&#8217;s roads lead to 64-bit Java SE 6.</p>
<p>If you&#8217;re not panicking (or at least a little alarmed) then don&#8217;t bother reading onward.</p>
<p>If (however) you&#8217;re asking about giving priority to the 32-bit version and/or if you&#8217;re looking for J2SE 5.0, you may find <a href="http://wiki.oneswarm.org/index.php/OS_X_10.6_Snow_Leopard">this article on the OneSwarm wiki</a> to be helpful.</p>
<ol>
<li>If all you need to do is give priority to the 32-bit mode, try launching the Java Preferences app (in <tt>/Applications/Utilities</tt>) and re-ordering the preferred modes.</li>
<li>If you need J2SE 5.0, try downloading and untarring the 1.5 version that shipped with Leopard (OS X 10.5).  The instructions from OneSwarm:
<ol>
<li><tt>cd /tmp/</tt></li>
<li><tt>wget http://www.cs.washington.edu/homes/isdal/snow_leopard_workaround/java.1.5.0-leopard.tar.gz</tt></li>
<li><tt>tar -xvzf java.1.5.0-leopard.tar.gz</tt></li>
<li><tt>sudo mv 1.5.0 /System/Library/Frameworks/JavaVM.framework/Versions/1.5.0-leopard</tt></li>
<li><tt>cd /System/Library/Frameworks/JavaVM.framework/Versions/</tt></li>
<li><tt>sudo rm 1.5.0</tt></li>
<li><tt>sudo ln -s 1.5.0-leopard 1.5.0</tt></li>
</ol>
</li>
<li>And if all else fails, don&#8217;t forget to check where your <tt>${JAVA_HOME}</tt> is pointed.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2009/09/a-note-about-java-and-os-x-10-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>font wars</title>
		<link>http://blog.founddrama.net/2009/04/font-wars/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=font-wars</link>
		<comments>http://blog.founddrama.net/2009/04/font-wars/#comments</comments>
		<pubDate>Wed, 08 Apr 2009 23:52:09 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Andale Mono]]></category>
		<category><![CDATA[Consolas]]></category>
		<category><![CDATA[font]]></category>
		<category><![CDATA[Monaco]]></category>
		<category><![CDATA[Terminal]]></category>
		<category><![CDATA[typography]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=3590</guid>
		<description><![CDATA[Mostly for Pete, a follow-up to a thread on Facebook today&#8230; The co-worker&#8217;s terminal font (click to make big): Now I used to have a big fat crush on Andale Mono but how could that be easy on the eyes?  The painfully mucky tilde, the one digit and the lowercase L practically indistinguishable!  And at [...]]]></description>
			<content:encoded><![CDATA[<p>Mostly for Pete, a follow-up to a thread on Facebook today&#8230;</p>
<p>The co-worker&#8217;s terminal font (click to make big):</p>
<div id="attachment_3591" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.founddrama.net/wp-content/uploads/2009/04/andale-mono-9pt.png"><img class="size-medium wp-image-3591" title="Andale Mono 9pt" src="http://blog.founddrama.net/wp-content/uploads/2009/04/andale-mono-9pt-300x262.png" alt="Andale Mono 9pt" width="300" height="262" /></a><p class="wp-caption-text">Andale Mono 9pt</p></div>
<p>Now I used to have a big fat crush on Andale Mono but how could <em>that</em> be easy on the eyes?  The painfully mucky tilde, the one digit and the lowercase L practically indistinguishable!  And at 9pt?  Holy cow that&#8217;s tiny.</p>
<p>Now Pete&#8217;s:</p>
<div id="attachment_3592" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.founddrama.net/wp-content/uploads/2009/04/monaco-10pt.png"><img class="size-medium wp-image-3592" title="Monaco 10pt" src="http://blog.founddrama.net/wp-content/uploads/2009/04/monaco-10pt-300x290.png" alt="Monaco 10pt" width="300" height="290" /></a><p class="wp-caption-text">Monaco 10pt</p></div>
<p>A wiser choice.  The one digit and the lowercase L are more distinct (though the latter is not all that distinct from the pipe).  A nice swoosh to the tilde.  And even at 10pt, it is nice and legible.  Still, there&#8217;s something about Monaco that&#8217;s always been a little unsettling to me.  Like the legs on the lowercase M are too bunched together maybe&#8230;?  Never could put my finger on it.</p>
<p>Now, Consolas, that&#8217;s the fixed-width font for me:</p>
<div id="attachment_3593" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.founddrama.net/wp-content/uploads/2009/04/consolas-14pt.png"><img class="size-medium wp-image-3593" title="Consolas 14pt" src="http://blog.founddrama.net/wp-content/uploads/2009/04/consolas-14pt-300x272.png" alt="Consolas 14pt" width="300" height="272" /></a><p class="wp-caption-text">Consolas 14pt</p></div>
<p>Now I know what you&#8217;re going to say.  <em>&#8220;Weren&#8217;t you just busting on Andale Mono for the one digit and the lowercase L being too similar-looking?&#8221;</em> Yes.  But there&#8217;s always that risk.  I find the &#8220;1&#8243; and the &#8220;l&#8221; here to be sufficiently distinct.  Especially at that luxurious 14pt.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2009/04/font-wars/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Git with it!</title>
		<link>http://blog.founddrama.net/2009/03/git-with-it/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=git-with-it</link>
		<comments>http://blog.founddrama.net/2009/03/git-with-it/#comments</comments>
		<pubDate>Fri, 27 Mar 2009 00:38:10 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[git]]></category>
		<category><![CDATA[GitHub]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=3526</guid>
		<description><![CDATA[Partly for my own enjoyment and partly to respond to Tweets from two friends of mine, I&#8217;d like to write a little bit about my experience with the Git source control manager. Before we get too far in this process though, let&#8217;s get one thing out in the open.  I&#8217;m probably the least technical developer out [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignleft size-full wp-image-3532" title="git logo" src="http://blog.founddrama.net/wp-content/uploads/2009/03/git-logo.gif" alt="git logo" width="132" height="106" />Partly for my own enjoyment and partly to respond to Tweets from <a href="http://twitter.com/scottmccracken/status/1385737932">two</a> <a href="http://twitter.com/lepht/status/1385507061">friends</a> of mine, I&#8217;d like to write a little bit about my experience with the <a href="http://git-scm.com/">Git</a> source control manager.</p>
<p>Before we get too far in this process though, let&#8217;s get one thing out in the open.  I&#8217;m probably the least technical developer out there.  I&#8217;ve used <a href="http://subversion.tigris.org/">Subversion</a> &#8220;lightly&#8221; for <a href="http://blog.founddrama.net/colophon/ortho/">a simple development project</a> for about two years and CVS at the office for only about the past six months or so.  So keep that in mind as we move forward here:  my frame of reference is not a terribly technical one and is likely not to answer any burning questions that you may have about branching or anything else that moves into terribly complex terrain.</p>
<p>That said, my thoughts <em>re</em> Git <em>versus</em> Subversion and/or CVS?</p>
<p><strong>LOVE IT.</strong><span id="more-3526"></span></p>
<p>From a strictly user-experience perspective, Git is a simpler, friendlier source control system.  It seems to be a little more forgiving of your blunders and makes it easy to back yourself out of a corner if needs be.  It&#8217;s less worried about your conflicts because those are <em>your</em> conflicts until you try to push those commits up to the origin (the central, master repository).</p>
<p><img class="alignright size-full wp-image-3534" title="Git has its own Domo Kun?" src="http://blog.founddrama.net/wp-content/uploads/2009/03/git-domo-kun.gif" alt="Git has its own Domo Kun?" width="230" height="106" />&#8220;What?&#8221; (you ask) &#8220;Central, master repository?&#8221;</p>
<p>Yes, that&#8217;s right.  By all accounts, Git is a <em>distributed</em> versioning system.  From the Git website:</p>
<blockquote><p>Every Git clone is a full-fledged repository with complete history and full revision tracking capabilities, not dependent on network access or a central server. Branching and merging are fast and easy to do.</p></blockquote>
<p>The way I like to think of this:  every time you check out the project from the origin, you are creating a branch.  And all the development that you do on the project, every commit that you make, is committed only to that branch.  And when you&#8217;re satisfied with your changes, you push those commits to the origin.  Coming from Subversion and CVS, it feels like making a whole bunch of low-risk &#8220;micro&#8221; commits and then one great big giant commit to push all those changes back up to the central repository.</p>
<p>So what about branching then?  Well, I haven&#8217;t really done that yet.  Part of the reason for trying Git in the first place was because I was having a bear of a time getting branching and tagging to work properly under Subversion.  If I was wrestling that much with Subversion&#8217;s branching anyway, why not just Git a whirl?  Which is approximately where I&#8217;m at right now.  Again, each checkout feels like its very own branch.  Now, I&#8217;m at least smart enough to know that these are not true branches.  I&#8217;ll get there at some point.  But for now I&#8217;m just glad to be using a version control system that doesn&#8217;t bitch me out every time I try to commit a file.</p>
<p>While we&#8217;re on the subject&#8230;  Publishing/deploying projects has also proven to be much easier compared to the strategy I had going for Ortho under Subversion.  Under Subversion, I did my work, updated to resolve conflicts, made my commits, then SSH&#8217;d into my web host to re-checkout the project into its correct directory — and then hope that <em>that</em> did not introduce conflicts into the published version.  With Git, it seems like all of those conflicts are resolved cleanly and <em>stay</em> resolved once your changes pushed into the origin.  It seems to me that this because you resolve your conflicts in your distribution of the repository before Git will even let you push those changes into the origin.  At least, in my limited experience thus far, Git seems to politely decline when you try to do something unwise.  Anyway, my points is that you can feel about what is in the origin — <em>that</em> is nice and stable — so when you want to deploy, just go to the location for your deployment (<em>e.g.</em>, in my example case <tt>$WORDPRESS/themes/ortho</tt>) and type: <tt>git pull git://github.com/founddrama/ortho.git</tt></p>
<p>Bam.  A cleaner deployment there never was.</p>
<p>An exhaustive review?  Hardly.  Detailed and technical?  Not a chance.  Nevertheless, those are my (amazingly, uniformly) positive impressions of Git after spending about a week with it.</p>
<p><small>For other impressions on Git, try <a href="http://www.webdesignerdepot.com/2009/03/intro-to-git-for-web-designers/">this write-up on Webdesinger Depot</a>.  And if you&#8217;ve decided to try out Git, do yourself a favor and download <a href="http://zrusin.blogspot.com/2007/09/git-cheat-sheet.html">Zack Rusin&#8217;s Git cheat sheet</a> post-haste.</small></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2009/03/git-with-it/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Espresso</title>
		<link>http://blog.founddrama.net/2009/03/espresso/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=espresso</link>
		<comments>http://blog.founddrama.net/2009/03/espresso/#comments</comments>
		<pubDate>Thu, 19 Mar 2009 02:30:41 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Espresso]]></category>
		<category><![CDATA[MacRabbit]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=3350</guid>
		<description><![CDATA[While banging through the home-stretch of Ortho 1.0, I decided to give MacRabbit&#8217;s Espresso editor a try. I&#8217;m &#8220;between&#8221; editors right now — feeling no special love or loyalty to any one text editor — and noting Espresso&#8217;s public beta, I decided it was worthy of some exploration. THE SHORT VERSION: I liked it alright [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://macrabbit.com/espresso/"><img class="alignright size-full wp-image-3496" title="Espresso banner icon" src="http://blog.founddrama.net/wp-content/uploads/2009/03/espresso-banner-icon.png" alt="Espresso banner icon" width="248" height="254" /></a>While banging through the home-stretch of Ortho 1.0, I decided to give <a href="http://macrabbit.com/espresso/">MacRabbit&#8217;s Espresso</a> editor a try.  I&#8217;m &#8220;between&#8221; editors right now — feeling no special love or loyalty to any one text editor — and noting Espresso&#8217;s public beta, I decided it was worthy of some exploration.</p>
<p><strong>THE SHORT VERSION:</strong> I liked it alright but there was nothing about it that blew me away.<span id="more-3350"></span></p>
<p>First, the stuff that I did like:</p>
<ol>
<li>The &#8220;lite&#8221; style previews that appear in the right-hand sidebar while editing CSS files.  That&#8217;s a nice touch.  (But what do you expect from the makers of <a href="http://macrabbit.com/cssedit/">CSSEdit</a>?)</li>
<li>The default editor font (Espresso Mono) was actually pretty easy to read and by the time I got around to writing this, I realized that I never once considered switching it to Consolas (my fixed-width favorite of &#8217;08 and &#8217;09-to-date).</li>
<li>From the sidebar:  single-click to view, double-click to add it to the workspace.</li>
<li>The cold-folding interface was cool.  I wound up not using it that much, but I liked it.</li>
<li>MacRabbit&#8217;s clever little <a href="http://blog.founddrama.net/wp-content/uploads/2009/03/macrabbit-beta-graphic.png">beta software graphic</a>.</li>
</ol>
<p>Stuff that took some getting used to:</p>
<ol>
<li>The layout.  It took me a while to get oriented.  Especially since the toolbar just seemed so&#8230; <em>sparse</em>.</li>
<li>Dirty document indication.  My first reaction is to look for the darkened center of the main window&#8217;s red &#8220;close&#8221; jewel — and if the active document is dirty then this window jewel is dirty, too.  But if you have a dirty document that is <em>not</em> the active document, but the active document is <em>not</em> dirty, then the window&#8217;s close jewel is <em>not</em> dirty.  It took me a while to realize that I should also be looking for blue dots next to the files open in the workspace.  I feel like this needs some work still.</li>
<li>Workspace vs. tabs.  I like tabbed interfaces, so that&#8217;s my own bias here.  But it took me a while to get used to the idea that Espresso&#8217;s left-hand sidebar was home to <em>all</em> the files in the <em>project</em> and also <em>all</em> the <em>open</em> files in the <em>workspace</em>.  In light of my comments about the dirty file indicators (<em>vide supra</em>), I felt that this made it too easy to forget to save documents.  (Not that Espresso doesn&#8217;t prompt you on the way out&#8230;)  Anyway:  wasn&#8217;t sold on that aspect of the interface.</li>
<li>Codesense and auto-complete seemed&#8230;  incomplete?  Example, when editing a CSS file, Espresso felt compelled to suggest all the properties in the world — just start typing (&#8220;<tt>fo</tt>&#8230;&#8221;) and then hit <tt>down</tt> a few times and <tt>enter</tt> and suddenly <tt>font-family</tt> is there.  But then the actual values for these properties were not suggested, even when there was a finite number of responses.  Not recommending <tt>Lucida Grande</tt> when I&#8217;m entering <tt>font-family</tt>?  Sure.  But not suggesting <tt>visible</tt> vs. <tt>hidden</tt> vs. <tt>collapse</tt> for <tt>visibility</tt>?  That&#8217;s not OK</li>
</ol>
<p>Stuff I didn&#8217;t like:</p>
<ol>
<li>Not enough &#8220;baked-in&#8221; syntax highlighting options.  Which shouldn&#8217;t have been a big deal because of the &#8220;sugars&#8221; and how easy it&#8217;s supposed to be to extend Espresso but&#8230;</li>
<li>&#8230;I found that it was not in fact very easy to extend Espresso.  Or perhaps more accurately, I invested entirely too much time trying to figure out how to get started writing a sugar or two of my own but it wasn&#8217;t clear.  I&#8217;m not even saying that I wanted it to be obvious but it just seemed like the documentation was buried and what little I found was poor.</li>
<li>The currently set syntax highlighting should not be buried in a menu.  That needs to be in the toolbar or in a status bar.  It needs to be immediately accessible.  Especially if your application is not &#8220;nesting&#8221; syntax highlighting.</li>
<li>Why can&#8217;t I preview my project&#8217;s images from within Espresso&#8230;?</li>
<li>The document mark-up tree in the right-hand sidebar.  At first I thought it was neat.  But eventually it just felt distracting and not terribly useful.</li>
</ol>
<p>Overall grade?  B- — it&#8217;s pretty strong for its beta phase but I didn&#8217;t see anything terribly innovative or compelling.  Which was sad because I loved the name and the icon.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2009/03/espresso/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ortho 1.0</title>
		<link>http://blog.founddrama.net/2009/03/ortho-10/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=ortho-10</link>
		<comments>http://blog.founddrama.net/2009/03/ortho-10/#comments</comments>
		<pubDate>Mon, 16 Mar 2009 01:44:49 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[Ortho]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=3478</guid>
		<description><![CDATA[Almost exactly two years ago, I first unveiled Ortho, the home-rolled custom WordPress theme that you see here.  It is named in part after the character Ortho Stice from David Foster Wallace&#8217;s novel Infinite Jest and is also a vaguely tongue-in-cheek, slightly punny nod to the squared-off corners that graced the original design. With this [...]]]></description>
			<content:encoded><![CDATA[<p>Almost exactly two years ago, I first unveiled <a href="http://blog.founddrama.net/2007/03/introducing-ortho/">Ortho</a>, the home-rolled custom WordPress theme that you see here.  It is named in part after the character Ortho Stice from David Foster Wallace&#8217;s novel <em>Infinite Jest</em> and is also a vaguely tongue-in-cheek, slightly punny nod to the squared-off corners that graced the original design.</p>
<p>With this &#8220;1.0&#8243; revision, I have tried mostly to go for some refinements.  I wanted to &#8220;widget-enable&#8221; the theme, I wanted to clean up some of the code, and ply a few other tricks to open up my future options a little bit.  I did my development primarily in Safari (with a soft-spot for Firefox) and tried to play nice with Internet Explorer.  I found that though IE7 is not nearly the nightmare that IE6 continues to be, that it still has a startling lack of support for many things; IE6 is still a nightmare but I gave myself a hard cut-off of two hours — anything that couldn&#8217;t get fixed or made to gracefully degrade got hacked out.  I conceded to use conditional comments but that was in the interest of ousting old <code>* html</code> hacks.  I looked at Ortho in Opera just for fun and in the two minutes I spent browsing, found that nothing obviously needed attention — not that I get much traffic from Opera users.</p>
<p>Some other handy technical notes for the web nerds out there:</p>
<ol>
<li>I actually bothered to run my CSS through the YUIcompressor 2.4.2.  The gains were very very small but it was still a fun exercise.</li>
<li>I still hate CSS sprites which is part of why I&#8217;m not using them here.  Also, because I&#8217;m (er&#8230;) between graphics editors right now and had no effective means of making them.</li>
<li>I&#8217;m using the <a href="http://code.google.com/apis/ajaxlibs/">Google Ajax Libraries</a> CDN-equivalent for the code jQuery here on blog.founddrama.net.  It takes some of the load off the server.  And should help for one of those tiny incremental decreases in load time.</li>
<li>I&#8217;ve kept Ortho in <a href="http://subversion.tigris.org/">Subversion</a> for the past two years and it has paid off well.  Though when it came time to deploy this site live, somehow a bunch of conflicts managed to make it into the master <code>style.css</code> file (despite the fact that I&#8217;d told SVN they were &#8220;resolved&#8221;) and that caused some panic for a few minutes.  Blargh.</li>
</ol>
<p>Anyway, I think things turned out well.  Now that it&#8217;s up, it looks like I need to fix the trackbacks but I&#8217;m otherwise quite pleased.  Hopefully the transition went smoother for you (dear reader) than it did for me.  But anyway, should look nicer, read a little easier, and so on.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2009/03/ortho-10/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>wrastlin&#8217; with IE6 float bugs</title>
		<link>http://blog.founddrama.net/2008/12/wrastlin-with-ie6-float-bugs/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=wrastlin-with-ie6-float-bugs</link>
		<comments>http://blog.founddrama.net/2008/12/wrastlin-with-ie6-float-bugs/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 21:28:57 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[float]]></category>
		<category><![CDATA[IE6]]></category>
		<category><![CDATA[Ortho]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=3164</guid>
		<description><![CDATA[I spent a little time this past weekend trying to wrap up my &#8220;for Ortho 0.5&#8243; to-do list.  Fixed a few obscure bugs, polished up a few items that had bugged me, deferred a few others to the Ortho 1.0 to-do list.  And I was basically ready to close the book on Ortho 0.5 if [...]]]></description>
			<content:encoded><![CDATA[<p>I spent a little time this past weekend trying to wrap up my &#8220;for <a href="http://blog.founddrama.net/2007/03/introducing-ortho/">Ortho</a> 0.5&#8243; to-do list.  Fixed a few obscure bugs, polished up a few items that had bugged me, deferred a few others to the Ortho 1.0 to-do list.  And I was basically ready to close the book on Ortho 0.5 if not for IE6&#8242;s various inexplicable <tt>float</tt> bugs:</p>
<p align="center"><img class="alignnone size-full wp-image-3165" title="IE6-float-right-bug" src="http://blog.founddrama.net/wp-content/uploads/2008/12/picture-2.png" alt="IE6-float-right-bug" width="379" height="338" /></p>
<p>What you see is a carved-out screenshot from <a href="http://blog.founddrama.net/2008/12/hey-facebook-breastfeeding-is-not-obscene/">this recent post</a>.  Looks fine in any decent, modern browser.  But as you can see from that screen cap, looks like shit in Internet Explorer 6.  My gut reaction is to take a page from <a href="http://daringfireball.net/colophon/">Mr. John Gruber</a>:</p>
<blockquote><p>If Daring Fireball looks like shit in your browser, you’re using a shitty browser that doesn’t support web standards. Internet Explorer, I’m looking in your direction. If you complain about this, I will laugh at you, because I do not care.</p></blockquote>
<p>But the evidence in my logs suggests that a significant-enough portion of my pages are getting served up to IE6 and so I feel like I should make a best effort to resolve something that so seriously screws up the layout.  So web standards aside, IE6 mockery aside, there was the challenge of getting things to look right.</p>
<p><span id="more-3164"></span>Now as a brief aside:  I have no intention of bending over backwards on this issue.  The site&#8217;s footer looks pretty shitty in IE6.  And probably for the same reason (<em>viz.</em> the floats) that the images do.  But the footer is way down there and generally not something that folks are spending too much time worrying about.  And so I&#8217;m spending no extra effort on the footer.  Though I, incidentally, believe that once I get this thing with the image floats figured out, the fix for the footer will seem downright trivial.</p>
<p>Now where was I?  Oh right, the float styles that are applied to the images.</p>
<p>This isn&#8217;t something that I made up on the spot back in March of &#8217;07.  I did not pull these styles out of my ass.  I did what any smart coder would do:  I ripped it off from somewhere else — somewhere where I knew it to be working.</p>
<p>Now, there is the obvious argument that ripping off code from one place and dropping it into a new context is no guarantee that it will work the way that you expect it to.  After all, you didn&#8217;t write it, so you can&#8217;t very well say that you know all of what it&#8217;s doing.  What else does it depend upon? &amp;c.</p>
<p>But let&#8217;s brush off that argument as irrelevant.  I understand these dozen-or-so lines of CSS well enough to know what they&#8217;re supposed to do, that they function well enough on their own without additional supporting code, and that I haven&#8217;t created any conflicts.</p>
<p>Or at least:  no conflicts that I know of.</p>
<p>In the screenshot above, the image has a class of <tt>alignright</tt> applied to it.  The &#8220;meat&#8221; of this class is as follows:</p>
<blockquote><p><tt>img { border: none; }<br />
.post-body img, .post-body * img {<br />
&nbsp;&nbsp;&nbsp;&nbsp;margin: 0.25em;<br />
&nbsp;&nbsp;&nbsp;&nbsp;padding: 2px;<br />
&nbsp;&nbsp;&nbsp;&nbsp;border: 1px solid #666;<br />
&nbsp;&nbsp;&nbsp;&nbsp;max-width: 100%;<br />
}<br />
img, .alignleft, .alignright { display: inline;/*forIE*/ }<br />
.alignright, img[align="right"] {<br />
&nbsp;&nbsp;&nbsp;&nbsp;float: right;<br />
&nbsp;&nbsp;&nbsp;&nbsp;margin-right: 0px;<br />
}</tt></p></blockquote>
<p>Or so it was at the time I began my examination.  I did a couple of searches for IE6 float bugs and how to resolve them.  I found a lot of stuff about sidebars, three-column layouts, and the usual forum posts with the usual litany of complaints that either go unanswered or else answered by unhelpful trolls.  I did manage to find two interesting pieces but nothing that seemed to solve the problem I was experiencing.  I was already using the &#8220;it&#8217;s so simple, it&#8217;s almost stupid&#8221; <tt>display:inline</tt> fix so I felt as though I could safely assume <em>that</em> wasn&#8217;t the answer.  So I tried&#8230;:</p>
<ol>
<li>adding <tt>clear:none</tt> to accompany <tt>display:inline</tt> (no luck)</li>
<li>adding <tt>width:auto</tt> to accompany <tt>display:inline</tt> (and though that partially helped with the otherwise unusually large size of next/previous links, I still wouldn&#8217;t call it a win)</li>
<li>adding <tt>width:auto</tt> <em>and</em> <tt>clear:none</tt> to accompany <tt>display:inline</tt> (no luck here either)</li>
</ol>
<p>Leaving me pretty much out of ideas.  Baffling!  Everything I have found so far seems to suggest that setting <tt>display:inline</tt> is enough and (where it&#8217;s not) you probably just need to set a width (e.g., <tt>width:auto</tt>) and you&#8217;re good to go.  The <tt>clear:none</tt> business was just me grasping at straws.</p>
<p>Any readers out there with ideas on this one?</p>
<p><strong>UPDATE:</strong>  In case you&#8217;re curious:  (1) I also wound up removing the <tt>position:relative</tt> from <tt>#page</tt> and (2) the current state of the CSS applied to the <tt>img</tt> elements stands as such:</p>
<blockquote><p><tt>img { border: none; width: auto; }<br />
.post-body img, .post-body * img {<br />
&nbsp;&nbsp;&nbsp;&nbsp;margin: 0.25em;<br />
&nbsp;&nbsp;&nbsp;&nbsp;padding: 2px;<br />
&nbsp;&nbsp;&nbsp;&nbsp;border: 1px solid #666;<br />
&nbsp;&nbsp;&nbsp;&nbsp;max-width: 100%;<br />
}<br />
img, .alignleft, .alignright { display: inline;/*forIE*/ }<br />
.alignright, img[align="right"] {<br />
&nbsp;&nbsp;&nbsp;&nbsp;float: right;<br />
&nbsp;&nbsp;&nbsp;&nbsp;margin-right: 0px;<br />
}</tt></p></blockquote>
<p>And again:  ideas?  Because I still can&#8217;t seem to track this down — despite trying to recreate this one from scratch by reverse engineering it.  Such a dilly of a pickle.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2008/12/wrastlin-with-ie6-float-bugs/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>blunders and near misses</title>
		<link>http://blog.founddrama.net/2008/12/blunders-and-near-misses/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=blunders-and-near-misses</link>
		<comments>http://blog.founddrama.net/2008/12/blunders-and-near-misses/#comments</comments>
		<pubDate>Wed, 17 Dec 2008 02:04:44 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[Dreamhost]]></category>
		<category><![CDATA[outage]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=3115</guid>
		<description><![CDATA[F_D was hit pretty hard since Sunday by a major outage in the Spacey cluster in the Dreamhost network.  In a nutshell:  shit was down for days. Where do we stand? As of this evening, and after lots of unacceptably bad best case scenarios described, the damage is relatively minimal.  Mail has been back solidly [...]]]></description>
			<content:encoded><![CDATA[<p>F_D was hit pretty hard since Sunday by <a href="http://www.dreamhoststatus.com/2008/12/14/spacey-filer-problems/">a major outage in the Spacey cluster</a> in the Dreamhost network.  In a nutshell:  shit was down for days.</p>
<p>Where do we stand?</p>
<p>As of this evening, and after lots of unacceptably bad best case scenarios described, the damage is relatively minimal.  Mail has been back solidly for a while; <a href="http://baby.founddrama.net/">A.&#8217;s project</a> seems to have escaped the outage with a little stress and downtime as its only casualty; this blog here has fared slightly worse.  Things seem to be back up and no data seems to have been lost but the WordPress admin app was curiously inaccessible at first.  Trawling the forums turned up a tip that recommended adding <tt>DirectoryIndex index.php</tt> to the root <tt>.htaccess</tt> file and though this appeared to buy us a ticket in, it&#8217;s horrendously slow to load the Dashboard page.  The only other thing that seems to help folks is a complete reinstallation.</p>
<p>Hmm&#8230;  I&#8217;d rather not.  Time will tell if I can live with the slow initial load or not.  I&#8217;m backing up my plugins, my custom theme, etc. in the meantime.</p>
<p>As for the hosting provider&#8230;  Dreamhost has been a pretty good value to date.  We pay next to nothing for what we&#8217;ve got through them and thus far the service has been good and the uptime tolerable.  What has me torn is that on the one hand, this inflammatory response appears in the comment thread of the related post of their system status blog:</p>
<p align="center"><a href="http://blog.founddrama.net/wp-content/uploads/2008/12/picture-1.png"><img class="alignnone size-medium wp-image-3116" title="a Dreamhost response?" src="http://blog.founddrama.net/wp-content/uploads/2008/12/picture-1-300x52.png" alt="a Dreamhost response?" width="300" height="52" /></a></p>
<p>&#8230;but it&#8217;s a comment thread so&#8230;  Really, that could have come from anywhere.  The official email response that went around was much better, talking about a full recovery of the data and a credit toward the effected accounts, etc.  Which <em>does</em> seem like an adequate response&#8230;  So again:  I guess we&#8217;ll see what happens.</p>
<p>In the meantime:  (1) Backing up and (2) any of you dear readers have any idea why that <tt>.htaccess</tt> trick would help but still jam things down to a creeping crawl?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2008/12/blunders-and-near-misses/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Automator: still a little lacking?</title>
		<link>http://blog.founddrama.net/2008/11/automator-still-a-little-lacking/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=automator-still-a-little-lacking</link>
		<comments>http://blog.founddrama.net/2008/11/automator-still-a-little-lacking/#comments</comments>
		<pubDate>Wed, 26 Nov 2008 03:59:13 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[Automator]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=3035</guid>
		<description><![CDATA[Apple&#8217;s Automator has been a mixed bag for me since its release in 2005.  For renaming a wad of files, it has been great:  select them, invoke Automator, and seconds later they&#8217;ve all been renamed to conform to the convention you had in mind.  Exported charts from Excel too large?  Pass in those files and Automator [...]]]></description>
			<content:encoded><![CDATA[<p>Apple&#8217;s <a href="http://www.apple.com/macosx/features/300.html#automator">Automator</a> has been a mixed bag for me since its release in 2005.  For renaming a wad of files, it has been great:  select them, invoke Automator, and seconds later they&#8217;ve all been renamed to conform to the convention you had in mind.  Exported charts from Excel too large?  Pass in those files and Automator can scale those down lickety split.  But if you want to get much more complicated than that&#8230;  Well, you might be out of luck.</p>
<p>But with OS X 10.5&#8242;s release, Automator got a few useful additions to make it a bit more useful.  In particular, support for variables added some flexibility that was previously impossible within the framework it provided.  <strong>So I decided to throw a little task at Automator:</strong></p>
<blockquote><p>Take my selected photos and export them to a folder on the Desktop called &#8220;4Uploadr&#8221; (and create that folder first if it isn&#8217;t already there).</p></blockquote>
<p>Straightforward enough, eh?  So I dropped in two actions:</p>
<ol>
<li>Aperture: Get Selected Images</li>
<li>Aperture: Export Versions
<ul>
<li>Destination: (Variable = ~/Desktop/4Uploadr)</li>
<li>Export Preset: JPEG &#8211; Original Size</li>
<li>Export Name Format: Current Version Name</li>
<li>Export subfolder: No folder&#8230;</li>
</ul>
</li>
</ol>
<p>Which I naïvely believed would do the trick.  Wouldn&#8217;t Automator know that if 4Uploadr didn&#8217;t exist that it was supposed to create it?  Nope.  It just quietly fails, recording in the Automator log that such a folder does not exist.  Alright, what about setting &#8220;Export subfolder&#8221; to &#8220;Custom&#8221;?  No, that only appears to output the selected images into a folder with the name &#8220;&lt;untitled&gt;&#8221;.  Perhaps there is a preference buried somewhere in there for setting &#8220;Custom&#8221; to &#8220;something useful&#8221; instead of &#8220;&lt;untitled&gt;&#8221; — but if it&#8217;s in there, I couldn&#8217;t find it.</p>
<p><strong>Unsatisfactory!</strong></p>
<p>So instead:  AppleScript to the rescue!</p>
<p>One of the variables that Automator now accepts/supports is an &#8220;AppleScript&#8221; variable wherein you set a script for Automator to execute.  In my case, I wrote a script to test for the existence of &#8220;4Uploadr&#8221; and the create it as necessary <em>before</em> exporting all those images from Aperture into it.</p>
<p><strong>The AppleScript</strong>:</p>
<p align="center"><a href="http://blog.founddrama.net/wp-content/uploads/2008/11/20081125-applescript.png"><img class="aligncenter size-thumbnail wp-image-3036" title="check4Uploadr AppleScript" src="http://blog.founddrama.net/wp-content/uploads/2008/11/20081125-applescript-150x125.png" alt="tell application..." width="150" height="125" /></a></p>
<p>That&#8217;s:</p>
<blockquote><p><code>tell application "Finder"<br />
  if "Malkovich:Users:rob:Desktop:4Uploadr" exists then<br />
    return true<br />
  else<br />
    make folder at desktop with properties {name:"4Uploadr"}<br />
  end if<br />
end tell</code></p></blockquote>
<p><strong>The Automator action:</strong></p>
<p align="center"><a href="http://blog.founddrama.net/wp-content/uploads/2008/11/20081125-automator.png"><img class="aligncenter size-thumbnail wp-image-3037" title="the-automator-action" src="http://blog.founddrama.net/wp-content/uploads/2008/11/20081125-automator-150x150.png" alt="" width="150" height="150" /></a></p>
<p>Sure enough, it worked.  It creates the folder if it&#8217;s not there, passes through quietly if it is there and then exports all the selected images from Aperture just like we would want.  A little heavier lifting than originally expected but nothing too terrible.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2008/11/automator-still-a-little-lacking/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>on WP-Footnotes</title>
		<link>http://blog.founddrama.net/2008/08/on-wp-footnotes/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=on-wp-footnotes</link>
		<comments>http://blog.founddrama.net/2008/08/on-wp-footnotes/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 01:44:51 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[plug-in]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP-Footnotes]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=2363</guid>
		<description><![CDATA[Two things to say about WP-Footnotes: (1) I love this plug-in.  Truth be told, I probably abuse it.  The right answer would be to develop a better writing style and use the footnotes only where they&#8217;re really needed.  The easy answer is: fuck that, I love my footnotes. (2) Could we have the &#8220;opening&#8221; and [...]]]></description>
			<content:encoded><![CDATA[<p>Two things to say about <a href="http://elvery.net/drzax/more-things/wordpress-footnotes-plugin/">WP-Footnotes</a>:</p>
<p>(1) I love this plug-in.  Truth be told, I probably abuse it.  The right answer would be to develop a better writing style and use the footnotes only where they&#8217;re really needed.  The easy answer is: fuck that, I love my footnotes.</p>
<p>(2) Could we have the &#8220;opening&#8221; and &#8220;closing&#8221; syntax be a configurable option?  The defaults don&#8217;t work for me and I hate having to go back through the source code and fix this every time the plug-in requires an upgrade.  Seriously, there are so many other settings in the current version that this one seems the logical next step.</p>
<p>Give us a break?</p>
<p>That is all, thanks.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2008/08/on-wp-footnotes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quicksilver and Quick Look</title>
		<link>http://blog.founddrama.net/2008/07/quicksilver-and-quick-look/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=quicksilver-and-quick-look</link>
		<comments>http://blog.founddrama.net/2008/07/quicksilver-and-quick-look/#comments</comments>
		<pubDate>Fri, 01 Aug 2008 01:17:42 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[AppleScript]]></category>
		<category><![CDATA[OS X]]></category>
		<category><![CDATA[Quick Look]]></category>
		<category><![CDATA[Quicksilver]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/?p=2407</guid>
		<description><![CDATA[My otherwise limitless love for Quicksilver has recently been tempered by a burgeoning love for the addition of Quick Look to Mac OS X in the 10.5 version.  Pre-Quick Look, Quicksilver was hands-down the fastest way to access and open files.  ⌘+Space ➟ type a few characters ➟ and you were on your way.  In some instances you still [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignright size-full wp-image-2408" title="quicksilvericon" src="http://blog.founddrama.net/wp-content/uploads/2008/07/quicksilvericon.png" alt="" width="128" height="128" />My otherwise limitless love for <a href="http://docs.blacktree.com/quicksilver/what_is_quicksilver">Quicksilver</a> has recently been tempered by a burgeoning love for the addition of <a href="http://www.apple.com/macosx/features/quicklook.html">Quick Look</a> to Mac OS X in the 10.5 version.  Pre-Quick Look, Quicksilver was hands-down the fastest way to access and open files.  ⌘+Space ➟ type a few characters ➟ and you were on your way.  In some instances you still had to wait for some Behemoth Application to open up and unfurl its many tendrils into memory.  But it was still a hell of a lot faster than navigating the Finder via mouse clicks, etc.</p>
<p>With the advent of Quick Look however, we are faced with a little bit of a conundrum.  <span id="more-2407"></span>Quicksilver is still the fastest way to locate and access those files but for many documents Quick Look provides a <em>much</em> faster way to view them.  And sometimes that&#8217;s really all that you need to do.  Spring open the document, scroll through it and find that one phrase or that one number or just confirm that it is (in fact) the document for which you&#8217;re looking.  So why add the additional 15-20 second wait while the Behemoth Application opens?  Quick Look provides an instantaneous glance at the contents.</p>
<p>It&#8217;s just too bad that Quicksilver does not provide us with a &#8220;Quick Look&#8221; action or command.  There certainly isn&#8217;t one built in.  The closest I came on my own was ⌘+Space ➟ type a few characters to find the document ➟ tab over ➟ &#8220;Reveal&#8221; ➟ and then hit Space again (this time in the Finder) to invoke Quick Look.  Faster than opening the Behemoth Application?  Yes.  But it still <em>feels</em> cumbersome, like it has a whole lot of extra steps.</p>
<p>Rather than research or experiment with alternatives myself, I let Google do the walking on my behalf and together we identified an <a href="http://www.macosxhints.com/article.php?story=20071128071402814">AppleScript-based solution over at MacOSXHints.com</a>.  Well, it&#8217;s sort of a solution.</p>
<p>The AppleScript as initially suggested references an external shell script.  Not ideal but it&#8230; works?  A clever commenter then re-factors the AppleScript to wrap the command line elements in a &#8220;do shell script&#8221; line.  Which is&#8230; better?  Both methods worked for me &#8212; though imperfectly.</p>
<p>First of all, both versions include the following line:</p>
<blockquote><p><tt>tell application Quicksilver to hide</tt></p>
</blockquote>
<p>Wrong because:</p>
<ol>
<li>The application name needs to be wrapped in double-quotes to be valid: &#8220;Quicksilver&#8221;; and</li>
<li>&#8220;hide&#8221; is not valid AppleScript (if you compile the script, you&#8217;ll notice it turns green, indicating it&#8217;s now a variable).</li>
</ol>
<p>Putting that minor gaffe aside, does it work?  Does it take the selected item and pass it to Quick Look?</p>
<p>Yes, but not without a delay.  A <em>15 second</em> delay.  So we&#8217;re not really all that better off.  The other major sticking point (for me) was that we somehow manage not to give the system&#8217;s focus over to Quick Look.  So even after the delay, even after Quick Look brings up that spreadsheet or document or whatever, when I hit &#8220;Space&#8221; again, it doesn&#8217;t dismiss the Quick Look window, it does&#8230; what?  Well, the application otherwise active in the background captures that keystroke.  So you wind up with another space in the email you were composing or accidentally clearing out the values in that spreadsheet&#8217;s cell, etc.</p>
<p>Clearly this is non-optimal.</p>
<p>I attempted to author an alternative version of the script that appeared on MacOSXHints.com with some limited results:</p>
<div id="attachment_2410" class="wp-caption aligncenter" style="width: 464px"><img class="size-full wp-image-2410" title="qsql-script" src="http://blog.founddrama.net/wp-content/uploads/2008/07/qsql-script.png" alt="An AppleScript-based Quick Look Action for Quicksilver." width="454" height="253" /><p class="wp-caption-text">An AppleScript-based Quick Look Action for Quicksilver.</p></div>
<p>Don&#8217;t bother asking why I didn&#8217;t just publish it in a copy/paste-able format because this isn&#8217;t really an improvement over the versions that appear at MacOSXHints.com.  What I &#8220;fixed&#8221;: use System Events to set Quicksilver&#8217;s &#8220;visible&#8221; to false.  What I <em>tried</em> to fix: in my experience, Quick Look appears to behave like an appendage of the Finder.  So I figured that I could <tt>tell application "Finder" to activate</tt> and that would give the space keystrokes over to Quick Look/Finder as expected.  But no.  Fail.  We still have a 15 second delay.  And we still can&#8217;t direct the spacebar keystrokes to Quick Look &#8220;where they belong&#8221;.</p>
<p>The quest continues?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2008/07/quicksilver-and-quick-look/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>webdev gang sign</title>
		<link>http://blog.founddrama.net/2008/01/webdev-gang-sign/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=webdev-gang-sign</link>
		<comments>http://blog.founddrama.net/2008/01/webdev-gang-sign/#comments</comments>
		<pubDate>Thu, 24 Jan 2008 23:16:06 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[Sundry]]></category>
		<category><![CDATA[tech]]></category>
		<category><![CDATA[gang sign]]></category>
		<category><![CDATA[humor]]></category>
		<category><![CDATA[webdev]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/2008/01/webdev-gang-sign/</guid>
		<description><![CDATA[High nerdery; join us.]]></description>
			<content:encoded><![CDATA[<p align="center"><a href="http://www.flickr.com/photos/found_drama/2216365501/" title="WebDev Gang Sign by found_drama, on Flickr"><img src="http://farm3.static.flickr.com/2391/2216365501_4698cbdde3.jpg" alt="WebDev Gang Sign" height="375" width="500" /></a></p>
<p>High nerdery; <a href="http://flickr.com/groups/webdevgangsign/">join us</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2008/01/webdev-gang-sign/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simile Timeline</title>
		<link>http://blog.founddrama.net/2007/10/simile-timeline/?utm_source=rss&amp;utm_medium=rss&amp;utm_campaign=simile-timeline</link>
		<comments>http://blog.founddrama.net/2007/10/simile-timeline/#comments</comments>
		<pubDate>Sun, 21 Oct 2007 13:03:15 +0000</pubDate>
		<dc:creator>found_drama</dc:creator>
				<category><![CDATA[Code]]></category>
		<category><![CDATA[garden]]></category>
		<category><![CDATA[Simile]]></category>
		<category><![CDATA[Simile Timeline]]></category>
		<category><![CDATA[Timeline]]></category>
		<category><![CDATA[visualization]]></category>

		<guid isPermaLink="false">http://blog.founddrama.net/2007/10/simile-timeline/</guid>
		<description><![CDATA[Mentioned in passing the other day, Simile Timeline is a neat little API for building rich timeline visualizations with annotations. Though the documentation is a bit thin at the moment, the core code is not too difficult to figure out and if you start with a straightforward example (like this one) then you can get [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/found_drama/1671958936/" title="Photo Sharing"><img src="http://farm3.static.flickr.com/2301/1671958936_c8a338b998_m.jpg" class="alignright" alt="2007 Garden Timeline" height="122" width="240" /></a>Mentioned in passing <a href="http://blog.founddrama.net/2007/10/links-for-2007-10-17/">the other day</a>, <a href="http://simile.mit.edu/timeline/">Simile Timeline</a> is a neat little API for building rich timeline visualizations with annotations.</p>
<p>Though the documentation is a bit thin at the moment, the core code is not too difficult to figure out and if you start with a straightforward example (like <a href="http://lifehacker.com/software/memory/geek-to-live--roll-your-own-timeline-207426.php">this one</a>) then you can get a quick-and-dirty one going in about as much time as it takes you to write out the XML.</p>
<p>Considering that <a href="http://blog.founddrama.net/2007/10/2007-garden-wrap-up/">the community garden shut down for the season yesterday</a>, I decided to experiment with the Simile Timeline API by building out one for our 2007 garden foray.  Again, getting the initial events into the XML data file is super-easy (if a bit tedious); tweaking the JavaScript to get your timeline looking the way you want?  That takes a bit longer&#8230;  Most of the main variables (e.g., the height/width of the timeline) are well-enough exposed that a novice would be able to get it right with a few guesses.  Customizing the theme and &#8220;zooming in&#8221; on sensitive &#8220;hot zones&#8221; however, that takes a bit more experimentation.  That said, considering what I was able to accomplish in an afternoon (between loads of laundry), I must admit to being impressed with its relative simplicity &#8212; Simile Timeline is certainly an elegant solution for these kind of visualizations.  Poking around on their site a bit, it seems I&#8217;ve just barely scratched the surface of its sophistication.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.founddrama.net/2007/10/simile-timeline/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
