<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Matt Sanford</title>
	<atom:link href="http://mzsanford.wordpress.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://mzsanford.wordpress.com</link>
	<description>Code, Movies, Whatever strikes my fancy.</description>
	<lastBuildDate>Mon, 28 Nov 2011 01:03:43 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='mzsanford.wordpress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://s2.wp.com/i/buttonw-com.png</url>
		<title>Matt Sanford</title>
		<link>http://mzsanford.wordpress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://mzsanford.wordpress.com/osd.xml" title="Matt Sanford" />
	<atom:link rel='hub' href='http://mzsanford.wordpress.com/?pushpress=hub'/>
		<item>
		<title>Vespa Fender Replacement</title>
		<link>http://mzsanford.wordpress.com/2011/11/20/vespa-et4-fender-replacement/</link>
		<comments>http://mzsanford.wordpress.com/2011/11/20/vespa-et4-fender-replacement/#comments</comments>
		<pubDate>Mon, 21 Nov 2011 00:19:05 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Automotive]]></category>

		<guid isPermaLink="false">http://mzsanford.wordpress.com/?p=183</guid>
		<description><![CDATA[After a minor accident I needed to replace the rear fender on my 2001 Vespa ET4. The person who rear-ended me was curious what was entailed in replacing the part but we couldn&#8217;t find a good time for him to visit while I made the repairs. I busted out my handy iPhone and took pictures of my [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=183&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>After a minor accident I needed to replace the rear fender on my 2001 Vespa ET4. The person who rear-ended me was curious what was entailed in replacing the part but we couldn&#8217;t find a good time for him to visit while I made the repairs. I busted out my handy iPhone and took pictures of my repair progress so I could share. This post is really aimed at that one person but should anyone need to replace the fender on an ET series (especially one with crash bars) hopefully this helps.</p>
<p><span id="more-183"></span></p>
<h2>1. Before the replacement</h2>
<div id="attachment_198" class="wp-caption aligncenter" style="width: 234px"><a href="http://mzsanford.files.wordpress.com/2011/11/img_1516.jpg"><img class="size-medium wp-image-198  " title="Before: Broken fender" src="http://mzsanford.files.wordpress.com/2011/11/img_1516.jpg?w=224&#038;h=300" alt="Mah fender is busted." width="224" height="300" /></a><p class="wp-caption-text">Image 1.1: Before view of the fender</p></div>
<p>Being rear-ended on a scooter, even at low speed, is pretty jarring. We were stopped and he just rolled into me but it felt like when a clutch slips on an manual scooter and you jump forward. There weren&#8217;t any injuries and as you can see above it only cracked one part. What you can&#8217;t see above is the seam behind the chrome crash bar. The back fender is made of plastic and holds the license plate, license plate light and a reflector.</p>
<h2>2. Removing the crash bars</h2>
<p>The crash bars have saved the body of my scooter more than once. Taking these things off is a pain in the butt because they hug the body very closely. Taking off the front part of the bars requires a socket (13mm) as well as something to hold the nut on the back (pliers in this case). I loosened these on both sides but didn&#8217;t remove them immediately because I needed the bars to stay in position for the nest step. I couldn&#8217;t take a picture with both the wrench and the pliers on at the same time since one hand needed to hold the camera. However, this should give you the idea:</p>
<p><a href="http://mzsanford.files.wordpress.com/2011/11/img_1517.jpg"><img class="size-medium wp-image-199 alignnone" title="Front of the crash bar (socket)" src="http://mzsanford.files.wordpress.com/2011/11/img_1517.jpg?w=224&#038;h=300" alt="Front of the crash bar (outside wrench)" width="224" height="300" /></a>    <a href="http://mzsanford.files.wordpress.com/2011/11/img_1520.jpg"><img class="size-medium wp-image-200 alignnone" title="Front of the crash bar (inside pliers)" src="http://mzsanford.files.wordpress.com/2011/11/img_1520.jpg?w=224&#038;h=300" alt="Front of the crash bar (inside pliers)" width="224" height="300" /></a></p>
<p>With the front bolts loose I was able to move to the rear bolts. Once again I needed to use a wrench on the outside (11mm) and pliers on the inside (plier picture omitted, you get the idea):</p>
<p><a href="http://mzsanford.files.wordpress.com/2011/11/img_1521.jpg"><img class="size-medium wp-image-201 alignnone" title="Back of the bar (socket)" src="http://mzsanford.files.wordpress.com/2011/11/img_1521.jpg?w=224&#038;h=300" alt="Back of the bar (outside wrench)" width="224" height="300" /></a></p>
<p>The crash bars are supported in the back by a bracket that passes over the tire and rests on the inside of the fender (image one). That bracket is held on at the sides by the rear bolts mentioned above so once they are removed you can slide the bracket out and then remove the loosened front bolts and remove the bars completely (image two):</p>
<p><a href="http://mzsanford.files.wordpress.com/2011/11/img_1523.jpg"><img class="alignnone size-medium wp-image-202" title="Back bracket, held in place" src="http://mzsanford.files.wordpress.com/2011/11/img_1523.jpg?w=224&#038;h=300" alt="Back bracket, held in place" width="224" height="300" /></a>  <a href="http://mzsanford.files.wordpress.com/2011/11/img_1524.jpg"><img class="alignnone size-medium wp-image-203" title="Full bars" src="http://mzsanford.files.wordpress.com/2011/11/img_1524.jpg?w=224&#038;h=300" alt="Full bars off the bike" width="224" height="300" /></a></p>
<h2>3. Remove the fender</h2>
<p>Removing the fender itself after the crash bars in quite simple. I have photographed the steps on the left side of the scooter below but the right side is just a mirror image. I started by removing the license plate light, which is held in place by a rubber grommet and nothing more. It&#8217;s a bit hard to see in the two images below but these are pictures taken from the ground, under the inside of the fender. The circle of light in image two is the sun coming in the license plate light hole. If you compare the two photos you should be able to see the rubber grommet around the base of the bulb. That&#8217;s all that held it in so a light tug dislodged it:</p>
<p><a href="http://mzsanford.files.wordpress.com/2011/11/img_1531.jpg"><img class="alignnone size-medium wp-image-208" title="Inside (light in place)" src="http://mzsanford.files.wordpress.com/2011/11/img_1531.jpg?w=300&#038;h=224" alt="Inside fender (light in place)" width="300" height="224" /></a>  <a href="http://mzsanford.files.wordpress.com/2011/11/img_1532.jpg"><img class="alignnone size-medium wp-image-209" title="Inside (light pulled)" src="http://mzsanford.files.wordpress.com/2011/11/img_1532.jpg?w=300&#038;h=224" alt="Inside fender (light pulled)" width="300" height="224" /></a></p>
<p>Now on to the real body panels. If you pull up the back corner of the floor mat you&#8217;ll see a large screw which needs to be removed:</p>
<p><a href="http://mzsanford.files.wordpress.com/2011/11/img_1526.jpg"><img class="alignnone size-medium wp-image-204" title="Lift the floor mat" src="http://mzsanford.files.wordpress.com/2011/11/img_1526.jpg?w=224&#038;h=300" alt="Lift the floor mat" width="224" height="300" /></a>  <a href="http://mzsanford.files.wordpress.com/2011/11/img_1527.jpg"><img class="alignnone size-medium wp-image-205" title="Bolt under the floor mat" src="http://mzsanford.files.wordpress.com/2011/11/img_1527.jpg?w=224&#038;h=300" alt="Bolt under the floor mat" width="224" height="300" /></a></p>
<p>Once the screw is removed the lower panel of the cowl can be pulled off. Start by pulling on the side closest to the front of the scooter because the back edge is hooked into the fender (see image one). Once the lower panel is removed you have a clear view of the fender mounting screw (image two):</p>
<p><a href="http://mzsanford.files.wordpress.com/2011/11/img_1529.jpg"><img class="alignnone size-medium wp-image-206" title="Pull off the lower panel" src="http://mzsanford.files.wordpress.com/2011/11/img_1529.jpg?w=224&#038;h=300" alt="Pull off the lower panel" width="224" height="300" /></a>  <a href="http://mzsanford.files.wordpress.com/2011/11/img_1530.jpg"><img class="alignnone size-medium wp-image-207" title="Fender mounting screw" src="http://mzsanford.files.wordpress.com/2011/11/img_1530.jpg?w=224&#038;h=300" alt="Fender mounting screw" width="224" height="300" /></a></p>
<p>When the mounting screws have been remove from both sides the fender just needs a light tug to come off. You can see below the old   part with all of the accessories on it next to the new part:</p>
<div id="attachment_210" class="wp-caption aligncenter" style="width: 310px"><a href="http://mzsanford.files.wordpress.com/2011/11/img_1533.jpg"><img class="size-medium wp-image-210" title="Side by side" src="http://mzsanford.files.wordpress.com/2011/11/img_1533.jpg?w=300&#038;h=224" alt="Side by side" width="300" height="224" /></a><p class="wp-caption-text">New and old, side by side</p></div>
<h2>4. Transfer the accessories</h2>
<p>The license plate it held on by four slot-headed screws that require pliers to hold the square nuts on the far side. Once the plate is remove you can clearly see the license plate bracket (image one, shown upside down, sorry.), which is held on by three screws that have nuts (7mm) on the back side. The license plate light housing (which is fronted by a reflector) is held on by two screws from the inside (image two, also upside down, sorry):</p>
<p><a href="http://mzsanford.files.wordpress.com/2011/11/img_1534.jpg"><img class="alignnone size-medium wp-image-211" title="License plate bracket" src="http://mzsanford.files.wordpress.com/2011/11/img_1534.jpg?w=224&#038;h=300" alt="License plate bracket" width="224" height="300" /></a>  <a href="http://mzsanford.files.wordpress.com/2011/11/img_1535.jpg"><img class="alignnone size-medium wp-image-212" title="Screws for the light housing" src="http://mzsanford.files.wordpress.com/2011/11/img_1535.jpg?w=224&#038;h=300" alt="Screws for the license plate light housing" width="224" height="300" /></a></p>
<p>And once all of that is removed you have a mess on the sidewalk and someone with a dog is bound to come upon you and give you the stink eye. Remind yourself that they have likely helped add to the feces content of SF streets and feel smug that your shit will be cleaned up in the next 15 minutes and won&#8217;t leave a smear that some poor fool steps in. My mess looked something like this, but your mess may vary:</p>
<div id="attachment_213" class="wp-caption aligncenter" style="width: 234px"><a href="http://mzsanford.files.wordpress.com/2011/11/img_1536.jpg"><img class="size-medium wp-image-213" title="Everything asunder " src="http://mzsanford.files.wordpress.com/2011/11/img_1536.jpg?w=224&#038;h=300" alt="Everything asunder" width="224" height="300" /></a><p class="wp-caption-text">A mess.</p></div>
<h2>5. Conclusion</h2>
<p>The steps were easy to repeat in reverse so I don&#8217;t see any use in detailing that here. The finished product looks good, though the paint is not a perfect match due to aging:</p>
<div id="attachment_214" class="wp-caption aligncenter" style="width: 234px"><a href="http://mzsanford.files.wordpress.com/2011/11/img_1537.jpg"><img class="size-medium wp-image-214" title="Done." src="http://mzsanford.files.wordpress.com/2011/11/img_1537.jpg?w=224&#038;h=300" alt="Completed product" width="224" height="300" /></a><p class="wp-caption-text">Ta-da!</p></div>
<p>This is an off-topic blog post about a scooter repair meant for one (or maybe two) people to read. If you&#8217;re not one of those people and you&#8217;re reading this then hopefully you found this through some very obscure search and you&#8217;re saying &#8220;Thank god somebody wrote this down&#8221;. I leave you with this moment of zen:</p>
<p style="text-align:center;"><a href="http://xkcd.com/979/"><img class="aligncenter" title="Thanks god someone wrote this down" src="http://imgs.xkcd.com/comics/wisdom_of_the_ancients.png" alt="" width="485" height="270" /></a></p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/183/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/183/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/183/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=183&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2011/11/20/vespa-et4-fender-replacement/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1516.jpg?w=224" medium="image">
			<media:title type="html">Before: Broken fender</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1517.jpg?w=224" medium="image">
			<media:title type="html">Front of the crash bar (socket)</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1520.jpg?w=224" medium="image">
			<media:title type="html">Front of the crash bar (inside pliers)</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1521.jpg?w=224" medium="image">
			<media:title type="html">Back of the bar (socket)</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1523.jpg?w=224" medium="image">
			<media:title type="html">Back bracket, held in place</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1524.jpg?w=224" medium="image">
			<media:title type="html">Full bars</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1531.jpg?w=300" medium="image">
			<media:title type="html">Inside (light in place)</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1532.jpg?w=300" medium="image">
			<media:title type="html">Inside (light pulled)</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1526.jpg?w=224" medium="image">
			<media:title type="html">Lift the floor mat</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1527.jpg?w=224" medium="image">
			<media:title type="html">Bolt under the floor mat</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1529.jpg?w=224" medium="image">
			<media:title type="html">Pull off the lower panel</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1530.jpg?w=224" medium="image">
			<media:title type="html">Fender mounting screw</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1533.jpg?w=300" medium="image">
			<media:title type="html">Side by side</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1534.jpg?w=224" medium="image">
			<media:title type="html">License plate bracket</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1535.jpg?w=224" medium="image">
			<media:title type="html">Screws for the light housing</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1536.jpg?w=224" medium="image">
			<media:title type="html">Everything asunder </media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/11/img_1537.jpg?w=224" medium="image">
			<media:title type="html">Done.</media:title>
		</media:content>

		<media:content url="http://imgs.xkcd.com/comics/wisdom_of_the_ancients.png" medium="image">
			<media:title type="html">Thanks god someone wrote this down</media:title>
		</media:content>
	</item>
		<item>
		<title>Sufferin&#8217; Safari: Quirks Between Safari Versions</title>
		<link>http://mzsanford.wordpress.com/2011/07/14/sufferin-safari-version-quirks/</link>
		<comments>http://mzsanford.wordpress.com/2011/07/14/sufferin-safari-version-quirks/#comments</comments>
		<pubDate>Thu, 14 Jul 2011 19:06:24 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://mzsanford.wordpress.com/?p=175</guid>
		<description><![CDATA[Browser incompatibility is so 1999, isn&#8217;t it? Well, while we spend our time fretting about IE version incompatibility and cross-browser issues we often overlook the version issues of other browsers. Over the past week I&#8217;ve been working on the twitter-text-js support for hashtags in Russian, Korean, Japanese and Chinese. Along the way I ran into [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=175&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Browser incompatibility is so 1999, isn&#8217;t it? Well, while we spend our time fretting about IE version incompatibility and cross-browser issues we often overlook the version issues of other browsers. Over the past week I&#8217;ve been working on the <a href="https://github.com/twitter/twitter-text-js">twitter-text-js</a> support for hashtags in Russian, Korean, Japanese and Chinese. Along the way I ran into two bugs in some versions of Safari that surprised me. I didn&#8217;t find much online about it so I wanted to take a moment and jot this down.<span id="more-175"></span></p>
<h2>Non-ASCII URL Hashes</h2>
<p>The first bug I ran into has to do with assigning a new value to <code>window.location.hash</code> in Javascript. Our site uses the hash (or anchor) portion of the URL quite extensively in something generally called &#8220;hashbang URLs&#8221;. Two of my colleagues at Twitter have discussed the <a href="http://www.adequatelygood.com/2011/2/Thoughts-on-the-Hashbang">pros</a> and <a href="http://danwebb.net/2011/5/28/it-is-about-the-hashbangs">cons</a> of this approach publicly but what&#8217;s important here is that we use it today and therefore do more work with the hash portion of the URL than most people. This matters for hashtags because we catch the click on hashtag links and navigate by assigning the search to the <code>window.location.hash</code>.</p>
<p>Safari 5.0.5, and possibly earlier versions, are buggy in the implementation of assignment to <code>window.location.hash</code>. This isn&#8217;t a quirk, or a feature-I-do-not-appreciate, this is a bug. It&#8217;s fixed in 5.1 which makes me very happy. Our site was attempting to assign <code>#томск</code> to the window.location.hash but the page kept switching to <code>#B&gt;&lt;A:</code>. After a bit of reflection on the issue I noticed that the two are the exact same number of characters. What a curious coincidence. Well, it turns out it&#8217;s much worse than I thought:</p>
<div id="attachment_185" class="wp-caption aligncenter" style="width: 590px"><a href="http://mzsanford.files.wordpress.com/2011/07/untitled-1.jpg"><img class="size-full wp-image-185" title="What happened to by high order bits?" src="http://mzsanford.files.wordpress.com/2011/07/untitled-1.jpg?w=580&#038;h=340" alt="" width="580" height="340" /></a><p class="wp-caption-text">Safari 5.0.5 hash alteration</p></div>
<p>Look at that! Safari 5.0.5 seems to have turned all of our well formed Unicode into ASCII by stripping out all of the high bits. I thought this must be a problem with our page but our pages are UTF-8 encoded so those are not even the bytes on our page (and it also works in all other browsers, which is always suspicious). The fix for this was quite simple. If you re-build the complete URL and assign it to <code>window.location.href</code> the encoding is left intact. As a bonus, Safari correctly recognizes that the only change was the hash and does not trigger a full page reload. If you&#8217;re using hashbang URLs in languages other than English this might bite you. Beware of changing to <code>window.location.href</code> because IE does a full page reload, thus disabling your carefully crafted hasbang plans.</p>
<h2>Regular Expression Size Limit</h2>
<p>After testing our new hashtag regular expression in a myriad of browsers we thought we were covered. It turns out that Safari 4.0 and below have a limit on the maximum size of a regular expression that is lower than the browsers we tested. I had tested in Safari 5.1, because it is what I have, as well as several versions of Firefox and IE. Running multiple versions of Safari on a Mac is somewhere between impossible and difficult as far as I can tell, so beware of this one because it&#8217;s hard to test.</p>
<p>The regular expression in question contained a character class that had every Chinese character, which was admittedly excessive. We were able to refactor into character ranges and verify that it works in all of our supported browsers, so this was more of a coding inconvenience that a serious bug. The inability to run two versions of Safari feels like it&#8217;s setting me up for more failures like this in the future. If versions don&#8217;t act the same (and they shouldn&#8217;t, otherwise what&#8217;s the point?) then developers will need a way to run multiple versions to test. Without that this is a losing battle.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/175/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/175/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/175/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=175&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2011/07/14/sufferin-safari-version-quirks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/07/untitled-1.jpg" medium="image">
			<media:title type="html">What happened to by high order bits?</media:title>
		</media:content>
	</item>
		<item>
		<title>R2rb &#8211; Mirroring CSS direction</title>
		<link>http://mzsanford.wordpress.com/2011/06/17/r2rb-mirroring-css-direction/</link>
		<comments>http://mzsanford.wordpress.com/2011/06/17/r2rb-mirroring-css-direction/#comments</comments>
		<pubDate>Sat, 18 Jun 2011 00:38:41 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Languages]]></category>
		<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://mzsanford.wordpress.com/?p=173</guid>
		<description><![CDATA[I&#8217;m proud to announce the release of what is possibly the smallest Ruby gem I&#8217;ve ever worked on, R2 (R2rb on github, simply r2 on rubygems.org). Anybody who has read my older posts knows that I&#8217;m interested in Arabic, and more specifically Arabic information processing. While talking about something unrelated I found out that Dustin Diaz (@ded, dustindiaz.com) has [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=173&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m proud to announce the release of what is possibly the smallest Ruby gem I&#8217;ve ever worked on, <a href="https://github.com/mzsanford/r2rb">R2</a> (<a title="R2rb on github" href="https://github.com/mzsanford/r2rb">R2rb</a> on github, simply <a title="r2 on Rubygems.org" href="http://rubygems.org/gems/r2">r2</a> on rubygems.org). Anybody who has read my older posts knows that I&#8217;m interested in Arabic, and more specifically Arabic information processing. While talking about something unrelated I found out that Dustin Diaz (<a href="http://twitter.com/ded">@ded</a>, <a href="http://dustindiaz.com">dustindiaz.com</a>) has written a Node.js module called <a href="https://github.com/ded/r2">R2</a> for mirroring the appropriate CSS values needed to alter the directionality of a page. While this isn&#8217;t a silver bullet it does do a very good job on pages that have successfully separated presentation from markup (read as: don&#8217;t use inline CSS styles).<span id="more-173"></span></p>
<p>The code itself is shockingly simple but effective. Dustin already has an example built into his website. Here is the normal page (emphasis added to the demo link):</p>
<p style="text-align:center;"><a href="http://mzsanford.files.wordpress.com/2011/06/ltr.jpg"><img class="aligncenter size-full wp-image-176" style="margin-top:10px;margin-bottom:10px;border-color:black;border-style:solid;border-width:1px;" title="Normal left-to-right view" src="http://mzsanford.files.wordpress.com/2011/06/ltr.jpg?w=630&#038;h=371" alt="dustindiaz.com as seen by default" width="630" height="371" /></a></p>
<p>When you click the demo link (pointed to with the <span style="color:#800000;"><strong>Click Me.</strong></span> label) there is a small amount of Javascript that alters the link tag to point the the CSS file that R2 has processed. The resulting page shows the CSS direction change with zero customization:</p>
<p style="text-align:center;"><a href="http://mzsanford.files.wordpress.com/2011/06/rtl.jpg"><img class="aligncenter size-full wp-image-177" style="margin-top:10px;margin-bottom:10px;border-color:black;border-style:solid;border-width:1px;" title="Altered right-to-left site" src="http://mzsanford.files.wordpress.com/2011/06/rtl.jpg?w=630&#038;h=320" alt="dustindiaz.com as seen after clicking the arrow" width="630" height="320" /></a></p>
<p>While this is obviously not everything one needs to do for right-to-left support (of note above are the Twitter follow buttons) it&#8217;s a good starting point. If you have a large CSS file to start with the alterations can be daunting. I recommend using R2 and then troubleshooting the remaining bugs. I created a Ruby port of R2 in part to improve my understanding of R2 and in part in the hopes of using it in some future Rails project.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/173/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/173/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/173/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=173&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2011/06/17/r2rb-mirroring-css-direction/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/06/ltr.jpg" medium="image">
			<media:title type="html">Normal left-to-right view</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2011/06/rtl.jpg" medium="image">
			<media:title type="html">Altered right-to-left site</media:title>
		</media:content>
	</item>
		<item>
		<title>Crowdsourcing vs. Community</title>
		<link>http://mzsanford.wordpress.com/2011/06/15/crowdsourcing-vs-community/</link>
		<comments>http://mzsanford.wordpress.com/2011/06/15/crowdsourcing-vs-community/#comments</comments>
		<pubDate>Wed, 15 Jun 2011 16:54:55 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://mzsanford.wordpress.com/?p=164</guid>
		<description><![CDATA[This is post is about how I have come to use the words &#8220;crowdsourced&#8221; and &#8220;community&#8221; to distinguish different, but related, activities. I&#8217;ve been working on Twitter&#8217;s community translation tools since before they were launched and this is a lesson I&#8217;ve learned during that time. This all started with my reply to a Quora topic [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=164&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>This is post is about how I have come to use the words &#8220;crowdsourced&#8221; and &#8220;community&#8221; to distinguish different, but related, activities. I&#8217;ve been working on Twitter&#8217;s community translation tools since before they were launched and this is a lesson I&#8217;ve learned during that time. This all started with my reply to a <a href="http://www.quora.com/What-key-benefits-did-Twitter-and-Facebook-uncover-in-crowdsourcing-their-translations">Quora topic</a>  and much of the information was already covered there. But since Quora is a smaller community than the web at large I wanted to re-format the information for widest consumption and change some of the examples to be a little bit clearer.</p>
<p><span id="more-164"></span>As I mentioned above I&#8217;ve been working on Twitter&#8217;s community translation tools from the beginning. I originally called it &#8220;crowdsourced translation&#8221; but over time I&#8217;ve come to call it &#8220;community translation&#8221; and appreciate the subtle difference between the two terms, or at least started using them to mean two slightly different, but similar, things. The explanation of that difference explains is a little interesting but it&#8217;s most interesting because it highlights the biggest benefits Twitter has seen from translating this way.</p>
<p>I see &#8220;crowdsourcing&#8221; as an activity that requires very<strong> little or no prior knowledge</strong> of the problem space at hand and which can benefit solely from a wealth of different opinions/views/activities. A great example of this is search engine relevance evaluations. At their most basic these evaluations ask a group of people to search for a term and mark different links on the results as on- or off-topic. In more complicated scenarios they ask the participants to re-order the links into the &#8220;best&#8221; order, or to compare two result pages side-by-side and pick which is best. In all of these scenarios the activity does not require that the person have any idea how search engines work. You&#8217;re not asking an expert in the field to evaluate something, you&#8217;re asking the largest, most diverse group possible to evaluate it so you can understand the problem.</p>
<p>In the case of Twitter&#8217;s Translation Center we rely heavily on our user&#8217;s <strong>prior knowledge</strong> of Twitter itself. While that might seem like a minor difference it matches exactly what Nicholas Muldoon said above about Atlassian in the <a href="http://www.quora.com/What-key-benefits-did-Twitter-and-Facebook-uncover-in-crowdsourcing-their-translations">original Quora topic</a>, &#8220;<em>translations provided by our Language Service Provider were not translated by people who used the product</em>&#8220;. Twitter has also experimented with Language Service Providers (LSPs) and they do a great job at some types of tasks, while at others they don&#8217;t. The reason I now call it &#8220;community translation&#8221; is that we have taken an existing community of users and asked them to help based on prior knowledge. We did not take a group of people at random, but an existing community (bi-lingual Twitter users). We also didn&#8217;t take a collection of professional translators because while our task is translation our actual problem space is actually Twitter, and how it uses language.</p>
<p>One quick example to highlight the difference in community translation quality versus professional translators: Twitter uses the word &#8220;<em>unfollow</em>&#8221; to label the button that stops following another account. If you ask an LSP to translate this they will likely return a phrase such as &#8220;<em>Nicht mehr folgen</em>&#8221; in German. If you ask a translator (or linguist) directly they will probably point out that &#8220;<em>unfollow</em>&#8221; isn&#8217;t a word. Twitter&#8217;s language is very informal in English and community translation has helped us keep that playful tone in every language (even the ungrammatical &#8220;<em>Entfolgen</em>&#8221; in German). This might seem like a small thing but the consistency of product language with the product itself is really the key to translation quality. The localization industry has known this for ages and has made great strides in &#8220;source document quality&#8221; to that end (limited grammars, style guides, etc.).</p>
<p>As Alex Lane said in the original Quora topic nobody is crowdsourcing advertising, accounting or legal translation work (he might have meant the functions and not translations, but I took it to mean translation). Even Twitter does not do that because the language of those domains is formal. Our community of translators are an asset because they know our domain so well. They don&#8217;t know those more formal domains so they would do as poorly at those as an LSP does with things like &#8220;<em>unfollow</em>&#8220;.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/164/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/164/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/164/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=164&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2011/06/15/crowdsourcing-vs-community/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>
	</item>
		<item>
		<title>The Effort of Content Creation: An Evolution</title>
		<link>http://mzsanford.wordpress.com/2011/02/19/content-creation-evolution/</link>
		<comments>http://mzsanford.wordpress.com/2011/02/19/content-creation-evolution/#comments</comments>
		<pubDate>Sat, 19 Feb 2011 22:56:40 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Culture]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://mzsanford.wordpress.com/?p=142</guid>
		<description><![CDATA[Much like my previous posts about omnivores and MC Hammer this is something I&#8217;ve told many people in person but I&#8217;m only just now putting down in writing. Many people ask me why I think Twitter is popular, thinking there is some part of it they have yet to see. The &#8216;killer feature&#8217; isn&#8217;t some [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=142&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Much like my previous posts about <a title="The Honest Omnivore" href="http://mzsanford.wordpress.com/2010/05/16/the-honest-omnivore/" target="_blank">omnivores</a> and <a title="MC Hammer showed me the future of Twitter" href="http://mzsanford.wordpress.com/2010/12/22/mc-hammer-showed-me-the-future-of-twitter/" target="_blank">MC Hammer</a> this is something I&#8217;ve told many people in person but I&#8217;m only just now putting down in writing. Many people ask me why I think Twitter is popular, thinking there is some part of it they have yet to see. The &#8216;killer feature&#8217; isn&#8217;t some page on twitter.com they haven&#8217;t seen yet but rather it&#8217;s the simplicity of what they already see. It&#8217;s not about something complicated but rather the sum of the uncomplicated parts … not unlike the internet itself. I&#8217;m way ahead of myself. This post is about the evolution of people&#8217;s self-expression on the internet, people&#8217;s internet-identity, and how I see Twitter in that context. This isn&#8217;t some lofty vision from a Twitter founder or executive. This is the view from a guy who just happened upon all of this and is still trying to explain it however he can – to himself most of all.<span id="more-142"></span></p>
<h1>In the beginning, there was Geocities</h1>
<p>When I first heard of mainstream internet usage there was a general feeling of excitement about every person being able to share their views and knowledge with anyone interested. Internet savvy people practically stood on soap boxes in town squares telling people they should  have a presence on the internet. After all, the greatness of the internet is the fact that any one of us can have a site all our own – our own internet-identity. Enter Geocities, a free way to host a site of your own (I know there were others, but Geocities captured the imagination) for the modest price of learning HTML. Or, as luck would have it, there were some templates to get you started.</p>
<p>Some people were drawn to the internet by this and stayed. Most, however, put together a hasty page with a few words and an <a title="Iconic of Geocities" href="http://www.cs.utah.edu/~gk/atwork/" target="_blank">&#8220;Under Construction&#8221; icon</a> and moved on to other things. Even those who spent the time learning HTML, or finding a good template, soon felt like they just didn&#8217;t have enough to say to fill a site. Posting was technically difficult, graphic design was harder than anticipated but what killed the Geocities utopia more than anything was that most people realized they just didn&#8217;t have enough to say to make it <em>worth</em> all of that effort. If this self-expression on the internet thing was going to work out something had to give.</p>
<h1>And then came Blogger</h1>
<p>The homepage craze died down among the majority but it was clear that the internet-identity and self-expression dream still lived on. While I don&#8217;t know if that was the direct inspiration for blogs I would argue it led directly to it. It was clear to the creators of early blog platforms (Blogger as an early and popular example) that people had things to say and there was a business in making that easier. Blog platforms removed most, if not all, of the technical and design challenges that the home page era had suffered from. All you needed to blog was an idea and the time to write about it.</p>
<p>Blog platforms made (and still make) publishing easy but they didn&#8217;t do anything to ease what I see as the crux of the problem. You see, most blogs stop after a <a title="Original" href="http://www.caslon.com.au/weblogprofile1.htm" target="_blank">month or two</a> (<a title="Google Cache FTW!" href="http://webcache.googleusercontent.com/search?q=cache:HnMsQWnK0ZEJ:www.caslon.com.au/weblogprofile1.htm" target="_blank">cached</a>) and the main reasons are a lack of things to say and the time it takes to create a long-form blog post. That lack of things to say might be true or it might just be in the eyes of the author. Hell, my own update rate is erratic for just that reason. If I have a spare few hours I don&#8217;t run to post what&#8217;s on my mind for nobody to read. I only write when I feel I have both the time and the personal desire to get something off my chest &#8211; reader be damned (sorry).</p>
<h1>And here we are at Twitter</h1>
<p>I talked about Twitter in the intro and here is where it all ties back. I see Twitter as the next logical step in the process and that&#8217;s part of how I use it. There is no longer a technical or design learning curve and the amount of effort required at any one time is small. Twitter does not replace all blogs, just like blogs did not replace all home pages. This has all been an evolution from having a whole site that was infused with you in both design and content; to a place that expressed your views in traditional long-form content; and now to the sum of your small thoughts and observations. It turns out those small bits add up to your self-expression and your identity on the internet. You are what you say , what you do, and even what you repeat, on the internet just like everywhere else.</p>
<p>Could it get simpler to publish? Sure. Could you distill human communication down any more? Perhaps. Maybe that&#8217;s the vision for <a title="Whois?" href="http://whois.domaintools.com/gruntr.com" target="_blank">gruntr.com</a> … maybe the next big thing will be a system where you can only poke and grunt. Physical-gesture-over-IP? I&#8217;m in. Watch out AT&amp;T Wireless customer service, I foresee some angry gestures from SF residents.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/142/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/142/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/142/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=142&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2011/02/19/content-creation-evolution/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>
	</item>
		<item>
		<title>MySQL and Unicode</title>
		<link>http://mzsanford.wordpress.com/2010/12/28/mysql-and-unicode/</link>
		<comments>http://mzsanford.wordpress.com/2010/12/28/mysql-and-unicode/#comments</comments>
		<pubDate>Tue, 28 Dec 2010 21:51:08 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://mzsanford.wordpress.com/?p=133</guid>
		<description><![CDATA[I used MySQL for a great many projects over the years with the assumption that a charset of utf8 and a collation of utf8_unicode_ci was going to support all of UTF-8 and that was all I need to do. I was sorely mistaken but there was no point in writing until now, because MySQL 5.5 [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=133&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I used MySQL for a great many projects over the years with the assumption that a charset of <code>utf8</code> and a collation of <code>utf8_unicode_ci</code> was going to support all of UTF-8 and that was all I need to do. I was sorely mistaken but there was no point in writing until now, because MySQL 5.5 has finally helped rectify the issue. Up until MySQL 5.5 (released December of 2010) the UTF-8 support was severely hobbled. With MySQL 5.5 the server can now support the full range of characters that UTF-8 allows but it&#8217;s not the default behavior. There are still plenty of pitfalls for the naïve developer starting out with MySQL.<span id="more-133"></span></p>
<h2>The root cause and how the problems surface</h2>
<p>If you work on internationalization issues and use MySQL you&#8217;ve probably run into this. If not then it&#8217;s only a matter of time until you run into it. This is the dirty little secret of MySQL before 5.5 … it only supports characters within the BMP (more on what that means in a moment). With Unicode <a title="Esoterica, anyone?" href="http://www.unicode.org/charts/PDF/U13000.pdf">6.0</a> over 50% of all characters are outside of the BMP so that&#8217;s a big deal. To me it was a big deal before, but with Unicode 6.0 it&#8217;s bigger and now people are starting to take notice. Supporting half of a character set is almost worse than not supporting it since it&#8217;s difficult to figure out what&#8217;s going to happen when you send data to the server.</p>
<p>Most of the bugs caused by this poor UTF-8 support don&#8217;t surface in English, and that&#8217;s why many developers remain blissfully unaware of the problem. Having said that, this is not something that&#8217;s only found when user&#8217;s write in <a title="Deseret alphabet : all outside the BMP" href="http://en.wikipedia.org/wiki/Deseret_alphabet">Deseret</a> or <a href="http://www.unicode.org/charts/PDF/U13000.pdf">Egyptian Hieroglyphs</a> (PDF), it also comes into play with Japanese names and some new Unicode characters like Emoji.</p>
<p>The MySQL defaults also have an effect on Unicode processing that affects the majority of European languages you&#8217;re likely the try and target. This unsafe default  has a different root cause but I want to cover it here so the two issues are not confused with each other. Here are how some of the most common issue surface:</p>
<ul>
<li>Attempting to update a record where a <code>varchar</code> column changed only by a single accent will return success but not save the change
<ul>
<li>This makes spelling corrections in record seem to &#8220;not save&#8221;.</li>
</ul>
</li>
<li>A row can be inserted successfully but when it is re-read the <code>varchar</code> column is empty or missing characters.
<ul>
<li>This is the case with the Ruby driver at least, probably others.</li>
</ul>
</li>
<li>Unique constraints on <code>varchar</code> columns will fail despite different text if the differences are all outside of the BMP.</li>
<li>You can&#8217;t store the new Emoji characters, or they seem to disappear.</li>
</ul>
<h3>The supplementary character issue</h3>
<p>The crux of the UTF-8 issue is rooted in the fact that UTF-8 is a <a href="http://en.wikipedia.org/wiki/Variable-width_encoding">variable-width encoding</a>. The MySQL 5.1 implementation (like many others) was built on the assumption that a UTF-8 encoded character would use between 1 and 3 bytes. The beauty of UTF-8 is that it is compatible with ASCII (and by proxy the beginning of ISO-8859-1, which is also ASCII compatible) for the most common characters in English, using only 1 byte, but that the variable-width encoding scheme lets it also support the rest of Unicode. Here&#8217;s the rub: &#8220;the rest of Unicode&#8221; is an expanding set and when it passed a certain boundary UTF-8 needed 4 bytes to handle it. Let&#8217;s have an example:</p>
<p><code><br />
1 byte  (0000-007F): "A"  ➔ 0x41<br />
2 bytes (0080-07FF): "Ж" ➔ 0xD0 0x96<br />
3 bytes (0800-FFFF): "龍" ➔ 0xE9 0xBE 0x8D<br />
4 bytes (&gt; FFFF)   : "𐐒" ➔ 0xF0 0x90 0x90 0x92</code></p>
<p>As you can see above, that last character takes 4 bytes in UTF-8 while MySQL only expects 1-3 bytes per character. Without getting into too many Unicode details it&#8217;s important for our discussion to know that the Unicode characters are logically divided into &#8220;<a href="http://en.wikipedia.org/wiki/Unicode_plane">planes</a>&#8220;. The first plane is the Basic Multilingual Plane (BMP) and what you probably think of as &#8220;Unicode&#8221;. This is all of the characters between <code>U+0000</code> and <code>U+FFFF</code> and covers most of the characters for the major languages of the world. When Unicode starting using the additional planes it started addressing characters beyond <code>U+FFFF</code> and UTF-8 expanded to handle that.</p>
<p>The MySQL 5.1 <code>CHARSET</code> &#8220;<code>utf8</code>&#8221; and the <code>utf8_*</code> collations were only able to handle 1-3 bytes so they had to do something. That something was mentioned depends on your client driver. In Ruby the insert succeeds but the data is discarded. In Java an exception is thrown, which at least alerts you to the problem. With the addition of <a href="http://en.wikipedia.org/wiki/Emoji">Emoji</a> in Unicode 6.0 this problem has a very high profile failure case when the text is Emoji-only. For Japanese mobile phone users this not an uncommon use case, and you can expect it to get more common in the US very soon.</p>
<h3>The problem with accents</h3>
<p>The problem I mentioned above with accent changes not taking effect is actually a configuration problem rather than a MySQL bug. This has to do with the common misunderstandings around MySQL collation and specifically the <code>utf_general_ci</code>/<code>utf_uncode_ci</code> collation sequences. This is probably best illustrated with an example:</p>
<p><code><br />
mysql&gt; select "bar" = "bär" COLLATE utf8_unicode_ci\G<br />
*************************** 1. row ***************************<br />
"bar" = "bär" COLLATE <strong>utf8_unicode_ci: 1</strong><br />
mysql&gt; select "bar" = "bär" COLLATE utf8_general_ci\G<br />
*************************** 1. row ***************************<br />
"bar" = "bär" COLLATE <strong>utf8_general_ci: 1</strong><br />
mysql&gt; select "bar" = "bär" COLLATE utf8_bin\G<br />
*************************** 1. row ***************************<br />
"bar" = "bär" COLLATE <strong>utf8_bin: 0</strong><br />
</code></p>
<p>If your default collation is <code>utf_general_ci</code> or <code>utf_uncode_ci</code> then your database thinks &#8220;bar&#8221; and &#8220;bär&#8221; are the same word. If you have unique constraints on a column this is clearly problematic but this can also cause problems without that. This is the root cause of the &#8220;accent changes won&#8217;t save&#8221; problem. When updating a record it appears MySQL (or at least InnoDB) checks for equality before updating a record. Since and accent-only change is considered equal by the collation MySQL skips the write (which saves I/O overhead) and returns success since it thinks it optimized a write rather than failing.</p>
<p>English speaking developers very often assume that MySQL is mature and will &#8220;just work&#8221; in every language. The default character set for MySQL is <code>latin1</code> (rather than <code>utf8</code>) and many developers have learned to dutifully change that to <code>utf8</code> and <code>utf8_general_ci</code> when they install MySQL. This change fixes a large swath of issues but leaves behind these much more subtle bugs.</p>
<h2>The MySQL 5.1 guidelines and work arounds</h2>
<p>If you need to stay on MySQL 5.1 there are a few things worth keeping in mind.</p>
<ul>
<li>Using <code>utf8_bin</code> for collation will solve the accent issues, which is probably what you thought the other <code>utf8_*</code> collations where doing. The downside to this is that <code>utf8_bin</code> and <code>ORDER BY</code> will not be in language-specific order. You&#8217;ll have to make the choice for yourself depending on your needs but my advice would be that if you don&#8217;t know you should go with <code>utf8_bin</code>.</li>
<li>If you want to fully support non-BMP characters your only recourse is to convert your <code>char</code>/<code>varchar</code> column in question to a <code>binary</code>/<code>varbinary</code> and make sure you handle the character encoding correctly on the way in and out. If you use UTF-8 be sure to allow 4 bytes per character (as discussed above). If you use UTF-16, make sure you allow 4-bytes to handle <a href="http://en.wikipedia.org/wiki/Mapping_of_Unicode_characters#Surrogates">surrogate pairs</a>. The downside to this is the subtle differences in how <a href="http://dev.mysql.com/doc/refman/5.1/en/binary-varbinary.html">binary and varbinary columns</a> are stored and you should fully understand that and the performance implications before making any changes.</li>
</ul>
<h2>The MySQL 5.5 fix</h2>
<p>MySQL 5.5 was just released with new character sets for <code>utf8mb4</code>, <code>utf16</code> and <code>utf32</code>. While <code>utf16</code> and <code>utf32</code> support is certainly welcomed I want to focus on <code>utf8mb4</code> since my assumption is that you want ASCII compatibility. The newly added <a href="http://dev.mysql.com/doc/refman/5.5/en/charset-unicode-utf8mb4.html"><code>utf8mb4</code></a> character set is a superset of the <code>utf8</code> character set that can store up to 4 bytes per character. With 4 bytes per character <code>utf8mb4</code> should be able to store all 16 planes, including planes 4-13 which are currently empty and given the known writing systems in the world are not expected to be filled.</p>
<p>The addition of <code>utf8mb4</code> makes me breath a little easier. You still have to know your collations to not reproduce the accent problem but I trust you can remember that small piece of Unicode/MySQL knowledge. If not, maybe you&#8217;ll google again in the future an find this handy command:</p>
<blockquote><p><code>ALTER TABLE table_name CONVERT TO CHARACTER SET utf8mb4 COLLATE utf8mb4_bin;</code></p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/133/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/133/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/133/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=133&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2010/12/28/mysql-and-unicode/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>
	</item>
		<item>
		<title>MC Hammer showed me the future of Twitter</title>
		<link>http://mzsanford.wordpress.com/2010/12/22/mc-hammer-showed-me-the-future-of-twitter/</link>
		<comments>http://mzsanford.wordpress.com/2010/12/22/mc-hammer-showed-me-the-future-of-twitter/#comments</comments>
		<pubDate>Thu, 23 Dec 2010 01:27:29 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Culture]]></category>
		<category><![CDATA[Twitter]]></category>

		<guid isPermaLink="false">http://mzsanford.wordpress.com/?p=131</guid>
		<description><![CDATA[If you&#8217;ve seen me talk at a conference or meet-up about Twitter you&#8217;ve likely heard about MC Hammer (@mchammer on Twitter). Well, since I don&#8217;t do that many speaking engagements I wanted to take a moment and record my story about about what MC Hammer taught me about Twitter … and I already worked there. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=131&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;ve seen me talk at a conference or meet-up about Twitter you&#8217;ve likely heard about MC Hammer (<a href="http://twitter.com/mchammer">@mchammer</a> on Twitter). Well, since I don&#8217;t do that many speaking engagements I wanted to take a moment and record my story about about what MC Hammer taught me about Twitter … and I already worked there.</p>
<p><span id="more-131"></span></p>
<h2>The Twitter HQ Visit</h2>
<p>In May of 2009 I had been working for Twitter for long enough that the then-common celebrity visits to HQ didn&#8217;t seem out of the ordinary. Having said that, I worked remotely so these visits always seemed like an exotic treat when they coincided with my trips to SF. It was only the second time only of these visits was scheduled during one of my SF trips and it was going to be MC Hammer. To be honest I wasn&#8217;t an MC Hammer fan even when he was huge and I thought it seemed like it was going to be a bit dull. I could not have been more wrong.</p>
<p>MC Hammer started by talking about his own use of Twitter. He was one of our earliest high-profile users and we all knew he was an avid user. He is an amazing speaker and kept a group who were probably not fans glued to the talk. Hearing people tell the stories about how they use Twitter is always interesting. Most people stop at how they use it but Hammer talked about how he saw it changing the very business he was in. To explain that, let me follow the line of thought he had at the time.</p>
<h2>Hammer&#8217;s Tale (my recollection, anyhow)</h2>
<p>If you&#8217;re making a music video you can <a title="#7 is MC Hammer" href="http://en.wikipedia.org/wiki/List_of_most_expensive_music_videos" target="_blank">spend quite a bit of money</a>, and that is money spent by you and/or your label (if your label spends it you can bet they are going to want that back before you get paid). Now, you&#8217;ve spent this money and made a video which you then <em>give</em> to MTV. What does MTV do? They run your video surrounded by ads, for which they get paid. On cable networks who pay to carry the channel. The only way that money makes it back to the person who paid for and created the video is through exposure. Well, money that comes in that way passes through a great many hands.</p>
<ul>
<li><strong>Albums?</strong> Promotion, packaging and distribution take a chunk of that. Check out <a title="How music royalties work" href="http://entertainment.howstuffworks.com/music-royalties6.htm" target="_blank">how that all works</a>.</li>
<li><strong>Tours?</strong> It turns out carting all of that stuff around is expensive. Venues are expensive. And TicketMaster™, just like MTV, are making money on both sides.</li>
</ul>
<p>Hammer has often rocked the boat in which the music industry sits, like providing <a href="http://venturebeat.com/2008/06/04/mc-hammer-offers-entrepreneurial-advice-to-intel-capitals-ceos/" target="_blank">advice to the Napster founder</a>, and his feelings about TicketMaster™ were clearly of the same bent. Hammer, mobile phone in hand said (and I paraphrase),</p>
<blockquote><p>&#8220;There will come a time when I can go to a stadium owner and say I want to put on a concert – ok, maybe not me, I&#8217;m not going to be playing stadiums, but Bruce Springsteen. Anyway: Bruce will say he can sell all of the tickets in the whole place with one Tweet [hold up his phone]. We don&#8217;t need any TicketMaster™. No booking agent. Just you, me and my followers buying tickets. Now, what kind of a deal will you give me on the concessions?&#8221;</p></blockquote>
<p>During the Q&amp;A someone pointed out that the Bruce Springsteen story expected every artist to also be business savvy, which is unrealistic. Hammer&#8217;s response, which will stick with me, was that there will always be agents and managers, &#8220;There is always someone willing to do work like that for 20% of your take&#8221;. In May of 2009 I thought this sounded really far fetched. I believed in our product but I never thought there would be a time where we could do anything like this.</p>
<h2>Enter the Future</h2>
<p>Time passed, I worked hard, and then Conan O&#8217;Brien came along. Conan sent a <a title="Hey Internet: I'm headed to your town on a half-assed comedy &amp; music tour. Go to http://TeamCoco.com for tix. I repeat: It's half-assed." href="http://twitter.com/#!/conanobrien/status/10326418664" target="_blank">tweet</a> with a link to buy tickets to his upcoming live comedy tour. Within hours the tickets were sold out. This didn&#8217;t buy-pass traditional ticket agents, but there is no reason it couldn&#8217;t have. This was only half way to the future Hammer talked about but it was the half I was (and still am) working on so it speaks to me. I am certainly convinced that Hammer was on to something. So this has left me feeling that Twitter will do more in the future than I can foresee today. But my main lesson is this:</p>
<blockquote><p>TicketMaster™, watch your back … Justin Bieber doesn&#8217;t need you.</p></blockquote>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/131/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/131/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/131/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=131&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2010/12/22/mc-hammer-showed-me-the-future-of-twitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>
	</item>
		<item>
		<title>Grease Monkey programming for #NewTwitter</title>
		<link>http://mzsanford.wordpress.com/2010/09/19/grease-monkey-for-newtwitter/</link>
		<comments>http://mzsanford.wordpress.com/2010/09/19/grease-monkey-for-newtwitter/#comments</comments>
		<pubDate>Sun, 19 Sep 2010 23:47:20 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Programming]]></category>

		<guid isPermaLink="false">http://mzsanford.wordpress.com/?p=121</guid>
		<description><![CDATA[The new Twitter redesign (#NewTwitter) introduced a Details Pane for Tweets. This is a great way to add context to Tweets but it only launched with a limited partners. This post goes into how to use Grease Monkey to add support for img.ly as an example of what you can do.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=121&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>So the new Twitter redesign (a.k.a. #NewTwitter) is out in the wild at last, even if it&#8217;s only a small percentage of users. Soon enough we&#8217;ll all have access but even before that I wanted to write about customizing #NewTwitter using Grease Monkey. Much has been said about the new right side &#8220;Detail Pane&#8221; real estate as a platform but I don&#8217;t know about any of that. I suspect that annotations and the Details Pane will be a match made in heaven but that&#8217;s not something I heard at the office, just my personal view as a former Platform team member, and former 3rd party Twitter developer. What I&#8217;m interested in <em>right now</em> is customizing the Details Pane for myself using Grease Money.</p>
<p><span id="more-121"></span></p>
<p>I know that Twitter had to limit who they display content from for a myriad of reasons. I&#8217;m not privy to the reasons but I know from the public discussion around <a href="http://www.avc.com/a_vc/2010/04/the-twitter-platform.html">previous blog posts</a> that Twitter is sensitive about injuring 3rd party developers. When it comes to mash-ups, which is essentially what this is, most developers I know would argue that any site with an open API is fair game. With that moral relativism out of the way I&#8217;ll get down to the business at hand.</p>
<h2>Adding a new media type</h2>
<p>Maybe your you and your friends use an unsupported photo posting site. Maybe it&#8217;s video. Maybe it&#8217;s something I haven&#8217;t yet thought of. Whatever it is, here is an example of adding a new media hosting site. This specific technique works with any site providing content from a URL based on the short-url component. For my example I&#8217;m using images from the image hosting site img.ly. I&#8217;ll start with a code listing and then break it down:</p>
<pre>// ==UserScript==
// @name          Twitter Details Pane - Media Type support example
// @namespace     http://mzsanford.com/
// @description   Example script to display a spcific media type
// @include       http://twitter.com/*
// @include       https://twitter.com/*
// ==/UserScript==

(function(){

    window.addEventListener('load', function() {
      unsafeWindow.twttr.mediaType('twttr.media.types.Imgly')

      .url('http://img.ly')
      .matcher(/\b(?:https?\:\/\/)?img\.ly\/(\S+)/g)

      .icon('photo')

      .process(function(slug, cb) {
        slug = slug.replace(/\/$/, '');
        this.data["id"] = slug;
        cb();
      })

      .methods({
        html: function(cb) {
          var t = '&lt;img src="http://img.ly/show/medium/{id}" /&gt;'
          cb(unsafeWindow.twttr.supplant(t, this.data));
        }
      });
    }, true);
})();</pre>
<p>I&#8217;m going to skip the Grease Monkey boiler plate and get right to line 11. You can&#8217;t call into the #NewTwitter Javascript environment until it&#8217;s loaded (duh) so I setup a window load handler to run my code. Now the magic begins. Using some information <a href="http://twitter.com/hoverbird">@hoverbird</a> <a href="http://gist.github.com/584797">posted on GitHub</a> and Grease Monkey&#8217;s unsafeWindow I was able to execute my own Javascript code in the #NewTwitter environment. This code uses Twitter&#8217;s twttr.MediaType system to register a new URL pattern and how it is displayed.</p>
<p>The  url() and matcher() functions seem pretty straight forward with the additional note that parentheses in the matcher pattern can be accessed by the process function. The icon() function takes one of three values: &#8216;photo&#8217; (the little picutre), &#8216;video&#8217; (which looks like film) and &#8216;generic&#8217; (a little generic page icon) and is displayed on the timeline. The process function is run for the timeline entries and where you can stash away infomation found in the URL match for later on. And lastly the html method (defined using this odd methods({}) syntax) is where the actual data is rendered in the Details Pane.</p>
<p>If you had a JSONP API to work with you would want to make your call in the html method since it called when the Detail Pane is rendered. Calling in the process method would create a bunch of load on the other API for Tweets that the user never clicks on. That&#8217;s not how friendly neighbors work.</p>
<p>Hopefully that was at least a little helpful for developing Grease Monkey scripts that work with #NewTwitter. I am also working on Details Pane interaction without a timeline icon but that will have to wait for a future post. If you have a suggested API to use for my next example (JSONP is easiest) drop a comment at the bottom.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/121/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/121/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/121/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=121&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2010/09/19/grease-monkey-for-newtwitter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>
	</item>
		<item>
		<title>My life in the start up arc</title>
		<link>http://mzsanford.wordpress.com/2010/08/12/my-life-in-the-start-up-arc/</link>
		<comments>http://mzsanford.wordpress.com/2010/08/12/my-life-in-the-start-up-arc/#comments</comments>
		<pubDate>Thu, 12 Aug 2010 17:06:18 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">http://mzsanford.wordpress.com/?p=81</guid>
		<description><![CDATA[After two years with a start up I'm looking back on how things have changed. This is a public journal entry to myself about how start ups begin free, create a mess, and then clean it up. Most of all, it's about how that's all a Good Thing™. More change is certain to come, and I'm sure in two more years I'll look back on this post as naïve.<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=81&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been working for a pretty early stage and popular start up for a few years now and I&#8217;ve learned some things. None of what I&#8217;ve learned is news to people who have been through the start up mania, and I bet there are better posts out there on the internet. These are my personal ramblings about my experience and might not reflect anyone else&#8217;s experience. Having said that, when I was making my decision to join a start up I wanted an informal description of this arc and all I found where venture capitalists and people yearning for the bygone &#8217;90&#8242;s bubble. I&#8217;m neither of those. I&#8217;m just a guy who likes to play with badly formed analogies.</p>
<p>Start up life is complicated so no one analogy really explains it all. Instead I&#8217;ve opted to break it into three phases, all alike in dignity. It&#8217;s not like there is a day where you switch from one phase to the next … and I&#8217;m not even sure I could spot these again if I were in the middle of them. This is a hindsight look at the last two years. The craziest and possibly best years I&#8217;ve known.<br />
<span id="more-81"></span></p>
<h1>It All Starts with Prometheus</h1>
<p style="clear:both;">When Prometheus stole fire from the gods he didn&#8217;t sell it to his neighbor. He didn&#8217;t barter with it or tell the person next to him about &#8220;<em>the exciting investment opportunities in state-of-the-art home heating and illumination</em>&#8220;. No, he <strong>gave</strong> it to humanity. I joined a start-up when it was still very small and making no money at all. At the same time we were becoming quite popular and busily working to stay online. I&#8217;m not saying we brought something as critical as fire to man, but what I am saying is that we didn&#8217;t show up looking like P.T. Barnum and trying to bilk the suckers. We showed up with what we could muster and gave it up for people to use as they like. And boy did they use it … and in ways we never imagined. Looking back on it the Prometheus myth would be more fitting if he was burned badly while delivering fire to man, but that&#8217;s another story.</p>
<p style="clear:both;">To me the point is that it starts with an idea, yearning to spread, and making that idea available for free is a good start. Selfishly: you are more free to experiment when money isn&#8217;t your biggest worry. Pragmatically: Building a product people love will result in more people spending time with your product and becoming the people to whom you market your money-making idea. Bring the fire for free now and when you see they use it to see in the dark start making oil lamps to sell (or stoves to cook).</p>
<h1>On to the Industrial Revolution</h1>
<p style="clear:both;">It&#8217;s hard to think of the Industrial Revolution without thinking of profit and loss, especially after the &#8220;free fire&#8221; talk above but that&#8217;s what I need to ask you to do. Trust me, we&#8217;re still in the free period of the start up product but the Industrial Revolution has a good lesson. This phase of the arc is about the accumulation of &#8220;<a href="http://en.wikipedia.org/wiki/Technical_debt"><strong>technical debt</strong></a>&#8220;.</p>
<p style="clear:both;">During the Industrial Revolution the skies were filled with black smoke from coal fires. Those coal fires were powering some of the greatest inventions of the 18th and 19th centuries and altered the lives of the people living in those times, and the history of the world in some cases. The focus of all manufacturers was getting their product out to the people, often ignoring any consequences. Start ups are less reckless and unlike Industrial Revolution factories they don&#8217;t endanger workers&#8217; lives or the environment, but they leave a wake of refuse all the same. That refuse is called &#8220;technical debt&#8221; and is sometimes the code left over by late-night, under-fire fixes but more often than not it is the design work done when the product was being use differently that it would end up being used in the end.</p>
<p style="clear:both;">This filling of your office sky with coal smoke is a good thing, actually. While there will be a time when you look back on it and realize you were rash, I would argue you could never have made it to that vantage point without a little rash action.</p>
<h1>Renewable Energy: The Promised Land</h1>
<p style="clear:both;">I&#8217;ll tie the second and third phases of this arc together, since they&#8217;re very related. In the real worlds there came a point where we started to talk about &#8220;peak oil&#8221; and &#8220;climate change&#8221; and ever since then we&#8217;ve looked back on the Industrial Revolution like a youthful indiscretion. Something we would do better if we had it to do again. We&#8217;ve more or less painted ourselves into a corner when it comes to energy and environmental issues and now we&#8217;re trying to fix it. Start ups are no different in my experience.</p>
<p style="clear:both;">During the &#8220;Industrial Revolution&#8221; phase of the start up there was furious design and implementation work. We didn&#8217;t completely know where we were headed but we knew we wanted to get there and find out. Now that we&#8217;ve reached a point where we can see what the product is we can look back over the scorched earth behind us and wonder what we were thinking. Well, if we were busy wondering back then we wouldn&#8217;t be able to think about how to fix it, we would have failed, so I&#8217;m glad we did what we need to survive.</p>
<p style="clear:both;">So we&#8217;re in search of the promised land of renewable energy, but unlike the real world we can cleanup all of the mess we&#8217;ve made. We want something that does not pollute our experience (or code base) but can sustain itself. This means fixing the things we&#8217;ve created in haste, turning a good product into a sustainable business, and continuing to do what made us a success: focusing on users. We have a group of great people evaluating a bevy of great options and I believe we&#8217;ll manage a balance we can be proud of. Maybe in the future I&#8217;ll add a fourth phase about utopia … or the after life. My bet is on utopia but life can be unpredictable.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/81/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/81/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/81/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=81&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2010/08/12/my-life-in-the-start-up-arc/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>
	</item>
		<item>
		<title>The Honest Omnivore</title>
		<link>http://mzsanford.wordpress.com/2010/05/16/the-honest-omnivore/</link>
		<comments>http://mzsanford.wordpress.com/2010/05/16/the-honest-omnivore/#comments</comments>
		<pubDate>Sun, 16 May 2010 03:51:56 +0000</pubDate>
		<dc:creator>mzsanford</dc:creator>
				<category><![CDATA[Culture]]></category>

		<guid isPermaLink="false">https://mzsanford.wordpress.com/?p=98</guid>
		<description><![CDATA[I have many friends who are vegetarian to one degree or another and I&#8217;m happy to accommodate that. I respect their choice in the same way they respect mine. In asking around about people&#8217;s dietary restrictions over the years I&#8217;ve found a group who annoy me: The Dishonest Omnivore. I am an omnivore and I&#8217;m [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=98&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I have many friends who are vegetarian to one degree or another and I&#8217;m happy to accommodate that. I respect their choice in the same way they respect mine. In asking around about people&#8217;s dietary restrictions over the years I&#8217;ve found a group who annoy me: The Dishonest Omnivore.</p>
<p>I am an omnivore and I&#8217;m not ashamed. I&#8217;m also not squeamish about where my food comes from. I know that pork used to be a pig, beef a cow. I can&#8217;t say I love the feel of raw chicken in my hands. What I can say is that I like the taste of chicken more than I dislike dealing with it in the raw … and because of that I&#8217;m unashamed to be an omnivore.</p>
<p><span id="more-98"></span></p>
<h1>Burgers Shaped Like Cows</h1>
<p>Anybody who has talked about food with me has heard my rant about burgers shaped like cows. Well, that pretty much the gist of this post and it sums up my feelings. If you order a hamburger you need to be comfortable with the fact you&#8217;re eating what was formerly a cow (or, depending on where you order it, several different cows). If you ordered and someone told you the cow&#8217;s name was &#8220;Bessy&#8221;, would you order something else? If so, perhaps vegetarianism is for you. Vegetarian food is just as tasty, sustaining and filling as the omnivore diet.</p>
<p>As time has progressed we&#8217;ve become farther and farther removed from the source of our food. Where our parent or grandparents might have raised live stock, today the vast majority of us don&#8217;t have that sort of connection to our food source. There has been a local food movement brewing, mostly focused on fruits and vegetables. This movement has been about distance in the traditional land area sense … I want less distance in the mental sense. I want to think about the previous form of my food. Be it vegetable:</p>
<p><a href="http://mzsanford.files.wordpress.com/2010/05/800px-brusselssprouts-onvine.jpg"><img class="aligncenter size-medium wp-image-104" title="Brussels Sprouts on the Vine" src="http://mzsanford.files.wordpress.com/2010/05/800px-brusselssprouts-onvine.jpg?w=300&#038;h=194" alt="Brussels Sprouts on the Vine" width="300" height="194" /></a></p>
<p>or animal:</p>
<p><a href="http://mzsanford.files.wordpress.com/2010/05/500px-british_pork_cuts-svg.png"><img class="aligncenter size-medium wp-image-105" title="British Pork Cuts" src="http://mzsanford.files.wordpress.com/2010/05/500px-british_pork_cuts-svg.png?w=300&#038;h=155" alt="British Pork Cuts" width="300" height="155" /></a></p>
<p>But let&#8217;s be honest – nobody is squeamish about what a vegetable looked like in the field.</p>
<br />  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/mzsanford.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/mzsanford.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/mzsanford.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/mzsanford.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/mzsanford.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/mzsanford.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/mzsanford.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/mzsanford.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/mzsanford.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/mzsanford.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/mzsanford.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/mzsanford.wordpress.com/98/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/mzsanford.wordpress.com/98/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/mzsanford.wordpress.com/98/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=mzsanford.wordpress.com&amp;blog=2061461&amp;post=98&amp;subd=mzsanford&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://mzsanford.wordpress.com/2010/05/16/the-honest-omnivore/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/e064beb9dde96716d9d141b1ac0eb372?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=PG" medium="image">
			<media:title type="html">mzsanford</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2010/05/800px-brusselssprouts-onvine.jpg?w=300" medium="image">
			<media:title type="html">Brussels Sprouts on the Vine</media:title>
		</media:content>

		<media:content url="http://mzsanford.files.wordpress.com/2010/05/500px-british_pork_cuts-svg.png?w=300" medium="image">
			<media:title type="html">British Pork Cuts</media:title>
		</media:content>
	</item>
	</channel>
</rss>
