<?xml version='1.0' encoding='utf-8' ?>
<!--  If you are running a bot please visit this policy page outlining rules you must respect. http://www.livejournal.com/bots/  -->
<rss version='2.0' xmlns:lj='http://www.livejournal.org/rss/lj/1.0/' xmlns:media='http://search.yahoo.com/mrss/' xmlns:atom10='http://www.w3.org/2005/Atom'>
<channel>
  <title>C. Scott Ananian</title>
  <link>http://cananian.livejournal.com/</link>
  <description>C. Scott Ananian - LiveJournal.com</description>
  <lastBuildDate>Wed, 04 Nov 2009 19:27:15 GMT</lastBuildDate>
  <generator>LiveJournal / LiveJournal.com</generator>
  <lj:journal>cananian</lj:journal>
  <lj:journalid>123187</lj:journalid>
  <lj:journaltype>personal</lj:journaltype>
  <atom10:link rel='hub' href='http://pubsubhubbub.appspot.com/' />
  <image>
    <url>http://l-userpic.livejournal.com/11312513/123187</url>
    <title>C. Scott Ananian</title>
    <link>http://cananian.livejournal.com/</link>
    <width>100</width>
    <height>100</height>
  </image>

<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/58744.html</guid>
  <pubDate>Wed, 04 Nov 2009 19:27:15 GMT</pubDate>
  <title>litl&apos;s technical secrets revealed!</title>
  <link>http://cananian.livejournal.com/58744.html</link>
  <description>&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; Lucas has written up some additional &lt;a href=&quot;http://blogs.gnome.org/lucasr/2009/11/04/litl-webbook-some-technical-comments/&quot;&gt;technical details&lt;/a&gt; &amp;mdash; and he mentions our update system, which was one of the first bits I worked on when I arrived.  We heavily dog-food the updater, using &lt;a href=&quot;http://buildbot.net/&quot;&gt;buildbot&lt;/a&gt; to push out the latest bits to developers every night.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update 2:&lt;/b&gt; Welcome, slashdot!  The videos at &lt;a href=&quot;http://litl.com/support/&quot;&gt;http://litl.com/support/&lt;/a&gt; give a good idea of what the UI is like.&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update 3:&lt;/b&gt; Non-technical press coverage: &lt;a href=&quot;http://www.wired.com/gadgetlab/2009/11/litl-webbook/&quot;&gt;Wired&lt;/a&gt;, &lt;a href=&quot;http://blogs.wsj.com/digits/2009/11/04/litl-introduces-its-web-based-netbook/&quot;&gt;WSJ&lt;/a&gt;, &lt;a href=&quot;http://www.xconomy.com/boston/2009/11/04/the-litl-computer-that-could-boston-startup-tries-a-new-take-on-the-home-internet-appliance/&quot;&gt;Xconomy&lt;/a&gt;, &lt;a href=&quot;http://www.crunchgear.com/2009/11/04/litl-webbook-aims-to-blend-portable-computing-with-a-tv-like-experience/&quot;&gt;CrunchGear&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update 4:&lt;/b&gt; More words: &lt;a href=&quot;http://innergeekmoments.blogspot.com/2009/11/litl-theres-server-component-too.html&quot;&gt;dignacio on litl&apos;s server side&lt;/a&gt;, &lt;a href=&quot;http://www.j5live.com/2009/11/04/litls-little-netbook/&quot;&gt;J5&lt;/a&gt;, &lt;a href=&quot;http://twitter.com/#search?q=%23litl&quot;&gt;twitter&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href=&quot;http://litl.com&quot;&gt;litl&lt;/a&gt; launches today, so I can finally
talk a bit about the cool technologies behind our software stack.&lt;/p&gt;

&lt;p&gt;On the server side, litl is a cloud computer, built on &lt;a href=&quot;http://en.wikipedia.org/wiki/Google_App_Engine&quot;&gt;Google App
Engine&lt;/a&gt;, &lt;a href=&quot;http://en.wikipedia.org/wiki/Amazon_S3&quot;&gt;Amazon
S3&lt;/a&gt;, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Django_(web_framework)&quot;&gt;Django&lt;/a&gt;
&amp;mdash; all of which are fantastic technologies.
All machine data is stored in the cloud, so you can have a
gorilla stomp on your litl, pick up another one, log on and instantly
recreate your environment.  (Since we developers are always abusing
our prototype hardware, we&apos;ve tested this a lot!)&lt;/p&gt;

&lt;p&gt;On the client side, the litl software (naturally, code-named &quot;big&quot;)
is built on &lt;a href=&quot;http://live.gnome.org/Gjs/&quot;&gt;gjs&lt;/a&gt;, which is the
smallest possible wrapper around &lt;a href=&quot;http://www.amazon.com/exec/obidos/ASIN/0596517742/wrrrldwideweb&quot;&gt;JavaScript&lt;/a&gt;
necessary to make it a large-scale programming language.  I&apos;ve really
enjoyed programming in JavaScript, which might seem odd to people who
(a) have had frustrating experiences with global variables and crazy
incompatibilites trying to make JavaScript work on the web, and (b)
know that I&apos;m a &lt;a href=&quot;http://cscott.net/Publications/thesis.pdf&quot;&gt;static types&lt;/a&gt; and
&lt;a href=&quot;http://cscott.net/Publications/p072-ananian.pdf&quot;&gt;compiler-bondage&lt;/a&gt;
sort of guy.  So I&apos;ll spend a little time here talking about gjs.&lt;/p&gt;

&lt;p&gt;From a language standpoint gjs adds just one feature: a minimal
module/namespacing mechanism built on a single top-level definition: the name &quot;&lt;code&gt;imports&lt;/code&gt;&quot;.
Modules are imported using (typically constant) definitions, such as:&lt;/p&gt;
&lt;pre style=&quot;background: #eef; border: 1px solid #ccc; margin: 1em; padding: 1em; width: 40em;&quot;&gt;
const StringUtil = imports.stringUtil;

s = StringUtil.sprintf(&quot;%d&quot;, 3);
&lt;/pre&gt;

&lt;p&gt;The dynamic &lt;code&gt;stringUtil&lt;/code&gt; property of the
&lt;code&gt;imports&lt;/code&gt; object is an object whose properties are the
top-level definitions in the file &lt;code&gt;stringUtil.js&lt;/code&gt;, found on
the import path.  Subdirectories are additional dot-separated
components, as in Java package names; &lt;code&gt;imports.util&lt;/code&gt; is a
dynamic object representing modules found in a &lt;code&gt;util&lt;/code&gt;
directory on the path.  You may need to compare this to the
namespacing mechanism in the abandoned &lt;a href=&quot;http://www.ecmascript.org/es4/spec/overview.pdf&quot;&gt;ES4&lt;/a&gt;
proposal to appreciate how small and elegant this is.&lt;/p&gt;

&lt;p&gt;Further, this module system integrates with the &lt;a href=&quot;http://library.gnome.org/devel/gobject/unstable/index.html&quot;&gt;GObject system&lt;/a&gt; via
&lt;a href=&quot;http://live.gnome.org/GObjectIntrospection/&quot;&gt;GObject
introspection&lt;/a&gt; annotations for library code.  This allows
easy integration with libraries written in C
or any other introspectable language.  For example:&lt;/p&gt;
&lt;pre style=&quot;background: #eef; border: 1px solid #ccc; margin: 1em; padding: 1em; width: 40em;&quot;&gt;
const Gtk = imports.gi.Gtk;
Gtk.init(0, null);

let w = new Gtk.Window({ type: Gtk.WindowType.TOPLEVEL });
w.connect(&apos;destroy&apos;, Gtk.main_quit );

let button = new Gtk.Button({ label: &quot;Hello, world!&quot; });
button.connect(&apos;clicked&apos;, function() { w.destroy(); } );
w.add(button);
w.show_all();

Gtk.main();
&lt;/pre&gt;

&lt;p&gt;The gjs system is built on the &lt;a href=&quot;http://www.mozilla.org/js/spidermonkey/&quot;&gt;SpiderMonkey&lt;/a&gt;
JavaScript engine, the one used in &lt;a href=&quot;http://www.mozilla.com/en-US/firefox/upgrade.html&quot;&gt;Firefox&lt;/a&gt;,
so JavaScript execution benefits from all the &lt;a href=&quot;http://ejohn.org/blog/tracemonkey/&quot;&gt;JIT&lt;/a&gt; and performance work
done upstream.  Further, it means that we can code in &lt;a href=&quot;https://developer.mozilla.org/en/New_in_JavaScript_1.8&quot;&gt;JavaScript
1.8&lt;/a&gt;, Mozilla&apos;s dialect of JavaScript with lots of bells and
whistles (mostly borrowed from Python):&lt;/p&gt;

&lt;pre style=&quot;background: #eef; border: 1px solid #ccc; margin: 1em; padding: 1em; width: 40em;&quot;&gt;
gjs&amp;gt; function range(n) { for (let i=0; i&amp;lt;n; i++) yield i; }
gjs&amp;gt; [i*2 for (i in range(5))]
0,2,4,6,8
&lt;/pre&gt;

&lt;p&gt;(In a later post perhaps I&apos;ll describe how you can use the
&lt;code&gt;yield&lt;/code&gt; expression to build a continuation-based system for
writing asynchronous callbacks for UI code in a natural manner.)&lt;/p&gt;

&lt;p&gt;Overall,
JavaScript as a system programming language feels a lot like Lisp must
have for the programming generation before mine: minimal
syntax, very powerful and orthogonal core abstractions, and (dare I
say it) not much type-checking or busy-work to get in your way.
(&lt;code&gt;gjs&lt;/code&gt; is not a homage to &lt;a href=&quot;http://en.wikipedia.org/wiki/Gjs&quot;&gt;Sussman&lt;/a&gt;, but it should
be!)  JavaScript is a programming language for those who know what they&apos;re
doing and aren&apos;t afraid of a little functional abstraction.  (Now if
only there was a way to disable &lt;a href=&quot;http://www.mozilla.org/js/language/js20-2000-07/rationale/syntax.html&quot;&gt;semicolon
insertion&lt;/a&gt;!)&lt;/p&gt;

&lt;p&gt;OK, enough about gjs.  The litl software stack is based on &lt;a href=&quot;http://www.canonical.com/&quot;&gt;Canonical&lt;/a&gt;&apos;s distribution
of Ubuntu for &lt;a href=&quot;http://www.ubuntu.com/products/mobile&quot;&gt;mobile/embedded
devices&lt;/a&gt;, and the Canonical folks have been great partners.
It&apos;s been a joy to get changes integrated upstream, and Canonical has done a
lot of excellent work accommodating their distribution to litl&apos;s
unique needs.  On the UI side, we use X11 and some GTK widgets, but
implement our own (very simple) window manager.  Most of the
actual look and feel is done with &lt;a href=&quot;http://en.wikipedia.org/wiki/Clutter_(toolkit)&quot;&gt;Clutter&lt;/a&gt;
(hardware-accelerated 3d animated effects, whee!), and we have a
Flash-based API for external developers.  We also have
hardware-accelerated &lt;a href=&quot;http://en.wikipedia.org/wiki/H.264&quot;&gt;h.264&lt;/a&gt; video.&lt;/p&gt;

