<?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"
	>

<channel>
	<title>Painfully Obvious</title>
	<atom:link href="http://www.andrewdupont.net/wp-rss2.php" rel="self" type="application/rss+xml" />
	<link>http://andrewdupont.net</link>
	<description>The weblog of Andrew Dupont, web designer and writer.</description>
	<pubDate>Mon, 17 Nov 2008 17:20:39 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6.3</generator>
	<language>en</language>
			<item>
		<title>Quotation: Nate Silver</title>
		<link>http://andrewdupont.net/2008/11/17/quotation-nate-silver/</link>
		<comments>http://andrewdupont.net/2008/11/17/quotation-nate-silver/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 17:19:53 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Politics]]></category>

		<category><![CDATA[Quotations]]></category>

		<category><![CDATA[Thoughts]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/?p=585</guid>
		<description><![CDATA[CBS&#8217;s underlying problem&#8230; is the arbitrary and largely ineffectual nature of the fact-checking process employed by the mainstream media. I have written for perhaps a dozen major publications over the span of my career, and the one with the most thorough fact-checking process is by some margin Sports Illustrated. Although this is an indication of [...]]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://www.fivethirtyeight.com/2008/11/few-notes-on-media.html">
<p>CBS&#8217;s underlying problem&#8230; is the arbitrary and largely ineffectual nature of the fact-checking process employed by the mainstream media. I have written for perhaps a dozen major publications over the span of my career, and the one with the most thorough fact-checking process is by some margin <cite>Sports Illustrated</cite>. Although this is an indication of the respect with which <cite>SI</cite> accords its brand, it does not speak so well of the mainstream political media that you are more likely to see an unverified claim repeated on the evening news than you are to see in the pages of your favorite sports periodical.</p>
</blockquote>
<p><cite>— <a href='http://www.fivethirtyeight.com/2008/11/few-notes-on-media.html'>Nate Silver</a></cite></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/17/quotation-nate-silver/feed/</wfw:commentRss>
		</item>
		<item>
		<title>PDoc: inline documentation for Prototype</title>
		<link>http://andrewdupont.net/2008/11/16/pdoc-inline-documentation-for-prototype/</link>
		<comments>http://andrewdupont.net/2008/11/16/pdoc-inline-documentation-for-prototype/#comments</comments>
		<pubDate>Mon, 17 Nov 2008 02:26:37 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/?p=566</guid>
		<description><![CDATA[As 2008 turns into 2009, it&#8217;s past time to dust off some dormant projects in the Prototype realm. I&#8217;ve been playing around with PDoc for the first time since April in an effort to get it ready for the next major Prototype release.
Wait &#8212; have I not talked about PDoc yet? How is that possible?
OK, [...]]]></description>
			<content:encoded><![CDATA[<p>As 2008 turns into 2009, it&#8217;s past time to dust off some dormant projects in the Prototype realm. I&#8217;ve been playing around with PDoc for the first time since April in an effort to get it ready for the next major Prototype release.</p>
<p>Wait &mdash; have I not talked about <a href="http://pdoc.org/" title="PDoc">PDoc</a> yet? How is that possible?</p>
<p>OK, here&#8217;s what you need to know:</p>
<ul>
<li>It&#8217;s <a href="http://rdoc.sourceforge.net/" title="RDoc - Document Generator for Ruby Source">RDoc</a> for JavaScript.</li>
<li>It&#8217;s the brainchild of <a href="http://tobielangel.com/" title="Tobie Langel - Home">Tobie Langel</a> and evidence of his mad genius.</li>
<li>It has a Prototype bent. Technically, there&#8217;s nothing Prototype-specific about it, but we designed it so that Prototype&#8217;s idioms and conventions would feel at home.</li>
<li>It&#8217;s implemented far differently than most JavaScript inline-doc tools.</li>
<li>One day soon, it&#8217;ll be the way we document Prototype.</li>
</ul>
<h4 id="what8217s_different_about_it">What&#8217;s different about it?</h4>
<p>We started PDoc because we were frustrated by tools like <a href="http://jsdoctoolkit.org/" title="JsDoc Toolkit">JSDoc</a> &mdash; which, though they make a valiant effort, fall short at drawing inferences about modern JavaScript. JavaDoc (the standard-bearer for inline documentation) works so well because Java itself guides the user into One Way of doing things. Static languages are comparatively easy to write inline-doc tools for.</p>
<p>JavaScript, on the other hand, has a countably-large assload of ways to define an API, most of which will act the same from the outside even though they look so different from the inside. Prototype employs some strange techniques to define strange APIs: functions that work both as generic methods and instance methods, run-time definition and re-definition of functions based on browser capabilities and quirks, and so on. When doc tools try to read our JavaScript, they get <em>angry</em>, and <em>people get hurt</em>.</p>
<p>Tobie&#8217;s solution was to make a doc tool that wouldn&#8217;t <em>try</em> to read our JavaScript.</p>
<h4 id="what_it_does">What it does</h4>
<p>PDoc is unconcerned with the code itself. It&#8217;s looking only at the comments (which are <code>/** delineated like this **/</code>). Here&#8217;s an example:</p>
<pre><code class="javascript">/** alias: Array.from, section: Language
* $A([iterable]) -> Array
* - iterable (Object): An array-like collection (anything with numeric
*    indices).
*
* Coerces an "array-like" collection into an actual array.
*
* This method is a convenience alias of [[Array.from]], but is the preferred
* way of casting to an `Array`.
**/</code>
</pre>
<p>You, as a human being, can read this comment, and once you&#8217;ve read it you can probably explain just what <code>$A</code> does. PDoc can read it, too: it does some clever parsing to extract a lot of information from this comment. It can tell the name of the method is <code>$A</code>; it knows it&#8217;s just another name for <code>Array.from</code>; it knows to put it in the <code>Language</code> section of the generated documentation; it knows the method&#8217;s one argument is named <code>iterable</code> and is optional.</p>
<p>The last two paragraphs are a human-readable description of what the method does. PDoc mostly delegates to <a href="http://daringfireball.net/projects/markdown/" title="Daring Fireball: Markdown">Markdown</a> here &mdash; except for the <code>[[bracket]]</code> syntax, which it recognizes as a way to link to the documentation for another method.</p>
<p>A few other things make PDoc different. First of all, it knows about Prototype&#8217;s conventions; for instance, I can define a class, then document its individual methods, and PDoc knows to organize them into instance methods and static methods. PDoc also knows about <em>mixins</em> (e.g., <code>Enumerable</code>); should a class mixin one or more objects, PDoc will include those objects as part of its metadata about that class. Look at the <a href="http://pdoc.org/documentation.html" title="PDoc">syntax documentation</a> and you&#8217;ll find other examples.</p>
<h4 id="how_it_works">How it works</h4>
<p>PDoc is both a parser and a generator. The PDoc parser converts all those special comment blocks into an abstract representation of the code; a PDoc generator transforms that model into readable documentation. For now, there&#8217;s only one generator &mdash; it produces HTML &mdash; but we hope other generators will emerge over time.</p>
<p>It uses <a href="http://treetop.rubyforge.org/">Treetop</a>, the most excellent Ruby library, to define its language grammar; and <a href="http://ruby-doc.org/stdlib/libdoc/erb/rdoc/classes/ERB.html">ERB</a> to echo all these Ruby objects into HTML snippets. For more about the nuts and bolts, <a href="http://github.com/tobie/pdoc/tree/master/README.markdown" title="README.markdown at master from tobie's pdoc &mdash; GitHub">consult the README file</a>.</p>
<h4 id="where_we_need_help">Where we need help</h4>
<p>PDoc is alpha software. Here&#8217;s where it needs help:</p>
<ul>
<li>It needs to be faster. There are some simple things I&#8217;m sure we can do in order to improve performance; nodes&#8217; awareness of where they are in the tree (i.e., their parent node and child nodes) relies heavily upon sluggish <code>Enumerable</code> methods. The good news is that this node tree doesn&#8217;t change after the parsing stage, so <a href="http://en.wikipedia.org/wiki/Memoization" title="Memoization - Wikipedia, the free encyclopedia">memoization</a> might be the answer.</li>
<li>At the same time, it needs to be less of a memory hog. Holding the whole node tree in memory at once is less than ideal. I&#8217;ve experimented with using Ruby&#8217;s <code>Marshal</code> class to store the parse tree as a file on disk; I did this so I wouldn&#8217;t have to re-parse every time I wanted to re-generate the docs, but with some tweaking it could also (perhaps) be used to reduce memory consumption by keeping only part of the tree in memory at any given moment.</li>
<li>It needs <a href="http://prototype.lighthouseapp.com/projects/8889-pdoc/" title="PDoc - prototype">feedback, bug reports, and feature requests</a>. Could PDoc grok your APIs? If not, what can we add to it to make that possible?</li>
</ul>
<p>PDoc is <a href="http://github.com/tobie/pdoc/tree/master" title="tobie's pdoc at master &mdash; GitHub">hosted on GitHub</a>, of course. Help us get it from alpha to beta.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/16/pdoc-inline-documentation-for-prototype/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Link: W3C</title>
		<link>http://andrewdupont.net/2008/11/10/link-w3c/</link>
		<comments>http://andrewdupont.net/2008/11/10/link-w3c/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 17:10:01 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Design]]></category>

		<category><![CDATA[Links]]></category>

		<category><![CDATA[Sports]]></category>

		<category><![CDATA[Tumbles]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/?p=557</guid>
		<description><![CDATA[CSS Advanced Layout Module. I suppose this is a good spec, even though the syntax is a bit weird. But &#8212; Christ &#8212; can they please stop overloading the display property? It&#8217;s hard enough to use as it is. 
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.w3.org/TR/css3-layout/" title="CSS Advanced Layout Module">CSS Advanced Layout Module</a>. I suppose this is a good spec, even though the syntax is a bit weird. But &mdash; Christ &mdash; can they please stop overloading the <code>display</code> property? It&#8217;s <a href="http://tobielangel.com/2006/12/31/why-the-css-display-property-sucks/" title="Tobie Langel - Why the CSS display property sucks">hard enough to use</a> as it is. </p>
]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/10/link-w3c/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Link: Dan Benjamin</title>
		<link>http://andrewdupont.net/2008/11/09/link-dan-benjamin/</link>
		<comments>http://andrewdupont.net/2008/11/09/link-dan-benjamin/#comments</comments>
		<pubDate>Mon, 10 Nov 2008 00:01:06 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[JavaScript]]></category>

		<category><![CDATA[Sports]]></category>

		<category><![CDATA[Tips]]></category>

		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/2008/11/09/link-dan-benjamin/</guid>
		<description><![CDATA[No Labs Love for Google Apps. This domain&#8217;s e-mail account is hosted by Google Apps — and I use Mail.app to read my e-mail — so the fact that GApps seems to be branched off from all the cool Gmail features is an annoyance for me, too. Good to hear that someone&#8217;s trying to fix [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://danbenjamin.com/articles/2008/11/google-labs-is-broken-for-google-apps" title="Dan Benjamin - No Labs Love for Google Apps">No Labs Love for Google Apps</a>. This domain&#8217;s e-mail account is hosted by Google Apps — and I use Mail.app to read my e-mail — so the fact that GApps seems to be branched off from all the cool Gmail features is an annoyance for me, too. Good to hear that someone&#8217;s trying to fix it.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/09/link-dan-benjamin/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Conversation: Get Your War On</title>
		<link>http://andrewdupont.net/2008/11/08/conversation-get-your-war-on/</link>
		<comments>http://andrewdupont.net/2008/11/08/conversation-get-your-war-on/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 21:56:07 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Conversations]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/?p=500</guid>
		<description><![CDATA[
Accounts Payable
Look, man, if McCain is elected, I can guarantee you will never be bored. Because America&#8217;s going to be a dynamic, exciting country again!
Accounts Receivable
Because everything&#8217;s gonna be on fire.

]]></description>
			<content:encoded><![CDATA[<dl>
<dt>Accounts Payable</dt>
<dd>Look, man, if McCain is elected, I can guarantee you will never be bored. Because America&#8217;s going to be a dynamic, exciting country again!</dd>
<dt>Accounts Receivable</dt>
<dd>Because everything&#8217;s gonna be <em>on fire</em>.</dd>
</dl>
]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/08/conversation-get-your-war-on/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Link: MasterCard logo</title>
		<link>http://andrewdupont.net/2008/11/07/link-mastercard-logo/</link>
		<comments>http://andrewdupont.net/2008/11/07/link-mastercard-logo/#comments</comments>
		<pubDate>Sat, 08 Nov 2008 01:29:42 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<category><![CDATA[Sports]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/2008/11/07/link-mastercard-logo/</guid>
		<description><![CDATA[MasterCard, what are you thinking? How on earth will you reproduce this logo on a credit card, on a fax, on a standard-def television screen? Did you take this as valuable advice, rather than as the parody it so clearly was?
]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.flickr.com/photos/30999249@N04/3010971288/sizes/o/" title="Flickr Photo Download: Mastercard Rebranding">MasterCard, what are you thinking?</a> How on earth will you reproduce this logo on a credit card, on a fax, on a standard-def television screen? <a href="http://www.beadesigngroup.com/blog/archives/2006/07/logo_news_8_inter_the_future.php" title="Logo New(s) 8: Inter the Future (Be A Design Group)">Did you take this as valuable advice</a>, rather than as the parody it so clearly was?</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/07/link-mastercard-logo/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Link: Sean Tevis</title>
		<link>http://andrewdupont.net/2008/11/05/link-sean-tevis/</link>
		<comments>http://andrewdupont.net/2008/11/05/link-sean-tevis/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 18:56:13 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Links]]></category>

		<category><![CDATA[Politics]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/?p=491</guid>
		<description><![CDATA[
Sean Tevis, the &#8220;xkcd&#8221; candidate for Kansas state representative, lost by 4%. Sucks. But, as he points out, he outperformed Obama in his own district, and outperformed Democrats in adjacent districts. I have a feeling he&#8217;s not done with politics just yet.
]]></description>
			<content:encoded><![CDATA[<p>
<a href="http://seantevis.com/weblog/story/election-results/" title="Election Results">Sean Tevis, the &#8220;xkcd&#8221; candidate for Kansas state representative, lost by 4%.</a> Sucks. But, as he points out, he outperformed Obama in his own district, and outperformed Democrats in adjacent districts. I have a feeling he&#8217;s not done with politics just yet.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/05/link-sean-tevis/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quotation: Brendan</title>
		<link>http://andrewdupont.net/2008/11/05/quotation-brendan/</link>
		<comments>http://andrewdupont.net/2008/11/05/quotation-brendan/#comments</comments>
		<pubDate>Wed, 05 Nov 2008 18:04:09 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Politics]]></category>

		<category><![CDATA[Quotations]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/?p=488</guid>
		<description><![CDATA[
We didn’t see much of the Bradley effect last night, but now we might have to invent the “Stevens effect” — reluctance to admit to pollsters that you would vote for a convicted felon.
]]></description>
			<content:encoded><![CDATA[<blockquote cite="http://yglesias.thinkprogress.org/archives/2008/11/whats_the_matter_with_alaska.php#comment-798916">
<p>
We didn’t see much of the Bradley effect last night, but now we might have to invent the “Stevens effect” — reluctance to admit to pollsters that you would vote for a convicted felon.</p>
</blockquote>
<p><cite>— <a href='http://yglesias.thinkprogress.org/archives/2008/11/whats_the_matter_with_alaska.php#comment-798916'>Brendan</a></cite></p>
]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/05/quotation-brendan/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Auto-format Tweets</title>
		<link>http://andrewdupont.net/2008/11/04/auto-format-tweets/</link>
		<comments>http://andrewdupont.net/2008/11/04/auto-format-tweets/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 16:27:36 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Code]]></category>

		<category><![CDATA[Prototype]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/?p=476</guid>
		<description><![CDATA[(function() {  
  var USERNAMES = /@([A-Za-z0-9_]*)\b/;
  var URLS      = /https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?/;
  
  function getInnerText(element) {
    element = $(element);
    return element.innerText &#038;&#038; !window.opera ? element.innerText :
     element.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g, ' ');
  }
  
  function linkifyTweet(li) [...]]]></description>
			<content:encoded><![CDATA[<p>Used on my <a href="http://andrewdupont.net/about">“About” page</a>.</p>
<pre><code class="javascript">(function() {  
  var USERNAMES = /@([A-Za-z0-9_]*)\b/;
  var URLS      = /https?:\/\/([-\w\.]+)+(:\d+)?(\/([\w\/_\.]*(\?\S+)?)?)?/;
  
  function getInnerText(element) {
    element = $(element);
    return element.innerText &#038;&#038; !window.opera ? element.innerText :
     element.innerHTML.stripScripts().unescapeHTML().replace(/[\n\r\s]+/g, ' ');
  }
  
  function linkifyTweet(li) {
    var html = li.innerHTML, text = getInnerText(li);

    text.scan(URLS, function(match) {
      html = html.sub(match[0], '&lt;a href="#{0}">#{0}</a>');
    });    
    html = html.gsub(USERNAMES, '&lt;a href="http://twitter.com/#{1}/">#{0}</a>');
    li.update(html);
  }
  
  function init() {
    $('twitter').select('li > span.tweet').each(linkifyTweet);
  }  

  document.observe('dom:loaded', init);  
})();</code></pre>]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/04/auto-format-tweets/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Vote!</title>
		<link>http://andrewdupont.net/2008/11/04/vote/</link>
		<comments>http://andrewdupont.net/2008/11/04/vote/#comments</comments>
		<pubDate>Tue, 04 Nov 2008 15:31:52 +0000</pubDate>
		<dc:creator>Andrew</dc:creator>
		
		<category><![CDATA[Web]]></category>

		<guid isPermaLink="false">http://andrewdupont.net/?p=472</guid>
		<description><![CDATA[
Vote! Decisions are made by those who show up.
]]></description>
			<content:encoded><![CDATA[<p>
Vote! Decisions are made by those who show up.</p>
]]></content:encoded>
			<wfw:commentRss>http://andrewdupont.net/2008/11/04/vote/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
