<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:creativeCommons="http://backend.userland.com/creativeCommonsRssModule" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
    <channel>
        <title>Tyler Butler Feed</title>
        <link>http://www.tylerbutler.com</link>
        <description>The 5 most recent posts from http://www.tylerbutler.com.</description>
        
        <lastBuildDate>Thu, 17 May 2012 18:23:00 UTC</lastBuildDate>
        <generator uri="http://github.com/tylerbutler/engineer">Engineer</generator>
        
            <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/TylerButlerAllPosts" /><feedburner:info uri="tylerbutlerallposts" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><creativeCommons:license>http://creativecommons.org/licenses/by-sa/2.0/</creativeCommons:license><image><link>http://creativecommons.org/licenses/by-sa/2.0/</link><url>http://creativecommons.org/images/public/somerights20.gif</url><title>Some Rights Reserved</title></image><feedburner:emailServiceId>TylerButlerAllPosts</feedburner:emailServiceId><feedburner:feedburnerHostname>http://feedburner.google.com</feedburner:feedburnerHostname><item>
    <title>xkcd 2</title>
    <link>http://feedproxy.google.com/~r/TylerButlerAllPosts/~3/HrRzCQzwABs/</link>
    <description>&lt;p&gt;I&amp;#8217;ve just put up a small side project I whipped together over the last day or so called &lt;a href="http://xkcd2.com/"&gt;xkcd 2&lt;/a&gt;. It might not make much sense why I built this thing, so bear with me while I try to&amp;nbsp;explain.&lt;/p&gt;
&lt;h2&gt;Why&lt;/h2&gt;
&lt;p&gt;I&amp;#8217;ve been reading &lt;a href="http://xkcd.com/"&gt;xkcd&lt;/a&gt; for years, but it wasn&amp;#8217;t until fairly recently that I discovered most of the comics actually have a caption.&lt;sup id="fnref:xkcd1"&gt;&lt;a href="#fn:xkcd1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt; It&amp;#8217;s tucked away in the &lt;code&gt;title&lt;/code&gt; attribute on the &lt;code&gt;img&lt;/code&gt; tag, and in most browsers you really only see it if you hover your mouse over the image for a few&amp;nbsp;seconds.&lt;/p&gt;
&lt;p&gt;Discovering this was a total accident. I read most xkcd comics via the &lt;span class="caps"&gt;RSS&lt;/span&gt; feed in &lt;a href="http://reederapp.com/"&gt;Reeder&lt;/a&gt;. If you zoom-pinch on an image in Reeder, it opens up a view like&amp;nbsp;this:&lt;/p&gt;
&lt;div class="image caption center"&gt;
    &lt;a href="http://www.flickr.com/photos/76037594@N06/7206331966/"&gt;
        &lt;img src="http://farm8.staticflickr.com/7241/7206331966_66d2e5e577.jpg" width="500" height="375" alt="An xkcd.com comic in Reeder"&gt;
    &lt;/a&gt;
    &lt;p&gt;An xkcd.com comic in&amp;nbsp;Reeder&lt;/p&gt;
&lt;/div&gt;

&lt;p&gt;That panel at the bottom displays the &lt;code&gt;title&lt;/code&gt; attribute, but it only shows up if you tap once on the image. Anyway, after coming across this in Reeder, I started looking at all the captions every time a new comic would come out. It turns out that in many cases the caption is funnier than the comic itself. Case in point: &lt;a href="http://xkcd2.com/1049/"&gt;comic 1049&lt;/a&gt;, the one featured in the picture above, is my most recent favorite. The caption perfectly mirrors my own experience with Ayn Rand, and in my opinion makes the comic that much more interesting as a&amp;nbsp;whole.&lt;/p&gt;
&lt;p&gt;Anyway, I find it frustrating that the comic captions are not a more visible part of the xkcd site itself, so I decided to put together a separate site that loads the comics from xkcd and simply displays them in a slightly different way &amp;#8211; and includes the comic captions directly. The same comic shown above looks like this on&amp;nbsp;xkcd2.com:&lt;/p&gt;
&lt;div class="image caption center"&gt;
    &lt;a href="http://www.flickr.com/photos/76037594@N06/7213096382/"&gt;
        &lt;img src="http://farm9.staticflickr.com/8151/7213096382_d033e235a0.jpg" width="500" height="361" alt="xkcd2" class="center"/&gt;
    &lt;/a&gt;
    &lt;p&gt;An xkcd comic as shown on&amp;nbsp;xkcd2.com&lt;/p&gt;