&lt;p&gt;Regardless of the technical fun, though, I have to say that the
best thing about working at litl is its management: developing with
all the other rockstars here is made the more fun by the knowledge
that management will help ensure that our goals are realistic and that
we&apos;ll be able to hit our targets, with time left over to polish before
release.  It&apos;s just much more fun to code when you know you&apos;ll be
proud of the end result.&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/58744.html</comments>
  <category>javascript</category>
  <category>olpc</category>
  <category>litl</category>
  <category>gjs</category>
  <category>gnome</category>
  <lj:security>public</lj:security>
  <lj:reply-count>5</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/58474.html</guid>
  <pubDate>Tue, 06 Oct 2009 07:40:53 GMT</pubDate>
  <title>Echo^n Square Thru A(5)</title>
  <link>http://cananian.livejournal.com/58474.html</link>
  <description>&lt;p&gt;&lt;small&gt;[Square Dance primer for computer scientists: square dance &lt;strong&gt;calls&lt;/strong&gt; are
(recursive) sequences of basic actions: walk forward, turn around, do
a square dance call.  &quot;&lt;tt&gt;U-turn back&lt;/tt&gt;&quot; is a square dance call, which
means simply &quot;turn around&quot;.  Some calls take numeric arguments:
&quot;&lt;tt&gt;square thru &lt;i&gt;N&lt;/i&gt;&lt;/tt&gt;&quot; for &lt;i&gt;N&lt;/i&gt;=1 means &quot;&lt;tt&gt;pull by&lt;/tt&gt;&quot;; &quot;&lt;tt&gt;pull by&lt;/tt&gt;&quot; is another square dance
call which is roughly &quot;step past the person you&apos;re facing&quot;.  For &lt;i&gt;N&lt;/i&gt;&amp;gt;1,
&quot;&lt;tt&gt;square thru &lt;i&gt;N&lt;/i&gt;&lt;/tt&gt;&quot; means &quot;&lt;tt&gt;pull by&lt;/tt&gt;, turn in, &lt;tt&gt;mirror square thru (&lt;i&gt;N&lt;/i&gt;-1)&lt;/tt&gt;&quot;.
The word &quot;mirror&quot; in that definition is a square dance &lt;strong&gt;concept&lt;/strong&gt;.  It
is a function which takes a square dance call and transforms it,
yielding square dance calls or actions.  &quot;&lt;tt&gt;Mirror&lt;/tt&gt;&quot; means to simply do the
call as if you were looking in a mirror, exchanging right and left.
(If you&apos;ve ever tried to comb your hair looking into the display from a
webcam, which is not mirrored the way you expect it to, you know how
hard it can be to do well-practiced actions mirror-wise.  &quot;&lt;tt&gt;Mirror&lt;/tt&gt;&quot; is a
&lt;i&gt;simple&lt;/i&gt; square dance concept.)  So the definition of &lt;tt&gt;square thru &lt;i&gt;N&lt;/i&gt;&lt;/tt&gt; I
gave above is recursive, defined in terms of a transformation of the
call itself.  The concept &quot;&lt;tt&gt;twice&lt;/tt&gt;&quot; takes a call and merely means to
repeat the call twice.&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;&lt;small&gt;Concepts can take multiple arguments, including arguments which are
themselves concepts, not just calls.  (Some would call these
&lt;a href=&quot;http://www.lynette.org/sctheory.html&quot;&gt;supercalls&lt;/a&gt; or &lt;a href=&quot;http://www.lynette.org/starwars.html&quot;&gt;meta-concepts&lt;/a&gt;, but
we&apos;ll gloss over this for now.)  Which brings us to the subject of
today&apos;s post: the ECHO concept.]&lt;/small&gt;&lt;/p&gt;

&lt;p&gt;&lt;tt&gt;&quot;ECHO &amp;lt;concept&amp;gt; &amp;lt;call&amp;gt;&lt;/tt&gt;&quot; means do &lt;tt&gt;&amp;lt;concept&amp;gt; &amp;lt;call&amp;gt;&lt;/tt&gt; then do &lt;tt&gt;&amp;lt;call&amp;gt;&lt;/tt&gt; &amp;mdash; like
you were hearing the last part of the phrase echoed back from a
distance.  So, &quot;&lt;tt&gt;ECHO mirror square thru 4&lt;/tt&gt;&quot; means do a &quot;&lt;tt&gt;mirror square
thru 4&lt;/tt&gt;&quot; and then a &quot;&lt;tt&gt;square thru 4&lt;/tt&gt;&quot;.  &quot;&lt;tt&gt;Echo twice u-turn back&lt;/tt&gt;&quot; means
u-turn back three times.&lt;/p&gt;

&lt;p&gt;Most dancers have a bit of a formal grammar in their heads, something
like:&lt;/p&gt;

&lt;pre&gt;
call: &amp;lt;simple_call&amp;gt; | &amp;lt;concept&amp;gt; &amp;lt;call&amp;gt; | &amp;lt;metaconcept&amp;gt; &amp;lt;concept&amp;gt; &amp;lt;call&amp;gt; ;
simple_call: square thru &amp;lt;number&amp;gt; | u-turn back | pull by | ... ;
concept: mirror | twice | ... ;
metaconcept: echo | ... ;

&lt;/pre&gt;
&lt;dl&gt;
&lt;dt&gt;Examples of valid utterances:&lt;/dt&gt;&lt;dd&gt;&quot;&lt;tt&gt;mirror square thru 4&lt;/tt&gt;&quot;, &quot;&lt;tt&gt;echo mirror
square thru 4&lt;/tt&gt;&quot;, &quot;&lt;tt&gt;echo twice u-turn back&lt;/tt&gt;&quot;.&lt;/dd&gt;

&lt;dt&gt;Some invalid utterances:&lt;/dt&gt;&lt;dd&gt;&quot;&lt;tt&gt;square thru 4 mirror&lt;/tt&gt;&quot;, &quot;&lt;tt&gt;mirror square&lt;/tt&gt;&quot;, &quot;&lt;tt&gt;echo mirror&lt;/tt&gt;&quot;.&lt;/dd&gt;
&lt;/dl&gt;

&lt;p&gt;Now here comes the fun part: how do you parse the expression &quot;&lt;tt&gt;echo
echo twice u-turn back&lt;/tt&gt;&quot;?&lt;/p&gt;

&lt;p&gt;It doesn&apos;t parse according to the grammar above: you have to mentally &lt;a href=&quot;http://en.wikipedia.org/wiki/Currying&quot;&gt;curry&lt;/a&gt;
an argument to make &quot;&lt;tt&gt;echo twice&lt;/tt&gt;&quot; into a concept (since when provided
with a concept the remaining part is a &apos;function taking a
call&apos;, aka a concept).  You end up with something like
&quot;&lt;tt&gt;echo (echo twice) u-turn back&lt;/tt&gt;&quot;, which would mean, &quot;&lt;tt&gt;echo twice u-turn back,
u-turn back&lt;/tt&gt;&quot;.  Thus, &quot;&lt;tt&gt;echo twice u-turn back&lt;/tt&gt;&quot; means do the u-turn back 3
times; &quot;&lt;tt&gt;echo (echo twice) u-turn back&lt;/tt&gt;&quot; thus means to do the call 4
times, and  &quot;&lt;tt&gt;echo (echo (echo twice)) u-turn back&lt;/tt&gt;&quot; is 5 times.  Adding
another echo adds another u-turn back.  &lt;strong&gt;Bo-ring&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Because we&apos;re adventurous types, let&apos;s throw the grammar out the
window and treat &lt;tt&gt;echo&lt;/tt&gt; as a simple macro-expander, which grabs
the shortest possible phrase following it as its argument.  Now we&apos;ll
parse &quot;&lt;tt&gt;echo echo twice u-turn back&lt;/tt&gt;&quot; as &quot;&lt;tt&gt;echo (echo) twice u-turn
back&lt;/tt&gt;&quot;, that is, &quot;&lt;tt&gt;echo twice u-turn back, twice u-turn back&lt;/tt&gt;&quot;.  That&apos;s 5
u-turn backs.  The next one, &quot;&lt;tt&gt;echo echo echo twice u-turn back&lt;/tt&gt;&quot;
becomes &quot;&lt;tt&gt;echo (echo) (echo (echo) twice u-turn back)&lt;/tt&gt;&quot;, which is 8.
Continuing, &quot;&lt;tt&gt;echo (echo) (echo (echo) (echo twice u-turn back))&lt;/tt&gt;&quot; is 13.
Adding more echos yields subsequent terms in the &lt;a href=&quot;http://en.wikipedia.org/wiki/Fibonacci_number&quot;&gt;Fibonacci
sequence&lt;/a&gt;.  &lt;strong&gt;Now we&apos;re talking!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;The sequence constructed above grows in duration as an exponential
function of the length of the utterance, but we already know of
another such construction: the humble &quot;&lt;tt&gt;square thru &lt;i&gt;N&lt;/i&gt;&lt;/tt&gt;&quot; also grows
exponentially with its input, since the value of its numeric argument
&quot;999...9&quot; is also exponential with the number of digits uttered.
Let&apos;s say that the goal is to allow the square dance caller time to
enjoy a nice beverage and sporting event on TV while the dancers work
out the implications of a short call.  Exponential is okay, but we
could certainly do better.&lt;/p&gt;

&lt;p&gt;Some readers might be aware of the &quot;baker&apos;s function&quot;, which naturally
involves multiplying everything by 13/12.  One might imagine &quot;&lt;tt&gt;&lt;a href=&quot;http://www.mixed-up.com/clark/&quot;&gt;Baker&lt;/a&gt;&apos;s
Square Thru 6&lt;/tt&gt;&quot; called using this function as a concept; this is
equivalent to &quot;&lt;tt&gt;square thru 6 1/2 times&lt;/tt&gt;&quot;.  (Computer scientists: define &quot;&lt;tt&gt;square
thru 1/2&lt;/tt&gt;&quot; as &quot;&lt;tt&gt;do the first half of a pull by&lt;/tt&gt;&quot; then you can continue using the
recursive definition above.)&lt;/p&gt;

&lt;p&gt;But, for packing the most dancing into the fewest words &amp;mdash;
super-exponentially! &amp;mdash; I submit &quot;&lt;tt&gt;&lt;a href=&quot;http://en.wikipedia.org/wiki/Ackermann_function&quot;&gt;Ackermann&lt;/a&gt;&apos;s
Square Thru 5&lt;/tt&gt;&quot;.  (Use f(n)=A(n,n) as computer scientists do.)
Guy Steele has suggested that the caller might use &quot;&lt;tt&gt;Ackermann&apos;s Square
Thru Your Couple Number&lt;/tt&gt;&quot;, finish the tip calling for two couples, and
then use three-couple figures for the rest of the night.  Perfect for
the lazy caller who wants to do 25% less.&lt;/p&gt;

