<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><atom:link rel="hub" href="http://tumblr.superfeedr.com/" xmlns:atom="http://www.w3.org/2005/Atom"/><description>
var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

try {
var pageTracker = _gat._getTracker("UA-256794-6");
pageTracker._trackPageview();
} catch(err) {}</description><title>Ethan Herdrick</title><generator>Tumblr (3.0; @herdrick)</generator><link>http://herdrick.tumblr.com/</link><item><title>Interest in Spark waning lately? (April 2013)</title><description>&lt;p&gt;&lt;a href="http://spark-project.org/"&gt;Spark&lt;/a&gt; is far easier to work with than Hadoop, and better for rapid development. Excellent! But the community of Hadoop users is probably two orders of magnitude bigger. That&amp;#8217;s bad for Spark. But is the Spark community growing fast enough to make that soon irrelevant?&lt;/p&gt;

&lt;p&gt;I counted new topics on the Spark users Google &lt;a href="http://groups.google.com/group/spark-users"&gt;Group&lt;/a&gt; by time period.&lt;/p&gt;

&lt;table border="0" cellpadding="0" cellspacing="0" width="196" style="border-collapse:   collapse;table-layout:fixed;width:196pt"&gt;&lt;col width="131" style="mso-width-source:userset;mso-width-alt:5589;width:131pt"&gt;&lt;col width="65" style="width:65pt"&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;All of 2011&lt;/td&gt;
  &lt;td align="right" style="width:65pt; width: 65px;"&gt;2&lt;/td&gt;
 &lt;/tr&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;Aug 2012&lt;/td&gt;
  &lt;td align="right"&gt;1&lt;/td&gt;
 &lt;/tr&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;Sept 2012&lt;/td&gt;
  &lt;td align="right"&gt;0&lt;/td&gt;
 &lt;/tr&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;Oct 2012&lt;/td&gt;
  &lt;td align="right"&gt;1&lt;/td&gt;
 &lt;/tr&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;Nov 2012&lt;/td&gt;
  &lt;td align="right"&gt;5&lt;/td&gt;
 &lt;/tr&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;Dec 2012&lt;/td&gt;
  &lt;td align="right"&gt;8&lt;/td&gt;
 &lt;/tr&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;Jan 2013&lt;/td&gt;
  &lt;td align="right"&gt;5&lt;/td&gt;
 &lt;/tr&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;Feb 2013&lt;/td&gt;
  &lt;td align="right"&gt;101&lt;/td&gt;
 &lt;/tr&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;March 2013&lt;/td&gt;
  &lt;td align="right"&gt;150&lt;/td&gt;
 &lt;/tr&gt;&lt;tr style="height:15.0pt"&gt;&lt;td style="height:15.0pt; height: 15px;"&gt;April 2013&lt;/td&gt;
  &lt;td align="right"&gt;89 (on track for 125)&lt;/td&gt;
 &lt;/tr&gt;&lt;/table&gt;&lt;p&gt;&lt;br/&gt;I was loving that growth until April. It may be that this group didn&amp;#8217;t became the home of the community until February, meaning that March is the first full month that can be measured. Whether that&amp;#8217;s true or not, as of April 22, April is on track to see fewer new threads than March.&lt;/p&gt;

&lt;p&gt;New questions on StackOverflow with Hadoop or Hadoop family tags are at ~135 in the past seven days, a monthly rate of 540. So far there are zero Spark or Shark questions on SO.&lt;/p&gt;

