<?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: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/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>Edward Benson</title>
	
	<link>http://www.edwardbenson.com</link>
	<description>Technology and Society</description>
	<lastBuildDate>Fri, 02 Oct 2009 06:42:35 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" href="http://feeds.feedburner.com/edwardbenson" type="application/rss+xml" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com" /><item>
		<title>Uccello’s Chalice</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/KndbAanZ_Cg/</link>
		<comments>http://www.edwardbenson.com/2009/10/02/uccellos-chalice/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 06:42:16 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Random Thoughts]]></category>
		<category><![CDATA[Art]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=524</guid>
		<description><![CDATA[Amazing. This is Paolo Uccello&#8217;s wireframe rendering of a chalice in the year 1450 &#8212; right around the time when perspective was being invented. 

To think that the birth of the Renaissance would look so much like the birth of computer graphics..
]]></description>
			<content:encoded><![CDATA[<p>Amazing. This is Paolo Uccello&#8217;s wireframe rendering of a chalice in the year 1450 &#8212; right around the time when perspective was being invented. </p>
<p><a href="http://www.edwardbenson.com/wp-content/uploads/2009/10/ai03_uccello_chalice.jpg"><img src="http://www.edwardbenson.com/wp-content/uploads/2009/10/ai03_uccello_chalice-212x300.jpg" alt="ai03_uccello_chalice" title="ai03_uccello_chalice" width="212" height="300" class="aligncenter size-medium wp-image-525" /></a></p>
<p>To think that the birth of the Renaissance would look so much like the birth of computer graphics..</p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/KndbAanZ_Cg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/10/02/uccellos-chalice/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/10/02/uccellos-chalice/</feedburner:origLink></item>
		<item>
		<title>How Safari and Firefox handle HTML 5 Manifest files</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/j4CTzD0Kvfg/</link>
		<comments>http://www.edwardbenson.com/2009/09/26/how-safari-and-firefox-handle-html-5-manifest-files/#comments</comments>
		<pubDate>Sat, 26 Sep 2009 18:39:04 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[The Interwebs]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[HTML5]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=492</guid>
		<description><![CDATA[I was doing some experiments with Adam in the lab on Friday, and we discovered some interesting variations in the way that Firefox and Safari implement the HTML 5 Cache Manifest specification. I think this is a particularly important feature to have implemented consistently across platforms because it is the make-or-break feature of HTML5 that [...]]]></description>
			<content:encoded><![CDATA[<p>I was doing some experiments with <a href="http://people.csail.mit.edu/marcua/">Adam</a> in the lab on Friday, and we discovered some interesting variations in the way that Firefox and Safari implement the HTML 5 Cache Manifest specification. I think this is a particularly important feature to have implemented consistently across platforms because it is the make-or-break feature of HTML5 that will permit web applications to function offline. </p>
<h3>First, what is the manifest?</h3>
<p>For people who haven&#8217;t heard about this feature before, the manifest is essentially a special file that lists portions of a web site that should be cached locally for offline access. This is the feature of HTML 5 that will standardize the type of &#8220;airplane mode&#8221; access that GMail users have with Google&#8217;s custom Gears plugin.  </p>
<p>The manifest is served as a regular old file, with MIME type <i>text/cache-manifest</i>, and is linked from the <i>html</i> tag itself, as follows:</p>
<pre name="code" class="html">

&lt;html manifest="site.manifest"&gt;

..

&lt;/html&gt;
</pre>
<p>Once a web site is marked as being cached, then the browser will use the local cached copy of all the files specified in the manifest instead of attempting to load them from the internet. Say you&#8217;re on an airplane and type in the URL for <tt>http://my_cached_site.com</tt>. The browser will recognize it as a cached one, load it from its local storage instead, and then use a new JavaScript API to inform the web site that it is running in offline mode.  </p>
<p>So now for the important part, how do these two browsers (Firefox and Safari) handle this file?</p>
<h3>Firefox</h3>
<p>Upon loading an HTML5 document with a manifest attached, Firefox firsts asks permission to cache the site offline before requesting the manifest file from the server. Here is how the toolbar looks on my browser:</p>
<p><img src="http://www.edwardbenson.com/wp-content/uploads/2009/09/cache_ffox_permission.png" alt="cache_ffox_permission" title="cache_ffox_permission" width="598" height="267" class="aligncenter size-full wp-image-503" /></p>
<p>And here is the server log (I&#8217;m using a Rails project to test this) to show that the manifest was not yet loaded:</p>
<p><img src="http://www.edwardbenson.com/wp-content/uploads/2009/09/cache_firefox_first_load.png" alt="cache_firefox_first_load" title="cache_firefox_first_load" width="676" height="189" class="aligncenter size-full wp-image-505" /></p>
<p>If you choose to allow offline caching, the web browser then requests the cache file, as can be seen from this screen shot.</p>
<p><img src="http://www.edwardbenson.com/wp-content/uploads/2009/09/cache_ffox_after_perm.png" alt="cache_ffox_after_perm" title="cache_ffox_after_perm" width="676" height="189" class="aligncenter size-full wp-image-502" /></p>
<p>Now here&#8217;s the cool thing, I set the headers on the manifest file such that the manifest file itself should also be cached on the client side:</p>
<pre name="code" class="ruby">

        headers["Expires"] = "Fri, 30 Oct 2010 14:19:41 GMT"
        headers["Cache-Control"] = "max-age=3600, must-revalidate"
</pre>
<p>And the result of this is that the subsequent load, <b>no files at all are loaded from Firefox</b> &#8212; it operates entirely offline. Notice the completely empty server log as I reload the site 2..n times. </p>
<p><img src="http://www.edwardbenson.com/wp-content/uploads/2009/09/cache_ffox_second_load.png" alt="cache_ffox_second_load" title="cache_ffox_second_load" width="676" height="189" class="aligncenter size-full wp-image-504" /></p>
<h3>Safari</h3>
<p>Now let&#8217;s look at how Safari does it. Upon loading the web page, Safari also does not load the manifest file, as can be seen from this screen shot:</p>
<p><img src="http://www.edwardbenson.com/wp-content/uploads/2009/09/cache_safari_first_load.png" alt="cache_safari_first_load" title="cache_safari_first_load" width="599" height="223" class="aligncenter size-full wp-image-506" /></p>
<p>However, it also does not ask any questions about offline access. The <i>next</i> time I load the web page, something strange happens. Safari checks the manifest file <i>twice</i> and then doesn&#8217;t load the actual HTML page (because it doesn&#8217;t have to). The double-loading of the manifest file appears to be on the second page load, not split 1/1 between the page departure and subsequent reload. A little strange, if you ask me. </p>
<p><img src="http://www.edwardbenson.com/wp-content/uploads/2009/09/cache_safari_second_load.png" alt="cache_safari_second_load" title="cache_safari_second_load" width="676" height="308" class="aligncenter size-full wp-image-507" /></p>
<p>Furthermore, when I reload the page, despite the HTTP headers specifying that the manifest should be cached, Safari reloads the manifest file. Though, at least it only loads it once for every subsequent time:</p>
<p><img src="http://www.edwardbenson.com/wp-content/uploads/2009/09/cache_safari_third_load.png" alt="cache_safari_third_load" title="cache_safari_third_load" width="676" height="189" class="aligncenter size-full wp-image-508" /></p>
<h3>Conclusion</h3>
<p>I&#8217;m no spec-master, but it seems like Firefox&#8217;s implementation of this feature is what I would want to happen as a web architect, while Safari&#8217;s behavior seems a bit strange. </p>
<p>Firefox:</p>
<ol>
<li>Only loads the web page once </li>
<li>Asks the user for permission to enter offline mode</li>
<li>Only downloads the manifest file once if given permission</li>
<li>Then obeys HTTP Cache Control headers to suppress reloading the manifest file on future loads</li>
</ol>
<p>If Safari were to also behave like this, there are a few fixes that need to be implemented. Namely: </p>
<ol>
<li>Ask the user if offline access should be allowed</li>
<li>Load the manifest when the user loads the page the first time (and approves offline mode), not the second time, when the user might be on an airplane</li>
<li>Stop loading the manifest file multiple times in a single page load</li>
<li>Start obeying the HTTP cache headers so that <i>zero</i> web connections are necessary if the cache says so</li>
</ol>
<p>Safari&#8217;s Manifest handling quirks aside, both browser teams should be applauded for so aggressively implementing the HTML5 spec. It is a real treat as someone researching web platforms to get to test the in-progress spec on real browsers instead of just talking about what might eventually happen down the road. </p>
<p><i>This article is <a href="http://groups.csail.mit.edu/haystack/blog/2009/09/26/how-safari-and-firefox-handle-html-5-manifest-files/">cross-posted</a> on the <a href="http://groups.csail.mit.edu/haystack/blog/">Haystack Blog</a>.</i></p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/j4CTzD0Kvfg" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/09/26/how-safari-and-firefox-handle-html-5-manifest-files/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/09/26/how-safari-and-firefox-handle-html-5-manifest-files/</feedburner:origLink></item>
		<item>
		<title>Will the Namespace Traffic Jam Kill RDFa in HTML5?</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/rnhTu2HIwGE/</link>
		<comments>http://www.edwardbenson.com/2009/09/21/will-the-namespace-traffic-jam-kill-rdfa-in-html5/#comments</comments>
		<pubDate>Mon, 21 Sep 2009 17:54:32 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[Haystack]]></category>
		<category><![CDATA[The Interwebs]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[HTML5]]></category>
		<category><![CDATA[Microdata]]></category>
		<category><![CDATA[RDFa]]></category>
		<category><![CDATA[semantic web]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=483</guid>
		<description><![CDATA[[ Cross-posted on the Haystack Blog ]
One of the most exciting aspects of the (in-progress) HTML5 specification is the number of data-centric features it contains. It&#8217;s almost as if the committee is saying a big, &#8220;OK, OK! We heard you!&#8221;  to all the data-heads out there and is providing not one, not two, not [...]]]></description>
			<content:encoded><![CDATA[<p><b>[ Cross-posted on the <a href="http://groups.csail.mit.edu/haystack/blog/">Haystack Blog</a> ]</b></p>
<p>One of the most exciting aspects of the (in-progress) HTML5 specification is the number of data-centric features it contains. It&#8217;s almost as if the committee is saying a big, &#8220;OK, OK! We heard you!&#8221;  to all the data-heads out there and is providing not one, not two, not three, but four different ways to access and manage structured data from within the client browser:</p>
<ol>
<li><b>Data Attributes</b>, are key-value pairs that may be added to any DOM node</li>
<li><b>Microdata</b> provides a way to interweave objects and object-properties amidst the DOM</li>
<li><b>RDFa</b> provides a way to interweave RDF amidst the DOM</li>
<li><b>Client-side Database Support</b> provides a full relational data access from JavaScript (the spec says this will be SQL compliant, but in reality it will likely just be the SQLite subset of SQL).</li>
</ol>
<p>These are all great developments, and will no doubt bring about a lot of creativity about how data can be used on the client-side, but what interests me the most is <i>why the HTML5 working group felt the need to include Microdata alongside RDFa</i>. </p>
<p>The capabilities of HTML5 Microdata and RDFa are nearly identical, albeit with slightly different terminology. Both provide a way to embed data within HTML attributes and tag contents. Both allow for both named entities and blank nodes. And both allow for a variety of more complex constructions, such as lists and HREF property values. One of the only real differences, as I can tell from glancing over the specs, is that RDFa requires URIs whereas Microdata simply uses ordinary strings to reference entities and properties. And that is what worries me: one of the biggest benefits of RDF is its use of URIs, yet URIs seem to be exactly what is preventing the adoption of RDF. </p>
<p>One problem is probably that URIs look funny as data model elements, even to a programmer. <i>&#8220;A person has name&#8221;</i> is much more natural sounding than <i>&#8220;A http://csail.mit.edu/Contact#Person has a http://csail.mit.edu/Contact#name&#8221;</i>. We think of our code in natural language terms, and URIs obfuscate our real world metaphors. </p>
<p>Far more serious a problem is the <b>namespace traffic jam</b> that currently exists. If I want to publish an RDF document that describes this blog, for example, best practice would have me draw class types and property types from no less than <b>six</b> ontologies!</p>
<ul>
<li>The RDF ontology to describe object properties</li>
<li>The RDFS ontology to describe object classes and labels</li>
<li>The Dublin Core (DC) ontology to describe the titles, authors, and the like</li>
<li>The Friend of a Friend (FOAF) ontology to describe my contact information</li>
<li>The XSD ontology to describe literal dates, strings, and numbers</li>
<li>And yet another, custom, ontology to describe everything else particular to the blog</li>
</ul>
<p>That is already 6 ontologies, and we haven&#8217;t even raised the possibility of using OWL Time, Snap, Span, and GeoOWL for things like time and space description! Even for a semantic web developer, the complexity of managing all of these ontologies, and the namespaces that go with them, becomes pretty burdensome pretty quickly. </p>
<p>And that is why I worry about the future of RDFa in HTML5. It appears that the Microdata specification in HTML5 is essentially the RDF graph data model with the URIs neutered out. Given essentially the same data model, no doubt most developers will pick the easier of two formats to implement. </p>
<p>In order to get more people on the RDF bandwagon, we need to make the RDF path just as easy to follow as the Microdata one. How can this be done? If you ask me, the best way is to get rid of this namespace traffic jam and cultivate a set of community-oriented ontologies. </p>
<p>Rather than trying to create base ontologies that address abstract universal concepts, why not try to have each community standardize a single ontology for their particular domain. Have WordPress and Blogger sponsor the Blog Ontology. Have Amazon.com and eBay sponsor the Marketplace Ontology. Have Facebook and MySpace sponsor the Social Ontology. Then, instead of reusing bits from other ontologies, such as <tt>dc:creator</tt> or <tt>foaf:name</tt>, have each of these community-focused ontologies be self-sufficient, covering all the concepts necessary for their domain. We can always apply mapping rules to distinguish between <tt>social:name</tt> and <tt>store:book-author-name</tt> later. With only a single ontology per domain area to worry about, the namespace traffic jam will disappear and it will be easier for people to get on board with RDF and RDFa.  </p>
<p>All in all, it seems the good news coming out of the HTML5 spec is that we can expect rich data annotation to soon be arriving to HTML content everywhere. But what we need to work on as a community is a way to make URIs, and the Ontologies that give them meaning, easier for programmers to use so that the web won&#8217;t just be full of data with Microdata, but full of <i>linked</i> data with RDFa. </p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/rnhTu2HIwGE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/09/21/will-the-namespace-traffic-jam-kill-rdfa-in-html5/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/09/21/will-the-namespace-traffic-jam-kill-rdfa-in-html5/</feedburner:origLink></item>
		<item>
		<title>A More Subtle Security “Hole”  in WordPress</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/l7tBY3o-SPs/</link>
		<comments>http://www.edwardbenson.com/2009/09/08/a-more-subtle-security-hole-in-wordpress/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 19:28:01 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[The Interwebs]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Security hole]]></category>
		<category><![CDATA[wordpress]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=477</guid>
		<description><![CDATA[This has come up twice in one day over here at the Haystack group, so I thought I&#8217;d post it here.
Using Emacs (and possibly Vi?) to configure Wordpress can expose your database login and password to the world.
Here is why: Wordpress stores this configuration information in a file called wp-config.php that lives in the root [...]]]></description>
			<content:encoded><![CDATA[<p>This has come up twice in one day over here at the <a href="http://groups.csail.mit.edu/haystack/">Haystack</a> group, so I thought I&#8217;d post it here.</p>
<p><strong>Using Emacs (and possibly Vi?) to configure Wordpress can expose your database login and password to the world.</strong></p>
<p>Here is why: Wordpress stores this configuration information in a file called <tt>wp-config.php</tt> that lives in the root of your install. This files contents aren&#8217;t visible to web visitors because its <tt>.php</tt> extension causes to be interpreted by PHP instead of returned to the web user. </p>
<p>Emacs, by default, will save a backup file of anything you edit in the same directory. This file will end with a tilde character (~). This means that if you use a non-customized version of Emacs to edit your <tt>wp-config.php</tt> file, you&#8217;ll get a second file called <tt>wp-config.php~</tt>. The <tt>.php~</tt> extension is not registered to any particular MIME type, and so it will be returned, in full, to the remote user as text, revealing your database server, login, and password with it.</p>
<p>So please, if you use Emacs and have Wordpress, check your WP install directory for any Emacs backup files and delete them! There&#8217;s enough Wordpress hackery going around already this week <img src='http://www.edwardbenson.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/l7tBY3o-SPs" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/09/08/a-more-subtle-security-hole-in-wordpress/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/09/08/a-more-subtle-security-hole-in-wordpress/</feedburner:origLink></item>
		<item>
		<title>More Six Degrees: An Experimental Study of Search in Global Social Networks</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/DnLYl6lsIho/</link>
		<comments>http://www.edwardbenson.com/2009/09/08/more-six-degrees-an-experimental-study-of-search-in-global-social-networks/#comments</comments>
		<pubDate>Tue, 08 Sep 2009 16:00:14 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[paper]]></category>
		<category><![CDATA[six degrees of separation]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=475</guid>
		<description><![CDATA[The followup paper to the prior one I summarized here, also published in Science, re-does the Milgram letter experiments over email. Before going further, here is the citation:
Dodds, P. , Muhamad, R., Watts, D. An Experimental Study of Search in Global Social Networks. Science Vol 301. 8 August 2003.
They take the letter-writing experiments global, ultimately [...]]]></description>
			<content:encoded><![CDATA[<p>The followup paper to the prior one I summarized here, also published in Science, re-does the Milgram letter experiments over email. Before going further, here is the citation:</p>
<p>Dodds, P. , Muhamad, R., Watts, D. An Experimental Study of Search in Global Social Networks. Science Vol 301. 8 August 2003.</p>
<p>They take the letter-writing experiments global, ultimately involving over 60,000 people in 13 countries, all trying to route messages to one of 18 targets with only local information. They found the following bits of interesting information:</p>
<ul>
<li>Friends are routed to far more than other relationship-types</li>
<li>Work ties, School ties, and family ties are the three highest sources of the acquaintance, in decreasing order</li>
<li>People route to &#8220;fairly-close&#8221; friends more often than very close friends.</li>
</ul>
<p>They verify that email, as with letters, reaches its target in 5-7 hops using local-knowledge social routing. And they find that routing in this experiment was fairly egalitarian &#8212; that is, no one person was critical to the success of the messages reaching targets.</p>
<p>This is an interesting experiment to see how the prior letter-writing one would apply to the digital world. In addition, it collected some useful statistics about the types of people we choose when trying to route information to a target. </p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/DnLYl6lsIho" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/09/08/more-six-degrees-an-experimental-study-of-search-in-global-social-networks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/09/08/more-six-degrees-an-experimental-study-of-search-in-global-social-networks/</feedburner:origLink></item>
		<item>
		<title>Controller-specific TTNavigator URLs with Three20</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/XlFnKTGSwpo/</link>
		<comments>http://www.edwardbenson.com/2009/09/04/controller-specific-ttnavigator-urls-with-three20/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 22:40:27 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[iPhone Development]]></category>
		<category><![CDATA[iPhone]]></category>
		<category><![CDATA[Objective C]]></category>
		<category><![CDATA[Three20]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=468</guid>
		<description><![CDATA[
One of the more unique parts of the programming style that comes with the Three20 framework its its URL navigation style via the TTNavigator class. This class is intimately tied in with table cell-based navigation. But what about when you have a URL that is context sensitive. That is, it doesn&#8217;t route to a general [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://www.edwardbenson.com/wp-content/uploads/2009/09/ted_iphone.png" alt="ted_iphone" title="ted_iphone" width="250" height="480" class="alignleft size-full wp-image-469" /></p>
<p>One of the more unique parts of the programming style that comes with the <a href="http://github.com/joehewitt/three20/">Three20</a> framework its its URL navigation style via the TTNavigator class. This class is intimately tied in with table cell-based navigation. But what about when you have a URL that is context sensitive. That is, it doesn&#8217;t route to a general function, but rather a specific instance. </p>
<p>Here is a scenario like the one I have in my code: I have a &#8220;profile&#8221; view that allows people to publish various social links about themselves, and one of these is email. When you click the email table cell, I would like it to trigger a message to that controller which opens up the email client:</p>
<p><b>[self sendEmail];</b></p>
<p>The problem is that TTTableItem objects want URLs, not delegates and selectors. How do I wire up a URL to this <em>particular</em> controller instance instead of just a general one?</p>
<p>The answer is to stop thinking of TTNavigator routes as something that has to be setup at application start time.  I don&#8217;t know if you think like this, but I realized I had subconsciously been thinking about routes the Ruby on Rails way &#8212; parameters that are only mutable during initialization. But TTNavigator routes can be changed any time.</p>
<p>So here is how I implemented the email link. Each time the PersonController initializes, I have the following code:</p>
<pre name="code" class="c">
TTNavigator* navigator = [TTNavigator navigator];
TTURLMap* map = navigator.URLMap;

[map removeURL:@"app://person/email"]
[map from:@"app://person/email" toViewController:self selector:@selector(sendEmail)];
</pre>
<p>Notice how I first <strong>remove</strong> any existing routes, and then I re-wire that route to the particular controller that has just been initialized. </p>
<p>Then when I create my table cell, I can just use a URL as always:</p>
<pre name="code" class="c">
[cells addObject:[TTTableImageItem itemWithText:@"Send Email" imageURL:@"bundle://email.png" URL:@"app://person/email"]];
</pre>
<p>And that is it! Let me know how you have solved the same problem. As Three20 doesn&#8217;t have much in the way of documentation, I would love to hear how other Objective-C hackers are handling situations like this.</p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/XlFnKTGSwpo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/09/04/controller-specific-ttnavigator-urls-with-three20/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/09/04/controller-specific-ttnavigator-urls-with-three20/</feedburner:origLink></item>
		<item>
		<title>A Formal Model for Travers &amp; Milgram’s Letter Experiments</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/QN-NJlH8jOc/</link>
		<comments>http://www.edwardbenson.com/2009/09/04/a-formal-model-for-travers-milgrams-letter-experiments/#comments</comments>
		<pubDate>Fri, 04 Sep 2009 06:03:19 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Computer Science]]></category>
		<category><![CDATA[graph]]></category>
		<category><![CDATA[paper summary]]></category>
		<category><![CDATA[social networks]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=462</guid>
		<description><![CDATA[Back to school next week, so in my neverending quest to learn how to do Real Research, I&#8217;m going to try to begin reading papers regularly. To keep momentum (and to be a better blogger), I&#8217;ll write summaries here.
First up is Identity and Search in Social Networks by Watts, D.J.; Dodds, P.S.; Newman, M.E.J. from [...]]]></description>
			<content:encoded><![CDATA[<p>Back to school next week, so in my neverending quest to learn how to do Real Research, I&#8217;m going to try to begin reading papers regularly. To keep momentum (and to be a better blogger), I&#8217;ll write summaries here.</p>
<p>First up is <a href="http://research.yahoo.com/files/w_d_n_SCIENCE.pdf">Identity and Search in Social Networks</a> by Watts, D.J.; Dodds, P.S.; Newman, M.E.J. from Science Vol 296, 2002. </p>
<p>They create a formal model to describe social networks which predicts similar path-lengths as Travers and Milgram&#8217;s famous letter-writing experiments in the 1960s. For those have haven&#8217;t heard, these experiments are where the term &#8220;six degrees of separation&#8221; come from. The two scientists randomly chose residents in Nebraska and Massachusetts to send a letter to a target person in Boston, and, if they didn&#8217;t know the person directly they were to mail it to the person they thought might know them with the same instructions. They found that the average length of the chain from random sender to target was about 6 (and, as an aside, that the probability of termination at any point in the path was 0.25).</p>
<p>Watts, Dodds, and Newman  creates a tunable social network model that is able to predict the results of Travers and Milgram, but also resembles many real-world computer science problems. The essence (read: oversimplification) of their model is that individuals are described by (1) connections to friends, and (2) a feature vector of traits, and (3) a tendency to interact with and make social decisions based on hierarchy, where hierarchy is expressed within the feature vector. </p>
<p>Setting up the model as such, it stands to reason that an individual with only local information &#8212; that is, knowledge of their own feature vector and the feature vectors of their friends &#8212; would route a message to a target T to the friend whose feature vector best matches that of the target. Approaching the world hierarchically, such a friend is most likely to be in an overlapping social group to the target. </p>
<p>They then test their model with a variety of different parameters, with a few interesting findings:</p>
<ul>
<li>If <em>H</em>, the feature vector, is of too high a dimensionality, the path becomes a random walk. This matches real-world intuition: if we were unable to bucket our social network into groups, we would have trouble deciding which friend to turn to for a particular need.</li>
<li>Searchable networks (those for which senders can locate their targets with relatively short paths) tend to have a positive homophily parameter. Homophily, apparently, is the tendency of individuals to associate with like individuals, as opposed to dissimilar people. This also makes intuitive sense: if you can reliably predict what types of associations a friend has by that friend&#8217;s feature-vector, then you can make good guesses as to whether your friend is a good routing choice for a particular target.</li>
</ul>
<p>And, perhaps most interestingly, when tuned to simulate the conditions of the Travers and Milgram experiments, the model predicts that the average path length between a randomly chosen source and target is 6.7 &#8212; right in line with the &#8220;six degrees of separation&#8221; we all recite.</p>
<p>Takeaways: An interesting model both for its assumptions of how social networks can be formally characterized and how localized routing decisions work. Its routing algorithm produces paths of equal average length to observed human behavior.  </p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/QN-NJlH8jOc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/09/04/a-formal-model-for-travers-milgrams-letter-experiments/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/09/04/a-formal-model-for-travers-milgrams-letter-experiments/</feedburner:origLink></item>
		<item>
		<title>Nasty Bug in Rack 1.0</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/LGtCkAdLYjE/</link>
		<comments>http://www.edwardbenson.com/2009/08/12/nasty-bug-in-rack-1-0/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 03:28:05 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Ruby]]></category>
		<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Development]]></category>
		<category><![CDATA[rack]]></category>
		<category><![CDATA[rails]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=446</guid>
		<description><![CDATA[I spent most of the afternoon tracking down a nasty bug that ended up being in the Ruby Rack middlewear and thought I&#8217;d post a fix here in case there are any Rails developers out there who read my blog.
In short, a call to .params on a Rack::Request object will fail with an uncaught exception [...]]]></description>
			<content:encoded><![CDATA[<p>I spent most of the afternoon tracking down a nasty bug that ended up being in the Ruby Rack middlewear and thought I&#8217;d post a fix here in case there are any Rails developers out there who read my blog.</p>
<p>In short, a call to <code>.params</code> on a <code>Rack::Request</code> object will fail with an uncaught exception whenever <code>@env["rack.request.form_input"].eql</code> and <code>@env["rack.input"]</code> are both <code>nil</code>. This causes <code>request.POST</code> to return <code>nil</code> (line 137 of request.rb), which then causes line 160 of request.rb to throw an exception: </p>
<pre name="code" class="ruby">
160        self.put? ? self.GET : self.GET.update(self.POST)
</pre>
<p>I wouldn&#8217;t be surprised if this bug is already fixed in the latest git repository, but I wanted to post the fix here in case you are on a host where you are frozen at Rack 1.0 and can&#8217;t update to the lastest. </p>
<p>Basically, instead of using <code>request.params</code> to access the union of GET and POST params, use the following method:</p>
<pre name="code" class="ruby">
    def extract_params(req)
      if req.put?
        return req.GET
      else
        (req.GET || {}).update(req.POST || {})
      end
    rescue EOFError => e
      req.GET
    end
</pre>
<p>That implements the code a bit more safely and will return an empty hash instead of <code>nil</code>. Don&#8217;t hate me for using Ruby&#8217;s notorious <code>(possibly_nil_var || backup_var)</code> syntax. </p>
<p>Now to finally finish the real work I was trying to get done&#8230;.I guess the good news is I learned how to use ruby-debug. </p>
<p>I was using Rack::Request to extract the useful data out of the <code>env</code> variable that is presented with the rack request. In certain circumstances, the  </p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/LGtCkAdLYjE" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/08/12/nasty-bug-in-rack-1-0/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/08/12/nasty-bug-in-rack-1-0/</feedburner:origLink></item>
		<item>
		<title>Palm Pre secretly tracks you by GPS, sends info to Palm</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/KgjDRYRb1N0/</link>
		<comments>http://www.edwardbenson.com/2009/08/12/palm-pre-secretly-tracks-you-by-gps-sends-info-to-palm/#comments</comments>
		<pubDate>Wed, 12 Aug 2009 18:30:36 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Business]]></category>
		<category><![CDATA[Politics]]></category>
		<category><![CDATA[Palm Pre]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=444</guid>
		<description><![CDATA[It was bound to happen one day with these new GPS and Internet-enabled phones. First we find out AT&#038;T has been illegally spying on US citizens, now we find out that companies are beginning to do it for their own personal gain.
We dearly need someone on the hill to craft legislation that prevents companies from [...]]]></description>
			<content:encoded><![CDATA[<p>It was bound to happen one day with these new GPS and Internet-enabled phones. First we find out AT&#038;T has been illegally spying on US citizens, now we find out that companies are beginning to <a href="http://kitenet.net/~joey/blog/entry/Palm_Pre_privacy/">do it for their own personal gain</a>.</p>
<p>We dearly need someone on the hill to craft legislation that prevents companies from this type of cyber-stalking, as it can only lead to the types of societies that people don&#8217;t want for their kids.</p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/KgjDRYRb1N0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/08/12/palm-pre-secretly-tracks-you-by-gps-sends-info-to-palm/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/08/12/palm-pre-secretly-tracks-you-by-gps-sends-info-to-palm/</feedburner:origLink></item>
		<item>
		<title>Blog Moved!</title>
		<link>http://feedproxy.google.com/~r/edwardbenson/~3/3zaJrY-kTlc/</link>
		<comments>http://www.edwardbenson.com/2009/07/08/blog-moved/#comments</comments>
		<pubDate>Thu, 09 Jul 2009 01:23:30 +0000</pubDate>
		<dc:creator>Ted</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.edwardbenson.com/?p=442</guid>
		<description><![CDATA[For posterity&#8217;s sake, I&#8217;m cross posting from my blog at MIT here:
 Hi Everyone,
I have a confession to make. When I first got to MIT last fall, I thought the mit.edu domain was so cool and geek-cred-worthy that I moved my blog there from my old site at edwardbenson.com. Well, I&#8217;m moving it back, and [...]]]></description>
			<content:encoded><![CDATA[<p>For posterity&#8217;s sake, I&#8217;m cross posting from my blog at MIT here:</p>
<p> Hi Everyone,</p>
<p>I have a confession to make. When I first got to MIT last fall, I thought the mit.edu domain was so cool and geek-cred-worthy that I moved my blog there from my old site at <a href="http://www.edwardbenson.com/">edwardbenson.com</a>. Well, I&#8217;m moving it back, and permanently this time. Right now, I&#8217;m at MIT and love it, but that won&#8217;t always be the case. I will, however, always be Edward Benson, so <a href="http://www.edwardbenson.com/">edwardbenson.com</a> seems the best place to lay my occasional thoughts.</p>
<p>So, all you RSS readers out there (maybe just <a href="http://people.csail.mit.edu/marcua/">Adam</a>? I have no idea), please update your feed readers. You can either visit my <a href="http://www.edwardbenson.com/">new site</a> and click the RSS link that should pop up in your browser, or manually copy-paste <b>feed://feeds.feedburner.com/edwardbenson</b> into your feed reader.</p>
<p>(I&#8217;ve also switched over to FeedBurner so that this problem won&#8217;t happen in the future)</p>
<p>So long, mit.edu, and <a href="http://en.wikipedia.org/wiki/So_Long,_and_Thanks_for_All_the_Fish">thanks for all the fish</a>,<br />
Ted</p>
<img src="http://feeds.feedburner.com/~r/edwardbenson/~4/3zaJrY-kTlc" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://www.edwardbenson.com/2009/07/08/blog-moved/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://www.edwardbenson.com/2009/07/08/blog-moved/</feedburner:origLink></item>
	</channel>
</rss><!-- Dynamic page generated in 0.558 seconds. --><!-- Cached page generated by WP-Super-Cache on 2009-11-05 09:31:55 -->