&lt;p&gt;&lt;small&gt;(Credits: Justin Legakis discovered the Fibonacci connection.  &lt;a href=&quot;http://en.wikipedia.org/wiki/Guy_L._Steele,_Jr.&quot;&gt;Guy Steele&lt;/a&gt; had most of the good ideas here.  &lt;a href=&quot;http://www.lynette.org/sd/sd_doc.html&quot;&gt;Bill Ackerman&lt;/a&gt; is the
recipient of the eponymous super-exponential concept.  I just wrote it all up.)&lt;/small&gt;&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/58474.html</comments>
  <category>square dance</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/58238.html</guid>
  <pubDate>Mon, 05 Oct 2009 18:18:18 GMT</pubDate>
  <title>Flash Filesystems</title>
  <link>http://cananian.livejournal.com/58238.html</link>
  <description>&lt;p&gt;Dave Woodhouse in a recent article &lt;a href=&quot;http://www.advogato.org/person/dwmw2/diary/211.html&quot;&gt;calls shenanigans on
hardware translation for flash devices&lt;/a&gt;.  I agree: flash memory is
a Horse Of A Different Color, and trying to gussy it up to look like
a rotating disk of magnetized rust is using a bad and leaky abstraction that
will only end in tears.  But I don&apos;t think the engineers&apos; better
judgment will prevail: the use of hardware
translation is driven by Windows/DOS compatibility concerns, since
Microsoft (to my knowledge) has shown no desire in writing a new
filesystem for flash drives.  &lt;a href=&quot;http://en.wikipedia.org/wiki/OLPC&quot;&gt;OLPC&lt;/a&gt; used a raw flash device in the
&lt;a href=&quot;http://wiki.laptop.org/images/7/71/CL1A_Hdwe_Design_Spec.pdf&quot;&gt;XO-1&lt;/a&gt;, but in their &lt;a href=&quot;http://wiki.laptop.org/go/XO-1.5&quot;&gt;follow-on&lt;/a&gt; had to switch to a hardware-translation device
because market/scale economics were making those
devices cheaper and cheaper while the original raw flash device was
(a) not increasing in volume (aka, getting relatively more expensive),
(b) not increasing in size (no one wanted to make new ones), and
(c) getting discontinued (aka, impossible to buy).  The best
one can hope for is that a raw interface be offered &lt;i&gt;in addition&lt;/i&gt; to
the standard &quot;Windows-compatible&quot; one, for specialized embedded or
high-performance applications &amp;mdash; but the chicken and egg problem applies:
until there are compelling gains, these interfaces won&apos;t be purchased
in sufficient volumes to yield reasonable prices, and no one is
writing the optimized filesystems because you can&apos;t find
reasonably-priced flash devices to run them on.
The end result is likely to be that &lt;a href=&quot;http://www.jwz.org/doc/worse-is-better.html&quot;&gt;Worse Is Better&lt;/a&gt;, and we&apos;ll be left
with another set of legacy chains.  Given enough time and transistors,
the hardware may eventually grow Heroic Measures to work
around the bad abstraction (see: the x86 instruction set).&lt;/p&gt;

&lt;p&gt;If your filesystem is large enough and the amount of data
being rewritten small enough, the flash problems &quot;probably&quot;
won&apos;t bite you until after the obsolescence of the device &amp;mdash; flash storage
doesn&apos;t have to be good, it just has to be &quot;not too bad&quot; until, say, 3
years after purchase.  Like non-removable rechargeable batteries that
slowly degrade over time, you&apos;ll find your filesystem slowly
degrading &amp;mdash; one more reason to eventually buy a new one, and I&apos;ve never
known manufacturers to be especially sorry about that.  Heroic Measures may never be needed/taken.&lt;/p&gt;

&lt;p&gt;Leaving amateur market economics (and despair), let&apos;s revisit a cryptic and probably overlooked
paragraph in my &lt;a href=&quot;http://wiki.laptop.org/go/Olpcfs#Implementations_on_flash_memory&quot;&gt;olpcfs&lt;/a&gt; proposal:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Implementations tuned for flash memory can use &lt;a href=&quot;http://doi.acm.org/10.1145/1292609.1292616&quot; class=&quot;external text&quot; title=&quot;http://doi.acm.org/10.1145/1292609.1292616&quot; rel=&quot;nofollow&quot;&gt;Adaptive Packed Memory Arrays&lt;/a&gt; for efficient CAS.  This is an open research topic, but there is some evidence that a high-performance scalable flash-based filesystem can more profitably be implemented using cache-oblivious B-Trees and APMAs, rather than more &quot;traditional&quot; filesystem structures.
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Here I&apos;m trying to build a little bridge between filesystem designers
and functional data structure researchers, two groups who probably
rarely sit down together for a beer.  I think &lt;a href=&quot;http://doi.acm.org/10.1145/1292609.1292616&quot;&gt;Packed Memory Arrays&lt;/a&gt; are
the &quot;B-trees of flash filesystems&quot;: a better way to build an on-disk
index given the peculiar characteristics of flash memory.  Just as
&lt;a href=&quot;http://en.wikipedia.org/wiki/Be_File_System&quot;&gt;BeOS&lt;/a&gt; demonstrated that your filesystem could be &quot;B-trees all the way
down&quot;, I believe you could build a compelling filesystem using PMAs as
the primary data structure.  Ultimately, I suspect that the
development strategy Dave Woodhouse describes &amp;mdash; small incremental
changes to existing filesystems whose philosophies are &quot;close enough&quot;
&amp;mdash; will probably prevail over a ground-up PMA rewrite.  Incremental
improvements and shared codebases are the Right Strategy for
successful open source projects: you get more developers and testers
for those parts which aren&apos;t flash-specific, and you&apos;ve already gotten
yourself out of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Cathedral_and_the_Bazaar&quot;&gt;Cathedral&lt;/a&gt; with some working code to kick things off.&lt;/p&gt;

&lt;p&gt;But if anyone&apos;s interested in attempting a clean slate design, PMAs are
my advice.  Maybe you&apos;ll come up with something so wonderful it will
make a compelling &lt;a href=&quot;http://www.nobius.org/~dbg/practical-file-system-design.pdf&quot;&gt;book&lt;/a&gt; (and inspire folks like me), even if
ultimately you don&apos;t win in the marketplace.&lt;/p&gt;

&lt;p&gt;(But maybe you&apos;ll win!  Flash storage and your optimized filesystem will prevail, and one day we&apos;ll think of rotating media in the same way we now think of core memory, floppy disks, tape drives, and the x86 instruction set... er, hmm.)&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/58238.html</comments>
  <category>olpcfs</category>
  <category>olpc</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/58022.html</guid>
  <pubDate>Sun, 13 Sep 2009 03:43:32 GMT</pubDate>
  <title>JDoctest 1.5 released</title>
  <link>http://cananian.livejournal.com/58022.html</link>
  <description>I&apos;ve released &lt;a href=&quot;http://cscott.net/Projects/JDoctest/&quot;&gt;JDoctest 1.5&lt;/a&gt;, with support for integrating Javascript doctests of your Java code into the &lt;a href=&quot;http://junit.org&quot;&gt;JUnit&lt;/a&gt; test framework.  I use this to implement &lt;a href=&quot;http://groups.csail.mit.edu/pag/continuoustesting/&quot;&gt;continuous testing&lt;/a&gt;.</description>
  <comments>http://cananian.livejournal.com/58022.html</comments>
  <category>javascript</category>
  <category>jdoctest</category>
  <category>java</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/57834.html</guid>
  <pubDate>Mon, 24 Aug 2009 15:58:10 GMT</pubDate>
  <title>Waiting for Godot/the 87 bus</title>
  <link>http://cananian.livejournal.com/57834.html</link>
  <description>&lt;p&gt;A: What time?&lt;br /&gt;B: Should be here at 11:30&lt;br /&gt;A: 2, 3 minutes. (spits)&lt;br /&gt;Pause.&lt;br /&gt;A: Look.  Here.&lt;br /&gt;B: Davis at 11:22.  But that&apos;s down there.&lt;br /&gt;A: 2, 3 minutes.&lt;br /&gt;B: Yeah.  11:30.&lt;br /&gt;Pause.&lt;br /&gt;A: Maybe look, you see yet?&lt;br /&gt;B: No, no, I can&apos;t see past the construction.&lt;br /&gt;A: 2, 3 minutes.  No more.&lt;br /&gt;A: It&apos;s hot.  Inside my house, 90% humidity. Outside: 100.&lt;br /&gt;Pause.&lt;br /&gt;A: How old are you? 26? 28?&lt;br /&gt;B: No, 32. (looks down street)&lt;br /&gt;A: You see?&lt;br /&gt;B: No, not yet.&lt;br /&gt;A: 2, 3 minutes. (spits)&lt;br /&gt;Pause.&lt;br /&gt;A: Maybe 10.&lt;br /&gt;Pause.&lt;br /&gt;A: You married?&lt;br /&gt;B: No.&lt;br /&gt;Pause.&lt;br /&gt;A: Maybe is better.&lt;br /&gt;Pause&lt;br /&gt;A: You&apos;re 26?&lt;br /&gt;B: 32.&lt;br /&gt;A: I was 28.&lt;br /&gt;Pause&lt;br /&gt;A: You see yet?&lt;br /&gt;B: No.  I can&apos;t see. (shrugs)&lt;br /&gt;A: 2, 3 minutes. (spits)&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;small&gt;Posted via &lt;a href=&quot;http://community.livejournal.com/cosysoftware_en/&quot;&gt;LiveJournal.app&lt;/a&gt;.&lt;/small&gt;&lt;/em&gt;&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/57834.html</comments>
  <category>found drama</category>
  <category>godot</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/57486.html</guid>
  <pubDate>Tue, 04 Aug 2009 15:54:51 GMT</pubDate>
  <title>Sugar waves: time to get started!</title>
  <link>http://cananian.livejournal.com/57486.html</link>
  <description>While I was abroad, it seems that Google &lt;a href=&quot;http://googlewavedev.blogspot.com/2009/07/google-wave-federation-protocol-and.html&quot;&gt;released their wave server/federation code&lt;/a&gt;.  So you can now get started tackling some of the projects I outlined in &lt;a href=&quot;http://cananian.livejournal.com/56585.html&quot;&gt;my previous post on Waves and Sugar&lt;/a&gt;: getting a basic federation server running on the school server and/or writing a server running locally on the XO which exports the content of the Journal/filesystem for collaboration.  I&apos;m hoping someone other than me thinks this is an exciting idea, and runs with it!</description>
  <comments>http://cananian.livejournal.com/57486.html</comments>
  <category>journal</category>
  <category>sugar</category>
  <category>olpc</category>
  <category>google wave</category>
  <category>google</category>
  <category>journal2</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/57130.html</guid>
  <pubDate>Mon, 03 Aug 2009 16:03:55 GMT</pubDate>
  <title>OLPC kerfuffle</title>
  <link>http://cananian.livejournal.com/57130.html</link>
  <description>&lt;p&gt;It seems I missed a nice little &lt;a href=&quot;http://linux.slashdot.org/story/09/07/20/1628228/Negroponte-Sees-Sugar-As-OLPCs-Biggest-Mistake&quot;&gt;Slashdot&lt;/a&gt;/&lt;a href=&quot;http://www.zdnetasia.com/insight/hardware/0,39043471,62056166,00.htm&quot;&gt;Negroponte&lt;/a&gt;/&lt;a href=&quot;http://radian.org/notebook/nonsense-omelet&quot;&gt;Krstić&lt;/a&gt; OLPC/Sugar row while I was away in Europe savoring the efficient intercity rail.  While Tomeu and OLPCnews choose to blame particular words or phrases (&quot;&lt;a href=&quot;http://blog.tomeuvizoso.net/2009/07/on-negropontes-omelettes.html&quot;&gt;Sugar&lt;/a&gt;&quot;, &quot;&lt;a href=&quot;http://www.olpcnews.com/people/negroponte/olpc_biggest_mistake_sugar.html&quot;&gt;$100 laptop&lt;/a&gt;&quot;), both &lt;a href=&quot;https://www.blogger.com/comment.g?blogID=664175667937540078&amp;amp;postID=4369316166455399161&quot;&gt;J5&lt;/a&gt; and &lt;a href=&quot;http://gregdek.livejournal.com/52052.html&quot;&gt;gregdek&lt;/a&gt; seem to think the Real Problem was the fact that OLPC wouldn&apos;t upstream its patches.&lt;/p&gt;