&lt;p&gt;(Actually it&amp;#8217;s much worse than that.  There are some questions on SO about other Shark projects, especially a new Flash/Flex framework by that name. This illustrates the awfulness of the name &amp;#8216;Spark&amp;#8217;.  BDAS really blew it in giving their project a name that is a common English word. But that is another post.)&lt;/p&gt;

&lt;p&gt;So I am not yet seeing exponential growth in the Spark community. Let&amp;#8217;s hope that changes.&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/48639208685</link><guid>http://herdrick.tumblr.com/post/48639208685</guid><pubDate>Mon, 22 Apr 2013 14:34:00 -0700</pubDate></item><item><title>Best thing I've read all month</title><description>&lt;a href="https://medium.com/thoughts-on-creativity/bad7c34842a2"&gt;Best thing I've read all month&lt;/a&gt;: &lt;p&gt;&lt;blockquote&gt;
Charles Dickens, rejecting an invitation from a friend: “‘It is only half an hour’ — ‘It is only an afternoon’ — ‘It is only an evening,’ people say to me over and over again; but they don’t know that it is impossible to command one’s self sometimes to any stipulated and set disposal of five minutes — or that the mere consciousness of an engagement will sometime worry a whole day … Who ever is devoted to an art must be content to deliver himself wholly up to it, and to find his recompense in it. I am grieved if you suspect me of not wanting to see you, but I can’t help it; I must go in my way whether or no.”
&lt;/blockquote&gt;&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/45777318525</link><guid>http://herdrick.tumblr.com/post/45777318525</guid><pubDate>Tue, 19 Mar 2013 13:36:30 -0700</pubDate></item><item><title>The boat engine is worth 33,500 Egyptian slaves</title><description>&lt;p&gt;&lt;img alt="image" src="http://media.tumblr.com/b317408e3a1c4c848dbf6b9674a17a08/tumblr_inline_mjk1yzxo5C1qz4rgp.jpg"/&gt;&lt;br/&gt;
In &lt;a href="http://herdrick.tumblr.com/post/45297680351/1998-google-was-worth-1-838-389-workers-maybe"&gt;1998 Google was worth 1,838,389 workers&lt;/a&gt; I proposed measuring the worth of innovations by estimating the equivalent amount of labor &amp;#8216;saved&amp;#8217; by using them. But how about the great rapid transportation innovations of the 20th century? Surely those can&amp;#8217;t be reduced to human power. Much like you can&amp;#8217;t make a baby in one month with nine women, no amount of people can make a vehicle go faster than a running human, right? No. You can do it, and with that insight I&amp;#8217;ll show you what the human labor equivalent of a 5 horsepower Evinrude boat engine would be in ancient Egypt.
In America, pulling a canal barge with horses or &lt;a href="http://www.youtube.com/watch?v=OidGQ1f9TRs" title="Bruce Springsteen explains 19th century freight transport"&gt;mules&lt;/a&gt; on the banks was how midwest grain and beef got from the Great Lakes (and so the entire upper midwest) to the Atlantic. But in some sad times and places, labor was so cheap that &lt;a href="http://en.wikipedia.org/wiki/Barge_Haulers_on_the_Volga" title="Barge Haulers on the Volga"&gt;humans&lt;/a&gt; were riverside draft animals &lt;sup id="fnref:p45193590173-f1"&gt;&lt;a href="#fn:p45193590173-f1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt;. There&amp;#8217;s even a name for that job in Russian: Burlak.&lt;/p&gt;

&lt;p&gt;Lots of burlaks meant you could haul lots of freight. But with a rope gear - just two spools of different radii ganged together - on an anchored axle you could &amp;#8220;gear up&amp;#8221; to convert their slow, strong force to a fast weak one. A series of these rigs on the banks of a river, could, with coordination, pull a long, shallow draft boat quickly and continuously.
How many burlaks would you need? Let&amp;#8217;s say you&amp;#8217;ll need 5 horsepower, sustained. I&amp;#8217;m pretty sure I could get a long slim, light riverboat with a light load to 20 knots with a 5-horse Evinrude. A person can produce, in a short burst, &lt;a href="http://en.wikipedia.org/wiki/Horsepower"&gt;1.2 horsepower&lt;/a&gt;. Friction between the spool and the axle would eat up some of that, but then the boat engine loses a lot of power to turbulance around the prop, too. So let&amp;#8217;s say we need four burlaks pulling at maximum effort at all times.
The ancient Egyptians were fine rope-makers - it looks like they could make 100 meter rope strong enough. &lt;sup id="fnref:p45193590173-f2"&gt;&lt;a href="#fn:p45193590173-f2" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt; Experience suggests that 5 knots (~5 mph or 8 kph) is about the ideal speed for a human to generate maximum power - think of a footbal or rugby player driving an opponent backward. That&amp;#8217;s 1/4 the speed we want our boat to go, so the right gearing would have our burlaks surge forward only 25 meters while the boat they are pulling covers 100 meters. Our rig will need 125 meters of rope - call it 150 meters just in case. We&amp;#8217;ll need one of these rigs (a large double spool anchored into the ground, 150 meters of rope, and 5 burlaks) every 100 meters of the trip - about 6700 of them over the 667 kilometers between Luxor and Alexandria. That&amp;#8217;s 33500 burlaks.  &lt;sup id="fnref:p45193590173-f3"&gt;&lt;a href="#fn:p45193590173-f3" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;So if we waive the manufacturing costs of the outboard engine and the rope-spool-axle system (and the work needed to supply gasoline for the motor and food for the burlaks), the 5 horsepower outboard engine &lt;sup id="fnref:p45193590173-f4"&gt;&lt;a href="#fn:p45193590173-f4" rel="footnote"&gt;4&lt;/a&gt;&lt;/sup&gt;, when plopped down into ancient Egypt, does the work of about 33,500 slaves. &lt;sup id="fnref:p45193590173-f5"&gt;&lt;a href="#fn:p45193590173-f5" rel="footnote"&gt;5&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;&lt;img src="http://media.tumblr.com/216f60a8bdf613d78553c5854e454407/tumblr_inline_mjplpmBr701qz4rgp.jpg" alt="image"/&gt;&lt;/span&gt; &lt;span&gt; &lt;img alt="image" src="http://media.tumblr.com/44de5376fa241184fc28c349407498cd/tumblr_inline_mjplncuaZJ1qz4rgp.jpg"/&gt;&lt;/span&gt;&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;&lt;/p&gt;

&lt;div class="footnotes"&gt;
&lt;hr&gt;&lt;ol&gt;&lt;li id="fn:p45193590173-f1"&gt;
&lt;p&gt;On the &lt;a href="http://en.wikipedia.org/wiki/File:1875_bridgman_scene_de_halage_sur_le_nil_01.jpg" title="Towing on the Nile"&gt;Nile&lt;/a&gt; in fact. &lt;a href="#fnref:p45193590173-f1" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45193590173-f2"&gt;
&lt;p&gt;The spool size needed seems reasonable for the ancients, too: 19&amp;#160;mm for rope thickness, and 15 inches, 12 inches, and 20 inches for the traverse, barrel diameter, and flange diameter, respectively, gives you a capacity of &lt;a href="http://www.timbercon.com/spools-and-reels-calculator/"&gt;137 meters&lt;/a&gt; of rope. Close enough. &lt;a href="#fnref:p45193590173-f2" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45193590173-f3"&gt;
&lt;p&gt;This setup is good for more than just the occasional trip by the Pharoah. The burlaks should be able to go all out at least four times an hour, leaving some time to pull the rope back off the spool and lay it out in place, throughout a burlak&amp;#8217;s 15 hour day. That&amp;#8217;s 60 trips / day on the trans-Nile high speed boating system. You could use it to go in either direction, although some boats would have to wait in places. &lt;a href="#fnref:p45193590173-f3" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45193590173-f4"&gt;
&lt;p&gt;Of course the outboard is worth more as you could use it to cross the Nile, not just go down- or up-river. So we haven&amp;#8217;t completely found the human labor equivalent of the outboard. &lt;a href="#fnref:p45193590173-f4" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45193590173-f5"&gt;
&lt;p&gt;I put the painting of burlaks at the top because it&amp;#8217;s famous and relevant. But I included photos at the bottom because they are just so tragic. God, human draft animals - the ultimate result of cheap labor. Is there any surer sign that your society has gone wrong? &lt;a href="#fnref:p45193590173-f5" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;&lt;/div&gt;</description><link>http://herdrick.tumblr.com/post/45193590173</link><guid>http://herdrick.tumblr.com/post/45193590173</guid><pubDate>Fri, 15 Mar 2013 09:00:00 -0700</pubDate></item><item><title>Google was worth 1,838,389 workers in 1998, maybe</title><description>&lt;p&gt;What is an innovation worth? I&amp;#8217;m not asking how much money it makes, because that&amp;#8217;s just part of it. To take an extreme example, if you give an invention away to the public it can still provide value to people, it&amp;#8217;s just that you&amp;#8217;re not getting any of it, or no more than anyone else. But the cash value of the uncaptured part is notoriously hard to quantify. How about a different approach?&lt;/p&gt;

&lt;p&gt;Human labor has always been a fundamental good. And lots of new technologies have been called &amp;#8220;labor saving devices&amp;#8221;. If we can figure out a way to calculate an innovation&amp;#8217;s equivalent in human work, we&amp;#8217;d have a measure that works across history, even prehistory. Plus we wouldn&amp;#8217;t care if the invention was &amp;#8216;monetizable&amp;#8217;, ex. whether it appeared in a period with a legal system defending private property and maybe patents. &lt;sup id="fnref:p45297680351-f1"&gt;&lt;a href="#fn:p45297680351-f1" rel="footnote"&gt;1&lt;/a&gt;&lt;/sup&gt; Maybe best of all we don&amp;#8217;t have to worry about the value of various currencies over time, and in fact can value innovations that predate money itself.&lt;/p&gt;

&lt;p&gt;The value of some new ideas seems well captured by measuring how much human work they replace. Manufacturing and hanging drywall needs much less effort than lath and plaster. Dynamite and bulldozers remove rock with much less effort than picks and shovels. &lt;sup id="fnref:p45297680351-f2"&gt;&lt;a href="#fn:p45297680351-f2" rel="footnote"&gt;2&lt;/a&gt;&lt;/sup&gt; But what labor is saved by the jet engine? All the laborers in the world couldn&amp;#8217;t get you from San Francisco to New York in six hours. &lt;sup id="fnref:p45297680351-f3"&gt;&lt;a href="#fn:p45297680351-f3" rel="footnote"&gt;3&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;Google&amp;#8217;s search engine seems to be like that - not a labor saver but something that does what was before impossible. Is it though? Could you measure the value of Google by how much labor it would take to replace it? I think you can. What if, instead of Google&amp;#8217;s new software, you just had people? Could you build such a system that could rival, if not today&amp;#8217;s Google, then the first Google search engine, from 1998? Google was searching over only &lt;a href="http://googleblog.blogspot.com/2008/07/we-knew-web-was-big.html"&gt;26 million&lt;/a&gt; pages at the time. Couldn&amp;#8217;t you fulfill a query over those pages given enough &amp;#8216;librarians&amp;#8217;? If we can value even Google this way, then maybe we&amp;#8217;ve got a useful scale for innovation.&lt;/p&gt;

&lt;p&gt;How about if you divided up the web among your librarians? Before reporting for duty, each would read each page in his or her balliwick and remember, more or less, what they say. It&amp;#8217;s not so unrealistic if you assign people to pages pertaining to things they already know something about. Of course most pages weren&amp;#8217;t really about anything, then perhaps more than now. The blog hadn&amp;#8217;t been formally invented &lt;sup id="fnref:p45297680351-f4"&gt;&lt;a href="#fn:p45297680351-f4" rel="footnote"&gt;4&lt;/a&gt;&lt;/sup&gt; but &amp;#8216;home pages&amp;#8217; seemed to make up a majority of the web and few of them were about anything other than the author and his interests. Here&amp;#8217;s a surviving example that exemplifies the species: &lt;a href="http://jerrypournelle.com/" title="Jerry Pournelle"&gt;&lt;a href="http://jerrypournelle.com/"&gt;http://jerrypournelle.com/&lt;/a&gt;&lt;/a&gt; Notice the multiple sections, &amp;#8220;Books and Movie reviews&amp;#8221;, &amp;#8220;What&amp;#8217;s new&amp;#8221;, &amp;#8220;Reader email&amp;#8221;, etc. Remembering what was mentioned in one of those pages wouldn&amp;#8217;t be easy.&lt;/p&gt;

&lt;p&gt;We can make it easier. Let&amp;#8217;s give each librarian the software from one of the existing, crummy pre-Google search engines (or maybe just grep) and set it up so search only their 100 pages. That will give the librarian a good quick start, jog his or her memory, and help a lot with the kind of things that unsophisticated software is good at, like finding exact matches of sentence fragments.&lt;/p&gt;

&lt;p&gt;If we assign 100 web pages to each person and their search engine, we&amp;#8217;d have the 26 million pages covered by 260,000 librarians. But what if you search for something common, like &lt;em&gt;bill clinton&lt;/em&gt; and most of those 260,000 librarians have results? How to pick among them? This is really what the search engine that Google launched in 1998 did that was so great. Its results were ordered in a way that seemed like magic. You searched for &lt;em&gt;that sherlock holmes story with the snake&lt;/em&gt; and the first result was The Adventure of the Speckeled Band. To replicate that we&amp;#8217;re going to need more people to sort out the work of those first 260k people. We need editors.&lt;/p&gt;

&lt;p&gt;Let&amp;#8217;s start with a layer of editors above the librarians. We assigned 100 pages to each librarian, so why not 100 librarians per editor? That&amp;#8217;d be 2600 editors. When a dump of those &lt;em&gt;bill clinton&lt;/em&gt; results comes in to an editor, he or she picks the 10 best, in order, and passes them on, declaring them the best 10 results from the 100 librarians he edits. Each of those are assigned 100 web pages, so the the editor&amp;#8217;s top 10 results are the best from the 10,000 pages his librarians cover. 
Now we&amp;#8217;ve got 10 results each of our 2600 editors. We need to whittle these down to 10 results to show to the user, who is still staring at the screen, waiting. You can see that all we need are more layers of editors. log base 100 of 260,000 is 2.7 so a total of three layers of these editors is enough. That&amp;#8217;ll give us 260,000 librarians, 2,600 first level editors, 26 second level ones, and 1 chief editor: 262,627 workers. 
If it takes a minute for each layer to do its work, which seems reasonable, then a user gets a result back in three minutes, and the system can handle one query per minute. &lt;sup id="fnref:p45297680351-f5"&gt;&lt;a href="#fn:p45297680351-f5" rel="footnote"&gt;5&lt;/a&gt;&lt;/sup&gt; That&amp;#8217;s not much. Luckily this system is easily parallelized. To get another query per minute we simply add another 262,627 workers searching over the same 26 million pages. Apparently Google was doing &lt;a href="http://www.mathewingram.com/work/2008/09/05/how-many-searches-has-google-done/"&gt;10,000&lt;/a&gt; searches per day in 1998. That&amp;#8217;s about 7 per minute. &lt;sup id="fnref:p45297680351-f6"&gt;&lt;a href="#fn:p45297680351-f6" rel="footnote"&gt;6&lt;/a&gt;&lt;/sup&gt; To handle that at a steady state, we&amp;#8217;ll need 262,627 * 7 = 1,838,389 workers. &lt;sup id="fnref:p45297680351-f7"&gt;&lt;a href="#fn:p45297680351-f7" rel="footnote"&gt;7&lt;/a&gt;&lt;/sup&gt;&lt;/p&gt;

&lt;p&gt;There you go. On the day Google launched they were providing, free of charge and with less than 1/120th the latency, what you&amp;#8217;d need 1,838,389 smart workers to do the day before.&lt;/p&gt;

&lt;p&gt;Does this technique work as a scale of innovation? Well, it’s got the nice advantages I mention above. But it can only give you an upper limit on the value of the innovation, since if it paid to do it the labor intensive way, that would have been happening. &lt;sup id="fnref:p45297680351-f8"&gt;&lt;a href="#fn:p45297680351-f8" rel="footnote"&gt;8&lt;/a&gt;&lt;/sup&gt; It needs improvement. &lt;a href="https://news.ycombinator.com/item?id=5429585"&gt;What do you think&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;&lt;img src="http://media.tumblr.com/b9eefc4d36b1a6223ffbeabb03d2b263/tumblr_inline_mjrxi7CwVs1qz4rgp.jpg" alt=""/&gt;&lt;br/&gt;&lt;br/&gt;&lt;a href="https://twitter.com/share" class="twitter-share-button" data-url="http://bit.ly/15F5tfJ" data-text="Google was worth 1,838,389 workers in 1998, maybe." data-via="herdrick" data-size="large" data-count="none" data-hashtags="measuringinnovation"&gt;Tweet&lt;/a&gt;
&lt;script&gt;!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");&lt;/script&gt;&lt;/p&gt;

&lt;p&gt;&lt;br/&gt;&lt;em&gt;Follow me on &lt;a href="https://twitter.com/herdrick"&gt;Twitter&lt;/a&gt;&lt;/em&gt;&lt;/p&gt;

&lt;div class="footnotes"&gt;
&lt;hr&gt;&lt;ol&gt;&lt;li id="fn:p45297680351-f1"&gt;
&lt;p&gt;Or whether it appealed to the richer segments of society. Of course this last item is controversial. On one hand perhaps serving the needs of people who are themselves effectively creating (and capturing) value is morally better than otherwise. But that == &amp;#8220;it&amp;#8217;s morally better to benefit the wealthy than the poor&amp;#8221; which surely isn&amp;#8217;t true. It&amp;#8217;s not surprising that I&amp;#8217;ve have waded into this swamp since I&amp;#8217;m more or less writing about the labor theory of value, a staple of Marxism. &lt;a href="#fnref:p45297680351-f1" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45297680351-f2"&gt;
&lt;p&gt;Of course you need to amortize the work to build the bulldozers and dynamite. &lt;a href="#fnref:p45297680351-f2" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45297680351-f3"&gt;
&lt;p&gt;You might be able to do better than you&amp;#8217;d think though. The way to see what could be done with enough manpower is to imagine yourself a Pharaoh. Better yet, the Pharaoh&amp;#8217;s head engineer with unlimited cooperative laborers. Now how fast can you move the Pharoah from Luxor to Alexandria? I explored that here: &lt;a href="http://herdrick.tumblr.com/private/45193590173/tumblr_mjk1tlaO6g1qz6vjp"&gt;The boat engine is worth 33500 Egyptian slaves&lt;/a&gt;. &lt;a href="#fnref:p45297680351-f3" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45297680351-f4"&gt;
&lt;p&gt;Although there were &lt;a href="http://herdrick.blogspot.com/2007/01/robert-dymonds-ancient-blog.html"&gt;proto-bloggers&lt;/a&gt; already. &lt;a href="#fnref:p45297680351-f4" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45297680351-f5"&gt;
&lt;p&gt;I&amp;#8217;m describing the worst-case scenario. Often an editor will have less to do for some searches, as when his reports give him fewer than 100 results. You could take advantage of this and drop the &lt;a href="http://en.wikipedia.org/wiki/Lockstep_(computing)"&gt;lockstep architecture&lt;/a&gt;. But no closed form solution to calculate how much more productive you could make the tree of workers comes to mind. You&amp;#8217;d probably do best with a Monte Carlo simulation. This optimization would be an interesting problem. &lt;a href="#fnref:p45297680351-f5" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45297680351-f6"&gt;
&lt;p&gt;Actually a lot more than that at peak periods and fewer late at night. But for simplicity we&amp;#8217;ll stick with this. &lt;a href="#fnref:p45297680351-f6" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45297680351-f7"&gt;
&lt;p&gt;There are complications. For one thing, if the user asks for the &lt;em&gt;second&lt;/em&gt; page of results, everyone has to do the same thing except each editor must pass up the 20 best results, since there&amp;#8217;s no way for such an editor to know which, if any of those could ultimately be in the overall top 20. All his fellow editors at his level do the same and now the editor above him has twice as much work to do. Further clicking deeper into the search results makes it worse (only linearly, though). But most people don&amp;#8217;t do that and anyway this is supposed to be a first version. &lt;a href="#fnref:p45297680351-f7" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;li id="fn:p45297680351-f8"&gt;
&lt;p&gt;In this case we don&amp;#8217;t really have an upper limit either, since the army of librarians and editors are so much slower than Google, and speed is so important in a search engine. &lt;a href="#fnref:p45297680351-f8" rev="footnote"&gt;↩&lt;/a&gt;&lt;/p&gt;
&lt;/li&gt;

&lt;/ol&gt;&lt;/div&gt;</description><link>http://herdrick.tumblr.com/post/45297680351</link><guid>http://herdrick.tumblr.com/post/45297680351</guid><pubDate>Fri, 15 Mar 2013 07:00:00 -0700</pubDate></item><item><title>Facebook checkin to become the new price for free wifi</title><description>&lt;p&gt;Just showing up at Coupa Cafe and connecting to their wifi now automatically does a Facebook checkin there.  Good idea for the local business.   And when this spreads to embaressing locations it&amp;#8217;ll make your Facebook feed a lot more interesting, so it&amp;#8217;s good for Facebook too!&lt;/p&gt;

&lt;p&gt;Seriously, I think it only checks you in if you&amp;#8217;ve already accepted thier TOS once.  So the loss of privacy is probably in the &amp;#8216;one more step&amp;#8217; sweet spot.  I predict ubiquity.&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/46095141015</link><guid>http://herdrick.tumblr.com/post/46095141015</guid><pubDate>Mon, 05 Nov 2012 00:00:00 -0800</pubDate></item><item><title>My newest hack (with Dave Brushinski)</title><description>&lt;p&gt;&lt;a href="http://endrank.com/crunchbase" title="The startup world, ranked"&gt;&lt;a href="http://endrank.com/crunchbase"&gt;http://endrank.com/crunchbase&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&amp;#8220;The Crunchranked.  The 217,000 most important companies, financial firms, and people in the startup world, according to an impartial algorithm.&amp;#8221;&lt;/p&gt;
&lt;p&gt;Comments: &lt;a href="http://news.ycombinator.com/item?id=3805555"&gt;&lt;a href="http://news.ycombinator.com/item?id=3805555"&gt;http://news.ycombinator.com/item?id=3805555&lt;/a&gt;&lt;/a&gt;&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/24563553660</link><guid>http://herdrick.tumblr.com/post/24563553660</guid><pubDate>Mon, 16 Apr 2012 13:21:00 -0700</pubDate></item><item><title>Display git branch and 'dirty' status in fish shell prompt</title><description>&lt;p&gt;The primitivism of the bash shell, and the feature list and humorous promotion of the new fish shell fork (&amp;#8220;Finally, a command line shell for the 90s&amp;#8230;&lt;span&gt;You&amp;#8217;ll have an astonishing 256 colors available for use!&amp;#8221;)&lt;/span&gt;  spurred me to try fish out for a few days.  It&amp;#8217;ll have to be a lot better than bash to make worthwhile leaving the large bash community and it&amp;#8217;s google-able answers.  We&amp;#8217;ll see.&lt;/p&gt;
&lt;p&gt;The customization in my bash .profile I can&amp;#8217;t live without [1] is showing the current git branch in the command prompt. Googling this feature for fish got me most of the way there, with the code found here: https://wiki.archlinux.org/index.php/Fish#Configuration_Suggestions  .  But it didn&amp;#8217;t quite work.  Below is what I got to work.  As it also shows if you have staged or unstaged changes I like it better than what I had in bash.&lt;/p&gt;
&lt;p&gt;set fish_git_dirty_color red&lt;/p&gt;
&lt;p&gt;function parse_git_dirty &lt;/p&gt;
&lt;p&gt;         git diff &amp;#8212;quiet HEAD ^&amp;amp;-&lt;/p&gt;
&lt;p&gt;         if test $status = 1&lt;/p&gt;
&lt;p&gt;            echo (set_color $fish_git_dirty_color)&amp;#8221;Δ&amp;#8221;(set_color normal)&lt;/p&gt;
&lt;p&gt;         end&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;function parse_git_branch&lt;/p&gt;
&lt;p&gt;         # git branch outputs lines, the current branch is prefixed with a *&lt;/p&gt;
&lt;p&gt;         set -l branch (git branch 2&amp;gt; /dev/null | sed -e &amp;#8216;/^[^*]/d&amp;#8217; -e &amp;#8216;s/* \(.*\)/\1/&amp;#8217;) &lt;/p&gt;
&lt;p&gt;         echo $branch (parse_git_dirty)     &lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;function fish_prompt&lt;/p&gt;
&lt;p&gt;         if test -z (git branch &amp;#8212;quiet 2&amp;gt;| awk &amp;#8216;/fatal:/ {print &amp;#8220;no git&amp;#8221;}&amp;#8217;)&lt;/p&gt;
&lt;p&gt;            printf &amp;#8216;%s@%s %s%s%s (%s) $ &amp;#8217; (whoami) (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal) (parse_git_branch)            &lt;/p&gt;
&lt;p&gt;         else&lt;/p&gt;
&lt;p&gt;            printf &amp;#8216;%s@%s %s%s%s $ &amp;#8217;  (whoami) (hostname|cut -d . -f 1) (set_color $fish_color_cwd) (prompt_pwd) (set_color normal)&lt;/p&gt;
&lt;p&gt;         end &lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;div&gt;&lt;/div&gt;
&lt;p&gt;[1] Actually the best customization is changing the maximum size and count of the .bash_history file to be really big so that I can keep a lifetime of shell work.&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/24563032599</link><guid>http://herdrick.tumblr.com/post/24563032599</guid><pubDate>Fri, 06 Apr 2012 14:51:00 -0700</pubDate></item><item><title>Professor Sebastian Thrun quits Stanford to teach people</title><description>&lt;p&gt;&lt;div&gt;The text of his homepage today:&lt;/div&gt;

&lt;blockquote&gt;
&lt;div&gt;One of the most amazing things I&amp;#8217;ve ever done in my life is to teach a class to 160,000 students. In the Fall of 2011, Peter Norvig and I decided to offer our class &amp;#8220;Introduction to Artificial Intelligence&amp;#8221; to the world online, free of charge. We spent endless nights recording ourselves on video, and interacting with tens of thousands of students. Volunteer students translated some of our classes into over 40 languages; and in the end we graduated over 23,000 students from 190 countries. In fact, Peter and I taught more students AI, than all AI professors in the world combined. This one class had more educational impact than my entire career. Just watch this video.&lt;/div&gt;
&lt;div&gt;Now that I saw the true power of education, there is no turning back. It&amp;#8217;s like a drug. I won&amp;#8217;t be able to teach 200 students again, in a conventional classroom setting. I&amp;#8217;ve just peeked through a window into an entire new world, and I am determined to get there.&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;div&gt;(and yes, I gave up my tenured position at Stanford)&lt;/div&gt;
&lt;div&gt;&lt;/div&gt;
&lt;/blockquote&gt;

&lt;div&gt;&lt;span&gt;I could not be more impressed with Sebastian.  &lt;/span&gt;From a &lt;a href="http://reut.rs/wM27iT"&gt;story&lt;/a&gt; about this:&lt;/div&gt;

&lt;div&gt;
&lt;blockquote&gt;
&lt;div&gt;&lt;span&gt;&lt;br/&gt;&amp;#8230; the physical class at Stanford&amp;#8230; dwindled from 200 students to 30 students because the online course was more intimate and better at teaching&amp;#8230;&amp;#8221;  &lt;/span&gt;&lt;/div&gt;
&lt;/blockquote&gt;
&lt;/div&gt;&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/16359785894</link><guid>http://herdrick.tumblr.com/post/16359785894</guid><pubDate>Mon, 23 Jan 2012 19:31:24 -0800</pubDate><category>udacity</category><category>aiclass</category><category>stanford</category><category>onlinelearning</category><category>future</category><category>heroic</category></item><item><title>Kill hashtables, get shorter code</title><description>&lt;p&gt;Driving late at night two months ago I wondered, why do we return hashtables from functions?  Isn&amp;#8217;t a hashtable like a function?  Instead of calling some function to get a hashtable, then looking up values on that hashtable with keys, why not simply call the function directly each time I want a value?  Just make the &amp;#8216;key&amp;#8217; the last argument of the new function.  So I tried it on the code from my last post, where I explained hierarchical document clustering and showed some Clojure that does it.  In this post I&amp;#8217;ll show how I eliminated hashtables in that code and got a shorter codebase, comparing the already pretty short &lt;a title="Agglomerative hierarchical document clustering in Clojure." href="http://github.com/herdrick/hierarchical-text/blob/master/src/hierarchical-classifier.clj"&gt;original&lt;/a&gt; to the &lt;a title="Agglomerative hierarchical document clustering in Clojure, refactored to replace hashtables with function calls." href="http://github.com/herdrick/hierarchical-text/blob/refactor-hashtables-to-memoized-fns/src/hierarchical-classifier.clj"&gt;new code&lt;/a&gt;.  &lt;/p&gt;
&lt;p&gt;The best way to show the change will be to walk you through what happens in a call to &lt;code&gt;euclidean&lt;/code&gt;, which calculates the euclidean distance of two documents or an arbitrarily deep tree of documents, based on their word frequencies.    &lt;/p&gt;
&lt;p&gt;In the original, ordinary version, I get a hashtable of the word frequencies of a tree of documents with a call to &lt;code&gt;freq&lt;/code&gt;, which recursively combines the frequencies (hashtables) of the branches of the tree, ultimately calling &lt;code&gt;freq-files&lt;/code&gt; on each leaf, which is a document, of the tree. &lt;code&gt;freq-files&lt;/code&gt; returns a hashtable of frequencies for that a document.  We will pass the hashtable we get back from &lt;code&gt;freq&lt;/code&gt; into &lt;code&gt;euclidean&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;In contrast, in this new version, we just call &lt;code&gt;euclidean&lt;/code&gt; before getting any frequencies. &lt;code&gt;euclidean&lt;/code&gt; calls &lt;code&gt;freq&lt;/code&gt; once for &lt;em&gt;each word&lt;/em&gt; in the corpus.  Each call to &lt;code&gt;freq&lt;/code&gt; calculates the frequency for just that one word, again by recursively combining the frequency of that word of each of the branches, and ultimately calling &lt;code&gt;freq-files&lt;/code&gt; on each document in the tree, which calculates just that word&amp;#8217;s frequency for that document.  &lt;/p&gt;
&lt;p&gt;This is a little weird.  Do you see what has happened here?  That data now is no longer represented with a hashtable - instead it&amp;#8217;s not represented at all.&lt;/p&gt;
&lt;p&gt;Doing all those function calls sounds grossly inefficient but it shouldn&amp;#8217;t.  For one thing, who cares?  It&amp;#8217;s just performance.  We can always profile and deal with problems like that later.  But second, it isn&amp;#8217;t really any less efficient than getting the whole document worth of frequencies all at once, because now I&amp;#8217;m memoizing - caching function return values.  I&amp;#8217;ve wrapped all of the functions in that chain of calls down to and including &lt;code&gt;freq-files&lt;/code&gt; (and beyond) in &lt;code&gt;memoize &lt;/code&gt;[1].  For example, it looks like I&amp;#8217;m reading files from disk every time I call &lt;code&gt;freq-files&lt;/code&gt;.  But memoizing &lt;code&gt;to-words&lt;/code&gt; prevents that, so following a first call, every time &lt;code&gt;freq-files&lt;/code&gt; is called with the same file tree (but probably a different word) the memozied &lt;code&gt;to-words&lt;/code&gt; returns a cached word list. &lt;code&gt;frequencies-m&lt;/code&gt; (the memoized version of &lt;code&gt;frequencies)&lt;/code&gt;, is in turn called with that word list as its argument, a call which would be somewhat computationally costly but since it has a cached value associated with that argument it simply returns that.  This frequency needs to be relative, so we&amp;#8217;ve got to divide by the word count of the doc.  I&amp;#8217;ve got &lt;code&gt;count&lt;/code&gt; wrapped in &lt;code&gt;memoize&lt;/code&gt; too, calling it &lt;code&gt;count-m,&lt;/code&gt; which I call on the results of calling &lt;code&gt;to-words&lt;/code&gt; again, which again returns a cached value.  &lt;/p&gt;
&lt;p&gt;The really cool thing is that that data is still there.  It&amp;#8217;s just that you don&amp;#8217;t see it or manipulate it in the code anymore.  It&amp;#8217;s implicit.  &lt;/p&gt;
&lt;p&gt;This change chops the code down by about 20%, from 55 non-comment lines of code to 44 (or 39, not counting the boilerplate function memoization, which would be a 30% reduction) [2]. &lt;/p&gt;
&lt;p&gt;This style of programming has downsides.  For me, wrapping functions in &lt;code&gt;memoize&lt;/code&gt; means my editor / IDE can&amp;#8217;t tell what arguments my functions take any more (a common problem when you have first class functions).  That sort of sucks.  Further, it makes some functions, like &lt;code&gt;euclidean&lt;/code&gt;, hopelessly non-general, since &lt;code&gt;euclidean&lt;/code&gt; now has to know what function to call to get a frequency [3].  It makes it harder to track down bugs.  When you get all the values you want from each function in a chain of functions, always passing the entire hashtable of them up the chain, it&amp;#8217;s easier to figure out where a problem has come up than if you ask about a single value all the way down the call chain.  But the main disadvantage to this technique is that it doesn&amp;#8217;t match the way I code.  I like to program very interactively.  For example, the first thing I did when I started coding this stuff up was to slurp up the documents in question and call &lt;code&gt;frequencies&lt;/code&gt; on them.  With the resulting hashtables in hand I wrote code to find the distance between two document &amp;#8220;vectors&amp;#8221;.  With these distances I wrote the code to find the shortest ones, and so forth.  Calling the entire function chain to get each value is only possible after you&amp;#8217;ve written that chain of functions.  While you&amp;#8217;re building them it&amp;#8217;s easier to pass all the data from each step to the next step.  But I haven&amp;#8217;t really tried coding in this style from scratch yet, so who knows?  Maybe it&amp;#8217;s got some other hidden advantage I don&amp;#8217;t know about. &lt;/p&gt;
&lt;p&gt;But it&amp;#8217;s hard to argue with brevity.  And by the way, there&amp;#8217;s nothing inherently lisp-ish about this technique.  You can do it in any language with first class functions, like Python or Ruby, just as easily.&lt;/p&gt;
&lt;p&gt;Comment on this post at &lt;a href="http://news.ycombinator.com/item?id=1529918"&gt;News.YC&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;em&gt;
&lt;p&gt;&lt;strong&gt;In the Bay Area and need help with your machine learning project? Contact me at &lt;em&gt;&lt;a title="Clojure programmer and consultant Ethan Herdrick's email address" href="mailto:info@reatlas.com"&gt;info@reatlas.com&lt;/a&gt;&lt;/em&gt; or &lt;em&gt;&lt;a title="Clojure programmer and consultant Ethan Herdrick's twitter" href="http://twitter.com/herdrick"&gt;twitter.com/herdrick&lt;/a&gt;  &lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;hr&gt;&lt;p&gt;[1]  And we&amp;#8217;ve been doing some of that all along anyway, since we often call &lt;code&gt;freq&lt;/code&gt; with the same arguments, over multiple calls to &lt;code&gt;euclidean&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;[2]  There&amp;#8217;s actually another related change here that isn&amp;#8217;t so interesting, but definitely helped.  In the original version, the word-list - the list of all words that appear somewhere in the documents - is calculated immediately upon calling cluster, and passed into each subsequent recursive call to cluster.  From there it&amp;#8217;s passed into best-pairing, which passes it into &lt;code&gt;euclidean&lt;/code&gt;, the only place where it is actually used.  I did this because getting this list requires some file reading and computation and it seems ineffiecient to recalculate it every time I call &lt;code&gt;euclidean&lt;/code&gt;, which is a lot. But that was the wrong way to think about this problem. When I went ahead and did the inefficent thing, the right fix became clear: memoization, again.  best-pairing&amp;#8217;s argument is a list of file-trees in which every file in our corpus is represented, so we can calculate our list of words from that - so I did.  Now every call to &lt;code&gt;euclidean&lt;/code&gt; makes a call to word-list.  But this isn&amp;#8217;t such a problem because word-list and most of the functions it calls are memoized.  So the only additional cost of calling that function are several memo lookups - negligible - and flattening and sorting a file tree.  Which isn&amp;#8217;t nothing but I don&amp;#8217;t think it&amp;#8217;s a big deal.  I should profile it to find out.&lt;/p&gt;
&lt;p&gt;[3] Actually I could make &lt;code&gt;euclidean&lt;/code&gt; more general by just sticking with the original version.  Because Clojure hashtables can be called as functions, I can just call &lt;code&gt;euclidean&lt;/code&gt; like this: &lt;code&gt;(euclidean (partial freq pof1) (partial freq pof2) (word-list pofs))&lt;/code&gt;, using closures created with partial function application as the frequency arguments.  Seemed a little harder to explain though, so I skipped it.&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/825096887</link><guid>http://herdrick.tumblr.com/post/825096887</guid><pubDate>Mon, 19 Jul 2010 12:34:00 -0700</pubDate><category>refactoring</category><category>clojure</category></item><item><title>Cluster (with Clojure)</title><description>&lt;p&gt;I was watching a video of Berkeley professor Michael Jordan lecturing on the Chinese Restaurant &lt;a href="http://en.wikipedia.org/wiki/Chinese_restaurant_process"&gt;process&lt;/a&gt; and for a moment he showed a slide of a tree of documents that were matched up by word frequencies.  It seemed cool so I coded up my own version of it, mostly to learn about the topic and to get some practice with &lt;a href="http://clojure.org" title="Clojure"&gt;Clojure&lt;/a&gt;.  It turned out there&amp;#8217;s a name for this:  &lt;a href="http://en.wikipedia.org/wiki/Hierarchical_clustering" title="Aggolomertive hierarchical clustering"&gt;hierarchical clustering&lt;/a&gt;.  I went with the &amp;#8216;agglomerative&amp;#8217; version of it, which is repeatedly pairing up things and pairs of those things until you have a single pairing that, beneath it, contains everything you started with.  Usually you choose pairings based on similarity - you pair up the two available things that are most similar. &lt;/p&gt;
&lt;p&gt;To make documents into something you can easily compare, I&amp;#8217;m converting each into a hashtable of the relative frequencies of the words it contains, like this:  &lt;code&gt;{"purple" 0.0015, "it" 0.0023, "this" 0.0083  ...} &lt;/code&gt; etc.  The code finds the two most similar docs based on those frequencies, and matches them up, making a new hashtable like that by averaging the frequencies of those two docs [1]. This &amp;#8220;pairing&amp;#8221; is now on the same footing with all the other documents.  So we again find the two most similar docs (allowing this new pairing to be treated as a doc), repeating that process until we&amp;#8217;re left with only a single pairing.  It contains every pairing we made, and ultimately every document we started with.  This is our finished product, a hierarchical cluster.&lt;/p&gt;
&lt;p&gt;You can see the code on &lt;a href="http://github.com/herdrick/hierarchical-text/blob/master/src/hierarchical-classifier.clj" title="Code for agglomerative hierarchical classifier in Clojure"&gt;my GitHub&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;I turned it loose on some text files got the following (plotted with the Protoviz Javascript toolkit) [3]&lt;/p&gt;
&lt;p&gt;&lt;img alt="Image of an agglomerative hierarchical cluster of documents, rendered by Protovis." height="391" src="http://dl.dropbox.com/u/78/agglomerative-hierarchical-cluster-of-documents.png" width="514"/&gt;&lt;/p&gt;
&lt;p&gt;The blue nodes are the documents and the green nodes are pairings.  From top to bottom, the docs are: &lt;/p&gt;
&lt;p&gt;-the German Wikipedia article on the lambda calculus, &lt;br/&gt;-the first several hundred words of a German novel, Wilhelm Meister&amp;#8217;s Apprenticeship by Johann Wolfgang von Goethe, &lt;br/&gt;-an exerpt from Shakespeare&amp;#8217;s King Lear, &lt;br/&gt;-the scifi short story, &amp;#8220;They&amp;#8217;re Made out of Meat&amp;#8221;, &lt;br/&gt;-the English Wikipedia article on the lambda calculus, &lt;br/&gt;-the English Wikipedia article on &amp;#8220;The Buzzer&amp;#8221; or UVB-76, &lt;br/&gt;-the Sherlock Holmes story, &amp;#8220;The Red Headed League&amp;#8221;, &lt;br/&gt;-the Sherlock Holmes story, &amp;#8220;A Scandal in Bohemia&amp;#8221;, &lt;br/&gt;-the scifi short story, &amp;#8220;The Long Watch&amp;#8221; by Robert Heinlein, &lt;br/&gt;-Shakespeare&amp;#8217;s first and second sonnets, &lt;br/&gt;-Shakespeare&amp;#8217;s third and fourth sonnets, &lt;br/&gt;-the Spanish poems, &amp;#8220;Candor&amp;#8221; and &amp;#8220;Reto&amp;#8221; from Julio Flórez, &lt;br/&gt;-the Spanish Wikipedia article on the lambda calculus, &lt;br/&gt;-the Spanish Wikipedia article on functional programming, &lt;br/&gt;-the Dutch Wikipedia article on the lambda calculus,&lt;/p&gt;
&lt;p&gt;Notice that each pairing shows three words.  Those are the most &amp;#8216;interesting words&amp;#8217;: those whose frequencies do the most to make that pairing stand out from the average.  For example, if you&amp;#8217;ve got a document that uses the word &amp;#8220;mooloolaba&amp;#8221; a few times, that&amp;#8217;s probably going to be one of its interesting words because it&amp;#8217;s so rare elsewhere.  But a word could also be interesting for &lt;em&gt;not&lt;/em&gt; showing up, ex. if the word &amp;#8220;the&amp;#8221; never shows up in a document or only a few times in a long text.  In that case the word is in parens.&lt;/p&gt;
&lt;p&gt;It seems to have done an OK job here.  It strongly leans toward matching up docs (and pairings) in the same language when possible.  I was hoping that it would be able to pull out the two science fiction stories, but that isn&amp;#8217;t happening.  It&amp;#8217;s not smart enough for that.  I&amp;#8217;m pleased that it grouped the Spanish functional programming and lambda calculus articles before inluding the Spanish poetry.  It put Shakespeare&amp;#8217;s sonnets together, but failed to associate them very closely with the exerpt from King Lear.  [4] &lt;/p&gt;
&lt;p&gt;I was also hoping the Dutch and German articles would clusted together before being joined with the Spanish or English docs, but this didn&amp;#8217;t happen.  It might be that &amp;#8220;de&amp;#8221; is a common word in Dutch and Spanish, whereas &amp;#8220;is&amp;#8221; and &amp;#8220;in&amp;#8221; are common in Dutch and English.  So the classifier might see Dutch documents as partway between English and Spanish ones (even though the opposite is closer to the truth).  &lt;/p&gt;
&lt;p&gt;Interesting.  I think this could be improved by using a statistical distance to measure the distance between vectors, instead of unscaled distance of relative frequencies as I&amp;#8217;m doing now.&lt;/p&gt;
&lt;p&gt;In playing with this code I stumbled on a interesting way to refactor it.  I&amp;#8217;ll talk about that in the next post.&lt;/p&gt;
&lt;p&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;hr&gt;&lt;p&gt;&lt;br/&gt;&lt;br/&gt;&lt;/p&gt;
&lt;p&gt;[1] This is called the vector space model, declaring each word to be a dimension, and each document a point, or vector, in that word-space.  Identifying docs by the words they contain and not worrying about word order is in general called using the &amp;#8220;bag of words&amp;#8221;.  I&amp;#8217;m comparing those frequencies using Euclidean distance.  It&amp;#8217;s often said to be better to use the cosine of the two vectors but that doesn&amp;#8217;t matter here since the dimensions of any document vector sum to 1 (is there a name for such a vector?), and I&amp;#8217;m only looking for a ranking of distance.&lt;/p&gt;
&lt;p&gt;[2] I omitted the thirty lines of code to translate the s-expression result to the JSON needed for Protovis.&lt;/p&gt;
&lt;p&gt;[3] I found in trial runs over all of Shakespeare&amp;#8217;s sonnets that it did a pretty good job of sorting out the earlier sonnets from the later ones.&lt;/p&gt;
&lt;p&gt;[4] The regular expression I used for extracting words is poor for non-English languages, but the algorithim can probably handle it anyway, as the fragments it creates will be unique to the words they came from.&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;em&gt;&lt;em&gt;&lt;strong&gt;In the Bay Area and need help with your machine learning project? Contact me at &lt;em&gt;&lt;a href="mailto:info@reatlas.com" title="Clojure programmer and consultant Ethan Herdrick's email address"&gt;info@reatlas.com&lt;/a&gt;&lt;/em&gt; or &lt;em&gt;&lt;a href="http://twitter.com/herdrick" title="Clojure programmer and consultant Ethan Herdrick's twitter"&gt;twitter.com/herdrick&lt;/a&gt;  &lt;/em&gt;&lt;/strong&gt;&lt;/em&gt;&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/672301520</link><guid>http://herdrick.tumblr.com/post/672301520</guid><pubDate>Sun, 06 Jun 2010 23:53:00 -0700</pubDate><category>machine learning</category><category>clojure</category><category>hierarchical clustering</category><category>document clustering</category><category>agglomerative hierarchical clustering</category></item><item><title>Some speculation on human knowledge</title><description>&lt;p&gt;&lt;em&gt;(What I write here includes a lot of confident-sounding guesses.  Consider this more like a late night wine-soaked conversation than an exposition about things that I know.  This was meant to be an exploration.  It turned out to raise more questions than it answered.)&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;Last night as I was trying to fall asleep I was, for some reason, thinking about mathematics and innovation, and I was it occured to me that the point humanity passed a few decades ago, where a single mind [1] can no longer contain all our mathematics is a major and universal milestone for a civilization.  What does it mean? Will the balkanization of math [2] slow progress?  Are we approaching Peak Math? [3]&lt;/p&gt;

&lt;p&gt;There is something else related to this: the more study required to reach the frontiers of a field, the fewer restless turbulent personalities will be in that field, because they won&amp;#8217;t have the patience to quietly learn at the feet of their predicessors for the many years necessary to reach the frontier.  And without those sort of people, you won&amp;#8217;t get the sort of revolutionaries that shake the planet with their work.  Thus as the frontier gets further from the starting point of pure ignorance, you should see more incremental advances and fewer revolutions.  Do we see that in mathematics?  If the revolutionaries are driven out of vast fields, where do they go?  &lt;a style="color: #007bff;" title="Guy Steele" href="http://labs.oracle.com/pls/apex/f?p=labs:bio:0:120"&gt;I&lt;/a&gt; &lt;a style="color: #007bff;" title="Matthias Felleisen" href="http://www.ccs.neu.edu/home/matthias/"&gt;have&lt;/a&gt; &lt;a style="color: #007bff;" title="Dan Friedman" href="http://www.cs.indiana.edu/~dfried/"&gt;my&lt;/a&gt; &lt;a style="color: #007bff;" title="Gerald Sussman" href="http://groups.csail.mit.edu/mac/users/gjs/"&gt;suspicions&lt;/a&gt;.  Is it useful to ask how they are driven out?  Do they just find the culture and its practitioners &lt;em&gt;no simpatico&lt;/em&gt;?&lt;/p&gt;

&lt;p&gt;The distance to the frontier of a field should be related to how much of the field can be contained in a single brain, (it should increase as the square root of the amount of knowledge in the field if you assume the field grows in all directions) since you&amp;#8217;ve got to have all the preceding stuff that is on the route to your speciality in mind before you can advance the field and by the time you get there you have less space for the new stuff.  This implies that there will be a bigger chunk of your brain filled up with the common stuff shared between subfields than if you were in a smaller field.&lt;/p&gt;

&lt;p&gt;So again, how many brains do you need to contain mathematics?  Or physics?  How many other fields have exceeded the capacity of a single brain?  Economics?  Certainly there are fields of Econ that have no contact with other fields - game theory has little in common with econometics - but is brain-filled-ness the reason for that?  Geology - certainly soft rock geologists and hard rock geologists don&amp;#8217;t fully understand what each other are currrenly up to but is that because they can&amp;#8217;t or because they don&amp;#8217;t want to?  [4]  How about Computer Science - surely there is more than one brainfull there.  I&amp;#8217;m pretty sure that most of what&amp;#8217;s going on in machine learning is not understood at all by the people working in theory, and vice versa.  Likewise the PL people can&amp;#8217;t be current on algorithims.  I just don&amp;#8217;t know enough about these fields to know how many minds you need to encompass the field, just that its got to be more than one.&lt;/p&gt;

&lt;p&gt;What fields aren&amp;#8217;t like that?  New ones.  [5]  From what I understand, neuroscience is new enough that a neuroscientist can just be a neuroscientist.&lt;/p&gt;

&lt;p&gt;So is this the difference between a field and a subfield?  Two different fields can share some stuff, like math and physics (or math and anything) but from the beginning they are diverging - there are lots of things that a first year physics undergrad and a first year math undergrad learn together, but already there are things that they don&amp;#8217;t.  Same is true for geologists and physicists - from the first year they are diverging.  (Hmm&amp;#8230; yet they all have the same pre-college experience.)  But budding topologists and analysts are studying exactly the same things for years at college.  So are the capabilities of the 18 year old college student the thing that makes electrical engineering and computer science different fields? Maybe.  Honestly, academia politics probably has much to do with it.  Hmmm&amp;#8230; probably I&amp;#8217;m seeing this thru my lens shaped by the current divisions in university departments.   I mean, what the 18 year olds are studying isn&amp;#8217;t necessarily what they *should* be studying.&lt;/p&gt;

&lt;p&gt;What I&amp;#8217;d love to see is some way to measure the size of fields in units of brains.  How?  I was thinking that maybe a field branches into subfields every time it gets too big to be contained in a single head.  Does this happen?  Well, if you assume that the amount of knowledge in a leaf on the tree of fields is constant, the increase in fields and subfields should be proportionate to the increase in human knowledge.&lt;/p&gt;

&lt;p&gt;How much have fields increased?  It seems that there were no departments at universities 800 years ago.  &lt;a style="color: #007bff;" href="http://en.wikipedia.org/wiki/List_of_academic_disciplines"&gt;This page&lt;/a&gt; shows around 1500 of them today, but that list is under-branched.  &lt;a style="color: #007bff;" href="http://en.wikipedia.org/wiki/List_of_basic_engineering_topics#Fields_of_engineering"&gt;This&lt;/a&gt; shows many subfields not mentioned on the first page.  Excluding repeats it makes at most a 5-fold  increase.  If it is underspecified and there are (or should be) similar pages for other topics we might get another order of magnitude.  So four orders of magnatude increase in human knowledge in 800 years.  For every one thing known 800 years ago do we now know only 1000 things?  No way - that seems too low.  Math has done far more than that, even excluding its offshoots (Computer Science, etc).  On the other hand, theology was a major area of study at the time and we have probably not even doubled our knowledge of that since then.  For example I think most Protestants would say that theological knowledge has been completely static for 2000 years.  [6]&lt;/p&gt;

&lt;p&gt;Here&amp;#8217;s something interesting: if your field is smaller than one brainfull, I don&amp;#8217;t think you can tell how much less.  It seems to come as a surprise to all that the arts and sciences combined had gotten too big, and it was only by complaints by some mathematicians that they realized it was true in their field, too.&lt;/p&gt;

&lt;p&gt;Related: &lt;a title="The Last Days of the Polymath" href="http://moreintelligentlife.com/content/edward-carr/last-days-polymath"&gt;The Last Days of the Polymath&lt;/a&gt;.&lt;/p&gt;



&lt;hr&gt;&lt;p&gt;FOOTNOTES:&lt;/p&gt;

&lt;p&gt;[1]  I should clarfify that the amount of knowledge that you can fit into one brain is going to be very hard to differentiate from the amount you can learn before you start going senile.  Perhaps, in fact, that is the limit.  Maybe the brain has no limit of knowledge, but instead is limited by rate of intake.  Then that rate times the lifespan of a person equals the size of a brain.&lt;/p&gt;

&lt;p&gt;[2]  Just how balkanized is math?  Do they in fact know, in absolute terms, less about other fields than they used to?  Of course they know a smaller percentage of the whole field than they used to, but do they also just know less?  Would a topology mathematician of 30 years ago know things about analysis that a topologist today wouldn&amp;#8217;t?  Probably if someone wanted to simply know as much as possible about math and did not intend to contribute, he or she could know much more than the typical mathematician.  I.e. it might be just that no one ambitious wants to &amp;#8216;waste&amp;#8217; any time keeping up with the rest of their field when their subfield is so demanding.  But that&amp;#8217;s OK - couldn&amp;#8217;t I just redefine my definition of &amp;#8220;too big for a brain to encompass&amp;#8221; to &amp;#8220;too big for an ambitious brain to bother learning all of&amp;#8221;?&lt;/p&gt;

&lt;p&gt;[3]  I don&amp;#8217;t think this would hurt us for some time.  Our current known reserves of unapplied math should last centuries.&lt;/p&gt;

&lt;p&gt;[4]  Here&amp;#8217;s what wikipedia says are the &amp;#8216;subdisciplines&amp;#8217; of geology:  Economic geology, Mining geology, Petroleum geology, Engineering geology, Environmental geology, Geochemistry, Geological modelling, Geomorphology, Historical geology, Hydrogeology, Mineralogy, Paleontology, Petrology, Sedimentology, Stratigraphy, and Structural geology.  Certainly no ambitous geologist is atop the current trends of all of these.  (I have the advantage of knowing some.)&lt;/p&gt;

&lt;p&gt;[5]  Here&amp;#8217;s an ancient one that can be pretty well understood by one mind: music.  I&amp;#8217;m pretty sure one person could understand everything that&amp;#8217;s currently happening and everything that is known about previous music of humanity.  (It&amp;#8217;s really interesting.  You can start here: &lt;a style="color: #007bff;" href="http://en.wikipedia.org/wiki/Musical_scale"&gt;&lt;a href="http://en.wikipedia.org/wiki/Musical_scale"&gt;http://en.wikipedia.org/wiki/Musical_scale&lt;/a&gt;&lt;/a&gt; .)  That&amp;#8217;s really weird.  People have been innovating music forever and yet the field isn&amp;#8217;t too big to know?  Why?  Is our innate musical sense just that much better than our ability to comprehend math or science?  Probably.&lt;/p&gt;

&lt;p&gt;[6]  You could compare the religions of the world based on how they see the advance of theological or spirtual knowledge over time.  Christians would see it as a starting in Eden with miniscule knowledge, then a spike when Eve bites the apple, a long period of occasional increases by the odd prophet here and there until a big jump at Moses, and eventually a giant leap by Jesus, and finally a small increase with the writing of Revelations.  After that Catholics and Orthodox would suppose continued small increased through the present day while Protestants would draw a flat line.  Islam&amp;#8217;s line wouldn&amp;#8217;t look too different except with a giant leap around the year 800 followed by a flat line.  I don&amp;#8217;t really know enough about other religions to say further, even by the loose standard I&amp;#8217;m holding myself to here.&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/46094986874</link><guid>http://herdrick.tumblr.com/post/46094986874</guid><pubDate>Wed, 13 Jan 2010 00:00:00 -0800</pubDate></item><item><title>Math question</title><description>&lt;p&gt;Question: Can an edge of a hypergraph connect to some node more than once in some definition of a graph?  If so you could represent a text, for example a book, as a single directed hyperedge running through a graph of words.  EDIT:  Probably not.  If you could you&amp;#8217;d lose lots of the useful properties of graphs, I think.&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/329351672</link><guid>http://herdrick.tumblr.com/post/329351672</guid><pubDate>Mon, 11 Jan 2010 14:34:00 -0800</pubDate><category>math</category><category>graphs</category><category>hypergraphs</category><category>hyperedges</category></item><item><title>Can't I have tasteful with a good keyboard?</title><description>&lt;p&gt;I&amp;#8217;m writing this in a store that sells laptops, on one of the tackiest computers I&amp;#8217;ve ever seen. I think it&amp;#8217;s called a Gateway FX or something - imagine a Pontiac Grand Prix with a touchpad. Yet I&amp;#8217;m envious and irritated because it has something that I can&amp;#8217;t have in my wonderfully designed MacBook Pro: fantastic keyboard feel. My MBP has the mushiest, least responsive keyboard I&amp;#8217;ve ever used, at least among those keyboards I&amp;#8217;ve tolerated. It&amp;#8217;s crap. I&amp;#8217;m going to be ordering up a nice IBM Model M keyboard to use while I&amp;#8217;ve seated at a table, which will be great since that must account for, gosh, at least 5% of my usage. I wonder if I can get a laptop case that will hold a seven pound keyboard?&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/46094730087</link><guid>http://herdrick.tumblr.com/post/46094730087</guid><pubDate>Thu, 18 Sep 2008 00:00:00 -0700</pubDate></item><item><title>When should you get on a bandwagon?</title><description>&lt;p&gt;My sister and two of my best friends just joined Facebook after years of grouchy protest. Now they love it. Why wouldn&amp;#8217;t they? All their friends are already there - it&amp;#8217;s like a personal theme park that&amp;#8217;s been waiting for them. It&amp;#8217;s funny, because their early adopter buddies had a much harder time, yet talked the experience up.&lt;/p&gt;

&lt;p&gt;So the sticks-in-the-mud have more fun.  Is this true of other experiences?  I was going to say that that&amp;#8217;s true of anything with a heavy network effect. But that&amp;#8217;s not true - I was the first of my circle of friends to get involved with the internet and it was a fantastic experience.  The early Twitter had that feel, and blogging.  CB radio is said to have been like that too. Why? Simple: that&amp;#8217;s where the cool kids hang out. Your friends may not be there, but the friends you wish you had are.&lt;/p&gt;

&lt;p&gt;So, there you have it. If you want a new crew of hip friends, jump aboard the newest network. They&amp;#8217;re waiting for you there.&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/46094575981</link><guid>http://herdrick.tumblr.com/post/46094575981</guid><pubDate>Mon, 15 Sep 2008 00:00:00 -0700</pubDate></item><item><title>Dropbox viewed from the south</title><description>&lt;p&gt;I&amp;#8217;m in Mexico right now working around people in the mining industry and I just got an invitation from one of the Mexican geologists to join a Dropbox folder to share files about a mining project. Now, I&amp;#8217;ve been using and telling people about Dropbox since they starting beta testing. Hearing about a startup sources unrelated to the people building is always really cool and feels like a big milestone. That I&amp;#8217;m far from Silicon Valley makes it all the more impressive. Plus these are corporate users who have told me they&amp;#8217;d be perfectly happy to upgrade to a paying account when they need to. ¡Dropbox les gusta a todos aca!&lt;/p&gt;</description><link>http://herdrick.tumblr.com/post/46094828015</link><guid>http://herdrick.tumblr.com/post/46094828015</guid><pubDate>Sun, 03 Aug 2008 00:00:00 -0700</pubDate></item></channel></rss>