&lt;/div&gt;

&lt;h2&gt;How&lt;/h2&gt;
&lt;p&gt;Now that you know the &lt;em&gt;why&lt;/em&gt; of xkcd2.com, let&amp;#8217;s talk about the &lt;em&gt;how&lt;/em&gt;.&lt;/p&gt;
&lt;p&gt;xkcd 2 is an exceedingly simple &lt;a href="http://flask.pocoo.org/"&gt;Flask&lt;/a&gt; app. It&amp;#8217;s ~100 lines of Python (not including empty lines of course). A majority of the time was spent messing with the &lt;span class="caps"&gt;HTML&lt;/span&gt; and &lt;span class="caps"&gt;CSS&lt;/span&gt;, not on the Python&amp;nbsp;itself.&lt;/p&gt;
&lt;p&gt;Each time a comic is requested, I use the excellent &lt;a href="http://code.google.com/p/httplib2/"&gt;httplib2&lt;/a&gt; library to retrieve the corresponding page directly from xkcd.com. httplib2 behaves more like a browser than a typical &lt;span class="caps"&gt;HTTP&lt;/span&gt; library; it handles caching the page content and everything for me, so if the same comic is requested many times httplib2 will return the page content from its local file cache instead of bouncing the request to xkcd.com every time.&lt;sup id="fnref:xkcd2"&gt;&lt;a href="#fn:xkcd2" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Once I get the response and page content from xkcd.com, I parse the page into a &lt;span class="caps"&gt;DOM&lt;/span&gt; object using &lt;a href="http://code.google.com/p/html5lib/"&gt;html5lib&lt;/a&gt;. Then I use some rather inefficient list comprehensions to find the right elements in the &lt;span class="caps"&gt;DOM&lt;/span&gt; and extract the relevant information. There are probably more efficient means of doing this, but the page structure is simple enough that it&amp;#8217;s not too bad performance-wise. I did find myself desperately wanting server-side jQuery&amp;#8230;&lt;sup id="fnref:xkcd3"&gt;&lt;a href="#fn:xkcd3" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;
&lt;p&gt;Once I have all the comic details from the page, I store it all in a pickle file so I can load it from the local disk rather than parsing the &lt;span class="caps"&gt;HTML&lt;/span&gt; on each request. Thus, if httplib2 reports that it used its cached version rather than retrieving a fresh page (via the &lt;code&gt;response.fromcache&lt;/code&gt; property), I discard httplib2&amp;#8217;s response entirely and simply load the comic metadata from the pickle&amp;nbsp;file.&lt;/p&gt;
&lt;p&gt;Once I have the metadata, I just pass it to the page template and render the&amp;nbsp;page.&lt;/p&gt;
&lt;h2&gt;But&amp;#8230;&amp;nbsp;but&amp;#8230;&lt;/h2&gt;
&lt;p&gt;I considered a couple of different high-level options before settling on the &amp;#8216;request the page, parse the metadata&amp;#8217; approach. First, since the set of comics is finite (1056 as of this writing), I considered writing a simple scraper that would &amp;#8216;preload&amp;#8217; all of the comics and just load from that cache. However, in the end this isn&amp;#8217;t much different than what I&amp;#8217;m doing. I still would have had to retrieve the page, parse out the relevant data, and store it. The current approach does this lazily, which makes a lot more sense since I doubt most people are looking through really old comics (though it &lt;em&gt;is&lt;/em&gt; interesting to see how Munroe&amp;#8217;s style has changed over the years). I still get the benefits without having this separate &amp;#8216;build the cache&amp;#8217;&amp;nbsp;step.&lt;/p&gt;
&lt;p&gt;I also considered using the &lt;span class="caps"&gt;RSS&lt;/span&gt; feed rather than scraping &lt;span class="caps"&gt;HTML&lt;/span&gt;. This was appealing because the &lt;span class="caps"&gt;RSS&lt;/span&gt; will be less likely to change format. If xkcd.com undergoes a rewrite, my current &lt;span class="caps"&gt;HTML&lt;/span&gt; parsing code will probably break.&lt;sup id="fnref:xkcd4"&gt;&lt;a href="#fn:xkcd4" rel="footnote"&gt;4&lt;/a&gt;&lt;/sup&gt; However, the feed is a snapshot of the most recent comics, not all of them, and I really wanted to support all of them. How broken would it feel if someone sent you a link to a comic on xkcd2.com and it didn&amp;#8217;t load because there was a new comic published that morning and the old comic was no longer in the &lt;span class="caps"&gt;RSS&lt;/span&gt; feed? Spoiler: very&amp;nbsp;broken.&lt;/p&gt;
&lt;p&gt;Anyway, hopefully some folks will find this useful and/or interesting. Code is up &lt;a href="https://github.com/tylerbutler/xkcd2"&gt;on github&lt;/a&gt; and the site is live at &lt;a href="http://xkcd2.com/"&gt;xkcd2.com&lt;/a&gt;.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:xkcd1"&gt;
&lt;p&gt;Oh, you already knew that? Well good for you.&amp;#160;&lt;a href="#fnref:xkcd1" rev="footnote" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:xkcd2"&gt;
&lt;p&gt;There are no doubt some subtleties in the httplib2 cache behavior that I did not dive into. My hunch is that a request still gets made to xkcd.com &amp;#8211; even just a &lt;code&gt;HEAD&lt;/code&gt; request &amp;#8211; because httplib2 needs to somehow determine whether its cache is still valid. I&amp;#8217;m not an expert on its behavior. Regardless, using its cache is almost certainly better than naively proxying the request to xkcd.com &amp;#8211; and waiting for/parsing the response &amp;#8211; each time.&amp;#160;&lt;a href="#fnref:xkcd2" rev="footnote" title="Jump back to footnote 2 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:xkcd3"&gt;
&lt;p&gt;This is probably actually possible using node.js, but it seemed like overkill for this project.&amp;#160;&lt;a href="#fnref:xkcd3" rev="footnote" title="Jump back to footnote 3 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;li id="fn:xkcd4"&gt;
&lt;p&gt;I do use IDs and classes and avoid relying on actual page structure as much as possible, but sometimes it&amp;#8217;s unavoidable. &lt;span class="caps"&gt;HTML&lt;/span&gt; scraping is &lt;em&gt;always&lt;/em&gt; brittle no matter what precautions you take or how smart you try to be.&amp;#160;&lt;a href="#fnref:xkcd4" rev="footnote" title="Jump back to footnote 4 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TylerButlerAllPosts/~4/HrRzCQzwABs" height="1" width="1"/&gt;</description>
    <pubDate>Thu, 17 May 2012 18:23:00 UTC</pubDate>
    <guid isPermaLink="false">http://www.tylerbutler.com/2012/05/17/xkcd-2/</guid>