&lt;p&gt;I beg to disagree.  As I &lt;a href=&quot;http://gregdek.livejournal.com/52052.html?view=385876#t385876&quot;&gt;wordily tried to explain&lt;/a&gt; in a comment to gregdek&apos;s post, I think Ivan is mostly right here: OLPC tried to do &quot;seven new things&quot; (as Mary Lou explained to me when I was hired) -- and &quot;new things&quot; end up costing a lot of debugging and development time, in one of the Iron Laws Of Writing New Code And Making New Hardware.  But another problem was just Picking The Wrong Partners.  With the exception of the display (one of the few unalloyed successes of the XO hardware), most of our hardware and software partners were working at cross purposes.  Red Hat didn&apos;t really want to build an embedded OS product, &quot;mesh networking&quot; to Marvel meant household networks between your TV and your stereo with maybe 10 participants, the Geode was an orphaned offering from AMD, the display and flash NAND controller was a unloved one-off, etc.  Success is found by aligning your partners&apos; interests with your own.&lt;/p&gt;
&lt;p&gt;At Litl our OS partner has many other embedded-systems clients, and has developed the toolsets to handle forks and customization without all the angst I&apos;d grown used to at OLPC.  We just say, &quot;we need feature X turned on/off&quot; or &quot;set to Y&quot; or just &quot;somehow Z needs to happen&quot; and it&apos;s done.  We&apos;re not fighting, we&apos;re not destabilizing their core OS, we don&apos;t waste time with elaborate justifications why This Is The Right Thing To Do.  If the change is appropriate to upstream, they upstream it, and maybe the work benefits the other embedded-systems clients.  There&apos;s no drama, because We All Want The Same Thing.&lt;/p&gt;
&lt;p&gt;I think &quot;upstreaming&quot; is entirely the wrong hero for OLPC here.  If anything, I think OLPC&apos;s best hope is to continue to &lt;b&gt;aggressively innovate&lt;/b&gt; -- no one buys a computer because its code has been upstreamed.  Unfortunately, I don&apos;t think OLPC has enough current funding to do anything but follow the upstream, so maybe this current round of praise for Fedora-ization is just the old cliché: making a virtue of necessity.&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/57130.html</comments>
  <category>sugar</category>
  <category>olpc</category>
  <category>litl</category>
  <category>negroponte</category>
  <lj:security>public</lj:security>
  <lj:reply-count>1</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/57019.html</guid>
  <pubDate>Wed, 08 Jul 2009 18:20:53 GMT</pubDate>
  <title>SDR 0.5</title>
  <link>http://cananian.livejournal.com/57019.html</link>
  <description>&lt;p&gt;Over the 4th of July weekend, I released &lt;a href=&quot;http://cscott.net/Projects/SDR/&quot;&gt;SDR 0.5&lt;/a&gt;, now with a &lt;a href=&quot;http://code.google.com/webtoolkit/&quot;&gt;&lt;abbrev title=&quot;Google Web Toolkit&quot;&gt;GWT&lt;/abbrev&gt;&lt;/a&gt;/&lt;a href=&quot;http://code.google.com/appengine/&quot;&gt;&lt;abbrev title=&quot;Google App Engine&quot;&gt;GAE&lt;/abbrev&gt;&lt;/a&gt; frontend you can check out at &lt;a href=&quot;http://square-dance.appspot.com&quot;&gt;square-dance.appspot.com&lt;/a&gt;.  It&apos;s still incomplete -- breathing and collision resolution need to be hooked up, it doesn&apos;t do &quot;centers X sides Y&quot; yet, and it&apos;s missing &lt;i&gt;lots&lt;/i&gt; of call definitions -- but at least there&apos;s something tangible to play with that doesn&apos;t require mucking around in a javascript shell.  Progress!&lt;/p&gt;
