<?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>mitcho.com &#187; code</title>
	<atom:link href="http://mitcho.com/blog/tag/code/feed/" rel="self" type="application/rss+xml" />
	<link>http://mitcho.com</link>
	<description></description>
	<lastBuildDate>Tue, 07 Feb 2012 02:04:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.4-alpha-19719</generator>
		<item>
		<title>Every website has a purpose</title>
		<link>http://mitcho.com/blog/projects/every-website-has-a-purpose/</link>
		<comments>http://mitcho.com/blog/projects/every-website-has-a-purpose/#comments</comments>
		<pubDate>Thu, 03 Jun 2010 02:16:13 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[A/B testing]]></category>
		<category><![CDATA[Automattic]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[ShrimpTest]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mitcho.com/?p=3714</guid>
		<description><![CDATA[Every website has a purpose. Maybe you want people to buy a product, donate to your cause, download your app, or subscribe to your mailing list. How can you confidently modify your site to make it more effective with respect to this goal? A/B testing is a process by which multiple variants of a website [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/after-the-deadline-for-firefox/' rel='bookmark' title='After the Deadline for Firefox'>After the Deadline for Firefox</a></li>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Every website has a purpose. Maybe you want people to buy a product, donate to your cause, download your app, or subscribe to your mailing list. How can you confidently modify your site to make it more effective with respect to this goal?</p>

<p><strong>A/B testing</strong> is a process by which multiple variants of a website are presented to different users randomly and statistical tools are used to see whether any variant is more <em>effective</em>, according to an overall goal metric such as conversions or revenue.</p>

<p>While various A/B testing products—many free—exist, none are made from the ground up to work within the WordPress ecosystem. I believe a solution made particularly for WordPress could make A/B testing so much easier and more straightforward, and that such a solution could be greatly beneficial to the platform as a whole.</p>

<p>I&#8217;m happy to announce my new project, code-named <strong>ShrimpTest</strong>,<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> which is directly aimed at filling this void. I&#8217;ll be working on this project this summer together with the fantastic folks at <a href="http://automattic.com">Automattic</a>.</p>

<p>The best way to keep up with development is on the project&#8217;s development blog, <a href="http://shrimptest.wordpress.com/">the ShrimpTest P2</a>. Most updates will most likely be much shorter than this initial post. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  You can get less frequent, milestone-like updates by <a href="http://twitter.com/shrimptest">following ShrimpTest on twitter</a>. Development will be <a href="http://plugins.svn.wordpress.org/shrimptest/">open</a> so feel free to check it out (haha) and submit patches as well. As I go along, I&#8217;ll also look forward to your feedback.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Five dollars to the first person to correctly guess why I&#8217;m calling it ShrimpTest.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/after-the-deadline-for-firefox/' rel='bookmark' title='After the Deadline for Firefox'>After the Deadline for Firefox</a></li>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/every-website-has-a-purpose/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Better Linguist List RSS Feeds</title>
		<link>http://mitcho.com/blog/projects/better-linguist-list-rss-feeds/</link>
		<comments>http://mitcho.com/blog/projects/better-linguist-list-rss-feeds/#comments</comments>
		<pubDate>Mon, 26 Apr 2010 23:18:14 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[annoyances]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Linguist List]]></category>
		<category><![CDATA[linguistics]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3555</guid>
		<description><![CDATA[Everyone I know in linguistics uses the LINGUIST List website to a greater or lesser degree. Linguist List began as a mailing list in the 90&#8217;s, with book, job, and dissertation announcements, call-for-papers, and general academic discussions. Nowadays many people follow the various announcements on Linguist List using an RSS feed reader such as Google [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/automating-the-linguists-job/' rel='bookmark' title='Automating the Linguist&#8217;s Job'>Automating the Linguist&#8217;s Job</a></li>
<li><a href='http://mitcho.com/blog/link/the-hit-list-better-software-through-less-ui/' rel='bookmark' title='The Hit List: Better Software Through Less UI'>The Hit List: Better Software Through Less UI</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-ubiquity-an-open-letter-to-linguists/' rel='bookmark' title='Localizing Ubiquity: an open letter to linguists'>Localizing Ubiquity: an open letter to linguists</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://mitcho.com/blog/wp-content/uploads/2010/04/linguistlist.png"><img src="http://mitcho.com/blog/wp-content/uploads/2010/04/linguistlist.png" alt="" title="linguistlist" width="268" height="99" class="alignright size-full wp-image-3556" /></a></p>

<p>Everyone I know in linguistics uses the <a href="http://linguistlist.org/">LINGUIST List</a> website to a greater or lesser degree. Linguist List began as a mailing list in the 90&#8217;s, with book, job, and dissertation announcements, call-for-papers, and general academic discussions.</p>

<p>Nowadays many people follow the various announcements on Linguist List using an RSS feed reader such as <a href="http://google.com/reader">Google Reader</a> or my personal favorite <a href="http://netnewswireapp.com/">NetNewsWire</a>.</p>

<p>Unfortunately, the Linguist List RSS feeds (at least recently) don&#8217;t include the full text of the articles and have a few other quirks as well. It&#8217;s often hard to judge based on the title whether it&#8217;s really something I&#8217;m interested or not, so I&#8217;ve spent a lot of time frustratedly opening any possibly interesting-looking entry in a separate NetNewsWire tab. Today I decided enough was enough: I just wrote a script which parses each of the Linguist List RSS feeds, finds the actual descriptions and interleaves them.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> It&#8217;s working remarkably well so far:</p>

<p><span id="more-3555"></span></p>

<p><a rel='imagebox' href="http://mitcho.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-26-at-6.41.07-PM.png"><img src="http://mitcho.com/blog/wp-content/uploads/2010/04/Screen-shot-2010-04-26-at-6.41.07-PM.png" alt="" title="Screen shot 2010-04-26 at 6.41.07 PM" width="650" height="365" class="alignright size-full wp-image-3557" /></a></p>

<p>Here are all the RSS links for all of you to subscribe to. I plan on keeping this up and maintained for the foreseeable future (or, until Linguist List improves their own RSS feeds!) so feel free to subscribe to it. Please do let me know if you run into any issues or have a suggestion. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<table>
<tr><td><a href="http://feeds.feedburner.com/LinguistListMostRecent" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Most recent issues</a></td><td><a href="http://feeds.feedburner.com/LinguistListMostRecent"><img src="http://feeds.feedburner.com/~fc/LinguistListMostRecent?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListAll" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> All (announcements)</a></td><td><a href="http://feeds.feedburner.com/LinguistListAll"><img src="http://feeds.feedburner.com/~fc/LinguistListAll?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListBooks" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Book announcements</a></td><td><a href="http://feeds.feedburner.com/LinguistListBooks"><img src="http://feeds.feedburner.com/~fc/LinguistListBooks?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListCalls" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Call for papers</a></td><td><a href="http://feeds.feedburner.com/LinguistListCalls"><img src="http://feeds.feedburner.com/~fc/LinguistListCalls?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListConfs" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Conference announcements</a></td><td><a href="http://feeds.feedburner.com/LinguistListConfs"><img src="http://feeds.feedburner.com/~fc/LinguistListConfs?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListDisc" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Discussions</a></td><td><a href="http://feeds.feedburner.com/LinguistListDisc"><img src="http://feeds.feedburner.com/~fc/LinguistListDisc?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListDiss" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Dissertation announcements</a></td><td><a href="http://feeds.feedburner.com/LinguistListDiss"><img src="http://feeds.feedburner.com/~fc/LinguistListDiss?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListFYI" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> FYI</a></td><td><a href="http://feeds.feedburner.com/LinguistListFYI"><img src="http://feeds.feedburner.com/~fc/LinguistListFYI?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListJobs" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Job announcements</a></td><td><a href="http://feeds.feedburner.com/LinguistListJobs"><img src="http://feeds.feedburner.com/~fc/LinguistListJobs?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListMedia" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Topics in the Media</a></td><td><a href="http://feeds.feedburner.com/LinguistListMedia"><img src="http://feeds.feedburner.com/~fc/LinguistListMedia?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListQs" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Queries</a></td><td><a href="http://feeds.feedburner.com/LinguistListQs"><img src="http://feeds.feedburner.com/~fc/LinguistListQs?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListReview" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Book reviews</a></td><td><a href="http://feeds.feedburner.com/LinguistListReview"><img src="http://feeds.feedburner.com/~fc/LinguistListReview?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListSoftware" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Software announcements</a></td><td><a href="http://feeds.feedburner.com/LinguistListSoftware"><img src="http://feeds.feedburner.com/~fc/LinguistListSoftware?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListSum" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Summaries of Query Responses</a></td><td><a href="http://feeds.feedburner.com/LinguistListSum"><img src="http://feeds.feedburner.com/~fc/LinguistListSum?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
<tr><td><a href="http://feeds.feedburner.com/LinguistListSupport" type="application/rss+xml"><img src='http://feedburner.google.com/fb/lib/images/icons/feed-icon-12x12-orange.gif'/> Support for Students</a></td><td><a href="http://feeds.feedburner.com/LinguistListSupport"><img src="http://feeds.feedburner.com/~fc/LinguistListSupport?bg=99CCFF&#038;fg=444444&#038;anim=0" height="26" width="88" style="border:0" alt="" /></a></td></tr>
</table>

<p>You can find descriptions of the content of each of these feeds <a href="http://linguistlist.org/issues/rss/topics.cfm">on Linguist List&#8217;s RSS feeds page</a>.</p>

<p><a href="http://www.feedburner.com" target="_blank"><img src="http://www.feedburner.com/fb/images/pub/i_heart_fb.gif" alt="Powered by FeedBurner" style="border:0"/></a><a href="http://scripts.mit.edu/">
<img alt="powered by scripts.mit.edu"
src="http://scripts.mit.edu/media/powered_by.gif" /></a></p>

<p>Perhaps in the future I&#8217;ll do a &#8220;how to&#8221; post as well with the code I use to make this happen. I&#8217;ll note that it&#8217;s just 70 lines of PHP (including whitespace) and could no doubt be tightened up. <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Veteran Linguist List RSS subscribers will also note that I&#8217;m adding the full title to the entry title for the Conferences and Calls lists as well.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/automating-the-linguists-job/' rel='bookmark' title='Automating the Linguist&#8217;s Job'>Automating the Linguist&#8217;s Job</a></li>
<li><a href='http://mitcho.com/blog/link/the-hit-list-better-software-through-less-ui/' rel='bookmark' title='The Hit List: Better Software Through Less UI'>The Hit List: Better Software Through Less UI</a></li>
<li><a href='http://mitcho.com/blog/projects/localizing-ubiquity-an-open-letter-to-linguists/' rel='bookmark' title='Localizing Ubiquity: an open letter to linguists'>Localizing Ubiquity: an open letter to linguists</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/better-linguist-list-rss-feeds/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Spring is for Speaking: JSConf, WordCamp SF, IACL</title>
		<link>http://mitcho.com/blog/projects/spring-is-for-speaking/</link>
		<comments>http://mitcho.com/blog/projects/spring-is-for-speaking/#comments</comments>
		<pubDate>Sat, 20 Mar 2010 04:37:04 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[Boston]]></category>
		<category><![CDATA[Chinese language]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[conference]]></category>
		<category><![CDATA[harvard]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jetpack]]></category>
		<category><![CDATA[linguistics]]></category>
		<category><![CDATA[Mandarin]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[San Francisco]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[Washington D.C.]]></category>
		<category><![CDATA[WordCamp]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3448</guid>
		<description><![CDATA[I recently confirmed three different very exciting speaking gigs which I&#8217;ll be doing this spring: JSConf.us: I&#8217;ll be putting my Mozilla Jetpack Ambassador hat on to represent Mozilla Labs&#8217; Jetpack project at the premier Javascript conference in North America, JSConf.us, which this year will be April 17-18 in Washington D.C. and has a pirate theme.1 [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Jetpacking in Boston'>Jetpacking in Boston</a></li>
<li><a href='http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/' rel='bookmark' title='Mashing up the browser in Maine'>Mashing up the browser in Maine</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently confirmed three different very exciting speaking gigs which I&#8217;ll be doing this spring:</p>

<p><span id="more-3448"></span></p>

<p><strong>JSConf.us</strong>:</p>

<p>I&#8217;ll be putting my Mozilla Jetpack Ambassador hat on to represent Mozilla Labs&#8217; <a href="https://jetpack.mozillalabs.com/">Jetpack project</a> at the premier Javascript conference in North America, <a href="http://jsconf.us/2010/">JSConf.us</a>, which this year will be April 17-18 in Washington D.C. and has a pirate theme.<sup id="fnref:2"><a href="#fn:2" rel="footnote">1</a></sup> I&#8217;ll be giving a short talk in the main session and will also lead a hands-on Jetpack workshop in the hacker lounge. I&#8217;ve heard that JSConf is a lot of fun and I&#8217;m really looking forward to it! <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><strong>WordCamp San Francisco</strong>:</p>

<p>I&#8217;m honored to have been invited to give a talk at <a href="http://2010.sf.wordcamp.org/">WordCamp San Francisco 2010</a>. WordCamps are community-organized events for the <a href="http://wordpress.org">WordPress</a> community, and the San Francisco WordCamp is the original and biggest. WordCamp SF will be at the Mission Bay Conference Center on May 1st. <a href="https://2010.sf.wordcamp.org/tickets/">Tickets available</a>.</p>

<p>My talk is tentatively titled &#8220;Abstract Your Code.&#8221;<sup id="fnref:1"><a href="#fn:1" rel="footnote">2</a></sup> WordPress is a great platform to build amazing content-rich applications on, and many of us have written new functionality in the form of plugins. I hope to encourage developers to make their code more portable and reusable after the project is done—or, ideally, to even start with abstraction in mind—to add to the &#8220;life&#8221; of the code and to consider then open-sourcing that functionality.</p>

<p>Hope to see you there!</p>

<p><strong>International Association of Chinese Linguistics (IACL) 18</strong>:</p>

<p>Finally, I&#8217;m thrilled to say that I got a paper accepted to the <a href="http://www.fas.harvard.edu/~iacl18/Site/index.html">annual meeting of the International Association of Chinese Linguistics</a> which this year is at Harvard on May 20-22. IACL is <em>the</em> big conference for Chinese linguistics, with about <a href="http://www.fas.harvard.edu/~IACL18/AcceptList.pdf">180 papers presenting</a>. I&#8217;ll be presenting <em>Two</em> Only<em>s in Mandarin Chinese</em>, my recent work on the formal syntax/semantics of two <em>only</em> words in Chinese: <em>zhǐ</em> (只) and <em>éryǐ</em> (而已). I&#8217;ve put up <a href="http://mitcho.com/academic/handout-20100226.pdf">a handout</a> of some of this material in work-in-progress form which I recently presented at <a href="http://people.fas.harvard.edu/~nicolae/SNEWS_2010/Welcome.html">SNEWS</a>.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:2">
<p>I&#8217;ll <a href="http://beijinghuar.com">fit right in</a>.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:1">
<p>Sexier title suggestions welcome.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
<li><a href='http://mitcho.com/blog/projects/jetpacking-in-boston/' rel='bookmark' title='Jetpacking in Boston'>Jetpacking in Boston</a></li>
<li><a href='http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/' rel='bookmark' title='Mashing up the browser in Maine'>Mashing up the browser in Maine</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/spring-is-for-speaking/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Jetpacking in Boston</title>
		<link>http://mitcho.com/blog/projects/jetpacking-in-boston/</link>
		<comments>http://mitcho.com/blog/projects/jetpacking-in-boston/#comments</comments>
		<pubDate>Sat, 13 Mar 2010 21:19:06 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[Boston]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Jetpack]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[talk]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3424</guid>
		<description><![CDATA[A couple weeks ago I gave a talk at the Boston Javascript meetup introducing Jetpack and filling people in in the latest developments in the project, including the Reboot. Between 20 to 30 people came to the talk which was at Microsoft Cambridge. Here are the slides from the talk:1 Extend the Browser with Jetpack [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/' rel='bookmark' title='Mashing up the browser in Maine'>Mashing up the browser in Maine</a></li>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>A couple weeks ago I gave a talk at the <a href="http://javascript.meetup.com/2/">Boston Javascript meetup</a> introducing Jetpack and filling people in in the latest developments in the project, including the <a href="http://javascript.meetup.com/2/">Reboot</a>. Between 20 to 30 people came to the talk which was at Microsoft Cambridge. Here are the slides from the talk:<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p><a href="http://www.slideshare.net/mitcho/extend-the-browser-with-jetpack" title="Extend the Browser with Jetpack">Extend the Browser with Jetpack</a></p>

<p><object width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bostonjs-100224202650-phpapp02&#038;rel=0&#038;stripped_title=extend-the-browser-with-jetpack" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=bostonjs-100224202650-phpapp02&#038;rel=0&#038;stripped_title=extend-the-browser-with-jetpack" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object></p>

<p><span id="more-3424"></span>I felt the audience was very engaged and we had almost a dozen questions in the question period and throughout. Most of the examples centered around the use of capabilities and the new security model. For example:</p>

<ul>
<li>What level of granularity will the manifests have? Do you have to just say &#8220;I use xhr&#8221; or &#8220;I talk to twitter but not facebook&#8221;?</li>
<li>What will be the review process for capabilities?</li>
<li>What license will capabilities use?</li>
</ul>

<p>Perhaps I simply did not present this material in the clearest manner (it didn&#8217;t help that I didn&#8217;t have any particular slides covering the <a href="http://vimeo.com/10011379">capability and manifest model</a>) but it also reflects the reality that these particulars of the manifests&#8217; security sections are still being fleshed out. I&#8217;m looking forward to <a href="http://jsconf.us/2010/">the next time I speak on Jetpack</a> when hopefully the discussion of the Reboot will be more concrete and I&#8217;ll be able to give a clearer overview and demo of these aspects of the Reboot.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>If anyone would like the Keynote deck, just let me know.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/' rel='bookmark' title='Mashing up the browser in Maine'>Mashing up the browser in Maine</a></li>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/life/wordcamp-boston-2010/' rel='bookmark' title='WordCamp Boston 2010'>WordCamp Boston 2010</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/jetpacking-in-boston/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>After the Deadline for Firefox</title>
		<link>http://mitcho.com/blog/projects/after-the-deadline-for-firefox/</link>
		<comments>http://mitcho.com/blog/projects/after-the-deadline-for-firefox/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 01:02:54 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[Automattic]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[Firefox]]></category>
		<category><![CDATA[proofreading]]></category>
		<category><![CDATA[spelling]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3321</guid>
		<description><![CDATA[After the Deadline is a powerful and intelligent proofreading tool which checks for spelling errors, misused words, some grammatical gaffes, and even some stylistic issues. For the past month, I&#8217;ve been working for Automattic, the company behind AtD and the makers of WordPress.com, to create a Firefox add-on which enables this superior technology everywhere on [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/mozilla-by-the-numbers/' rel='bookmark' title='Mozilla By The Numbers'>Mozilla By The Numbers</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-in-firefox-japanese/' rel='bookmark' title='Ubiquity in Firefox: Focus on Japanese'>Ubiquity in Firefox: Focus on Japanese</a></li>
<li><a href='http://mitcho.com/blog/link/light-of-firefox-tomoshibi-%e7%81%af-from-mozilla-japan/' rel='bookmark' title='Light of Firefox (tomoshibi 灯) from Mozilla Japan'>Light of Firefox (tomoshibi 灯) from Mozilla Japan</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><a href="http://afterthedeadline.com">After the Deadline</a> is a powerful and intelligent proofreading tool which checks for spelling errors, misused words, some grammatical gaffes, and even some stylistic issues. For the past month, I&#8217;ve been working for <a href="http://automattic.com">Automattic</a>, the company behind AtD and the makers of <a href="http://wordpress.com">WordPress.com</a>, to create a Firefox add-on which enables this superior technology everywhere on the web. Words can&#8217;t do justice to the magic that is AtD, so here&#8217;s a video we put together:</p>

<p><embed src="http://v.wordpress.com/wp-content/plugins/video/flvplayer.swf?ver=1.15" type="application/x-shockwave-flash" width="640" height="360" allowscriptaccess="always" allowfullscreen="true" flashvars="guid=n3dZCS7D&amp;width=640&amp;height=360&amp;qc_publisherId=p-18-mFEk4J448M" title="Firefox: Check Spelling, Style, and Grammar"></embed></p>

<p>I invite you all to give it a spin:</p>

<p style='text-align:center'><a title="Add After the Deadline to Firefox" class="button positive significant" href="https://addons.mozilla.org/downloads/latest/58947/addon-58947-latest.xpi?src=external-mitcho"><img src="http://mitcho.com/blog/wp-content/uploads/2010/02/add-add-on.png" alt="add-add-on.png" border="0" width="263" height="36" /></a></p>

<p>Working on After the Deadline for Firefox gave me my first experience creating an add-on from the ground up and I&#8217;ve learned a lot. After working on Ubiquity and dabbling with Jetpack, it&#8217;s given me another perspective on extensibility on the web and I look forward to thinking and writing more about these experiences in the near future.</p>

<p>In the mean time, happy proofreading! <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/mozilla-by-the-numbers/' rel='bookmark' title='Mozilla By The Numbers'>Mozilla By The Numbers</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-in-firefox-japanese/' rel='bookmark' title='Ubiquity in Firefox: Focus on Japanese'>Ubiquity in Firefox: Focus on Japanese</a></li>
<li><a href='http://mitcho.com/blog/link/light-of-firefox-tomoshibi-%e7%81%af-from-mozilla-japan/' rel='bookmark' title='Light of Firefox (tomoshibi 灯) from Mozilla Japan'>Light of Firefox (tomoshibi 灯) from Mozilla Japan</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/after-the-deadline-for-firefox/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>WordCamp Boston 2010</title>
		<link>http://mitcho.com/blog/life/wordcamp-boston-2010/</link>
		<comments>http://mitcho.com/blog/life/wordcamp-boston-2010/#comments</comments>
		<pubDate>Sat, 30 Jan 2010 02:02:01 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[Boston]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[video]]></category>
		<category><![CDATA[WordPress]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3298</guid>
		<description><![CDATA[This past weekend I gave a couple talks at the inaugural WordCamp Boston. WordCamps are local, community-organized events for WordPress users and enthusiasts. We had about 400 people at the Microsoft Cambridge campus. (I invite you to also check out more photos below as well as my full WordCamp gallery.) My first talk was &#8220;Getting [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/presenting-in-boston-at-sigir-workshop/' rel='bookmark' title='Presenting in Boston at SIGIR Workshop'>Presenting in Boston at SIGIR Workshop</a></li>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><img src="http://mitcho.com/blog/wp-content/uploads/2010/01/4096077627_c6d3035124_o.jpg" alt="4096077627_c6d3035124_o.jpg" border="0" width="470" height="246" /></p>

<p>This past weekend I gave a couple talks at the inaugural <a href="http://wordcampboston.com/">WordCamp Boston</a>. <a href="http://central.wordcamp.org/">WordCamps</a> are local, community-organized events for <a href="http://wordpress.org">WordPress</a> users and enthusiasts. We had about 400 people at the Microsoft Cambridge campus.</p>

<p><zp:boston/wordcamp/wordcamp28.jpg><zp:boston/wordcamp/wordcamp31.jpg><zp:boston/wordcamp/wordcamp35.jpg></p>

<p><span id="more-3298"></span></p>

<p>(I invite you to also check out more photos below as well as my <a href="http://mitcho.com/photos/boston/wordcamp/">full WordCamp gallery</a>.)</p>

<p>My first talk was &#8220;Getting Into The Loop,&#8221; which gives a quick taste of <a href="http://codex.wordpress.org/The_Loop">The Loop</a> which is a central programming construct in every WordPress application. (<a href="http://speakerrate.com/talks/2000-getting-into-the-loop">SlideShare</a>, <a href="http://speakerrate.com/talks/2000-getting-into-the-loop">SpeakerRate</a>)</p>

<p><embed src="http://blip.tv/play/AYHA938C" type="application/x-shockwave-flash" width="650" height="473" allowscriptaccess="always" allowfullscreen="true"></embed></p>

<p>My second talk was an <a href="http://en.wikipedia.org/wiki/Ignite_(event)">Ignite</a> talk on the importance of beta testing plugins. Ignite talks are five minute lightning talks with 20 slides which auto-advance every 15 seconds. (<a href="http://www.slideshare.net/mitcho/ignite-wordcamp-youd-beta-test-your-plugins">SlideShare</a>, <a href="http://speakerrate.com/talks/2031-ignite-wordcamp-you%E2%80%99d-beta%E2%80%99-test-your-plugins">SpeakerRate</a>)</p>

<p><object width="650" height="384"><param name="movie" value="http://www.youtube.com/v/n3RXpJrSAnw&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;hd=1"></param><param name="allowFullScreen" value="true"></param><param name="allowscriptaccess" value="always"></param><embed src="http://www.youtube.com/v/n3RXpJrSAnw&#038;hl=en_US&#038;fs=1&#038;rel=0&#038;hd=1" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="650" height="384"></embed></object></p>

<p>The videos for both talks will ultimately go up on <a href="http://wordpress.tv">wordpress.tv</a>.</p>

<p>The event was a huge success and I&#8217;m looking forward to help organize WordCamp Boston 2011 as well! <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>

<p><zp:boston/wordcamp/wordcamp11.jpg><zp:boston/wordcamp/wordcamp13.jpg><zp:boston/wordcamp/wordcamp16.jpg><zp:boston/wordcamp/wordcamp29.jpg><zp:boston/wordcamp/wordcamp60.jpg><zp:boston/wordcamp/wordcamp68.jpg><zp:boston/wordcamp/wordcamp77.jpg><zp:boston/wordcamp/wordcamp78.jpg><zp:boston/wordcamp/wordcamp82.jpg><zp:boston/wordcamp/wordcamp85.jpg><zp:boston/wordcamp/wordcamp86.jpg></p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/presenting-in-boston-at-sigir-workshop/' rel='bookmark' title='Presenting in Boston at SIGIR Workshop'>Presenting in Boston at SIGIR Workshop</a></li>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/life/wordcamp-boston-2010/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating an image-sized iframe overlay with Shadowbox</title>
		<link>http://mitcho.com/blog/how-to/creating-an-image-sized-iframe-overlay-with-shadowbox/</link>
		<comments>http://mitcho.com/blog/how-to/creating-an-image-sized-iframe-overlay-with-shadowbox/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 05:33:50 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[how to]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[iframe]]></category>
		<category><![CDATA[image]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[MIT]]></category>
		<category><![CDATA[shadowbox]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3293</guid>
		<description><![CDATA[I recently have been working with the Shadowbox JavaScript library for an upcoming revision to the MIT Edgerton Digital Collections website. Shadowbox is a nice lightbox library designed to work with various JavaScript libraries like jQuery, prototype, and mootools with a nice modular design. Shadowbox is organized around different &#8220;players&#8221;—one for each kind of media [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/life/im-seriously-dreaming-of-a-white-christmas/' rel='bookmark' title='I&#8217;m Seriously Dreaming of a White Christmas'>I&#8217;m Seriously Dreaming of a White Christmas</a></li>
<li><a href='http://mitcho.com/blog/life/the-gift-that-keeps-on-giving/' rel='bookmark' title='The Gift That Keeps On Giving'>The Gift That Keeps On Giving</a></li>
<li><a href='http://mitcho.com/blog/life/atayal-cultural-festival/' rel='bookmark' title='Atayal cultural festival'>Atayal cultural festival</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently have been working with the <a href="http://www.shadowbox-js.com/">Shadowbox</a> JavaScript library for an upcoming revision to the MIT <a href="http://edgerton-digital-collections.org">Edgerton Digital Collections</a> website. Shadowbox is a nice <a href="http://en.wikipedia.org/wiki/Lightbox (JavaScript)">lightbox</a> library designed to work with various JavaScript libraries like jQuery, prototype, and mootools with a nice modular design.</p>

<p>Shadowbox is organized around different &#8220;players&#8221;—one for each kind of media that will be displayed. The library by default comes with players for Flash, HTML fragments, <code>iframe</code>s, QuickTime, and Windows Media. Some of these players, like those for images and video, automatically recognize the media size and adjust the lightbox accordingly, while others such as the <code>iframe</code> player can use a set size or can fill the screen. For the Edgerton site, though, we had a need for displaying an <code>iframe</code> but in the dimensions of a set image, so that we could display the image with an overlay. Here are some notes on how to implement a custom player for Shadowbox.</p>

<p><span id="more-3293"></span>
The first step to getting Shadowbox to recognize a custom player is to modify the players loaded by <code>shadowbox.js</code>. I called my player &#8220;hybrid,&#8221; as it&#8217;s like a cross between the <code>iframe</code> and <code>img</code> players.</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">Shadowbox.<span style="color: #660066;">options</span>.<span style="color: #660066;">players</span><span style="color: #339933;">=</span><span style="color: #009900;">&#91;</span><span style="color: #3366CC;">&quot;html&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;iframe&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;img&quot;</span><span style="color: #339933;">,</span><span style="color: #3366CC;">&quot;hybrid&quot;</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span></pre></div></div>


<p>Now Shadowbox will try to look for the file <code>players/shadowbox-hybrid.js</code>. That&#8217;s where we will create our custom player. Start by duplicating the <code>iframe</code> player file. Next, we can make one more change to <code>shadowbox.js</code>. In the <code>getPlayer</code> function, add a line that will return &#8220;<code>hybrid</code>&#8221; when it recognizes a lightbox which should use the hybrid player. I added the following line, which uses the hybrid player when the text &#8220;<code>galleries</code>&#8221; is in the <code>a</code> tag&#8217;s <code>href</code> attribute.</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #009966; font-style: italic;">/galleries/</span>.<span style="color: #660066;">test</span><span style="color: #009900;">&#40;</span>content<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #3366CC;">&quot;hybrid&quot;</span><span style="color: #339933;">;</span></pre></div></div>


<p>Finally, you must actually write the new player. There&#8217;s a readme file which describes the interface:</p>

<blockquote>
<p>All players should implement the same interface. This makes it possible for the Shadowbox class to know what methods to call and properties to check on player objects.</p>
<p>The interface is described here, with some simple explanations of how each method and/or property is to be used.</p>
<dl>
<dt><strong>height</strong></dt>
    <dd>(Number) The height of the object (in pixels)</dd>
<dt><strong>width</strong></dt>
    <dd>(Number) The width of the object (in pixels)</dd>
<dt><strong>ready</strong></dt>
    <dd>(optional, Boolean) True if the content is ready to be loaded, false otherwise. Useful when the script should wait until the content loads before proceeding (see below)</dd>
<dt><strong>resizable</strong></dt>
    <dd>(optional, Boolean) True if the content can be dynamically resized by the script (e.g. images, but not most movie formats)</dd>
<dt><strong>append()</strong></dt>
    <dd>Appends this object to the DOM</dd>
<dt><strong>remove()</strong></dt>
    <dd>Removes this object from the DOM</dd>
<dt><strong>onLoad()</strong></dt>
    <dd>(optional) Called after the content is loaded and the loading layer is hidden</dd>
<dt><strong>onWindowResize()</strong></dt>
    <dd>(optional) Called when the window is resized</dd>
</dl>
</blockquote>

<p>I found these directions quite easy to follow. For our purposes, there was also a note on how to set an object&#8217;s height and width based on an image.</p>

<p>Hopefully these notes are helpful for others who hope to take full advantage of this very powerful JavaScript library.</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/life/im-seriously-dreaming-of-a-white-christmas/' rel='bookmark' title='I&#8217;m Seriously Dreaming of a White Christmas'>I&#8217;m Seriously Dreaming of a White Christmas</a></li>
<li><a href='http://mitcho.com/blog/life/the-gift-that-keeps-on-giving/' rel='bookmark' title='The Gift That Keeps On Giving'>The Gift That Keeps On Giving</a></li>
<li><a href='http://mitcho.com/blog/life/atayal-cultural-festival/' rel='bookmark' title='Atayal cultural festival'>Atayal cultural festival</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/how-to/creating-an-image-sized-iframe-overlay-with-shadowbox/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Disgusting Word-formatted HTML and how to fix it</title>
		<link>http://mitcho.com/blog/projects/disgusting-word-formatted-html-and-how-to-fix-it/</link>
		<comments>http://mitcho.com/blog/projects/disgusting-word-formatted-html-and-how-to-fix-it/#comments</comments>
		<pubDate>Wed, 30 Dec 2009 21:29:44 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[observation]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[markup]]></category>
		<category><![CDATA[microsoft]]></category>
		<category><![CDATA[MITWPL]]></category>
		<category><![CDATA[Office]]></category>
		<category><![CDATA[perl]]></category>
		<category><![CDATA[word]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3287</guid>
		<description><![CDATA[In working on a new website for the MIT Working Papers in Linguistics, I recently inherited a collection of HTML files with all of our books&#8217; abstracts. To my dismay (but not surprise) the markup in these files were horrendous. Here are some of the cardinal sins of markup that I saw committed in these [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/observation/%e5%8f%8e%e9%9b%86-vs-%e5%9b%9e%e5%8f%8e-and-better-word-meanings-through-usage/' rel='bookmark' title='回収 vs. 収集 and Better Word Meanings Through Usage'>回収 vs. 収集 and Better Word Meanings Through Usage</a></li>
<li><a href='http://mitcho.com/blog/life/the-most-beautiful-word/' rel='bookmark' title='The Most Beautiful Word'>The Most Beautiful Word</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>In working on a new website for the MIT Working Papers in Linguistics, I recently inherited a collection of HTML files with all of our books&#8217; abstracts. To my dismay (but not surprise) the markup in these files were horrendous. Here are some of the cardinal sins of markup that I saw committed in these files:</p>

<ol>
<li><strong>Confusing <code>id</code>s and <code>class</code>es.</strong> <code>id</code>s should be unique on the page&#8230; but here&#8217;s an instance of using multiple instances of the same <code>id</code> in order to format them together.<br/></li>
</ol>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;div id=&quot;indent&quot;&gt; &lt;div id=&quot;number&quot;&gt;4.2.1&lt;/div&gt; &lt;div id=&quot;page&quot;&gt;161&lt;/div&gt; &lt;div id=&quot;section&quot;&gt;Old French (Adams 1987)&lt;/div&gt;
&lt;/div&gt; &lt;div id=&quot;indent&quot;&gt; &lt;div id=&quot;number&quot;&gt;4.2.2&lt;/div&gt; &lt;div id=&quot;page&quot;&gt;164&lt;/div&gt; &lt;div id=&quot;section&quot;&gt;The evolution of the dialects of northern Italy&lt;/div&gt;</pre></div></div>


<ol>
<li><strong>Putting a class on every instance of something.</strong> Everything paragraph should be formatted equivalently. We get the point.<br/></li>
</ol>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p class=MsoNormal&gt;&lt;b&gt;The English Noun Phrase in Its Sentential Aspect&lt;/b&gt;&lt;/p&gt;
&lt;p class=MsoNormal&gt;Steven Paul Abney&lt;/p&gt;
&lt;p class=MsoNormal&gt;May 1987&lt;/p&gt;</pre></div></div>


<ol>
<li><strong>Using blank space for formatting.</strong>  <br/></li>
</ol>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p class=MsoNormal&gt;&lt;o:p&gt;&amp;amp;nbsp;&lt;/o:p&gt;&lt;/p&gt;</pre></div></div>


<ol>
<li><strong>CSS styles that don&#8217;t exist.</strong> Browsers just ignore these anyway&#8230; <br/></li>
</ol>


<div class="wp_syntax"><div class="code"><pre class="html" style="font-family:monospace;">&lt;p class=MsoNormal&gt;One factor in determining which worlds a modal quantifies
over is the temporal argument of the modal’s accessibility relation.&lt;span
style='mso-spacerun:yes'&gt;  &lt;/span&gt;It is well-known that a higher tense affects
the accessibility relation of modals.&lt;span style='mso-spacerun:yes'&gt; 
&lt;/span&gt;What is not well-known is that there are aspectual operators high enough
to affect the accessibility relation of modals.&lt;span style='mso-spacerun:yes'&gt; 
&lt;/span&amp;gt</pre></div></div>


<h3>The solution</h3>

<p>My solution was to write a perl script which takes care of a number of these issues. It&#8217;s not foolproof and doesn&#8217;t involve any voodoo—for example, it can&#8217;t retypeset things which were formatted using whitespace—but it does a good job as a first pass.</p>

<div class="files">
<div class="file">
<a href="http://mitcho.com/blog/wp-content/uploads/2009/12/cleanwordhtml.pl_.txt">cleanwordhtml.pl</a><br/>
<span class="specs">perl</span>
</div>
</div>

<p>You can run the script by making it executable (<code>chmod +x cleanwordhtml.pl</code>) then specifying a target filename as an argument. For example,</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">.<span style="color: #000000; font-weight: bold;">/</span>cleanwordhtml.pl source.html <span style="color: #000000; font-weight: bold;">&gt;</span> clean.html</pre></div></div>


<p>I used this with a simple bash for loop to run over all my files:</p>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">for</span> f <span style="color: #000000; font-weight: bold;">in</span> <span style="color: #000000; font-weight: bold;">*/*</span>.html; <span style="color: #000000; font-weight: bold;">do</span> .<span style="color: #000000; font-weight: bold;">/</span>cleanwordhtml.pl <span style="color: #007800;">$f</span> <span style="color: #000000; font-weight: bold;">&gt;</span> <span style="color: #800000;">${f%.html}</span>-clean.html; <span style="color: #000000; font-weight: bold;">done</span>;</pre></div></div>


<p>Hopefully someone else can benefit from my experience.</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/observation/%e5%8f%8e%e9%9b%86-vs-%e5%9b%9e%e5%8f%8e-and-better-word-meanings-through-usage/' rel='bookmark' title='回収 vs. 収集 and Better Word Meanings Through Usage'>回収 vs. 収集 and Better Word Meanings Through Usage</a></li>
<li><a href='http://mitcho.com/blog/life/the-most-beautiful-word/' rel='bookmark' title='The Most Beautiful Word'>The Most Beautiful Word</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/disgusting-word-formatted-html-and-how-to-fix-it/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Mashing up the browser in Maine</title>
		<link>http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/</link>
		<comments>http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/#comments</comments>
		<pubDate>Sat, 19 Dec 2009 19:00:32 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[travelogue]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[demo]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Jetpack]]></category>
		<category><![CDATA[Maine]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[presentation]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=3233</guid>
		<description><![CDATA[Last week I was invited to give a talk at the TechMaine annual conference in Portland, Maine. Being a longer time slot than I previously have used to talk about Ubiquity, I decided to dedicate a good portion of the talk to Jetpack. Being outside of Mozilla for the past few months, this gave me [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/talking-ubiquity-in-japan-%e6%8b%a1%e5%bc%b5%e6%a9%9f%e8%83%bd%e5%8b%89%e5%bc%b7%e4%bc%9a%e3%81%ab%e3%81%a6%e7%99%ba%e8%a1%a8/' rel='bookmark' title='Talking Ubiquity in Japan: 拡張機能勉強会にて発表'>Talking Ubiquity in Japan: 拡張機能勉強会にて発表</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-presentation-at-tokyo-20/' rel='bookmark' title='Ubiquity presentation at Tokyo 2.0'>Ubiquity presentation at Tokyo 2.0</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Last week I was invited to give a talk at the <a href="http://www.techmaine.com/ac2009">TechMaine annual conference</a> in Portland, Maine.</p>

<p>Being a longer time slot than I previously have used to talk about Ubiquity, I decided to dedicate a good portion of the talk to <a href="http://jetpack.mozillalabs.com">Jetpack</a>. Being outside of Mozilla for the past few months, this gave me an opportunity to get reacquainted with the Jetpack APIs. I myself was impressed by how easy it was to develop a quick Jetpack. I ended up preparing two to live-code during the talk: one called <a href="http://jetpackgallery.mozillalabs.com/jetpacks/207">Helvetica</a> which, with one click, replaces all fonts on the current page with Helvetica; and <a href="http://jetpackgallery.mozillalabs.com/jetpacks/208">You Are Here</a> which uses an open API from <a href="http://ipinfodb.com/">IPinfoDB</a> to display the physical location of the domain you are currently visiting in the status bar. Both are now on the <a href="http://jetpackgallery.mozillalabs.com/">Jetpack Gallery</a>.</p>

<p><a rel='lightbox' href="http://mitcho.com/blog/wp-content/uploads/2009/12/youarehere.png"><img src="http://mitcho.com/blog/wp-content/uploads/2009/12/youarehere-inset.png" alt="" title="You Are Here" width="464" height="112" class="alignnone size-full wp-image-3237" /></a></p>

<p>Unfortunately there was a bit of a snowstorm leading up to the event, but there was still a nice turnout and I got to meet some fantastic people there. Ken Shoemake of <a href="http://en.wikipedia.org/wiki/slerp">slerp</a> and <a href="http://en.wikipedia.org/wiki/quaternion">quaternion</a> fame came up to me after my talk and said &#8220;the Ubiquity parser reminded me of the dancing bear&#8230; it&#8217;s less surprising that it works well as that it works at all.&#8221; <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' />  I also enjoyed the other great presentations in the technology track, covering the <a href="http://www.nofluffjuststuff.com/conference/speaker/brian_sletten">virtues of REST</a> and basic iPhone development.</p>

<p><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/mitcho/mashup-the-browser-with-ubiquity-and-jetpack" title="Mashup the Browser with Ubiquity and Jetpack">Mashup the Browser with Ubiquity and Jetpack</a><object style="margin:0px" width="600" height="501"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=techmaine-091210174736-phpapp01&#038;stripped_title=mashup-the-browser-with-ubiquity-and-jetpack" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=techmaine-091210174736-phpapp01&#038;stripped_title=mashup-the-browser-with-ubiquity-and-jetpack" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="600" height="501"></embed></object></p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/' rel='bookmark' title='Extending WordPress talk at the Boston WordPress Meetup'>Extending WordPress talk at the Boston WordPress Meetup</a></li>
<li><a href='http://mitcho.com/blog/projects/talking-ubiquity-in-japan-%e6%8b%a1%e5%bc%b5%e6%a9%9f%e8%83%bd%e5%8b%89%e5%bc%b7%e4%bc%9a%e3%81%ab%e3%81%a6%e7%99%ba%e8%a1%a8/' rel='bookmark' title='Talking Ubiquity in Japan: 拡張機能勉強会にて発表'>Talking Ubiquity in Japan: 拡張機能勉強会にて発表</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-presentation-at-tokyo-20/' rel='bookmark' title='Ubiquity presentation at Tokyo 2.0'>Ubiquity presentation at Tokyo 2.0</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/mashing-up-the-browser-in-maine/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Extending WordPress talk at the Boston WordPress Meetup</title>
		<link>http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/</link>
		<comments>http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/#comments</comments>
		<pubDate>Tue, 29 Sep 2009 17:40:19 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[life]]></category>
		<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[HookPress]]></category>
		<category><![CDATA[photos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[slides]]></category>
		<category><![CDATA[talk]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2959</guid>
		<description><![CDATA[Yesterday I gave a talk at the Boston WordPress Meetup. The Boston WordPress Meetup meets monthly at the Microsoft Cambridge Research Center which is a fantastic venue right on the Charles river. Last night we got to be up on the 10th floor which has a great view of Boston right over the river. There [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Yesterday I <a href="http://www.meetup.com/boston-wordpress-meetup/calendar/11378229/">gave a talk</a> at the <a href="http://www.meetup.com/boston-wordpress-meetup/">Boston WordPress Meetup</a>. The Boston WordPress Meetup meets monthly at the Microsoft Cambridge Research Center which is a fantastic venue right on the Charles river. Last night we got to be up on the 10th floor which has a great view of Boston right over the river. There was pretty good turnout, with about thirty or fourty people there.</p>

<p>My talk was a general introduction to WordPress plugin development, beginning with the concepts of <a href="http://codex.wordpress.org/Plugin_API/Action_Reference">actions</a> and <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference">filters</a>, and concluding with a description of <a href="http://mitcho.com/code/hookpress/">HookPress</a>, my new plugin which enables <a href="http://webhooks.org">webhooks</a> in WordPress. Here are the slides:</p>

<p><span id="more-2959"></span></p>

<div style="width:425px;text-align:left" id="__ss_2084487"><a style="font:14px Helvetica,Arial,Sans-serif;display:block;margin:12px 0 3px 0;text-decoration:underline;" href="http://www.slideshare.net/mitcho/extending-wordpress-with-webhooks" title="Extending WordPress with (Web)Hooks">Extending WordPress with (Web)Hooks</a><object style="margin:0px" width="425" height="355"><param name="movie" value="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=extendingwordpress-090928155439-phpapp01&#038;rel=0&#038;stripped_title=extending-wordpress-with-webhooks" /><param name="allowFullScreen" value="true"/><param name="allowScriptAccess" value="always"/><embed src="http://static.slidesharecdn.com/swf/ssplayer2.swf?doc=extendingwordpress-090928155439-phpapp01&#038;rel=0&#038;stripped_title=extending-wordpress-with-webhooks" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="425" height="355"></embed></object><div style="font-size:11px;font-family:tahoma,arial;height:26px;padding-top:2px;">View more <a style="text-decoration:underline;" href="http://www.slideshare.net/">documents</a> from <a style="text-decoration:underline;" href="http://www.slideshare.net/mitcho">Michael Yoshitaka Erlewine</a>.</div></div>

<p>The talk included some live coding which is always dangerous, but it all went off without a hitch.</p>

<p><a href="http://twitter.com/kurteng">Kurt Eng</a> was kind enough to get video of the talk as well which hopefully we&#8217;ll get up on <a href="http://wordpress.tv">wordpress.tv</a> in the near future. Bryan also sent me a link with some <a href="http://www.flickr.com/photos/76505157@N00/">photos on Flickr</a>.</p>

<p>Thank you to all who attended<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> and of course to Microsoft who provided the venue and food! The Boston WordPress Meetup is a great community and I hope to keep supporting it and its activities.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>For anyone who attended, I would greatly appreciate feedback on the talk <a href="http://speakerrate.com/talks/1470-extending-wordpress-with-web-hooks">at SpeakerRate</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/' rel='bookmark' title='HookPress: Webhooks for WordPress'>HookPress: Webhooks for WordPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/extending-wordpress-talk-at-the-boston-wordpress-meetup/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Exploring Command Chaining in Ubiquity: Part 2</title>
		<link>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/</link>
		<comments>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/#comments</comments>
		<pubDate>Sun, 23 Aug 2009 23:14:07 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[Chinese]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[English]]></category>
		<category><![CDATA[Japanese language]]></category>
		<category><![CDATA[Mandarin]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[natural syntax]]></category>
		<category><![CDATA[serial verb construction]]></category>
		<category><![CDATA[syntax]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2799</guid>
		<description><![CDATA[Introduction I recently have begun giving serious thought to what command chaining might look like in Ubiquity and the various considerations which must be made to make it happen. The &#8220;command chaining,&#8221; or &#8220;piping,&#8221; described here always involves (at least) two verbs acting sequentially on a passed target—that is, the first command performs some action [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/link/ubiquity-in-italian/' rel='bookmark' title='Ubiquity in Italian'>Ubiquity in Italian</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>

<p>I recently have begun giving serious thought to what <strong>command chaining</strong> might look like in Ubiquity and the various considerations which must be made to make it happen. The &#8220;command chaining,&#8221; or &#8220;piping,&#8221; described here always involves (at least) two verbs acting sequentially on a passed target—that is, the first command performs some action or lookup and the second command acts on the first command&#8217;s output.</p>

<p>A few days ago I penned some initial <a href="http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/">technical considerations regarding command chaining</a>. In this post I&#8217;ll be point out some linguistic considerations involved in supporting a <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural syntax</a> for chaining.</p>

<p><span id="more-2799"></span></p>

<h3>Simple syntaxes: sequential vs embedding strategies</h3>

<p>When it comes to creating a natural language interface, there&#8217;s always a decision to make between requiring a certain kind of input, or working a little harder to understand the user&#8217;s natural input. From an implementation point of view, adopting certain programmatic conventions is of course simpler and to this end, there have been a couple different &#8220;unnatural&#8221; command chaining syntaxes suggested. While these both go against Ubiquity&#8217;s basic tenet of <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural syntax</a> — that is, to not introduce rules which contradict the user&#8217;s natural language — which gives Ubiquity its strengths of usability and memorability, I&#8217;ll entertain them here as they illustrate two different structural relationships that we will want to consider.</p>

<p><a href='http://www.threadless.com/product/543/This_is_not_a_Pipe?streetteam=mitcho'><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/not-pipe.gif" alt="not-pipe.gif" border="0" width="480" height="329" /></a></p>

<p>The first suggestion is to adopt the <a href="http://en.wikipedia.org/wiki/Pipeline_(Unix)">shell pipe</a> (|), which would lead to input such as</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
</pre></td><td class="code"><pre class="ubiquity" style="font-family:monospace;">translate hello to Spanish | email to Jono</pre></td></tr></table></div>


<p>While this itself is pretty unnatural unless you speak shell, note that this syntax is similar to the more natural &#8220;, and&#8221; syntax, yielding <code>translate hello to Spanish, and email to Jono</code>, which we will consider below. I&#8217;ll refer to this strategy as the <strong>sequential</strong> strategy.</p>

<p>Another <a href="http://www.croczilla.com/blog/16">very interesting proposal</a> by Alex Fritze is to embed each subordinate computation into an argument position, marked by parentheses. This could also be parsed relatively straightforwardly by writing a noun type which first checks for parentheses and then runs the content of the argument through another <a href="http://ubiquity.mozilla.com/trac/ticket/532">ParseQuery</a>.</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>2
</pre></td><td class="code"><pre class="ubiquity" style="font-family:monospace;">email (translate hello to Spanish) to Jono</pre></td></tr></table></div>


<p>I&#8217;ll refer to this pattern as the <strong>embedding</strong> strategy.</p>

<h3>Sequential and embedding strategies in natural language</h3>

<p>What&#8217;s interesting about the two proposals above is that both strategies are seen in natural language. The sequential strategy could correspond to the following linguistic phenomena:</p>

<ol>
<li><a href="http://en.wikipedia.org/wiki/coordination (linguistics)">coordination</a>: a non-hierarchical joining of two or more <a href="http://en.wikipedia.org/wiki/clauses (linguistics)">clauses</a>, often marked by a <a href="http://en.wikipedia.org/wiki/conjunction">conjunction</a>. Here&#8217;s an example from English:

<ul>
<li>&#8220;[I made a sandwich] and [you will eat it]&#8221; where [] represent clause boundaries. Here, &#8220;and&#8221; is the conjunction.</li>
</ul></li>
<li><a href="http://en.wikipedia.org/wiki/serial verb construction">serial verb</a> and <a href="http://en.wikipedia.org/wiki/converb">converb</a> constructions: a joining of multiple verbs or verb phrases within a single clause, with shared subject and tense/aspect values, with no particular conjugation or delimiter between them. Such constructions are common in many African and east Asian languages. Here are two examples:<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup><br/></li>
</ol>

<ul><li>A converbal construction in Japanese:<br/>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>3
4
5
</pre></td><td class="code"><pre class="ja" style="font-family:monospace;">僕は     サンドイッチを 作って     食べる
boku-wa sandiʔchi-o  tsuku-ʔte tabe-ru
I-TOP   sandwich-ACC make-CON  eat</pre></td></tr></table></div>


<br/>&#8220;I (will) make a sandwich and eat [it].&#8221; (Here, `TOP` = topic, `ACC` = accusative, `CON` = converbal ending)[^3]</li>
<li>A serial verb construction in Mandarin Chinese:<br/>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>6
7
8
</pre></td><td class="code"><pre class="zh" style="font-family:monospace;">我 作   三明治      吃
wǒ zùo  sānmíngzhì chī
I  make sandwich   eat</pre></td></tr></table></div>


<br/>&#8220;I (will) make a sandwich and eat [it]&#8221; or &#8220;I (will) make a sandwich [in order to] eat [it].&#8221;</li></ul>

<p><br/>Note that in both the converb and serial verb construction, the second verb (eat) takes shares its object (sandwich) with the first verb and there is no need for a pronoun such as &#8220;it&#8221; to introduce that argument as it is with coordination, above.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>

<p>The embedding strategy is observed in natural language as well, in the form of the following phenomena:</p>

<ol>
<li><a href="http://en.wikipedia.org/wiki/embedded clauses">embedded clauses</a>: a sentence is itself the argument of another verb. Example:<br/></li>
</ol>

<ul><li>&#8220;John says [he likes sandwiches].&#8221;</li></ul>

<p><br/>Embedded clauses, however, clearly have no relation to command chaining and does not require our attention.
2. <a href="http://en.wikipedia.org/wiki/relative clauses">relative clauses</a>: a partial sentence<sup id="fnref:5"><a href="#fn:5" rel="footnote">3</a></sup> is attached to a noun in order to describe it or distinguish it from other possible referents. Example:</p>

<ul><li>&#8220;You ate the sandwich that I made&#8221; where &#8220;sandwich&#8221; is called the &#8220;head&#8221; of the relative clause, and &#8220;I made&#8221; is what I here call the &#8220;partial sentence&#8221; (see footnote). The &#8220;relative clause&#8221; is used here to distinguish &#8220;the sandwich that I made&#8221; from other sandwiches.</li></ul>

<h3>The natural syntax of chaining</h3>

<p>So <strong>which strategy is used in complex natural language commands:</strong> the sequential strategy or the embedding strategy? Both the sequential strategy and embedding strategy can be involved with commands:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>9
10
</pre></td><td class="code"><pre class="en" style="font-family:monospace;">[Make a sandwich] and [eat it]!
Eat (the sandwich that I made)!</pre></td></tr></table></div>


<p>These two commands do not mean the same thing, though, and only (9) is the kind of command we would want to give Ubiquity. The problem with relative clauses, as in (10), is that it <em><a href="http://en.wikipedia.org/wiki/presupposition">presupposes</a> the existence of the sandwich in the context</em>. If we both know you just made a sandwich, saying (10) is perfectly appropriate, but out of the blue it doesn&#8217;t make sense. For this reason, <strong>only the sequential strategy is used in the natural syntax of chaining.</strong></p>

<h3>Parsing the sequential strategy</h3>

<p>In natural language, unlike the initial simple proposals laid out above, there is often no clear delimiter marking the boundary between the two parts in a sequential relation (e.g. examples (3) and (6) above, particularly given that neither Japanese and Chinese normally break words with spaces). <strong>How would we parse a sequential string of commands?</strong></p>

<p>Let&#8217;s assume for our purposes here that we can identify find all verbs within the input string.<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> Parsing a sequential strategy string is not particularly difficult if we can also assume that the verb in any particular language is either always verb-initial or always verb-final. Let&#8217;s look at both cases:</p>

<ul>
<li>Always verb-initial: Mandarin Chinese:<br/></li>
</ul>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>11
12
13
</pre></td><td class="code"><pre class="zh" style="font-family:monospace;">翻譯       hello 到  西班牙語   送    給  Juanito
fānyì     hello dào xībānyáyǔ sòng gěi Juanito
translate hello to  Spanish   send to  Juanito</pre></td></tr></table></div>


<p><br/>
&#8220;Translate hello to Spanish [and] send [it] to Juanito&#8221;
  1. find every possible verb:<br/><strong>翻譯</strong>hello到西班牙語<strong>送</strong>給Juanito
  2. as every verb marks the beginning of a sentence, we now have our two commands: &#8220;<strong>翻譯</strong>hello到西班牙語&#8221; (translate hello to Spanish) and &#8220;<strong>送</strong>給Juanito&#8221; (send to Juanito).
* Always verb-final: Japanese<br/></p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>14
15
16
</pre></td><td class="code"><pre class="ja" style="font-family:monospace;">helloを スペイン語に 訳して Juanitoに 送って
hello-o supeingo-ni yakus-ite Juanito-ni oku-ʔte
hello-ACC Spanish-DAT translate-CON Juanito-DAT send-CON</pre></td></tr></table></div>


<p><br/>
&#8220;Translate hello to Spanish [and] send [it] to Juanito&#8221;
  1. find every possible verb:<br/>helloをスペイン語に<strong>訳して</strong>Juanitoに<strong>送って</strong>
  2. as every verb marks the end of a sentence, we now have our two commands: &#8220;helloをスペイン語に<strong>訳して</strong>&#8221; (translate hello to Spanish) and &#8220;Juanitoに<strong>送って</strong>&#8221; (send to Juanito).</p>

<p>For languages where there is a clear conjunction between the two commands, such as English &#8220;and&#8221;, we can also use that conjunction as a delimiter as well. We then simply execute the first command and then execute the second with the first command&#8217;s output in its interpolation context. This way the output of the first command will be picked up both by an overt pronoun such as &#8220;it&#8221; in the second command and without it, such as in the Chinese and Japanese examples above.<sup id="fnref:6"><a href="#fn:6" rel="footnote">5</a></sup></p>

<p>The only potential problem with this approach is in the case of languages where some commands are verb-initial while others are verb-final. I note that such languages do exist in a previous blog post, <a href="http://mitcho.com/blog/observation/wheres-the-verb/">Where&#8217;s The Verb</a>. In these languages, commands can be expressed by more than one verb form (such as infinitive, imperative, subjunctive, etc.) and some of those verb forms are sentence-initial while others are sentence-final. Here&#8217;s one such example from German:</p>

<p>&#8220;search hello with google&#8221; (German)
1. Infinitive: hello mit google suchen
2. Imperative: suche hello mit google</p>

<p>Here the verb for &#8220;search&#8221; is &#8220;suchen&#8221; (infinitive) or &#8220;suche&#8221; (imperative). I know that this same type of phenomena occurs in other Germanic languages such as Dutch with infinitive and imperative and also other languages such as Modern Greek with infinitive and subjunctive forms. <strong>If you are a speaker of one of these lanuages (German, Dutch, Greek, etc.) I would love to know whether you can chain verb-final and verb-initial commands together.</strong></p>

<h3>Conclusion</h3>

<p>In this blog post I examined command chaining in natural language, focusing on data from English, Mandarin Chinese, and Japanese, which exhibit three linguistically different approaches to chaining. What we found is that the sequential strategy—that of listing the commands one by one, in order of execution—is what is used in natural languages, rather than any sort of embedding. This fact, combined with the fact that our parser can recognize every available verb, offers a simple approach to doing a naive parse of natural command chains in most languages, even without explicit delimiters.</p>

<p>In a final installation of this series on &#8220;exploring command chaining,&#8221; I hope to consider how the Ubiquity interface itself could present command chains and aid in its input.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>The distinction between serial verb and converb constructions (as well as other forms of complex predication) hinge on structural distinctions which are not of importance for our purposes.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Some people (<a href="http://www.jstor.org/stable/4178644">Baker 1989</a> and others), in fact, list this object sharing as a necessary part of the notion of a &#8220;serial verb construction.&#8221;&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:5">
<p>&#8220;Partial sentence&#8221; is used in a descriptive sense here to reflect that the relative clause, such as &#8220;I made&#8221; in the example given cannot stand as its own sentence, as the verb&#8217;s argument is clearly missing. This type of pattern is also seen in questions (&#8220;What did [you make]?&#8221;) and topicalization (&#8220;That sandwich, [I made].&#8221;) and is a great focus of theoretical linguistics research. See <a href="http://en.wikipedia.org/wiki/wh-movement">wh-movement</a> on wikipedia for more examples and information on theoretical approaches to such constructions.&#160;<a href="#fnref:5" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:4">
<p>We don&#8217;t do this right now as there hasn&#8217;t been a use for it—right now <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2">Parser 2</a> simply looks for known verbs at the beginning and end of the input. The parser does build a nice regular expression to find known verbs, however, so finding verbs input-medially would also be easy to do, though.&#160;<a href="#fnref:4" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:6">
<p>Note that even though the linguistic relation between the two commands is non-hierarchical, we interpret the sentences to mean &#8220;translate hello to Spanish and <em>then</em> email it to Juanito&#8221;, rather than &#8220;translate hello to Spanish and email it (hello) to Juanito <em>at the same time</em>.&#8221; This observed universal property that, ceteris paribus, the linear speech order of verbs reflects the conceptual order of events is known as the Temporal Iconicity Condition (<a href="http://www.jstor.org/pss/416696">Li 1993</a> and others).&#160;<a href="#fnref:6" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/link/ubiquity-in-italian/' rel='bookmark' title='Ubiquity in Italian'>Ubiquity in Italian</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-2/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The Ubiquity Persistence Project: exploring a persistent Ubiquity in the toolbar</title>
		<link>http://mitcho.com/blog/projects/the-ubiquity-persistence-project/</link>
		<comments>http://mitcho.com/blog/projects/the-ubiquity-persistence-project/#comments</comments>
		<pubDate>Thu, 20 Aug 2009 19:50:13 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[CSS]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[interface]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[jQuery]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[participate]]></category>
		<category><![CDATA[screencast]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2781</guid>
		<description><![CDATA[It&#8217;s often hard to remember Ubiquity&#8217;s presence and keystroke without a visual reminder—even I often forget that I could use Ubiquity and end up going to a search engine or using the search bar for some quick lookup task. What if the Ubiquity input were in the toolbar and always visible? How would that affect [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/user-aided-disambiguation-a-demo/' rel='bookmark' title='User-Aided Disambiguation: a demo'>User-Aided Disambiguation: a demo</a></li>
<li><a href='http://mitcho.com/blog/projects/count-command-for-ubiquity/' rel='bookmark' title='Count command for Ubiquity'>Count command for Ubiquity</a></li>
<li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s often hard to remember Ubiquity&#8217;s presence and keystroke without a visual reminder—even I often forget that I could use Ubiquity and end up going to a search engine or using the search bar for some quick lookup task. <strong>What if the Ubiquity input were in the toolbar and always visible?</strong> How would that affect people&#8217;s use of Ubiquity? And what could we make that look like and how would it behave? Today we&#8217;re kicking off the Ubiquity Persistence Project, a new Ubiquity initiative to explore what a persistent Ubiquity might look like in the Firefox toolbar.</p>

<p><a rel='lightbox' href="http://mitcho.com/blog/wp-content/uploads/2009/08/Screen-shot-2009-08-20-at-12.48.43-PM.png" alt="The Persistence tool"><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/persistence-small.png" alt="persistence-small.png" border="0" width="650" height="484" /></a></p>

<p>In order to facilitate this discussion, we created the Persistence tool. With the Persistence tool you can quickly try out new design and interaction ideas, mocking things up with some simple <a href="http://jquery.com">jQuery</a>-powered JavaScript and CSS and see your changes live. The Persistence tool is bundled with our <a href="http://ubiquity.mozilla.com/xpi/ubiquity-latest-beta.xpi">latest Ubiquity beta</a> (install link).</p>

<p><object width="649" height="365"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=6197526&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=6197526&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="649" height="365"></embed></object></p>

<p><a href="http://vimeo.com/6197526">The Ubiquity Persistence Project: exploring a persistent Ubiquity in the toolbar</a> from <a href="http://vimeo.com/mitchoyoshitaka">mitcho</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>I just put together a screencast introducing the initiative, demoing the Persistence tool, as well as talking about this project&#8217;s relation to the ongoing work on <a href="http://wiki.mozilla.org/Taskfox">Taskfox</a>. We&#8217;ll look forward to your comments and designs! <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/user-aided-disambiguation-a-demo/' rel='bookmark' title='User-Aided Disambiguation: a demo'>User-Aided Disambiguation: a demo</a></li>
<li><a href='http://mitcho.com/blog/projects/count-command-for-ubiquity/' rel='bookmark' title='Count command for Ubiquity'>Count command for Ubiquity</a></li>
<li><a href='http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/' rel='bookmark' title='Exploring Command Chaining in Ubiquity: Part 1'>Exploring Command Chaining in Ubiquity: Part 1</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/the-ubiquity-persistence-project/feed/</wfw:commentRss>
		<slash:comments>14</slash:comments>
		</item>
		<item>
		<title>Exploring Command Chaining in Ubiquity: Part 1</title>
		<link>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/</link>
		<comments>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/#comments</comments>
		<pubDate>Wed, 19 Aug 2009 20:35:37 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[asynchronous]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[verbs]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2760</guid>
		<description><![CDATA[Since the dawn of time people have been asking about command chaining in Ubiquity. If you have a translate command and an email command, it would be great to be able to, for example, translate hello to Spanish and email to Juanito. This is what we call command chaining or piping: in a single complex [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-commands-by-the-numbers/' rel='bookmark' title='Ubiquity Commands by The Numbers'>Ubiquity Commands by The Numbers</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Since the <a href="http://labs.mozilla.com/2008/08/introducing-ubiquity/">dawn of time</a> people have been asking about command chaining in Ubiquity. If you have a <code>translate</code> command and an <code>email</code> command, it would be great to be able to, for example, <code>translate hello to Spanish and email to Juanito</code>. This is what we call <strong>command chaining</strong> or <strong><a href="http://en.wikipedia.org/wiki/Pipeline_(Unix)">piping</a></strong>: in a single complex query, specifying multiple (probably two) actions and using the first&#8217;s output as the second&#8217;s input.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>Today I hope to cover some of the technical considerations required in implementing command chaining in Ubiquity, and I will follow up soon with a blog post on the linguistic considerations required as well.</p>

<p><span id="more-2760"></span></p>

<h3>Technical considerations: hooking the pipes together</h3>

<p>I&#8217;d first like to lay out some technical challenges and questions. These can be broken into two different categories: (1) how the parse and display of suggestions is affected and (2) how the execution is affected.</p>

<h4>Matching inputs and outputs</h4>

<p>We&#8217;ll first consider how command chaining may affect the parsing. Ubiquity commands each specify the types of argument inputs that it expects using different <strong>noun types</strong>, such as <code>noun_arb_text</code> which accepts anything, <code>noun_type_number</code> which accepts numbers, or <code>noun_type_language</code>, which takes the name of a language. For example, the <code>translate</code> verb takes maximally three arguments: a <code>noun_arb_text</code> object, a <code>noun_type_language</code> goal (the language to translate into), and a <code>noun_type_language</code> source (the source language). In implementing command chaining, it will be necessary to identify the appropriate noun types for the <em>output</em> of a command.</p>

<p>The first question we must address here is <strong>&#8220;what is the chaining output of a command&#8221;?</strong> Is it the preview text? Some text output from the execution?</p>

<p><a href='http://www.flickr.com/photos/joemud/2851415655/'><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/2851415655_1012a4cce0_o.jpg" alt="2851415655_1012a4cce0_o.jpg" border="0" width="650" height="226" /></a><br/><small><a href='http://www.flickr.com/photos/joemud/2851415655/'>Big fish eat da lil fish</a> by joemud, CC-SA-NC</small></p>

<p>To put this question into perspective, we note that Ubiquity commands can be broadly classified into two types: <strong>lookup</strong> and <strong>action execution</strong>. Here&#8217;s a classification which I believe to be exhaustive:<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>

<table>
<tr><th>classification</th><th>preview</th><th>execution</th><th>example</th></tr>
<tr><td rowspan='4'>lookup</td><td rowspan='4'>data lookup</td><td>inserting result into page</td><td><code>translate</code></td></tr>
<tr><td>opening a website</td><td><code>weather</code>, most search commands</td></tr>
<tr><td>copying result to pasteboard</td><td><code>get email address</code></td></tr>
<tr><td>nothing</td><td><code></code></td></tr>
<tr><td>action</td><td>nothing (maybe a description<br/>of what the action will do)</td><td>an action which changes some state <br/>(in the browser or on the web)</td><td><code>quit firefox</code>, <code>email</code>, <code>twitter</code></td></tr>
</table>

<p>In light of this classification I believe we can say that lookup commands are much more likely to be the first verb in a command chain—conversely, chains such as <code>email hello to Blair and then do ...</code> or <code>twitter hello and then ...</code> are quite unlikely. What is much more likely is for the first verb to be a lookup function.</p>

<table>
<tr><th>first verb type</th><th>second verb type</th><th>example</th></tr>
<tr><td>lookup</td><td>action</td><td><code>translate this to Spanish and email to Aza</code></td>
<tr><td>lookup</td><td>lookup</td><td><code>translate this to English and then find it with Amazon</code></td>
<tr><td>action</td><td>action/lookup</td><td><i>no use case?</i></td>
</table>

<p>Thus in the same way that not all commands have a useful execution<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> <strong>perhaps only lookup commands will have a chainable output: the results of the lookup.</strong> Even with this restriction, we will most likely need to implement a new &#8220;chainable output&#8221; method or getter in these commands. This means that commands will need to opt-in to become chainable, but I believe this is a necessary evil.</p>

<p>The second question we must address is <strong>&#8220;when do we establish the noun type of a command&#8217;s chainable output?&#8221;</strong> One unsung but crucial feature of the way Ubiquity works now is that suggestions&#8217; previews are not computed until that suggestion is selected (except for the first suggestion, which in most skins gets previewed immediately). Should we wait for all of the first verbs&#8217; chainable output to be computed and then run them through the <a href="http://mitcho.com/blog/projects/judging-noun-types/">noun type detection system</a>? Or should verbs with chainable output also <em>a priori</em> specify what noun types their output will be?</p>

<p>Both of these approaches have their problems. If we compute the chainable output of the first verb, run a noun type detection on it and <em>then</em> suggest the full combination if it matches what the second verb was expecting, this will have clear performance implications, not to mention that it could greatly complicate our <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2">parsing algorithm</a>. While the latter approach doesn&#8217;t have these performance implications, it does mean that it will have to list (by name or reference) the noun types that will match its output, meaning that if a command author is unaware of someone else&#8217;s noun type, that chain will be impossible, even if the chainable output itself does indeed match that noun type. The <em>a posteriori</em> approach would never have this issue. <strong>What other benefits or problems do you forsee with either of these approaches? Is there another approach which avoids these pitfalls?</strong></p>

<h4>(A)synchronous composability</h4>

<p>Once we have the noun types, parsing, and suggestions down, all that remains is to compute the previews and implement the composite execution. Since the Ubiquity command manager already wraps the preview and execute functions in a wrapper to facilitate localization, among other uses, it would be easy to make the command manager <a href="http://www.croczilla.com/blog/16">compose asynchronous processes pseudo-synchronously</a>. No major changes should be necessary to do the previews and executions, though, again, there will be a performance cost.</p>

<h3>Conclusion</h3>

<p>There are a number of technical questions which must be answered, mostly in the parsing/suggesting stage. The key questions to answer are:</p>

<ol>
<li>What is the chaining output of a command?</li>
<li>When do we establish the noun type of a command&#8217;s chainable output?</li>
</ol>

<p>I&#8217;ll make another post soon on the linguistic considerations necessary in making command chaining happen in a <a href="http://mitcho.com/blog/projects/how-natural-should-a-natural-interface-be/">natural</a> fashion.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>We&#8217;re going to limit our discussion here to this restriction that the two verbs are not simply two simultaneous commands, but two commands which operate successively on an input, i.e., that it is true piping. This for example rules out input such as <code>google dogs and translate cat to Spanish</code>, as the second command&#8217;s execution does not semantically depend on the first&#8217;s execution. This (hopefully uncontroversial) decision also affects the linguistic considerations to be made in my next post.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>If you know of a command which doesn&#8217;t neatly fit into &#8220;lookup&#8221; or &#8220;action&#8221;, please let me know.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>I believe we should mark these no-execution lookup commands visually so the user does not expect anything to happen if they execute it. This is <a href="http://ubiquity.mozilla.com/trac/ticket/651">trac #651</a>.&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/link/command-chaining-with-oni/' rel='bookmark' title='Command Chaining with Oni?'>Command Chaining with Oni?</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-commands-by-the-numbers/' rel='bookmark' title='Ubiquity Commands by The Numbers'>Ubiquity Commands by The Numbers</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/exploring-command-chaining-in-ubiquity-part-1/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>Performance vs Responsiveness —or— How I Made the Parser Twice As Fast in One Day</title>
		<link>http://mitcho.com/blog/projects/performance-vs-responsiveness/</link>
		<comments>http://mitcho.com/blog/projects/performance-vs-responsiveness/#comments</comments>
		<pubDate>Thu, 13 Aug 2009 06:16:54 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[optimization]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[response]]></category>
		<category><![CDATA[responsiveness]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[UI]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2712</guid>
		<description><![CDATA[Since we launched Ubiquity 0.5, the issue of Parser 2 performance has been brought up over and over within the community. By virtue of having a more flexible and localizable design, Parser 2 was expected to be slower than our original parser, but its current implementation felt noticeably—perhaps unnecessarily—slow compared to Parser 1. Parser 2 [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
<li><a href='http://mitcho.com/blog/projects/this-week-on-ubiquity-parser-the-next-generation/' rel='bookmark' title='This week on Ubiquity Parser: The Next Generation'>This week on Ubiquity Parser: The Next Generation</a></li>
<li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>Since we <a href="http://labs.mozilla.com/2009/07/ubiquity-0-5/">launched Ubiquity 0.5</a>, the issue of Parser 2 performance has been brought up <a href="http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/b0dfa649dda77a2c#">over</a> and <a href="http://groups.google.com/group/ubiquity-firefox/browse_thread/thread/13bc9ade35c8b708#">over</a> within the community. By virtue of having a <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2">more flexible and localizable design</a>, Parser 2 was expected to be slower than our original parser, but its current implementation felt noticeably—perhaps unnecessarily—slow compared to Parser 1. Parser 2 performance has been identified as <a href="https://wiki.mozilla.org/Labs/Ubiquity/Meetings/2009-08-05_Weekly_Meeting#Notes">one of the blockers</a> for pushing Ubiquity 0.5+ to all of our 0.1.x users, and has thus been one of my recent foci.</p>

<h3>The short story:</h3>

<p>Inspired by some comments by <a href="http://theunfocused.net">Blair</a>, yesterday I was able to make significant (roughly 100%) performance gains in Parser 2, resulting in 40-60% faster parses, depending on the query. This change <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/77156d689b26">has been committed</a> and will be released as part of our forthcoming minor update, Ubiquity 0.5.4. Yay!</p>

<p><span id="more-2712"></span></p>

<h3>The long story: asynchronous parsing</h3>

<p>Given that parsing in Ubiquity, combined with the post-parse of displaying suggestions, takes a good few dozen milliseconds, it is important to make sure it doesn&#8217;t block the main execution thread in order for the UI to stay responsive throughout. In other words, we needed to make it asynchronous.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>When we began work on Parser 2 a few months ago, <a href="http://theunfocused.net">Blair</a> stepped up to the plate to make it run asynchronously. For various reasons, the parser doesn&#8217;t run in a Worker thread for truer threading. Instead, what we did was to put the parser&#8217;s steps into a <a href="https://developer.mozilla.org/en/New_in_JavaScript_1.7#Generators_and_iterators">generator</a> called <code>_yieldingParse</code>. The keyword <code>yield</code> is scattered in points throughout this generator.</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">function</span> _yieldingParse<span style="color: #009900;">&#40;</span>...<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #006600; font-style: italic;">// step 1</span>
  ...
  <span style="color: #660066;">yield</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #006600; font-style: italic;">// step 2</span>
  ...
  <span style="color: #009900;">&#123;</span>
    ...
    <span style="color: #660066;">yield</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">;</span>
  <span style="color: #009900;">&#125;</span>
  ...
&nbsp;
<span style="color: #009900;">&#125;</span></pre></div></div>


<p>We then iterate over a <code>_yieldingParse</code> object in a function called <code>doAsyncParse</code>. Each time we go invoke <code>doAsyncParse</code>, it invokes <code>next</code> which advances from the last <code>yield</code> point of the parse to the next one. <code>doAsyncParse</code> checks after each step whether we should <code>keepworking</code> or not and then asynchronously advances to the next step by calling itself with a <code>setTimeout</code>. (Note the code below is a simplification.)</p>


<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;"><span style="color: #003366; font-weight: bold;">var</span> parseGenerator <span style="color: #339933;">=</span> _yieldingParse<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #003366; font-weight: bold;">function</span> doAsyncParse<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
  <span style="color: #003366; font-weight: bold;">var</span> ok <span style="color: #339933;">=</span> parseGenerator.<span style="color: #660066;">next</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>ok <span style="color: #339933;">&amp;&amp;</span> keepworking<span style="color: #009900;">&#41;</span>
    Utils.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>doAsyncParse<span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #006600; font-style: italic;">// get this party started</span>
Utils.<span style="color: #660066;">setTimeout</span><span style="color: #009900;">&#40;</span>doAsyncParse<span style="color: #339933;">,</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>


<p>The more often we <code>yield</code>, the more responsive the UI would be. However, there is a certain overhead to <code>yield</code>ing each time due to the <code>setTimeout</code>s we call. This point hit home when Blair told me the other day that the parser was much faster without any of the <code>setTimeout</code>s. Indeed, in my own testing running queries completely synchronously (replacing out all the <code>setTimeout</code>s), parses would run in roughly half the original time. However, by virtue of being completely synchronous, the parser would then completely lock up the UI.</p>

<p>I thus set out to strike a balance between performance and responsiveness by taking out and moving some of the <code>yield</code>s in our <code>_yieldingParse</code> (<a href="http://ubiquity.mozilla.com/trac/ticket/856">#856</a>).</p>

<h3>Tests, tests, tests</h3>

<p><a href='http://twitter.com/progrium/status/3273910705'><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/Screen-shot-2009-08-12-at-4.38.50-PM.png" alt="Screen shot 2009-08-12 at 4.38.50 PM.png" border="0" width="641" height="206" /></a></p>

<p>Keeping this in mind, I ran a number of tests as I proceeded with my &#8220;refactoring.&#8221;</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/notes1.jpg" alt="notes.jpg" border="0" width="649" height="327" /></p>

<p>Here are some final parse time results:<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/beforeafter1.png" alt="beforeafter.png" border="0" width="576" height="344" /></p>

<p>Four different queries (&#8220;hello to span&#8221;, &#8220;goo hello&#8221;, &#8220;22.7&#8221;, &#8220;tw as test&#8221; with a selection context of &#8220;hello world&#8221;) were run using each algorithm. The blue bar is the performance of the algorithm prior to adjustment of <code>setTimeout</code>s—that of Ubiquity 0.5.3. The gold bar is the time from a completely synchronous parse where all the <code>setTimeout</code>s were replaced. This algorithm completely locks up the UI, but is clearly the fastest, and should be seen as a baseline for all other yielding optimizations. The green bar is our new algorithm. As you can see, <strong>the parser is now roughly twice as fast.</strong></p>

<p>Moreover, the average time difference between <code>yield</code>s went from 0.7ms to 3.9ms which still should be no problem in terms of responsiveness.</p>

<h3>Cancellability</h3>

<p>This <code>doAsyncParse</code> is also the key for cancellability of the query. When a user changes the input or closes Ubiquity while a query is in progress, we want to cancel that query as soon as possible so the user and UI can advance. <code>keepworking</code> is set to false when the query is cancelled, so making sure that we <code>yield</code> early enough and often enough in the parse are important for issues like <a href="http://ubiquity.mozilla.com/trac/ticket/741">keystrokes being lost when typing too fast</a>.</p>

<p>While the parser was indeed <code>yield</code>ing often enough (in fact, more often than necessary) before, I noticed that our first <code>yield</code> was often 15-20&#160;ms into the parse. This was because step 1 of our parse derivation was happening outside of the <code>doAsyncParse</code> loop. By moving this into that loop, I was able to bring this initial synchronous time down to around 10&#160;ms. Of course, setting up the parse generator itself takes a little overhead, so this can never go down to 0, but perhaps this will improve <a href="http://ubiquity.mozilla.com/trac/ticket/741">the keystroke issue</a> as well. <strong>I&#8217;d love to get anecdotal feedback on whether this update improves the disappearing keystrokes issue from 0.5.4 users.</strong></p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>This is analogous to <a href="http://shawnwilsher.com/archives/279">a recent discussion of the asynchronous AwesomeBar</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>A note on methodology: the Parser 2 Playpen (<a href="chrome://ubiquity/content/playpen.html">chrome://ubiquity/content/playpen.html</a>) was used for all testing and timing. All tests were in Firefox 3.5 on Mac OS X Leopard. My machine is a 2.4&#160;GHz Intel Core 2 Duo MacBook Pro. No other (non-OS/daemon) apps were running. No other tabs were open and no other add-ons were installed.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
<li><a href='http://mitcho.com/blog/projects/this-week-on-ubiquity-parser-the-next-generation/' rel='bookmark' title='This week on Ubiquity Parser: The Next Generation'>This week on Ubiquity Parser: The Next Generation</a></li>
<li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/performance-vs-responsiveness/feed/</wfw:commentRss>
		<slash:comments>11</slash:comments>
		</item>
		<item>
		<title>HookPress: Webhooks for WordPress</title>
		<link>http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/</link>
		<comments>http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/#comments</comments>
		<pubDate>Fri, 07 Aug 2009 02:23:25 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[mashups]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[plugin]]></category>
		<category><![CDATA[webhooks]]></category>
		<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WordPress Planet]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2672</guid>
		<description><![CDATA[I recently have spent a little time putting together a new WordPress plugin called HookPress. HookPress lets you add webhooks to WordPress, letting you easily develop push notifications or extend WordPress in languages other than PHP. WordPress itself is built on a powerful plugin API which provides actions and filters. Actions correspond to events, so [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p>I recently have spent a little time putting together a new WordPress plugin called HookPress. <a href="http://wordpress.org/extend/plugins/hookpress/">HookPress</a> lets you add <a href="http://webhooks.org">webhooks</a> to WordPress, letting you easily develop push notifications or extend WordPress in languages other than PHP.</p>

<p>WordPress itself is built on a <a href="http://codex.wordpress.org/Plugin_API">powerful plugin API</a> which provides <a href="http://codex.wordpress.org/Plugin_API/Action_Reference"><strong>actions</strong></a> and <a href="http://codex.wordpress.org/Plugin_API/Filter_Reference"><strong>filters</strong></a>. Actions correspond to events, so you can set a webhook to fire when a post is published or a comment is made.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> Filters let you modify some text when it is saved or displayed, so you can have your external webhook script reformat some text or insert some other content dynamically. Not all actions and filters are supported at this time, but I will continue to add more in.</p>

<p>There&#8217;s a <a href="http://upcoming.yahoo.com/event/4049111">webhooks meetup in San Francisco</a> today but I unfortunately left SF this morning, so I created a video which will be played there as a lightning talk. A demo of both types of webhooks are in the video as well.</p>

<p><object width="649" height="365"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5905102&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5905102&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="649" height="365"></embed></object></p>

<p><a href="http://vimeo.com/5905102">HookPress: add webhooks to WordPress</a> from <a href="http://vimeo.com/mitchoyoshitaka">mitcho</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>I&#8217;m really excited by this very simple but potentially high-impact plugin. I&#8217;d love to get your comments and feedback on this new plugin and hope to hear how you&#8217;re using HookPress!</p>

<p>ADDENDUM: Please also <a href="http://twitter.com/hookpress/">follow HookPress on twitter</a>!</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>My friend Abi actually has already blogged about <a href="http://blog.abi.sh/2009/tweeting-your-blog-with-hookpress/">HookPress and how it can be used to tweet on post publication</a>.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/markdown-for-wordpress-and-bbpress/' rel='bookmark' title='Markdown for WordPress and bbPress'>Markdown for WordPress and bbPress</a></li>
<li><a href='http://mitcho.com/blog/projects/modifiying-wordpress-plugin-activation-behavior/' rel='bookmark' title='Modifiying WordPress plugin activation behavior'>Modifiying WordPress plugin activation behavior</a></li>
<li><a href='http://mitcho.com/blog/projects/yet-another-related-posts-plugin-20/' rel='bookmark' title='Yet Another Related Posts Plugin 2.0'>Yet Another Related Posts Plugin 2.0</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/hookpress-webhooks-for-wordpress/feed/</wfw:commentRss>
		<slash:comments>16</slash:comments>
		</item>
		<item>
		<title>Nountype Quirks: Day 3: Geo Day</title>
		<link>http://mitcho.com/blog/projects/nountype-quirks-day-3/</link>
		<comments>http://mitcho.com/blog/projects/nountype-quirks-day-3/#comments</comments>
		<pubDate>Sat, 01 Aug 2009 04:20:22 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[scoring]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2647</guid>
		<description><![CDATA[It&#8217;s time for one more installment of Nountype Quirks, where I review and tweak Ubiquity&#8217;s built-in nountypes. For an introduction to this effort, please read Judging Noun Types and my updates from Day 1 and Day 2. Today I ended up spending most of the day attempting to implement (but not yet completing) major improvements [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-2/' rel='bookmark' title='Nountype Quirks: Day 2'>Nountype Quirks: Day 2</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Judging Noun Types'>Judging Noun Types</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><style type='text/css'>
.scorebar {
  background-color:red;
  display:inline-block;
  height:0.5em;
  vertical-align:middle;
}
.scoretable td {
  font-size: 0.7em;
}
</style></p>

<p>It&#8217;s time for one more installment of Nountype Quirks, where I review and tweak <a href="http://ubiquity.mozilla.com">Ubiquity</a>&#8217;s built-in nountypes. For an introduction to this effort, please read <a href="http://mitcho.com/blog/projects/judging-noun-types/">Judging Noun Types</a> and my updates from <a href="http://mitcho.com/blog/projects/nountype-quirks-day-1/">Day 1</a> and <a href="http://mitcho.com/blog/projects/nountype-quirks-day-2/">Day 2</a>.</p>

<p>Today I ended up spending most of the day attempting to implement (but not yet completing) major improvements to the geolocation-related nountypes whose plans I lay out here.</p>

<p><em>Note: this blog post includes a number of graphs using HTML/CSS formatting. If you are reading this article through a feed reader or planet, I invite you to read it <a href="http://mitcho.com/blog/projects/nountype-quirks-day-3/">on my site</a>.</em><span id="more-2647"></span></p>

<h3><code>noun_type_geolocation</code></h3>

<p><code>noun_type_geolocation</code> is the nountype used by the <code>weather</code> command for its location argument in input like &#8220;weather near Chicago&#8221;. The neat feature of <code>noun_type_geolocation</code> is that it has a smart default value which uses Firefox&#8217;s geolocation system to give you your current location by default, so I can enter &#8220;weather&#8221; and get the suggestion &#8220;weather near Broomfield, Colorado&#8221; (not completely correct, but close enough for the weather). Otherwise, however, <code>noun_type_geolocation</code> does not do too hot&#8230; for any input you give it, it&#8217;ll just accept it with a score of 0.3, much like <code>noun_arb_text</code>. We could do better.</p>

<p>One issue with this <code>noun_type_geolocation</code> is a conceptual one. Is this nountype supposed to accept only municipalities? Countries? Or should it accept landmarks or addresses as well? Part of the issue is that it&#8217;s only used by one built-in command in Ubiquity now, <code>weather</code>. But to be called a general &#8220;geolocation&#8221; nountype, its output should not be specific to <code>weather</code>&#8217;s usage, which is to throw the result at the <a href="http://wunderground.com">Weather Underground</a> API.</p>

<p>I propose that we change this to be something like <code>noun_type_geo_town</code> and also make similar nountypes like <code>noun_type_geo_country</code>, <code>noun_type_geo_region</code>, going all the way down to <code>noun_type_address</code> (which already exists—see below). All of the nountypes in this family could use a geocoding API such as <a href="http://code.google.com/apis/maps/documentation/geocoding/index.html">Google&#8217;s</a> or <a href="http://developer.yahoo.com/maps/rest/V1/geocode.html">Yahoo&#8217;s</a>. Their <code>data</code> properties could include all of this geocoded geographic data (in English) and also the latitude/longitude coordinate data.</p>

<p>The <code>weather</code> command could then accept <code>noun_type_geo_town</code> but, as some municipalities are not in Weather Underground or, for some countries, it is only as granular as administrative districts, we could just display the results of the geocoding API but then give Weather Underground the geocoded latitude/longitude data.</p>

<h3><code>noun_type_async_address</code></h3>

<p><code>noun_type_async_address</code> attempts to do exactly what I&#8217;ve laid out above for the most granular level: that of geolocations with data all the way down to the street level. This is the nountype which is used for the built-in <code>map</code> command and uses the <a href="http://developer.yahoo.com/maps/rest/V1/geocode.html">Yahoo geocoding service</a> to accomplish this. Let&#8217;s see what kinds of results it returns:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>mitcho</td><td>mitcho</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td rowspan='1'>grenada</td><td>grenada</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>jono</td><td>jono</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>mountain view</td><td>mountain view</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
</table>

<p>Let&#8217;s lay out some immediate quirks:</p>

<ol>
<li>All scores are either 0.5 or 0.9. In general, if the Yahoo API returns some geocoded interpretation, it gets 0.9, but otherwise it accepts everything with 0.5.</li>
<li>The results that came back from the Yahoo service doesn&#8217;t add any useful information like the country or administrative region. Even the case stays lowercase.</li>
<li>Since when is Jono a location!? I&#8217;ll get back to this later.</li>
</ol>

<p>For starters, the Yahoo! Maps API terms of service dictate that we can&#8217;t use its geocoding service if we&#8217;re not also displaying Yahoo maps, so I rewrote it using the Google API which also had the advantage of offering JSON output.</p>

<p>One quirk of the Google Geocoding API, though, is that all of the resulting municipality names are only in English. Try for example queries for <a href="http://maps.google.com/maps/geo?q=Wien&amp;output=json&amp;oe=utf8&amp;sensor=false">Wien</a> or <a href="http://maps.google.com/maps/geo?q=%E6%9D%B1%E4%BA%AC&amp;output=json&amp;oe=utf8&amp;sensor=false">東京 (Tokyo)</a>. Since we want our suggestions to only add information to our input, not replace the input entirely (and especially not in another language), we&#8217;ll then only take results which have the input as an initial substring. On the other hand, if none of the results have the input as a proper prefix of the return value, we will take the geocoding information from the first result but with the original input as the display text. Such results will have a markedly lower score.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>As this is the <code>address</code> nountype, we&#8217;ll penalize results which do not have detailed information such as street address or town-level information. All of this is very easy to judge as every result from the API has a <a href="http://code.google.com/intl/ja/apis/maps/documentation/geocoding/index.html#GeocodingAccuracy">geocoding accuracy</a> value.</p>

<h3>The best laid plans of mice and men&#8230;</h3>

<p>I spent a good few hours this afternoon and evening <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/377daf3fe57a">attempting to implement</a> this new family of nountypes, including this new <code>nountype_geo_address</code>, but also <code>nountype_geo_subregion</code>, <code>nountype_geo_region</code>, and <code>nountype_geo_country</code>. Some of the quirks of the <code>weather</code> and <code>map</code> commands, however, have prevented me from completely replacing the legacy <code>noun_type_address</code> and <code>noun_type_geolocation</code> described above. I hope to continue this work again soon and actually make this transition, ideally before 0.5.2.</p>

<p>Look forward to one (or maybe two?) more episode(s) of Nountype Quirks where I hope to definitively explain, analyze, and tweak <code>matchScore</code>, the scoring algorithm which underlies the majority of the nountypes in Ubiquity. As always, I look forward to your comments and feedback.</p>

<h3>Bonus: Where&#8217;s Jono?</h3>

<p>It turns out that <code>noun_type_async_address</code> was recognizing &#8220;Jono&#8221; as an address because Jono is actually a location afterall! Not only that, but Jono is in Japan!!</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/08/Picture-31.png" alt="Picture 3.png" border="0" width="594" height="525" /></p>

<p>You clearly <a href="http://jonoscript.files.wordpress.com/2009/06/ubiquity_japanese.png">can&#8217;t take Japan out of Jono</a>, but it turns out you can&#8217;t take Jono out of Japan either.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>If this crazy algorithm raises a red flag for anyone, you&#8217;re not alone&#8230; if you think of a more elegant solution, please let me know. This will no doubt be an issue when it comes to localizing the <code>address</code> nountype as well. I wish we could specify an output language for the Google Geocoding API&#8230; <img src='http://mitcho.com/blog/wp-includes/images/smilies/icon_sad.gif' alt=':(' class='wp-smiley' /> &#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-2/' rel='bookmark' title='Nountype Quirks: Day 2'>Nountype Quirks: Day 2</a></li>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Judging Noun Types'>Judging Noun Types</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/nountype-quirks-day-3/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Nountype Quirks: Day 2</title>
		<link>http://mitcho.com/blog/projects/nountype-quirks-day-2/</link>
		<comments>http://mitcho.com/blog/projects/nountype-quirks-day-2/#comments</comments>
		<pubDate>Thu, 30 Jul 2009 22:44:52 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[localization]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[scoring]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2635</guid>
		<description><![CDATA[Today I&#8217;m continuing the process of reviewing and tweaking all of the nountypes built-in to Ubiquity. For a more respectable introduction to this endeavor, please read my blog post from a couple days ago, Judging Noun Types and my status update from yesterday, Nountype Quirks: Day 1. Note: this blog post includes a number of [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Judging Noun Types'>Judging Noun Types</a></li>
<li><a href='http://mitcho.com/blog/projects/big-issues-and-small-issues-with-parser-2/' rel='bookmark' title='Big Issues and Small Issues with Parser 2'>Big Issues and Small Issues with Parser 2</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><style type='text/css'>
.scorebar {
  background-color:red;
  display:inline-block;
  height:0.5em;
  vertical-align:middle;
}
.scoretable td {
  font-size: 0.7em;
}
</style></p>

<p>Today I&#8217;m continuing the process of reviewing and tweaking all of the nountypes built-in to <a href="http://ubiquity.mozilla.com">Ubiquity</a>. For a more respectable introduction to this endeavor, please read my blog post from a couple days ago, <a href="http://mitcho.com/blog/projects/judging-noun-types/">Judging Noun Types</a> and my status update from yesterday, <a href="http://mitcho.com/blog/projects/nountype-quirks-day-1/">Nountype Quirks: Day 1</a>.</p>

<p><em>Note: this blog post includes a number of graphs using HTML/CSS formatting. If you are reading this article through a feed reader or planet, I invite you to read it <a href="http://mitcho.com/blog/projects/nountype-quirks-day-2/">on my site</a>.</em></p>

<p><span id="more-2635"></span></p>

<h3><code>noun_type_twitter_user</code></h3>

<p>Let&#8217;s begin again by considering the suggestions and scores that a variety of different inputs to this nountype return and see what quirks we find.</p>

<p>To test this nountype, I made sure I had logged into <a href="http://twitter.com">Twitter</a> once with the login <a href="http://twitter.com/mitchoyoshitaka/"><code>mitchoyoshitaka</code></a>.</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='2'>mitcho</td><td>mitchoyoshitaka</td><td><span class='scorebar' style='width:425px'></span> 0.85</td></tr>
<tr><td>mitcho</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td rowspan='2'>mitchoyoshi</td><td>mitchoyoshitaka</td><td><span class='scorebar' style='width:470px'></span> 0.94</td></tr>
<tr><td>mitcho</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td>test</td><td>test</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td>テスト</td><td><i>none</i></td><td></td></tr>
<tr><td>hello world</td><td><i>none</i></td><td></td></tr>
<tr><td>@test</td><td><i>none</i></td><td></td></tr>
</table>

<p><a href="http://mitcho.com/blog/projects/nountype-quirks-day-1/">As nountypes go</a>, this is looking pretty good. For usernames which look like logins we&#8217;ve saved before, we&#8217;re using <code>matchScore</code> to get decent differential scores.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> It&#8217;s even ruling out impossible twitter username strings, according to Twitter&#8217;s own restriction:</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/twitter-usernames.png" alt="twitter-usernames.png" border="0" width="574" height="75" /></p>

<p>One possible improvement we could make is to let @ strings be accepted. I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/97871e3a453c">went ahead and made this improvement</a>. The initial @ will be stripped off and then will be checked as normal, but the final score will receive a slight boost using an <a href="http://en.wikipedia.org/wiki/nth_root"><i>n</i>th root</a> formula. The <code>twitter</code> command was also updated to deal with inputs with and without the initial @.</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='2'>mitcho</td><td>mitchoyoshitaka</td><td><span class='scorebar' style='width:425px'></span> 0.85</td></tr>
<tr><td>mitcho</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td rowspan='2'>@mitcho</td><td>@mitchoyoshitaka</td><td><span class='scorebar' style='width:440px'></span> 0.88</td></tr>
<tr><td>@mitcho</td><td><span class='scorebar' style='width:285px'></span> 0.57</td></tr>

<tr><td>test</td><td>test</td><td><span class='scorebar' style='width:250px'></span> 0.5</td></tr>
<tr><td>@test</td><td>@test</td><td><span class='scorebar' style='width:285px'></span> 0.57</td></tr>
</table>

<p>Although the <code>noun_type_twitter_user</code> nountype is currently most used by the built-in <code>twitter</code> command to specify the user&#8217;s username, in theory it could also be used for example in a command which pulls up another user&#8217;s tweets. With that in mind, perhaps in the future we could check the browser history and/or bookmarks for entries of the form <code>http://twitter.com/...</code> and suggest those as well (<a href="http://ubiquity.mozilla.com/trac/ticket/846">trac #846</a>).</p>

<h3><code>noun_type_number</code></h3>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>text</td><td><i>none</i></td><td></td></tr>
<tr><td>0.5</td><td>0.5</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>0.5.1</td><td><i>none</i></td><td></td></tr>
</table>

<p>This nountype has an incredibly simple job and does it with ease. I&#8217;m going to leave it alone.</p>

<h3><code>noun_type_date</code> and <code>noun_type_time</code></h3>

<p><code>noun_type_date</code> and <code>noun_type_time</code> both use the magical <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/parse">Date.parse</a> method to parse date- and time-like strings. Let&#8217;s first take a look at some of its suggestions:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th><code>date</code> suggestion</th><th><code>time</code> suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="250" height="15" /></th></tr>
<tr><td rowspan='1'>June 8th 5pm</td><td>2009-06-08</td><td>05:00 PM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>5pm</td><td>2009-07-30</td><td>05:00 PM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>5</td><td>2009-07-05</td><td>12:00 AM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>June 8th</td><td>2009-06-08</td><td>12:00 AM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>today</td><td>2009-07-30</td><td>12:00 AM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>now</td><td>2009-07-30</td><td>02:40 PM</td><td><span class='scorebar' style='width:250px'></span> 1</td></tr>
<tr><td rowspan='1'>5pm is a good time</td><td><i>none</i></td><td><i>none</i></td><td></td></tr>
</table>

<p>The quirks in these outputs can be summed up into these two factors:</p>

<ol>
<li>There is no differential scoring at all.</li>
<li>Both nountypes parse the input with <a href="https://developer.mozilla.org/en/Core_JavaScript_1.5_Reference/Global_Objects/Date/parse">Date.parse</a> and then just spit out the date or time components of the result. Thus time-only inputs get the default date and date-only inputs get the default time with equal scores.</li>
</ol>

<p>I just rewrote both nountypes and also added a new <code>noun_type_date_time</code>. Here are some of the features of the new implementation:</p>

<ol>
<li>If the input only contains digits and spaces, it is marked down.</li>
<li>With the exception of the outputs &#8216;today&#8217; and &#8216;now&#8217;, if the resulting <code>Date</code> object&#8217;s date is today, its date suggestion is scored lower; equivalently for time being the default value, &#8220;12:00 AM&#8221;.</li>
<li>Scores (with the exception of &#8216;today&#8217; and &#8216;now&#8217;) which are shorter than the output string get a slight penalty. This factor reflects the intuition that a longer output than input means some generic information was added and thus there is less confidence in the output.</li>
</ol>

<p>Here&#8217;s what some of the inputs give now:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>

<tr><td rowspan='3'>June 8th 5pm</td><td><code>date</code>: 2009-06-08</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td><code>time</code>: 05:00 PM</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td><code>date_time</code>: 2009-06-08&#160;05:00 PM</td><td><span class='scorebar' style='width:430px'></span> 0.86</td></tr>

<tr><td rowspan='3'>5pm</td><td><code>date</code>: 2009-07-30</td><td><span class='scorebar' style='width:135px'></span> 0.27</td></tr>
<tr><td><code>time</code>: 05:00 PM</td><td><span class='scorebar' style='width:405px'></span> 0.81</td></tr>
<tr><td><code>date_time</code>: 2009-07-30&#160;05:00 PM</td><td><span class='scorebar' style='width:245px'></span> 0.49</td></tr>

<tr><td rowspan='3'>5</td><td><code>date</code>: 2009-07-05</td><td><span class='scorebar' style='width:265px'></span> 0.53</td></tr>
<tr><td><code>time</code>: 12:00 AM</td><td><span class='scorebar' style='width:95px'></span> 0.19</td></tr>
<tr><td><code>date_time</code>: 2009-07-05&#160;12:00 AM</td><td><span class='scorebar' style='width:170px'></span> 0.34</td></tr>

<tr><td rowspan='3'>June 8th</td><td><code>date</code>: 2009-06-08</td><td><span class='scorebar' style='width:475px'></span> 0.95</td></tr>
<tr><td><code>time</code>: 12:00 AM</td><td><span class='scorebar' style='width:175px'></span> 0.35</td></tr>
<tr><td><code>date_time</code>: 2009-06-08&#160;12:00 AM</td><td><span class='scorebar' style='width:170px'></span> 0.58</td></tr>

<tr><td rowspan='3'>today</td><td><code>date</code>: 2009-07-30</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td><code>time</code>: 12:00 AM</td><td><span class='scorebar' style='width:225px'></span> 0.45</td></tr>
<tr><td><code>date_time</code>: 2009-06-08&#160;12:00 AM</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>

<tr><td rowspan='3'>now</td><td><code>date</code>: 2009-07-30</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td><code>time</code>: 12:00 AM</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td><code>date_time</code>: 2009-06-08&#160;04:34 PM</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>

</table>

<p>In addition, looking to the future we&#8217;d <a href="http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/">like to make nountypes localizable</a> as well, and these two nountypes in particular will surely require some good thinking and planning to make localizable.</p>

<h3><code>noun_type_email</code> and <code>noun_type_contact</code></h3>

<p><code>noun_type_email</code> and <code>noun_type_contact</code> are two closely related nountypes. <code>noun_type_email</code> simply validates email address-looking strings, while <code>noun_type_contact</code> will return the <code>noun_type_email</code> suggestions and additionally return contacts from GMail if available.</p>

<p>The first thing to note is that I&#8217;ve often found the GMail contact lookup to be finicky in my own use. Reading through the code, I discovered the solution: GMail must either be open in a tab or you must use the &#8220;stay signed in&#8221; option and close the GMail tab.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup> With this mystery solved, and <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/8478c7103753">some code cleanup done to this contact fetching</a>, let&#8217;s take a look at some example suggestions: (suggestions overlapping with <code>noun_type_email</code> are not listed here)</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>aza@m</td><td>aza@mozilla.com</td><td><span class='scorebar' style='width:210px'></span> 0.42</td></tr>
<tr><td rowspan='1'>jono</td><td>jdicarlo@mozilla.com</td><td><span class='scorebar' style='width:140px'></span> 0.28</td></tr>
<tr><td rowspan='1'>jdicarlo</td><td>jdicarlo@mozilla.com</td><td><span class='scorebar' style='width:95px'></span> 0.19</td></tr>
</table>

<p>In general, we see that these scores all look pretty poor. In particular, though, note that the &#8220;jono&#8221; input yielded a higher score for the same suggestion than &#8220;jdicarlo&#8221;, even though &#8220;jdicarlo&#8221; is longer and thus, intuitively, has more informational content and should maybe do better. Digging into the code I realized why this is. It was computing the scores by comparing &#8220;jono&#8221; and &#8220;jdicarlo&#8221; not simply to &#8220;Jono DiCarlo&#8221; and &#8220;jdicarlo@mozilla.com&#8221; respectively, but to the combined string &#8220;Jono DiCarlo &lt;jdicarlo@mozilla.com&gt;&#8221;. Now with <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/0877848192f2">this change</a> in place, both the email address and name are analyzed individually and, due to the way nountype detection works in Parser 2, no duplicates are returned. Here are the updated results:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>jono</td><td>jdicarlo@mozilla.com</td><td><span class='scorebar' style='width:415px'></span> 0.83</td></tr>
<tr><td rowspan='1'>jdicarlo</td><td>jdicarlo@mozilla.com</td><td><span class='scorebar' style='width:425px'></span> 0.85</td></tr>
</table>

<p>That&#8217;s much better!</p>

<p>Now let&#8217;s consider the suggestions from <code>noun_type_email</code>. Here are what they originally looked like:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>bpung</td><td><i>none</i></td><td></td></tr>
<tr><td rowspan='1'>bpung@m</td><td>bpung@m</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td rowspan='1'>bpung@mozilla.com</td><td>bpung@mozilla.com</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
</table>

<p><code>noun_type_email</code> is based on <a href="http://blog.livedoor.jp/dankogai/archives/51190099.html">a very robust regular expression</a> for <a href="http://www.ietf.org/rfc/rfc2822.txt">RFC 2822</a>. Unfortunately this means that it completely rules out strings such as &#8220;bpung&#8221; which could be a proper prefix of an email address—something that I&#8217;ve advocated for avoiding before (see footnote 2 of <a href="http://mitcho.com/blog/projects/judging-noun-types/">Judging Noun Types</a>). Moreover, due to a quirk of how nountypes based on regular expressions are scored, all results are given the score of 1.</p>

<p>I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/0d1803104c7d">just committed a change</a> so that this behavior is improved. The new version accepts strings which match the username part of the email address spec sans @ and domain, but with a great score penalty.<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup> Moreover, domains which do not have a final label (the <a href="http://en.wikipedia.org/wiki/top level domain">top level domain</a>) with more than one letter (unless it&#8217;s an IP address) or do not have any periods (.) in the domain will be penalized as well. Here&#8217;s what the same inputs produce now:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='1'>bpung</td><td>bpung</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='1'>bpung@m</td><td>bpung@m</td><td><span class='scorebar' style='width:400px'></span> 0.8</td></tr>
<tr><td rowspan='1'>bpung@mozilla.com</td><td>bpung@mozilla.com</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
</table>

<h3>Same time, same channel</h3>

<p>I hope this post sheds light on the many changes I made together as well as the underlying thought process. If you don&#8217;t agree with any particular fix or analysis, please comment! I&#8217;ll be back again tomorrow with another installment of Nountype Quirks. Stay tuned!</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Again, <code>matchScore</code> will be the subject of another blog post in the near future.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>Moreover, due to the way <code>noun_type_contact</code> caches the contact list internally, as long as GMail&#8217;s contacts are available once, you should be able to continue accessing those contacts&#8217; suggestions after logging out of GMail. There are also great performance benefits to this caching. The downside is that we currently have no way to know when to clear the cache, so even if you update your contacts in GMail, those new contacts won&#8217;t appear in Ubiquity until you restart Firefox.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>Perhaps this is a horrible idea, because if executed or previewed, any verb which uses these nountypes would have to deal with arguments which are not valid email addresses. In my mind, though, as long as it doesn&#8217;t actually cause any error, this should be okay. Keep in mind that, given the very low scores given to these suggestions, parses using it would most likely only show up if the verb which requires these nountypes was explicitly given and there are other arguments as well, for example in input like &#8220;email hello to bpung&#8221;. In such a situation, we would rather this suggestion not disappear until we type &#8220;@m&#8221;. If executed, the built-in email verb, for instance, will deal with this gracefully by simply putting the incomplete email address in the To field.&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/nountype-quirks-day-1/' rel='bookmark' title='Nountype Quirks: Day 1'>Nountype Quirks: Day 1</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Judging Noun Types'>Judging Noun Types</a></li>
<li><a href='http://mitcho.com/blog/projects/big-issues-and-small-issues-with-parser-2/' rel='bookmark' title='Big Issues and Small Issues with Parser 2'>Big Issues and Small Issues with Parser 2</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/nountype-quirks-day-2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nountype Quirks: Day 1</title>
		<link>http://mitcho.com/blog/projects/nountype-quirks-day-1/</link>
		<comments>http://mitcho.com/blog/projects/nountype-quirks-day-1/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 23:00:56 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[algorithm]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[scoring]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2598</guid>
		<description><![CDATA[Today I began the process of going through all of the nountypes built-in to Ubiquity using the principles and criteria I laid out yesterday—a task I&#8217;ve had in planning for a while now. As I explained yesterday, improved suggestions and scoring from the built-in nountypes could directly translate to better and smarter suggestions, resulting in [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Judging Noun Types'>Judging Noun Types</a></li>
<li><a href='http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-parser-2/' rel='bookmark' title='A Demonstration of Ubiquity Parser 2'>A Demonstration of Ubiquity Parser 2</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><style type='text/css'>
.scorebar {
  background-color:red;
  display:inline-block;
  height:0.5em;
  vertical-align:middle;
}
.scoretable td {
  font-size: 0.7em;
}
</style></p>

<p>Today I began the process of going through all of the nountypes built-in to <a href="http://ubiquity.mozilla.com">Ubiquity</a> using <a href="http://mitcho.com/blog/projects/judging-noun-types/">the principles and criteria I laid out yesterday</a>—a task I&#8217;ve had <a href="http://ubiquity.mozilla.com/trac/ticket/746">in planning</a> for a while now. As I explained yesterday, improved suggestions and scoring from the built-in nountypes could directly translate to better and smarter suggestions, resulting in a better experience for all users. Here I&#8217;ll document some of the nountype quirks I&#8217;ve discovered so far and what remedy has been implemented or is planned.</p>

<p><em>Note: this blog post includes a number of graphs using HTML/CSS formatting. If you are reading this article through a feed reader or planet, I invite you to read it <a href="http://mitcho.com/blog/projects/nountype-quirks-day-1/">on my site</a>.</em></p>

<p><span id="more-2598"></span></p>

<h3><code>noun_type_percentage</code></h3>

<p>Here&#8217;s what a few different inputs originally returned:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td>20</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>20%</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>0.2</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>0.2%</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>20.0</td><td>2000%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>2 hens in the garden</td><td>2%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
</table>

<p>Let me highlight a couple obvious quirks:</p>

<ol>
<li>In certain cases, where the numerical expression includes a decimal and is less than one, it is interpreted as a proportional, rather than percent, value, e.g. &#8220;0.2&#8221; → &#8220;20%&#8221;. &#8220;0.2%&#8221; is not even an option. This is the case even when explicitly adding a % sign.</li>
<li>All suggestions, including those where the numeral was extracted from a long string of text (e.g. &#8220;2 hens in the garden&#8221;), get the same score of 1.</li>
</ol>

<p>I just <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/c3cd4af0f06a">committed a fix</a> so <code>noun_type_percentage</code> now&#8230;</p>

<ol>
<li>Counts the number of characters in the input which match <code>[\d.%]</code> and caps the score by (number of acceptable characters)/(length of input).</li>
<li>Strings which do not include &#8220;%&#8221; get a 10% penalty.</li>
<li>In the case of decimals less than 1 without a % sign, the proportion interpretation is also suggested (e.g. &#8220;0.2&#8221; → &#8220;20%&#8221;) in addition to the original suggestion (&#8220;0.2%&#8221;), but with a slight penalty.</li>
</ol>

<p>Here is what they now return:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td>20</td><td>20%</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>20%</td><td>20%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td rowspan='2'>0.2</td><td>0.2%</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>20%</td><td><span class='scorebar' style='width:405px'></span> 0.81</td></tr>
<tr><td>0.2%</td><td>0.2%</td><td><span class='scorebar' style='width:500px'></span> 1</td></tr>
<tr><td>20.0</td><td>20%</td><td><span class='scorebar' style='width:450px'></span> 0.9</td></tr>
<tr><td>2 hens in the garden</td><td>2%</td><td><span class='scorebar' style='width:25px'></span> 0.05</td></tr>
</table>

<h3><code>noun_type_tag</code></h3>

<p>Here&#8217;s what a few different inputs originally returned. Keep in mind that currently in this test profile, the preexisting tags are &#8220;animal&#8221;, &#8220;help&#8221;, &#8220;test&#8221;, and &#8220;ubiquity&#8221;.</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td>animal</td><td>animal</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td>mineral</td><td>mineral</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>anim</td><td>animal</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td>anim</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>help, test, ubiq</td><td>help,test,ubiquity</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td>help,test,ubiq</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>google, yahoo, ubiq</td><td>google,yahoo,ubiquity</td><td><span class='scorebar' style='width:350px'></span> 0.7</td></tr>
<tr><td>google,yahoo,ubiq</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td>google, , yahoo</td><td>google,yahoo</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
</table>

<p>Here are a few of <code>noun_type_tag</code>&#8217;s quirks:</p>

<ol>
<li>There are only two scores ever given out: 0.3 and 0.7.</li>
<li>Only the last tag in the list and whether it exists or not is taken into account.</li>
<li>When the last tag is incomplete, the completion is suggested with a higher score, but if the last tag is <em>exactly</em> equal to an existing tag, it gets the lower score.</li>
</ol>

<p>Ideally, we want <code>noun_type_tag</code> to look at each of the tags given to it, with higher scores for when there are more preexisting tags and fewer new ones. Keep in mind, though, that we only have to suggest the completion of the very last tag as that may be one where the user hasn&#8217;t completed typing yet&#8230; for earlier tags, we can assume (safely or not) that the user placed the comma where they meant to. We can&#8217;t teach Ubiquity to read minds, after all.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup></p>

<p>With this in mind, I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/54e6a232ec3a">just made a change</a> to <code>noun_type_tag</code> which aims to follow these principles. The basic idea is that we start with a base score of 0.3 but then raise it via <a href="http://en.wikipedia.org/wiki/nth root"><i>n</i>th root</a> for every tag in the sequence which is preexisting. Here&#8217;s what the same inputs return now. Recall that the preexisting tags are &#8220;animal&#8221;, &#8220;help&#8221;, &#8220;test&#8221;, and &#8220;ubiquity&#8221;.</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td>animal</td><td>animal</td><td><span class='scorebar' style='width:275px'></span> 0.55</td></tr>
<tr><td>mineral</td><td>mineral</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>anim</td><td>animal</td><td><span class='scorebar' style='width:275px'></span> 0.55</td></tr>
<tr><td>anim</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td rowspan='2'>help, test, ubiq</td><td>help,test,ubiquity</td><td><span class='scorebar' style='width:430px'></span> 0.86</td></tr>
<tr><td>help,test,ubiq</td><td><span class='scorebar' style='width:370px'></span> 0.74</td></tr>
<tr><td rowspan='2'>google, yahoo, ubiq</td><td>google,yahoo,ubiquity</td><td><span class='scorebar' style='width:275px'></span> 0.55</td></tr>
<tr><td>google,yahoo,ubiq</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
<tr><td>google, , yahoo</td><td>google,yahoo</td><td><span class='scorebar' style='width:150px'></span> 0.3</td></tr>
</table>

<h3><code>noun_type_awesomebar</code></h3>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='4'>moz</td><td class="sugg">http://www.mozilla.com/</td><td class="score"><span style="width: 400px;" class="scorebar">&nbsp;</span> 0.8</td></tr>
<tr><td class="sugg">https://wiki.mozilla.org/Labs/Ubiquity/ Parser_2_API_Conversion_Tutorial</td><td class="score"><span style="width: 400px;" class="scorebar">&nbsp;</span> 0.8</td></tr>
<tr><td class="sugg">http://en-us.start3.mozilla.com/ firefox?client=firefox-a&#038;rls= org.mozilla:en-US:official</td><td class="score"><span style="width: 400px;" class="scorebar">&nbsp;</span> 0.8</td></tr>
<tr><td class="sugg">http://en-us.www.mozilla.com/en-US/firefox/about/</td><td class="score"><span style="width: 400px;" class="scorebar">&nbsp;</span> 0.8</td></tr>
</table>

<p>There are a couple quirks here:</p>

<ol>
<li>All suggestions are returned with the same scores.</li>
<li>The nountype returns the URL of the entry as the HTML-formatted result and the title as the text-formatted result, which clearly does not make sense. However, it&#8217;s not clear to me whether the title, URL, or some combination of both is what we should be returning as the suggestion text presented to the user.<sup id="fnref:2"><a href="#fn:2" rel="footnote">2</a></sup></li>
</ol>

<p>I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/cb98c72364db">just rewrote <code>noun_type_awesomebar</code></a> to actually do some differential scoring. This new version also presents the URL or title depending on whichever had a better match using the <code>matchScore</code> function.<sup id="fnref:3"><a href="#fn:3" rel="footnote">3</a></sup></p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='4'>moz</td><td class="sugg">www.mozilla.com</td><td class="score"><span style="width: 350px;" class="scorebar">&nbsp;</span> 0.7</td></tr>
<tr><td class="sugg">https://wiki.mozilla.org/Labs/Ubiquity/ Parser_2_API_Conversion_Tutorial</td><td class="score"><span style="width: 315px;" class="scorebar">&nbsp;</span> 0.63</td></tr>
<tr><td class="sugg">http://en-us.start3.mozilla.com/ firefox?client=firefox-a&#038;rls= org.mozilla:en-US:official</td><td class="score"><span style="width: 305px;" class="scorebar">&nbsp;</span> 0.61</td></tr>
<tr><td class="sugg">http://en-us.www.mozilla.com/en-US/firefox/about/</td><td class="score"><span style="width: 300px;" class="scorebar">&nbsp;</span> 0.6</td></tr>
</table>

<h3><code>noun_type_url</code></h3>

<p>The purpose of <code>noun_type_url</code>&#8217;s suggest function is two-fold: first, to accept strings which may look like a URL and, second, to suggest URL&#8217;s from the history just like <code>noun_type_url</code>, but only based on URL matches and not title matches.<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup> Here are a few sample inputs:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='5'>moz</td><td class="sugg">http://www.mozilla.com/</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>
<tr><td class="sugg">http://moz</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td class="sugg">https://wiki.mozilla.org/Labs/Ubiquity/ Parser_2_API_Conversion_Tutorial</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>
<tr><td class="sugg">http://en-us.start3.mozilla.com/ firefox?client=firefox-a&#038;rls= org.mozilla:en-US:official</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>
<tr><td class="sugg">http://en-us.www.mozilla.com/en-US/firefox/about/</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>

<tr><td rowspan='1'>test</td><td class="sugg">http://test</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>http://</td><td class="sugg">http://</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>http:</td><td class="sugg">http:</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>http</td><td class="sugg">http</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>_test</td><td class="sugg">http://_test</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
<tr><td rowspan='1'>hello world!</td><td class="sugg">http://hello world!</td><td class="score"><span style="width: 250px;" class="scorebar">&nbsp;</span> 0.5</td></tr>
</table>

<p>Oh, where to begin!? Here are some initial quirks&#8230; it&#8217;s possible that you could think of more!</p>

<ol>
<li>There is no differential scoring&#8230; only 0.9 for suggestions from history and 0.5 for URL-like strings.</li>
<li>A number of invalid domain names are being accepted and turned into suggestions (&#8220;hello world!&#8221;, &#8220;_test&#8221;, etc.).</li>
<li>It&#8217;s trying to be smart by suggesting &#8220;http://&#8221; as a default <a href="http://en.wikipedia.org/wiki/URI scheme">URI scheme</a> but doing so even for prefixes (initial substrings) of the word &#8220;http&#8221; itself.</li>
</ol>

<p>With these thoughts in mind, I <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/rev/26f179661107">just took a first stab</a> at improving this situation. Here are some features of the new implementation:</p>

<ol>
<li>History entries are scored in the same way as in <code>noun_type_awesomebar</code>, using <code>matchScore</code>.</li>
<li>URLs without an explicit <a href="http://en.wikipedia.org/wiki/URI scheme">URI scheme</a> (like &#8220;http://&#8221;) get a 10% penalty.</li>
<li>&#8220;http://&#8221; is only suggested if one of a long list of common URI schemes are not detected.</li>
<li>It repairs schemes which are missing a slash or two, suggesting for example &#8220;http:hello.com&#8221; → &#8220;http://hello.com&#8221;.</li>
<li>It actually uses Firefox&#8217;s own <a href="https://developer.mozilla.org/en/nsIIDNService">IDNService</a> to check if the domain name is a valid <a href="http://en.wikipedia.org/wiki/internationalized domain name">internationalized domain name</a>. If it&#8217;s an IDN as opposed to LDH (&#8220;letters, digits, and hyphens&#8221;), it gets a 10% penalty. If it&#8217;s not even a valid IDN, it is ruled out (see last two example inputs below).</li>
<li>There are also penalties for only being a domain name with no path and for the domain not having any periods (.) in it.</li>
</ol>

<p>Here is what our suggestions now look like:</p>

<table style='border:0' class='scoretable'>
<tr><th>input</th><th>suggestion</th><th><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></th></tr>
<tr><td rowspan='5'>moz</td><td class="sugg">http://www.mozilla.com/</td><td class="score"><span style="width: 300px;" class="scorebar">&nbsp;</span> 0.6</td></tr>
<tr><td class="sugg">http://moz</td><td class="score"><span style="width: 325px;" class="scorebar">&nbsp;</span> 0.65</td></tr>
<tr><td class="sugg">https://wiki.mozilla.org/Labs/Ubiquity/ Parser_2_API_Conversion_Tutorial</td><td class="score"><span style="width: 315px;" class="scorebar">&nbsp;</span> 0.63</td></tr>
<tr><td class="sugg">http://en-us.start3.mozilla.com/ firefox?client=firefox-a&#038;rls= org.mozilla:en-US:official</td><td class="score"><span style="width: 305px;" class="scorebar">&nbsp;</span> 0.61</td></tr>
<tr><td class="sugg">http://en-us.www.mozilla.com/en-US/firefox/about/</td><td class="score"><span style="width: 300px;" class="scorebar">&nbsp;</span> 0.6</td></tr>

<tr><td rowspan='1'>test</td><td class="sugg">http://test</td><td class="score"><span style="width: 325px;" class="scorebar">&nbsp;</span> 0.65</td></tr>
<tr><td rowspan='2'>http://</td><td class="sugg">http://</td><td class="score"><span style="width: 500px;" class="scorebar">&nbsp;</span> 1</td></tr>
<tr><td class="sugg">shttp://</td><td class="score"><span style="width: 375px;" class="scorebar">&nbsp;</span> 0.75</td></tr>

<tr><td rowspan='2'>http:</td><td class="sugg">http://</td><td class="score"><span style="width: 450px;" class="scorebar">&nbsp;</span> 0.9</td></tr>
<tr><td class="sugg">shttp://</td><td class="score"><span style="width: 350px;" class="scorebar">&nbsp;</span> 0.7</td></tr>

<tr><td rowspan='4'>http</td><td class="sugg">http://</td><td class="score"><span style="width: 360px;" class="scorebar">&nbsp;</span> 0.72</td></tr>
<tr><td class="sugg">https://</td><td class="score"><span style="width: 355px;" class="scorebar">&nbsp;</span> 0.71</td></tr>
<tr><td class="sugg">shttp://</td><td class="score"><span style="width: 340px;" class="scorebar">&nbsp;</span> 0.68</td></tr>
<tr><td class="sugg">http://http</td><td class="score"><span style="width: 325px;" class="scorebar">&nbsp;</span> 0.65</td></tr>

<tr><td rowspan='1'>_test</td><td class="sugg"><i>none</i></td><td class="score">&nbsp;</td></tr>
<tr><td rowspan='1'>hello world!</td><td class="sugg"><i>none</i></td><td class="score">&nbsp;</td></tr></table>

<h3>See you tomorrow~</h3>

<p>Alright, enough nountype wrangling for one day. I&#8217;ll be back again tomorrow for another installment.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>If we could make assumptions about what tags look like, for example that they are always pretty short, or use certain character classes, we could use such factors as well to judge non-preexisting tags for &#8220;tagginess&#8221; but unfortunately it&#8217;s possible (though unlikely) that a user would prefer really long tag strings and of course Firefox allows tags in any unicode code range. The only strings we can immediately rule out as impossible are ones which are purely whitespace.&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>It&#8217;s actually unclear whether the method we&#8217;re using (<a href="https://developer.mozilla.org/en/nsIAutoCompleteSearch"><code>nsIAutoCompleteSearch</code></a>) is actually searching titles or not&#8230; it currently looks like it&#8217;s only looking at the URL&#8217;s. Perhaps the title query is what we&#8217;re supposed to enter in <a href="https://bugzilla.mozilla.org/show_bug.cgi?id=507315">the mystery parameter</a>.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>I hope to discuss the <code>matchScore</code> function in a separate blog post later.&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:4">
<p>While writing up this section I ran into a bug whereby when both <code>noun_type_awesomebar</code> and <code>noun_type_url</code> are active, only one of their async callbacks from <code>Utils.history.search</code> are returned. Thus, if lucky, only one of the nountypes will return the history results and if unlucky the parse query will not complete. Filed as <a href="http://ubiquity.mozilla.com/trac/ticket/845">trac #845</a>.&#160;<a href="#fnref:4" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/localizing-commands-for-ubiquity-0-5/' rel='bookmark' title='Localizing Commands for Ubiquity 0.5'>Localizing Commands for Ubiquity 0.5</a></li>
<li><a href='http://mitcho.com/blog/projects/judging-noun-types/' rel='bookmark' title='Judging Noun Types'>Judging Noun Types</a></li>
<li><a href='http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-parser-2/' rel='bookmark' title='A Demonstration of Ubiquity Parser 2'>A Demonstration of Ubiquity Parser 2</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/nountype-quirks-day-1/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Judging Noun Types</title>
		<link>http://mitcho.com/blog/projects/judging-noun-types/</link>
		<comments>http://mitcho.com/blog/projects/judging-noun-types/#comments</comments>
		<pubDate>Wed, 29 Jul 2009 06:39:11 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[arguments]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[design]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[nountypes]]></category>
		<category><![CDATA[scoring]]></category>
		<category><![CDATA[ubiquity]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2588</guid>
		<description><![CDATA[Introduction Different arguments are classified into different kinds of nouns in Ubiquity using noun types.1 For example, a string like &#8220;Spanish&#8221; could be construed as a language, while &#8220;14.3&#8221; should not be. These kinds of relations are then used by the parser to introduce, for example, language-related verbs (like translate) using the former argument, and [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/observation/scoring-and-ranking-suggestions/' rel='bookmark' title='Scoring and Ranking Suggestions'>Scoring and Ranking Suggestions</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>

<p>Different arguments are classified into different kinds of nouns in Ubiquity using <em>noun types</em>.<sup id="fnref:1"><a href="#fn:1" rel="footnote">1</a></sup> For example, a string like &#8220;Spanish&#8221; could be construed as a language, while &#8220;14.3&#8221; should not be. These kinds of relations are then used by the parser to introduce, for example, language-related verbs (like <code>translate</code>) using the former argument, and number-related verbs (like <code>zoom</code> or <code>calculate</code>) based on the latter. Ubiquity nountypes aren&#8217;t exclusive—a single string can count as valid for a number of different nountypes and in particular the &#8220;arbitrary text&#8221; nountype (<code>noun_arb_text</code>) will always accept any string given.</p>

<p>In addition to the <a href="https://ubiquity.mozilla.com/hg/ubiquity-firefox/raw-file/tip/ubiquity/modules/nountypes.js">various built-in nountypes</a>, Ubiquity lets command authors <a href="https://wiki.mozilla.org/Labs/Ubiquity/Ubiquity_Source_Tip_Author_Tutorial#Writing_a_Noun_Type_Object">write their own nountypes</a> as well.</p>

<h3>The functions of a noun type</h3>

<p>Nountypes have two functions: the first is <strong>accepting and suggesting</strong> suggestions and the second is <strong>scoring</strong>.</p>

<p><span id="more-2588"></span></p>

<h4>Accepting and suggesting</h4>

<p>Nountypes don&#8217;t just have to accept the exact string they were given—they can also return suggestions which are based on that input. For example, the <code>noun_type_language</code> can take the input &#8220;span&#8221; and return &#8220;Spanish.&#8221; A nountype can return multiple suggestions which may or may not include the trivial suggestion, i.e. the original input as is. If there is no way that that input could possibly be part of an accepted value, it should return no suggestions, i.e. <code>[]</code>.<sup id="fnref:3"><a href="#fn:3" rel="footnote">2</a></sup></p>

<h4>Scoring</h4>

<p>Ubiquity 0.5 with Parser 2 introduced the notion of a nountype suggestion <em>score</em>. For example, two different nountypes can accept the same input, but with different scores. Scores range from 0 to 1 where 1 is a perfect or exact suggestion and 0.1 or so is a very very improbable suggestion.<sup id="fnref:2"><a href="#fn:2" rel="footnote">3</a></sup> These scores are used in the <a href="http://mitcho.com/blog/observation/scoring-for-optimization/">scoring of parses</a>. Because verbs specify certain nountypes for each of their arguments, the scores that individual nountypes return for each argument are a crucial component of the scoring algorithm and can even determine whether a parse is returned or not.</p>

<p>With this in mind, you may be tempted to make your nountype return a score of 1 on any input so your verb will show up in the suggestions highly. While this would work, it will only act to make your verb annoying and a poor Ubiquity citizen. Appropriate scores must be given to noun suggestions, with higher values reflecting confidence and lower values reflecting imprecision. <em>But how exactly do you figure out what&#8217;s an appropriate value?</em></p>

<h3>Judging nountypes with the Nountype Tuner</h3>

<p>The Nountype Tuner is a new tool I&#8217;ve been building to help both Ubiquity core developers and command authors to check their nountypes against others and to &#8220;tune&#8221; their behavior and scores. The nountype tuner will take your input and throw it against all of the nountypes referenced in your active verbs and display the suggestions returned with their scores. You can think of it as <a href="http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/">the Playpen</a>&#8217;s little sister.</p>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner.png" alt="tuner.png" border="0" width="650" height="646" /></p>

<p>The Nountype Tuner can be found at <a href='chrome://ubiquity/content/tuner.html'>chrome://ubiquity/content/tuner.html</a>, though I am pretty sure it is broken in Ubiquity 0.5 and 0.5.1. It has been fixed now and I will make sure it&#8217;s in good shape for 0.5.2.</p>

<p>The heart and soul of the Nountype Tuner is this scale:</p>

<p><center><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/tuner-top.png" alt="tuner-top.png" border="0" width="500" height="30" /></center></p>

<p>This scale tells you, <em>in plain English</em>, what different scores represent and correspond to, in two sets of vocabulary: &#8220;in terms of a guess&#8221; and &#8220;in terms of a match.&#8221; While still subjective, this scale helps developers just different input/output pairs and their scores. For example, &#8220;lian&#8221; → &#8220;http://lian&#8221; is given 0.5, so it&#8217;s an okay guess or a possible match&#8230; does that seem right to you? Or &#8220;lian&#8221; → &#8220;Italian&#8221; being between &#8220;okay&#8221; and &#8220;good.&#8221; Appropriate? We can look at such statements, decide how we feel about them, and tweak if necessary.</p>

<h3>Good nountype scores have roots</h3>

<p><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/roots.jpg" alt="roots.jpg" border="0" width="650" height="300" /></p>

<p><small>CC-BY <a href="http://www.flickr.com/photos/aaronescobar/2569091622/">Aaron Escobar</a></small></p>

<p>&#8230;not that kind of root, but more like <a href="http://en.wikipedia.org/wiki/Nth_root">this kind of root</a>&#8230; let me explain&#8230;</p>

<p>When comparing the scores that individual nountypes return for different inputs, we must compare those scores <em>within the same nountype&#8217;s family of suggestions</em> to see if higher scores truly correspond to higher confidence. For example, the language nountype should give the suggestion &#8220;French&#8221; for both the inputs &#8220;f&#8221; and &#8220;fren,&#8221; but the scores of these suggestions should be different—i.e. the score of &#8220;f&#8221; → &#8220;French&#8221; should be much lower than the score for &#8220;fren&#8221; → &#8220;French,&#8221; reflecting the additional informational value. We refer to this relation of the scores of successive prefixes of a single suggestion all returning that same suggestion as the <em>score curve</em> and in general it should be non-decreasing.<sup id="fnref:4"><a href="#fn:4" rel="footnote">4</a></sup></p>

<p>One could say the most trivial score function then is the linear one. For a series of converging prefixes of the same suggestion (&#8220;Dutch&#8221;), under a linear approach we could naively let the score be (length of the input)/(length of the suggestion), as below:</p>

<p><center></p>

<h4>the linear model</h4>

<table>
<tr><th>input</th><td>d</td><td>du</td><td>dut</td><td>dutc</td><td>dutch</td></tr>
<tr><th>output</th><td>Dutch</td><td>Dutch</td><td>Dutch</td><td>Dutch</td><td>Dutch</td></tr>
<tr><th>score</th><td>0.2</td><td>0.4</td><td>0.6</td><td>0.8</td><td>1</td></tr>
</table>

<p></center></p>

<p>This linear model is represented below by the black line.</p>

<p><center><img src="http://mitcho.com/blog/wp-content/uploads/2009/07/nth-roots.png" alt="nth-roots.png" border="0" width="299" height="262" /></center></p>

<p>The problem with the linear model is that earlier transitions (additional keystrokes) <em>add more information</em> than the later ones. Once we&#8217;ve entered &#8220;dutc,&#8221; after all, we would like to be <em>pretty darn sure</em> that we mean &#8220;Dutch,&#8221; so the score difference between &#8220;dutc&#8221; and &#8220;dutch&#8221; should be less than the score difference between, say, &#8220;d&#8221; and &#8220;du.&#8221; We want a score curve that looks more like the solid or dotted red lines above.</p>

<p>For this reason, <strong>I strongly advocate the incorporation of an <em>n</em>th-root in the score computation</strong>. <em>N</em>th-rooted score functions over [0,1] have the feature that they are increasing but also that earlier transitions affect the score more than later ones, which is exactly what we&#8217;d like to see. (The solid red line above is <code>x^1/2</code> and the dotted one is <code>x^1/3</code>.)<sup id="fnref:5"><a href="#fn:5" rel="footnote">5</a></sup></p>

<h3>Conclusion</h3>

<p>Properly tuning both the built-in nountypes and custom nountypes is crucial to producing more accurate and relevant parse suggestions. I&#8217;ll be using the principles and criteria laid out above, combined with the new Nountype Tuner, to <a href="http://ubiquity.mozilla.com/trac/ticket/746">tune the built-in nountypes (trac #746)</a> in the coming days in preparation for our <a href="http://tinyurl.com/lgekyh">0.5.2 release</a>. I invite you to use the Nountype Tuner in 0.5.2 to tune your custom nountypes as well.</p>

<div class="footnotes">
<hr />
<ol>

<li id="fn:1">
<p>Or, as I often write them, &#8220;nountypes.&#8221;&#160;<a href="#fnref:1" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:3">
<p>Note that I didn&#8217;t just say &#8220;if the input is not an accepted value&#8230;&#8221; That&#8217;s because, based on the left-to-right nature of text input, an argument may later become a valid input of a certain nountype with a few more keystrokes. For example, if we had a URL nountype which accepted &#8220;http://mitcho.com&#8221; but not &#8220;http://mitcho&#8221;, any command which took this nountype would not show up in the suggestions while we were typing out &#8220;http://mitcho&#8221;&#8230; but would suddenly appear when we completed the &#8220;.com&#8221;. The best practice here is to suggest a valid value for the initial &#8220;http://mitcho&#8221;, like &#8220;http://mitcho.com&#8221;.<br/>(In reality, I should have said &#8220;initial-to-later nature&#8221; to be fair to right-to-left languages, but you get the idea. Speaking of which, serious consideration of Ubiquity in right-to-left languages is long overdue.)&#160;<a href="#fnref:3" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:2">
<p>In reality, due to the way parses are scored and the fact that <code>noun_arb_text</code> accepts anything with score 0.3, a suggestion with score below 0.3 is probably not worth even giving out. Notable exceptions are for custom noun types which are used in commands which take multiple arguments&#8230; in these cases, even scores below 0.3 could add up and overtake a <code>noun_arb_text</code> parse, but it&#8217;s rare.&#160;<a href="#fnref:2" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:4">
<p>The idea that successively longer inputs should yield successively higher scores only makes sense (1) when they are converging on the same suggestion output and (2) when these are truly suggestions, not just acceptances. For nountypes which accept the input verbatim, suggestion scores need not increase&#8230; for example &#8220;1&#8221; is just as good a &#8220;number&#8221; as &#8220;1234&#8221; is, so both of their respective suggestions, &#8220;1&#8221; and &#8220;1234&#8221; could be given the same score.&#160;<a href="#fnref:4" rev="footnote">&#8617;</a></p>
</li>

<li id="fn:5">
<p>Unfortunately the Nountype Tuner currently only compares the suggestions of <em>one input</em> across a number of nountypes, not a number of inputs across the same nountype. In the future I&#8217;d like to make the Nountype Tuner be able to produce these sorts of score curves as well.&#160;<a href="#fnref:5" rev="footnote">&#8617;</a></p>
</li>

</ol>
</div>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/observation/scoring-and-ranking-suggestions/' rel='bookmark' title='Scoring and Ranking Suggestions'>Scoring and Ranking Suggestions</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-localization-whats-new-whats-next/' rel='bookmark' title='Ubiquity Localization: What&#8217;s New, What&#8217;s Next'>Ubiquity Localization: What&#8217;s New, What&#8217;s Next</a></li>
<li><a href='http://mitcho.com/blog/projects/ubiquity-parser-the-next-generation-demo/' rel='bookmark' title='Ubiquity Parser: The Next Generation Demo'>Ubiquity Parser: The Next Generation Demo</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/judging-noun-types/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Converting your Ubiquity command to Ubiquity 0.5</title>
		<link>http://mitcho.com/blog/projects/converting-your-ubiquity-command-to-ubiquity-0-5/</link>
		<comments>http://mitcho.com/blog/projects/converting-your-ubiquity-command-to-ubiquity-0-5/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 12:15:37 +0000</pubDate>
		<dc:creator>mitcho</dc:creator>
				<category><![CDATA[projects]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[Mozilla Planet]]></category>
		<category><![CDATA[parser]]></category>
		<category><![CDATA[ubiquity]]></category>
		<category><![CDATA[video]]></category>

		<guid isPermaLink="false">http://mitcho.com/blog/?p=2521</guid>
		<description><![CDATA[Converting your Ubiquity command to Ubiquity 0.5 from mitcho on Vimeo. This video walks through the process of converting your Ubiquity commands to Ubiquity 0.5 with Parser 2. For more information, please consult the command conversion tutorial. Related posts: A Demonstration of Ubiquity Parser 2 Changes to Ubiquity Parser 2 and the Playpen Foxkeh demos [...]
Related posts:<ol>
<li><a href='http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-parser-2/' rel='bookmark' title='A Demonstration of Ubiquity Parser 2'>A Demonstration of Ubiquity Parser 2</a></li>
<li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
<li><a href='http://mitcho.com/blog/projects/foxkeh-demos-ubiquity-parser-the-next-generation/' rel='bookmark' title='Foxkeh demos Ubiquity Parser: The Next Generation'>Foxkeh demos Ubiquity Parser: The Next Generation</a></li>
</ol>

Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.]]></description>
			<content:encoded><![CDATA[<p><object width="649" height="365"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id=5691107&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><embed src="http://vimeo.com/moogaloop.swf?clip_id=5691107&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="649" height="365"></embed></object><br /><a href="http://vimeo.com/5691107">Converting your Ubiquity command to Ubiquity 0.5</a> from <a href="http://vimeo.com/mitchoyoshitaka">mitcho</a> on <a href="http://vimeo.com">Vimeo</a>.</p>

<p>This video walks through the process of converting your Ubiquity commands to Ubiquity 0.5 with Parser 2. For more information, please consult <a href="https://wiki.mozilla.org/Labs/Ubiquity/Parser_2_API_Conversion_Tutorial">the command conversion tutorial</a>.</p>
<p>Related posts:</p><ol>
<li><a href='http://mitcho.com/blog/projects/a-demonstration-of-ubiquity-parser-2/' rel='bookmark' title='A Demonstration of Ubiquity Parser 2'>A Demonstration of Ubiquity Parser 2</a></li>
<li><a href='http://mitcho.com/blog/projects/changes-to-ubiquity-parser-2-and-the-playpen/' rel='bookmark' title='Changes to Ubiquity Parser 2 and the Playpen'>Changes to Ubiquity Parser 2 and the Playpen</a></li>
<li><a href='http://mitcho.com/blog/projects/foxkeh-demos-ubiquity-parser-the-next-generation/' rel='bookmark' title='Foxkeh demos Ubiquity Parser: The Next Generation'>Foxkeh demos Ubiquity Parser: The Next Generation</a></li>
</ol>
<p>Related posts brought to you by <a href='http://yarpp.org'>Yet Another Related Posts Plugin</a>.</p>]]></content:encoded>
			<wfw:commentRss>http://mitcho.com/blog/projects/converting-your-ubiquity-command-to-ubiquity-0-5/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