<feedburner:origLink>http://www.tylerbutler.com/2012/05/17/xkcd-2/</feedburner:origLink></item>
        
            <item>
    <title>Convergence</title>
    <link>http://feedproxy.google.com/~r/TylerButlerAllPosts/~3/rl1vXALNwpg/</link>
    <description>&lt;p&gt;Love this quote from &lt;a href="http://www.macstories.net/news/apple-q2-2012-results-39-2-billion-revenue-35-1-million-iphones-11-8-million-ipads-sold/"&gt;Tim Cook&lt;/a&gt;:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Anything can be forced to converge, but the problem is about trade-offs, and you end up with trade-offs that don&amp;#8217;t please anyone. You can converge a toaster and refrigerator, but the end result won&amp;#8217;t be pleasing to the&amp;nbsp;user.&lt;/p&gt;
&lt;/blockquote&gt;&lt;img src="http://feeds.feedburner.com/~r/TylerButlerAllPosts/~4/rl1vXALNwpg" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 30 Apr 2012 21:56:00 UTC</pubDate>
    <guid isPermaLink="false">http://www.tylerbutler.com/2012/04/30/convergence/</guid>
<feedburner:origLink>http://www.tylerbutler.com/2012/04/30/convergence/</feedburner:origLink></item>
        
            <item>
    <title>Lukas Mathis</title>
    <link>http://feedproxy.google.com/~r/TylerButlerAllPosts/~3/E8UE_J6vbg4/</link>
    <description>&lt;p&gt;I just linked to a piece that I got via &lt;a href="http://ignorethecode.net"&gt;Lukas Mathis&lt;/a&gt;, but I wanted to explicitly encourage you to read his stuff. In my opinion, &lt;a href="http://ignorethecode.net"&gt;ignorethecode.net&lt;/a&gt; should be required reading for anyone doing user experience design today. Very smart, very insightful, very well-reasoned. Solid&amp;nbsp;work.&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/TylerButlerAllPosts/~4/E8UE_J6vbg4" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 23 Apr 2012 21:27:00 UTC</pubDate>
    <guid isPermaLink="false">http://www.tylerbutler.com/2012/04/23/lukas-mathis/</guid>