&lt;p&gt;
(Oh, and if you click &apos;+&apos; and then &apos;Add to Home Screen&apos; when looking at &lt;a href=&quot;http://square-dance.appspot.com&quot;&gt;square-dance.appspot.com&lt;/a&gt; in Safari on your iPhone, you get a cute &quot;there&apos;s an app for that&quot; mobile version.)&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/57019.html</comments>
  <category>sdr</category>
  <category>iphone</category>
  <category>square dance</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/56585.html</guid>
  <pubDate>Sat, 30 May 2009 22:18:40 GMT</pubDate>
  <title>Google Wave and Sugar: what&apos;s next?</title>
  <link>http://cananian.livejournal.com/56585.html</link>
  <description>&lt;p&gt;So, yesterday I posted a entry discussing how &lt;a href=&quot;http://wave.google.com&quot;&gt;Google Wave&lt;/a&gt; actually implements the collaborative vision Sugar (and OLPC) were working towards.  (It&apos;s a shame we didn&apos;t have better contacts with Google while I was at OLPC; Google was actually on OLPC&apos;s board, and beta-ing Waves would have been a very fruitful partnership.)&lt;/p&gt;
&lt;p&gt;If you agree with the premise: what should the next steps in a Waves-ification of Sugar be?  Eventually Google promises to release &quot;the lion&apos;s share&quot; of its source code, for both server and client, so getting the google server installed on the school server is one task &amp;mdash; but not one which can be done immediately.  Implementing &lt;a href=&quot;http://wiki.laptop.org/index.php?title=Network_principles&amp;amp;oldid=154537&quot;&gt;Network Principles&lt;/a&gt; is another necessary precondition, in order to use Wave&apos;s DNS-based participant naming system (&quot;SuzyQStudent@lima.peru.schoolserver.laptop.org&quot; or whatever).  That&apos;s something which can be done now.  What else?
&lt;/p&gt;
&lt;p&gt;Eventually, when the source code drops, making the waves client work offline would be important, since Waves (and embedded gadgets) basically replace Write and Sugar&apos;s bulletin board.  Waves edit XML trees, so porting existing activities to use XML-based file formats will go far in integrating them into a new Wave World Order.  I haven&apos;t seen any demo of a waves-based drawing activity/gadget (tuxpaint is a favorite of most kids), so Waves Paint would be a fun project if you want to start playing with the Waves extension APIs.&lt;/p&gt;
&lt;p&gt;More controversially, work on Waves-enabling a next-gen &lt;a href=&quot;http://cananian.livejournal.com/tag/journal2&quot;&gt;Journal&lt;/a&gt; could be interesting.  As predicted by proponents of the Journal for some time, the &quot;wave of the future&quot; (so to speak) is filesystem-independent storage.  Waves in Google&apos;s demo are titled and searched like email messages, not as &quot;documents&quot; in a filesystem hierarchy.  However, we had repeated requests to unify Journal storage and traditional filesystems, for (a) better interoperability with existing systems, and (b) sneakernet collaboration.  In my mind, this would mean exporting a waves-like view of an existing filesystem, as I proposed for the Journal, where directories are interpreted as slightly-special tag markers.  One could imagine implementing a &quot;Wave Server&quot; based around this idea, in effect using the filesystem as the wave database.  With the magic of Wave Federation, these &quot;filesystem&quot; waves can interoperate with other wave clients and servers.  This standalone file-based server might also server as the basis for &quot;one child under a tree&quot; wave editing.  (For that matter, a robust sneakernet implementation of the Wave Federation Protocol would also be very useful!)&lt;/p&gt;
&lt;p&gt;Exciting times!  Wave promises to bring OLPC/Sugar&apos;s vision of ubiquitous collaboration to life at long last.  Google has the funding and development resources to tackle what is in effect a bottom-up reorganization of the software stack.  OLPC/SugarLab&apos;s role is peripheral but vital: strongly lead the development of offline or &quot;flakey connectivity&quot; aspects of this technology so that it can be used everywhere from the solar-powered jungle to the dense urban cities, and to provide the educational software on top of the platform so that kids can *learn* as they collaborate and create.&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/56585.html</comments>
  <category>journal</category>
  <category>sugar</category>
  <category>olpc</category>
  <category>google wave</category>
  <category>google</category>
  <category>journal2</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/56338.html</guid>
  <pubDate>Thu, 28 May 2009 21:24:33 GMT</pubDate>
  <title>Google Waves of Sugar</title>
  <link>http://cananian.livejournal.com/56338.html</link>
  <description>&lt;p&gt;Google announced &lt;a href=&quot;http://wave.google.com/&quot;&gt;Google Wave&lt;/a&gt; today, an &quot;attempt to imagine what email would be like if it were invented today&quot;.  It has a robust collaboration infrastructure &lt;a href=&quot;http://www.waveprotocol.org/whitepapers&quot;&gt;strongly grounded in distributed systems theory&lt;/a&gt;.  If I were (re)starting the OLPC project today, this is certainly what I&apos;d base Sugar on &amp;mdash; with as much corporate support from Google as possible, since the project is strongest when it has strong allies.
&lt;/p&gt;&lt;p&gt;
I believe you could make each school server into a &lt;a href=&quot;http://www.waveprotocol.org/whitepapers/google-wave-architecture&quot;&gt;Wave Provider&lt;/a&gt;, using the &lt;a href=&quot;http://wiki.laptop.org/index.php?title=Network_principles&amp;amp;oldid=154537&quot;&gt;Network Principles&lt;/a&gt; I drafted while employed at OLPC to ensure appropriate DNS-style naming.  Any document format based on XML can be made collaborative using the &lt;a href=&quot;http://www.waveprotocol.org/whitepapers/operational-transform&quot;&gt;Operational Transform&lt;/a&gt; mechanism.  The journal&apos;s large scale history/versioning mechanism could be based on the same principles, as &lt;a href=&quot;http://doi.acm.org/10.1145/958160.958194&quot;&gt;So6/LibreSource&lt;/a&gt; demonstrated.  And the UI demonstrated in the keynote (which I haven&apos;t even fully watched yet) would be an exciting way to implement the neglected &lt;a href=&quot;http://wiki.sugarlabs.org/go/Design_Team/Human_Interface_Guidelines/The_Laptop_Experience/Bulletin_Boards&quot;&gt;Bulletin Board&lt;/a&gt; feature.
&lt;/p&gt;&lt;p&gt;
It would be an exciting start to the Sugar project!  But given the existing code base, is there now too much bathwater around the baby to consider swapping the child out?&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/56338.html</comments>
  <category>sugar</category>
  <category>olpc</category>
  <category>google wave</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/56302.html</guid>
  <pubDate>Sat, 09 May 2009 16:58:35 GMT</pubDate>
  <title>Science</title>
  <link>http://cananian.livejournal.com/56302.html</link>
  <description>&lt;p&gt;I liked the new Star Trek movie, but I wish they&apos;d paid &lt;i&gt;some&lt;/i&gt; attention to physics.  When the main technical substance is named &quot;red matter,&quot; you know the science consultant isn&apos;t on call.  C&apos;mon, name it Rubidium Dilanthumide or something -- technobabble&apos;s not hard if you&apos;re &lt;i&gt;trying at all&lt;/i&gt;.&lt;/p&gt;&lt;p&gt;But it was the orbital mechanics that really annoyed me.  You can&apos;t, y&apos;know, just &lt;i&gt;drop a spiky anchor&lt;/i&gt; straight down to earth from orbit.  Nor can you &quot;fall&quot; out of the belly of a space plane: you&apos;re already falling.  That&apos;s what being in orbit &lt;i&gt;is&lt;/i&gt;.  And there&apos;s this thing called an atmosphere?  You ever heard about it?  Air resistance?  Friction? It makes things &lt;i&gt;hot&lt;/i&gt;.  And winds!  C&apos;mon, at least give your unanchored space tether thingy some sort of guidance rockets along it&apos;s length to keep it going &quot;straight down&quot;.  It would make it &lt;i&gt;cooler&lt;/i&gt;.  Your heroes rocketing down, enveloped in huge plasma fireballs, dodging the giant blasts from the cable&apos;s guidance jets... It would be science-tastic.&lt;/p&gt;&lt;p&gt;Also, Starfleet: the bottom of a gravity well is not a great place to build an Enterprise.  How exactly did you get that thing up into orbit?  Without setting the corn fields on fire, I mean.  Maybe another long spiky anchor chain lowered from space?  And some hamsters in a wheel to crank it up?&lt;/p&gt;&lt;p&gt;And while I&apos;m ranting about atmospheric physics: although I liked Spock&apos;s ship&apos;s dramatic swoop down into the atmosphere as a popcorn-munching crowd pleaser, from an orbital mechanics standpoint?  Not so much.  There&apos;s all this &lt;i&gt;atmosphere&lt;/i&gt; in the way, and that&apos;s a &lt;i&gt;space&lt;/i&gt; ship.  And you thrust &lt;i&gt;backwards&lt;/i&gt; to go &quot;down&quot; from orbit.  And the scale&apos;s all wrong w.r.t. the length of the &quot;drill cable&quot; and the distance to orbit and the color of the sky and amount of atmosphere... but I can probably stop now.&lt;/p&gt;&lt;p&gt;Dear JJ Abrams: please hire someone who knows something about &lt;i&gt;space&lt;/i&gt; for your sequel.  I can deal with conventions like &quot;explosions in space still make sounds&quot; because it&apos;s more fun that way and &quot;artificial gravity onboard all ships&quot; because it makes the filming affordable-- but I expect at least a token attempt to make orbital space something other than a really dark room high up.&lt;/p&gt;&lt;p&gt;&lt;em&gt;&lt;small&gt;Posted via &lt;a href=&quot;http://community.livejournal.com/cosysoftware_en/&quot;&gt;LiveJournal.app&lt;/a&gt;.&lt;/small&gt;&lt;/em&gt;&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/56302.html</comments>
  <category>star trek</category>
  <category>science</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/56033.html</guid>
  <pubDate>Fri, 01 May 2009 15:10:22 GMT</pubDate>
  <title>Somerville Open Studios!</title>
  <link>http://cananian.livejournal.com/56033.html</link>
  <description>&lt;p&gt;I&apos;m one of the painters participating in &lt;a href=&quot;http://www.somervilleopenstudios.org/artists/artist_profile.php?artistID=798&quot;&gt;Somerville Open Studios&lt;/a&gt; this weekend: Sat/Sun noon-6pm, 40 Quincy St.  Come on by and see some of my paintings!  Mars, dogs, square dancers, swamps, and &lt;a href=&quot;http://en.wikipedia.org/wiki/Golden_spiral&quot;&gt;golden spirals&lt;/a&gt; will be ably represented.  I regret that I wasn&apos;t able to complete my ironic juxtaposition painting pitting &lt;a href=&quot;http://en.wikipedia.org/wiki/Fermat&amp;#39;s_spiral&quot;&gt;Fermat&apos;s spiral&lt;/a&gt; against fibonacci&apos;s sequence; you&apos;ll have to wait until next year for that one.&lt;/p&gt;
&lt;a href=&quot;http://cscott.net/Images/SOS09.pdf&quot;&gt;&lt;img src=&quot;http://cscott.net/Images/SOS09.png&quot; /&gt;&lt;/a&gt;</description>
  <comments>http://cananian.livejournal.com/56033.html</comments>
  <category>painting</category>
  <category>phyllotaxis</category>
  <category>terraforming</category>
  <category>square dance</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/55572.html</guid>
  <pubDate>Tue, 10 Mar 2009 18:54:01 GMT</pubDate>
  <title>SDR 0.4; JDoctest 1.4</title>
  <link>http://cananian.livejournal.com/55572.html</link>
  <description>I released &lt;a href=&quot;http://cscott.net/Projects/SDR&quot;&gt;SDR 0.4&lt;/a&gt; last night (while watching a fabulous Woz on Dancing With the Stars), and &lt;a href=&quot;http://cscott.net/Projects/JDoctest/&quot;&gt;JDoctest 1.4&lt;/a&gt;.  SDR&apos;s release mostly signifies that I&apos;m finally moving on from the breathing code; JDoctest has a number of minor improvements.</description>
  <comments>http://cananian.livejournal.com/55572.html</comments>
  <category>sdr</category>
  <category>woz</category>
  <category>jdoctest</category>
  <category>square dance</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/55355.html</guid>
  <pubDate>Tue, 17 Feb 2009 23:08:58 GMT</pubDate>
  <title>Found a litl work</title>
  <link>http://cananian.livejournal.com/55355.html</link>
  <description>&lt;p&gt;I started work at &lt;a href=&quot;http://litl.com&quot;&gt;litl&lt;/a&gt; yesterday, did all the necessary administrivia and got a build environment set up, and am typing this today using their software stack.  There are a lot of similarities between my old and new jobs: both target poorly served &quot;nonexpert&quot; audiences &amp;mdash; in litl&apos;s case, families at home &amp;mdash; and are taking advantage of the opportunity to build a clean-slate integrated hardware/software solution that&apos;s new and different and not another rehash of the &lt;a href=&quot;http://en.wikipedia.org/wiki/Common_Desktop_Environment&quot;&gt;Common Desktop Environment of 1993&lt;/a&gt;.  Both litl and OLPC write highly design-driven software and employ some of the same &lt;a href=&quot;http://pentagram.com/en/portfolio/interactive/one-laptop-per-child.php&quot;&gt;design&lt;/a&gt; &lt;a href=&quot;http://other90.cooperhewitt.org/Design/one-laptop-per-child&quot;&gt;firms&lt;/a&gt;, so there are more subtle aesthetic similarities as well.&lt;/p&gt;
&lt;p&gt;
The most sobering difference (for me) is the effective organization at litl.  After spending years fighting uphill battles at OLPC, it&apos;s refreshing to find what seems a model development environment: clear and explicit specifications for new features, release notes that incorporate the specs (with green annotations indicating future features or deviations), and test cases.  Lots of test cases &amp;mdash; both in the code for machine use, and written in English for people to use.
&lt;/p&gt;
&lt;p&gt;
This isn&apos;t rocket science.  But writing specifications for a complete software/hardware system is not a little work, and as you become more ambitious the difficulty increases.  Both OLPC&apos;s &lt;a href=&quot;http://en.wikipedia.org/wiki/Sugar_(GUI)&quot;&gt;Sugar&lt;/a&gt; and litl reinvent the standard desktop paradigm, so you can&apos;t take even &quot;the program launches when you click on it&quot; for granted: you have to define every such interaction (what does &quot;the program&quot; mean?), how it should work, and test that it does so.  Software at OLPC never quite made the transition from self-directed research project to production code.  It saddens me to think what might have been if OLPC had been able to either properly develop Sugar, or successfully contract out the work &amp;mdash; if only it was *Sugar* with the careful 200-page spec, exact lists of features implemented/in-process, heaps of test cases, and proper staging of features...
&lt;/p&gt;
&lt;p&gt;
As part of a &lt;a href=&quot;http://aquent.com&quot;&gt;much larger company&lt;/a&gt;, litl also avoids the self-hosting trap.  Email, HR, site hosting, databases, bug trackers, and collaboration support for the devel team are all sourced out to companies who do it well, so precious development time isn&apos;t wasted by having your rock star developers installing ubuntu for the 13th time on some new server, upgrading, doing backups, moving machines from one network to the next, tuning trac, etc.  Some of this is inevitable, and some is actually necessary -- sometimes there *is* a vital business need for some tool which it&apos;s easier to have in-house and patch &amp;mdash; but OLPC was suckered into bad decisions by the lure of fast free bandwidth from MIT.  At OLPC we didn&apos;t have to pay for hosting or bandwidth as long as we kept our servers under our desks &amp;mdash; so we ended up paying far more than we saved in lost developer hours as we tinkered.
&lt;/p&gt;
&lt;p&gt;
Anyway, I&apos;m looking forward to the change of pace and to actually delivering the features in the spec!  At least one of my OLPC friends will be joining me, and litl is hiring (although they self-describe as &quot;a small team of rockstars&quot;); I can point you in the right direction if you want to learn more about working here.&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/55355.html</comments>
  <category>olpc</category>
  <category>litl</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/55146.html</guid>
  <pubDate>Sat, 14 Feb 2009 22:48:02 GMT</pubDate>
  <title>Migrated repositories to git</title>
  <link>http://cananian.livejournal.com/55146.html</link>
  <description>I&apos;ve been slowly migrating my CVS repositories to git.  The &lt;a href=&quot;http://flex.cscott.net&quot;&gt;FLEX compiler repository&lt;/a&gt; (my decade of thesis work at MIT) and &lt;a href=&quot;http://cscott.net/Projects/JUtil&quot;&gt;JUtil&lt;/a&gt; are now newly git-ified -- and I&apos;ve released version 1.4 of JUtil in the process, for good measure.  I&apos;ve also added &lt;a href=&quot;https://www.ohloh.net/p/flexc&quot;&gt;FLEX&lt;/a&gt; and &lt;a href=&quot;https://www.ohloh.net/p/jutil&quot;&gt;JUtil&lt;/a&gt; to ohloh, for good measure.  Enjoy!</description>
  <comments>http://cananian.livejournal.com/55146.html</comments>
  <category>jutil</category>
  <category>flex</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/54907.html</guid>
  <pubDate>Sat, 14 Feb 2009 00:03:15 GMT</pubDate>
  <title>SDR can partner trade</title>
  <link>http://cananian.livejournal.com/54907.html</link>
  <description>I&apos;ve released &lt;a href=&quot;http://cscott.net/Projects/SDR/&quot;&gt;Square Dance Revolution 0.3&lt;/a&gt;.  It still doesn&apos;t do anything terribly useful yet, but its square dance engine can do a partner trade now (barely).  Contrary to the advice I always give others, I haven&apos;t developed SDR in the &quot;crappy first draft, then refine&quot; style -- since it&apos;s primarily for my own enjoyment, I&apos;ve spent lovely leisurely hours playing with grammars, grammar generators, &lt;a href=&quot;http://cscott.net/Projects/JDoctest/&quot;&gt;doctesting&lt;/a&gt;, drafting 3d models of &lt;a href=&quot;http://webpages.charter.net/baypath/&quot;&gt;Baypath Barn&lt;/a&gt;, and other such fun stuff.  It&apos;s classic cathedral development: it may take years of off-hours, but boy will it be lovely when it&apos;s done!</description>
  <comments>http://cananian.livejournal.com/54907.html</comments>
  <category>sdr</category>
  <category>square dance</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/54572.html</guid>
  <pubDate>Sat, 07 Feb 2009 08:33:01 GMT</pubDate>
  <title>JDoctest!</title>
  <link>http://cananian.livejournal.com/54572.html</link>
  <description>&lt;p&gt;The Python &lt;a href=&quot;http://docs.python.org/lib/module-doctest.html&quot;&gt;doctest&lt;/a&gt; module is really great: it makes it easy to simultaneously write test suites and demonstrate the usage for your modules.  Python&apos;s interactive interpreter is key to its coolness: it&apos;s really easy to load the code you&apos;re working on, type some examples at the prompt, and turn the session into documentation and a test case.&lt;/p&gt;
&lt;p&gt;I&apos;ve been dusting off my &lt;a href=&quot;http://cscott.net/Projects/SDR/&quot;&gt;Square Dance Revolution&lt;/a&gt; project, written in Java, and I thought: gee, it would be nice to use doctests here.  A bit of inspiration from &lt;a href=&quot;http://code.google.com/p/doctestj/&quot;&gt;doctestj&lt;/a&gt; and &lt;a href=&quot;http://blog.norrisboyd.com/2008/03/doctest-in-rhino.html&quot;&gt;Rhino&lt;/a&gt;, and a bit of elbow grease and: voila!  &lt;a href=&quot;http://cscott.net/Projects/JDoctest/&quot;&gt;JDoctest is born!&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://cscott.net/Projects/JDoctest/&quot;&gt;JDoctest&lt;/a&gt; is a Javadoc plugin which implements doctests by calling out to the Rhino javascript interpreter.  Rhino&apos;s interactive javascript session makes Java as fun to program in / debug / test as Python is.  (Rhino makes it &lt;a href=&quot;http://www.mozilla.org/rhino/ScriptingJava.html&quot;&gt;easy to call between Javascript and Java&lt;/a&gt;.) Copy and paste those examples into javadoc comments, add a &lt;code&gt;@doc.test&lt;/code&gt; tag, and you&apos;ve got a test / use case example.  I&apos;ve added hooks to &lt;a href=&quot;http://code.google.com/p/google-code-prettify/&quot;&gt;google-code-prettify&lt;/a&gt; to make the output beautiful, too.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;http://cscott.net/Projects/JDoctest/jdoctest-latest/api/net/cscott/jdoctest/JDoctest.html&quot;&gt;Here&apos;s a simple example&lt;/a&gt; using JDoctest, and the SDR sources are now filled with more complex examples (for &lt;a href=&quot;http://cscott.net/Projects/SDR/sdr-latest/doc/net/cscott/sdr/calls/package-summary.html#package_description&quot;&gt;example&lt;/a&gt;). (New SDR release soon, I promise.)  Enjoy!&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/54572.html</comments>
  <category>sdr</category>
  <category>jdoctest</category>
  <category>java</category>
  <category>doctest</category>
  <category>python</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/54295.html</guid>
  <pubDate>Thu, 29 Jan 2009 21:29:23 GMT</pubDate>
  <title>Making shut-the-box fair</title>
  <link>http://cananian.livejournal.com/54295.html</link>
  <description>The standard game of &quot;shut the box&quot;, analyzed in &lt;a href=&quot;http://cananian.livejournal.com/tag/shut+the+box&quot;&gt;previous posts&lt;/a&gt;, has a fundamental flaw: it&apos;s not fair!  On average in a two-player game, the first player will lose 2.5% of their stake in each game.  Can we make a more fair two-player game?&lt;br /&gt;&lt;br /&gt;The simplest solution is to change how ties are treated: with optimal strategies, 1% of the games end in ties.  We can resolve all ties in favor of the first player, but that&apos;s not good enough.  We actually need to treat ties like box-shutting, and award double payoffs.  And it&apos;s still not enough, especially since the 2nd player can alter their strategy to avoid ties if they become too painful.&lt;br /&gt;&lt;br /&gt;So let&apos;s leave ties alone, and alter the box-shutting payoff.  Although the 2nd player has an advantage in the points race, because they know what 1st player score they have to beat, the 1st player has an advantage in shutting the box: if there are able to do so, the game ends immediately and the 2nd player doesn&apos;t have a turn.  The 2nd player doesn&apos;t have the opportunity to, for example, achieve a shut box themselves, tying the game.&lt;br /&gt;&lt;br /&gt;In the standard game, box-shutting pays out double: if everyone had to put up a $1 stake to play, then they have to pay another $1 to the player who is able to shut the box.  We&apos;ll call this a &quot;2x&quot; payout.  Even odds work out to a 3.8x payout (accounting for the fact that optimal strategies change as the payout rises).  It would be a little awkward to ante up $2.80 a person in a $1 ante game, but it turns out that a 4x payout ($3 more from each person on a shut box) is probably okay: this only gives the 1st player a 0.1% advantage.  That might be enough for a casino to live on, but it&apos;s probably acceptable among friends.&lt;br /&gt;&lt;br /&gt;Another way to even the odds is to force the players to alternate turns.  This is hard in the physical game, where there&apos;s only one physical box with tiles, but it is natural in a computer version of shut-the-box &amp;mdash; and it probably improves gameplay by elimininating the long waits between a player&apos;s turns.  The first player still has a slight advantage, but computation indicates that this advantage is limited to 0.4% of the stake (&quot;acceptable among friends&quot;).  It&apos;s hard to compute optimal strategies in a 3 player game, due to combinatorial explosion, but it appears the first player&apos;s advantage grows as the number of players does.</description>
  <comments>http://cananian.livejournal.com/54295.html</comments>
  <category>shut the box</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/54085.html</guid>
  <pubDate>Thu, 29 Jan 2009 21:01:31 GMT</pubDate>
  <title>Even more shutting of boxes.</title>
  <link>http://cananian.livejournal.com/54085.html</link>
  <description>In &lt;a href=&quot;http://cananian.livejournal.com/tag/shut+the+box&quot;&gt;previous posts&lt;/a&gt; I&apos;ve talked about mathematics and strategies for the &quot;shut the box&quot; game.  I&apos;ve been describing a two-player game, but shut the box can be played with any number of players.  How do strategies change?&lt;br /&gt;&lt;br /&gt;It&apos;s easy to think about the limit case and work backwards.  If there are an infinite number of players, eventually &lt;i&gt;someone&lt;/i&gt; will &quot;shut the box&quot; &amp;mdash; it happens in about 1 in 10 games, after all.  Since the round will eventually end this way, then your final score doesn&apos;t matter: all that&apos;s important is whether you manage to shut the box.  Every player&apos;s strategy is identical. (With an infinite number of players, there is no &quot;last&quot; player &amp;mdash; in fact, even if there were one, there would be an infinitesimal chance of their touching the dice: they game would almost certainly be ended by a previous player&apos;s shutting the box before the &quot;last turn&quot; occurred.)&lt;br /&gt;&lt;br /&gt;A strategy which maximizes your chances of shutting the box, ignoring final score, is easy to implement and evaluate, and differences from the &quot;largest result&quot; strategy described previously can again be tabulated on a single side of a sheet of paper.  This &quot;most zeros&quot; strategy manages to shut the box in 9.8% of games played, but still loses in a two player game &amp;mdash; even though the optimal 1st player strategy only manages the shut the box in 9.5% of its games.  As first player against an optimal 2nd player, &quot;most zeros&quot; loses 3.3% of the stake in each game, compared to only 2.5% lost by an optimal 1st player (game results: 9.5% 1st player shut box, 8.2% 2nd player shut box, 37.3% 1st player by points, 43.8% 2nd player by points, 0.9% ties).  As second player against an optimal 1st player, &quot;most zeros&quot; &lt;i&gt;loses&lt;/i&gt; 2.8% of the stake; an optimal second player would &lt;i&gt;win&lt;/i&gt; 2.5% of the stake (game results: 9.5% 1st player shut box, 8.8% 2nd player shut box, 41.1% 1st player by points, 39.7% 2nd player by points, 0.9% ties).&lt;br /&gt;&lt;br /&gt;Since the box is shut with a fairly high probability, we converge to the &quot;most zeros&quot; strategy fairly quickly as the number of players increases.  Intermediate strategies are parameterized by the &quot;score to beat&quot; (the minimum score achieved by previous players) and the probability distribution of the minimum score to be achieved by future players.  The complexity of computing exact solutions increases quickly.&lt;br /&gt;&lt;br /&gt;In my next post on the topic, I&apos;ll discuss an &quot;alternating turns&quot; variant of shut-the-box which might be a more enjoyable real-time-collaborative computer game.</description>
  <comments>http://cananian.livejournal.com/54085.html</comments>
  <category>shut the box</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/54002.html</guid>
  <pubDate>Thu, 29 Jan 2009 20:14:39 GMT</pubDate>
  <title>Collaboration!</title>
  <link>http://cananian.livejournal.com/54002.html</link>
  <description>Just on the off chance that people read my blog but not &lt;a href=&quot;http://blog.printf.net/&quot;&gt;Chris Ball&lt;/a&gt;&apos;s, I&apos;ll point out his recent &lt;a href=&quot;http://blog.printf.net/articles/2009/01/26/multi-pointer-remote-desktop&quot;&gt;Multipointer Remote Desktop&lt;/a&gt; demo.  This is a key technology for improving collaboration, and I think it&apos;s relevant both to OLPC and to other little companies which might be thinking about collaboration features.  Multi-pointer stuff is just a much different experience than &quot;watching&quot; someone else drive the display, as numerous studies (such as &lt;a href=&quot;http://doi.acm.org/10.1145/286498.286766&quot;&gt;this one&lt;/a&gt;) have substantiated.</description>
  <comments>http://cananian.livejournal.com/54002.html</comments>
  <category>olpc</category>
  <category>mpx</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/53587.html</guid>
  <pubDate>Thu, 29 Jan 2009 19:19:35 GMT</pubDate>
  <title>Pinot/Journal news</title>
  <link>http://cananian.livejournal.com/53587.html</link>
  <description>The magic of RSS just informed me that Pinot has had it&apos;s &lt;a href=&quot;http://pinotdev.blogspot.com/2009/01/pinot-090.html&quot;&gt;0.90 release&lt;/a&gt;, fixing some of the problems with i18n and OpenSearch that I&apos;d found in my &lt;a href=&quot;http://wiki.laptop.org/go/Journal,_reloaded&quot;&gt;Journal2&lt;/a&gt; work, and actually implementing my &lt;a href=&quot;http://wiki.laptop.org/go/Experiments_with_unordered_paths&quot;&gt;tagged cd&lt;/a&gt; idea!  Coolness.  I had been thinking about &lt;a href=&quot;http://www.lesbonscomptes.com/recoll/usermanual/index.html&quot;&gt;Recoll&lt;/a&gt; recently, simply because I like its simple plug-in interface for indexing new formats, but it looks like &lt;a href=&quot;http://pinot.berlios.de/&quot;&gt;Pinot&lt;/a&gt; has pulled ahead again.&lt;br /&gt;&lt;br /&gt;Fabrice, how about importing the HTML-indexing code from &lt;a href=&quot;http://xapian.org/docs/omega/overview.html&quot;&gt;Omega&lt;/a&gt; like Recoll does, and using the same plugin interface and filters?  You&apos;d immediately expand greatly the types of documents you can index, and make it easy for third-parties to create one ones.  A plugin basically just takes the file-to-be-indexed and spits out an HTML document with the indexable text.  Additional xapian fields can be specified by including appropriate &amp;lt;meta&amp;gt; tags in the output HTML.  Full details are in the &lt;a href=&quot;http://www.lesbonscomptes.com/recoll/usermanual/index.html#RCL.PROGRAM.FILTERS&quot;&gt;Recoll manual&lt;/a&gt;; it&apos;s a pretty straightforward scheme.</description>
  <comments>http://cananian.livejournal.com/53587.html</comments>
  <category>olpc</category>
  <category>pinot</category>
  <category>recoll</category>
  <category>journal2</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/53417.html</guid>
  <pubDate>Thu, 29 Jan 2009 19:10:11 GMT</pubDate>
  <title>Mystery Hunt lessons</title>
  <link>http://cananian.livejournal.com/53417.html</link>
  <description>It&apos;s almost February, but I still haven&apos;t posted my wrapup of the &lt;a href=&quot;http://web.mit.edu/puzzle/www/09/&quot;&gt;2009 MIT Mystery Hunt&lt;/a&gt;.  Before I get to the puzzles, let me just say that the mystery hunt has made job interviews very awkward for me!  Every time I&apos;ve been on the job market, I find that I want to cite &quot;lessons learned&quot; from mystery hunts past -- which then forces me to explain what the mystery hunt is (&quot;well, imagine the world&apos;s hardest scavenger hunt, with puzzles&quot;), and I end up sounding like a huge geek.  Which may not be a bad thing, I guess...&lt;br /&gt;&lt;br /&gt;Why does the Mystery Hunt keep cropping up?  Well, in my recent interview it started with a discussion of the difference between &quot;enforced&quot; and &quot;permissive&quot; management styles.  There is a great and good tendency in any large endeavor, corporate or puzzle-hunt, to draw up &quot;best practices&quot; to codify lessons learned about the most effective ways to do things.  But what happens next?  There is a crossroads between two fundamental strategies.  The &quot;enforcement&quot; strategy tries to figure out how we can forcibly prevent people from doing things other than the &quot;best thing&quot;.  Bureaucracy and long lists of rules follow, along with authority: someone who will not let X do Y unless they have been convinced that Z has happened.&lt;br /&gt;&lt;br /&gt;A better strategy is &quot;permissive&quot;: assuming good-faith on the part of all involved, just passively monitor the situation, so that &quot;bad things&quot; can be remedied without intruding on all the people trying to do good things.  This is a much more efficient strategy, especially if your resources are constrained &amp;mdash; it&apos;s less costly to monitor than to prevent &amp;mdash; but it involves a lot of trust.  Some cultures can sustain the necessary trust, and some cannot.&lt;br /&gt;&lt;br /&gt;Mystery hunt example: how do we prevent people from calling in too many wrong guesses at an answer?  Team ACME solved the problem by just putting the communal answer phone at the front of the room, so that everyone would notice if someone got crazy with the guessing.  Team Codex uses an enforcer: all answers must be called in by the designated operator-on-duty.  Lest you get the idea that permissive==good and enforcement==bad, let me state clearly that Codex has solid reasons for its choice: it has so many remote team members (not physically present in team headquarters) that monitoring is difficult -- the simple &quot;phone in the front of the room&quot; doesn&apos;t work when your rooms are scattered across Seattle, Zurich, and countless other places.&lt;br /&gt;&lt;br /&gt;At OLPC we faced the same issue with system administration: how to we keep our network and computers secure?  OLPC came from the permissive MIT/Media Lab heritage: since it is a research and learning organization, MIT uses the permissive strategy, letting users do what they please on the academic network and focusing effort on detecting &quot;bad behavior&quot; (worms, cracked machines, attacks, misconfigurations) and efficiently and effectively black-holing small pieces of the network to contain these problems.  If a naive user doesn&apos;t properly patch their personal computer and it gets hacked, that machine is noticed almost immediately and dropped off the network.  &quot;Traditional&quot; system adminstration focuses on enforcement: by forcing all users to use only patched versions of approved software, we can proactively prevent problems -- but at the cost of also preventing Real Work and Unexpected Solutions.&lt;br /&gt;&lt;br /&gt;Back to the mystery hunt: since the hunt is a competitive event, it&apos;s easy for people to get carried away with secrecy to protect the team&apos;s competitive advantages.  But the mystery hunt starts at noon on a Friday, with people arriving that morning from around the country, and it is crucial to get all these new people integrated into the team as quickly as possible.  Every minute that some team member can&apos;t print/can&apos;t access the network/can&apos;t access the wiki/can&apos;t access the chat rooms is a minute that could be spend advancing the goal: solving puzzles.  Permissive strategies are a big win here, especially because the hunt code of conduct, observed by all seriously competitive teams, ensures the necessary trust.  Other teams aren&apos;t actively seeking to hack into our systems; preventing Google from sucking everything into its archives and index is usually enough.&lt;br /&gt;&lt;br /&gt;Another OLPC example: build systems.  During the run-up to a stable build, it&apos;s very important to keep build changes under control.  How to prevent developers from making uncontrolled changes to the stable build?  The enforcement strategy appoints a build master Who Alone Is Powerful and forces all changes to be made via the build master.  The permissive strategy says that developers are generally trustworthy (and are accountable to management if not!) and retains the ability of &lt;i&gt;anyone&lt;/i&gt; to affect the build at &lt;i&gt;any time&lt;/i&gt;.  Instead of making it arbitrarily &lt;i&gt;harder to fix things&lt;/i&gt; as the build approaches stability, we (a) trust the developers to commit only appropriate fixes to stable, (b) watch all the changes (which has the benefit of catching even &lt;i&gt;unintentional&lt;/i&gt; changes) and (c) back out any well-intentioned fixes that might adversely affect stability.  The buck still stops with the build master to determine what&apos;s &quot;safe&quot; for the stable build, but their direct intervention is limited to backing out the infrequent &quot;bad thing&quot; instead of being interposed in every frequent good thing.&lt;br /&gt;&lt;br /&gt;This post is very long, and I&apos;ve only discussed &lt;i&gt;one&lt;/i&gt; of the &quot;mystery hunt lessons&quot;.  Others include effective ways to collaborate with remote resources/solvers, and the importance of making &quot;the right thing easy&quot;.  The best way to get people to do &quot;the right thing&quot; is to make it the easiest thing to do.  For example: a perennial problem is keeping remote hunters &quot;in the loop&quot; about what puzzles have been solved and what new puzzles have been made available.  Further, there&apos;s a lot of internal bookkeeping that needs to be done on these events.  My best solution to the problem was a chatbot who lived in the chatroom ACME used to keep in touch with remote solvers.  When a solution was phoned in, we&apos;d type &quot;bot, the solution to FROBNOTIC UPGRADES is BAZNIC&quot;.  When a new puzzle was made available, &quot;bot, new puzzle: GROOVY FROOD&quot;.  This was the (only) means to update our collaboration software: the puzzles/answers would be added to the wiki&apos;s automatically generated &quot;status blackboard&quot;, and new puzzle pages would be created in the wiki to track work done.  But, by performing the operation in the shared chat room, it notified the remotes at the same time.  Suddenly no one had to be reminded to update the remote hunters!  (Codex has a similar system: all answers are phoned in by a dedicated operator, and you are encouraged to communicate with the operator via the shared ringhunters chat room.  Codex doesn&apos;t have an effective a &quot;new puzzle notification&quot; system, although you could monitor the changelog of the wiki to see new pages being created.)&lt;br /&gt;&lt;br /&gt;In our latest hunt, we used Google Spreadsheets extensively to collaboratively solve puzzles.  Team members would typically create new sheets in the spreadsheet to test different theories for how the puzzle might work.  This had the unexpected side effect of eliminating almost all updates to the puzzle&apos;s wiki pages -- it was &lt;i&gt;easy&lt;/i&gt; to work in the spreadsheet, and &lt;i&gt;hard&lt;/i&gt; to keep switching back to the wiki.  The problem was that it is &lt;i&gt;also&lt;/i&gt; &quot;hard&quot; to write long free-text blocks inside a spreadsheet, and so most sheets in the spreadsheet were &quot;undocumented&quot;, and it was hard reconstructing what had been done on a puzzle when a newcomer picked it up.  The discussion on our mailing list started along familiar paths: can we somehow force people to update the wiki?  The &quot;make the right thing easy&quot; lesson suggests it would be more profitable to make it &quot;easy&quot; to add free-text blocks to sheets of the spreadsheet -- then the &quot;right&quot; thing will just naturally happen.</description>
  <comments>http://cananian.livejournal.com/53417.html</comments>
  <category>mystery hunt</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/53028.html</guid>
  <pubDate>Thu, 08 Jan 2009 16:42:15 GMT</pubDate>
  <title>Available</title>
  <link>http://cananian.livejournal.com/53028.html</link>
  <description>&lt;p&gt;OLPC &lt;a href=&quot;http://blog.laptop.org/2009/01/07/refocusing-on-our-mission/&quot;&gt;laid off most of their software staff&lt;/a&gt; yesterday -- 50% of the staff overall, but the cuts were deepest in software.  That means, as of Friday, I am available to work -- for you!&lt;/p&gt;
&lt;p&gt;I am hearing rumors that there might be a source of seed funding for continued development of Sugar, the educational software stack shipping on all OLPC XOs.  If so, I&apos;d love to be able to continue the work that&apos;s consumed me for the past 18 months.  Fingers crossed.&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/53028.html</comments>
  <category>sugar</category>
  <category>olpc</category>
  <category>jobs</category>
  <lj:security>public</lj:security>
  <lj:reply-count>2</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/52847.html</guid>
  <pubDate>Sat, 03 Jan 2009 05:09:46 GMT</pubDate>
  <title>xkcd and shut-the-box</title>
  <link>http://cananian.livejournal.com/52847.html</link>
  <description>&lt;p&gt;An xkcd comic from a while ago mentioned a &quot;&lt;a href=&quot;http://xkcd.com/c287.html&quot;&gt;knapsack problem&lt;/a&gt;,&quot; and one reader (dhogarty) &lt;a href=&quot;http://www.flyingsymbols.com/2007/11/06/recursive-generators-multisets-and-randall-munroe/&quot;&gt;wrote some set enumeration code&lt;/a&gt; to tackle it.&lt;/p&gt;

&lt;p&gt;Before I go further, I should mention that &lt;a href=&quot;http://www-cs-staff.stanford.edu/~uno/taocp.html&quot;&gt;Knuth&lt;/a&gt; is the definitive reference here (as in most things), in particular Volume 4 which is now available only in fascicle form.  If you haven&apos;t been reading the pre-fascicles just as soon as they&apos;re posted on the TAOCP web page, you&apos;re a sad sorry person who doesn&apos;t deserve to be called a computer scientist.  (If you&apos;re not a computer scientist, read at least fascicle 4&apos;s chapter on &lt;a href=&quot;http://www-cs-staff.stanford.edu/~uno/fasc4b.ps.gz&quot;&gt;the history of combinatorics&lt;/a&gt;; you can buy a hardcopy from &lt;a href=&quot;http://www.amazon.com/exec/obidos/ISBN=0321335708/cscottananianA/&quot;&gt;amazon&lt;/a&gt;.)&lt;/p&gt;

&lt;p&gt;The xkcd problem is called a &quot;knapsack problem&quot;, but it&apos;s not, really; see Knuth&apos;s commentary around Algorithm F of 7.2.1.3 (vol 4 fascicle 3a).  We&apos;re generating multicombinations of n items taken from the m appetizers (repetition permitted).  It&apos;s always worthwhile generating your options in strict lexicographic order to get a handle on duplicates; consult the history of combinatorics cited above for cautionary tales.&lt;p&gt;

&lt;p&gt;A compact way to generate multicombinations without duplicates is simply to require the output to be in lexicographic (sorted) order.  For example, tweaking dhogarty&apos;s code only slightly:&lt;/p&gt;
&lt;pre&gt;
def all_seqs(size, alphabet):
   for n,c in zip(xrange(len(alphabet)), alphabet):
     for s in all_seqs(size-1, alphabet[n:]) if size&amp;gt;1 else [[]]:
       yield [c]+s

&lt;/pre&gt;
&lt;p&gt;You can wrap this in an iteration of sizes from 0 to infinity to generate multicombinations of all possible cardinalities.&lt;/p&gt;

&lt;p&gt;A more elegant solution only generates multicombinations which sum properly (this is similar to Knuth&apos;s Algorithm F):&lt;/p&gt;

&lt;pre&gt;
def ways_to_sum(total, menu):
    if total &amp;lt; 0: return
    if total == 0: yield []
    for (item,price),n in zip(menu, xrange(len(menu))):
        for tail in ways_to_sum(total-price, menu[n:]):
            yield [ item ] + tail

menu = [(&apos;Fruit&apos;, 215), (&apos;Fries&apos;, 275),
        (&apos;Salad&apos;, 335), (&apos;Wings&apos;, 355),
        (&apos;Sticks&apos;, 420), (&apos;Sampler&apos;, 580)]

for solution in ways_to_sum(1505, menu):
    print solution

&lt;/pre&gt;

&lt;p&gt;It&apos;s regrettable that the solution isn&apos;t unique.  Bad Randall.&lt;/p&gt;

&lt;p&gt;I&apos;ve found lots of opportunities to generate &quot;all possible solutions&quot; in various contexts, and Python&apos;s generators have generally been an elegant means to express solutions.  For example, I&apos;ve been discussing &lt;a href=&quot;http://cananian.livejournal.com/tag/shut+the+box&quot;&gt;&quot;Shut the Box&quot;&lt;/a&gt;; here&apos;s some code fragments to generate all possible plays for some board state:&lt;/p&gt;

&lt;pre&gt;
def ways_to_sum(total, min_digit=1, max_digit=9):
    &quot;&quot;&quot;Generate all the ways to sum to the given total using the digits
    `min` through `max` without repetitions.
    By default min and max are 1 and 9, respectively.

    &amp;gt;&amp;gt;&amp;gt; list(ways_to_sum(1))
    [[1]]
    &amp;gt;&amp;gt;&amp;gt; list(ways_to_sum(2))
    [[2]]
    &amp;gt;&amp;gt;&amp;gt; list(ways_to_sum(3))
    [[1, 2], [3]]
    &amp;gt;&amp;gt;&amp;gt; list(ways_to_sum(12))
    [[1, 2, 3, 6], [1, 2, 4, 5], [1, 2, 9], [1, 3, 8], [1, 4, 7], [1, 5, 6], [2, 3, 7], [2, 4, 6], [3, 4, 5], [3, 9], [4, 8], [5, 7]]
    &quot;&quot;&quot;
    for first in xrange(min_digit, min(max_digit+1, total)):
        for tail in ways_to_sum(total-first, min_digit=first+1, max_digit=max_digit):
            yield [ first ] + tail
    if min_digit &amp;lt;= total and total &amp;lt;= max_digit:
        yield [ total ]

def all_states(min_digit=1):
    &quot;&quot;&quot;Generate all possible shut-the-box states.&quot;&quot;&quot;
    if min_digit &amp;lt;= 9:
        for x in all_states(min_digit=min_digit+1):
            yield x
            yield [min_digit] + x
    else:
        yield []

&lt;/pre&gt;

&lt;p&gt;The all_states() function generates the states in lexicographic order based on the set&apos;s binary representation (a9 a8 a7 ... a2 a1, to use Knuth&apos;s notation).&lt;/p&gt;

&lt;p&gt;
[This was originally going to be a comment on &lt;a href=&quot;http://www.flyingsymbols.com/2007/11/06/recursive-generators-multisets-and-randall-munroe/&quot;&gt;dhogarty&apos;s post&lt;/a&gt;, but after writing it I discovered that dhogarty had broken his wordpress installation sometime after 12 Sep 2008.  I reverse-engineered the &lt;a href=&quot;http://wordpresssupplies.com/wordpress-plugins/captcha-free/&quot;&gt;&quot;Captcha-free&quot;&lt;/a&gt; spam protection and fixed the Ajax URL in his page, but no dice.  Querying the &quot;Captcha-free&quot; implementation with a python one-liner and performing a manual submission still loses.  Maybe trackback will work.] &lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/52847.html</comments>
  <category>knuth</category>
  <category>shut the box</category>
  <category>xkcd</category>
  <category>python</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
<item>
  <guid isPermaLink='true'>http://cananian.livejournal.com/52530.html</guid>
  <pubDate>Tue, 09 Dec 2008 23:24:00 GMT</pubDate>
  <title>Pippy.  And Winnie-the-Pooh.</title>
  <link>http://cananian.livejournal.com/52530.html</link>
  <description>&lt;p&gt;In October, &lt;a href=&quot;http://blogs.law.harvard.edu/sj/&quot;&gt;SJ&lt;/a&gt; and I travelled to Peru for &lt;a href=&quot;http://blog.laptop.org/&quot;&gt;OLPC&lt;/a&gt;.  (Ob. Plug: buy a &lt;a href=&quot;http://laptop.org/xo&quot;&gt;G1G1&lt;/a&gt; machine this holiday season!  It helps get laptops to needy kids &lt;i&gt;and&lt;/i&gt; helps fund us to develop more and better software for those kids.)&lt;/p&gt;

&lt;p&gt;Anyway, my favorite story from our time in Peru was when SJ stood up in front of a classroom of &lt;a href=&quot;http://www.usmp.edu.pe/&quot;&gt;university&lt;/a&gt; kids and announced, in Spanish, &quot;Now we are going to make drawings with pee-pee.&quot;  He actually was talking about &lt;a href=&quot;http://wiki.laptop.org/go/Pippy&quot;&gt;Pippy&lt;/a&gt;, the python-programming-for-kids activity written by &lt;a href=&quot;http://blog.printf.net/&quot;&gt;Chris Ball&lt;/a&gt; (with patches from yours truely and others) -- but there&apos;s a reason why Pippy is translated &quot;Peppy&quot; in Spanish =).&lt;/p&gt;

&lt;p&gt;But I&apos;ve found another contender for that crown: a &lt;a href=&quot;http://www.ironicsans.com/2007/10/best_book_title_ever.html&quot;&gt;cookbook&lt;/a&gt;.  Best book title ever.  (David Friedman not only found that book, he made it an &lt;a href=&quot;http://www.ironicsans.com/2007/12/bookstore_befuddlement.html&quot;&gt;&quot;employee pick&quot;&lt;/a&gt; when working at a &quot;large chain bookstore&quot;.)&lt;/p&gt;

&lt;p&gt;So.  Pippy and Winnie-the-Pooh.  Closing a scatological circle.&lt;/p&gt;

&lt;p&gt;(While I&apos;m in the neighborhood, I have to plug David Friedman&apos;s &lt;a href=&quot;http://www.ironicsans.com/2008/11/murder_in_the_hundred_acre_woo.html&quot;&gt;Murder in the Hundred Acre Wood&lt;/a&gt; as well.  And &lt;a href=&quot;http://www.ironicsans.com/2008/09/10_lessons_from_the_movies.html&quot;&gt;10 Lessons from the Movies&lt;/a&gt;.  Ok, go resume your productive lives now.)&lt;/p&gt;</description>
  <comments>http://cananian.livejournal.com/52530.html</comments>
  <category>winnie-the-pooh</category>
  <category>olpc</category>
  <category>david friedman</category>
  <category>pippy</category>
  <category>python</category>
  <lj:security>public</lj:security>
  <lj:reply-count>0</lj:reply-count>
</item>
</channel>
</rss>
