<?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>Chad Weider</title>
	<atom:link href="http://blog.oofn.net/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.oofn.net</link>
	<description>You have found the home of</description>
	<lastBuildDate>Sun, 13 May 2012 01:01:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>A Folk History of Hayes Valley</title>
		<link>http://blog.oofn.net/2012/05/06/a-folk-history-of-hayes-valley/</link>
		<comments>http://blog.oofn.net/2012/05/06/a-folk-history-of-hayes-valley/#comments</comments>
		<pubDate>Mon, 07 May 2012 03:08:33 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[Observations]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/?p=289</guid>
		<description><![CDATA[Folk, common, local, whatever, history is a fascinating thing (no surprise then, that I grew up listening to This American Life). I’m convinced that there is no place you can find that is not interesting, especially if you happen to live in a large city. I live in the Hayes Valley neighborhood of San Francisco. [...]]]></description>
			<content:encoded><![CDATA[<p>Folk, common, local, whatever, history is a fascinating thing (no surprise then, that I grew up listening to <a href="http://www.thisamericanlife.org/"><em>This American Life</em></a>). I’m <a href="http://en.wikipedia.org/wiki/Interesting_number_paradox">convinced</a> that there is no place you can find that is not interesting, especially if you happen to live in a large city.</p>

<p>I live in the Hayes Valley neighborhood of San Francisco. While it does seem neat, clean, and nice, if you pull things back and look beyond the gentrification, the boutiques, the parks, the disappeared freeway, and the <a href="http://en.wikipedia.org/wiki/Loma_Prieta_earthquake">earthquake</a> – back into the  80’s – you would find the identity and experience of this neighborhood completely foreign. Back then the neighborhood (but, honestly, most parts of most cities) was pretty edgy. Indeed, in 1979, Chris Pirsig (from <a href="http://en.wikipedia.org/wiki/Zen_and_the_Art_of_Motorcycle_Maintenance"><em>ZAMM</em></a>) was <a href="http://www.sfgate.com/cgi-bin/article.cgi?f=/c/a/2004/11/19/WBGKJ9SCPS1.DTL">murdered</a> a few blocks away from my apartment.</p>

<p>However, despite all of the drama of the moment, in history, most events are forgotten and stories remain untold. I’d reserve judgment on whether or not this is a good thing, but, regardless, this does make the discovery of those stories, regardless of provenance, something to behold.</p>

<p>Anyways, not to make to too much of it, a while ago I dug up a  short story about growing up in this neighborhood – way before I ever stepped foot in it – and I think it’s pretty interesting:</p>

<p><em>Chronicles Of A True Hustler</em>:
<a href="http://dailymath.ihiphop.com/weblog/?p=78">Pt. 1</a>,
<a href="http://dailymath.ihiphop.com/weblog/?p=84">Pt. 2</a>,
<a href="http://dailymath.ihiphop.com/weblog/?p=90">Pt. 3</a>,
<a href="http://dailymath.ihiphop.com/weblog/?p=100">Pt. 4</a>,
<a href="http://dailymath.ihiphop.com/weblog/?p=111">Pt. 5</a>,
<a href="http://dailymath.ihiphop.com/weblog/?p=120">Pt. 6</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2012/05/06/a-folk-history-of-hayes-valley/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Emulating UIBarButtonItem Appearance</title>
		<link>http://blog.oofn.net/2012/04/22/emulating-uibarbuttonitem-appearance/</link>
		<comments>http://blog.oofn.net/2012/04/22/emulating-uibarbuttonitem-appearance/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 18:18:48 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/?p=275</guid>
		<description><![CDATA[While it’s best to avoid, sometimes it you must duplicate the appearance of UIToolbar items. Unfortunately, UIKit doesn’t appear to provide any means for achieving the etched look that it adds on each item it has control over so, for custom UIBarButtonItems you must do it manually. In my case, I needed to present some [...]]]></description>
			<content:encoded><![CDATA[<p>While it’s best to avoid, sometimes it you must duplicate the appearance of <code>UIToolbar</code> items. Unfortunately, UIKit doesn’t appear to provide any means for achieving the etched look that it adds on each item it has control over so, for custom <code>UIBarButtonItem</code>s you must do it manually.</p>

<p><img class="center" src="/pictures/mines_status_bar.png" /></p>

<p>In my case, I needed to present some information on the toolbar, but needed it to be non-interactive, have a special layout, and use some existing vector images. To that end, here are some category methods that made it straight forward: <a href="https://gist.github.com/2465637">https://gist.github.com/2465637</a>.</p>

<p>Given that, etching can be had with a few lines. It’s not efficient, but it is easy.
<pre>
[[[[UIImage ct&#x5F;imageWithPDFNamed:@"time" size:CGSizeMake(26, 26)]
  ct&#x5F;imageWithOverlayColor:[UIColor colorWithRed:112/255. green:119/255. blue:123/255. alpha:1]]
  ct&#x5F;imageWithInnerShadowOffset:CGSizeMake(0, 1) color:[UIColor colorWithWhite:0 alpha:.6]]
  ct&#x5F;imageWithShadowOffset:CGSizeMake(0, 1) blur:0 color:[UIColor colorWithWhite:1 alpha:.6]]
</pre></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2012/04/22/emulating-uibarbuttonitem-appearance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I Shipped a Thing</title>
		<link>http://blog.oofn.net/2012/04/21/i-shipped-a-thing/</link>
		<comments>http://blog.oofn.net/2012/04/21/i-shipped-a-thing/#comments</comments>
		<pubDate>Sun, 22 Apr 2012 02:25:55 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[Cool]]></category>
		<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac]]></category>
		<category><![CDATA[Rants]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/?p=238</guid>
		<description><![CDATA[Late last week a little app of mine made its way onto the App Store. So congratulations to me! but, uh, a minesweeper clone? that would not be very original. Nope, it’s not very original, but it is better†. It is my weak protest against the garish implementations that litter the App Store. It’s not [...]]]></description>
			<content:encoded><![CDATA[<p>Late last week a <a href="http://halfworking.com/mines">little app</a> of mine made its way onto the <a href="http://itunes.com/apps/halfworking/mines">App Store</a>. So congratulations to me! but, uh, a minesweeper clone? that would <em>not</em> be very original. Nope, it’s not very original, but it is <em>better</em>†.</p>

<p><img class="center" src="/pictures/mines_screenshot.png"  width="240px" height="360px"/></p>

<p>It is my weak protest against the <a href="http://itunes.apple.com/us/app/minesweeper-*****/id407768156?mt=8">garish</a> implementations that litter the App Store. It’s not something I’d plan to profit from (game development has always seemed to be an inevitably feral existence), but an argument for quality in the App Store, where barring a <a href="http://carcassonneapp.com/">few</a> <a href="http://cocoastuff.com/products/deepgreen">exceptions</a> it can seem like there is so little.</p>

<p>…It was also fun to do.</p>

<p>† How many times have I heard <em>that</em> said before?</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2012/04/21/i-shipped-a-thing/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Quick and Dirty High-DPI Images</title>
		<link>http://blog.oofn.net/2012/04/16/quick-and-dirty-high-dpi-images/</link>
		<comments>http://blog.oofn.net/2012/04/16/quick-and-dirty-high-dpi-images/#comments</comments>
		<pubDate>Mon, 16 Apr 2012 20:59:44 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[Design]]></category>
		<category><![CDATA[Development]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/?p=214</guid>
		<description><![CDATA[While working on this page, I discovered just how awful the web can look on the the the iPhone and iPad with their “retina” screens. In native applications, normal resolution images are scaled without anti-aliasing, but in Mobile Safari images are scaled with anti-aliasing, and as a consequence, many important pixels can get badly blurred. [...]]]></description>
			<content:encoded><![CDATA[<p>While working on <a href="http://halfworking.com/mines">this page</a>, I discovered just how awful the web can look on the the the iPhone and iPad with their “retina” screens. In native applications, normal resolution images are scaled without anti-aliasing, but in Mobile Safari images are scaled <em>with</em> anti-aliasing, and as a consequence, many important pixels can get badly blurred.</p>

<p>This isn’t an unrecognized problem and it has been solved <a href="http://flowz.com/2010/07/css-image-replacement-for-iphone-4-high-dpi-retina-display/">elsewhere</a>, but the accepted approach seems require JavaScript and class names, which strikes me as unnecessary – CSS declarations alone should suffice.</p>

<p>To that end, the approach I use is <a href="https://gist.github.com/2394800">this</a>:
<pre>
@media only screen and -webkit-min-device-pixel-ratio:2 {
  img[src="images&#x2F;icon.png"] {
    content: url("images&#x2F;icon@2x.png");
  }
  img[src="images&#x2F;store&#x5F;small.png"] {
    content: url("images&#x2F;store&#x5F;small@2x.png");
  }
  img[src="images&#x2F;screen&#x5F;fail.png"] {
    content: url("images&#x2F;screen&#x5F;fail@2x.png");
  }
  img[src="images&#x2F;screen&#x5F;play.png"] {
    content: url("images&#x2F;screen&#x5F;play@2x.png");
  }
}
</pre></p>

<p>*I swear I read about content negotiation for this at some point, but all I can find is an old, unresolved <a href="https://lists.webkit.org/pipermail/webkit-dev/2007-June/001923.html">discussion</a> at <a href="http://webkit.org">webkit.org</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2012/04/16/quick-and-dirty-high-dpi-images/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>YAJSML</title>
		<link>http://blog.oofn.net/2011/04/21/yajsml/</link>
		<comments>http://blog.oofn.net/2011/04/21/yajsml/#comments</comments>
		<pubDate>Thu, 21 Apr 2011 08:35:44 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/?p=149</guid>
		<description><![CDATA[Ugh, I’m pretty tired of the endless parade of “Oh hai, iz wrtn a JS loaderz” projects. Given the number of existing implementations and the general solved-ness of the problem, the time devoted to it is disappointing. But here I am, doing just the same. Principles This work is related to that done in RequireJS [...]]]></description>
			<content:encoded><![CDATA[<p>Ugh, I’m pretty tired of the endless parade of “Oh hai, iz wrtn a JS loaderz” projects. Given the number of existing implementations and the general solved-ness of the problem, the time devoted to it is disappointing. But here I am, doing just the same.</p>

<h2>Principles</h2>

<p>This work is related to that done in <a href="http://requirejs.org/">RequireJS</a> and <a href="http://wiki.commonjs.org/wiki/Modules">CommonJS</a>, but hardly <a href="http://tagneto.blogspot.com/">bound</a> by them. Instead, the results are a product of the following principles:</p>

<ul>
<li>Improving the loading characteristics of a JavaScript project should be approached as an incremental optimization problem.</li>
<li>Simplicity is best. Only implement the necessary features.</li>
<li>Caching should be exploited. Expensive one-time operations are acceptable provided their responses are reusable.</li>
<li><a href="http://wiki.commonjs.org/wiki/Modules/1.1.1">Modules</a> are well defined, widely used, and well founded. The five different asynchronous loading specifications, not so much.</li>
</ul>

<p>This leads to what I&#8217;m given to think is a much <a href="http://c2.com/xp/DoTheSimplestThingThatCouldPossiblyWork.html">simpler version that works</a> than existing implementations. The other nice thing is that the packaging tool takes an original approach to solving the dependency issue.</p>

<h2>Observations</h2>

<h3>Optimization</h3>

<p>Naïve implementations are good. Those implementations may be slow, but they are also cheap and set the stage for proper <a href="http://c2.com/cgi/wiki?RulesOfOptimization">optimization</a>. Chances are, that many possible optimizations are rendered unnecessary by the right tools.</p>

<h3>Dependencies</h3>

<p>Most current implementations use one of <a href="http://wiki.commonjs.org/wiki/Modules/Transport">five</a> ways to wrap a module&#8217;s code with a description of the dependencies that that code requires, and which a library will fetch asynchronously, finally evaluating the modules code once all are loaded. The thought being that, once that module is received, first all of its dependencies need loading (asynchronously so they are non-blocking, natch).</p>

<p>IMHO, that obscures the more obvious and important observation, that having dependencies that aren&#8217;t loaded by the time the current module is loaded, asynchronous or not, is <em>never</em> good. If this is to be treated as an optimization problem, then the issue is one of packaging. If the packaging works well, the question of synchronous/asynchronous loading is moot.</p>

<h3>Packaging</h3>

<p>Existing packagers all perform some sort of parsing on source files, usually a regular expression, maybe a full preprocessor language. Both approaches have the downsides of requiring boilerplate code or being unreliable. There is also the additional complication of describing lazy dependencies so that they do not get confused with loading dependencies.</p>

<p>The good news is that, given the availability of non-browser interpreters, there is a third way, where the code itself can be evaluated offline and dependencies <em>extracted during run-time</em>. Not only would this extract only those dependencies needed exactly at load time and require no boilerplate, using the same kernel in both environments, it would keep both the client and the packager’s results consistent.</p>

<h3>Versioning</h3>

<p>The current practice for deploying JavaScript is to set a query parameter like <code>bust=v_n+1</code> on the URL of the script’s location to, in effect, invalidate the cache. This happens to work in the monolithic file case, however, lazy loading code makes versioning a problem that cannot be ignored. While new clients will use <code>v_n+1</code>, clients using <code>v_n</code> code must continue to receive <code>v_n</code> code. For this reason, versioning should be reflected in the base URI.</p>

<p><code>
http://assets1.example.com/js/src/n/<br />
http://assets1.example.com/js/src/n+1/<br />

http://assets1.example.com/js/src/n+2/

</code></p>

<h3>Caching</h3>

<p>It’s a common observation that different areas of a project change at different rates. This is certainly the case in web applications where library code will change much slower than application code. It follows then that updates to application code should have no effect on still cacheable library code.</p>

<p>Convention already specifies this using a leading slash for <code>'/application/code'</code> and none for <code>'library/code'</code>. This is simple to exploit by allowing different URIs for the two classes of code.</p>

<p><code>
http://assets1.example.com/js/lib/0.1.2/<br />

http://assets1.example.com/js/src/0.3.0/

</code></p>

<h2>Implementation</h2>

<p>The tool that implements this loader provides two things things, a kernel and a module compiler. For the moment it is on an <a href="https://github.com/cweider/modulizer/tree/experimental">experimental branch</a> of the Modulizer project, though I’m beginning to like “Yajsml” more and more.</p>

<p>The kernel is a terse bit of JS that provides the module loading and fetching functionality. It has no references to the global environment and, by default, exports to the <code>require</code> symbol. It&#8217;s the part that enables a simple page like this:</p>

<p><code>
&lt;script type="text/javascript" src="/kernel.js"&gt;&lt;/script&gt;<br />
&lt;script type="text/javascript"&gt;<br />
&nbsp;&nbsp;require.setRootURI('/js/src/');<br />
&nbsp;&nbsp;require.setLibraryURI('/js/lib/');<br />
&nbsp;&nbsp;require.setGlobalKeyPath('require');<br />
&nbsp;&nbsp;app = new (require('/app').Application)({<br />
&nbsp;&nbsp;&nbsp;&nbsp;"userId": 1234<br />
&nbsp;&nbsp;,&nbsp;"baseURI": "http://example.com/"<br />
&nbsp;&nbsp;});<br />
&lt;/script&gt;
</code></p>

<p>The module compiler takes a number of paths and compiles them into a <code>require.define()</code> call. Using the command line tool:</p>

<p><code>../modulize --output code.js --root-path ./src --library-path ./lib --import-dependencies -- ./src/app.js</code></p>

<p>Produces the following package:<br />
<code>
require.define({<br />
&nbsp;&nbsp;"/app":&nbsp;null<br />
,&nbsp;"/app.js":&nbsp;function&nbsp;(require,&nbsp;exports,&nbsp;module)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;models&nbsp;=&nbsp;require('/models');<br />
&nbsp;&nbsp;&nbsp;&nbsp;var&nbsp;util&nbsp;=&nbsp;require('util');<br />
&nbsp;&nbsp;}<br />
,&nbsp;"/models":&nbsp;null<br />
,&nbsp;"/models.js":&nbsp;null<br />
,&nbsp;"/models/group":&nbsp;null<br />
,&nbsp;"/models/group.js":&nbsp;function&nbsp;(require,&nbsp;exports,&nbsp;module)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;exports.Group&nbsp;=&nbsp;function&nbsp;()&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/<em>...</em>/<br />
&nbsp;&nbsp;&nbsp;&nbsp;};<br />
&nbsp;&nbsp;}<br />
,&nbsp;"/models/index":&nbsp;null<br />
,&nbsp;"/models/index.js":&nbsp;function&nbsp;(require,&nbsp;exports,&nbsp;module)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;exports.User&nbsp;=&nbsp;require('./user').User;<br />
&nbsp;&nbsp;&nbsp;&nbsp;exports.Group&nbsp;=&nbsp;require('./group').Group;<br />
&nbsp;&nbsp;}<br />
,&nbsp;"/models/user":&nbsp;null<br />
,&nbsp;"/models/user.js":&nbsp;function&nbsp;(require,&nbsp;exports,&nbsp;module)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;exports.User&nbsp;=&nbsp;function&nbsp;()&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;/<em>...</em>/<br />
&nbsp;&nbsp;&nbsp;&nbsp;};<br />
&nbsp;&nbsp;}<br />
,&nbsp;"util":&nbsp;null<br />
,&nbsp;"util.js":&nbsp;null<br />
,&nbsp;"util/index":&nbsp;null<br />
,&nbsp;"util/index.js":&nbsp;function&nbsp;(require,&nbsp;exports,&nbsp;module)&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;exports.escapeHTML&nbsp;=&nbsp;function&nbsp;()&nbsp;{};<br />
&nbsp;&nbsp;&nbsp;&nbsp;exports.escapeHTMLAttribute&nbsp;=&nbsp;function&nbsp;()&nbsp;{};<br />
&nbsp;&nbsp;&nbsp;&nbsp;exports.importantURL&nbsp;=&nbsp;'http://example.com/';<br />
&nbsp;&nbsp;}<br />
});
</code></p>

<h2>Future</h2>

<p>This the first iteration in a longer project with several more big ideas to adopt, but, IMHO, aside from one or two missing features, this is a pretty comprehensive solution for the problem of distributing code from the client’s perspective. The remaining improvements revolve around improving the optimization of packaging and using the cache more effectively.</p>

<p>Regarding effective use of the cache, having module requests get redirected to designated/canonical packages has lots of potential to increase cache hits when loading order varies &#8211; such as across pages. As far as finding an optimal packaging goes, it’s the kind of problem that sounds like the perfect job for some sort of nondeterministic heuristic-ish algorithm.</p>

<p>And finally, while the two buckets, <code>libraryURI</code> and <code>rootURI</code>, are probably sufficient for most projects, the thought of allowing for multiple library paths is appealing. Searching would of course be made more expensive for some modules, but I suspect that ordering the search paths by increasing frequency of updates may allow caching to compensate for this.</p>

<h2>Updates</h2>

<p>It’s since become clear that parts of this discussion are reasonably independent of each other, so they’ve been broken into their own projects:</p>

<ul>
<li><a href="https://github.com/cweider/require-kernel">require-kernel</a>: A minimalist implementation of <code>require</code> that supports asynchronous retrieval.</li>
<li><a href="https://github.com/cweider/yajsml">yajsml</a>: An asset server that  performs packaging and clever things like redirecting to a canonical resource.</li>
<li><a href="https://github.com/cweider/yajsml">modulizer</a>: A tool that finds  dependencies at runtime.</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2011/04/21/yajsml/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Finding JavaScript’s Global Object</title>
		<link>http://blog.oofn.net/2011/04/10/finding-javascript%e2%80%99s-global-object/</link>
		<comments>http://blog.oofn.net/2011/04/10/finding-javascript%e2%80%99s-global-object/#comments</comments>
		<pubDate>Sun, 10 Apr 2011 23:06:15 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[JavaScript]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/?p=124</guid>
		<description><![CDATA[With JavaScript code being written in ever more diverse environments these days, some assumptions are bound to get broken. One such assumption is that the object bound to the symbol window in the current scope is the global object. Every approach I’ve seen searches through a list of probable symbols and returns the first defined, [...]]]></description>
			<content:encoded><![CDATA[<p>With JavaScript code being written in ever more diverse environments these days, some assumptions are bound to get broken. One such assumption is that the object bound to the symbol <code>window</code> in the current scope is the global object. Every approach I’ve seen searches through a list of probable symbols and returns the first defined, instead of using the language itself.</p>

<p><code>var global = (typeof window != 'undefined' ? window : global)</code></p>

<p>Below is a snippet that will return the global object independent of scope and interpreter.</p>

<p><code>var global = (function () {return this})();</code></p>

<p><em>Note: except in the rarest of cases, direct address of the global object is illegitimate regardless of approach, using this more robust snippet is no excuse.</em><em></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2011/04/10/finding-javascript%e2%80%99s-global-object/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>According to Wikipedia…</title>
		<link>http://blog.oofn.net/2008/06/27/according-to-wikipedia%e2%80%a6/</link>
		<comments>http://blog.oofn.net/2008/06/27/according-to-wikipedia%e2%80%a6/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 21:29:36 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[Observations]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/2008/06/27/according-to-wikipedia%e2%80%a6/</guid>
		<description><![CDATA[If you didn&#8217;t know already, I&#8217;m a lover of eclectic information. Here is a sampling of some of the more interesting facts I’ve gleaned from the Wikipedia. In no particular order: Birds, reptiles and amphibians only have one orifice for their intestinal and urinary tract. This orifice is called the Cloaca, from the Latin for [...]]]></description>
			<content:encoded><![CDATA[<p>If you didn&#8217;t know already, I&#8217;m a lover of eclectic information. Here is a sampling of some of the more interesting facts I’ve gleaned from the Wikipedia. In no particular order:</p>

<ul>
<li><p>Birds, reptiles and amphibians only have one orifice for their intestinal and urinary tract. This orifice is called the <a href="http://en.wikipedia.org/wiki/Cloaca">Cloaca</a>, from the Latin for sewer. If that’s not cool enough get this: some turtles have gills in their cloacal cavity. </p></li>
<li><p><a href="http://en.wikipedia.org/wiki/Belt_%28mechanical%29">Belt Drives</a> are cool! Because of the repetitive nature of their use, wear is a major concern. Thankfully there are clever ways to reduce the wear. 1) flat belts can be made into a <a href="http://en.wikipedia.org/wiki/Möbius_strip">Möbius strip</a>. 2) timing belts can made so that the number of teeth on the belt and all of the sprokets are <a href="http://en.wikipedia.org/wiki/Coprime">coprime</a>.</p></li>
<li><p><a href="http://en.wikipedia.org/wiki/Gastropoda">Gastropoda</a> have diversified so much over geological time that evolutionarily things have gotten very confused. There are land species with gills as well as marine species with lungs. Slugs (Gastropoda without much of a shell) are also interesting because most go through <a href="http://en.wikipedia.org/wiki/Torsion_%28gastropod%29">torsion</a> where the internals and the shell of the gastropod rotate. This can be problematic since it puts the anus right by the mouth – but evolutionarily speaking it must of been helpful for something.</p></li>
<li><p>The parasitic flatworm <a href="http://en.wikipedia.org/wiki/Leucochloridium_paradoxum">Leucochloridium paradoxum</a>  is an amazing example of <a href="http://en.wikipedia.org/wiki/Aggressive_mimicry">aggressive mimicry</a>. The flatworm&#8217;s sporocyst grows within a snail, invading the tentacles of the snail, with a preference to the left. The now swollen and colored tentacle mimics the appearance of a caterpillar – which a bird host eats. A snail then consumes the birds feces completing the cycle. Some interesting bits about the infected tentacle’s effect on the snail: 1) it cannot retract into its shell, leaving the flatworm always exposed. 2) it appears to reduce light sensitivity in the snail which keeps it out in the open in view of potential hosts.</p></li>
<li><p>The <a href="http://en.wikipedia.org/wiki/Tempest_Prognosticator">Tempest Prognosticator</a> was a curious invention from the 1850’s. It was a barometer made of <a href="http://en.wikipedia.org/wiki/Leech">leeches</a>. The inventor, George Merryweather, found that leeches would respond to changes in the atmosphere by climbing to higher ground. It consisted of a number of leaches each in their own glass jar, at the top of which was a piece of whale bone tied to a string. &#91;<a href="http://www.scholars.nus.edu.sg/landow/victorian/technology/packer/merryweather.html">diagram</a>&#93; When the leach would climb the jar it would dislodge the whale bone which would pull a mallet which would strike a bell – you would guess the likelihood of a storm by the number of bell rings. He had lobbied for it to be distributed throughout the coast of England, but the British Crown decided instead on the (still not entirely understood) <a href="http://en.wikipedia.org/wiki/Storm_glass">storm glass</a>.</p></li>
<li><p><a href="http://en.wikipedia.org/wiki/Neurocysticercosis">Neurocysticercosis</a> is a condition caused by the infestation of the brain by the tapeworm <a href="http://en.wikipedia.org/wiki/Taenia_solium">Taenia solium</a>. If you aren&#8217;t afraid of undercooked meat yet, I think you might now – the usual vector for infection is through larvae in pork meat (though autoinfection through vomit or feces is also possible). Treatment of  Neurocysticercosis can be very problematic. The problem is that living cysticerci are typically asymptomatic, the complications arise when the organism dies, triggering the host’s immune response  and leading to the inflammation, scarring, etc. that can lead to seizures, paralysis, and death.</p></li>
<li><p>While all flies will occasionally mistake fetid wounds for dead flesh, <a href="http://en.wikipedia.org/wiki/Cochliomyia_hominivorax">Cochliomyia hominivorax</a>, a spechies of <a href="http://en.wikipedia.org/wiki/Screw_worm">screwworm fly</a>, is notable for targeting fresh wounds and even exposed skin (e.g. the navel) for laying their larvae, causing <a href="http://en.wikipedia.org/wiki/Myiasis">Myiasis</a>. The larvae are also very aggressive, if disturbed they will burrow further into the host, hence their name. They are known to infect humans and are also a major concern for <a href="http://en.wikipedia.org/wiki/Merino">merino</a> sheep, where the condition is called flystrike. However, before you get too worried, know this – that the fly caused so much destruction to American cattle herds that the <a href="http://en.wikipedia.org/wiki/Sterile_insect_technique">sterile insect technique</a> was developed as a means of controlling the screw worm. This led to its eradication in the United States in 1982.</p></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2008/06/27/according-to-wikipedia%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DarkKit</title>
		<link>http://blog.oofn.net/2008/06/11/darkkit/</link>
		<comments>http://blog.oofn.net/2008/06/11/darkkit/#comments</comments>
		<pubDate>Wed, 11 Jun 2008 14:41:32 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Mac]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/2008/06/11/darkkit/</guid>
		<description><![CDATA[It&#8217;s been sitting in my ~/Projects folder for the better part of a year, but now it really is about time I dust it off and set it free… finished or not. It started with my work on LaserLine. I had written a parser for ILDA files, but needed a way to test its output. [...]]]></description>
			<content:encoded><![CDATA[<p><img class="right" width="128px" height="128px" src="/pictures/DKIcon.png" alt=""/>
It&#8217;s been sitting in my <code>~/Projects</code> folder for the better part of a year, but now it really is about time I <a href="http://blog.oofn.net/2008/05/07/the-developer’s-dilemma/">dust it off</a> and set it free… finished or not.</p>

<p>It started with my work on <a href="http://www.acm.uiuc.edu/projects/LaserLine">LaserLine</a>. I had written a parser for ILDA files, but needed a way to test its output. Naturally, I couldn’t accept Aqua’s presence in an app associated with an app for Lasers – which are all about bright lights and dark rooms. Granted, it was only two controls and some custom images, but by the time I was done there was no doubt in my or anybody else’s mind that the final app would be “dark”.</p>

<p><img class="center" width="360px" height="422px" src="/pictures/ILDAInspector.png" alt="ILDA Inspector Animation"/></p>

<p>Knowing that a complete app would need a more complete library of widgets and subclassing AppKit seemed like a good way to get intimately acquainted with its internals, I didn’t stop there. A full accounting of my adventures in AppKit really deserves its own (lengthy) post that I&#8217;ll for later, I will just say this — kids, don’t try this at home. Even I, in my pixel perfecting, eye candy licking, gradient loving glory, will admit that the whole endeavor was likely not worth the time and frustration involved. But the work was done, so I might as well publish it.</p>

<p><span style="font-weight:bold; font-style:small-caps">Disclaimer:</span> DarkKit is full of sketchy code. It began as a hack – and it still is a hack. It does a whole lot of things AppKit doesn’t want you do to; a whole lot of things you <em>shouldn&#8217;t</em> do. It uses private, undocumented methods and even shadier things (IIRC there was toying with a <code>super</code>’s instance variables somewhere). Keep this in mind if you think you might need help from AppKit folks – I doubt abusing their framework will endear them to you. <em>Use at your own risk</em>.</p>

<p><img class="center" width="470px" height="360px" src="/pictures/DarkKit_TestApp.png" alt="DarkKit Widgets"/></p>

<p>What does it cover? not everything, but hopefully enough to be kinda useful. Most of the controls have their dark alternatives and <code>DKButton</code> covers some of the button variants present in AppKit (the normal shiny capsule button, the square beveled button, and square gradient button). Where things get iffy are Views… <code>NSScrollView</code>s were not designed with alternative looks in mind (not that that’s a bad thing) and that causes problems when it comes to TableViews, etc.</p>

<h3>Using DarkKit</h3>

<p>If you&#8217;ve ever gone about working out in the dark, then you probably have a good appreciation for one of the reasons I decided DarkKit would be a nice thing to have. When everything around you is pitch black, the fluorescent glow of the computer’s screen stresses your eyes terribly, so much so that when I’d be typesetting text or some other project that extended way into the night I would regularly enable high-contrast mode (⌃⌥⌘8) to give my eyes a chance to relax. So, if you happen to be designing an application that is going to be used in low-light settings (a laser show for example) a good low-light interface approaches the point of being a requirement.</p>

<p>IMHO, a really dark interface also does an excellent job of placing content front-and-center. The huge contrast between your app’s monochrome controls and your app’s colorful/interesting content tells your eyes exactly what to look at and drastically reduces visual clutter.</p>

<p>So yea, if you happen to be doing a pro-thing (and you accept the disclaimer from earlier) DarkKit might be for you. And, if you hadn’t noticed yet, jet black interfaces seem to have a way of kicking an app’s sex appeal up a notch. So, if on the other hand you find yourself looking for cheap UI pixie dust DarkKit might also be helpful – not that I endorse pixie dust… just sayin’.</p>

<p><img class="center" width="281px" height="167px" src="/pictures/DarkKit_IBPlugin.png" alt="DarkKit IBPlugin"/></p>

<p>Seeing that doing something as damaging to you application’s stability, maintainability, and general code-quality as adding an illegitimate framework like DarkKit should only be done with the greatest care and after considered thought, I built a IBPlugin* so you can build all your dark interfaces with minimal effort right from interface builder. Enjoy!</p>

<p class="footnote">*There was also a palette, back when that was cool…</p>

<p><em><strong>» Continue on to <a href="http://svn.oofn.net">svn.oofn.net</a></strong></em></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2008/06/11/darkkit/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Meanwhile…</title>
		<link>http://blog.oofn.net/2008/05/30/meanwhile%e2%80%a6/</link>
		<comments>http://blog.oofn.net/2008/05/30/meanwhile%e2%80%a6/#comments</comments>
		<pubDate>Fri, 30 May 2008 06:57:12 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Life]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/2008/05/30/meanwhile%e2%80%a6/</guid>
		<description><![CDATA[I&#8217;m my past post I forgot to mention just how significant distraction can be to keeping projects from getting finished. Well, a bit ago I got Atmel&#8217;s AT90USBKey and last week, while up in a cabin in Wisconsin’s northwoods, I indulged my sentimental side and started reading Thoreau&#8217;s Walden. I’ll plan on getting back on [...]]]></description>
			<content:encoded><![CDATA[<p><img class="center" width="450px" height="338px" src="/pictures/LindyBridge.jpg" alt="Wisconsin Northwoods"/></p>

<p>I&#8217;m my past post I forgot to mention just how significant distraction can be to keeping projects from getting finished. Well, a bit ago I got Atmel&#8217;s <a href="http://www.atmel.com/dyn/products/tools_card.asp?tool_id=3879">AT90USBKey</a> and last week, while up in a cabin in Wisconsin’s northwoods, I indulged my sentimental side and started reading Thoreau&#8217;s <em>Walden</em>. I’ll plan on getting back on the wagon, just not right now…</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2008/05/30/meanwhile%e2%80%a6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>As Seen on Campus</title>
		<link>http://blog.oofn.net/2008/05/08/as-seen-on-campus/</link>
		<comments>http://blog.oofn.net/2008/05/08/as-seen-on-campus/#comments</comments>
		<pubDate>Thu, 08 May 2008 16:45:26 +0000</pubDate>
		<dc:creator>Chad Weider</dc:creator>
				<category><![CDATA[Cool]]></category>
		<category><![CDATA[Observations]]></category>
		<category><![CDATA[University]]></category>

		<guid isPermaLink="false">http://blog.oofn.net/2008/05/08/as-seen-on-campus/</guid>
		<description><![CDATA[Call (217) 352–9993. We&#8217;ll haul your Garrrrrbage…]]></description>
			<content:encoded><![CDATA[<p><img class="center" width="450px" height="338px" src="/pictures/GARRRRBAGE.jpg" alt="Dumpster on Campus 'Capt. Hook'"/></p>

<div style="text-align:center; font-style:italic">Call (217) 352–9993. We&#8217;ll haul your Garrrrrbage…</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.oofn.net/2008/05/08/as-seen-on-campus/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.751 seconds -->
<!-- Cached page served by WP-Cache -->