<feedburner:origLink>http://www.tylerbutler.com/2012/04/23/lukas-mathis/</feedburner:origLink></item>
        
            <item>
    <title>The Monochrome Trend</title>
    <link>http://feedproxy.google.com/~r/TylerButlerAllPosts/~3/20fNO4bBaYU/</link>
    <description>&lt;p&gt;&lt;a href="http://www.literatureandlatte.com/blog/?p=271"&gt;Keith Blount on color&lt;/a&gt;, or lack thereof, in user&amp;nbsp;interfaces:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;I learned something about the way my brain works that I hadn’t hitherto ever had to think about: my brain is an awful lot faster at processing colours than it is at processing&amp;nbsp;shapes.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I&amp;#8217;ve felt this way for awhile about modern &lt;span class="caps"&gt;UI&lt;/span&gt; design trend to &amp;#8220;drain the color&amp;#8221; from &lt;span class="caps"&gt;UI&lt;/span&gt;, to borrow Blount&amp;#8217;s phrase. I really like color and when used tastefully and correctly I find it to be a wonderful usability aid.&lt;sup id="fnref:color1"&gt;&lt;a href="#fn:color1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt; It&amp;#8217;s nice to hear I&amp;#8217;m not the only one that feels this&amp;nbsp;way.&lt;/p&gt;
&lt;p&gt;In Mathis&amp;#8217; link to Blount, he pulls a quote from &lt;a href="http://pragprog.com/book/lmuse/designed-for-use"&gt;his own book&lt;/a&gt;, which in turn quotes Colin Ware (I&amp;#8217;m dangerously close to &lt;a href="http://www.inception-explained.com/"&gt;Inception&lt;/a&gt;-level quote recursion at this&amp;nbsp;point!):&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;In [his book] Information Visualization, Colin Ware notes that color is &amp;#8220;preattentively processed,&amp;#8221; meaning that we identify color before we give it conscious attention. In other words, when we look at a user interface, we can find and identify user interface elements with a specific color really quickly and&amp;nbsp;easily.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;On a related note, I have noticed I also have trouble with &lt;span class="caps"&gt;UI&lt;/span&gt; elements that are text-only with no color or icon hint. For example, the bookmarks bar in Safari, which eschews displaying favicons in favor of text alone, is maddening to me because I naturally look for an icon or color of some kind when looking through the links. There are probably differences in the psychology of this compared to color, but I wonder if there is experimental evidence that supports this notion that icons, color, or shape are easier to recognize quickly than words. &lt;a href="https://www.microsoft.com/typography/ctfonts/WordRecognition.aspx"&gt;This paper from Microsoft typography&lt;/a&gt; seems to indicate that we do indeed recognize words by their shape, though the prevailing scientific beliefs around the exact mechanics of that recognition have undergone some changes over the years. Interesting&amp;nbsp;stuff.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:color1"&gt;
&lt;p&gt;The fact that my current site design arguably does not use color &amp;#8216;tastefully&amp;#8217; or &amp;#8216;correctly&amp;#8217; is not lost on me. I realize that the current &amp;#8216;unicorn vomit&amp;#8217; color explosion is probably overkill and needs some adjustment.&amp;#160;&lt;a href="#fnref:color1" rev="footnote" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TylerButlerAllPosts/~4/20fNO4bBaYU" height="1" width="1"/&gt;</description>
    <pubDate>Mon, 23 Apr 2012 21:13:00 UTC</pubDate>
    <guid isPermaLink="false">http://www.tylerbutler.com/2012/04/23/the-monochrome-trend/</guid>
<feedburner:origLink>http://www.tylerbutler.com/2012/04/23/the-monochrome-trend/</feedburner:origLink></item>
        
            <item>
    <title>Mies</title>
    <link>http://feedproxy.google.com/~r/TylerButlerAllPosts/~3/th2WVww8oew/</link>
    <description>&lt;p&gt;I rarely go to the Google homepage, but I wound up there today and was surprised to see a &lt;a href="http://www.google.com/doodles/mies-van-der-rohes-126th-birthday"&gt;Doodle&lt;/a&gt; very reminiscent of &lt;a href="http://en.wikipedia.org/wiki/S.R._Crown_Hall"&gt;Crown Hall&lt;/a&gt;. Sure enough, it&amp;#8217;s an homage to &lt;a href="http://en.wikipedia.org/wiki/Ludwig_Mies_van_der_Rohe"&gt;Ludwig Mies van der Rohe&lt;/a&gt; &amp;#8211; or simply &lt;em&gt;Mies&lt;/em&gt; as he was always referred to on campus while I was there&lt;sup id="fnref:1"&gt;&lt;a href="#fn:1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt; &amp;#8211; whose birthday was today in 1886. Very&amp;nbsp;cool.&lt;/p&gt;
&lt;div class="footnote"&gt;
&lt;hr /&gt;
&lt;ol&gt;
&lt;li id="fn:1"&gt;
&lt;p&gt;If Wikipedia is to be trusted, referring to him simply as &lt;em&gt;Mies&lt;/em&gt; is widespread. I had always assumed this was an &lt;span class="caps"&gt;IIT&lt;/span&gt;-only thing given his importance to the campus and College of Architecture there.&amp;#160;&lt;a href="#fnref:1" rev="footnote" title="Jump back to footnote 1 in the text"&gt;&amp;#8617;&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;
&lt;/ol&gt;
&lt;/div&gt;&lt;img src="http://feeds.feedburner.com/~r/TylerButlerAllPosts/~4/th2WVww8oew" height="1" width="1"/&gt;</description>
    <pubDate>Wed, 28 Mar 2012 01:05:00 UTC</pubDate>
    <guid isPermaLink="false">http://www.tylerbutler.com/2012/03/27/mies/</guid>
<feedburner:origLink>http://www.tylerbutler.com/2012/03/27/mies/</feedburner:origLink></item>
        
    </channel>
</rss>

