<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xmlns:planet="http://planet.intertwingly.net/" xmlns:indexing="urn:atom-extension:indexing" indexing:index="no"><access:restriction xmlns:access="http://www.bloglines.com/about/specs/fac-1.0" relationship="deny"/>
  <title>Planet 5</title>
  <updated>2012-10-18T04:01:18Z</updated>
  <generator uri="http://intertwingly.net/code/venus/">Venus</generator>
  <author>
    <name>Uriel</name>
    <email>uriel99@gmail.com</email>
  </author>
  <id>http://planet5.cat-v.org/atom.xml</id>
  <link href="http://planet5.cat-v.org/atom.xml" rel="self" type="application/atom+xml"/>
  <link href="http://planet5.cat-v.org" rel="alternate"/>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-2431456131545267000</id>
    <link href="http://reneefrench.blogspot.com/feeds/2431456131545267000/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=2431456131545267000" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2431456131545267000" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2431456131545267000" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/10/blog-post_11.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-c9J2_lwuqi8/UHau0UohSAI/AAAAAAAAFIs/kWYtG_eBS6U/s1600/marcel2b.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-c9J2_lwuqi8/UHau0UohSAI/AAAAAAAAFIs/kWYtG_eBS6U/s320/marcel2b.jpg" width="239"/></a></div> <div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-2431456131545267000?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-10-11T11:35:10Z</updated>
    <published>2012-10-11T11:34:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="photographs"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-US">
    <id>http://blog.nella.org/?p=905</id>
    <link href="http://blog.nella.org/?p=905" rel="alternate" type="text/html"/>
    <title>Sugru</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">I had a great first Sugru experience! I scratched my finger on the way to work on my unicycle. I thought, dammit, I’m gonna fix that! So I bought some from my phone on the train. Cool! A few days … <a href="http://blog.nella.org/?p=905">Continue reading <span class="meta-nav">→</span></a></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I had a great first Sugru experience! I scratched my finger on the way to work on my unicycle. I thought, dammit, I’m gonna fix that! So I bought some from my phone on the train. Cool!</p>
<p>A few days later, it arrived in the post. I was having a hard time explaining why I was so excited about it to my wife. So I sat down, cut open my first packet and started fixing. My wife got interested, fast! She asked, would this stick to the door handle to make a bumper? I said, go try! And off she ran with my Sugru, leaving me grinning and cutting open a new packet…</p>
<p>Thanks, Sugru, for our new door bumper and unicycle seat bolt covers! You made two new happy fixers.</p>
<p>Correction: Three new fixers, including Elio, age 2 and a half:</p>
<p>&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="480" src="http://www.youtube.com/embed/oGW0qZUuowA?rel=0" width="640"&gt;&lt;/iframe&gt;</p></div>
    </content>
    <updated>2012-10-10T16:36:14Z</updated>
    <category term="Fun"/>
    <category term="Geeking"/>
    <author>
      <name>jra</name>
    </author>
    <source>
      <id>http://blog.nella.org</id>
      <link href="http://blog.nella.org/?feed=rss2" rel="self" type="application/atom+xml"/>
      <link href="http://blog.nella.org" rel="alternate" type="text/html"/>
      <title>jra's thoughts</title>
      <updated>2012-10-15T17:00:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-4791640826132790480</id>
    <link href="http://reneefrench.blogspot.com/feeds/4791640826132790480/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=4791640826132790480" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4791640826132790480" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4791640826132790480" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/10/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-UYumdjpfPIE/UG1Kyowxf0I/AAAAAAAAFIM/KT9ip_CRWYE/s1600/misterbjornstrand.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-UYumdjpfPIE/UG1Kyowxf0I/AAAAAAAAFIM/KT9ip_CRWYE/s320/misterbjornstrand.jpg" width="306"/></a></div> <div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-4791640826132790480?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-10-04T08:37:40Z</updated>
    <published>2012-10-04T08:37:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-US">
    <id>http://blog.nella.org/?p=896</id>
    <link href="http://blog.nella.org/?p=896" rel="alternate" type="text/html"/>
    <title>Two more stories</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Here’s two stories that worked their charm on a not-very-sleepy little boy, turning him into a sleepy one. Bep and the Giant Pumpkin: It is October, the official start of pumpkin season in our house. That means it is time … <a href="http://blog.nella.org/?p=896">Continue reading <span class="meta-nav">→</span></a></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Here’s two stories that worked their charm on a not-very-sleepy little boy, turning him into a sleepy one.</p>
<p>Bep and the Giant Pumpkin: It is October, the official start of pumpkin season in our house. That means it is time to start talking about pumpkins and where we get them. So mommy, daddy, Elio and Emma got in Bep and went for a drive. They drove up up up to the top of Lausanne and then up up up to Mont sur Lausanne, then up up up more to the little self-service vegetable stand above it. Everyone went in and chose their pumpkins one by one. Emma got a little pumpkin because she needed to hold it between her feet in her maxi-cosi. Elio got a bigger pumpkin because he’s strong (Elio e forte!). Mami chose a good pumpkin for soup because she makes the best pumpkin soup. And daddy chose one to make a yummy pumpkin curry. Daddy was about to pay and go, but Elio asked, “What about Bep?” So they looked but none of the pumpkins were big enough for Bep. They went out back and found a perfect pumpkin, 1 meter across, 3.14 meters around and weighing 200 kg! They went to get Bep and asked, “can you carry it?” Bep said “beep beep vroom vroom, no problem” and drove the whole family home, each with their pumpkin on their lap (except mami, who was driving) and Bep with his pumpkin right in the middle.</p>
<p>The Little Red Robot: Once upon a time, there was a little red robot. (Elio was wearing his red robot pj’s.) This little red robot could do everything the master programmer taught him. He could dress himself, go poo poo, feed himself, read books, etc etc. He even knew how to initiate the food processing unit decontamination procedure (teeth brushing) and the light delumination protocol (turning off the bathroom light by head butting it). But each night, when the little red robot went into sleep mode, something magical happened. He got to do things he never did in the day. He ran programs for flying on clouds, climbing in trees, (around this point Elio interrupted and asked that the story should include a “motoschlitta”: snowmobile), and ride lunar snowmobiles across the moon through craters and over the horizon, far from the robot base. That night, the little red robot ran the snow mobile program in his processing unit all night. In the morning when he woke up, he went to Central Dispatch and found that his job that day was to go drive lunar snowmobiles for real! And so he did.</p></div>
    </content>
    <updated>2012-10-03T19:07:13Z</updated>
    <category term="Once upon a time"/>
    <author>
      <name>jra</name>
    </author>
    <source>
      <id>http://blog.nella.org</id>
      <link href="http://blog.nella.org/?feed=rss2" rel="self" type="application/atom+xml"/>
      <link href="http://blog.nella.org" rel="alternate" type="text/html"/>
      <title>jra's thoughts</title>
      <updated>2012-10-15T17:00:37Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-US">
    <id>http://www.snowfrog.net/?p=1703</id>
    <link href="http://www.snowfrog.net/2012/10/03/golang-setup-and-producing-debs/" rel="alternate" type="text/html"/>
    <title>Golang – setup and producing .debs</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Here’s the setup I use for compiling Go binaries, as well as for writing .deb’s to package them and markdown for README’s – notes for me. Install build pre-requisites: Install Go from source (so can cross-compile). Download from Go Downloads eg go1.0.2.src.tar.gz Add to /etc/profile,… <a href="http://www.snowfrog.net/2012/10/03/golang-setup-and-producing-debs/" rel="bookmark">more...</a></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Here’s the setup I use for compiling Go binaries, as well as for writing .deb’s to package them and <a href="http://en.wikipedia.org/wiki/Markdown">markdown</a> for README’s – <em>notes for me</em>.</p>
<p>Install build pre-requisites:</p>
<pre class="brush: bash; title: ; notranslate">sudo aptitude install gcc libc6-dev libc6-dev-i386 make \
  markdown build-essential debhelper dh-make fakeroot devscripts
</pre>
<p>Install Go from source (so can cross-compile). Download from <a href="http://code.google.com/p/go/downloads/list">Go Downloads</a> eg go1.0.2.src.tar.gz</p>
<pre class="brush: bash; title: ; notranslate">sudo tar -C /usr/local -xzf go1.0.2.src.tar.gz ; cd /usr/local/go/src
sudo GOARCH=amd64 ./all.bash ; sudo GOARCH=386 ./all.bash
</pre>
<p>Add to /etc/profile, source or re-login:</p>
<pre class="brush: bash; title: ; notranslate">export GOROOT="/usr/local/go"
export PATH="$GOROOT/bin:$PATH"
</pre></div>
    </content>
    <updated>2012-10-02T23:29:06Z</updated>
    <category term="Linux"/>
    <category term="Debian"/>
    <category term="Golang"/>
    <category term="Ubuntu"/>
    <author>
      <name>Sonia Hamilton</name>
    </author>
    <source>
      <id>http://www.snowfrog.net</id>
      <link href="http://www.snowfrog.net/tag/golang/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://www.snowfrog.net" rel="alternate" type="text/html"/>
      <subtitle>Linux, Programming, Martial Arts</subtitle>
      <title>Sonia Hamilton » Golang</title>
      <updated>2012-10-18T04:00:29Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-1941874418998375489</id>
    <link href="http://mue.tideland.biz/feeds/1941874418998375489/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/10/happy-to-announce-tideland-cgl-release.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/1941874418998375489" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/1941874418998375489" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/10/happy-to-announce-tideland-cgl-release.html" rel="alternate" type="text/html"/>
    <title>Happy to announce Tideland CGL Release 2.1.0</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>I'm happy to announce the new <b>Release 2.1.0</b> of the <b>Tideland Common Go Library</b>. Beside some fixes, especially for the Redis client,  it contains new packages for buildings Atom and RSS clients and to supervise goroutines almost like in Erlang/OTP.<br/><br/><h4>General</h4><br/><ul><li>Changed import path prefixes from <span style="font-family: Courier New, Courier, monospace;">code.google.com/p/tcgl</span> to <span style="font-family: Courier New, Courier, monospace;">cgl.tideland.biz</span></li></ul><br/><h4>Cells</h4><br/><ul><li>Added EventCollector behavior</li></ul><br/><h4>Net</h4><br/><ul><li>Added new top-level package net for network related packages</li></ul><br/><h4>Net/Atom</h4><br/><ul><li>Added package net/atom for reading atom feeds</li></ul><br/><h4>Net/RSS</h4><br/><ul><li>Added package net/rss for reading rss feeds</li></ul><br/><h4>Redis</h4><br/><ul><li>Changed connection pooling and error handling</li><li>Now errors are better detected and returned and the pool is more flexible and faster</li><li>Removed deadlock error when number of used connections is larger then pool size</li></ul><br/><h4>Supervisor</h4><br/><ul><li>Added new package supervisor inspired by Erlang/OTP supervisors</li><li>Supervisors run goroutines and other supervisors and restart them after errors or panics</li><li>Hierarchical supervisor trees are possible</li><li>Depending on strategy and restart frequency all supervised goroutines may be restarted or stopped after an error</li><li>As Go has not the monitoring/killing abilities of Erlang the goroutines have to implement a defined signature and stop after a signal of their supervisor tells them to do</li></ul><br/><h4>Web</h4><br/><ul><li>Changed content type of gob-encoded data to <i>application/vnd.tideland.gob</i></li></ul><br/>As usual you find it at <a href="http://cgl.tideland.biz/">http://cgl.tideland.biz</a>.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-1941874418998375489?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-10-02T20:44:23Z</updated>
    <published>2012-10-02T20:37:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="cells"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="cgl"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="supervisor"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="redis"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://gowithconfidence.tumblr.com/post/32738458579</id>
    <link href="http://gowithconfidence.tumblr.com/post/32738458579" rel="alternate" type="text/html"/>
    <title>The power of ad hoc interfaces</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://blog.ser1.net/2012/10/the-power-of-ad-hoc-interfaces.html">The power of ad hoc interfaces</a></div>
    </summary>
    <updated>2012-10-02T15:40:16Z</updated>
    <source>
      <id>http://gowithconfidence.tumblr.com/</id>
      <link href="http://tumblr.superfeedr.com/" rel="hub" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/" rel="alternate" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/rss" rel="self" type="application/rss+xml"/>
      <subtitle>Thoughts with Go, by John Asmuth</subtitle>
      <title>go with confidence</title>
      <updated>2012-10-18T04:00:51Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://gowithconfidence.tumblr.com/post/32257688324</id>
    <link href="http://gowithconfidence.tumblr.com/post/32257688324" rel="alternate" type="text/html"/>
    <title>Cross compiling with go</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://dave.cheney.net/2012/09/08/an-introduction-to-cross-compilation-with-go">Cross compiling with go</a></div>
    </summary>
    <updated>2012-09-25T11:13:02Z</updated>
    <source>
      <id>http://gowithconfidence.tumblr.com/</id>
      <link href="http://tumblr.superfeedr.com/" rel="hub" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/" rel="alternate" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/rss" rel="self" type="application/rss+xml"/>
      <subtitle>Thoughts with Go, by John Asmuth</subtitle>
      <title>go with confidence</title>
      <updated>2012-10-18T04:00:51Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://gowithconfidence.tumblr.com/post/32197719656</id>
    <link href="http://gowithconfidence.tumblr.com/post/32197719656" rel="alternate" type="text/html"/>
    <title>An incremental improvement on JSON</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://rogpeppe.wordpress.com/2012/09/24/goson-readable-json/">An incremental improvement on JSON</a></div>
    </summary>
    <updated>2012-09-24T14:40:31Z</updated>
    <source>
      <id>http://gowithconfidence.tumblr.com/</id>
      <link href="http://tumblr.superfeedr.com/" rel="hub" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/" rel="alternate" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/rss" rel="self" type="application/rss+xml"/>
      <subtitle>Thoughts with Go, by John Asmuth</subtitle>
      <title>go with confidence</title>
      <updated>2012-10-18T04:00:51Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://rogpeppe.wordpress.com/?p=87</id>
    <link href="http://rogpeppe.wordpress.com/2012/09/24/goson-readable-json/" rel="alternate" type="text/html"/>
    <title>rjson – readable JSON</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">[Edited: after some feedback, I have renamed this project to rjson (it's really not at all Go-specific) and changed the specification so that unquoted strings are accepted only as object keys] JSON is a fine encoding. It has a very simple data model; it’s easy to understand and to write parsers for.  But personally, I [...]<img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=rogpeppe.wordpress.com&amp;blog=10759696&amp;post=87&amp;subd=rogpeppe&amp;ref=&amp;feed=1" width="1"/></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>[Edited: after some feedback, I have renamed this project to <b>rjson</b> (it's really not at all Go-specific) and changed the specification so that unquoted strings are accepted <i>only</i> as object keys]</p>
<p>JSON is a fine encoding. It has a very simple data model; it’s easy to understand and to write parsers for.  But personally, I find it a bit awkward to read and to edit. All those quotes add noise, and I’m always forgetting to remove the final comma at the end of an array or an object. I’m not the only one either. I’ve chatted to people about why they are using <a href="http://www.yaml.org/spec/1.2/spec.html" target="_blank" title="YAML specification">YAML</a>, and the reason is usually not because of the zillion features that YAML offers, but because the format is more human-friendly to edit.</p>
<p>A while ago I had an idea of how I might help this, and yesterday I had a free day to do it. I forked the Go <a href="http://golang.org/pkg/json" target="_blank" title="json package documentation">json package</a> to make <a href="http://launchpad.net/rjson" target="_blank" title="rjson package documentation">rjson</a>. It uses an idea taken from the <a href="http://golang.org/ref/spec#Semicolons" target="_blank" title="Go semicolon insertion rules">Go syntax rules</a> to make commas optional, and quotes become optional around object keys that look like identifiers. The rjson syntax rules are summarised in the <a href="http://go.pkgdoc.org/launchpad.net/rjson#_overview" target="_blank" title="rjson syntax">rjson package documentation</a>.</p>
<p>To make it easy to experiment with and use this format, I created a <a href="http://go.pkgdoc.org/launchpad.net/rjson/cmd/rjson" target="_blank" title="rjson command documentation">rjson command</a> that can read and write both formats.</p>
<p>Here is a transcript showing how the command can be used:</p>
<p/><pre class="brush: plain;">% cat config.json
{
  "ui" : {
    "global" : {
      "ui-type" : "default",
      "show-indicator" : true
    }
  }
}% rjson &lt; config.json
{
	ui: {
		global: {
			show-indicator: true
			ui-type: "default"
		}
	}
}
% rjson -indent '' &lt; config.json
{ui:{global:{show-indicator:true,ui-type:"default"}}}
% rjson -indent '' -j &lt; config.json
{"ui":{"global":{"show-indicator":true,"ui-type":"default"}}}
%
</pre><p/>
<p>You might notice that the compact version of the rjson format is smaller than the equivalent JSON. On a random selection of JSON files (all that I could find in my home directory), I measured that they were about 7% smaller on average when encoded with gson -indent ”. This was a nice bonus that I had not considered.</p>
<p>To use rjson, you’ll need a working <a href="http://golang.org/doc/install" target="_blank" title="Go installation instructions">Go installation</a>; then you can fetch and install the command into your go tree thus:</p>
<p/><pre class="brush: plain;">go get launchpad.net/rjson/cmd/rjson
</pre><p/>
<p>Enjoy!</p>
<br/>  <a href="http://feeds.wordpress.com/1.0/gocomments/rogpeppe.wordpress.com/87/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/rogpeppe.wordpress.com/87/"/></a> <img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=rogpeppe.wordpress.com&amp;blog=10759696&amp;post=87&amp;subd=rogpeppe&amp;ref=&amp;feed=1" width="1"/></div>
    </content>
    <updated>2012-09-24T10:20:14Z</updated>
    <category term="computers"/>
    <category term="golang"/>
    <author>
      <name>rogpeppe</name>
    </author>
    <source>
      <id>http://rogpeppe.wordpress.com</id>
      <logo>http://s2.wp.com/i/buttonw-com.png</logo>
      <link href="http://rogpeppe.wordpress.com/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://rogpeppe.wordpress.com" rel="alternate" type="text/html"/>
      <link href="http://rogpeppe.wordpress.com/osd.xml" rel="search" type="application/opensearchdescription+xml"/>
      <link href="http://rogpeppe.wordpress.com/?pushpress=hub" rel="hub" type="text/html"/>
      <subtitle>Just another WordPress.com weblog</subtitle>
      <title>Savoury Morsels</title>
      <updated>2012-10-18T04:00:35Z</updated>
    </source>
  </entry>

  <entry>
    <id>https://sites.google.com/feeds/content/kryas.com/kryas/7937417772947077893</id>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/5119061230095011683" rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"/>
    <link href="https://sites.google.com/a/kryas.com/kryas/recent_posts/darkeditforlackofabettername" rel="alternate" type="text/html"/>
    <link href="https://sites.google.com/feeds/revision/kryas.com/kryas/7937417772947077893" rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/7937417772947077893" rel="self" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/7937417772947077893" rel="edit" type="application/atom+xml"/>
    <title>DarkEdit (for lack of a better name)</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox"><tbody><tr><td class="sites-layout-tile sites-tile-name-content-1"><div dir="ltr">I've resurrected an idea I had awhile back regarding a simplified development environment.  I've gotten tired of Eclipse and large IDEs over the years.  The obvious benefit is that it can be built to suit my needs.  Here is a picture of the first display prototype:<br/><div style="display: block; margin-top: 5px; margin-right: auto; margin-bottom: 0px; text-align: left;"><a href="https://sites.google.com/a/kryas.com/kryas/recent_posts/darkeditforlackofabettername/darkedit.png?attredirects=0"><img border="0" height="277" src="https://sites.google.com/a/kryas.com/kryas/_/rsrc/1346999094392/recent_posts/darkeditforlackofabettername/darkedit.png" width="400"/></a></div><div style="display: block; text-align: left;"><br/></div><div style="display: block; text-align: left;">In the above prototype, the editor is in very much like a traditional editor.  This isn't what I want, but I think it is important to meet common expectations.  </div><div style="display: block; text-align: left;">What follows is a screenshot of my current development effort.  I think, there is enough novelty in this new vision to warrant continuing the development effort.</div><div style="display: block; text-align: left;"><div style="display: inline; float: left; margin: 5px 10px 0px 0px;"><a href="https://sites.google.com/a/kryas.com/kryas/recent_posts/darkeditforlackofabettername/ghost.png?attredirects=0"><img border="0" src="https://sites.google.com/a/kryas.com/kryas/_/rsrc/1348462720910/recent_posts/darkeditforlackofabettername/ghost.png"/></a></div><br/></div><br/></div></td></tr></tbody></table></div>
    </content>
    <updated>2012-09-24T05:14:01Z</updated>
    <published>2012-09-07T06:23:08Z</published>
    <category label="announcement" scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#announcement"/>
    <author>
      <name>Stan Steel</name>
      <email>steel@kryas.com</email>
    </author>
    <source>
      <id>https://sites.google.com/feeds/content/kryas.com/kryas</id>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#post" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas/batch" rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas?parent=5119061230095011683&amp;kind=announcement" rel="self" type="application/atom+xml"/>
      <title>Posts of Development Blog</title>
      <updated>2012-10-18T04:10:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6983287.post-8462550624728409907</id>
    <link href="http://www.blogger.com/feeds/6983287/posts/default/8462550624728409907" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6983287/posts/default/8462550624728409907" rel="self" type="application/atom+xml"/>
    <link href="http://commandcenter.blogspot.com/2012/09/thank-you-apple.html" rel="alternate" type="text/html"/>
    <title>Thank you Apple</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>Some days, things just don't work out. Or don't work.<br/><h4>Earlier</h4>I wanted to upgrade (their term, not mine) my iMac from Snow Leopard (10.6) to Lion (10.7). I even had the little USB stick version of the installer, to make it easy. But after spending some time attempting the installation, the Lion installer "app" failed, complaining about SMART errors on the disk.<br/><br/>Disk Utility indeed reported there were SMART errors, and that the disk hardware needed to be replaced. An ugly start.<br/><br/>The good news is that in some places, including where I live, Apple will do a house call for service, so I didn't have to haul the computer to an Apple store on public transit.<br/><br/>Thank you Apple.<br/><br/>I called them, scheduled the service for a few days later, and as instructed by Apple (I hardly needed prompting) prepped a backup using Time Machine.<br/><br/>The day before the repairman was to come to give me a new disk, I made sure the system was fully backed up, for security reasons started a complete erasure of the bad disk (using Disk Utility in target mode from another machine, about which more later), and went to bed.<br/><h4>The day</h4>When I got up, I checked that the disk had been erased and headed off to work. As I left the apartment, the ceiling lights in the entryway flickered and then went out: a new bulb was needed. On the way out of the building, I asked the doorman for a replacement bulb. He offered just to replace it for us. We have a good doorman.<br/><br/>Once at work, things were normal until my cell phone rang about 2pm. It was the Apple repairman, Twinkletoes (some names and details have been changed), calling to tell me he'd be at my place within the hour. Actually, he wasn't an Apple employee, but a contractor working for Unisys, a name I hadn't heard in a long time. (Twinkletoes was a name I hadn't heard for a while either, but that's another story.) At least here, Apple uses Unisys contractors to do their house calls.<br/><br/>So I headed home, arriving before Twinkletoes. At the front door, the doorman stopped me. He reported that the problem with the lights was not the bulb, but the wiring. He'd called in an electrician, who had found a problem in the breaker box and fixed it. Everything was good now.<br/><br/>When I got up to the apartment, I found chaos: the cleaners were mid-job, with carpets rolled up, vacuum cleaners running, and general craziness. Not conducive to work. So I went back down to the lobby with my laptop and sat on the couch, surfing on the free WiFi from the café next door, and waited for Twinkletoes.<br/><br/>Half an hour later, he arrived and we returned to the apartment. The cleaners were still there but the chaos level had dropped and it wasn't too hard to work around them. I saw what the inside of an iMac looks like as Twinkletoes swapped out the drive. By the time he was done, the cleaners had left and things had settled down.<br/><br/><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-eWOKI4PjbFA/UF4_4v-DPEI/AAAAAAAACZQ/t69_q0Nkj1g/s1600/L1000753.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="http://3.bp.blogspot.com/-eWOKI4PjbFA/UF4_4v-DPEI/AAAAAAAACZQ/t69_q0Nkj1g/s400/L1000753.jpg" width="400"/></a></div><div class="separator" style="clear: both; text-align: center;"><span style="font-size: x-small;">The innards of my 27" iMac</span></div><br/><br/>I had assumed that the replacement drive would come with an installed operating system, but I assumed wrong. (When you assume, you put plum paste on your ass.) I had a Snow Leopard installation DVD, but I was worried: it had failed to work for me a few days earlier when I wanted to boot from it to run fsck on the broken drive. Twinkletoes noticed it had a scratch. I needed another way to boot the machine.<br/><br/>It had surprised me when Lion came out that the installation was done by an "app", not as a bootable image. This is an unnecessary complication for those of us that need to maintain machines. Earlier, when updating a different machine, I had learned how painful this could be when the installation app destroyed the boot sector and I needed to reinstall Snow Leopard from DVD, and then upgrade <i>that</i> to a version of the system recent enough to run the Lion installer app. As will become apparent, had Lion come as a bootable image things might have gone more smoothly.<br/><br/>Thank you Apple.<br/><br/>[Note added in post: Several people have told me there's a bootable image inside the installer. I forgot to mention that I knew that, and there wasn't. For some reason, the version on the USB stick I have looks different from the downloaded one I checked out a day or two later, and even Twinkletoes couldn't figure out how to unpack it. Weird.]<br/><br/>Twinkletoes had an OS image he was willing to let me copy, but I needed to make a bootable drive from it. I had no sufficiently large USB stick—you need a 4GB one you can wipe. However I did have a free, big enough CompactFlash card and a USB reader, so that should do, right? Twinkletoes was unsure but believed it would.<br/><br/>Using my laptop, I used Disk Utility to create a bootable image on the CF card from Twinkletoes's disk image. We were ready.<br/><br/>Plug in the machine, push down the Option key, power on.<br/><br/>Nothing.<br/><br/>Turn on the light.<br/><br/>Nothing.<br/><br/>No power.<br/><br/>The cleaners must have tripped a breaker.<br/><br/>I went to the breaker box and found that all the breakers looked OK. We now had a mystery, because the cleaners had had lights on and were using electric appliances—I saw a vacuum cleaner running—but now there was no power. Was the power off to the building? No: the lights still worked in the kitchen and the oven clock was lit. I called the doorman and asked him to get the electrician back as soon as possible and then, with a little portable lamp, went looking around the apartment for a working socket. I found one, again in the kitchen. The iMac was going to travel after all, if not as far as downtown.<br/><br/>The machine was moved, plugged in, option-key-downed, and powered on. I selected the CF card to boot from, waited 15 minutes for the installation to come up, only to have the boot fail. CF cards don't work after all, although the diagnosis of failure is a bit tardy and uninformative.<br/><br/>Thank you Apple.<br/><br/>Next idea. My old laptop has FireWire so we could bring the disk up using target mode and then run the installer on the laptop to install Lion on the iMac.<br/><br/>We did the target mode dance and connected to the newly installed drive, then ran Disk Utility on the laptop to format the drive. Things were starting to look better.<br/><br/>Next, we put the Lion installer stick into the laptop, which was running a recent version of Snow Leopard.<br/><br/>Failure again. This time the problem is that the laptop, all of about four years old, is too old to run Lion. It's got a Core Duo, not a Core 2 Duo, and Lion won't run on that hardware. Even though Lion doesn't need to run, only the Lion installer needs to run, the system refuses to help. My other laptop is new enough to run the installer, but it doesn't have FireWire so it can't do target mode.<br/><br/>Thank you Apple. Your aggressive push to retire old technology hurts sometimes, you know? Actually, more than sometimes, but let's stay on topic.<br/><br/>Twinkletoes has to leave—he's been on the job for several hours now—but graciously lends me a USB boot drive he has, asking me to return it by post when I'm done. I thank him profusely and send him away before he is drawn in any deeper.<br/><br/>Using his boot drive, I was able to bring up the iMac and use the Lion installer stick to get the system to a clean install state. Finally, a computer, although of course all my personal data is over on the backup.<br/><br/>When a new OS X installation comes up, it presents the option of "migrating" data from an existing system, including from a Time Machine backup. So I went for that option and connected the external drive with the Time Machine backup on it.<br/><br/>The Migration Assistant presented a list of disks to migrate from. A list of one: the main drive in the machine. It didn't give me the option of using the Time Machine backup.<br/><br/>Thank you Apple. You told me to save my machine this way but then I can't use this backup to recover.<br/><br/>I called Apple on my cell phone (there's still no power in the room with the land line's wireless base station) and explained the situation. The sympathetic but ultimately unhelpful person on the phone said it should work (of course!) and that I should run Software Update and get everything up to the latest version. He reported that there were problems with the Migration Assistant in early versions of the Lion OS, and my copy of the installer was pretty early.<br/><br/>I started the upgrade process, which would take a couple of hours, and took my laptop back down to the lobby for some free WiFi to kill time. But it's now evening, the café is closed, and there is no WiFi. Naturally.<br/><br/>Back to the apartment, grab a book, return to the lobby to wait for the electrician.<br/><br/>An hour or so later, the electrician arrived and we returned to the apartment to see what was wrong. It was easy to diagnose. He had made a mistake in the fix, in fact a mistake related to what was causing the original problem. The breaker box has a silly design that makes it too easy to break a connection when working in the box, and that's what had happened. So it was easy to fix and easy to verify that it was fixed, but also easy to understand why it had happened. No excuses, but problem solved and power was now restored.<br/><br/>The computer was still upgrading but nearly done, so a few minutes later I got to try migrating again. Same result, naturally, and another call to Apple and this time little more than an apology. The unsatisfactory solution: do a clean installation and manually restore what's important from the Time Machine backup.<br/><br/>Thank you Apple.<br/><br/>It was fairly straightforward, if slow, to restore my personal files from the home directory on the backup, but the situation for installed software was dire. Restoring an installed program, either using the ludicrous Time Machine UI or copying the files by hand, is insufficient in most cases to bring back the program because you also need manifests and keys and receipts and whatnot. As a result, things such as iWork (Keynote etc.) and Aperture wouldn't run. I could copy every piece of data I could find but the apps refused to let me run them. Despite many attempts digging far too deep into the system, I could not get the right pieces back from the Time Machine backup. Worse, the failure modes were appalling: crashes, strange display states, inexplicable non-workiness. A frustating mess, but structured perfectly to belong on this day.<br/><br/>For peculiar reasons I didn't have the installation disks for everything handy, so these (expensive!) programs were just gone, even though I had backed up everything as instructed.<br/><br/>Thank you Apple.<br/><br/>I did have some installation disks, so for instance I was able to restore Lightroom and Photoshop, but then of course I needed to wait for huge updates to download even though the data needed was already sitting on the backup drive.<br/><br/>Back on the phone for the other stuff. Because I could prove that I had paid for the software, Apple agreed to send me fresh installation disks for everything of theirs but Aperture, but that would take time. In fact, it took almost a month for the iWork DVD to arrive, which is unacceptably long. I even needed to call twice to remind them before the disks were shipped.<br/><br/>The Aperture story was more complicated. After a marathon debugging session I managed to get it to start but then it needed the install key to let me do anything. I didn't have the disk, so I didn't know the key. Now, Aperture is from part of the company called Pro Tools or something like that, and they have a different way of working. I needed to contact them separately to get Aperture back. It's important to understand I hadn't lost my digital images. They were backed up multiple times, including in the network, on the Time Machine backup, and also on an external drive using the separate "vault" mechanism that is one of the best features of Aperture.<br/><br/>I reached the Aperture people on the phone and after a condensed version of the story convinced them I needed an install key (serial number) to run the version of Aperture I'd copied from the Time Machine backup. I was berated by the person on the phone: Time Machine is not suitable for backing up Aperture databases. (What? Your own company's backup solution doesn't know how to back up? Thank you Apple.) After a couple more rounds of abuse, I convinced the person on the phone that a) I was backing up my database as I should, using an Aperture vault and b) it wasn't the database that was the problem, but the program. I was again told that wasn't a suitable way to back up (again, What?), at which point I surrendered and just begged for an installation key, which was provided, and I could again run Aperture. This was the only time in the story where the people I was interacting with were not at least sympathetic to my situation. I guess Pro is a synonym for unfriendly.<br/><br/>Thank you Apple.<br/><br/>There's much more to the story. It took weeks to get everything working again properly. The complete failure of Time Machine to back up my computer's state properly was shocking to me. After this fiasco, I learned about the Lion Recovery App, which everyone who uses Macs should know about, but was not introduced until well after Lion rolled out with its preposterous not-bootable installation setup. The amount of data I already had on my backup disk but that needed to be copied from the net again was laughable. And there were total mysteries, like GMail hanging forever for the first day or so, a problem that may be unrelated or may just be the way life was this day.<br/><br/>But, well after midnight, worn out, beat up, tired, but with electricity restored and a machine that had a little life in it again, I powered down, took the machine back to my office and started to get ready for bed. Rest was needed and I had had enough of technology for one day.<br/><h4>One more thing</h4>Oh yes, one more thing. There's always one more thing in our technological world.<br/><br/>I walked into the bathroom for my evening ablutions only to have the toilet seat come off completely in my hand.<br/><br/>Just because you started it all, even for this,<br/><br/>Thank you Apple.<br/><div><br/></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6983287-8462550624728409907?l=commandcenter.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-09-23T03:33:33Z</updated>
    <published>2012-09-22T22:55:00Z</published>
    <author>
      <name>rob</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/18259238879445421354</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6983287</id>
      <author>
        <name>rob</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/18259238879445421354</uri>
      </author>
      <link href="http://commandcenter.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6983287/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://commandcenter.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <title>command center</title>
      <updated>2012-09-23T03:33:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-2317942697216558773</id>
    <link href="http://reneefrench.blogspot.com/feeds/2317942697216558773/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=2317942697216558773" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2317942697216558773" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2317942697216558773" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/09/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-icJWtrpfLlg/UF03Tv76EbI/AAAAAAAAFH0/3kMpAwm9Q8E/s1600/landscape35.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-icJWtrpfLlg/UF03Tv76EbI/AAAAAAAAFH0/3kMpAwm9Q8E/s320/landscape35.jpg" width="299"/></a></div> night train<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-2317942697216558773?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-09-22T03:58:23Z</updated>
    <published>2012-09-22T03:58:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/09/21/crime</id>
    <link href="http://www.imperialviolet.org/2012/09/21/crime.html" rel="alternate" type="text/html"/>
    <title>CRIME</title>
    <content type="html">&lt;p&gt;Last year I happened to worry on the SPDY mailing list about whether sensitive information could be obtained via SPDY's use of zlib for compressing headers. Sadly, I never got the time to follow up and find out whether it was a viable attack. Thankfully there exist security researchers who, independently, wondered the same thing and did the work for me! Today Duong and Rizzo presented that work at &lt;a href="http://www.ekoparty.org/2012/thai-duong.php"&gt;ekoparty 2012&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;They were also kind enough to let Firefox and ourselves know ahead of time so that we could develop and push security fixes before the public presentation. In order to explain what we did, let's start by looking at how SPDY compressed headers:&lt;/p&gt;

&lt;p&gt;(This is inline SVG, if you can't see it, &lt;a href="http://caniuse.com/svg-html5"&gt;check here&lt;/a&gt;.)&lt;/p&gt;

&lt;svg height="835" version="1.1" width="620" xmlns="http://www.w3.org/2000/svg"&gt;
&amp;lt;style&amp;gt;.ref { opacity: 0.3; } .ref:hover { opacity: 1.0; stroke-width: 2px; }&amp;lt;/style&amp;gt;
&lt;circle cx="10" cy="10" fill="white" r="5" stroke="black" stroke-width="1"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="23" y1="19" y2="14"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="103" y1="19" y2="14"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="103" y1="19" y2="14"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="183" y1="19" y2="14"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="15"&gt;:&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="203" y1="19" y2="14"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="15"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="15"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="15"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="265" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="265" x2="283" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="15"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="343" y1="19" y2="14"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="15"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="363" y1="19" y2="14"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="15"&gt;w&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="385" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="385" x2="403" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="15"&gt;w&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="405" y1="19" y2="19"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="405" x2="423" y1="19" y2="19"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="15"&gt;w&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="423" y1="19" y2="14"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="15"&gt;.&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="15"&gt;g&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="15"&gt;o&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="15"&gt;o&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="15"&gt;g&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="15"&gt;l&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="15"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="15"&gt;.&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="15"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="3" y1="39" y2="34"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="3" x2="5" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="5" x2="23" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="35"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="35"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="103" y1="39" y2="34"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="35"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="35"&gt;:&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="143" y1="39" y2="34"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="35"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="35"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="35"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="35"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="35"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="35"&gt;d&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="265" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="265" x2="283" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="343" y1="39" y2="34"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="35"&gt;G&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="35"&gt;E&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="35"&gt;T&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="403" y1="39" y2="34"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="405" x2="105" y1="35" y2="15"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="35"&gt;:&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="503" y1="39" y2="34"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="35"&gt;p&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="35"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="543" y1="39" y2="34"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="545" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="545" x2="563" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="35"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="563" x2="565" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="565" x2="583" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="35"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="583" x2="585" y1="39" y2="39"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="585" x2="603" y1="39" y2="39"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="35"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="3" x2="5" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="5" x2="23" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="43" y1="59" y2="54"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="55"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="55"&gt;/&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="59" y2="54"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="85" x2="45" y1="55" y2="35"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="105" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="105" x2="123" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="55"&gt;:&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="183" y1="59" y2="54"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="55"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="203" y1="59" y2="54"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="55"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="55"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="55"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="263" y1="59" y2="54"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="55"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="283" y1="59" y2="54"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="55"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="345" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="345" x2="363" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="383" y1="59" y2="54"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="55"&gt;h&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="55"&gt;t&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="55"&gt;t&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="55"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="463" y1="59" y2="54"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="55"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="485" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="485" x2="503" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="505" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="505" x2="523" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="523" x2="525" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="525" x2="543" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="55"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="543" y1="59" y2="54"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="55"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="55"&gt;:&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="583" y1="59" y2="54"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="583" x2="585" y1="59" y2="59"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="585" x2="603" y1="59" y2="59"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="55"&gt;v&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="3" x2="5" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="5" x2="23" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="75"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="75"&gt;r&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="75"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="75"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="75"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="75"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="75"&gt;H&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="75"&gt;T&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="75"&gt;T&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="265" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="265" x2="283" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="75"&gt;P&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="75"&gt;/&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="75"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="75"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="345" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="345" x2="363" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="75"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="385" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="385" x2="403" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="405" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="405" x2="423" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="423" y1="79" y2="74"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="423" y1="79" y2="74"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="425" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="425" x2="443" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="443" x2="445" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="445" x2="463" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="75"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="75"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="485" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="485" x2="503" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="75"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="505" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="505" x2="523" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="75"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="523" x2="525" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="525" x2="543" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="75"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="545" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="545" x2="563" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="75"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="563" x2="565" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="565" x2="583" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="583" x2="585" y1="79" y2="79"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="585" x2="603" y1="79" y2="79"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="75"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="3" x2="5" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="5" x2="23" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="95"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="23" y1="99" y2="94"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="95"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="43" y1="99" y2="94"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="95"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="95"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="95"&gt;x&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="95"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="95"&gt;/&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="95"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="95"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="95"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="95"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="95"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="243" y1="99" y2="94"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="243" y1="99" y2="94"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="95"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="265" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="265" x2="283" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="95"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="95"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="95"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="95"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="345" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="345" x2="363" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="95"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="95"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="385" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="385" x2="403" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="95"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="405" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="405" x2="423" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="95"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="425" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="425" x2="443" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="95"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="443" x2="445" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="445" x2="463" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="95"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="95"&gt;/&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="485" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="485" x2="503" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="95"&gt;x&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="505" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="505" x2="523" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="95"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="523" x2="525" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="525" x2="543" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="95"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="545" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="545" x2="563" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="95"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="563" x2="565" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="565" x2="583" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="95"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="583" x2="585" y1="99" y2="99"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="585" x2="603" y1="99" y2="99"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="95"&gt;+&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="3" x2="5" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="5" x2="23" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="115"&gt;x&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="115"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="115"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="115"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="83" y1="119" y2="114"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="119" y2="114"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="115"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="115"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="115"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="115"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="115"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="115"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="115"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="115"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="115"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="265" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="265" x2="283" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="115"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="115"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="115"&gt;/&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="115"&gt;x&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="345" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="345" x2="363" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="115"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="115"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="383" y1="119" y2="114"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="115"&gt;;&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="403" y1="119" y2="114"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="405" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="405" x2="423" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="115"&gt;q&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="425" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="425" x2="443" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="115"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="443" x2="445" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="445" x2="463" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="115"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="115"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="483" y1="119" y2="114"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="115"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="115"&gt;,&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="115"&gt;*&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="115"&gt;/&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="115"&gt;*&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="583" y1="119" y2="114"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="585" x2="385" y1="115" y2="115"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="119" y2="119"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="119" y2="119"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="115"&gt;;&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="135"&gt;q&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="135"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="135"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="135"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="139" y2="134"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="135"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="103" y1="139" y2="134"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="135"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="135"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="135"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="135"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="135"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="135"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="135"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="135"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="265" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="265" x2="283" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="135"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="135"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="135"&gt;-&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="135"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="345" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="345" x2="363" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="135"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="135"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="385" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="385" x2="403" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="135"&gt;r&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="405" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="405" x2="423" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="135"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="425" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="425" x2="443" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="135"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="443" x2="445" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="445" x2="463" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="135"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="135"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="485" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="485" x2="503" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="135"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="505" y1="139" y2="139"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="505" x2="523" y1="139" y2="139"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="135"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="523" x2="523" y1="139" y2="134"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="135"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="135"&gt;I&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="135"&gt;S&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="135"&gt;O&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="3" y1="159" y2="154"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="3" x2="5" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="5" x2="23" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="155"&gt;-&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="155"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="155"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="155"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="155"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="155"&gt;-&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="155"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="155"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="155"&gt;u&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="155"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="155"&gt;f&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="155"&gt;-&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="243" y1="159" y2="154"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="155"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="263" y1="159" y2="154"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="265" x2="585" y1="155" y2="115"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="155"&gt;;&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="155"&gt;q&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="155"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="155"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="155"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="363" y1="159" y2="154"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="155"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="155"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="403" y1="159" y2="154"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="405" x2="565" y1="155" y2="115"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="155"&gt;*&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="155"&gt;;&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="155"&gt;q&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="155"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="155"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="155"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="523" y1="159" y2="154"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="155"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="543" y1="159" y2="154"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="545" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="545" x2="563" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="155"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="563" x2="565" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="565" x2="583" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="155"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="583" x2="585" y1="159" y2="159"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="585" x2="603" y1="159" y2="159"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="155"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="3" x2="5" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="5" x2="23" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="175"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="175"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="175"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="175"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="175"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="175"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="175"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="175"&gt;-&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="175"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="175"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="175"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="175"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="175"&gt;d&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="265" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="265" x2="283" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="175"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="175"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="175"&gt;g&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="175"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="345" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="345" x2="363" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="175"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="175"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="383" y1="179" y2="174"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="175"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="403" y1="179" y2="174"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="405" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="405" x2="423" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="175"&gt;g&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="425" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="425" x2="443" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="175"&gt;z&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="443" x2="445" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="445" x2="463" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="175"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="175"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="485" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="485" x2="503" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="175"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="505" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="505" x2="523" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="175"&gt;d&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="523" x2="525" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="525" x2="543" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="175"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="545" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="545" x2="563" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="175"&gt;f&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="563" x2="565" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="565" x2="583" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="175"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="583" x2="585" y1="179" y2="179"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="585" x2="603" y1="179" y2="179"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="175"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="3" x2="5" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="5" x2="23" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="195"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="195"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="195"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="195"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="195"&gt;d&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="195"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="195"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="143" y1="199" y2="194"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="143" y1="199" y2="194"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="195"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="195"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="195"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="195"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="195"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="195"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="265" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="265" x2="283" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="195"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="195"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="195"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="195"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="345" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="345" x2="363" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="195"&gt;-&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="195"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="385" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="385" x2="403" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="195"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="405" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="405" x2="423" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="195"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="425" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="425" x2="443" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="195"&gt;g&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="443" x2="445" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="445" x2="463" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="195"&gt;u&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="195"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="485" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="485" x2="503" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="195"&gt;g&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="505" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="505" x2="523" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="195"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="523" x2="525" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="525" x2="543" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="195"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="545" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="545" x2="563" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="195"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="563" x2="565" y1="199" y2="199"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="565" x2="583" y1="199" y2="199"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="195"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="583" x2="583" y1="199" y2="194"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="195"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="215"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="215"&gt;n&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="215"&gt;-&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="215"&gt;U&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="215"&gt;S&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="103" y1="219" y2="214"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="215"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="215"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="215"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="163" y1="219" y2="214"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="163" y1="219" y2="214"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="165" x2="585" y1="215" y2="115"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="215"&gt;;&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="215"&gt;q&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="215"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="215"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="215"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="215"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="215"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="215"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="215"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="343" y1="219" y2="214"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="215"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="363" y1="219" y2="214"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="215"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="385" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="385" x2="403" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="215"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="405" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="405" x2="423" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="215"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="425" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="425" x2="443" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="215"&gt;k&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="443" x2="445" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="445" x2="463" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="215"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="215"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="485" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="485" x2="503" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="215"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="505" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="505" x2="523" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="215"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="523" x2="525" y1="219" y2="219"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="525" x2="543" y1="219" y2="219"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="215"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="543" y1="219" y2="214"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="215"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="215"&gt;P&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="215"&gt;R&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="235"&gt;E&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="235"&gt;F&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="235"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="235"&gt;I&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="235"&gt;D&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="235"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="235"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="235"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="235"&gt;c&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="235"&gt;b&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="235"&gt;b&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="235"&gt;f&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="235"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="235"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="235"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="235"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="235"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="235"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="235"&gt;a&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="235"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="235"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="235"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="235"&gt;:&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="235"&gt;F&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="235"&gt;F&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="235"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="235"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="235"&gt;:&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="235"&gt;T&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="235"&gt;M&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="255"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="23" y1="259" y2="254"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="255"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="255"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="255"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="83" y1="259" y2="254"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="259" y2="254"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="255"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="255"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="255"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="143" y1="259" y2="254"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="255"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="255"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="255"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="255"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="255"&gt;:&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="255"&gt;L&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="263" y1="259" y2="254"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="265" x2="585" y1="255" y2="235"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="255"&gt;M&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="255"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="255"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="255"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="255"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="255"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="255"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="255"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="255"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="255"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="255"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="255"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="259" y2="259"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="259" y2="259"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="255"&gt;:&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="523" y1="259" y2="254"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="255"&gt;S&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="255"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="255"&gt;f&lt;/text&gt;
&lt;circle cx="590" cy="250" fill="white" r="5" stroke="black" stroke-width="1"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="275"&gt;J&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="275"&gt;q&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="275"&gt;m&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="275"&gt;r&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="275"&gt;k&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="275"&gt;s&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="275"&gt;_&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="275"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="275"&gt;G&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="275"&gt;h&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="275"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="275"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="275"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="275"&gt;K&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="275"&gt;D&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="275"&gt;;&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="275"&gt; &lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="275"&gt;N&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="363" y1="279" y2="274"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="365" x2="65" y1="275" y2="235"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="279" y2="279"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="279" y2="279"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="275"&gt;I&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="279" y2="279"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="279" y2="279"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="275"&gt;D&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="279" y2="279"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="279" y2="279"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="275"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="423" y1="279" y2="274"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="275"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="275"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="275"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="275"&gt;k&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="275"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="275"&gt;f&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="275"&gt;K&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="275"&gt;d&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="275"&gt;q&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="295"&gt;_&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="295"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="295"&gt;g&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="295"&gt;u&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="295"&gt;F&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="295"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="295"&gt;O&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="295"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="295"&gt;F&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="295"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="295"&gt;g&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="295"&gt;V&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="295"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="295"&gt;K&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="295"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="295"&gt;C&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="295"&gt;I&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="295"&gt;t&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="295"&gt;F&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="295"&gt;b&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="295"&gt;x&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="295"&gt;d&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="295"&gt;d&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="295"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="295"&gt;f&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="295"&gt;D&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="295"&gt;W&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="295"&gt;L&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="295"&gt;g&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="295"&gt;x&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="315"&gt;T&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="315"&gt;H&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="315"&gt;f&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="315"&gt;a&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="315"&gt;Q&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="315"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="315"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="315"&gt;P&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="315"&gt;q&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="315"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="315"&gt;S&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="315"&gt;D&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="315"&gt;d&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="315"&gt;d&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="315"&gt;d&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="315"&gt;A&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="315"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="315"&gt;H&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="315"&gt;F&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="315"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="315"&gt;G&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="315"&gt;G&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="315"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="315"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="315"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="315"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="315"&gt;A&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="315"&gt;J&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="315"&gt;v&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="315"&gt;-&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="335"&gt;W&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="335"&gt;U&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="335"&gt;b&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="335"&gt;U&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="335"&gt;p&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="335"&gt;A&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="335"&gt;h&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="335"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="335"&gt;_&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="335"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="335"&gt;Y&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="335"&gt;Z&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="335"&gt;T&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="335"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="335"&gt;B&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="335"&gt;H&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="335"&gt;Q&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="335"&gt;N&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="335"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="335"&gt;f&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="335"&gt;A&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="335"&gt;B&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="335"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="335"&gt;j&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="335"&gt;O&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="335"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="335"&gt;_&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="335"&gt;Y&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="335"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="335"&gt;q&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="355"&gt;H&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="355"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="355"&gt;w&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="355"&gt;x&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="355"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="355"&gt;d&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="355"&gt;A&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="355"&gt;N&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="355"&gt;v&lt;/text&gt;
&lt;circle cx="190" cy="350" fill="white" r="5" stroke="black" stroke-width="1"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="355"&gt;I&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="355"&gt;n&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="355"&gt;J&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="355"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="355"&gt;R&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="355"&gt;r&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="355"&gt;h&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="355"&gt;l&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="355"&gt;s&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="355"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="355"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="355"&gt;h&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="355"&gt;M&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="355"&gt;Y&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="355"&gt;q&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="355"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="355"&gt;-&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="355"&gt;s&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="355"&gt;u&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="355"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="375"&gt;U&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="375"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="375"&gt;O&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="63" y1="379" y2="374"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="65" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="65" x2="83" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="375"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="375"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="375"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="375"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="375"&gt;u&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="165" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="165" x2="183" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="375"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="375"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="375"&gt;r&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="375"&gt;-&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="375"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="265" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="265" x2="283" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="375"&gt;g&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="283" x2="285" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="285" x2="303" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="375"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="303" x2="305" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="305" x2="323" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="375"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="323" x2="325" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="325" x2="343" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="375"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="345" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="345" x2="363" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="375"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="375"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="385" y1="379" y2="379"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="385" x2="403" y1="379" y2="379"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="375"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="403" y1="379" y2="374"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="375"&gt;g&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="375"&gt;M&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="375"&gt;o&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="375"&gt;z&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="375"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="375"&gt;l&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="375"&gt;l&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="375"&gt;a&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="375"&gt;/&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="375"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="395"&gt;.&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="395"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="395"&gt; &lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="395"&gt;(&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="395"&gt;X&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="395"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="395"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="395"&gt;;&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="395"&gt; &lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="395"&gt;L&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="395"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="395"&gt;n&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="395"&gt;u&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="395"&gt;x&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="395"&gt; &lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="395"&gt;x&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="395"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="395"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="395"&gt;_&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="395"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="395"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="395"&gt;)&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="443" y1="399" y2="394"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="443" x2="445" y1="399" y2="399"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="445" x2="463" y1="399" y2="399"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="395"&gt; &lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="399" y2="399"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="399" y2="399"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="395"&gt;A&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="485" y1="399" y2="399"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="485" x2="503" y1="399" y2="399"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="395"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="503" y1="399" y2="394"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="503" y1="399" y2="394"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="505" y1="399" y2="399"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="505" x2="523" y1="399" y2="399"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="395"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="523" x2="525" y1="399" y2="399"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="525" x2="543" y1="399" y2="399"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="395"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="545" y1="399" y2="399"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="545" x2="563" y1="399" y2="399"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="395"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="563" x2="563" y1="399" y2="394"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="395"&gt;W&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="395"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="415"&gt;b&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="415"&gt;K&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="415"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="415"&gt;t&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="415"&gt;/&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="415"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="415"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="415"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="415"&gt;.&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="415"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="203" y1="419" y2="414"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="205" x2="25" y1="415" y2="395"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="419" y2="419"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="419" y2="419"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="415"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="419" y2="419"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="419" y2="419"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="415"&gt; &lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="419" y2="419"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="419" y2="419"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="415"&gt;(&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="263" y1="419" y2="414"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="415"&gt;K&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="415"&gt;H&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="415"&gt;T&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="415"&gt;M&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="415"&gt;L&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="415"&gt;,&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="415"&gt; &lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="415"&gt;l&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="415"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="415"&gt;k&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="415"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="415"&gt; &lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="415"&gt;G&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="415"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="415"&gt;c&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="415"&gt;k&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="415"&gt;o&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="435"&gt;)&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="435"&gt; &lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="435"&gt;C&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="435"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="439" y2="434"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="439" y2="439"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="439" y2="439"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="435"&gt;r&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="439" y2="439"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="439" y2="439"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="435"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="439" y2="439"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="439" y2="439"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="435"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="143" y1="439" y2="434"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="435"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="435"&gt;/&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="435"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="435"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="435"&gt;.&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="435"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="435"&gt;.&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="435"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="435"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="435"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="435"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="363" y1="439" y2="434"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="365" x2="5" y1="435" y2="395"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="439" y2="439"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="439" y2="439"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="435"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="439" y2="439"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="439" y2="439"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="435"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="439" y2="439"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="439" y2="439"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="435"&gt; &lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="423" y1="439" y2="434"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="435"&gt;S&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="435"&gt;a&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="435"&gt;f&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="435"&gt;a&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="435"&gt;r&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="435"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="543" y1="439" y2="434"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="545" x2="85" y1="435" y2="415"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="439" y2="439"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="439" y2="439"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="435"&gt;/&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="439" y2="439"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="439" y2="439"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="435"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="439" y2="439"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="439" y2="439"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="435"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="455"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="455"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="455"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="455"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="459" y2="454"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="459" y2="454"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="455"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="455"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="455"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="145" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="145" x2="163" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="455"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="163" x2="163" y1="459" y2="454"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="455"&gt;x&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="183" y1="459" y2="454"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="185" x2="305" y1="455" y2="135"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="455"&gt;-&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="455"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="455"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="243" y1="459" y2="454"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="243" y1="459" y2="454"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="245" x2="85" y1="455" y2="435"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="455"&gt;r&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="455"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="455"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="455"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="323" y1="459" y2="454"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="455"&gt;-&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="343" y1="459" y2="454"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="343" x2="345" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="345" x2="363" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="455"&gt;v&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="363" x2="365" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="365" x2="383" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="455"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="383" x2="385" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="385" x2="403" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="455"&gt;r&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="403" x2="403" y1="459" y2="454"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="455"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="423" y1="459" y2="454"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="425" x2="205" y1="455" y2="115"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="455"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="455"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="455"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="455"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="455"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="523" y1="459" y2="454"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="523" y1="459" y2="454"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="525" x2="465" y1="455" y2="55"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="455"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="455"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="455"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="459" y2="459"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="459" y2="459"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="455"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="603" x2="603" y1="459" y2="454"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="475"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="475"&gt;C&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="475"&gt;M&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="475"&gt;+&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="475"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="475"&gt;y&lt;/text&gt;
&lt;circle cx="130" cy="470" fill="white" r="5" stroke="black" stroke-width="1"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="475"&gt;Q&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="475"&gt;E&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="475"&gt;I&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="475"&gt;l&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="475"&gt;b&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="475"&gt;b&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="475"&gt;J&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="475"&gt;A&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="475"&gt;Q&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="475"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="475"&gt;d&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="475"&gt;t&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="475"&gt;s&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="475"&gt;k&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="475"&gt;B&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="475"&gt;C&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="475"&gt;K&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="475"&gt;S&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="475"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="523" y1="479" y2="474"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="525" x2="105" y1="475" y2="475"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="479" y2="479"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="479" y2="479"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="475"&gt;y&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="479" y2="479"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="479" y2="479"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="475"&gt;Q&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="479" y2="479"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="479" y2="479"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="475"&gt;E&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="479" y2="479"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="479" y2="479"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="475"&gt;I&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="603" x2="603" y1="479" y2="474"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="495"&gt;p&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="495"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="43" y1="499" y2="494"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="45" x2="245" y1="495" y2="475"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="495"&gt;b&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="495"&gt;J&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="495"&gt;A&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="105" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="105" x2="123" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="495"&gt;Q&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="495"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="143" y1="499" y2="494"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="495"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="163" y1="499" y2="494"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="165" x2="365" y1="495" y2="475"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="495"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="495"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="495"&gt;k&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="495"&gt;B&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="495"&gt;C&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="263" y1="499" y2="494"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="495"&gt;L&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="495"&gt;u&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="495"&gt;D&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="495"&gt;y&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="495"&gt;g&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="495"&gt;E&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="495"&gt;=&lt;/text&gt;
&lt;circle cx="410" cy="490" fill="black" r="5" stroke="black" stroke-width="1"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="423" y1="499" y2="494"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="423" x2="425" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="425" x2="443" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="495"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="443" x2="445" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="445" x2="463" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="495"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="463" x2="465" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="465" x2="483" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="495"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="483" x2="485" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="485" x2="503" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="495"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="503" x2="503" y1="499" y2="494"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="503" y1="499" y2="494"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="505" x2="105" y1="495" y2="15"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="495"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="495"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="495"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="495"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="499" y2="499"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="499" y2="499"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="495"&gt;:&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="515"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="515"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="515"&gt;s&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="515"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="515"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="105" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="105" x2="123" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="515"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="515"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="515"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="515"&gt;w&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="515"&gt;w&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="515"&gt;w&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="515"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="515"&gt;g&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="515"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="515"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="515"&gt;g&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="515"&gt;l&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="515"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="515"&gt;.&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="515"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="515"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="515"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="515"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="515"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="515"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="515"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="515"&gt;:&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="515"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="515"&gt;e&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="519" y2="519"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="519" y2="519"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="515"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="535"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="535"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="535"&gt;d&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="105" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="105" x2="123" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="535"&gt;G&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="535"&gt;E&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="535"&gt;T&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="535"&gt;:&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="535"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="535"&gt;a&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="535"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="535"&gt;h&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="539" y2="539"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="539" y2="539"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="535"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="423" y1="539" y2="534"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="535"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="535"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="535"&gt;/&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="535"&gt;c&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="535"&gt;s&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="535"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="535"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="535"&gt;v&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="535"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="555"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="555"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="555"&gt;s&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="555"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="555"&gt;w&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="555"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="555"&gt;b&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="555"&gt;h&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="555"&gt;p&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="555"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="555"&gt;a&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="555"&gt;c&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="243" y1="559" y2="554"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="245" x2="445" y1="555" y2="455"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="559" y2="559"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="559" y2="559"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="555"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="559" y2="559"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="559" y2="559"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="555"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="559" y2="559"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="559" y2="559"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="555"&gt;o&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="559" y2="559"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="559" y2="559"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="555"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="323" y1="559" y2="554"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="555"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="555"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="555"&gt;s&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="555"&gt;r&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="555"&gt;t&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="555"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="555"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="555"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="555"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="555"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="555"&gt;p&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="555"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="555"&gt;s&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="555"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="575"&gt;n&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="575"&gt;p&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="575"&gt;n&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="575"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="575"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="575"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="575"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="575"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="575"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="575"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="575"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="575"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="575"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="575"&gt;,&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="575"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="575"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="575"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="575"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="575"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="383" y1="579" y2="574"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="385" x2="265" y1="575" y2="575"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="579" y2="579"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="579" y2="579"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="575"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="579" y2="579"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="579" y2="579"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="575"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="579" y2="579"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="579" y2="579"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="575"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="579" y2="579"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="579" y2="579"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="575"&gt;6&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="463" y1="579" y2="574"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="575"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="575"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="575"&gt;,&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="575"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="575"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="575"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="575"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="3" y1="599" y2="594"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="5" x2="485" y1="595" y2="575"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="595"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="595"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="595"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="63" y1="599" y2="594"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="595"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="595"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="595"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="595"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="595"&gt;,&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="595"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="595"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="595"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="595"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="595"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="595"&gt;,&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="595"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="595"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="595"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="595"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="363" y1="599" y2="594"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="365" x2="125" y1="595" y2="595"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="595"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="595"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="595"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="423" y1="599" y2="594"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="595"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="595"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="595"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="595"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="503" y1="599" y2="594"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="505" x2="385" y1="595" y2="595"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="595"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="595"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="595"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="599" y2="599"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="599" y2="599"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="595"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="583" y1="599" y2="594"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="595"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="615"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="615"&gt;,&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="615"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="615"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="619" y2="614"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="83" x2="85" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="85" x2="103" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="615"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="103" x2="105" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="105" x2="123" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="615"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="123" x2="125" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="125" x2="143" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="615"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="143" x2="143" y1="619" y2="614"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="143" y1="619" y2="614"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="145" x2="25" y1="615" y2="615"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="615"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="615"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="615"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="203" y1="619" y2="614"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="615"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="615"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="243" y1="619" y2="614"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="245" x2="245" y1="615" y2="595"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="615"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="615"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="615"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="303" y1="619" y2="614"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="615"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="615"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="615"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="615"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="383" y1="619" y2="614"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="385" x2="265" y1="615" y2="615"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="615"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="615"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="615"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="443" y1="619" y2="614"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="615"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="615"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="615"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="615"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="523" y1="619" y2="614"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="523" x2="525" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="525" x2="543" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="615"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="543" x2="545" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="545" x2="563" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="615"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="563" x2="565" y1="619" y2="619"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="565" x2="583" y1="619" y2="619"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="615"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="583" x2="583" y1="619" y2="614"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="615"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="635"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="23" y1="639" y2="634"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="25" x2="505" y1="635" y2="615"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="635"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="635"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="635"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="639" y2="634"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="635"&gt;3&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="635"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="123" y1="639" y2="634"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="125" x2="365" y1="635" y2="615"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="635"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="635"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="635"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="183" y1="639" y2="634"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="183" y1="639" y2="634"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="635"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="635"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="635"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="243" y1="639" y2="634"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="243" y1="639" y2="634"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="245" x2="425" y1="635" y2="255"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="635"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="635"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="635"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="303" y1="639" y2="634"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="303" y1="639" y2="634"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="305" x2="145" y1="635" y2="635"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="635"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="635"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="635"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="635"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="635"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="403" y1="639" y2="634"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="635"&gt;1&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="635"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="443" y1="639" y2="634"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="445" x2="285" y1="635" y2="635"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="635"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="635"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="635"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="635"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="635"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="635"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="639" y2="639"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="639" y2="639"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="635"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="583" y1="639" y2="634"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="635"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="655"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="23" y1="659" y2="654"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="25" x2="465" y1="655" y2="635"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="655"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="655"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="105" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="105" x2="123" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="655"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="655"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="143" y1="659" y2="654"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="143" y1="659" y2="654"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="145" x2="225" y1="655" y2="615"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="655"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="655"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="223" y1="659" y2="654"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="223" y1="659" y2="654"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="225" x2="65" y1="655" y2="655"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="655"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="655"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="655"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="323" y1="659" y2="654"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="323" y1="659" y2="654"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="325" x2="5" y1="655" y2="655"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="655"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="655"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="655"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="655"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="655"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="463" y1="659" y2="654"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="655"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="483" y1="659" y2="654"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="485" x2="445" y1="655" y2="635"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="655"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="655"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="655"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="563" y1="659" y2="654"&gt;
&lt;circle cx="570" cy="650" fill="black" r="5" stroke="black" stroke-width="1"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="583" y1="659" y2="654"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="583" x2="585" y1="659" y2="659"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="585" x2="603" y1="659" y2="659"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="655"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="3" x2="5" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="5" x2="23" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="23" x2="25" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="25" x2="43" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="43" x2="45" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="45" x2="63" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="675"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="63" x2="63" y1="679" y2="674"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="675"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="679" y2="674"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="85" x2="25" y1="675" y2="635"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="675"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="105" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="105" x2="123" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="675"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="143" y1="679" y2="674"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="143" y1="679" y2="674"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="145" x2="5" y1="675" y2="675"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="675"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="675"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="223" y1="679" y2="674"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="675"&gt;6&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="243" y1="679" y2="674"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="245" x2="85" y1="675" y2="675"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="675"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="675"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="343" y1="679" y2="674"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="675"&gt;2&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="675"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="403" y1="679" y2="674"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="405" x2="245" y1="675" y2="675"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="675"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="675"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="675"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="675"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="675"&gt;6&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="543" y1="679" y2="674"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="675"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="563" y1="679" y2="674"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="565" x2="405" y1="675" y2="675"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="675"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="679" y2="679"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="679" y2="679"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="675"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="695"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="699" y2="694"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="83" y1="699" y2="694"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="85" x2="465" y1="695" y2="615"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="695"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="105" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="105" x2="123" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="695"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="695"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="695"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="183" y1="699" y2="694"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="183" y1="699" y2="694"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="183" x2="185" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="185" x2="203" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="203" x2="205" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="205" x2="223" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="223" x2="225" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="225" x2="243" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="695"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="243" x2="245" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="245" x2="263" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,128,255); stroke-width: 1px;" x1="263" x2="263" y1="699" y2="694"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="263" y1="699" y2="694"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="265" x2="105" y1="695" y2="695"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="695"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="695"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="695"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="695"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="403" y1="699" y2="694"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="695"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="695"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="443" y1="699" y2="694"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="445" x2="285" y1="695" y2="695"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="695"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="695"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="695"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="695"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="699" y2="699"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="699" y2="699"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="695"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="583" y1="699" y2="694"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="695"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="3" y1="719" y2="714"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="5" x2="445" y1="715" y2="695"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="715"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="715"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="103" y1="719" y2="714"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="715"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="715"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="715"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="163" y1="719" y2="714"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="165" x2="5" y1="715" y2="715"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="715"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="715"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="715"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="715"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="303" y1="719" y2="714"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="303" y1="719" y2="714"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="305" x2="225" y1="715" y2="675"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="715"&gt;6&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="715"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="715"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="423" y1="719" y2="714"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="715"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="715"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="463" y1="719" y2="714"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="465" x2="305" y1="715" y2="715"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="715"&gt;6&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="715"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="505" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="505" x2="523" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="505" y="715"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="715"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="719" y2="719"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="719" y2="719"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="715"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="735"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="23" y1="739" y2="734"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="735"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="43" y1="739" y2="734"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="45" x2="485" y1="735" y2="715"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="735"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="735"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="105" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="105" x2="123" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="735"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="163" y1="739" y2="734"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="735"&gt;5&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="735"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="203" y1="739" y2="734"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="205" x2="45" y1="735" y2="735"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="735"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="735"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="735"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="323" y1="739" y2="734"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="735"&gt;9&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="343" y1="739" y2="734"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="345" x2="185" y1="735" y2="735"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="735"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="735"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="735"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="463" y1="739" y2="734"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="735"&gt;6&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="735"&gt;0&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="735"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="523" y1="739" y2="734"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="525" x2="365" y1="735" y2="735"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="735"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="735"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="739" y2="739"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="739" y2="739"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="735"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="755"&gt;6&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="43" y1="759" y2="754"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="43" y1="759" y2="754"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="45" x2="445" y1="755" y2="715"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="755"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="65" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="65" x2="83" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="65" y="755"&gt;6&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="83" x2="85" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="85" x2="103" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="85" y="755"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="103" x2="105" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="105" x2="123" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="105" y="755"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="183" y1="759" y2="754"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="755"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="755"&gt;6&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="223" y1="759" y2="754"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="225" x2="145" y1="755" y2="715"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="755"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="755"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="265" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="265" x2="283" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="265" y="755"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="283" x2="285" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="285" x2="303" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="285" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="303" x2="305" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="305" x2="323" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="305" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="343" y1="759" y2="754"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="755"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="755"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="383" y1="759" y2="754"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="385" x2="505" y1="755" y2="735"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="385" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="385" x2="403" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="385" y="755"&gt;5&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="755"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="755"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="755"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="503" y1="759" y2="754"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="755"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="755"&gt;3&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="543" y1="759" y2="754"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="545" x2="545" y1="755" y2="675"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="755"&gt;7&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="755"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="759" y2="759"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="759" y2="759"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="755"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="775"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="775"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="45" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="45" x2="63" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="45" y="775"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="63" x2="63" y1="779" y2="774"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="775"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="775"&gt;4&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="775"&gt;1&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="123" y1="779" y2="774"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="125" x2="565" y1="775" y2="755"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="123" x2="125" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="125" x2="143" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="125" y="775"&gt;,&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="143" x2="145" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="145" x2="163" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="145" y="775"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="163" x2="165" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="165" x2="183" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="165" y="775"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="183" x2="185" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="185" x2="203" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="185" y="775"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="203" x2="205" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="205" x2="223" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="205" y="775"&gt;0&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="223" x2="225" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="225" x2="243" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="225" y="775"&gt;8&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="243" x2="245" y1="779" y2="779"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="245" x2="263" y1="779" y2="779"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="245" y="775"&gt;4&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="263" x2="263" y1="779" y2="774"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="775"&gt;9&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="775"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="775"&gt;e&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="325" y="775"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="345" y="775"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="365" y="775"&gt;Y&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="775"&gt;r&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="405" y="775"&gt;N&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="425" y="775"&gt;P&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="445" y="775"&gt;U&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="465" y="775"&gt;N&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="485" y="775"&gt;P&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="775"&gt;t&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="525" y="775"&gt;H&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="545" y="775"&gt;8&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="565" y="775"&gt;T&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="585" y="775"&gt;C&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="5" y="795"&gt;g&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="25" y="795"&gt;A&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="45" y="795"&gt;f&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="65" y="795"&gt;Y&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="85" y="795"&gt;7&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="105" y="795"&gt;I&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="125" y="795"&gt;C&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="145" y="795"&gt;A&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="165" y="795"&gt;C&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="185" y="795"&gt;g&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="205" y="795"&gt;?&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="225" y="795"&gt;i&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="245" y="795"&gt;m&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="265" y="795"&gt;c&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="285" y="795"&gt;=&lt;/text&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="305" y="795"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="323" y1="799" y2="794"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="325" x2="205" y1="795" y2="795"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="323" x2="325" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="325" x2="343" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="325" y="795"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="343" x2="345" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="345" x2="363" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="345" y="795"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="363" x2="365" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="365" x2="383" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="365" y="795"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="383" x2="383" y1="799" y2="794"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="385" y="795"&gt;n&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="403" y1="799" y2="794"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="405" x2="285" y1="795" y2="795"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="403" x2="405" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="405" x2="423" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="405" y="795"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="423" x2="425" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="425" x2="443" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="425" y="795"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="443" x2="445" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="445" x2="463" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="445" y="795"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="463" x2="465" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="465" x2="483" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="465" y="795"&gt;i&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="483" x2="485" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="485" x2="503" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="485" y="795"&gt;m&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="503" x2="503" y1="799" y2="794"&gt;
&lt;text fill="red" font-family="Monospace" font-size="15px" x="505" y="795"&gt;p&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="523" y1="799" y2="794"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="525" x2="405" y1="795" y2="795"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="523" x2="525" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="525" x2="543" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="525" y="795"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="543" x2="545" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="545" x2="563" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="545" y="795"&gt;2&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="563" x2="565" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="565" x2="583" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="565" y="795"&gt;?&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="583" y1="799" y2="794"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="583" y1="799" y2="794"&gt;
&lt;line class="ref" style="stroke: rgb(0,0,0); stroke-width: 2px;" x1="585" x2="385" y1="795" y2="555"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="583" x2="585" y1="799" y2="799"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="585" x2="603" y1="799" y2="799"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="585" y="795"&gt;r&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="3" x2="5" y1="819" y2="819"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="5" x2="23" y1="819" y2="819"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="5" y="815"&gt;t&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="23" x2="25" y1="819" y2="819"&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="25" x2="43" y1="819" y2="819"&gt;
&lt;text fill="black" font-family="Monospace" font-size="15px" x="25" y="815"&gt;=&lt;/text&gt;
&lt;line style="stroke: rgb(0,0,255); stroke-width: 1px;" x1="43" x2="43" y1="819" y2="814"&gt;
&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/circle&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/circle&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/circle&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/circle&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/circle&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/line&gt;&lt;/circle&gt;&lt;/svg&gt;

&lt;p&gt;That's a pretty busy diagram! But I don't think it's too bad with a bit of explanation:&lt;/p&gt;

&lt;p&gt;zlib uses a language with basically two statements: “output these literal bytes” and “go back &lt;i&gt;x&lt;/i&gt; bytes and duplicate &lt;i&gt;y&lt;/i&gt; bytes from there”. In the diagram, red text was included literally and black text came from duplicating previous text.&lt;/p&gt;

&lt;p&gt;The duplicated text is underlined. A dark blue underline means that the original text is in the diagram and there will be a gray line pointing to where it came from. (You can hover the mouse over one of those lines to make it darker.)&lt;/p&gt;

&lt;p&gt;A light blue underline means that the original text came from a pre-shared dictionary of strings. SPDY defines some common text, for zlib to be able to refer to, that contains strings that we expect to find in the headers. This is most useful at the beginning of compression when there wouldn't otherwise be any text to refer back to.&lt;/p&gt;

&lt;p&gt;The problem that CRIME highlights is that sensitive cookie data and an attacker controlled path is compressed together in the same context. Cookie data makes up most of the red, uncompressed bytes in the diagram. If the path contains some cookie data, then the compressed headers will be shorter because zlib will be able to refer back to the path, rather than have to output all the literal bytes of the cookie. If you arrange things so that you can probe the contents of the cookie incrementally, then (assuming that the cookie is base64), you can extract the cookie byte-by-byte by inducing the browser to make requests.&lt;/p&gt;

&lt;p style="float: right; margin-left: 10px; margin-top: 0px; padding-top: 0px;"&gt;&lt;img src="http://www.imperialviolet.org/binary/crime1.png" style="vertical-align: top; margin: 5px;" /&gt;&lt;img src="http://www.imperialviolet.org/binary/crime2.png" style="vertical-align: top; margin: 5px;" /&gt;&lt;/p&gt;

&lt;p&gt;For details of how to get zlib to reveal that information in practice, I'll just refer you to Duong and Rizzo's CRIME presentation. It's good work.&lt;/p&gt;

&lt;p&gt;In order to carry out this attack, the attacker needs to be able to observe your network traffic and to be able to cause many arbitrary requests to be sent. An active network attacker can do both by injecting Javascript into any HTTP page load that you make in the same session.&lt;/p&gt;

&lt;p&gt;When we learned of this work, we were already in the process of designing the compression for SPDY/4, which avoids this problem. But we still needed to do something about SPDY/2 and SPDY/3 which are currently deployed. To that end, Chrome 21 and Firefox 15 have switched off SPDY header compression because that's a minimal change that easily backports.&lt;/p&gt;

&lt;p&gt;Chrome has also switched off TLS compression, through which a very similar attack can be mounted.&lt;/p&gt;

&lt;p&gt;But we like SPDY header compression because it saves significant amounts of data on the wire! Since SPDY/4 isn't ready to go yet we have a more complex solution for Chrome 22/23 that compresses data separately while still being backwards compatible.&lt;/p&gt;

&lt;p&gt;Most importantly cookie data will only ever be duplicated exactly, and in its entirety, against other cookie data. Each cookie will also be placed in its own Huffman group (Huffman coding is a zlib detail that I skipped over in the explanation above). Finally, in case other headers contain sensitive data (i.e. when set by an &lt;tt&gt;XMLHttpRequest&lt;/tt&gt;), non-standard headers will be compressed in their own Huffman group without any back references.&lt;/p&gt;

&lt;p&gt;That's only a brief overview of the rules. The code to follow them and continue to produce a valid zlib stream wasn't one of the cleaner patches ever landed in Chrome and I'll be happy to revert it when SPDY/4 is ready. But it's effective at getting much of the benefit of compression back.&lt;/p&gt;

&lt;p&gt;To the right are a couple of images of the same sort of diagram as above, but zoomed out. At this level of zoom, all you can really see are the blocks of red (literal) and blue (duplicated) bytes. The diagram on the right has the new rules enabled and, as you can see, there is certainly more red in there. However that's mostly the result of limited window size. In order to save on server memory, Chrome only uses 2048-byte compression windows and, under the new rules, a previous cookie value has to fit completely within the window in order to be matched. So things are a little less efficient until SPDY/4, although we might choose to trade a little more memory to make up for that.&lt;/p&gt;</content>
    <updated>2012-09-21T07:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>https://sites.google.com/feeds/content/kryas.com/kryas/6751889982644620939</id>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/5119061230095011683" rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"/>
    <link href="https://sites.google.com/a/kryas.com/kryas/recent_posts/careerresources" rel="alternate" type="text/html"/>
    <link href="https://sites.google.com/feeds/revision/kryas.com/kryas/6751889982644620939" rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/6751889982644620939" rel="self" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/6751889982644620939" rel="edit" type="application/atom+xml"/>
    <title>Career Resources</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox"><tbody><tr><td class="sites-layout-tile sites-tile-name-content-1"><div dir="ltr">Here I am compiling a list of resources used to prepare for technical interviews:<br/><br/><a href="http://developerauction.com/" rel="nofollow">developer auction</a><br/><a href="http://www.careercup.com/" rel="nofollow">CareerCup</a><br/><a href="http://www.topcoder.com/" rel="nofollow">TopCoder</a><br/><br/></div></td></tr></tbody></table></div>
    </content>
    <updated>2012-09-18T18:49:58Z</updated>
    <published>2012-08-31T21:52:08Z</published>
    <category label="announcement" scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#announcement"/>
    <author>
      <name>Stan Steel</name>
      <email>steel@kryas.com</email>
    </author>
    <source>
      <id>https://sites.google.com/feeds/content/kryas.com/kryas</id>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#post" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas/batch" rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas?parent=5119061230095011683&amp;kind=announcement" rel="self" type="application/atom+xml"/>
      <title>Posts of Development Blog</title>
      <updated>2012-10-18T04:10:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://gowithconfidence.tumblr.com/post/31797884887</id>
    <link href="http://gowithconfidence.tumblr.com/post/31797884887" rel="alternate" type="text/html"/>
    <title>applied mux()ing: a LimitBuffer</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>In a previous post I discussed <a href="http://gowithconfidence.tumblr.com/post/31431608488/muxing">mux()ing</a>, which is probably one of my favorite things.</p>

<p>Here I will show a fun application of mux()ing that I’m calling a LimitBuffer. It’s similar to a bytes.Buffer, except that it limits the amount of data stored in its buffer at any given time. Calls to .Write() will block until they no longer overflow the buffer. Calls to .Read() will block until there is data to read or the LimitBuffer has been closed.</p>



<p>First, the basic type and constructor.</p>

<pre><code>type LimitBuffer struct {
    limit    int
    buf      bytes.Buffer
    writes   chan writeRequest
    reads    chan readRequest
    isclosed bool
}

func NewLimitBuffer(limit int) (lb *LimitBuffer) {
    lb = &amp;LimitBuffer{
        limit:  limit,
        writes: make(chan writeRequest),
        reads:  make(chan readRequest),
    }
    go lb.mux()
    return
}
</code></pre>

<p>Since we’re using a mux(), we need to create the channels that bring data safely into the mux() goroutine. The .writes channel will take care of calls to .Write() and .Close(), and the .reads channel will take care of calls to .Read(). Of these three important methods, .Write() and .Read() both have return values. Since channels are mostly one-way means of communication, we’ll have to do something extra here.</p>

<p>This brings us to the request and response types.</p>

<pre><code>type writeRequest struct {
    buf      []byte
    closeit  bool
    response chan writeResponse
}
type writeResponse struct {
    n   int
    err error
}

type readRequest struct {
    buf      []byte
    response chan readResponse
}
type readResponse struct {
    n   int
    err error
}
</code></pre>

<p>The extra bit is the response channel in both request types. Since it takes a channel to get data in, it makes sense that we’d use a channel to get data out as well.</p>

<p>Both reading and writing have their own response types that wrap the return values of a normal .Read() and .Write() method.</p>

<p>Let’s look at the simpler operation first: .Read().</p>

<pre><code>func (lb *LimitBuffer) Read(buf []byte) (n int, err error) {
    req := readRequest{
        buf:      buf,
        response: make(chan readResponse, 1),
    }
    lb.reads &lt;- req
    response := &lt;-req.response
    n, err = response.n, response.err
    return
}
</code></pre>

<p>We created a request, loaded it up with the buffer and made a channel that the response could be sent back on. The channel is buffered so that the mux() wastes no time on unneeded synchronization when sending the data back. There’s no reason for it to wait around until the .Read()ing goroutine wakes back up and gets the response. Since the channel is buffered, it can drop the value in and go on its way with other operations.</p>

<p>I’ve made .Write() a little more complicated so that it will block until it is able to completely write the buffer into the LimitBuffer. Since the LimitBuffer will store only a certain amount of data at a time, this could cause .Write() to wait until more .Read() calls have been executed.</p>

<p>It would be acceptable for me to have let .Write() do partial writes, and return how much data was written, but then to be useful almost anyone would have to write a for loop similar to the one below.</p>

<p>If there were a .Write() analog to io.ReadFull(), I could use that here. But there isn’t, so I don’t. It would look a lot like this anyway.</p>

<pre><code>func (lb *LimitBuffer) Write(buf []byte) (n int, err error) {
    for len(buf) &gt; 0 {
        req := writeRequest{
            buf:      buf,
            response: make(chan writeResponse, 1),
        }
        lb.writes &lt;- req
        response := &lt;-req.response
        m, werr := response.n, response.err
        n += m
        if werr != nil {
            err = werr
            return
        }
        buf = buf[m:]
    }
    return
}
</code></pre>

<p>Since in go-land closing is usually considered a write operation (at least, it is with channels), I have piggybacked on the write request to allow closing, too. Since I have decided that there is no possibility of error when closing, the writeRequest has no response channel.</p>

<pre><code>func (lb *LimitBuffer) Close() error {
    req := writeRequest{
        closeit:  true,
    }
    lb.writes &lt;- req
    return nil
}
</code></pre>

<p>Now we get to the meat of the code - the mux() method. Usually I like to have a single for{} with a single select{} inside, but in this case there are some special situations.</p>

<pre><code>func (lb *LimitBuffer) mux() {
    for {
</code></pre>

<p>If the buffer is closed, all .Write()s return an error, and all .Read()s return an error once the buffer has emptied.</p>

<pre><code>        if lb.isclosed {
            if lb.buf.Len() == 0 {
                select {
                case req := &lt;-lb.reads:
                    req.response &lt;- readResponse{
                        n:   0,
                        err: io.EOF,
                    }
                case req := &lt;-lb.writes:
                    lb.handleWriteClosed(req)
                }
            } else {
                select {
                case req := &lt;-lb.reads:
                    lb.handleRead(req)
                case req := &lt;-lb.writes:
                    lb.handleWriteClosed(req)
                }
            }
            continue
        }
</code></pre>

<p>If the buffer is at its limit, we’ll save the .Write()s for later.</p>

<pre><code>        if lb.buf.Len() &gt; lb.limit {
            lb.handleRead(&lt;-lb.reads)
            continue
        }
</code></pre>

<p>If the buffer is currently empty, we can’t deal with a .Read() (or at least, I don’t want to).</p>

<pre><code>        if lb.buf.Len() == 0 {
            lb.handleWrite(&lt;-lb.writes)
            continue
        }
</code></pre>

<p>If it’s not closed, empty, or at its limit, then both .Read()s and .Write()s can happen.</p>

<pre><code>        select {
        case req := &lt;-lb.reads:
            lb.handleRead(req)
        case req := &lt;-lb.writes:
            lb.handleWrite(req)
        }
    }
}
</code></pre>

<p>Since some code would have been duplicated otherwise, I dropped it into helper methods.</p>

<pre><code>func (lb *LimitBuffer) handleRead(req readRequest) {
    n, err := lb.buf.Read(req.buf)
    req.response &lt;- readResponse{n, err}
}

func (lb *LimitBuffer) handleWrite(req writeRequest) {
    if req.closeit {
        lb.isclosed = true
    } else {
        m := lb.limit - lb.buf.Len()
        if m &gt; len(req.buf) {
            m = len(req.buf)
        }
        n, err := lb.buf.Write(req.buf[:m])
        req.response &lt;- writeResponse{n, err}
    }
}

func (lb *LimitBuffer) handleWriteClosed(req writeRequest) {
    req.response &lt;- writeResponse{
        n:   0,
        err: errors.New("Writing to closed stream"),
    }
}
</code></pre>

<p>Here is a <a href="https://gist.github.com/3743756">gist</a> with the full code embedded in an example program.</p></div>
    </summary>
    <updated>2012-09-18T15:28:00Z</updated>
    <source>
      <id>http://gowithconfidence.tumblr.com/</id>
      <link href="http://tumblr.superfeedr.com/" rel="hub" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/" rel="alternate" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/rss" rel="self" type="application/rss+xml"/>
      <subtitle>Thoughts with Go, by John Asmuth</subtitle>
      <title>go with confidence</title>
      <updated>2012-10-18T04:00:51Z</updated>
    </source>
  </entry>

  <entry>
    <id>https://sites.google.com/feeds/content/kryas.com/kryas/4395719222956314007</id>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/5119061230095011683" rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"/>
    <link href="https://sites.google.com/a/kryas.com/kryas/recent_posts/castingagouint32toabytearray" rel="alternate" type="text/html"/>
    <link href="https://sites.google.com/feeds/revision/kryas.com/kryas/4395719222956314007" rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/4395719222956314007" rel="self" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/4395719222956314007" rel="edit" type="application/atom+xml"/>
    <title>Casting a Go uint32 to a byte array</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox"><tbody><tr><td class="sites-layout-tile sites-tile-name-content-1"><div dir="ltr"><div>Why I am keeping this information is a mystery.<br/><br/>func main() {</div><div>  var i uint32 = 0x12345678;</div><div>  x := (*[4]byte)(unsafe.Pointer(&amp;i))</div><div>  for _, xn := range *x {</div><div>    fmt.Printf("%x\n", xn)</div><div>  } </div><div>} <br/></div></div></td></tr></tbody></table></div>
    </content>
    <updated>2012-09-18T14:52:52Z</updated>
    <published>2012-09-18T14:52:52Z</published>
    <category label="announcement" scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#announcement"/>
    <author>
      <name>Stan Steel</name>
      <email>steel@kryas.com</email>
    </author>
    <source>
      <id>https://sites.google.com/feeds/content/kryas.com/kryas</id>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#post" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas/batch" rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas?parent=5119061230095011683&amp;kind=announcement" rel="self" type="application/atom+xml"/>
      <title>Posts of Development Blog</title>
      <updated>2012-10-18T04:10:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://gowithconfidence.tumblr.com/post/31735316104</id>
    <link href="http://gowithconfidence.tumblr.com/post/31735316104" rel="alternate" type="text/html"/>
    <title>no methods on interfaces</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="https://plus.google.com/113906371240881159155/posts/PJshTRD6fBN">original post</a></p>

<p>At one point, in the #golang IRC channel, I had occasion to explain why you cannot define a method on an interface type.</p>

<p>Here is the code whose behavior you can mull over.</p>

<pre><code>package main

type Concrete int

func (c Concrete) Foo() {
    println("concrete foo")
}

func (c Concrete) Bar() {
    println("concrete bar")
}

type Interface1 interface {
    Foo()
}

func (i Interface1) Bar() {
    println("interface bar")
}

type Interface2 interface {
    Foo()
    Bar()
}

func main() {
    var c Concrete
    var i1 Interface1 = c
    var i2 Interface2 = i1
    i2.Foo() // prints "concrete foo"
    i2.Bar() // prints... what?
}
</code></pre>



<p>The core of the matter is that only concrete types are recorded when you put something into any kind of interface. If interface types were recorded as well, then there are a few unfortunate consequences.</p>

<p>First, either you only remember the most recent type the thing had (that is, the last interface it came from) and you’d forget something’s original type, or you have an arbitrarily deep stack of types passed along with the value.</p>

<p>While forgetting the previous types could produce working code, interfaces would no longer be particularly useful.</p>

<p>Keeping the entire stack of types that something has been labeled by also adds a lot of complexity, and it would be very hard indeed to keep track of what methods were available. Can you get something that has the method .Foo() out of this interface{}? Well, maybe, but the number of times you’d have to type assert it would depend on the control path up until that point.</p>

<p>Second, even if you <em>did</em> remember all the interfaces that have labeled your value until this point, there is a good deal of ambiguity. Whose .Foo() method are we to use? I suppose the last label that had such a method, but this is complicated and would be extremely error prone.</p>

<p>This is all made moot by the fact that anything you would be able to do by defining methods on interfaces can already be done using existing go syntax. Taking something that is an interface and giving it extra behavior is straightforward.</p>

<pre><code>type MyInterface interface {
    Foo()
}

type MyWrapper struct {
    MyInterface
}

func (mw MyWrapper) Bar() { ... }
</code></pre>

<p>Here we are in essence recording the type stack ourselves without much effort. If we’ve got a “var x MyInterface”, then “y := MyWrapper{x}” is sufficient to create a new value that will invoke the original concrete type’s .Foo() method and the MyWrapper’s .Bar() method.</p>

<p>The moral of the story is, allowing methods to be defined on interfaces gives no extra power and adds a lot of extra confusion.</p></div>
    </summary>
    <updated>2012-09-17T16:50:00Z</updated>
    <category term="golang"/>
    <source>
      <id>http://gowithconfidence.tumblr.com/</id>
      <link href="http://tumblr.superfeedr.com/" rel="hub" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/" rel="alternate" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/rss" rel="self" type="application/rss+xml"/>
      <subtitle>Thoughts with Go, by John Asmuth</subtitle>
      <title>go with confidence</title>
      <updated>2012-10-18T04:00:51Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:research.swtch.com,2012:research.swtch.com/acme</id>
    <link href="http://research.swtch.com/acme" rel="alternate" type="text/html"/>
    <title>A Tour of Acme</title>
    <summary>A video introduction to Acme, the Plan 9 text editor</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p class="lp">
People I work with recognize my computer easily:
it's the one with nothing but yellow windows and blue bars on the screen.
That's the text editor acme, written by Rob Pike for Plan 9 in the early 1990s.
Acme focuses entirely on the idea of text as user interface.
It's difficult to explain acme without seeing it, though, so I've put together
a screencast explaining the basics of acme and showing a brief programming session.
Remember as you watch the video that the 854x480 screen is quite cramped.
Usually you'd run acme on a larger screen: even my MacBook Air has almost four times
as much screen real estate.
</p>

<center>
<div style="border: 1px solid black; width: 853px; height: 480px;">&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="480" src="http://www.youtube.com/embed/dP1xVpMPn8M?rel=0" width="853"&gt;&lt;/iframe&gt;</div>
</center>

<p class="pp">
The video doesn't show everything acme can do, nor does it show all the ways you can use it.
Even small idioms like where you type text to be loaded or executed vary from user to user.
To learn more about acme, read Rob Pike's paper “<a href="http://research.swtch.com/acme.pdf">Acme: A User Interface for Programmers</a>” and then try it.
</p>

<p class="pp">
Acme runs on most operating systems.
If you use <a href="http://plan9.bell-labs.com/plan9/">Plan 9 from Bell Labs</a>, you already have it.
If you use FreeBSD, Linux, OS X, or most other Unix clones, you can get it as part of <a href="http://swtch.com/plan9port/">Plan 9 from User Space</a>.
If you use Windows, I suggest trying acme as packaged in <a href="http://code.google.com/p/acme-sac/">acme stand alone complex</a>, which is based on the Inferno programming environment.
</p>

<p class="lp"><b>Mini-FAQ</b>:
</p><ul>
<li><i>Q. Can I use scalable fonts?</i> A. On the Mac, yes. If you run <code>acme -f /mnt/font/Monaco/16a/font</code> you get 16-point anti-aliased Monaco as your font, served via <a href="http://swtch.com/plan9port/man/man4/fontsrv.html">fontsrv</a>. If you'd like to add X11 support to fontsrv, I'd be happy to apply the patch.
</li><li><i>Q. Do I need X11 to build on the Mac?</i> A. No. The build will complain that it cannot build ‘snarfer’ but it should complete otherwise. You probably don't need snarfer.
</li></ul>

<p class="pp">
If you're interested in history, the predecessor to acme was called help. Rob Pike's paper “<a href="http://research.swtch.com/help.pdf">A Minimalist Global User Interface</a>” describes it. See also “<a href="http://research.swtch.com/sam.pdf">The Text Editor sam</a>”
</p>

<p class="pp">
<i>Correction</i>: the smiley program in the video was written by Ken Thompson.
I got it from Dennis Ritchie, the more meticulous archivist of the pair.
</p></div>
    </content>
    <updated>2012-09-17T15:00:00Z</updated>
    <published>2012-09-17T15:00:00Z</published>
    <source>
      <id>tag:research.swtch.com,2012:research.swtch.com</id>
      <author>
        <name>Russ Cox</name>
        <email>rsc@swtch.com</email>
        <uri>https://plus.google.com/116810148281701144465</uri>
      </author>
      <link href="http://research.swtch.com/feed.atom" rel="self" type="application/atom+xml"/>
      <title>research!rsc</title>
      <updated>2012-09-17T15:00:00Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-US">
    <id>http://www.snowfrog.net/?p=1696</id>
    <link href="http://www.snowfrog.net/2012/09/14/golang-checking-open-files-and-memory-usage/" rel="alternate" type="text/html"/>
    <title>Golang: checking open files and memory usage</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Notes to myself more than anything, and not really specific to Go (but that’s where I was using it). To watch the memory usage of a process with pid PID: To watch the number of file descriptors being used: <a href="http://www.snowfrog.net/2012/09/14/golang-checking-open-files-and-memory-usage/" rel="bookmark">more...</a></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Notes to myself more than anything, and not really specific to Go (but that’s where I was using it).</p>
<p>To watch the memory usage of a process with pid PID:</p>
<pre class="brush: bash; title: ; notranslate">while [ 1 ] ; do
  grep VmSize  /proc/PID/status ; sleep 10
done
</pre>
<p>To watch the number of file descriptors being used:</p>
<pre class="brush: bash; title: ; notranslate">while [ 1 ] ; do
  sudo lsof -p PID | wc -l ; sleep 10
done
</pre></div>
    </content>
    <updated>2012-09-14T06:18:54Z</updated>
    <category term="Linux"/>
    <category term="Golang"/>
    <author>
      <name>Sonia Hamilton</name>
    </author>
    <source>
      <id>http://www.snowfrog.net</id>
      <link href="http://www.snowfrog.net/tag/golang/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://www.snowfrog.net" rel="alternate" type="text/html"/>
      <subtitle>Linux, Programming, Martial Arts</subtitle>
      <title>Sonia Hamilton » Golang</title>
      <updated>2012-10-18T04:00:29Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://gowithconfidence.tumblr.com/post/31431608488</id>
    <link href="http://gowithconfidence.tumblr.com/post/31431608488" rel="alternate" type="text/html"/>
    <title>just muxing about</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>In much of the programming universe, the preferred method of synchronization between two or more concurrent processes is the mutex. And for good reason: mutexes (mutices?) provide a very simple tool that is easy to understand, and once you acquire that understanding you can use it to build arbitrarily complex concurrent systems.</p>

<p>Eventually.</p>

<p>The problem is that what you want as the programmer is rarely limited to exactly what a mutex gives you. Most of the time you need something a bit more complex, and although the more complex operation can be built out of mutexes, small errors become huge bugs which can be difficult to fix or even just observe (heisenbugs).</p>

<p>In this post I will demonstrate how to build a useful real-world concurrent system, first using mutexes and then using the more advanced tools that go offers.</p>

<h2>the problem</h2>

<p>The system in question is a notification multiplexor. One process, which I’ll call the Listener, will receive notifications from an outside source. Some number of other processes, which I will call the Subscribers, need to collect these notifications.</p>



<h2>a mutex solution</h2>

<pre><code>// for simplicity, our notifications will just be simple strings
type Notification string

// and different subscribers tell us about which ones they want via a filter
type NotificationFilter func(string)bool

// a PollFunc gets all outstanding notifications for its subscriber
type PollFunc func() []Notification

type Notifier struct {
    // we'll embed a mutex in the Notifier, so it can be locked and unlocked
    sync.Mutex
    // queues is the list of outstanding notifications for each subscriber
    queues [][]Notification
    filters []NotificationFilter
}

func NewNotifier() *Notifier {
    return new(Notifier)
}

func (n *Notifier) Subscribe(filter NotificationFilter) (PollFunc) (
    n.Lock()
    defer n.Unlock()
    index := len(n.queues)
    n.queues = append(n.queues, []Notification{})
    n.filters = append(n.filters, filter)

    return func() (results []Notification) {
        n.Lock()
        defer n.Unlock()
        results = n.queues[index]
        n.queues[index] = n.queues[index][:0]
    }
}

func (n *Notifier) Notify(not Notification) {
    n.Lock()
    defer n.Unlock()
    for i, filter := range n.filters {
        if filter(not) {
            n.queues[i] = append(n.queues[i], not)
        }
    }
}
</code></pre>

<p>Seems pretty straight forward, right? It is. This is a simple system, and each of the operations that acquire the mutex are finite time and efficient (assuming that the filter function is too).</p>

<p>There are a few problems, here.</p>

<p>Foremost, and the concurrency sharp-shooters out there will have already noticed this, is that polling the notifier is a busy-wait operation. Even if your program only polls once every 20 seconds, that is still wasted cycles every 20 seconds if no notifications have come in.</p>

<p>And what if before those 20 seconds have elapsed, a whole stack of notifications have queued up? Perhaps a condition variable that unlocks when some condition has been met (like, the number of notifications is not zero). But waiting on a condition variable blocks your entire goroutine.</p>

<p>Go’s channels and the select{} statement provide an elegant response to these questions.</p>

<h2>a channel/select{} solution</h2>

<p>The method to accomplish this goal that I will show here is something often called a mux(), which is short for multiplexor.</p>

<p>To give a little go background, one of the ways that the current go runtime is so effective is that it will multiplex goroutines (Gs) to some set of available processes (Ms, short for machines). A given running go program will have some number of Ms, and some set of Gs that are not currently blocking. That is, the Gs aren’t performing a channel send/receive, aren’t trying to do some kind of I/O (networked or local), aren’t blocked on a semaphore acquire, or for some reason aren’t unable to make progress until something else happens.</p>

<p>When one of the running Gs hits a blocking operation, it is removed from its M and replaced with another G that is ready to go. This kind of CPU time-sharing is usually expressed in terms of coroutines, and that provides the basis for the word goroutine.</p>

<p>We’re going to do something similar with the notification system, except instead of Ms we can have the notifier’s goroutine, and instead of Gs we have the various things that can happen, which for our example are “new notification” and “tell me about a notification”.</p>

<p>Also, in a previous post I discussed <a href="http://gowithconfidence.tumblr.com/post/31426832143/stacked-channels">stacked channels</a>. Moving forward, I’m assuming the reader either knows how they work or does not care.</p>

<pre><code>// the stacked channel joins notification sets by appending the slice
type NotificationChan chan []Notification
func (nch NotificationChan) Stack(ns []Notification) { ... }
func JoinNotifications(ns1, ns2 []Notification) (ns3 []Notification) {
    ns3 = append(ns1, ns2...)
    return
}

type NotificationFilter func(Notification) bool

type newSubscriber struct {
    filter NotificationFilter
    res NotificationChan
}

type Notifier struct {
    // the listener sends new notifications on this channel
    Incoming NotificationChan
    filters []NotificationFilter
    chans []NotificationChan
    newSubscribers chan newSubscriber
}

func NewNotifier() (n *Notifier) {
    n = &amp;Notifier{
        Incoming: make(NotificationChan, 1)
    }
    go n.mux()
}

func (n *Notifier) Subscribe(filter Filter) NotificationChan {
    ns := newSubscriber{
        filter: filter,
        res: make(chan NotificationChan),
    }
    n.newSubscribers &lt;- ns
    return &lt;-ns.res
}

func (n *Notifier) mux() {
    for {
        select {
        case ns := &lt;-n.newSubscribers:
            n.filters = append(n.filters, ns.filter)
            ch := make(NotificationChan, 1)
            n.chans = append(n.chans, ch)
            ns.res &lt;- ch
        case nots := &lt;-n.Incoming:
            for _, not := range nots {
                for i, filter := range n.filters {
                    if filter(not) {
                        n.chans[i].Stack(not)
                    }
                }
            }
        }
    }
}
</code></pre>

<p>With a mux()er like this, instead of a system of polling or condition variables, we get a channel. The mux() goroutine takes care of moving notifications coming from the listener (via n.Incoming) to the subscribers.</p>

<p>Also, since adding subscribers touches a data structure that sending notifications also touches, new subscribers come in on a channel so they can be handled next to the incoming notifications in a single goroutine.</p>

<p>And the greatest benefit is that the subscribers can select on their own notification channels as well channels for communicating with other processes. No special condition magic needs to be performed - select{} gives you everything you need.</p></div>
    </summary>
    <updated>2012-09-13T00:31:00Z</updated>
    <category term="golang"/>
    <source>
      <id>http://gowithconfidence.tumblr.com/</id>
      <link href="http://tumblr.superfeedr.com/" rel="hub" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/" rel="alternate" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/rss" rel="self" type="application/rss+xml"/>
      <subtitle>Thoughts with Go, by John Asmuth</subtitle>
      <title>go with confidence</title>
      <updated>2012-10-18T04:00:51Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://gowithconfidence.tumblr.com/post/31426832143</id>
    <link href="http://gowithconfidence.tumblr.com/post/31426832143" rel="alternate" type="text/html"/>
    <title>stacked channels</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Sometimes a go programmer will wish for an infinitely buffered channel. Go does not offer any such construct, though by creating two channels and a goroutine to move data between them, it is possible to have infinitely buffered channel semantics.</p>

<p>Sometimes what people <em>actually</em> want is a channel that never blocks and never forgets. This isn’t quite the same as a channel with an infinite buffer. I didn’t mention anything about preserving the original message order, for one.</p>

<p>What you can do in the situation I describe is use something I’ve been calling a “stacked” channel. It’s a buffered channel with a special send operation and whose value type has a meaningful “join” function.</p>



<pre><code>type Thing anything

func JoinThings(thing1, thing2 Thing) (thing3 Thing) { ... }

type ThingChan chan Thing

func NewThingChan() ThingChan {
    return make(ThingChan, 1)
}

func (tch ThingChan) Stack(thing1 Thing) {
    for {
        select {
        case tch &lt;- thing1:
            return
        case thing2 := &lt;- tch:
            thing1 = JoinThings(thing1, thing2)
        }
    }
}
</code></pre>

<p>If it’s not immediately clear how stacking works, take a minute to try to figure it out before reading the explanation below.</p>

<p>The stacked channel allows non-blocking sending. That is, whenever a goroutine wants to send to this channel using the .Stack() method, it will complete quickly (provided that the join function completes quickly).</p>

<p>This non-blocking occurs because when the select{} statement is executed, there are two possible states for the channel. Either its buffer is full or its buffer is empty. If the buffer is empty, the new value will be put in immediately. If the buffer is full, the value will be picked off, combing with the new value and put back on.</p>

<p>It is possible that another goroutine stacks something in the meantime, and it will have to pick off another value to join and put back. With a fair scheduler, every goroutine attempting to stack will make progress quickly, relative to the the number of goroutines in contention. This progress comes about because every time a goroutine has to loop back and try again, there must have been another goroutine that succeeded in leaving a value on the channel.</p>

<p>This stacking technique has definite real-project application. I work for a private corporation on a public project called <a href="http://github.com/bketelsen/skynet">skynet</a>. With skynet, client programs need to be notified about new services as they come available. Sometimes these notifications can come faster than a client can ask about them, and they stack up. We use a stacked channel to collect the notifications into bundles without stalling out the notification system.</p>

<p>Here’s a play example: <a href="http://play.golang.org/p/MEp87YesU6">http://play.golang.org/p/MEp87YesU6</a></p></div>
    </summary>
    <updated>2012-09-12T23:24:00Z</updated>
    <category term="golang"/>
    <source>
      <id>http://gowithconfidence.tumblr.com/</id>
      <link href="http://tumblr.superfeedr.com/" rel="hub" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/" rel="alternate" type="text/html"/>
      <link href="http://gowithconfidence.tumblr.com/rss" rel="self" type="application/rss+xml"/>
      <subtitle>Thoughts with Go, by John Asmuth</subtitle>
      <title>go with confidence</title>
      <updated>2012-10-18T04:00:51Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-US">
    <id>http://blog.nella.org/?p=890</id>
    <link href="http://blog.nella.org/?p=890" rel="alternate" type="text/html"/>
    <title>Once upon a time…</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">My son now needs a bedtime story, whispered in the dark, to go to sleep. My wife and I both love good story telling. She even took a course on it once, and told a story to an audience as … <a href="http://blog.nella.org/?p=890">Continue reading <span class="meta-nav">→</span></a></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>My son now needs a bedtime story, whispered in the dark, to go to sleep. My wife and I both love good story telling. She even took a course on it once, and told a story to an audience as the final project. We go to le Nuit des Contes every year here in Lausanne, and I’ve picked up some tips from watching the (literally) professionals there. A key to oral story telling, certainly for small children, is to use a structure with repeating sounds and phrases that they can get wrapped up in.</p>
<p>In order to have these some day to look back at, I’m going to start writing down summaries of stories I tell. If one is good enough to develop and retell, perhaps one day I’ll tell it at the Nuit des contes!</p>
<p>Our 1974 VW Type 2 camper van (“Bep” is his name) would be the star of every story if Elio got to choose. Instead, we offer him a choice of three characters and then go from there. The key, I find, is to start slowly, describing the character, throwing in some fun details right away. This gives you time to race ahead in your mind and choose a rough storyline. The easiest is to choose the end state first, so you know where you are trying to get to. Then, like a dot to dot painting, you need to fill in a few intermediate hops along the way. These are attempts the character makes at achieving the goal, or increasingly dire straights the character finds himself in. These stretch out the story, but more importantly, give it a verse/chorus/verse/chorus/verse structure, which is where the real magic comes from. And the rhythm necessary to put a fidgety 2-year old kid to sleep, as well, which is the point afterall!</p>
<p>What do I mean by verse/chorus? The chorus is the catch-phrase, the repeated element that signals another loop around. It gives the story rhythm and momentum. The verses carry the story forward, so that you get to where you are trying to go and you get that nice satisfying conclusion.</p>
<p>So here are several stories that I’ve told so far:</p>
<ul>
<li>Bep and the Doubting Family: A story from real life, about a little camper that joined a new family and though it had been crossing the passes of Switzerland all its life, the mom and dad were worried it couldn’t do it (a family version of the Little Engine that Could). For each pass: Daddy said, “I don’t know if he can make it”, and Mommy said, “I’m afraid he can’t make it!”, and Elio said, “Go Bep, Go!”, and Bep said, “beep beep, vroom vroom, I know I can make it… I know I can make it… I knew I could make it!”.</li>
<li>Bep and the Big Campers: Big campers at a campground are making fun of Bep (“He’s only got 4 cylinders!”, “No fuel injection!”, “He doesn’t even run on diesel!”, “He’s got no toilet!”, “His exhaust stinks: che sputzza di benzina!”). Bep says he’s as good as other campers, but they demand proof. He names all the passes he’s done, and the bigger campers say, “Wait, they let you do that pass? I’m not allowed on it because I’m too big!”. The Dutch camper says, “My owners drive me all night long on the autoroute here, and go through all the tunnels to save time!”. The big-ass bus starts crying because he’ll never get to see Passo del Lucomagno because he’s too long. Bep makes him feel better by reminding him that he can drive all night from Barcelona and his owners don’t even have to go pee at the gas station. All the campers are friends after that.</li>
<li>Bunny and the Giant Carrot. A little bunny tells her mom that she loves carrots. She loves them so much she wants to grow up and be a farmer and grow carrots. She’ll sell them all around the forest. She’ll sell them by the big rock, and past the oak tree, etc, etc, etc. (This was inspired by Elio’s cousin, who told us this summer of a plan to be a farmer and sell his produce all around Switzerland in order to get out and see the country. Good plan, if you ask me!) She tells her mother the same thing every night, each night adding one more place she’ll sell her carrots, and naming all the others. One night, her mother reminds her that tomorrow is a special day, her birthday. She receives a single carrot seed, but it’s magic. The next morning, she has a regular carrot in her plot. But her mom convinces her to wait another night (and another and another, as many as it takes to make your fidgity 2 year old tired). Then it goes to seed and gives her all the seeds she’ll need to achieve her dream of being a carrot farmer.</li>
<li>Bep and the Apple. On a long trip, the daddy stops the car at a fruit stand. (Based on real life, and my fond memories of driving from San Francisco to Arnold as a child). He buys an apple for everyone (mommy, daddy, Elio and Emma). Each person crunches their apple, except Emma who coos because she knows she’ll get her apple cooked for snacktime later. Bep complains that he didn’t get an apple, and daddy explains to Bep that he can’t eat them, Bep eats gas. But daddy promises to make it up to Bep by getting him an apple anyway. Bep goes su, su, su! the pass, turning left and right and left and right and a moto goes by and goes zoom! (Repeat for as many switchbacks and/or passes as necessary until kidlet is cuddling and knodding off.) Bep is running out of gas and worried that daddy won’t fill him in time. But just when he’s sure he can’t go another kilometer, around the corner comes a giant sign with an apple on top. It’s Apple Gas, where Bep gets his gas, just as daddy promised!</li>
<li>The Lonely King. The king of a country with one citizen (the king himself) is lonely. On the plus side, all his subjects follow his orders, but having more people to play with would be nice. So he tries everything he can think of to get more citizens. He plants flowers on his castle, but the tourists just take pictures. He makes a decree that all the women of the kingdom (i.e. zero) must marry him, but that doesn’t work because there are none and because women don’t like to be told what to do like that anyway. He tries giving away cookies, but he runs out and no one moves in anyway. One day, a nice lady goes out picking mushrooms. She goes up up up the mountain until she finds herself in the kingdom. She asks the king if he’d like to look for mushrooms with her, and they laugh and have fun until sunset. She comes back for more mushrooms, day after day. After two weeks, the are in love. After two months, they are married. After two years, they have a family. And when the king and his queen had a happy family in the kingdom, other people came to join the happy kingdom and the king was no longer lonely (though he was likely exhausted from staying up late into the night telling stories to his kids).</li>
</ul></div>
    </content>
    <updated>2012-09-10T23:04:57Z</updated>
    <category term="Once upon a time"/>
    <author>
      <name>jra</name>
    </author>
    <source>
      <id>http://blog.nella.org</id>
      <link href="http://blog.nella.org/?feed=rss2" rel="self" type="application/atom+xml"/>
      <link href="http://blog.nella.org" rel="alternate" type="text/html"/>
      <title>jra's thoughts</title>
      <updated>2012-10-15T17:00:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://shadynasty.biz/blog/2012/09/05/auth-and-sessions</id>
    <link href="http://shadynasty.biz/blog/2012/09/05/auth-and-sessions/" rel="alternate" type="text/html"/>
    <title>Auth and Sessions</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I think it’s time to bring the guestbook to the next level, and that means users
and sessions. This post will show you how to handle user registration and authentication.
Let’s get started!</p>




<h2>The User Type</h2>

<p>The first thing we’re going to do is create a type to store the information of
the user. So what do users have? Well, an ID to identify them in the database,
a username, and a password. To make this a little more fun, we’re also going to
store the number of times they’ve posted on the guestbook. So here’s our type:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>user.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"code.google.com/p/go.crypto/bcrypt"</span>
</span><span class="line">  <span class="s">"labix.org/v2/mgo/bson"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">type</span> <span class="n">User</span> <span class="k">struct</span> <span class="p">{</span>
</span><span class="line">  <span class="n">ID</span>       <span class="n">bson</span><span class="p">.</span><span class="n">ObjectId</span> <span class="s">`bson:"_id,omitempty"`</span>
</span><span class="line">  <span class="n">Username</span> <span class="nb">string</span>
</span><span class="line">  <span class="n">Password</span> <span class="p">[]</span><span class="nb">byte</span>
</span><span class="line">  <span class="n">Posts</span>    <span class="nb">int</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Now lets define some functions to help hash the password and set it on the user
and and authenticate a user given a username and password.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>user.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="c1">//SetPassword takes a plaintext password and hashes it with bcrypt and sets the</span>
</span><span class="line"><span class="c1">//password field to the hash.</span>
</span><span class="line"><span class="k">func</span> <span class="p">(</span><span class="n">u</span> <span class="p">*</span><span class="n">User</span><span class="p">)</span> <span class="n">SetPassword</span><span class="p">(</span><span class="n">password</span> <span class="nb">string</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="n">hpass</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">bcrypt</span><span class="p">.</span><span class="n">GenerateFromPassword</span><span class="p">([]</span><span class="nb">byte</span><span class="p">(</span><span class="n">password</span><span class="p">),</span> <span class="n">bcrypt</span><span class="p">.</span><span class="n">DefaultCost</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span> <span class="c1">//this is a panic because bcrypt errors on invalid costs</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="n">u</span><span class="p">.</span><span class="n">Password</span> <span class="p">=</span> <span class="n">hpass</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="c1">//Login validates and returns a user object if they exist in the database.</span>
</span><span class="line"><span class="k">func</span> <span class="n">Login</span><span class="p">(</span><span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span> <span class="nb">string</span><span class="p">)</span> <span class="p">(</span><span class="n">u</span> <span class="p">*</span><span class="n">User</span><span class="p">,</span> <span class="n">err</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="n">err</span> <span class="p">=</span> <span class="n">ctx</span><span class="p">.</span><span class="n">C</span><span class="p">(</span><span class="s">"users"</span><span class="p">).</span><span class="n">Find</span><span class="p">(</span><span class="n">bson</span><span class="p">.</span><span class="n">M</span><span class="p">{</span><span class="s">"username"</span><span class="p">:</span> <span class="n">username</span><span class="p">}).</span><span class="n">One</span><span class="p">(&amp;</span><span class="n">u</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">err</span> <span class="p">=</span> <span class="n">bcrypt</span><span class="p">.</span><span class="n">CompareHashAndPassword</span><span class="p">(</span><span class="n">u</span><span class="p">.</span><span class="n">Password</span><span class="p">,</span> <span class="p">[]</span><span class="nb">byte</span><span class="p">(</span><span class="n">password</span><span class="p">))</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">u</span> <span class="p">=</span> <span class="n">nil</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">return</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Now lets work on the handler to log them in.</p>

<h2>First Sign of Trouble</h2>

<p>The login handler should be pretty simple. All we have to do is get the username
and password from the form POSTed to the handler, and pass it to our Login function
which will grab the user from the database and authenticate the credentials.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>handlers.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">func</span> <span class="n">login</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="p">(</span><span class="n">err</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//grab the username and password from the form</span>
</span><span class="line">  <span class="n">username</span><span class="p">,</span> <span class="n">password</span> <span class="p">:=</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"username"</span><span class="p">),</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"password"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//log in the user</span>
</span><span class="line">  <span class="n">user</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">Login</span><span class="p">(</span><span class="n">ctx</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//what to do now? if there was an error we want to present the form again</span>
</span><span class="line">  <span class="c1">//with some error message.</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//where do we store the user if the login was valid?</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//answer: sessions!</span>
</span><span class="line">  <span class="n">_</span> <span class="p">=</span> <span class="n">user</span>
</span><span class="line">  <span class="k">return</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>But we ran into some trouble. When should we display the template for the form?
Where do we store that the authentication was correct? Fortunately it’s not too
hard to fix these problems. Lets handle the displaying of the template part first.</p>

<h2>Two Handlers Are Better Than One</h2>

<p>The login handler is really two actions. When a GET request is passed to the handler
it should display a nice form, but when a POST request is passed to the handler
it should authenticate a user. These different actions based on the verb used
on the URL means we should dispatch to the correct handler in the router rather
than the handler itself. Lets write the simple form displaying template first.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>handlers.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">var</span> <span class="n">login</span> <span class="p">=</span> <span class="n">parseTemplate</span><span class="p">(</span>
</span><span class="line">  <span class="s">"templates/_base.html"</span><span class="p">,</span>
</span><span class="line">  <span class="s">"templates/login.html"</span><span class="p">,</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">loginForm</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="p">(</span><span class="n">err</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="n">err</span> <span class="p">=</span> <span class="n">login</span><span class="p">.</span><span class="n">Execute</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">nil</span><span class="p">)</span>
</span><span class="line">  <span class="k">return</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>The code was getting “smelly” because it wasn’t nice to have global variables storing
the templates, so it wasn’t too hard to whip up a simple function to compile templates
and cache them on the fly. Here’s what that looks like, and the new handler using it:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>template.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
<span class="line-number">24</span>
<span class="line-number">25</span>
<span class="line-number">26</span>
<span class="line-number">27</span>
<span class="line-number">28</span>
<span class="line-number">29</span>
<span class="line-number">30</span>
<span class="line-number">31</span>
<span class="line-number">32</span>
<span class="line-number">33</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"html/template"</span>
</span><span class="line">  <span class="s">"path/filepath"</span>
</span><span class="line">  <span class="s">"sync"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">var</span> <span class="n">cachedTemplates</span> <span class="p">=</span> <span class="k">map</span><span class="p">[</span><span class="nb">string</span><span class="p">]*</span><span class="n">template</span><span class="p">.</span><span class="n">Template</span><span class="p">{}</span>
</span><span class="line"><span class="k">var</span> <span class="n">cachedMutex</span> <span class="n">sync</span><span class="p">.</span><span class="n">Mutex</span>
</span><span class="line">
</span><span class="line"><span class="k">var</span> <span class="n">funcs</span> <span class="p">=</span> <span class="n">template</span><span class="p">.</span><span class="n">FuncMap</span><span class="p">{</span>
</span><span class="line">  <span class="s">"reverse"</span><span class="p">:</span> <span class="n">reverse</span><span class="p">,</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">T</span><span class="p">(</span><span class="n">name</span> <span class="nb">string</span><span class="p">)</span> <span class="p">*</span><span class="n">template</span><span class="p">.</span><span class="n">Template</span> <span class="p">{</span>
</span><span class="line">  <span class="n">cachedMutex</span><span class="p">.</span><span class="n">Lock</span><span class="p">()</span>
</span><span class="line">  <span class="k">defer</span> <span class="n">cachedMutex</span><span class="p">.</span><span class="n">Unlock</span><span class="p">()</span>
</span><span class="line">
</span><span class="line">  <span class="k">if</span> <span class="n">t</span><span class="p">,</span> <span class="n">ok</span> <span class="p">:=</span> <span class="n">cachedTemplates</span><span class="p">[</span><span class="n">name</span><span class="p">];</span> <span class="n">ok</span> <span class="p">{</span>
</span><span class="line">      <span class="k">return</span> <span class="n">t</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">t</span> <span class="p">:=</span> <span class="n">template</span><span class="p">.</span><span class="n">New</span><span class="p">(</span><span class="s">"_base.html"</span><span class="p">).</span><span class="n">Funcs</span><span class="p">(</span><span class="n">funcs</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="n">t</span> <span class="p">=</span> <span class="n">template</span><span class="p">.</span><span class="n">Must</span><span class="p">(</span><span class="n">t</span><span class="p">.</span><span class="n">ParseFiles</span><span class="p">(</span>
</span><span class="line">      <span class="s">"templates/_base.html"</span><span class="p">,</span>
</span><span class="line">      <span class="n">filepath</span><span class="p">.</span><span class="n">Join</span><span class="p">(</span><span class="s">"templates"</span><span class="p">,</span> <span class="n">name</span><span class="p">),</span>
</span><span class="line">  <span class="p">))</span>
</span><span class="line">  <span class="n">cachedTemplates</span><span class="p">[</span><span class="n">name</span><span class="p">]</span> <span class="p">=</span> <span class="n">t</span>
</span><span class="line">
</span><span class="line">  <span class="k">return</span> <span class="n">t</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;




&lt;figure class="code"&gt;&lt;figcaption&gt;<span>handlers.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">func</span> <span class="n">loginForm</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="p">(</span><span class="n">err</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="k">return</span> <span class="n">T</span><span class="p">(</span><span class="s">"login.html"</span><span class="p">).</span><span class="n">Execute</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">nil</span><span class="p">)</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;




&lt;figure class="code"&gt;&lt;figcaption&gt;<span>Login Template </span>&lt;/figcaption&gt;
<div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
</pre></td><td class="code"><pre><code class=""><span class="line">{{ define "title" }}Guestbook - Login{{ end }}
</span><span class="line">
</span><span class="line">{{ define "content" }}
</span><span class="line">    &lt;h1&gt;Login&lt;/h1&gt;
</span><span class="line">    &lt;form action="{{ reverse "login" }}" method="POST"&gt;
</span><span class="line">        &lt;p&gt;Username: &lt;input type="text" name="username"&gt;&lt;/p&gt;
</span><span class="line">        &lt;p&gt;Password: &lt;input type="password" name="password"&gt;&lt;/p&gt;
</span><span class="line">        &lt;p&gt;&lt;button&gt;Login&lt;/button&gt;&lt;/p&gt;
</span><span class="line">    &lt;/form&gt;
</span><span class="line">{{ end }}</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>At this point I had a working login page that would 404 when you clicked Login.
There were some smaller changes made around to clean things up that you can see
in <a href="https://github.com/zeebo/gostbook/commit/50d85a72495ac676db9301df45f84ca1cbf96702">this commit</a> (I have annotated the commit to include
some comments on the changes.) Let’s add the login form handling now.</p>

<h2>Sessions</h2>

<p>A session is just some data attached to some id that you hand the client in a cookie.
This way when a client requests a page, you can look at the cookie value and get the
id for the data and load up the data for that request. Tada! Sessions! For our
implementation of sessions, we’re once again going to use the excellent
<a href="http://gorilla-web.appspot.com/pkg/sessions">gorilla</a> package for sessions. It lets you use different stores
for the backend data, and in this case we’re just going to use a <a href="http://gorilla-web.appspot.com/pkg/sessions#CookieStore">cookie store</a>.
This stores all the data in the cookie the client sends to you. This does mean
that the user can tamper with the cookie, but the data is verified using a secret
value and a hash, and can optionally be encrypted with another secret value. For this
I’m just going to use a store that doesn’t encrypt the data: after all, the data
the store uses is open source.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"code.google.com/p/gorilla/sessions"</span>
</span><span class="line">  <span class="c1">//...</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">var</span> <span class="n">store</span> <span class="n">sessions</span><span class="p">.</span><span class="n">Store</span>
</span><span class="line"><span class="c1">//...</span>
</span><span class="line">
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//...</span>
</span><span class="line">  <span class="n">store</span> <span class="p">=</span> <span class="n">sessions</span><span class="p">.</span><span class="n">NewCookieStore</span><span class="p">([]</span><span class="nb">byte</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">Getenv</span><span class="p">(</span><span class="s">"KEY"</span><span class="p">)))</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>So we defined a cookie store, now let’s add grabbing the session to the context.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>context.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">type</span> <span class="n">Context</span> <span class="k">struct</span> <span class="p">{</span>
</span><span class="line">  <span class="n">Database</span> <span class="p">*</span><span class="n">mgo</span><span class="p">.</span><span class="n">Database</span>
</span><span class="line">  <span class="n">Session</span>  <span class="p">*</span><span class="n">sessions</span><span class="p">.</span><span class="n">Session</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">NewContext</span><span class="p">(</span><span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">(*</span><span class="n">Context</span><span class="p">,</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="n">sess</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">store</span><span class="p">.</span><span class="n">Get</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="s">"gostbook"</span><span class="p">)</span>
</span><span class="line">  <span class="k">return</span> <span class="p">&amp;</span><span class="n">Context</span><span class="p">{</span>
</span><span class="line">      <span class="n">Database</span><span class="p">:</span> <span class="n">session</span><span class="p">.</span><span class="n">Clone</span><span class="p">().</span><span class="n">DB</span><span class="p">(</span><span class="n">database</span><span class="p">),</span>
</span><span class="line">      <span class="n">Session</span><span class="p">:</span>  <span class="n">sess</span><span class="p">,</span>
</span><span class="line">  <span class="p">},</span> <span class="n">err</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>The last thing we need to do is make sure the handlers save the session when they’re
done with it. Unfortunately this causes a problem. Saving the session requires
modifying the headers of the response, and if the handler has already started
outputting data, the headers have already been sent and that ship has sailed.
Theres two approaches to solving this problem. The first is to just make sure
in each handler to save the session before writing anything to the <code>ResponseWriter</code>,
which can be a little verbose and error prone but provides the best performance.
The second is to use the fact that a <code>ResponseWriter</code> is an interface and use our
handler type to substitute in a buffered <code>ResponseWriter</code> that stores all the data
and header information written to it, so that it can be output at the end all at once.
I wrote a package to help with the second option so it’s clearly the one I prefer.
Here’s how we can hook that up:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>http.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
<span class="line-number">24</span>
<span class="line-number">25</span>
<span class="line-number">26</span>
<span class="line-number">27</span>
<span class="line-number">28</span>
<span class="line-number">29</span>
<span class="line-number">30</span>
<span class="line-number">31</span>
<span class="line-number">32</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"net/http"</span>
</span><span class="line">  <span class="s">"thegoods.biz/httpbuf"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">type</span> <span class="n">handler</span> <span class="k">func</span><span class="p">(</span><span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="n">error</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="p">(</span><span class="n">h</span> <span class="n">handler</span><span class="p">)</span> <span class="n">ServeHTTP</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//create the context</span>
</span><span class="line">  <span class="n">ctx</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">NewContext</span><span class="p">(</span><span class="n">req</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">defer</span> <span class="n">ctx</span><span class="p">.</span><span class="n">Close</span><span class="p">()</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//run the handler and grab the error, and report it</span>
</span><span class="line">  <span class="n">buf</span> <span class="p">:=</span> <span class="nb">new</span><span class="p">(</span><span class="n">httpbuf</span><span class="p">.</span><span class="n">Buffer</span><span class="p">)</span>
</span><span class="line">  <span class="n">err</span> <span class="p">=</span> <span class="n">h</span><span class="p">(</span><span class="n">buf</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">ctx</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//save the session</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">=</span> <span class="n">ctx</span><span class="p">.</span><span class="n">Session</span><span class="p">.</span><span class="n">Save</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="n">buf</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//apply the buffered response to the writer</span>
</span><span class="line">  <span class="n">buf</span><span class="p">.</span><span class="n">Apply</span><span class="p">(</span><span class="n">w</span><span class="p">)</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>All we do is create an <code>httpbuf.Buffer</code> and use that as our handler, finishing
with a call to its Apply method. With that, we can set and grab session values
in the handlers by just interacting with <code>ctx.Session</code>, and everthing will be
saved when <a href="https://github.com/zeebo/gostbook/commit/85b30a6efb917ab8567d3d277d5373b3e12a7f67">we’re done</a>.</p>

<h2>Back to Authentication</h2>

<p>Now that we have sessions, we know where we can store the user. Lets write the
login handler for the user then.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>handlers.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">func</span> <span class="n">login</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="n">error</span> <span class="p">{</span>
</span><span class="line">  <span class="n">username</span><span class="p">,</span> <span class="n">password</span> <span class="p">:=</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"username"</span><span class="p">),</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"password"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="n">user</span><span class="p">,</span> <span class="n">e</span> <span class="p">:=</span> <span class="n">Login</span><span class="p">(</span><span class="n">ctx</span><span class="p">,</span> <span class="n">username</span><span class="p">,</span> <span class="n">password</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">e</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">ctx</span><span class="p">.</span><span class="n">Session</span><span class="p">.</span><span class="n">AddFlash</span><span class="p">(</span><span class="s">"Invalid Username/Password"</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span> <span class="n">loginForm</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">ctx</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//store the user id in the values and redirect to index</span>
</span><span class="line">  <span class="n">ctx</span><span class="p">.</span><span class="n">Session</span><span class="p">.</span><span class="n">Values</span><span class="p">[</span><span class="s">"user"</span><span class="p">]</span> <span class="p">=</span> <span class="n">user</span><span class="p">.</span><span class="n">ID</span>
</span><span class="line">  <span class="n">http</span><span class="p">.</span><span class="n">Redirect</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">reverse</span><span class="p">(</span><span class="s">"index"</span><span class="p">),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusSeeOther</span><span class="p">)</span>
</span><span class="line">  <span class="k">return</span> <span class="n">nil</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;




&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"encoding/gob"</span>
</span><span class="line">  <span class="s">"labix.org/v2/mgo/bson"</span>
</span><span class="line">  <span class="c1">//...</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">init</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="n">gob</span><span class="p">.</span><span class="n">Register</span><span class="p">(</span><span class="n">bson</span><span class="p">.</span><span class="n">ObjectId</span><span class="p">(</span><span class="s">""</span><span class="p">))</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//...</span>
</span><span class="line">  <span class="n">router</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">"POST"</span><span class="p">,</span> <span class="s">"/login"</span><span class="p">,</span> <span class="n">handler</span><span class="p">(</span><span class="n">login</span><span class="p">))</span>
</span><span class="line">  <span class="c1">//...</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Note that we have to register the <code>bson.ObjectId</code> type with the <a href="http://golang.org/pkg/encoding/gob">gob package</a>
because the cookie store uses gob to store the data for the session.</p>

<p>Well, now we log in people and store it in the session, but it’d be nice if that
was reflected somehow in the user interface and if the context included information
about the logged in user. Lets do some work on the context and handlers to fix this.
First, we’re going to add a <code>*User</code> to the context that gets filled in based on the
id we stored in the session.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>context.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">type</span> <span class="n">Context</span> <span class="k">struct</span> <span class="p">{</span>
</span><span class="line">  <span class="n">Database</span> <span class="p">*</span><span class="n">mgo</span><span class="p">.</span><span class="n">Database</span>
</span><span class="line">  <span class="n">Session</span>  <span class="p">*</span><span class="n">sessions</span><span class="p">.</span><span class="n">Session</span>
</span><span class="line">  <span class="n">User</span>     <span class="p">*</span><span class="n">User</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">NewContext</span><span class="p">(</span><span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">(*</span><span class="n">Context</span><span class="p">,</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="n">sess</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">store</span><span class="p">.</span><span class="n">Get</span><span class="p">(</span><span class="n">req</span><span class="p">,</span> <span class="s">"gostbook"</span><span class="p">)</span>
</span><span class="line">  <span class="n">ctx</span> <span class="p">:=</span> <span class="p">&amp;</span><span class="n">Context</span><span class="p">{</span>
</span><span class="line">      <span class="n">Database</span><span class="p">:</span> <span class="n">session</span><span class="p">.</span><span class="n">Clone</span><span class="p">().</span><span class="n">DB</span><span class="p">(</span><span class="n">database</span><span class="p">),</span>
</span><span class="line">      <span class="n">Session</span><span class="p">:</span>  <span class="n">sess</span><span class="p">,</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="k">return</span> <span class="n">ctx</span><span class="p">,</span> <span class="n">err</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//try to fill in the user from the session</span>
</span><span class="line">  <span class="k">if</span> <span class="n">uid</span><span class="p">,</span> <span class="n">ok</span> <span class="p">:=</span> <span class="n">sess</span><span class="p">.</span><span class="n">Values</span><span class="p">[</span><span class="s">"user"</span><span class="p">].(</span><span class="n">bson</span><span class="p">.</span><span class="n">ObjectId</span><span class="p">);</span> <span class="n">ok</span> <span class="p">{</span>
</span><span class="line">      <span class="n">err</span> <span class="p">=</span> <span class="n">ctx</span><span class="p">.</span><span class="n">C</span><span class="p">(</span><span class="s">"users"</span><span class="p">).</span><span class="n">Find</span><span class="p">(</span><span class="n">bson</span><span class="p">.</span><span class="n">M</span><span class="p">{</span><span class="s">"_id"</span><span class="p">:</span> <span class="n">uid</span><span class="p">}).</span><span class="n">One</span><span class="p">(&amp;</span><span class="n">ctx</span><span class="p">.</span><span class="n">User</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="k">return</span> <span class="n">ctx</span><span class="p">,</span> <span class="n">err</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Now we just have to add the context to the value we pass in to templates to be
executed and hook up the templates. <a href="https://github.com/zeebo/gostbook/commit/7c2ff89f944d78cb51033c3ac5eeedd4ab552126">This commit</a> shows the
details of that, including adding a logout handler, and fixing some minor issues
with the code.</p>

<h2>Post Count and Creating Users</h2>

<p>The last two features we need are letting people register and increasing a persons
post count when they post. Let’s work on registration first. Registration works
just like logging in, so we need to create a template and two handlers.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>handlers.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
<span class="line-number">24</span>
<span class="line-number">25</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">func</span> <span class="n">registerForm</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="p">(</span><span class="n">err</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="k">return</span> <span class="n">T</span><span class="p">(</span><span class="s">"register.html"</span><span class="p">).</span><span class="n">Execute</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="k">map</span><span class="p">[</span><span class="nb">string</span><span class="p">]</span><span class="k">interface</span><span class="p">{}{</span>
</span><span class="line">      <span class="s">"ctx"</span><span class="p">:</span> <span class="n">ctx</span><span class="p">,</span>
</span><span class="line">  <span class="p">})</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">register</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="n">error</span> <span class="p">{</span>
</span><span class="line">  <span class="n">username</span><span class="p">,</span> <span class="n">password</span> <span class="p">:=</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"username"</span><span class="p">),</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"password"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="n">u</span> <span class="p">:=</span> <span class="p">&amp;</span><span class="n">User</span><span class="p">{</span>
</span><span class="line">      <span class="n">Username</span><span class="p">:</span> <span class="n">username</span><span class="p">,</span>
</span><span class="line">      <span class="n">ID</span><span class="p">:</span>       <span class="n">bson</span><span class="p">.</span><span class="n">NewObjectId</span><span class="p">(),</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="n">u</span><span class="p">.</span><span class="n">SetPassword</span><span class="p">(</span><span class="n">password</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">ctx</span><span class="p">.</span><span class="n">C</span><span class="p">(</span><span class="s">"users"</span><span class="p">).</span><span class="n">Insert</span><span class="p">(</span><span class="n">u</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">ctx</span><span class="p">.</span><span class="n">Session</span><span class="p">.</span><span class="n">AddFlash</span><span class="p">(</span><span class="s">"Problem registering user."</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span> <span class="n">registerForm</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">ctx</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//store the user id in the values and redirect to index</span>
</span><span class="line">  <span class="n">ctx</span><span class="p">.</span><span class="n">Session</span><span class="p">.</span><span class="n">Values</span><span class="p">[</span><span class="s">"user"</span><span class="p">]</span> <span class="p">=</span> <span class="n">u</span><span class="p">.</span><span class="n">ID</span>
</span><span class="line">  <span class="n">http</span><span class="p">.</span><span class="n">Redirect</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">reverse</span><span class="p">(</span><span class="s">"index"</span><span class="p">),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusSeeOther</span><span class="p">)</span>
</span><span class="line">  <span class="k">return</span> <span class="n">nil</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>The <code>register.html</code> template is very similar to the login template. If you really
wan’t to see it, you can find it at <a href="https://github.com/zeebo/gostbook/commit/46bf28e9f862d083e6a40d813ff3f271bf96a5f1">this commit</a>. Incrementing
the post count is super simple. In the <code>sign</code> handler, we just add</p>

<pre><code>ctx.C("users").Update(bson.M{"_id": ctx.User.ID}, bson.M{
    "$inc": bson.M{"posts": 1},
})
</code></pre>

<h2>Phew!</h2>

<p>So after all that we have a login/user registration system, and a session tied
to a context for storing whatever data we want. Hopefully with this guide you can
extend it to meet the needs of whatever webapp you’re writing. Thanks for reading
so far, and be sure to <a href="http://tranquil-refuge-9104.herokuapp.com">register and leave a comment</a> on the gostbook or
right below if you liked it.</p></div>
    </content>
    <updated>2012-09-05T20:10:00Z</updated>
    <source>
      <id>http://shadynasty.biz/</id>
      <author>
        <name>Jeff Wendling</name>
      </author>
      <link href="http://shadynasty.biz/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://shadynasty.biz/" rel="alternate" type="text/html"/>
      <title>Shadynasty Business</title>
      <updated>2012-09-06T11:21:44Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-4104201847964759407</id>
    <link href="http://reneefrench.blogspot.com/feeds/4104201847964759407/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=4104201847964759407" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4104201847964759407" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4104201847964759407" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/08/blog-post_30.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-yjSatq-rjI8/UEAWEGzL2qI/AAAAAAAAFHQ/Am7D036wtuE/s1600/fragsprooms.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-yjSatq-rjI8/UEAWEGzL2qI/AAAAAAAAFHQ/Am7D036wtuE/s320/fragsprooms.jpg" width="281"/></a></div> <div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-4104201847964759407?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-31T01:40:37Z</updated>
    <published>2012-08-31T01:38:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-2673490712248854922.post-8298933700039142639</id>
    <link href="http://hackgolang.blogspot.com/feeds/8298933700039142639/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://hackgolang.blogspot.com/2012/08/golang-project-update-edigo.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/2673490712248854922/posts/default/8298933700039142639" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/2673490712248854922/posts/default/8298933700039142639" rel="self" type="application/atom+xml"/>
    <link href="http://hackgolang.blogspot.com/2012/08/golang-project-update-edigo.html" rel="alternate" type="text/html"/>
    <title>Golang project update: edigo</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">After some reflection, what I want to have is in fact to be able to auto-generate a Go package or packages, which can be imported into any Go code later, given an XML EDIFACT grammar file that is generated by some tool, such as (my current employer) <a href="http://www.amadeus.com/">Amadeus</a>' Visual Services tool.<br/><div><br/></div><div>The format of this XML EDIFACT grammar file is</div><div><br/></div><pre class="brush: xml">&lt;root&gt;<br/>    &lt;source&gt;Visual Services 5 - XML Generator<br/>    &lt;version&gt;1&lt;/version&gt;<br/>    &lt;interface description="Yada yada blah." name="SKD" release="9" version="02"&gt;<br/>    &lt;transactions&gt;...list of transactions...&lt;/transactions&gt;<br/>    &lt;messages&gt;...list of messages...&lt;/messages&gt;<br/>    &lt;groups&gt;...list of groups...&lt;/groups&gt;<br/>    &lt;segments&gt;...list of segments...&lt;/segments&gt;<br/>    &lt;composites&gt;...list of composites...&lt;/composites&gt;<br/>    &lt;/interface&gt;<br/>&lt;/source&gt;&lt;/root&gt;<br/></pre>The resulting package codes could then be stored in a folder named after the interface name (in the above example "skd") as composites.go, segments.go, groups.go, etc. Every time there's a new version of the grammar XML file, edigo must be used to regenerate the said files.<br/><br/>That's all for now. I will write more on this later.  Oh, and by the way, I've created a <a href="https://github.com/axx/edigo">new repository on GitHub</a> for this.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/2673490712248854922-8298933700039142639?l=hackgolang.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-29T15:01:12Z</updated>
    <published>2012-08-29T14:36:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="edigo"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="go programming"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="edifact"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="update"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="project"/>
    <author>
      <name>Allister</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-2673490712248854922</id>
      <category term="linux"/>
      <category term="google go"/>
      <category term="message"/>
      <category term="computing problem"/>
      <category term="edigo"/>
      <category term="hacking with go"/>
      <category term="golang programming"/>
      <category term="hacking with golang"/>
      <category term="snail"/>
      <category term="syntax highlighting"/>
      <category term="ubuntu"/>
      <category term="parser"/>
      <category term="project"/>
      <category term="syntaxhighlighter"/>
      <category term="golang installation"/>
      <category term="golang"/>
      <category term="update"/>
      <category term="edifact"/>
      <category term="go programming"/>
      <author>
        <name>Allister</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://hackgolang.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/2673490712248854922/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://hackgolang.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">This blog is dedicated to learning the <a href="http://golang.org">Go programming language (golang)</a>. Most likely there'll be golang tutorials, discussions on golang idioms and golang programming techniques. We will also follow the development of golang as it matures.<br/>
Written by <a href="http://allistersanchez.com">Allister Sanchez</a>.</div>
      </subtitle>
      <title>Hacking with the Go Programming Language (GoLang)</title>
      <updated>2012-09-10T07:32:55Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-2673490712248854922.post-9147629231013893840</id>
    <link href="http://hackgolang.blogspot.com/feeds/9147629231013893840/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://hackgolang.blogspot.com/2012/08/golang-project-idea-go-edifact.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/2673490712248854922/posts/default/9147629231013893840" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/2673490712248854922/posts/default/9147629231013893840" rel="self" type="application/atom+xml"/>
    <link href="http://hackgolang.blogspot.com/2012/08/golang-project-idea-go-edifact.html" rel="alternate" type="text/html"/>
    <title>Golang Project Idea: Go EDIFACT</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">It's been sometime since I've written anything on this blog.  A few weeks back I realized that my <a href="http://hackgolang.blogspot.fr/2010/05/syntax-highlighting-for-golang.html">syntax highlighting brush</a> for golang wasn't available online anymore and so I decided to <a href="https://raw.github.com/axx/GolangHighlighter/master/shBrushGo.js">put it on Github</a>.  <br/><br/>Anyway, I've been thinking about what I could do to improve my understanding of the Go programming language.  Earlier today it dawned on me that since I've been working a lot with <a href="http://en.wikipedia.org/wiki/EDIFACT">EDIFACT</a> messages, why not a Go package for handling EDIFACT messages?<br/><br/>So, what do I want to make? I haven't really seen an EDIFACT grammar parser that takes an XML file that defines the grammar and converts a valid EDIFACT message into a Go data structure. Conversely, it should allow the user to fill the Go data structure and generates the corresponding EDIFACT message from it.<br/><br/>Okay, it's time to hack.  I'll post updates on this project later.  Cheers!<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/2673490712248854922-9147629231013893840?l=hackgolang.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-28T13:19:42Z</updated>
    <published>2012-08-28T13:18:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="parser"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="go programming"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="edifact"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="project"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="message"/>
    <author>
      <name>Allister</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-2673490712248854922</id>
      <category term="linux"/>
      <category term="google go"/>
      <category term="message"/>
      <category term="computing problem"/>
      <category term="edigo"/>
      <category term="hacking with go"/>
      <category term="golang programming"/>
      <category term="hacking with golang"/>
      <category term="snail"/>
      <category term="syntax highlighting"/>
      <category term="ubuntu"/>
      <category term="parser"/>
      <category term="project"/>
      <category term="syntaxhighlighter"/>
      <category term="golang installation"/>
      <category term="golang"/>
      <category term="update"/>
      <category term="edifact"/>
      <category term="go programming"/>
      <author>
        <name>Allister</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://hackgolang.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/2673490712248854922/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://hackgolang.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">This blog is dedicated to learning the <a href="http://golang.org">Go programming language (golang)</a>. Most likely there'll be golang tutorials, discussions on golang idioms and golang programming techniques. We will also follow the development of golang as it matures.<br/>
Written by <a href="http://allistersanchez.com">Allister Sanchez</a>.</div>
      </subtitle>
      <title>Hacking with the Go Programming Language (GoLang)</title>
      <updated>2012-09-10T07:32:55Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-7263348661368304576</id>
    <link href="http://reneefrench.blogspot.com/feeds/7263348661368304576/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=7263348661368304576" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7263348661368304576" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7263348661368304576" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/08/blog-post_27.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-altRivFAO2A/UDxbpOAjoMI/AAAAAAAAFGw/a7HebXZskHY/s1600/teacher14.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-altRivFAO2A/UDxbpOAjoMI/AAAAAAAAFGw/a7HebXZskHY/s320/teacher14.jpg" width="286"/></a></div> <div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-7263348661368304576?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-28T05:48:25Z</updated>
    <published>2012-08-28T05:48:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-4432469177709573208</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/4432469177709573208" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/4432469177709573208" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2012/08/go-updates-in-app-engine-171.html" rel="alternate" type="text/html"/>
    <title>Go updates in App Engine 1.7.1</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>This week we released version 1.7.1 of the App Engine SDK. It includes some significant updates specific to the App Engine runtime for Go.</p><p/><p>The <a href="https://developers.google.com/appengine/docs/go/memcache/reference">memcache package</a> has had some additions to its <a href="https://developers.google.com/appengine/docs/go/memcache/reference#Codec">Codec</a> convenience type. The SetMulti, AddMulti, CompareAndSwap, and CompareAndSwapMulti methods make it easier to store and update encoded data in the <a href="https://developers.google.com/appengine/docs/go/memcache/overview">Memcache Service</a>.</p><p/><p>The <a href="https://developers.google.com/appengine/docs/go/tools/uploadingdata">bulkloader tool</a> can now be used with Go apps, allowing users to upload and download datastore records in bulk. This is useful for backups and offline processing, and a great help when migrating Python or Java apps to the Go runtime.</p><p/><p>The <a href="https://developers.google.com/appengine/docs/go/images/overview">Images Service</a> is now available to Go users. The new <a href="https://developers.google.com/appengine/docs/go/images/reference">appengine/image package</a> supports serving images directly from Blobstore and resizing or cropping those images on the fly. Note that this is not the full image service as provided by the Python and Java SDKs, as much of the equivalent functionality is available in the <a href="http://golang.org/pkg/image/">standard Go image package</a> and external packages such as <a href="http://code.google.com/p/graphics-go/">graphics-go</a>.</p><p/><p>The new <a href="https://developers.google.com/appengine/docs/go/backends/runtime#RunInBackground">runtime.RunInBackground</a> function allows backend requests to spawn a new request independent of the initial request. These can run in the background as long as the backend stays alive.</p><p/><p>Finally, we have filled in some missing functionality: the <a href="https://developers.google.com/appengine/docs/go/xmpp/reference">xmpp package</a> now supports sending presence updates and chat invitations and retrieving the presence state of another user, and the <a href="https://developers.google.com/appengine/docs/go/users/reference">user package</a> supports authenticating clients with OAuth.</p><p/><p>You can grab the new SDK from the <a href="https://developers.google.com/appengine/downloads#Google_App_Engine_SDK_for_Go">App Engine downloads page</a> and browse the <a href="https://developers.google.com/appengine/docs/go">updated documentation</a>.</p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-4432469177709573208?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-08-23T22:44:04Z</updated>
    <published>2012-08-23T01:41:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="release"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="appengine"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry xml:lang="ja">
    <id>http://golang.jp/?p=3759</id>
    <link href="http://golang.jp/2012/08/3759" rel="alternate" type="text/html"/>
    <title>翻訳更新のお知らせ</title>
    <summary>公式サイトの更新を反映しました。 Go言語のインストール FAQ</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>公式サイトの更新を反映しました。</p>
<ul>
<li><a href="http://golang.jp/install">Go言語のインストール</a></li>
<li><a href="http://golang.jp/go_faq">FAQ</a></li>
</ul></div>
    </content>
    <updated>2012-08-23T07:39:03Z</updated>
    <category term="&#x30C9;&#x30AD;&#x30E5;&#x30E1;&#x30F3;&#x30C8;"/>
    <author>
      <name>noboru</name>
    </author>
    <source>
      <id>http://golang.jp</id>
      <link href="http://golang.jp/feed" rel="self" type="application/atom+xml"/>
      <link href="http://golang.jp" rel="alternate" type="text/html"/>
      <subtitle>プログラミング言語Goの情報サイト</subtitle>
      <title>golang.jp</title>
      <updated>2012-08-23T08:00:21Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-1182010163494438919</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/1182010163494438919" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/1182010163494438919" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2012/08/organizing-go-code.html" rel="alternate" type="text/html"/>
    <title>Organizing Go code</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Go code is organized differently to that of other languages. This post discusses how to name and package the elements of your Go program to best serve its users.<br/><br/><b>Choose good names</b><br/><br/>The names you choose affect how you think about your code, so take care when naming your package and its exported identifiers.<br/><br/>A package's name provides context for its contents. For instance, the <a href="http://golang.org/pkg/bytes/">bytes package</a> from the standard library exports the <code>Buffer</code> type. On its own, the name <code>Buffer</code> isn't very descriptive, but when combined with its package name its meaning becomes clear: <code>bytes.Buffer</code>. If the package had a less descriptive name, like <code>util</code>, the buffer would likely acquire the longer and clumsier name <code>util.BytesBuffer</code>. <br/><br/>Don't be shy about renaming things as you work. As you spend time with your program you will better understand how its pieces fit together and, therefore, what their names should be. There's no need to lock yourself into early decisions. (The <a href="http://golang.org/cmd/gofmt/">gofmt command</a> has a <code>-r</code> flag that provides a syntax-aware search and replace, making large-scale refactoring easier.)<br/><br/>A good name is the most important part of a software interface: the name is the first thing every client of the code will see. A well-chosen name is therefore the starting point for good documentation. Many of the following practices result organically from good naming. <br/><br/><b>Choose a good import path (make your package "go get"-able)</b><br/><br/>An import path is the string with which users import a package. It specifies the directory (relative to <code>$GOROOT/src/pkg</code> or <code>$GOPATH/src</code>) in which the package's source code resides.<br/><br/>Import paths should be globally unique, so use the path of your source repository as its base. For instance, the <code>websocket</code> package from the <code>go.net</code> sub-repository has an import path of <code>"code.google.com/p/go.net/websocket"</code>. The Go project owns the path <code>"code.google.com/p/go"</code>, so that path cannot be used by another author for a different package. Because the repository URL and import path are one and the same, the <code>go get</code> command can fetch and install the package automatically.<br/><br/>If you don't use a hosted source repository, choose some unique prefix such as a domain, company, or project name. As an example, the import path of all Google's internal Go code starts with the string <code>"google"</code>.<br/><br/>The last element of the import path is typically the same as the package name. For instance, the import path <code>"net/http"</code> contains package <code>http</code>. This is not a requirement - you can make them different if you like - but you should follow the convention for predictability's sake: a user might be surprised that import <code>"foo/bar"</code> introduces the identifier <code>quux</code> into the package name space.<br/><br/>Sometimes people set <code>GOPATH</code> to the root of their source repository and put their packages in directories relative to the repository root, such as <code>"src/my/package"</code>. On one hand, this keeps the import paths short (<code>"my/package"</code> instead of <code>"github.com/me/project/my/package"</code>), but on the other it breaks <code>go get</code> and forces users to re-set their <code>GOPATH</code> to use the package. Don't do this.<br/><br/><b>Minimize the exported interface</b><br/><br/>Your code is likely composed of many small pieces of useful code, and so it is tempting to expose much of that functionality in your package's exported interface. Resist that urge!<br/><br/>The larger the interface you provide, the more you must support. Users will quickly come to depend on every type, function, variable, and constant you export, creating an implicit contract that you must honor in perpetuity or risk breaking your users' programs. In preparing Go 1 we carefully reviewed the standard library's exported interfaces and removed the parts we weren't ready to commit to. You should take similar care when distributing your own libraries.<br/><br/>If in doubt, leave it out!<br/><br/><b>What to put into a package</b><br/><br/>It is easy to just throw everything into a "grab bag" package, but this dilutes the meaning of the package name (as it must encompass a lot of functionality) and forces the users of small parts of the package to compile and link a lot of unrelated code.<br/><br/>On the other hand, it is also easy to go overboard in splitting your code into small packages, in which case you will likely becomes bogged down in interface design, rather than just getting the job done.<br/><br/>Look to the Go standard libraries as a guide. Some of its packages are large and some are small. For instance, the <a href="http://golang.org/pkg/net/http/">http package</a> comprises 17 go source files (excluding tests) and exports 109 identifiers, and the <a href="http://golang.org/pkg/hash/">hash package</a> consists of one file that exports just three declarations. There is no hard and fast rule; both approaches are appropriate given their context.<br/><br/>With that said, package main is often larger than other packages. Complex commands contain a lot of code that is of little use outside the context of the executable, and often it's simpler to just keep it all in the one place. Godoc is nearly 6000 lines over <a href="http://golang.org/src/cmd/godoc/">16 files</a>, and the go tool is more than 7000 lines spread across <a href="http://golang.org/src/cmd/go/">23 files</a>.<br/><br/><b>Document your code</b><br/><br/>Good documentation is an essential quality of usable and maintainable code. Read the <a href="http://golang.org/doc/articles/godoc_documenting_go_code.html">Godoc: documenting Go code</a> article to learn how to write good doc comments.<br/><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-1182010163494438919?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-08-23T01:42:19Z</updated>
    <published>2012-08-16T16:00:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="gopath"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="interface"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="libraries"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="godoc"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://shadynasty.biz/blog/2012/08/18/template-usage-and-internals</id>
    <link href="http://shadynasty.biz/blog/2012/08/18/template-usage-and-internals/" rel="alternate" type="text/html"/>
    <title>Template Usage and Internals</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I’ve seen many tutorials on the internet about how to use templates in Go. They
typically concentrate on the syntax of the template and don’t go in to the details
of how they’re constructed and used in Go code. That’s why this article is about
what a template really is, and how to use them in your code.</p>




<h2>A little history</h2>

<p>Back before Go 1, the <a href="http://golang.org/pkg/text/template">text/template</a> package was different.
The real major difference was the package defined two major types: a template
and a template set. At some point the library authors decided to merge them into
one, the <a href="http://golang.org/pkg/text/template/#Template">Template</a> type.</p>

<h2>So what is a template?</h2>

<p>I like to think of a template as a collection of templates, with one promoted
as the “default” template. The default template is the one that gets used when
the execute method is called. Internally, a template contains a map of all the
other templates it is linked with, and each one of those templates contains
the same map. This makes the namespace of a template flat. It sounds really
confusing, so hopefully we can make it easier with some examples and implications.</p>

<h2>Implications</h2>

<p>So given that a template is really a set of templates with a mapping of all the
template names in the set to the templates (phew), what can we expect in how
we work with it?</p>

<ul>
<li><p><strong>Every template in the set can be called by any other.</strong> Because every template
shares the same map of name to templates, any template can call any other templates.
This is a pretty simple.</p></li>
<li><p><strong>You can’t have two templates with the same name.</strong> This is also pretty obvious
but bears stating. Because the namespace is flat, two template with the same name
would cause a collision. The package doesn’t allow you to add a template to a set
under a name that already exists.</p></li>
<li><p><strong>Theres no such thing as a subtemplate.</strong> Because the namespace is flat, you can’t
really have one template be a subtemplate of another. Because every template is accessible
from every other template, the concept of one template owning another isn’t really
defined. This isn’t to say you can’t use templates like subtemplates, its just that
theres no mechanism enforcing this in the package.</p></li>
<li><p><strong>Lookup is idempotent.</strong> This means that calling <code>t.Lookup("name").Lookup("name")</code>
is the same as <code>t.Lookup("name")</code>, as long as <code>"name"</code> exists in the template. This
is because every template shares the same map of template name to template. When we
lookup a specific one, it still has the same map to lookup the next one. This is
a handy property because it makes it always safe to call Lookup regardless of the
current state of the template.</p></li>
</ul>


<h2>Gotchas</h2>

<p>Here’s some common problems with the template package that people run into:</p>

<ul>
<li><p><strong>ParseFiles and its friends add the template under the name of the file.</strong> This means
if you do <code>template.New("base").ParseFiles("foo.html")</code> and try to execute it, you will
have an empty template. The template was read and parsed from “foo.html” and added to the
template under that name. This means you have to either do a <code>.Lookup("foo.html")</code> or
change the name in New to “foo.html”.</p></li>
<li><p><strong>Not just the name of the file, the basename of the file.</strong> This means if you
try to do <code>.ParseFiles("a/main.html", "b/main.html")</code> you’ll run into problems
because the two files share the same basename. It returns an error saying that
you can’t redefine the template named “main.html”.</p></li>
<li><p><strong>Functions must be added before parsing.</strong> During parse time, the template package
needs to know all the identifiers that could be used to parse a template correctly.
This means that you need to set the function map before you do any parsing.
This can make the code a little longer, especially when you start with
a simple <code>template.ParseFiles</code> and need to add functions to it.</p></li>
</ul>


<h2>Quiz time</h2>

<p>Now that we know more about how templates work and some common gotchas, lets look
at some code and have a quiz. Here’s how the quiz works: I’ll show you a piece
of sample code consisting of some files, and you tell me the output.
The answers are at the bottom of this post.</p>

<h3>Question 1</h3>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"text/template"</span>
</span><span class="line">  <span class="s">"os"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="n">t</span> <span class="p">:=</span> <span class="n">template</span><span class="p">.</span><span class="n">Must</span><span class="p">(</span><span class="n">template</span><span class="p">.</span><span class="n">New</span><span class="p">(</span><span class="s">"foo"</span><span class="p">).</span><span class="n">ParseFiles</span><span class="p">(</span><span class="s">"main.html"</span><span class="p">))</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">t</span><span class="p">.</span><span class="n">Execute</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">Stdout</span><span class="p">,</span> <span class="n">nil</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;




&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.html </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class="html"><span class="line">Hello World!
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<h3>Question 2</h3>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"text/template"</span>
</span><span class="line">  <span class="s">"os"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="n">t</span> <span class="p">:=</span> <span class="n">template</span><span class="p">.</span><span class="n">Must</span><span class="p">(</span><span class="n">template</span><span class="p">.</span><span class="n">ParseFiles</span><span class="p">(</span><span class="s">"main.html"</span><span class="p">,</span> <span class="s">"sub.html"</span><span class="p">))</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">t</span><span class="p">.</span><span class="n">Execute</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">Stdout</span><span class="p">,</span> <span class="n">nil</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;




&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.html </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class="html"><span class="line">{{ template "sub.html" }}
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;




&lt;figure class="code"&gt;&lt;figcaption&gt;<span>sub.html </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class="html"><span class="line">Hello World!
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<h3>Question 3</h3>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"text/template"</span>
</span><span class="line">  <span class="s">"os"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">greet</span><span class="p">()</span> <span class="nb">string</span> <span class="p">{</span>
</span><span class="line">  <span class="k">return</span> <span class="s">"Hello World!"</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="n">t</span> <span class="p">:=</span> <span class="n">template</span><span class="p">.</span><span class="n">Must</span><span class="p">(</span><span class="n">template</span><span class="p">.</span><span class="n">New</span><span class="p">(</span><span class="s">"foo"</span><span class="p">).</span><span class="n">Parse</span><span class="p">(</span><span class="s">`{{ greet }}`</span><span class="p">))</span>
</span><span class="line">  <span class="n">t</span><span class="p">.</span><span class="n">Funcs</span><span class="p">(</span><span class="n">template</span><span class="p">.</span><span class="n">FuncMap</span><span class="p">{</span>
</span><span class="line">      <span class="s">"greet"</span><span class="p">:</span> <span class="n">greet</span><span class="p">,</span>
</span><span class="line">  <span class="p">})</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">t</span><span class="p">.</span><span class="n">Execute</span><span class="p">(</span><span class="n">os</span><span class="p">.</span><span class="n">Stdout</span><span class="p">,</span> <span class="n">nil</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<h2>Answers</h2>

<ul>
<li><p><em>Question 1</em>: Nothing. The “foo” template is the “active” template and it’s
empty. Did you read the Gotchas?</p></li>
<li><p><em>Question 2</em>: “Hello World!”. Nothing tricky about this one. Interesting fact:
if we reversed the order of the parsed files it would be the same output, even though
it does something totally different. <em>(Why?)</em></p></li>
<li><p><em>Question 3</em>: A panic. We don’t have the functions in the template at the time of
the parsing, so an error is returned and <code>Must</code> causes a panic. This is Gotcha number 3.</p></li>
</ul>


<h2>Conclusion</h2>

<p>So how did you do? I admit, some of the questions were tricks and subtle so it’s
ok if you got some (all) of them wrong, but all of them were inspired by common
problems I’ve seen people have. Templates are actually pretty simple, but they
have some non-obvious properties that require some care in how they are created
and used in your code.</p></div>
    </content>
    <updated>2012-08-18T15:51:00Z</updated>
    <source>
      <id>http://shadynasty.biz/</id>
      <author>
        <name>Jeff Wendling</name>
      </author>
      <link href="http://shadynasty.biz/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://shadynasty.biz/" rel="alternate" type="text/html"/>
      <title>Shadynasty Business</title>
      <updated>2012-09-06T11:21:44Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-907347776987306103</id>
    <link href="http://reneefrench.blogspot.com/feeds/907347776987306103/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=907347776987306103" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/907347776987306103" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/907347776987306103" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/08/blog-post_14.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-JOqmSuvTAZ8/UCr3u-mqk-I/AAAAAAAAFFw/9F8GA1gNXAU/s1600/teacher18a.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-JOqmSuvTAZ8/UCr3u-mqk-I/AAAAAAAAFFw/9F8GA1gNXAU/s320/teacher18a.jpg" width="254"/></a></div> <div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-907347776987306103?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-15T01:13:35Z</updated>
    <published>2012-08-15T01:13:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2012/08/08/Quick-Update</id>
    <link href="http://www.codegrunt.co.uk/2012/08/08/Quick-Update.html" rel="alternate" type="text/html"/>
    <title>Quick Update</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><h2 id="metablah">Metablah</h2>

<p>Ok, so I’ve not managed to keep this updated… yeah, I hate meta-blog posts as much as anybody, so I’m going to keep this short - timetabled blogging clearly doesn’t work for me, so I’m officially making no promises about blogging ever again, I promise, even if that is a paradox ;-)</p>

<h2 id="weak">Weak</h2>

<p>I’ve been making good progress on <a href="https://github.com/lorenzo-stoakes/weak">weak</a>, though I have been totally focused on optimising <a href="http://chessprogramming.wikispaces.com/Move+Generation">move generation</a> so far to the point that the engine doesn’t actually play yet. This is after I switched from <a href="http://golang.org">go</a> to C since performance in the go version was so poor that I simply couldn’t continue. I have now got to the point where I’m vaguely happy with performance, so I’m going to work on actually making the engine play. I also plan to back-port to go at some point. It’ll be interesting to see how it looks after all the optimisations I’ve applied since going to C.</p>

<p>The switch isn’t necessarily a poor reflection on go, rather a combination of it being a very young language, and the fact that go is pretty much an unsuitable choice for this project. A chess engine is quite an unusual piece of software in any case, as it really does rely on pedantic optimisation more than a lot of other software might, and certain handy assembly instructions (bit scan forward/backward, pop count.)</p>

<p>Since I have used several ideas from <a href="http://www.stockfishchess.com">stockfish</a> for optimising weak, I have moved to a <a href="http://www.gnu.org/licenses/gpl-faq.html">GPLv3</a> license and officially acknowledged weak as a stockfish derivative. The degree of derivation right now is small, by no means have I copied code wholesale (the hours and hours spent debugging many very evil bugs is a testament to that), but there are certain portions of code which have been heavily influenced by my having scoured stockfish’s code, and a few portions of code which are essentially direct C ports of portions of stockfish (written in C++), hence the necessity of this move.</p>

<p>Moving to this arrangement also affords me the opportunity to mine stockfish for ideas as much as I like. Given the incredible quality of stockfish, that is quite useful to say the least. Regardless, I am not interested in simply porting the code to C, so it’ll be a matter of mining the code for ideas and applying them to weak.</p>

<h2 id="epiblog">Epiblog</h2>

<p>Hopefully I’ll put up a decent post about chess engine development at some point. In other news, I am enjoying my time in startup-land, having just spent a week in Greece working with some of my Grecian colleagues in a slightly nicer climate than dear old Blighty.</p></div>
    </content>
    <updated>2012-08-07T23:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://www.miek.nl/blog/archives/2012/08/07/user_management_in_fksd/index.html</id>
    <link href="http://www.miek.nl/blog/archives/2012/08/07/user_management_in_fksd/index.html" rel="alternate" type="text/html"/>
    <title>User management in fksd</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><blockquote>
<p>If you do DNS for too long everything looks like 53.</p>
</blockquote>
<p>In this "trace" I'm showing the logging of <code>fksd</code> when I add a zone, try to list it as a non-existent user <code>miekg</code> (which fails), add the user <code>miekg</code> and list it again. User are identified by the key in the TSIG record, their password is the shared secret.</p>
<p>The "config files" from <code>nsupdate</code> can be found in the <a href="https://github.com/miekg/dns/tree/dev/ex/fksd/cmds">github repo of fksd</a>. The <code>nsupdate</code> commands are preceded with a <code>%</code>, extra comments are preceded with <code>#</code>:</p>
<pre><code>./fksd -log
# add a zone as the superuser (defaults to root)
% nsupdate -vd addzone
2012/08/07 21:48:31 fksd: config command
2012/08/07 21:48:31 fksd: config command ok
2012/08/07 21:48:31 fksd: config: READ miek.nl.  /home/miekg/g/src/dns/ex/fksd/z/miek.nl.db
2012/08/07 21:48:31 fksd: config: added: READ miek.nl.  /home/miekg/g/src/dns/ex/fksd/z/miek.nl.db

# list the zones in the server as the user miekg (this fails)
% nsupdate -vd listzone-miekg
2012/08/07 21:48:35 fksd: config command
2012/08/07 21:48:35 fksd: non config command (tsig fail): dns: bad signature

# add the user miekg (only the superuser may do this)
% nsupdate -vd adduser-miekg
2012/08/07 21:48:39 fksd: config command
2012/08/07 21:48:39 fksd: config command ok
2012/08/07 21:48:39 fksd: config: ADD miekg. with bWlla2c=

# list the current users 
% nsupdate -vd listuser
2012/08/07 21:48:43 fksd: config command
2012/08/07 21:48:43 fksd: config command ok
2012/08/07 21:48:43 fksd: config: USER root.: c3R1cGlk
2012/08/07 21:48:43 fksd: config: USER miekg.: bWlla2c=

# Again, list the zones as the user miekg, now it works
% nsupdate -vd listzone-miekg
2012/08/07 21:48:51 fksd: config command
2012/08/07 21:48:51 fksd: config command ok
2012/08/07 21:48:51 fksd: config: LIST</code></pre>
<p>That last command now <em>works</em>, before we got a "dns: bad signature" error.</p>
<p>The user management will be kept simple. The superuser can do everything, other users can use: <code>write</code>, <code>list</code> or <code>drop</code>, but this is currently a (minor) to do.</p></div>
    </summary>
    <updated>2012-08-07T19:58:28Z</updated>
    <category term="go, dns(sec)"/>
    <author>
      <name>Miek Gieben</name>
    </author>
    <source>
      <id>http://www.miek.nl/blog</id>
      <author>
        <name>Miek Gieben</name>
      </author>
      <link href="http://www.miek.nl/blog/archives/go/index-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.miek.nl/blog" rel="alternate" type="text/html"/>
      <subtitle>Thoughts on (technical) stuff</subtitle>
      <title>Filed under: go | Miek</title>
      <updated>2012-09-17T18:42:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://shadynasty.biz/blog/2012/08/07/painless-web-handlers-in-go</id>
    <link href="http://shadynasty.biz/blog/2012/08/07/painless-web-handlers-in-go/" rel="alternate" type="text/html"/>
    <title>Painless Web Handlers in Go</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://shadynasty.biz/blog/2012/07/30/quick-and-clean-in-go/">Last time</a> we made a little guestbook application, but there were a
couple pain points. We had to have some boiler plate at the top of
all of the handlers, and errors were handled by copying the same line of code
everywhere. We also had fixed url paths hard coded in handlers and templates.
Let’s see how we can fix that.</p>




<h2>Adding context</h2>

<p>A lot of the boiler plate in the handlers last time had to do with the database
for each request, so let’s start by cleaning that up. How we do this is by
creating a type that will have the context for the request.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>context.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"labix.org/v2/mgo"</span>
</span><span class="line">  <span class="s">"net/http"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">type</span> <span class="n">Context</span> <span class="k">struct</span> <span class="p">{</span>
</span><span class="line">  <span class="n">Database</span> <span class="p">*</span><span class="n">mgo</span><span class="p">.</span><span class="n">Database</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="p">(</span><span class="n">c</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="n">Close</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="n">c</span><span class="p">.</span><span class="n">Database</span><span class="p">.</span><span class="n">Session</span><span class="p">.</span><span class="n">Close</span><span class="p">()</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">NewContext</span><span class="p">(</span><span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">(*</span><span class="n">Context</span><span class="p">,</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="k">return</span> <span class="p">&amp;</span><span class="n">Context</span><span class="p">{</span>
</span><span class="line">      <span class="n">Database</span><span class="p">:</span> <span class="n">session</span><span class="p">.</span><span class="n">Clone</span><span class="p">().</span><span class="n">DB</span><span class="p">(</span><span class="n">database</span><span class="p">),</span>
</span><span class="line">  <span class="p">},</span> <span class="n">nil</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>A context is the general context the request will use to make decisions, bundled
up with the handles to the resources it needs to perform actions. Right now we
only have the database. Let’s change our handlers to use the new context.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
<span class="line-number">24</span>
<span class="line-number">25</span>
<span class="line-number">26</span>
<span class="line-number">27</span>
<span class="line-number">28</span>
<span class="line-number">29</span>
<span class="line-number">30</span>
<span class="line-number">31</span>
<span class="line-number">32</span>
<span class="line-number">33</span>
<span class="line-number">34</span>
<span class="line-number">35</span>
<span class="line-number">36</span>
<span class="line-number">37</span>
<span class="line-number">38</span>
<span class="line-number">39</span>
<span class="line-number">40</span>
<span class="line-number">41</span>
<span class="line-number">42</span>
<span class="line-number">43</span>
<span class="line-number">44</span>
<span class="line-number">45</span>
<span class="line-number">46</span>
<span class="line-number">47</span>
<span class="line-number">48</span>
<span class="line-number">49</span>
<span class="line-number">50</span>
<span class="line-number">51</span>
<span class="line-number">52</span>
<span class="line-number">53</span>
<span class="line-number">54</span>
<span class="line-number">55</span>
<span class="line-number">56</span>
<span class="line-number">57</span>
<span class="line-number">58</span>
<span class="line-number">59</span>
<span class="line-number">60</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">func</span> <span class="n">hello</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="n">ctx</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">NewContext</span><span class="p">(</span><span class="n">req</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">defer</span> <span class="n">ctx</span><span class="p">.</span><span class="n">Close</span><span class="p">()</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//set up the collection and query</span>
</span><span class="line">  <span class="n">coll</span> <span class="p">:=</span> <span class="n">ctx</span><span class="p">.</span><span class="n">Database</span><span class="p">.</span><span class="n">C</span><span class="p">(</span><span class="s">"entries"</span><span class="p">)</span>
</span><span class="line">  <span class="n">query</span> <span class="p">:=</span> <span class="n">coll</span><span class="p">.</span><span class="n">Find</span><span class="p">(</span><span class="n">nil</span><span class="p">).</span><span class="n">Sort</span><span class="p">(</span><span class="s">"-timestamp"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//execute the query</span>
</span><span class="line">  <span class="c1">//TODO: add pagination :)</span>
</span><span class="line">  <span class="k">var</span> <span class="n">entries</span> <span class="p">[]</span><span class="n">Entry</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">query</span><span class="p">.</span><span class="n">All</span><span class="p">(&amp;</span><span class="n">entries</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//execute the template</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">index</span><span class="p">.</span><span class="n">Execute</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">entries</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">sign</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//make sure we got post</span>
</span><span class="line">  <span class="k">if</span> <span class="n">req</span><span class="p">.</span><span class="n">Method</span> <span class="p">!=</span> <span class="s">"POST"</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">NotFound</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">entry</span> <span class="p">:=</span> <span class="n">NewEntry</span><span class="p">()</span>
</span><span class="line">  <span class="n">entry</span><span class="p">.</span><span class="n">Name</span> <span class="p">=</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"name"</span><span class="p">)</span>
</span><span class="line">  <span class="n">entry</span><span class="p">.</span><span class="n">Message</span> <span class="p">=</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"message"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="k">if</span> <span class="n">entry</span><span class="p">.</span><span class="n">Name</span> <span class="p">==</span> <span class="s">""</span> <span class="p">{</span>
</span><span class="line">      <span class="n">entry</span><span class="p">.</span><span class="n">Name</span> <span class="p">=</span> <span class="s">"Some dummy who forgot a name"</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">if</span> <span class="n">entry</span><span class="p">.</span><span class="n">Message</span> <span class="p">==</span> <span class="s">""</span> <span class="p">{</span>
</span><span class="line">      <span class="n">entry</span><span class="p">.</span><span class="n">Message</span> <span class="p">=</span> <span class="s">"Some dummy who forgot a message."</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">ctx</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">NewContext</span><span class="p">(</span><span class="n">req</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">defer</span> <span class="n">ctx</span><span class="p">.</span><span class="n">Close</span><span class="p">()</span>
</span><span class="line">
</span><span class="line">  <span class="n">coll</span> <span class="p">:=</span> <span class="n">ctx</span><span class="p">.</span><span class="n">Database</span><span class="p">.</span><span class="n">C</span><span class="p">(</span><span class="s">"entries"</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">coll</span><span class="p">.</span><span class="n">Insert</span><span class="p">(</span><span class="n">entry</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">http</span><span class="p">.</span><span class="n">Redirect</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="s">"/"</span><span class="p">,</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusTemporaryRedirect</span><span class="p">)</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Now thats wonderful, but it looks like we just made it worse.</p>

<h2>The magic of interfaces</h2>

<p>To fix this, we’re going to create a new handler type, and give it a
<code>ServeHTTP</code> method. This new handler type will handle creating/closing
the context, and handling any errors that arise. Here’s the definition:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>http.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="s">"net/http"</span>
</span><span class="line">
</span><span class="line"><span class="k">type</span> <span class="n">handler</span> <span class="k">func</span><span class="p">(</span><span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="n">error</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="p">(</span><span class="n">h</span> <span class="n">handler</span><span class="p">)</span> <span class="n">ServeHTTP</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//create the context</span>
</span><span class="line">  <span class="n">ctx</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">NewContext</span><span class="p">(</span><span class="n">req</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">defer</span> <span class="n">ctx</span><span class="p">.</span><span class="n">Close</span><span class="p">()</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//run the handler and grab the error, and report it</span>
</span><span class="line">  <span class="n">err</span> <span class="p">=</span> <span class="n">h</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">ctx</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>The <code>handler</code> type is a function type, meaning any function with that signature
can be cast to that type. We define a method on the function (I know!) so that
the net/http package can use it as though it were any other handler. We’ve
already been doing something very similar to this already. When we called the
<code>http.HandleFunc</code> function in our <code>main.go</code>, we’ve been using our functions
as the type <code>http.HandlerFunc</code> which defines a ServeHTTP method, just like ours.
See, it’s not so bad. Here’s what the new handlers look like:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>handlers.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
<span class="line-number">24</span>
<span class="line-number">25</span>
<span class="line-number">26</span>
<span class="line-number">27</span>
<span class="line-number">28</span>
<span class="line-number">29</span>
<span class="line-number">30</span>
<span class="line-number">31</span>
<span class="line-number">32</span>
<span class="line-number">33</span>
<span class="line-number">34</span>
<span class="line-number">35</span>
<span class="line-number">36</span>
<span class="line-number">37</span>
<span class="line-number">38</span>
<span class="line-number">39</span>
<span class="line-number">40</span>
<span class="line-number">41</span>
<span class="line-number">42</span>
<span class="line-number">43</span>
<span class="line-number">44</span>
<span class="line-number">45</span>
<span class="line-number">46</span>
<span class="line-number">47</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="s">"net/http"</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">hello</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="p">(</span><span class="n">err</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//set up the collection and query</span>
</span><span class="line">  <span class="n">coll</span> <span class="p">:=</span> <span class="n">ctx</span><span class="p">.</span><span class="n">Database</span><span class="p">.</span><span class="n">C</span><span class="p">(</span><span class="s">"entries"</span><span class="p">)</span>
</span><span class="line">  <span class="n">query</span> <span class="p">:=</span> <span class="n">coll</span><span class="p">.</span><span class="n">Find</span><span class="p">(</span><span class="n">nil</span><span class="p">).</span><span class="n">Sort</span><span class="p">(</span><span class="s">"-timestamp"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//execute the query</span>
</span><span class="line">  <span class="c1">//TODO: add pagination :)</span>
</span><span class="line">  <span class="k">var</span> <span class="n">entries</span> <span class="p">[]</span><span class="n">Entry</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">=</span> <span class="n">query</span><span class="p">.</span><span class="n">All</span><span class="p">(&amp;</span><span class="n">entries</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//execute the template</span>
</span><span class="line">  <span class="n">err</span> <span class="p">=</span> <span class="n">index</span><span class="p">.</span><span class="n">Execute</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">entries</span><span class="p">)</span>
</span><span class="line">  <span class="k">return</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">sign</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="p">(</span><span class="n">err</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//make sure we got post</span>
</span><span class="line">  <span class="k">if</span> <span class="n">req</span><span class="p">.</span><span class="n">Method</span> <span class="p">!=</span> <span class="s">"POST"</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">NotFound</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">entry</span> <span class="p">:=</span> <span class="n">NewEntry</span><span class="p">()</span>
</span><span class="line">  <span class="n">entry</span><span class="p">.</span><span class="n">Name</span> <span class="p">=</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"name"</span><span class="p">)</span>
</span><span class="line">  <span class="n">entry</span><span class="p">.</span><span class="n">Message</span> <span class="p">=</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"message"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="k">if</span> <span class="n">entry</span><span class="p">.</span><span class="n">Name</span> <span class="p">==</span> <span class="s">""</span> <span class="p">{</span>
</span><span class="line">      <span class="n">entry</span><span class="p">.</span><span class="n">Name</span> <span class="p">=</span> <span class="s">"Some dummy who forgot a name"</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">if</span> <span class="n">entry</span><span class="p">.</span><span class="n">Message</span> <span class="p">==</span> <span class="s">""</span> <span class="p">{</span>
</span><span class="line">      <span class="n">entry</span><span class="p">.</span><span class="n">Message</span> <span class="p">=</span> <span class="s">"Some dummy who forgot a message."</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">coll</span> <span class="p">:=</span> <span class="n">ctx</span><span class="p">.</span><span class="n">Database</span><span class="p">.</span><span class="n">C</span><span class="p">(</span><span class="s">"entries"</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">=</span> <span class="n">coll</span><span class="p">.</span><span class="n">Insert</span><span class="p">(</span><span class="n">entry</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">http</span><span class="p">.</span><span class="n">Redirect</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="s">"/"</span><span class="p">,</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusTemporaryRedirect</span><span class="p">)</span>
</span><span class="line">  <span class="k">return</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Much better! Let’s commit that.</p>

<h2>Routing</h2>

<p>The other pain points, hard coded urls, and checking the request method,
are going to be handled by more advanced routing. For this, we’re going
to use the execllent <a href="http://gorilla-web.appspot.com">gorilla web toolkit</a>, specifically the
<a href="http://gorilla-web.appspot.com/pkg/pat">gorilla/pat</a> package. I really like the simple API it provides
with easy parameter capturing from the url. It’s very easy to use with the
<code>net/http</code> package:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="k">var</span> <span class="n">err</span> <span class="n">error</span>
</span><span class="line">  <span class="n">u</span> <span class="p">:=</span> <span class="n">os</span><span class="p">.</span><span class="n">Getenv</span><span class="p">(</span><span class="s">"DATABASE_URL"</span><span class="p">)</span>
</span><span class="line">  <span class="n">parsed</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">url</span><span class="p">.</span><span class="n">Parse</span><span class="p">(</span><span class="n">u</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="n">database</span> <span class="p">=</span> <span class="n">parsed</span><span class="p">.</span><span class="n">Path</span><span class="p">[</span><span class="mi">1</span><span class="p">:]</span>
</span><span class="line">  <span class="n">session</span><span class="p">,</span> <span class="n">err</span> <span class="p">=</span> <span class="n">mgo</span><span class="p">.</span><span class="n">Dial</span><span class="p">(</span><span class="n">u</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">r</span> <span class="p">:=</span> <span class="n">pat</span><span class="p">.</span><span class="n">New</span><span class="p">()</span>
</span><span class="line">  <span class="n">r</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">"GET"</span><span class="p">,</span> <span class="s">"/"</span><span class="p">,</span> <span class="n">handler</span><span class="p">(</span><span class="n">hello</span><span class="p">)).</span><span class="n">Name</span><span class="p">(</span><span class="s">"index"</span><span class="p">)</span>
</span><span class="line">  <span class="n">r</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">"POST"</span><span class="p">,</span> <span class="s">"/sign"</span><span class="p">,</span> <span class="n">handler</span><span class="p">(</span><span class="n">sign</span><span class="p">)).</span><span class="n">Name</span><span class="p">(</span><span class="s">"sign"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">=</span> <span class="n">http</span><span class="p">.</span><span class="n">ListenAndServe</span><span class="p">(</span><span class="s">":"</span><span class="p">+</span><span class="n">os</span><span class="p">.</span><span class="n">Getenv</span><span class="p">(</span><span class="s">"PORT"</span><span class="p">),</span> <span class="n">r</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>One important and easy to miss detail is we now pass the router in as the
second argument to the <code>http.ListenAndServe</code> call. Now we can remove the check
that the method is <code>POST</code> in the <code>sign</code> handler, as the router takes care of that
for us. Lets move on to fixing the hard coded entries.</p>

<h2>Reversing URLs</h2>

<p>If you’ll notice, we gave the handlers a <code>.Name</code> call. The <a href="http://gorilla-web.appspot.com/pkg/pat">gorilla/pat</a>
package returns a <code>*mux.Router</code> for us to work with. Using that we can have the
router rebuild urls from the names. For example, if we wanted to grab the url for
the index page, we could use</p>

<pre><code>r.GetRoute("index").URL()
</code></pre>

<p>but since <code>r</code> is inaccessable outside the <code>main</code> function, we have to move it
into a higher scope. Let’s do that.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">var</span> <span class="n">router</span> <span class="p">*</span><span class="n">pat</span><span class="p">.</span><span class="n">Router</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//...</span>
</span><span class="line">
</span><span class="line">  <span class="n">router</span> <span class="p">=</span> <span class="n">pat</span><span class="p">.</span><span class="n">New</span><span class="p">()</span>
</span><span class="line">  <span class="n">router</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">"GET"</span><span class="p">,</span> <span class="s">"/"</span><span class="p">,</span> <span class="n">handler</span><span class="p">(</span><span class="n">hello</span><span class="p">)).</span><span class="n">Name</span><span class="p">(</span><span class="s">"index"</span><span class="p">)</span>
</span><span class="line">  <span class="n">router</span><span class="p">.</span><span class="n">Add</span><span class="p">(</span><span class="s">"POST"</span><span class="p">,</span> <span class="s">"/sign"</span><span class="p">,</span> <span class="n">handler</span><span class="p">(</span><span class="n">sign</span><span class="p">)).</span><span class="n">Name</span><span class="p">(</span><span class="s">"sign"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">=</span> <span class="n">http</span><span class="p">.</span><span class="n">ListenAndServe</span><span class="p">(</span><span class="s">":"</span><span class="p">+</span><span class="n">os</span><span class="p">.</span><span class="n">Getenv</span><span class="p">(</span><span class="s">"PORT"</span><span class="p">),</span> <span class="n">router</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>And now we can update the sign handler</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>handlers.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">func</span> <span class="n">sign</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">,</span> <span class="n">ctx</span> <span class="p">*</span><span class="n">Context</span><span class="p">)</span> <span class="p">(</span><span class="n">err</span> <span class="n">error</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//...</span>
</span><span class="line">
</span><span class="line">  <span class="n">url</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">router</span><span class="p">.</span><span class="n">GetRoute</span><span class="p">(</span><span class="s">"index"</span><span class="p">).</span><span class="n">URL</span><span class="p">()</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">http</span><span class="p">.</span><span class="n">Redirect</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="n">url</span><span class="p">,</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusTemporaryRedirect</span><span class="p">)</span>
</span><span class="line">  <span class="k">return</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<h2>Reversing in Templates</h2>

<p>To reverse inside the template, we could either remember to pass the router in
as part of the template context on every invocation, or we could add a function to
the template. Since keeping track of the router through nested templates and scope
changes is a daunting task, adding a function to do the reversing is a better
option. Heres that function:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">func</span> <span class="n">reverse</span><span class="p">(</span><span class="n">name</span> <span class="nb">string</span><span class="p">,</span> <span class="n">things</span> <span class="p">...</span><span class="k">interface</span><span class="p">{})</span> <span class="nb">string</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//convert the things to strings</span>
</span><span class="line">  <span class="n">strs</span> <span class="p">:=</span> <span class="nb">make</span><span class="p">([]</span><span class="nb">string</span><span class="p">,</span> <span class="nb">len</span><span class="p">(</span><span class="n">things</span><span class="p">))</span>
</span><span class="line">  <span class="k">for</span> <span class="n">i</span><span class="p">,</span> <span class="n">th</span> <span class="p">:=</span> <span class="k">range</span> <span class="n">things</span> <span class="p">{</span>
</span><span class="line">      <span class="n">strs</span><span class="p">[</span><span class="n">i</span><span class="p">]</span> <span class="p">=</span> <span class="n">fmt</span><span class="p">.</span><span class="n">Sprint</span><span class="p">(</span><span class="n">th</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="c1">//grab the route</span>
</span><span class="line">  <span class="n">u</span><span class="p">,</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">router</span><span class="p">.</span><span class="n">GetRoute</span><span class="p">(</span><span class="n">name</span><span class="p">).</span><span class="n">URL</span><span class="p">(</span><span class="n">strs</span><span class="p">...)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">return</span> <span class="n">u</span><span class="p">.</span><span class="n">Path</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>We choose to have the function panic on errors because any incorrect reversal
is a programmer error. We also accept a variadic number of interface values because
sometimes we need to have a parameter in the reversal that is an integer, like the
year on the blog post url, and the <a href="http://gorilla-web.appspot.com/pkg/mux#Route.URL">URL function</a> takes strings.
So rather than force the template to do the conversion, or the function executing the template, we
just convert everything to a string by calling <code>fmt.Sprint</code> on it. Then we have
to add this function to the template.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">var</span> <span class="n">funcs</span> <span class="p">=</span> <span class="n">template</span><span class="p">.</span><span class="n">FuncMap</span><span class="p">{</span>
</span><span class="line">  <span class="s">"reverse"</span><span class="p">:</span> <span class="n">reverse</span><span class="p">,</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">parseTemplate</span><span class="p">(</span><span class="n">files</span> <span class="p">...</span><span class="nb">string</span><span class="p">)</span> <span class="p">*</span><span class="n">template</span><span class="p">.</span><span class="n">Template</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//create a new template named after the first file in the list and add</span>
</span><span class="line">  <span class="c1">//the function map to it</span>
</span><span class="line">  <span class="n">name</span> <span class="p">:=</span> <span class="n">filepath</span><span class="p">.</span><span class="n">Base</span><span class="p">(</span><span class="n">files</span><span class="p">[</span><span class="mi">0</span><span class="p">])</span>
</span><span class="line">  <span class="n">t</span> <span class="p">:=</span> <span class="n">template</span><span class="p">.</span><span class="n">New</span><span class="p">(</span><span class="n">name</span><span class="p">).</span><span class="n">Funcs</span><span class="p">(</span><span class="n">funcs</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//parse the files into the template and panic on errors</span>
</span><span class="line">  <span class="n">t</span> <span class="p">=</span> <span class="n">template</span><span class="p">.</span><span class="n">Must</span><span class="p">(</span><span class="n">t</span><span class="p">.</span><span class="n">ParseFiles</span><span class="p">(</span><span class="n">files</span><span class="p">...))</span>
</span><span class="line">  <span class="k">return</span> <span class="n">t</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">var</span> <span class="n">index</span> <span class="p">=</span> <span class="n">parseTemplate</span><span class="p">(</span>
</span><span class="line">  <span class="s">"templates/_base.html"</span><span class="p">,</span>
</span><span class="line">  <span class="s">"templates/index.html"</span><span class="p">,</span>
</span><span class="line"><span class="p">)</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Theres a tricky point here: the template package will error when trying to parse
a template and it finds a function invocation to something undefined. That means
we have to add our function map to the template before we add the files to parse.
We write a little helper function to do this correctly. Now we can update the
template to use it.</p>

<pre><code>&lt;form action="{{ reverse "sign" }}" method="POST"&gt;
</code></pre>

<p>Let’s update the <code>sign</code> handler to use the reverse function too.</p>

<pre><code>http.Redirect(w, req, reverse("index"), http.StatusSeeOther)
</code></pre>

<p>Pain: consider yourself eliminated.</p>

<p>Next up, we’re going to do more with the context type we created, and make
the guestbook a little more web 2.0. As always, the source to the gostbook
is up on <a href="http://github.com/zeebo/gostbook">github</a>.</p></div>
    </content>
    <updated>2012-08-07T18:13:00Z</updated>
    <source>
      <id>http://shadynasty.biz/</id>
      <author>
        <name>Jeff Wendling</name>
      </author>
      <link href="http://shadynasty.biz/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://shadynasty.biz/" rel="alternate" type="text/html"/>
      <title>Shadynasty Business</title>
      <updated>2012-09-06T11:21:44Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://www.miek.nl/blog/archives/2012/08/06/dynamic_nameserver_provisioning_with_dns_pkts/index.html</id>
    <link href="http://www.miek.nl/blog/archives/2012/08/06/dynamic_nameserver_provisioning_with_dns_pkts/index.html" rel="alternate" type="text/html"/>
    <title>Dynamic nameserver provisioning with dns pkts</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I'm writing a nameserver called <code>fksd</code> (Funkensturm daemon), which is currently in a prototype stage (but the code is available at <a href="https://github.com/miekg/dns/tree/dev/ex/fksd">github</a>).</p>
<p>In this server I'm pursuing some interesting directions in nameserver development, such as the dynamic configuration as provided by <a href="http://www.isc.org/bind10/">BIND10</a>.</p>
<p>BIND10 uses http(s), but I think using DNS packets is more in line with a nameserver, so I opted for that route.</p>
<p>With <code>fksd</code> you can use packets (which will be TSIG signed in the <s>future</s> tomorrow) to configure the server. The only configuration possible at the moment is adding a zone. Such a packet needs to have a TXT record like the following in its AUTHORITY SECTION:</p>
<pre><code>ZONE.   IN  TXT "READ miek.nl. /path/to/zone"</code></pre>
<p>Using the AUTH. section means we can re-use <code>nsupdate</code> (#win).</p>
<p>The current dev. version of <code>fksd</code> listens on port 1053 for real dns queries and on 8053 for configuration queries. Lets start the daemon and query for <code>miek.nl MX</code>:</p>
<pre><code>$ ./fksd -log
&lt;in other terminal&gt;
$ dig @127.0.0.1 -p 1053 mx miek.nl
...
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: SERVFAIL, id: 1945
...</code></pre>
<p>Indeed, SERVFAIL, because <code>miek.nl.</code> isn't loaded. Lets fix that (<code>-vD</code> is crucial otherwise it won't work for some reason):</p>
<pre><code>$ nsupdate -vD
&gt; server 127.0.0.1 8053
&gt; zone ZONE.
&gt; update add ZONE. 60 IN TXT "READ miek.nl /home/miekg/g/src/dns/ex/fksd/z/miek.nl.db"
&gt; send
; Communication with server failed: timed out</code></pre>
<p>That last error is because I'm lame and do not send a reply message (will be done in the future). Meanwhile <code>fksd</code> logs:</p>
<pre><code>2012/08/06 23:13:27 fksd: config commmand
2012/08/06 23:13:27 fksd: config: READ miek.nl. /home/miekg/g/src/dns/ex/fksd/z/miek.nl.db</code></pre>
<p>When I now query for <code>miek.nl MX</code>, I get:</p>
<pre><code>$ dig @127.0.0.1 -p 1053 mx miek.nl
...
;; -&gt;&gt;HEADER&lt;&lt;- opcode: QUERY, status: NOERROR, id: 31060
...
;; ANSWER SECTION:
miek.nl.                345600  IN      MX      20 mail.atoom.net.
miek.nl.                345600  IN      MX      40 mx-ext.tjeb.nl.

;; AUTHORITY SECTION:
miek.nl.                345600  IN      NS      ext.ns.whyscream.net.
miek.nl.                345600  IN      NS      open.nlnetlabs.nl.
miek.nl.                345600  IN      NS      omval.tednet.nl.
miek.nl.                345600  IN      NS      elektron.atoom.net.
...</code></pre>
<p>The config will be put in some kind of journal in json format (just like BIND10...), which is also "a future todo"(TM). But for now: this seems to work very nice - now the only thing left is to implement the rest of this authoritative nameserver.</p></div>
    </summary>
    <updated>2012-08-06T21:18:39Z</updated>
    <category term="go, dns(sec)"/>
    <author>
      <name>Miek Gieben</name>
    </author>
    <source>
      <id>http://www.miek.nl/blog</id>
      <author>
        <name>Miek Gieben</name>
      </author>
      <link href="http://www.miek.nl/blog/archives/go/index-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.miek.nl/blog" rel="alternate" type="text/html"/>
      <subtitle>Thoughts on (technical) stuff</subtitle>
      <title>Filed under: go | Miek</title>
      <updated>2012-09-17T18:42:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-2673490712248854922.post-3685354668513579924</id>
    <link href="http://hackgolang.blogspot.com/feeds/3685354668513579924/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://hackgolang.blogspot.com/2010/05/syntax-highlighting-for-golang.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/2673490712248854922/posts/default/3685354668513579924" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/2673490712248854922/posts/default/3685354668513579924" rel="self" type="application/atom+xml"/>
    <link href="http://hackgolang.blogspot.com/2010/05/syntax-highlighting-for-golang.html" rel="alternate" type="text/html"/>
    <title>Syntax highlighting for golang</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">I've been using Alex Gorbatchev's <a href="http://alexgorbatchev.com/wiki/SyntaxHighlighter">SyntaxHighlighter</a> to ease the task of presenting code on this blog.  Seeing that there's currently no "brush" for golang, I decided to create one.  I posted the code <a href="https://raw.github.com/axx/GolangHighlighter/master/shBrushGo.js">here</a> for anyone interested.  To use it, simply put the following line where you'd normally do it for SyntaxHighlighter brushes (usually before the &lt;head&gt; tag):<br/><pre class="brush: html">&lt;script src='https://raw.github.com/axx/GolangHighlighter/master/shBrushGo.js' type='text/javascript'/&gt;</pre>Then use either "go" or "golang" as alias when you insert golang code on your blog:<br/><pre class="brush: html">&lt;pre class="brush: go"&gt;package main<br/>import "fmt"<br/>func main() {<br/>    fmt.Printf("yoohoo!")<br/>}&lt;/pre&gt;</pre>This will be rendered as:<br/><pre class="brush: go">package main<br/>import "fmt"<br/>func main() {<br/>    fmt.Printf("yoohoo!")<br/>}</pre>I hope someone else finds it useful. Please drop a comment if you have some suggestions on how to improve it.<br/>EDIT (05AUG2012): I've lost my old server so I had to reconstruct the script and placed it on GitHub. I therefore updated the example and links above.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/2673490712248854922-3685354668513579924?l=hackgolang.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-05T17:32:08Z</updated>
    <published>2010-05-03T02:02:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="syntax highlighting"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="syntaxhighlighter"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang programming"/>
    <author>
      <name>Allister</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-2673490712248854922</id>
      <category term="linux"/>
      <category term="google go"/>
      <category term="message"/>
      <category term="computing problem"/>
      <category term="edigo"/>
      <category term="hacking with go"/>
      <category term="golang programming"/>
      <category term="hacking with golang"/>
      <category term="snail"/>
      <category term="syntax highlighting"/>
      <category term="ubuntu"/>
      <category term="parser"/>
      <category term="project"/>
      <category term="syntaxhighlighter"/>
      <category term="golang installation"/>
      <category term="golang"/>
      <category term="update"/>
      <category term="edifact"/>
      <category term="go programming"/>
      <author>
        <name>Allister</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://hackgolang.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/2673490712248854922/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://hackgolang.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">This blog is dedicated to learning the <a href="http://golang.org">Go programming language (golang)</a>. Most likely there'll be golang tutorials, discussions on golang idioms and golang programming techniques. We will also follow the development of golang as it matures.<br/>
Written by <a href="http://allistersanchez.com">Allister Sanchez</a>.</div>
      </subtitle>
      <title>Hacking with the Go Programming Language (GoLang)</title>
      <updated>2012-09-10T07:32:55Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-1559041068392016276</id>
    <link href="http://reneefrench.blogspot.com/feeds/1559041068392016276/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=1559041068392016276" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1559041068392016276" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1559041068392016276" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/08/blog-post_4.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-XXod7hwtHu8/UB3BZD9uZjI/AAAAAAAAFFc/X7wQlWx_K5k/s1600/babybjornstrand3.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-XXod7hwtHu8/UB3BZD9uZjI/AAAAAAAAFFc/X7wQlWx_K5k/s320/babybjornstrand3.jpg" width="304"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-1559041068392016276?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-05T00:42:18Z</updated>
    <published>2012-08-05T00:36:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-6655930694875841492</id>
    <link href="http://reneefrench.blogspot.com/feeds/6655930694875841492/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=6655930694875841492" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6655930694875841492" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6655930694875841492" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/08/blog-post_3.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-72RJV-tM6lc/UBxijqs5IrI/AAAAAAAAFE8/JJqa8ctrioA/s1600/mrholt1.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-72RJV-tM6lc/UBxijqs5IrI/AAAAAAAAFE8/JJqa8ctrioA/s320/mrholt1.jpg" width="286"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-6655930694875841492?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-03T23:45:26Z</updated>
    <published>2012-08-03T23:45:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-4519197237984339891</id>
    <link href="http://reneefrench.blogspot.com/feeds/4519197237984339891/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=4519197237984339891" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4519197237984339891" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4519197237984339891" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/08/blog-post_2.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-DVuMJUlk3q0/UBtUjg6ur0I/AAAAAAAAFEk/SLJW4JY34QY/s1600/bjornstrandhill.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-DVuMJUlk3q0/UBtUjg6ur0I/AAAAAAAAFEk/SLJW4JY34QY/s320/bjornstrandhill.jpg" width="293"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-4519197237984339891?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-03T04:33:23Z</updated>
    <published>2012-08-03T04:33:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-8613265679263449574</id>
    <link href="http://reneefrench.blogspot.com/feeds/8613265679263449574/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=8613265679263449574" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8613265679263449574" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8613265679263449574" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/08/blog-post_1.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-tI93HqxpR0g/UBoft5kS8OI/AAAAAAAAFEQ/n1-NjmShP88/s1600/bjornstrandbarf.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-tI93HqxpR0g/UBoft5kS8OI/AAAAAAAAFEQ/n1-NjmShP88/s320/bjornstrandbarf.jpg" width="314"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-8613265679263449574?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-02T06:35:39Z</updated>
    <published>2012-08-02T06:35:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-5268224850526412579</id>
    <link href="http://reneefrench.blogspot.com/feeds/5268224850526412579/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=5268224850526412579" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/5268224850526412579" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/5268224850526412579" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/08/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-berMtDv4ki0/UBjWe_5blCI/AAAAAAAAFD0/nPIjUYZyfqM/s1600/bjornstrandtower2.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://1.bp.blogspot.com/-berMtDv4ki0/UBjWe_5blCI/AAAAAAAAFD0/nPIjUYZyfqM/s320/bjornstrandtower2.jpg" width="301"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-5268224850526412579?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-08-01T07:10:55Z</updated>
    <published>2012-08-01T07:10:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://shadynasty.biz/blog/2012/07/30/quick-and-clean-in-go</id>
    <link href="http://shadynasty.biz/blog/2012/07/30/quick-and-clean-in-go/" rel="alternate" type="text/html"/>
    <title>Quick and Clean in Go</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>After reading a <a href="http://me.veekun.com/blog/2012/07/28/quick-doesnt-mean-dirty/">neat article</a> whose title I stole about making
a guestbook app in Flask, I decided to see how it would compare to my
favorite language of the year, Go. So here’s my take.</p>




<h2>First Steps</h2>

<p>Let’s create a new directory to hold the project. I’m gonna host the code on
github so let’s make the local directory match the import path.</p>

<pre><code>$ cd ~/Code/go/src
$ mkdir -p github.com/zeebo/gostbook
$ cd github.com/zeebo/gostbook/
$ git init
Initialized empty Git repository in /Users/zeebo/Code/go/src/github.com/zeebo/gostbook/.git/
</code></pre>

<p>Note that <code>~/Code/go</code> is a directory in my <a href="http://golang.org/doc/code.html#GOPATH">GOPATH</a> environment variable, the only
piece of configuration I need to do to have the build tool know how to fetch and
build any code that uses these conventions. Lets put in a little hello world code.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>Hello World - main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"fmt"</span>
</span><span class="line">  <span class="s">"net/http"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">hello</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="n">fmt</span><span class="p">.</span><span class="n">Fprintln</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="s">"Hello World!"</span><span class="p">)</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="n">http</span><span class="p">.</span><span class="n">HandleFunc</span><span class="p">(</span><span class="s">"/"</span><span class="p">,</span> <span class="n">hello</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">http</span><span class="p">.</span><span class="n">ListenAndServe</span><span class="p">(</span><span class="s">":8080"</span><span class="p">,</span> <span class="n">nil</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>This registers a handler that will match any path and write
<code>Hello World!</code> in the response. Building and running this code
runs a server that listens on port 8080, so lets visit it.</p>

<pre><code>$ go build
$ ./gostbook &amp;
[1] 39629
$ curl localhost:8080
Hello World!
$ kill 39629
</code></pre>

<p>Neat!</p>

<h2>Commit</h2>

<p>Let’s do our source control duty, and make a commit with our super simple
app.</p>

<pre><code>$ cat .gitignore 
*
!.gitignore
!*.go
!*.html
$ git status
# On branch master
#
# Initial commit
#
# Untracked files:
#   (use "git add &lt;file&gt;..." to include in what will be committed)
#
#   .gitignore
#   main.go
nothing added to commit but untracked files present (use "git add" to track)
$ git add .
$ git commit -m 'initial commit'
[master (root-commit) de0b184] initial commit
 2 files changed, 21 insertions(+)
 create mode 100644 .gitignore
 create mode 100644 main.go
</code></pre>

<h2>Templates</h2>

<p>The next step is to put templates in. Lets make a template directory
and some basic templates in there. I’ll steal the templates from
Eevee’s post and change them to use the built in <a href="http://golang.org/pkg/html/template">html/template</a>
package from the standard library. Here’s the source:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>templates/_base.html </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
</pre></td><td class="code"><pre><code class="html"><span class="line"><span class="cp">&lt;!DOCTYPE html&gt;</span>
</span><span class="line"><span class="nt">&lt;html</span> <span class="na">lang=</span><span class="s">"en"</span><span class="nt">&gt;</span>
</span><span class="line">    <span class="nt">&lt;head&gt;</span>
</span><span class="line">        <span class="nt">&lt;title&gt;</span>{{ template "title" . }}<span class="nt">&lt;/title&gt;</span>
</span><span class="line">    <span class="nt">&lt;/head&gt;</span>
</span><span class="line">    <span class="nt">&lt;body&gt;</span>
</span><span class="line">        <span class="nt">&lt;section</span> <span class="na">id=</span><span class="s">"contents"</span><span class="nt">&gt;</span>
</span><span class="line">            {{ template "content" . }}
</span><span class="line">        <span class="nt">&lt;/section&gt;</span>
</span><span class="line">        <span class="nt">&lt;footer</span> <span class="na">id=</span><span class="s">"footer"</span><span class="nt">&gt;</span>
</span><span class="line">            My Cool Guestbook 2000 © me forever
</span><span class="line">        <span class="nt">&lt;/footer&gt;</span>
</span><span class="line">    <span class="nt">&lt;/body&gt;</span>
</span><span class="line"><span class="nt">&lt;/html&gt;</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;




&lt;figure class="code"&gt;&lt;figcaption&gt;<span>templates/index.html </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
</pre></td><td class="code"><pre><code class="html"><span class="line">{{ define "title" }}Guestbook{{ end }}
</span><span class="line">
</span><span class="line">{{ define "content" }}
</span><span class="line">    <span class="nt">&lt;h1&gt;</span>Guestbook<span class="nt">&lt;/h1&gt;</span>
</span><span class="line">
</span><span class="line">    <span class="nt">&lt;p&gt;</span>Hello, and welcome to my guestbook, because it's 1997!<span class="nt">&lt;/p&gt;</span>
</span><span class="line">
</span><span class="line">    <span class="nt">&lt;ul</span> <span class="na">class=</span><span class="s">"guests"</span><span class="nt">&gt;</span>
</span><span class="line">        <span class="nt">&lt;li&gt;</span>...<span class="nt">&lt;/li&gt;</span>
</span><span class="line">    <span class="nt">&lt;/ul&gt;</span>
</span><span class="line">{{ end }}
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Updating the Go code is a little more work, but not much.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>Template World - main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"html/template"</span>
</span><span class="line">  <span class="s">"net/http"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">var</span> <span class="n">index</span> <span class="p">=</span> <span class="n">template</span><span class="p">.</span><span class="n">Must</span><span class="p">(</span><span class="n">template</span><span class="p">.</span><span class="n">ParseFiles</span><span class="p">(</span>
</span><span class="line">  <span class="s">"templates/_base.html"</span><span class="p">,</span>
</span><span class="line">  <span class="s">"templates/index.html"</span><span class="p">,</span>
</span><span class="line"><span class="p">))</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">hello</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">index</span><span class="p">.</span><span class="n">Execute</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">nil</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Building and running again, we see it’s working:</p>

<pre><code>$ go build
$ ./gostbook &amp;
[1] 39918
$ curl localhost:8080
&lt;!DOCTYPE html&gt;
&lt;html lang="en"&gt;
    &lt;head&gt;
        &lt;title&gt;Guestbook&lt;/title&gt;
    &lt;/head&gt;
    &lt;body&gt;
        &lt;section id="content"&gt;

    &lt;h1&gt;Guestbook&lt;/h1&gt;

    &lt;p&gt;Hello, and welcome to my guestbook, because it's 1997!&lt;/p&gt;

    &lt;ul class="guests"&gt;
        &lt;li&gt;...&lt;/li&gt;
    &lt;/ul&gt;

        &lt;/section&gt;
        &lt;footer id="footer"&gt;
            My Cool Guestbook 2000 © me forever
        &lt;/footer&gt;
    &lt;/body&gt;
&lt;/html&gt;
$ kill 39918
</code></pre>

<p>Let’s be diligent and make another commit. On to data!</p>

<h2>Databases</h2>

<p>Go has many database bindings but the one I find easiest to work with
would be MongoDB with the excellent <a href="http://go.pkgdoc.org/labix.org/v2/mgo">mgo</a> driver. Let’s create our data
model.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>Database entry - entry.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="p">(</span>
</span><span class="line">  <span class="s">"labix.org/v2/mgo/bson"</span>
</span><span class="line">  <span class="s">"time"</span>
</span><span class="line"><span class="p">)</span>
</span><span class="line">
</span><span class="line"><span class="k">type</span> <span class="n">Entry</span> <span class="k">struct</span> <span class="p">{</span>
</span><span class="line">  <span class="n">ID</span>        <span class="n">bson</span><span class="p">.</span><span class="n">ObjectId</span> <span class="s">`bson:"_id,omitempty"`</span>
</span><span class="line">  <span class="n">Timestamp</span> <span class="n">time</span><span class="p">.</span><span class="n">Time</span>
</span><span class="line">  <span class="n">Name</span>      <span class="nb">string</span>
</span><span class="line">  <span class="n">Message</span>   <span class="nb">string</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">NewEntry</span><span class="p">()</span> <span class="p">*</span><span class="n">Entry</span> <span class="p">{</span>
</span><span class="line">  <span class="k">return</span> <span class="p">&amp;</span><span class="n">Entry</span><span class="p">{</span>
</span><span class="line">      <span class="n">Timestamp</span><span class="p">:</span> <span class="n">time</span><span class="p">.</span><span class="n">Now</span><span class="p">(),</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>We just create a struct with some fields. The <a href="http://go.pkgdoc.org/labix.org/v2/mgo">mgo</a> driver uses runtime
reflection to look up the information about the struct for setting and reading
the values. For the ID field add some tags to it to instruct bson to omit it if
the value is empty, and name it <code>_id</code> when serializing, to have MongoDB pick the
id for us on insertion, and name it what it’s expecting. We also provide a
<code>NewEntry</code> function for creating an Entry at the current time.</p>

<p>Now lets add support to the handler.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>Databased up - main.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
<span class="line-number">24</span>
<span class="line-number">25</span>
<span class="line-number">26</span>
<span class="line-number">27</span>
<span class="line-number">28</span>
<span class="line-number">29</span>
<span class="line-number">30</span>
<span class="line-number">31</span>
<span class="line-number">32</span>
<span class="line-number">33</span>
<span class="line-number">34</span>
<span class="line-number">35</span>
<span class="line-number">36</span>
<span class="line-number">37</span>
<span class="line-number">38</span>
<span class="line-number">39</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">func</span> <span class="n">hello</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//grab a clone of the session and close it when the</span>
</span><span class="line">  <span class="c1">//function returns</span>
</span><span class="line">  <span class="n">s</span> <span class="p">:=</span> <span class="n">session</span><span class="p">.</span><span class="n">Clone</span><span class="p">()</span>
</span><span class="line">  <span class="k">defer</span> <span class="n">s</span><span class="p">.</span><span class="n">Close</span><span class="p">()</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//set up the collection and query</span>
</span><span class="line">  <span class="n">coll</span> <span class="p">:=</span> <span class="n">s</span><span class="p">.</span><span class="n">DB</span><span class="p">(</span><span class="s">"gostbook"</span><span class="p">).</span><span class="n">C</span><span class="p">(</span><span class="s">"entries"</span><span class="p">)</span>
</span><span class="line">  <span class="n">query</span> <span class="p">:=</span> <span class="n">coll</span><span class="p">.</span><span class="n">Find</span><span class="p">(</span><span class="n">nil</span><span class="p">).</span><span class="n">Sort</span><span class="p">(</span><span class="s">"-timestamp"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//execute the query</span>
</span><span class="line">  <span class="c1">//TODO: add pagination :)</span>
</span><span class="line">  <span class="k">var</span> <span class="n">entries</span> <span class="p">[]</span><span class="n">Entry</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">query</span><span class="p">.</span><span class="n">All</span><span class="p">(&amp;</span><span class="n">entries</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="c1">//execute the template</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">index</span><span class="p">.</span><span class="n">Execute</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">entries</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span><span class="line">
</span><span class="line"><span class="k">var</span> <span class="n">session</span> <span class="p">*</span><span class="n">mgo</span><span class="p">.</span><span class="n">Session</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">main</span><span class="p">()</span> <span class="p">{</span>
</span><span class="line">  <span class="k">var</span> <span class="n">err</span> <span class="n">error</span>
</span><span class="line">  <span class="n">session</span><span class="p">,</span> <span class="n">err</span> <span class="p">=</span> <span class="n">mgo</span><span class="p">.</span><span class="n">Dial</span><span class="p">(</span><span class="s">"localhost"</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">http</span><span class="p">.</span><span class="n">HandleFunc</span><span class="p">(</span><span class="s">"/"</span><span class="p">,</span> <span class="n">hello</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">=</span> <span class="n">http</span><span class="p">.</span><span class="n">ListenAndServe</span><span class="p">(</span><span class="s">":8080"</span><span class="p">,</span> <span class="n">nil</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">panic</span><span class="p">(</span><span class="n">err</span><span class="p">)</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Interacting with the databse requires a little boilerplate in the handler,
but this can easily be removed by clever use of Go’s interfaces. The <a href="http://golang.org/pkg/net/http">net/http</a>
package will serve anything with a <code>ServeHTTP(ResponseWriter, *Request)</code> method,
so you can decorate handlers by wrapping them in simple types that implement
that interface. Doing that is left as an exercise to the reader :)</p>

<p>Here’s how we change the template:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>templates/index.html </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
</pre></td><td class="code"><pre><code class="html"><span class="line">    <span class="nt">&lt;ul</span> <span class="na">class=</span><span class="s">"guests"</span><span class="nt">&gt;</span>
</span><span class="line">        {{ range . }}
</span><span class="line">        <span class="nt">&lt;li&gt;</span>
</span><span class="line">            <span class="nt">&lt;blockquote&gt;</span>{{ .Message }}<span class="nt">&lt;/blockquote&gt;</span>
</span><span class="line">            <span class="nt">&lt;p&gt;</span>- <span class="nt">&lt;cite&gt;</span>{{ .Name }}<span class="nt">&lt;/cite&gt;</span>, <span class="nt">&lt;time&gt;</span>{{ .Timestamp }}<span class="nt">&lt;/time&gt;&lt;/p&gt;</span>
</span><span class="line">        <span class="nt">&lt;/li&gt;</span>
</span><span class="line">        {{ end }}
</span><span class="line">    <span class="nt">&lt;/ul&gt;</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Notice we don’t worry about any kind of injection. The <a href="http://golang.org/pkg/html/template">html/template</a> package
is super awesome and handles that by knowing what it’s outputing and the context
in which the data is being used. If you’re in an html context, it will escape
the html properly. If you’re in a script or url context, it knows and will apply
the appropriate esacping. No modifying the data in the database. No “sanitizing”.
Just doing the right thing, every time.</p>

<h2>Signing it</h2>

<p>Time to add the handler to sign the guest book. Let’s start with the html for
the form.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>templates/index.html </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
</pre></td><td class="code"><pre><code class="html"><span class="line">    <span class="nt">&lt;hr&gt;</span>
</span><span class="line">
</span><span class="line">    <span class="nt">&lt;form</span> <span class="na">action=</span><span class="s">"/sign"</span> <span class="na">method=</span><span class="s">"POST"</span><span class="nt">&gt;</span>
</span><span class="line">        <span class="nt">&lt;p&gt;</span>Name: <span class="nt">&lt;input</span> <span class="na">type=</span><span class="s">"text"</span> <span class="na">name=</span><span class="s">"name"</span><span class="nt">&gt;&lt;/p&gt;</span>
</span><span class="line">        <span class="nt">&lt;p&gt;</span>Message: <span class="nt">&lt;textarea</span> <span class="na">name=</span><span class="s">"message"</span> <span class="na">rows=</span><span class="s">"10"</span> <span class="na">cols=</span><span class="s">"40"</span><span class="nt">&gt;&lt;/textarea&gt;&lt;/p&gt;</span>
</span><span class="line">        <span class="nt">&lt;p&gt;&lt;button&gt;</span>Sign<span class="nt">&lt;/button&gt;&lt;/p&gt;</span>
</span><span class="line">    <span class="nt">&lt;/form&gt;</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>And now the handler:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>sign.go </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
<span class="line-number">24</span>
<span class="line-number">25</span>
<span class="line-number">26</span>
<span class="line-number">27</span>
<span class="line-number">28</span>
<span class="line-number">29</span>
<span class="line-number">30</span>
<span class="line-number">31</span>
<span class="line-number">32</span>
<span class="line-number">33</span>
</pre></td><td class="code"><pre><code class="go"><span class="line"><span class="k">package</span> <span class="n">main</span>
</span><span class="line">
</span><span class="line"><span class="k">import</span> <span class="s">"net/http"</span>
</span><span class="line">
</span><span class="line"><span class="k">func</span> <span class="n">sign</span><span class="p">(</span><span class="n">w</span> <span class="n">http</span><span class="p">.</span><span class="n">ResponseWriter</span><span class="p">,</span> <span class="n">req</span> <span class="p">*</span><span class="n">http</span><span class="p">.</span><span class="n">Request</span><span class="p">)</span> <span class="p">{</span>
</span><span class="line">  <span class="c1">//make sure we got post</span>
</span><span class="line">  <span class="k">if</span> <span class="n">req</span><span class="p">.</span><span class="n">Method</span> <span class="p">!=</span> <span class="s">"POST"</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">NotFound</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">entry</span> <span class="p">:=</span> <span class="n">NewEntry</span><span class="p">()</span>
</span><span class="line">  <span class="n">entry</span><span class="p">.</span><span class="n">Name</span> <span class="p">=</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"name"</span><span class="p">)</span>
</span><span class="line">  <span class="n">entry</span><span class="p">.</span><span class="n">Message</span> <span class="p">=</span> <span class="n">req</span><span class="p">.</span><span class="n">FormValue</span><span class="p">(</span><span class="s">"message"</span><span class="p">)</span>
</span><span class="line">
</span><span class="line">  <span class="k">if</span> <span class="n">entry</span><span class="p">.</span><span class="n">Name</span> <span class="p">==</span> <span class="s">""</span> <span class="p">{</span>
</span><span class="line">      <span class="n">entry</span><span class="p">.</span><span class="n">Name</span> <span class="p">=</span> <span class="s">"Some dummy who forgot a name"</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">  <span class="k">if</span> <span class="n">entry</span><span class="p">.</span><span class="n">Message</span> <span class="p">==</span> <span class="s">""</span> <span class="p">{</span>
</span><span class="line">      <span class="n">entry</span><span class="p">.</span><span class="n">Message</span> <span class="p">=</span> <span class="s">"Some dummy who forgot a message."</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">s</span> <span class="p">:=</span> <span class="n">session</span><span class="p">.</span><span class="n">Clone</span><span class="p">()</span>
</span><span class="line">  <span class="k">defer</span> <span class="n">s</span><span class="p">.</span><span class="n">Close</span><span class="p">()</span>
</span><span class="line">
</span><span class="line">  <span class="n">coll</span> <span class="p">:=</span> <span class="n">s</span><span class="p">.</span><span class="n">DB</span><span class="p">(</span><span class="s">"gostbook"</span><span class="p">).</span><span class="n">C</span><span class="p">(</span><span class="s">"entries"</span><span class="p">)</span>
</span><span class="line">  <span class="k">if</span> <span class="n">err</span> <span class="p">:=</span> <span class="n">coll</span><span class="p">.</span><span class="n">Insert</span><span class="p">(</span><span class="n">entry</span><span class="p">);</span> <span class="n">err</span> <span class="p">!=</span> <span class="n">nil</span> <span class="p">{</span>
</span><span class="line">      <span class="n">http</span><span class="p">.</span><span class="n">Error</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">err</span><span class="p">.</span><span class="n">Error</span><span class="p">(),</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusInternalServerError</span><span class="p">)</span>
</span><span class="line">      <span class="k">return</span>
</span><span class="line">  <span class="p">}</span>
</span><span class="line">
</span><span class="line">  <span class="n">http</span><span class="p">.</span><span class="n">Redirect</span><span class="p">(</span><span class="n">w</span><span class="p">,</span> <span class="n">req</span><span class="p">,</span> <span class="s">"/"</span><span class="p">,</span> <span class="n">http</span><span class="p">.</span><span class="n">StatusTemporaryRedirect</span><span class="p">)</span>
</span><span class="line"><span class="p">}</span>
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>All we need to do is add a single line to main.go to make it handle the new
handler:</p>

<pre><code>http.HandleFunc("/sign", sign)
</code></pre>

<p>And we can sign, and view our guestbook. Lets commit again.</p>

<h2>Some issues</h2>

<p>Now the astute reader will notice a couple little pain points.</p>

<ul>
<li><p>We had to check in the <code>sign</code> handler if the method was <code>POST</code>. This can
be fixed by using a more sophisticated muxer than the built in one in <a href="http://golang.org/pkg/net/http">net/http</a>.
Like all good packages in Go, all of these things are just interfaces and so you
can swap them out with many community driven packages. An exellent one is the
gorilla muxer at <a href="http://go.pkgdoc.org/code.google.com/p/gorilla/mux">code.google.com/p/gorilla/mux</a>.</p></li>
<li><p>We had to hard code the urls. Once again, this is solved by using a more
sophisticated muxer. <a href="http://go.pkgdoc.org/code.google.com/p/gorilla/mux">code.google.com/p/gorilla/mux</a> supports building urls
from names you give to the routes.</p></li>
<li><p>Boilerplate in the handlers to specify a database/collection every time.
I typically solve this how I wrote earlier by making a type that implements
the <code>ServeHTTP</code> method and passes in a request context containing everything
I need to use for that request, including sessions and database connections.
It’s only a couple lines of code to make, but outside the scope of this
post.</p></li>
</ul>


<p>Other than that, I found it to be pretty painless and about as easy to do as
the Flask version. Considering this is a statically typed compiled language,
that’s quite the feat.</p>

<h2>Deployment</h2>

<p>It wouldn’t be useful if it wasn’t deployed. Fortunately, Go compiles down into
a static binary. This can be shipped to any system that it was compiled for, and
just ran. Go also allows you to easily cross compile for any system, so thats a
non-issue as well. The built in web server is comparable in performance to things
like Apache and nginx from my tests. So for most cases, it’s as simple as running
a binary and either proxy passing it through from your front end server, or just
letting the world hit it directly.</p>

<p>But, since that’s not cool enough, we’re also going to deploy on <a href="http://heroku.com">Heroku</a>.</p>

<h2>Buildpacks and a Note About Getting Code</h2>

<p>Unfortunately, Go isn’t a supported platform on Heroku. Fortunately, it’s just
a buildpack away. The Cedar stack is excellent and allows you to run any binary
you want to host your web site, so we just have to tell Heroku how to build our
code. I’m a little biased so I’m going to use the <a href="http://github.com/zeebo/buildpack">buildpack I modified</a>
to do this, although there are <a href="http://github.com/kr/heroku-buildpack-go">alternatives</a>.</p>

<p>The cool part about hosting our code on github is that anyone with Go installed
can just grab it with a single command:</p>

<pre><code>go get github.com/zeebo/gostbook
</code></pre>

<p>That will download, compile, and install a binary named “gostbook” in our bin
directory in our GOPATH. The buildpack I created uses this to build the code
we’ll be deploying. First we make a little file that describes how to do it,
and a Procfile to describe what to run:</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>.heroku </span>&lt;/figcaption&gt;
<div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
</pre></td><td class="code"><pre><code class=""><span class="line">BASE=github.com/zeebo/gostbook
</span><span class="line">+ github.com/zeebo/gostbook</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;




&lt;figure class="code"&gt;&lt;figcaption&gt;<span>Procfile </span>&lt;/figcaption&gt;
<div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
</pre></td><td class="code"><pre><code class=""><span class="line">web: bin/gostbook</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>Then we have to be nice and listen on the port Heroku tells us to. This is
a one line change:</p>

<pre><code>if err = http.ListenAndServe(":"+os.Getenv("PORT"), nil); err != nil {
</code></pre>

<p>Lastly, we have to dail out to the mongo config they ask too:</p>

<pre><code>session, err = mgo.Dial(os.Getenv("DATABASE_URL"))
</code></pre>

<p>I use <code>DATABASE_URL</code> as the key. We’ll have to set it later in the deployment.
Let’s commit that.</p>

<h2>Deployment (again)</h2>

<p>Lets create the heroku app.</p>

<pre><code>$ heroku create --stack cedar --buildpack http://github.com/zeebo/buildpack.git
Creating tranquil-refuge-9104... done, stack is cedar
http://tranquil-refuge-9104.herokuapp.com/ | git@heroku.com:tranquil-refuge-9104.git
Git remote heroku added
</code></pre>

<p>Add in a free mongo database and configure the <code>DATABASE_URL</code>:</p>

<pre><code>$ heroku addons:add mongolab:starter
-----&gt; Adding mongolab:starter to tranquil-refuge-9104... done, v3 (free)
       Welcome to MongoLab.
$ heroku config
BUILDPACK_URL =&gt; http://github.com/zeebo/buildpack.git
MONGOLAB_URI  =&gt; ...snip...
$ heroku config:add DATABASE_URL=...snip...
Adding config vars and restarting app... done, v4
  DATABASE_URL =&gt; ...snip...
</code></pre>

<p>If I was smarter, I would have just used <code>MONGOLAB_URI</code> in the code, but I’m not
so here we are. Finally, we can just push it up and watch the magic:</p>

<pre><code>$ git push heroku master
Counting objects: 24, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (21/21), done.
Writing objects: 100% (24/24), 3.41 KiB, done.
Total 24 (delta 4), reused 0 (delta 0)

-----&gt; Heroku receiving push
-----&gt; Fetching custom buildpack... done
-----&gt; Go app detected
-----&gt; Configuration
       GO_VERSION=go1.0.2
       BASE=github.com/zeebo/gostbook
       + github.com/zeebo/gostbook
-----&gt; Using Go go1.0.2.linux-amd64
-----&gt; Fetching Go go1.0.2.linux-amd64
-----&gt; Checking for Mercurial and Bazaar
       Fetching hg and bzr
       ..snip...
       Successfully installed mercurial
       ...snip...
       Successfully installed bzr
       Cleaning up...
-----&gt; Running go get -u -v all
-----&gt; Copying sources into GOPATH/src/github.com/zeebo/gostbook
-----&gt; Running go get -v github.com/zeebo/gostbook
       Fetching https://labix.org/v2/mgo?go-get=1
       Parsing meta tags from https://labix.org/v2/mgo?go-get=1 (status code 200)
       get "labix.org/v2/mgo": found meta tag main.metaImport{Prefix:"labix.org/v2/mgo", VCS:"bzr", RepoRoot:"https://launchpad.net/mgo/v2"} at https://labix.org/v2/mgo?go-get=1
       labix.org/v2/mgo (download)
       Fetching https://labix.org/v2/mgo/bson?go-get=1
       Parsing meta tags from https://labix.org/v2/mgo/bson?go-get=1 (status code 200)
       get "labix.org/v2/mgo/bson": found meta tag main.metaImport{Prefix:"labix.org/v2/mgo", VCS:"bzr", RepoRoot:"https://launchpad.net/mgo/v2"} at https://labix.org/v2/mgo/bson?go-get=1
       get "labix.org/v2/mgo/bson": verifying non-authoritative meta tag
       Fetching https://labix.org/v2/mgo?go-get=1
       Parsing meta tags from https://labix.org/v2/mgo?go-get=1 (status code 200)
       labix.org/v2/mgo/bson
       labix.org/v2/mgo
       github.com/zeebo/gostbook
-----&gt; Discovering process types
       Procfile declares types -&gt; web
-----&gt; Compiled slug size is 1.4MB
-----&gt; Launching... done, v6
       http://tranquil-refuge-9104.herokuapp.com deployed to Heroku

To git@heroku.com:tranquil-refuge-9104.git
 * [new branch]      master -&gt; master
</code></pre>

<p>And we have a nice guestbook at <a href="http://tranquil-refuge-9104.herokuapp.com">http://tranquil-refuge-9104.herokuapp.com</a></p>

<h2>A snag</h2>

<p>It seems like the database name is specified by the host in this case. We can’t
just go and create whatever database we want. So we have to update the code to
grab this information and use it when we’re making queries. The patch to fix it
was pretty easy. Just add a global variable and parse the URL to put the database
into it.</p>

&lt;figure class="code"&gt;&lt;figcaption&gt;<span>commit.diff </span>&lt;/figcaption&gt;
 <div class="highlight"><table><tbody><tr><td class="gutter"><pre class="line-numbers"><span class="line-number">1</span>
<span class="line-number">2</span>
<span class="line-number">3</span>
<span class="line-number">4</span>
<span class="line-number">5</span>
<span class="line-number">6</span>
<span class="line-number">7</span>
<span class="line-number">8</span>
<span class="line-number">9</span>
<span class="line-number">10</span>
<span class="line-number">11</span>
<span class="line-number">12</span>
<span class="line-number">13</span>
<span class="line-number">14</span>
<span class="line-number">15</span>
<span class="line-number">16</span>
<span class="line-number">17</span>
<span class="line-number">18</span>
<span class="line-number">19</span>
<span class="line-number">20</span>
<span class="line-number">21</span>
<span class="line-number">22</span>
<span class="line-number">23</span>
<span class="line-number">24</span>
<span class="line-number">25</span>
<span class="line-number">26</span>
<span class="line-number">27</span>
<span class="line-number">28</span>
<span class="line-number">29</span>
<span class="line-number">30</span>
<span class="line-number">31</span>
<span class="line-number">32</span>
<span class="line-number">33</span>
<span class="line-number">34</span>
<span class="line-number">35</span>
<span class="line-number">36</span>
<span class="line-number">37</span>
<span class="line-number">38</span>
<span class="line-number">39</span>
<span class="line-number">40</span>
<span class="line-number">41</span>
<span class="line-number">42</span>
<span class="line-number">43</span>
<span class="line-number">44</span>
<span class="line-number">45</span>
<span class="line-number">46</span>
<span class="line-number">47</span>
<span class="line-number">48</span>
<span class="line-number">49</span>
<span class="line-number">50</span>
<span class="line-number">51</span>
<span class="line-number">52</span>
<span class="line-number">53</span>
</pre></td><td class="code"><pre><code class="diff"><span class="line"><span class="gh">diff --git a/main.go b/main.go</span>
</span><span class="line"><span class="gh">index 6094df8..eea1565 100644</span>
</span><span class="line"><span class="gd">--- a/main.go</span>
</span><span class="line"><span class="gi">+++ b/main.go</span>
</span><span class="line"><span class="gu">@@ -4,6 +4,7 @@ import (</span>
</span><span class="line">  "html/template"
</span><span class="line">  "labix.org/v2/mgo"
</span><span class="line">  "net/http"
</span><span class="line"><span class="gi">+    "net/url"</span>
</span><span class="line">  "os"
</span><span class="line"> )
</span><span class="line">
</span><span class="line"><span class="gu">@@ -19,7 +20,7 @@ func hello(w http.ResponseWriter, req *http.Request) {</span>
</span><span class="line">  defer s.Close()
</span><span class="line">
</span><span class="line">  //set up the collection and query
</span><span class="line"><span class="gd">-    coll := s.DB("gostbook").C("entries")</span>
</span><span class="line"><span class="gi">+    coll := s.DB(database).C("entries")</span>
</span><span class="line">  query := coll.Find(nil).Sort("-timestamp")
</span><span class="line">
</span><span class="line">  //execute the query
</span><span class="line"><span class="gu">@@ -38,10 +39,17 @@ func hello(w http.ResponseWriter, req *http.Request) {</span>
</span><span class="line"> }
</span><span class="line">
</span><span class="line"> var session *mgo.Session
</span><span class="line"><span class="gi">+var database string</span>
</span><span class="line">
</span><span class="line"> func main() {
</span><span class="line">  var err error
</span><span class="line"><span class="gd">-    session, err = mgo.Dial(os.Getenv("DATABASE_URL"))</span>
</span><span class="line"><span class="gi">+    u := os.Getenv("DATABASE_URL")</span>
</span><span class="line"><span class="gi">+    parsed, err := url.Parse(u)</span>
</span><span class="line"><span class="gi">+    if err != nil {</span>
</span><span class="line"><span class="gi">+        panic(err)</span>
</span><span class="line"><span class="gi">+    }</span>
</span><span class="line"><span class="gi">+    database = parsed.Path[1:]</span>
</span><span class="line"><span class="gi">+    session, err = mgo.Dial(u)</span>
</span><span class="line">  if err != nil {
</span><span class="line">      panic(err)
</span><span class="line">  }
</span><span class="line"><span class="gh">diff --git a/sign.go b/sign.go</span>
</span><span class="line"><span class="gh">index a5b6cd0..c3ddbda 100644</span>
</span><span class="line"><span class="gd">--- a/sign.go</span>
</span><span class="line"><span class="gi">+++ b/sign.go</span>
</span><span class="line"><span class="gu">@@ -23,7 +23,7 @@ func sign(w http.ResponseWriter, req *http.Request) {</span>
</span><span class="line">  s := session.Clone()
</span><span class="line">  defer s.Close()
</span><span class="line">
</span><span class="line"><span class="gd">-    coll := s.DB("gostbook").C("entries")</span>
</span><span class="line"><span class="gi">+    coll := s.DB(database).C("entries")</span>
</span><span class="line">  if err := coll.Insert(entry); err != nil {
</span><span class="line">      http.Error(w, err.Error(), http.StatusInternalServerError)
</span><span class="line">      return
</span></code></pre></td></tr></tbody></table></div>&lt;/figure&gt;


<p>We just rely on the <a href="http://golang.org/pkg/net/url">net/url</a> package to parse the url and grab the database
out of the path argument. Since the path contains the leading forward slash, we
just slice that off. All thats left is a redeploy:</p>

<pre><code>$ git add .
$ git commit -m 'fixes for database'
[master 2b4bf78] fixes for database
 2 files changed, 11 insertions(+), 3 deletions(-)
$ git push heroku master
Counting objects: 7, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 493 bytes, done.
Total 4 (delta 3), reused 0 (delta 0)

-----&gt; Heroku receiving push
-----&gt; Fetching custom buildpack... done
-----&gt; Go app detected
-----&gt; Configuration
       GO_VERSION=go1.0.2
       BASE=github.com/zeebo/gostbook
       + github.com/zeebo/gostbook
-----&gt; Using Go go1.0.2.linux-amd64
-----&gt; Checking for Mercurial and Bazaar
       /app/tmp/repo.git/.cache/venv/bin/hg
       /app/tmp/repo.git/.cache/venv/bin/bzr
-----&gt; Running go get -u -v all
-----&gt; Copying sources into GOPATH/src/github.com/zeebo/gostbook
-----&gt; Running go get -v github.com/zeebo/gostbook
       github.com/zeebo/gostbook
-----&gt; Discovering process types
       Procfile declares types -&gt; web
-----&gt; Compiled slug size is 1.4MB
-----&gt; Launching... done, v7
       http://tranquil-refuge-9104.herokuapp.com deployed to Heroku

To git@heroku.com:tranquil-refuge-9104.git
   52a2171..2b4bf78  master -&gt; master
</code></pre>

<p>And to my surprise, it worked on the second try!</p>

<h2>Closing remarks</h2>

<p>I hope this post showed some of what can be done with Go. In little time and
code I was able to construct that awesome 1997 guestbook. This just scratched
the surface of the cool stuff going on in the Go ecosystem. There’s <a href="http://github.com/nsf/gocode">code competion</a>,
<a href="http://github.com/DisposaBoy/GoSublime">sublime text integration</a>, <a href="http://go.pkgdoc.org">hosted automatically generated documentation</a>, and
<a href="http://goci.me">continuous integration</a>. The Go tool is awesome and able to build the vast majority
of Go code that lives anywhere with one command. I highly recommend looking into
Go for your next project.</p></div>
    </content>
    <updated>2012-07-30T15:43:00Z</updated>
    <source>
      <id>http://shadynasty.biz/</id>
      <author>
        <name>Jeff Wendling</name>
      </author>
      <link href="http://shadynasty.biz/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://shadynasty.biz/" rel="alternate" type="text/html"/>
      <title>Shadynasty Business</title>
      <updated>2012-09-06T11:21:44Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-4231555851100728707</id>
    <link href="http://reneefrench.blogspot.com/feeds/4231555851100728707/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=4231555851100728707" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4231555851100728707" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4231555851100728707" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/07/blog-post_28.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-4Q-1Hk6ytLk/UBTesj9vwmI/AAAAAAAAFC0/LWatpO428ts/s1600/notanipple.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-4Q-1Hk6ytLk/UBTesj9vwmI/AAAAAAAAFC0/LWatpO428ts/s320/notanipple.jpg" width="312"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-4231555851100728707?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-07-29T06:56:54Z</updated>
    <published>2012-07-29T06:56:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-8232990251667260806</id>
    <link href="http://reneefrench.blogspot.com/feeds/8232990251667260806/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=8232990251667260806" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8232990251667260806" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8232990251667260806" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/07/blog-post_27.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-4mUp5y3OXE8/UBM7uelQseI/AAAAAAAAFCI/vjmkNb97qSQ/s1600/fragssenna.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-4mUp5y3OXE8/UBM7uelQseI/AAAAAAAAFCI/vjmkNb97qSQ/s320/fragssenna.jpg" width="306"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-8232990251667260806?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-07-28T01:09:17Z</updated>
    <published>2012-07-28T01:09:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-2336426060666691082</id>
    <link href="http://reneefrench.blogspot.com/feeds/2336426060666691082/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=2336426060666691082" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2336426060666691082" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2336426060666691082" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/07/blog-post_23.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-KJBPZvUr_EU/UA38e_MYTiI/AAAAAAAAFAA/Qn9R43omx-I/s1600/bjornstranduw.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-KJBPZvUr_EU/UA38e_MYTiI/AAAAAAAAFAA/Qn9R43omx-I/s320/bjornstranduw.jpg" width="288"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-2336426060666691082?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-07-24T01:38:07Z</updated>
    <published>2012-07-24T01:38:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-6061563854466468137</id>
    <link href="http://reneefrench.blogspot.com/feeds/6061563854466468137/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=6061563854466468137" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6061563854466468137" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6061563854466468137" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/07/blog-post_20.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-2oZxNC79RCs/UAo3N3jQdYI/AAAAAAAAE_w/uUCBhX-awPU/s1600/bjornstrandannex2g.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-2oZxNC79RCs/UAo3N3jQdYI/AAAAAAAAE_w/uUCBhX-awPU/s320/bjornstrandannex2g.jpg" width="309"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-6061563854466468137?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-07-21T04:59:40Z</updated>
    <published>2012-07-21T04:59:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/07/20/sslbypassrates</id>
    <link href="http://www.imperialviolet.org/2012/07/20/sslbypassrates.html" rel="alternate" type="text/html"/>
    <title>SSL interstitial bypass rates</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>In <a href="http://www.imperialviolet.org/2012/07/19/hope9talk.html">yesterday's post</a> I threw in the following that I've been asked to clarify:</p>

<p><i>“we know that those bypass buttons are clicked 60% of the time by Chrome users”</i></p>

<p>Chrome collects anonymous statistics from users who opt in to such collection (and thank you to those who do!). One of those statistics covers how frequently people bypass SSL interstitials. (As always, the <a href="http://www.google.com/chrome/intl/en/privacy.html">Chrome privacy policy</a> has the details.)</p>

<p>We define bypassing the interstitial as clicking the ‘Proceed anyway’ button and not bypassing as either closing the tab, navigating elsewhere, or clicking the ‘Back’ button.</p>

<p>I picked five days at random over the past six weeks and averaged the percentages of the time that users bypassed rather than not. That came to 61.6%.</p>

<p>There may be some biases here: we may have a biased population because we only include users who have opted in to statistics collection. We are also counting all interstitals: there may be a small number of users who bypass a lot of SSL errors. But that's the data that we have.</p></div>
    </content>
    <updated>2012-07-20T07:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/07/19/hope9talk</id>
    <link href="http://www.imperialviolet.org/2012/07/19/hope9talk.html" rel="alternate" type="text/html"/>
    <title>Living with HTTPS</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>(<i>These are my notes from the first half of my talk at <a href="http://www.hopenumbernine.net/">HOPE9</a> last weekend. I write notes like these not as a script, but so that I have at least some words ready in my head when I'm speaking. They are more conversational and less organised than a usual blog post, so please forgive me the rough edges.</i>)</p>

<p>HTTPS tends to cause people to give talks mocking certificate security and the ecosystem around it. Perhaps that's well deserved, but that's not what this talk is about. If you want to have fun at the expense of CAs, dig up one of Moxie's talks. This talk deals with the fact that your HTTPS site, and the sites that you use, probably don't even reach the level where you get to start worrying about certificates.</p>

<p>I'm a transport security person so the model for this talk is that we have two computers talking over a malicious network. We assume that the computers themselves are honest and uncompromised. That might be a stretch in these malware-ridden times, but that's the area of host security and I'm not talking about that today. The network can drop, alter or fabricate packets at will. As a lemma, we also assume that the network can cause the browser to load any URL it wishes. The network can do this by inserting HTML into any HTTP request and we assume that every user makes some unencrypted requests while browsing.</p>

<h4>Stripping</h4>

<p>If the average user typed <tt>mail.google.com</tt> into a browser and saw the following, what fraction of them do you think would login, none the wiser?</p>

<img src="http://www.imperialviolet.org/binary/hope9/hope-hsts-small.png"/>

<p>Can you even see what's terribly wrong here?</p>

<p>The problem is that the page isn't served over HTTPS. It should have been, but when a user types a hostname into a browser, the default scheme is HTTP. The server may attempt to redirect users to HTTPS, but that redirect is insecure: a MITM attacker can rewrite it and keep the user on HTTP, spoofing the real site the whole time. The attacker can now intercept all the traffic to this perfectly well configured and secure website.</p>

<p>This is called SSL stripping and it's terribly simple and devastatingly effective. We probably don't see it very often because it's not something that corporate proxies need to do, so it's not in off-the-shelf devices. But that respite is unlikely to last very long and maybe it's already over: how would we even know if it was being used?</p>

<p>In order to stop SSL stripping, we need to make HTTPS the only protocol. We can't do that for the whole Internet, but we can do it site-by-site with <a href="https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security">HTTP Strict Transport Security</a> (HSTS).</p>

<p>HSTS tells browsers to always make requests over HTTPS to HSTS sites. Sites become HSTS either by being built into the browser, or by advertising a header:</p>

<p><tt>Strict-Transport-Security: max-age=8640000; includeSubDomains</tt></p>

<p>The header is in force for the given number of seconds and may also apply to all subdomains. The header must be received over a clean HTTPS connection.</p>

<p>Once the browser knows that a site is HTTPS only, the user typing <tt>mail.google.com</tt> is safe: the initial request uses HTTPS and there's no hole for an attacker to exploit.</p>

<p>(<tt>mail.google.com</tt> and a number of other sites are already built into Chrome as HSTS sites so it's not actually possible to access <tt>accounts.google.com</tt> over HTTP with Chrome - I had to doctor that image! If you want to be included in Chrome's built-in HSTS list, email me.)</p>

<p>HSTS can also protect you, the webmaster, from making silly mistakes. Let's assume that you've told your mother that she should always type <tt>https://</tt> before going to her banking site or maybe you setup a bookmark for her. That's honestly more than we can, or should, expect of our users. But let's say that our supererogatory user enters <tt>https://www.citibank.com</tt> in order to securely connect to her bank. What happens? Well, <tt>https://www.citibank.com</tt> redirects her to <tt>http://www.citibank.com</tt>. They've downgraded the user! From there, the HTTP site should redirect back to HTTPS, but the damage has been done. An attacker can get in through the hole.</p>

<p>I'm honestly not picking on Citibank here. They were simply the second site that I tried and I was some surprised that the first site didn't have the problem. It's a very easy mistake to make, and everything just works! It's a completely silent disaster! But HSTS would have either prevented it, or would have failed closed.</p>

<p>HSTS also does something else. It turns this:</p>

<img src="http://www.imperialviolet.org/binary/hope9/hope-bad-cert-small.png"/>

<p>Into this:</p>

<img src="http://www.imperialviolet.org/binary/hope9/hope-bad-cert-hsts-small.png"/>

<p>The “bypass this certificate error” button has gone. That button is a UI disaster. Asking regular people to evaluate the validity of X.509 certificates is insane. It's a security cop-out that we're saddled with, and which is causing real damage.</p>

<p>We've seen widespread MITM attacks using invalid certificates <a href="https://www.eff.org/deeplinks/2011/05/syrian-man-middle-against-facebook">in Syria</a> and, in recent weeks, <a href="https://blog.torproject.org/blog/security-vulnerability-found-cyberoam-dpi-devices-cve-2012-3372">Jordan</a>. These attacks are invalid! This is squarely within our threat model for transport security and it shouldn't have been a risk for anybody. But we know that those bypass buttons are clicked 60% of the time by Chrome users. People are certainly habituated to clicking them and I bet that a large number of people were victims of attacks that we should have been able to prevent.</p>

<p>If you take only one thing away from this talk, HSTS should be it.</p>

<h4>Mixed scripting</h4>

<p>One we're sorted HSTS we have another problem. These snippets of HTML are gaping wide holes in your security:</p>

<pre>&lt;script src="http://...

&lt;link href="http://...

&lt;embed src="http://...</pre>

<p>It's called mixed scripting and it happens when a secure site loads critical sub-resources over HTTP. It's a subset of mixed content: mixed content covers loading any sub-resource insecurely. Mixed content is bad, but when the resource is Javascript, CSS, or a plugin we give is another name to make it clear that its a lot more damaging.</p>

<p>When you load sub-resources over HTTP, an attacker can replace them with content of their choosing. The attacker also gets to choose <i>any</i> page on your HTTPS site with the problem. That includes pages that you don't expect to be served over HTTPS, but happen to be mapped. If you have this problem anywhere, on any HTTPS page, the attacker wins.</p>

<p>With complex sites, it's very difficult to ensure that this doesn't happen. One good way to limit it is to only serve over HTTPS so that there aren't any pages that you expect to serve over HTTP. Also, HSTS might also save you if you're loading mixed script from the same domain.</p>

<p>Another mitigation is to use scheme-relative URLs everywhere possible. These URLs look like <tt>//example.com/bar.js</tt> and are valid in all browsers. They inherit the scheme of the parent page, which will be HTTP or HTTPS as needed. (Although it does mean that if you load the page from disk then things will break. The scheme will be <tt>file://</tt> in that case.)</p>

<p>Fundamentally this is such an easy mistake to make, and such a problem, that the only long term solution is for browsers to stop loading insecure Javascript, CSS and plugins for HTTPS sites. To their credit, IE9 does this and did it before Chrome. But I'm glad to say that Chrome has caught up and mixed scripting is now blocked by default, although with a user-override:</p>

<img src="http://www.imperialviolet.org/binary/hope9/hope-mixedscript.png"/>

<p>Yes, there's another of those damm bypass buttons. But we swear that it's just a transitional strategy and it already stops silent exploitation in a hidden iframe.</p>

<h4>Cookies</h4>

<p>HTTP and HTTPS cookie jars are the same. No really: cookies aren't scoped to a protocol! That means that if you set a Cookie on <tt>https://example.com</tt> and then make a request to <tt>http://example.com</tt>, the cookies will be sent in the clear! In order to prevent this, you should be setting <tt>secure</tt> on your HTTPS cookies. Sadly this is a very easy thing to miss because everything will still work if you omit it, but without the <tt>secure</tt> tag, attackers can easily steal your cookies.</p>

<p>It's worth noting that HSTS can protect you from this: by preventing the HTTP request from being sent, the cookies can't be leaked that way, but you'll need to include all subdomains in the HSTS coverage.</p>

<p>There's a second corollary to this: attackers can <i>set</i> your HTTPS cookies to. By causing an request to be sent to <tt>http://example.com</tt>, they can spoof a reply with cookies that then override any existing cookies. In this fashion, an attacker can log a user in as themselves during their interaction with an HTTPS site. Then, say, emails that they send will be saved in the attacker's out-box.</p>

<p>There's no very good protection against this except HSTS again. By preventing any HTTP requests you can stop the attacker from spoofing a reply to set the cookies. Against, HSTS needs to cover all subdomains in order to be effective against this.</p>

<h4>Get yourself checked out</h4>

<p>You should go to <tt><a href="https://www.ssllabs.com">https://www.ssllabs.com</a></tt> and run their scan against your site. It's very good, but ignore it if it complains about the BEAST attack. It'll do so if you make a CBC ciphersuite your top preference. Browsers have worked around BEAST and non-browser clients are very unlikely to provide the attacker enough access to be able to pull it off. You have a limited amount of resources to address HTTPS issues and I don't think BEAST should make the list.</p>

<h4>Get a real certificate</h4>

<p>You should get a real certificate. You probably already have one but, if you don't, then you're just training more people to ignore certificate errors and you can't have HSTS without a real certificate. StartSSL give them away for free. Get one.</p>

<p>If you've reached this far and have done all of the above, congratulations: you're in the top 0.1% of HTTPS sites. If you're getting bored, this is a reasonable point to stop reading: everything else is just bonus points from now on.</p>

<h4>Forward secrecy</h4>

<p>You should consider forward secrecy. Forward secrecy means that the keys for a connection aren't stored on disk. You might have limited the amount of information that you log in order to protect the privacy of your users, but if you don't have forward secrecy then your private key is capable of decrypting all past connections. Someone else might be doing the logging for you.</p>

<p>In order to enable forward secrecy you need to have DHE or ECDHE ciphersuites as your top preference. DHE ciphersuites are somewhat expensive if you're terminating lots of SSL connections and you should be aware that your server will probably only allow 1024-bit DHE. I think 1024-bit DHE-RSA is preferable to 2048-bit RSA, but opinions vary. If you're using ECDHE, use P-256.</p>

<p>You also need to be aware of Session Tickets in order to implement forward secrecy correctly. There are two ways to resume a TLS connection: either the server chooses a random number and both sides store the session information, of the server can encrypt the session information with a secret, local key and send that to the client. The former is called Session IDs and the latter is called Session Tickets.</p>

<p>But Session Tickets are transmitted over the wire and so the server's Session Ticket encryption key is capable of decrypting past connections. Most servers will generate a random Session Ticket key at startup unless otherwise configured, but you should check.</p>

<p>I'm not going to take the time to detail how to configure this here. There are lots of webservers and it would take a while. This is more of a pointer so that you can go away and research it if you wish.</p>

<p>(<i>The rest of the talk touched on OpenSSL speed, <a href="http://www.imperialviolet.org/2011/05/04/pinning.html">public key pinning</a>, <a href="http://www.imperialviolet.org/2012/06/08/tlsversions.html">TLS 1.1 and 1.2</a> and a few other matters, but I did those bits mostly on the fly and don't have notes for them.</i>)</p></div>
    </content>
    <updated>2012-07-19T07:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-8205032367690879412</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/8205032367690879412" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/8205032367690879412" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2012/07/gccgo-in-gcc-471.html" rel="alternate" type="text/html"/>
    <title>Gccgo in GCC 4.7.1</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The Go language has always been defined by a <a href="http://golang.org/ref/spec">spec</a>, not an implementation.  The Go team has written two different compilers that implement that spec: gc and gccgo.  Having two different implementations helps ensure that the spec is complete and correct: when the compilers disagree, we fix the spec, and change one or both compilers accordingly.  Gc is the original compiler, and the go tool uses it by default.  Gccgo is a different implementation with a different focus, and in this post we’ll take a closer look at it.<br/><br/>Gccgo is distributed as part of GCC, the GNU Compiler Collection.  GCC supports several different frontends for different languages; gccgo is a Go frontend connected to the GCC backend.  The Go frontend is separate from the GCC project and is designed to be able to connect to other compiler backends, but currently only supports GCC.<br/><br/>Compared to gc, gccgo is slower to compile code but supports more powerful optimizations, so a CPU-bound program built by gccgo will usually run faster.  All the optimizations implemented in GCC over the years are available, including inlining, loop optimizations, vectorization, instruction scheduling, and more.  While it does not always produce better code, in some cases programs compiled with gccgo can run 30% faster.<br/><br/>The gc compiler supports only the most popular processors: x86 (32-bit and 64-bit) and ARM.  Gccgo, however, supports all the processors that GCC supports.  Not all those processors have been thoroughly tested for gccgo, but many have, including x86 (32-bit and 64-bit), SPARC, MIPS, PowerPC and even Alpha.  Gccgo has also been tested on operating systems that the gc compiler does not support, notably Solaris.<br/><br/>Gccgo provides the standard, complete Go library.  Many of the core features of the Go runtime are the same in both gccgo and gc, including the goroutine scheduler, channels, the memory allocator, and the garbage collector.  Gccgo supports splitting goroutine stacks as the gc compiler does, but currently only on x86 (32-bit or 64-bit) and only when using the gold linker (on other processors, each goroutine will have a large stack, and a deep series of function calls may run past the end of the stack and crash the program).<br/><br/>Gccgo distributions do not yet include a version of the go command.  However, if you install the go command from a standard Go release, it already supports gccgo via the <code>-compiler</code> option: go build <code>-compiler gccgo myprog</code>.  The tools used for calls between Go and C/C++, cgo and SWIG, also support gccgo.<br/><br/>We have put the Go frontend under the same BSD license as the rest of the Go tools.  You can download the source code for the frontend at the <a href="http://code.google.com/p/gofrontend">gofrontend Google Code project</a>. Note that when the Go frontend is linked with the GCC backend to make gccgo, GCC’s GPL license takes precedence.<br/><br/>The latest release of GCC, 4.7.1, includes gccgo with support for Go 1.  If you need better performance for CPU-bound Go programs, or you need to support processors or operating systems that the gc compiler does not support, gccgo might be the answer.<br/><br/><i>by Ian Lance Taylor</i><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-8205032367690879412?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-07-11T17:04:24Z</updated>
    <published>2012-07-11T17:04:00Z</published>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-3400863648278513873</id>
    <link href="http://reneefrench.blogspot.com/feeds/3400863648278513873/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=3400863648278513873" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3400863648278513873" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3400863648278513873" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/07/blog-post_09.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-XJ4BSTYdokM/T_uIO-lN9ZI/AAAAAAAAE_Q/YiQhpcLckg4/s1600/bjornstrandbeachedbru.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-XJ4BSTYdokM/T_uIO-lN9ZI/AAAAAAAAE_Q/YiQhpcLckg4/s320/bjornstrandbeachedbru.jpg" width="290"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-3400863648278513873?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-07-10T01:41:21Z</updated>
    <published>2012-07-10T01:41:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-3075123874517708173</id>
    <link href="http://mue.tideland.biz/feeds/3075123874517708173/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/07/set-up-import-path-alias.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/3075123874517708173" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/3075123874517708173" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/07/set-up-import-path-alias.html" rel="alternate" type="text/html"/>
    <title>Set up an import path alias</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Today I set up an alias for the import path of my <i>Tideland</i> packages. How to do so is described in the documentation of the <a href="http://golang.org/cmd/go/#Remote_import_path_syntax" target="_blank">go command</a>. So I registered <a href="http://cgl.tideland.biz/">cgl.tideland.biz</a> and added the needed index and other files per package. They don't contain very much, only the meta tag<br/><br/><span style="font-family: 'Courier New', Courier, monospace;">&lt;meta name="go-import" content="cgl.tideland.biz hg https://code.google.com/p/tcgl"/&gt;</span><br/><br/>This way go get know that the real repository is hosted at <i>Google Code</i>. Beside the nice looking import path I can change the repository hoster if this is needed once.<br/><br/>Now I only have to change the import paths inside the code and push it.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-3075123874517708173?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-07-08T16:32:39Z</updated>
    <published>2012-07-08T16:32:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="alias"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="import"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="repository"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="meta"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-6609697650984356691</id>
    <link href="http://reneefrench.blogspot.com/feeds/6609697650984356691/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=6609697650984356691" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6609697650984356691" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6609697650984356691" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/07/blog-post_07.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-msXAMW-hskY/T_jV1lbIrAI/AAAAAAAAE-A/g_BzmyT1f8g/s1600/bjornstrandkite.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://1.bp.blogspot.com/-msXAMW-hskY/T_jV1lbIrAI/AAAAAAAAE-A/g_BzmyT1f8g/s320/bjornstrandkite.jpg" width="292"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-6609697650984356691?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-07-08T00:35:40Z</updated>
    <published>2012-07-08T00:35:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-4078000791987317464</id>
    <link href="http://reneefrench.blogspot.com/feeds/4078000791987317464/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=4078000791987317464" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4078000791987317464" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4078000791987317464" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/07/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-QHUpbTtWz-U/T_eIT-bPHVI/AAAAAAAAE9w/LANCtrxL5Ew/s1600/bjornstrandwater.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="316" src="http://4.bp.blogspot.com/-QHUpbTtWz-U/T_eIT-bPHVI/AAAAAAAAE9w/LANCtrxL5Ew/s320/bjornstrandwater.jpg" width="320"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-4078000791987317464?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-07-07T00:52:36Z</updated>
    <published>2012-07-07T00:52:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6983287.post-8214930309410995806</id>
    <link href="http://www.blogger.com/feeds/6983287/posts/default/8214930309410995806" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6983287/posts/default/8214930309410995806" rel="self" type="application/atom+xml"/>
    <link href="http://commandcenter.blogspot.com/2012/06/less-is-exponentially-more.html" rel="alternate" type="text/html"/>
    <title>Less is exponentially more</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>Here is the text of the talk I gave at the Go SF meeting in June, 2012.<br/><br/>This is a personal talk. I do not speak for anyone else on the Go team here, although I want to acknowledge right up front that the team is what made and continues to make Go happen. I'd also like to thank the Go SF organizers for giving me the opportunity to talk to you.<br/><br/>I was asked a few weeks ago, "What was the biggest surprise you encountered rolling out Go?" I knew the answer instantly: Although we expected C++ programmers to see Go as an alternative, instead most Go programmers come from languages like Python and Ruby. Very few come from C++.<br/><br/>We—Ken, Robert and myself—were C++ programmers when we designed a new language to solve the problems that we thought needed to be solved for the kind of software we wrote. It seems almost paradoxical that other C++ programmers don't seem to care.<br/><br/>I'd like to talk today about what prompted us to create Go, and why the result should not have surprised us like this. I promise this will be more about Go than about C++, and that if you don't know C++ you'll be able to follow along.<br/><br/>The answer can be summarized like this: Do you think less is more, or less is less?<br/><br/>Here is a metaphor, in the form of a true story.  Bell Labs centers were originally assigned three-letter numbers: 111 for Physics Research, 127 for Computing Sciences Research, and so on. In the early 1980s a memo came around announcing that as our understanding of research had grown, it had become necessary to add another digit so we could better characterize our work. So our center became 1127. Ron Hardin joked, half-seriously, that if we really understood our world better, we could drop a digit and go down from 127 to just 27. Of course management didn't get the joke, nor were they expected to, but I think there's wisdom in it. Less can be more. The better you understand, the pithier you can be.<br/><br/>Keep that idea in mind.<br/><br/>Back around September 2007, I was doing some minor but central work on an enormous Google C++ program, one you've all interacted with, and my compilations were taking about 45 minutes on our huge distributed compile cluster. An announcement came around that there was going to be a talk presented by a couple of Google employees serving on the C++ standards committee. They were going to tell us what was coming in C++0x, as it was called at the time. (It's now known as C++11).<br/><br/>In the span of an hour at that talk we heard about something like 35 new features that were being planned. In fact there were many more, but only 35 were described in the talk. Some of the features were minor, of course, but the ones in the talk were at least significant enough to call out. Some were very subtle and hard to understand, like rvalue references, while others are especially C++-like, such as variadic templates, and some others are just crazy, like user-defined literals.<br/><br/>At this point I asked myself a question: Did the C++ committee really believe that was wrong with C++ was that it didn't have enough features? Surely, in a variant of Ron Hardin's joke, it would be a greater achievement to simplify the language rather than to add to it. Of course, that's ridiculous, but keep the idea in mind.<br/><br/>Just a few months before that C++ talk I had given a talk myself, which you can see on <a href="http://video.google.com/videoplay?docid=810232012617965344" target="_blank">YouTube</a>, about a toy concurrent language I had built way back in the 1980s. That language was called <a href="ftp://cs.bell-labs.com/cm/cs/who/rsc/thread/newsqueak.pdf" target="_blank">Newsqueak</a> and of course it is a precursor to Go.<br/><br/>I gave that talk because there were ideas in Newsqueak that I missed in my work at Google and I had been thinking about them again.  I was convinced they would make it easier to write server code and Google could really benefit from that.<br/><br/>I actually tried and failed to find a way to bring the ideas to C++. It was too difficult to couple the concurrent operations with C++'s control structures, and in turn that made it too hard to see the real advantages. Plus C++ just made it all seem too cumbersome, although I admit I was never truly facile in the language. So I abandoned the idea.<br/><br/>But the C++0x talk got me thinking again.  One thing that really bothered me—and I think Ken and Robert as well—was the new C++ memory model with atomic types. It just felt wrong to put such a microscopically-defined set of details into an already over-burdened type system. It also seemed short-sighted, since it's likely that hardware will change significantly in the next decade and it would be unwise to couple the language too tightly to today's hardware.<br/><br/>We returned to our offices after the talk. I started another compilation, turned my chair around to face Robert, and started asking pointed questions. Before the compilation was done, we'd roped Ken in and had decided to do something. We did not want to be writing in C++ forever, and we—me especially—wanted to have concurrency at my fingertips when writing Google code. We also wanted to address the problem of "programming in the large" head on, about which more later.<br/><br/>We wrote on the white board a bunch of stuff that we wanted, desiderata if you will. We thought big, ignoring detailed syntax and semantics and focusing on the big picture.<br/><br/>I still have a fascinating mail thread from that week. Here are a couple of excerpts:<br/><br/>Robert: <i>Starting point: C, fix some obvious flaws, remove crud, add a few missing features.</i><br/><br/>Rob: <i>name: 'go'.  you can invent reasons for this name but it has nice properties. it's short, easy to type. tools: goc, gol, goa.  if there's an interactive debugger/interpreter it could just be called 'go'.  the suffix is .go.</i><br/><br/>Robert <i>Empty interfaces: interface {}. These are implemented by all interfaces, and thus this could take the place of void*.</i><br/><br/>We didn't figure it all out right away. For instance, it took us over a year to figure out arrays and slices. But a significant amount of the flavor of the language emerged in that first couple of days.<br/><br/>Notice that Robert said C was the starting point, not C++. I'm not certain but I believe he meant C proper, especially because Ken was there. But it's also true that, in the end, we didn't really start from C. We built from scratch, borrowing only minor things like operators and brace brackets and a few common keywords. (And of course we also borrowed ideas from other languages we knew.) In any case, I see now that we reacted to C++ by going back down to basics, breaking it all down and starting over. We weren't trying to design a better C++, or even a better C. It was to be a better language overall for the kind of software we cared about.<br/><br/>In the end of course it came out quite different from either C or C++. More different even than many realize. I made a list of significant simplifications in Go over C and C++:<br/><br/><ul><li>regular syntax (don't need a symbol table to parse)</li><li>garbage collection (only)</li><li>no header files</li><li>explicit dependencies</li><li>no circular dependencies</li><li>constants are just numbers</li><li>int and int32 are distinct types</li><li>letter case sets visibility</li><li>methods for any type (no classes)</li><li>no subtype inheritance (no subclasses)</li><li>package-level initialization and well-defined order of initialization</li><li>files compiled together in a package</li><li>package-level globals presented in any order</li><li>no arithmetic conversions (constants help)</li><li>interfaces are implicit (no "implements" declaration)</li><li>embedding (no promotion to superclass)</li><li>methods are declared as functions (no special location)</li><li>methods are just functions</li><li>interfaces are just methods (no data)</li><li>methods match by name only (not by type)</li><li>no constructors or destructors</li><li>postincrement and postdecrement are statements, not expressions</li><li>no preincrement or predecrement</li><li>assignment is not an expression</li><li>evaluation order defined in assignment, function call (no "sequence point")</li><li>no pointer arithmetic</li><li>memory is always zeroed</li><li>legal to take address of local variable</li><li>no "this" in methods</li><li>segmented stacks</li><li>no const or other type annotations</li><li>no templates</li><li>no exceptions</li><li>builtin string, slice, map</li><li>array bounds checking</li></ul><br/>And yet, with that long list of simplifications and missing pieces, Go is, I believe, more expressive than C or C++. Less can be more.<br/><br/>But you can't take out everything. You need building blocks such as an idea about how types behave, and syntax that works well in practice, and some ineffable thing that makes libraries interoperate well.<br/><br/>We also added some things that were not in C or C++, like slices and maps, composite literals, expressions at the top level of the file (which is a huge thing that mostly goes unremarked), reflection, garbage collection, and so on. Concurrency, too, naturally.<br/><br/>One thing that is conspicuously absent is of course a type hierarchy. Allow me to be rude about that for a minute.<br/><br/>Early in the rollout of Go I was told by someone that he could not imagine working in a language without generic types. As I have reported elsewhere, I found that an odd remark.<br/><br/>To be fair he was probably saying in his own way that he really liked what the STL does for him in C++. For the purpose of argument, though, let's take his claim at face value.<br/><br/>What it says is that he finds writing containers like lists of ints and maps of strings an unbearable burden. I find that an odd claim. I spend very little of my programming time struggling with those issues, even in languages without generic types.<br/><br/>But more important, what it says is that <i>types</i> are the way to lift that burden. <i>Types</i>. Not polymorphic functions or language primitives or helpers of other kinds, but <i>types</i>.<br/><br/>That's the detail that sticks with me.<br/><br/>Programmers who come to Go from C++ and Java miss the idea of programming with types, particularly inheritance and subclassing and all that. Perhaps I'm a philistine about types but I've never found that model particularly expressive.<br/><br/>My late friend Alain Fournier once told me that he considered the lowest form of academic work to be taxonomy. And you know what? Type hierarchies are just taxonomy. You need to decide what piece goes in what box, every type's parent, whether A inherits from B or B from A.  Is a sortable array an array that sorts or a sorter represented by an array? If you believe that types address all design issues you must make that decision.<br/><br/>I believe that's a preposterous way to think about programming. What matters isn't the ancestor relations between things but what they can do for you.<br/><br/>That, of course, is where interfaces come into Go. But they're part of a bigger picture, the true Go philosophy.<br/><br/>If C++ and Java are about type hierarchies and the taxonomy of types, Go is about composition.<br/><br/>Doug McIlroy, the eventual inventor of Unix pipes, wrote in 1964 (!):<br/><blockquote class="tr_bq">We should have some ways of coupling programs like garden hose--screw in another segment when it becomes necessary to massage data in another way. This is the way of IO also.</blockquote>That is the way of Go also. Go takes that idea and pushes it very far. It is a language of composition and coupling.<br/><br/>The obvious example is the way interfaces give us the composition of components. It doesn't matter what that thing is, if it implements method M I can just drop it in here.<br/><br/>Another important example is how concurrency gives us the composition of independently executing computations.<br/><br/>And there's even an unusual (and very simple) form of type composition: embedding.<br/><br/>These compositional techniques are what give Go its flavor, which is profoundly different from the flavor of C++ or Java programs.<br/><br/>===========<br/><br/>There's an unrelated aspect of Go's design I'd like to touch upon: Go was designed to help write big programs, written and maintained by big teams.<br/><br/>There's this idea about "programming in the large" and somehow C++ and Java own that domain. I believe that's just a historical accident, or perhaps an industrial accident. But the widely held belief is that it has something to do with object-oriented design.<br/><br/>I don't buy that at all. Big software needs methodology to be sure, but not nearly as much as it needs strong dependency management and clean interface abstraction and superb documentation tools, none of which is served well by C++ (although Java does noticeably better).<br/><br/>We don't know yet, because not enough software has been written in Go, but I'm confident Go will turn out to be a superb language for programming in the large. Time will tell.<br/><br/>===========<br/><br/>Now, to come back to the surprising question that opened my talk:<br/><br/>Why does Go, a language designed from the ground up for what what C++ is used for, not attract more C++ programmers?<br/><br/>Jokes aside, I think it's because Go and C++ are profoundly different philosophically.<br/><br/>C++ is about having it all there at your fingertips. I found this quote on a C++11 FAQ:<br/><blockquote class="tr_bq">The range of abstractions that C++ can express elegantly, flexibly, and at zero costs compared to hand-crafted specialized code has greatly increased.</blockquote>That way of thinking just isn't the way Go operates. Zero cost isn't a goal, at least not zero CPU cost. Go's claim is that minimizing programmer effort is a more important consideration.<br/><br/>Go isn't all-encompassing. You don't get everything built in. You don't have precise control of every nuance of execution. For instance, you don't have RAII. Instead you get a garbage collector. You don't even get a memory-freeing function.<br/><br/>What you're given is a set of powerful but easy to understand, easy to use building blocks from which you can assemble—compose—a solution to your problem. It might not end up quite as fast or as sophisticated or as ideologically motivated as the solution you'd write in some of those other languages, but it'll almost certainly be easier to write, easier to read, easier to understand, easier to maintain, and maybe safer.<br/><br/>To put it another way, oversimplifying of course:<br/><br/>Python and Ruby programmers come to Go because they don't have to surrender much expressiveness, but gain performance and get to play with concurrency.<br/><br/>C++ programmers <i>don't</i> come to Go because they have fought hard to gain exquisite control of their programming domain, and don't want to surrender any of it. To them, software isn't just about getting the job done, it's about doing it a certain way.<br/><br/>The issue, then, is that Go's success would contradict their world view.<br/><br/>And we should have realized that from the beginning. People who are excited about C++11's new features are not going to care about a language that has so much less.  Even if, in the end, it offers so much more.<br/><br/>Thank you.<br/><div><br/></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6983287-8214930309410995806?l=commandcenter.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-07-04T15:20:45Z</updated>
    <published>2012-06-25T21:35:00Z</published>
    <author>
      <name>rob</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/18259238879445421354</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6983287</id>
      <author>
        <name>rob</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/18259238879445421354</uri>
      </author>
      <link href="http://commandcenter.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6983287/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://commandcenter.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <title>command center</title>
      <updated>2012-09-23T03:33:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-8449075452479113811</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/8449075452479113811" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/8449075452479113811" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2012/07/go-videos-from-google-io-2012.html" rel="alternate" type="text/html"/>
    <title>Go videos from Google I/O 2012</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Phew! Google I/O is over for another year, and what an event it was. Thanks to our guest speakers and everyone who attended the four Go sessions. It was a lot of fun.<br/><br/>Here are the session videos:<br/><br/><b>Go concurrency patterns</b> by Rob Pike<br/><br/><i>Concurrency is the key to designing high performance network services. Go's concurrency primitives (goroutines and channels) provide a simple and efficient means of expressing concurrent execution. In this talk we see how tricky concurrency problems can be solved gracefully with simple Go code.</i><br/><br/>&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="304" src="http://www.youtube.com/embed/f6kdp27TYZs" width="540"&gt;&lt;/iframe&gt;<br/><br/><b>Go in production</b><br/><br/><i>Since Go's release in 2009 many companies (besides Google, of course) have used the language to build cool stuff. In this session Gustavo Niemeyer (Canonical), Keith Rarick (Heroku), Evan Shaw (Iron.io), and Patrick Crosby (StatHat) share their first-hand experience using Go in production environments.</i><br/><br/>&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="304" src="http://www.youtube.com/embed/kKQLhGZVN4A" width="540"&gt;&lt;/iframe&gt;<br/><br/><b>Meet the Go team</b><br/><br/><i>A panel discussion with David Symonds, Robert Griesemer, Rob Pike, Ken Thompson, Andrew Gerrand, and Brad Fitzpatrick.</i><br/><br/>&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="304" src="http://www.youtube.com/embed/sln-gJaURzk" width="540"&gt;&lt;/iframe&gt;<br/><br/><b>Computing Map Tiles with Go on App Engine</b> by Chris Broadfoot and Andrew Gerrand<br/><br/><i>In this talk we use the Maps API and Go on App Engine to build an app to build custom tile sets for Google Maps. The app demonstrates using Go's suitability for computation in the cloud and App Engine's key scalability features, such as Task Queues and Backends.</i><br/><br/>&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="304" src="http://www.youtube.com/embed/sPagpg0b7no" width="540"&gt;&lt;/iframe&gt;<br/><br/><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-8449075452479113811?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-07-02T21:43:37Z</updated>
    <published>2012-07-02T16:31:00Z</published>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://www.miek.nl/blog/archives/2012/07/01/libunbound_wrapper_in_go/index.html</id>
    <link href="http://www.miek.nl/blog/archives/2012/07/01/libunbound_wrapper_in_go/index.html" rel="alternate" type="text/html"/>
    <title>Libunbound wrapper in Go</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>I've created a small wrapper for <a href="https://unbound.net">libunbound</a> for use in <a href="http://www.golang.org">Go</a>.</p>
<p>The code can be <a href="http://github.com/miekg/unbound">found at github</a>. It depends on my Go DNS library which can be <a href="http://github.com/miekg/dns">found here</a>.</p>
<p><a href="https://unbound.nlnetlabs.nl/pipermail/unbound-users/2012-July/002431.html">Official announcement on the Unbound-users@ list</a>.</p>
<p>To give you a little taste of how it looks, I've (re)created tutorials 2 to 6 in Go. Tutorial 2 looks like this, for instance:</p>
<pre><code>package main

// https://www.unbound.net/documentation/libunbound-tutorial-2.html

import (
        "dns"
        "fmt"
        "os"
        "unbound"
)

func main() {
        u := unbound.New()
        defer u.Destroy()

        if err := u.ResolvConf("/etc/resolv.conf"); err != nil {
                fmt.Printf("error %s\n", err.Error())
                os.Exit(1)
        }

        if err := u.Hosts("/etc/hosts"); err != nil {
                fmt.Printf("error %s\n", err.Error())
                os.Exit(1)
        }

        r, err := u.Resolve("www.nlnetlabs.nl.", dns.TypeA, dns.ClassINET)
        if err != nil {
                fmt.Printf("error %s\n", err.Error())
                os.Exit(1)
        }
        fmt.Printf("%+v\n", r)
}</code></pre></div>
    </summary>
    <updated>2012-07-01T19:37:30Z</updated>
    <category term="go, dns(sec)"/>
    <author>
      <name>Miek Gieben</name>
    </author>
    <source>
      <id>http://www.miek.nl/blog</id>
      <author>
        <name>Miek Gieben</name>
      </author>
      <link href="http://www.miek.nl/blog/archives/go/index-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.miek.nl/blog" rel="alternate" type="text/html"/>
      <subtitle>Thoughts on (technical) stuff</subtitle>
      <title>Filed under: go | Miek</title>
      <updated>2012-09-17T18:42:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-6431349688872061178</id>
    <link href="http://reneefrench.blogspot.com/feeds/6431349688872061178/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=6431349688872061178" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6431349688872061178" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6431349688872061178" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/06/blog-post_30.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-JR6NZ23dh40/T-_rEjRflJI/AAAAAAAAE88/6TB1_ae7nKo/s1600/bjornstrandbuoy.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-JR6NZ23dh40/T-_rEjRflJI/AAAAAAAAE88/6TB1_ae7nKo/s320/bjornstrandbuoy.jpg" width="262"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-6431349688872061178?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-07-01T06:15:51Z</updated>
    <published>2012-07-01T06:15:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/218743631874490369</id>
    <link href="http://twitter.com/_rsc/statuses/218743631874490369" rel="alternate" type="text/html"/>
    <title>_rsc: RT @maxtaco: Golang makes working in Unicode a pleasure. In a string-heavy 1kLOC project, upgraded from naive ascii to full unicode supp ...</title>
    <summary>_rsc: RT @maxtaco: Golang makes working in Unicode a pleasure. In a string-heavy 1kLOC project, upgraded from naive ascii to full unicode supp ...</summary>
    <updated>2012-06-29T16:32:00Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-7386427935796018096</id>
    <link href="http://reneefrench.blogspot.com/feeds/7386427935796018096/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=7386427935796018096" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7386427935796018096" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7386427935796018096" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/06/blog-post_26.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-2v4pqcYBV3k/T-qO-qA4wzI/AAAAAAAAE8s/tv_RssspgCU/s1600/bjornstrandbuilt.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="314" src="http://3.bp.blogspot.com/-2v4pqcYBV3k/T-qO-qA4wzI/AAAAAAAAE8s/tv_RssspgCU/s320/bjornstrandbuilt.jpg" width="320"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-7386427935796018096?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-27T04:41:36Z</updated>
    <published>2012-06-27T04:41:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>https://sites.google.com/feeds/content/kryas.com/kryas/6236212527960689475</id>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/5119061230095011683" rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"/>
    <link href="https://sites.google.com/a/kryas.com/kryas/recent_posts/readingxmlviago" rel="alternate" type="text/html"/>
    <link href="https://sites.google.com/feeds/revision/kryas.com/kryas/6236212527960689475" rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/6236212527960689475" rel="self" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/6236212527960689475" rel="edit" type="application/atom+xml"/>
    <title>Reading XML via Go</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox"><tbody><tr><td class="sites-layout-tile sites-tile-name-content-1"><div dir="ltr"><span> </span><div style="display: inline; float: left; margin-top: 5px; margin-right: 10px; margin-bottom: 0px; margin-left: 0px;"><a href="https://sites.google.com/a/kryas.com/kryas/recent_posts/readingxmlviago/2011-06-26_23.23.03.png?attredirects=0"><img border="0" height="208" src="https://sites.google.com/a/kryas.com/kryas/_/rsrc/1340687171682/recent_posts/readingxmlviago/2011-06-26_23.23.03.png" width="400"/></a></div>My
 6 year old daughter and I play Minecraft together on occasion to pass 
the time.  We are slowly building our own little world, <div style="display: inline; margin: 5px 10px; float: right;"/>
just the two of us.  
If you are not familiar with Minecraft, the game's central premise (the 
way we play) is surviving a world filled with monsters while starting 
with nothing.  

Success usually entails finding shelter and a fire source before the sun
 sets on the first day.  After that, the excitement is pretty sparse.  
You spend a lot of time mining for resources and erecting humble 
structures.  To survive is to win.  A couple weeks ago, we were playing 
together and I think we both came to
 the conclusion we were bored.  Usually, when this happens we start
 a new world together to get through the excitement of the first night. 
 This time, however, we decided it'd be cool to design a game together. 
 So, she spent the next hour drawing pictures of how the monsters, 
foliage, sky, and people should look.  I asked questions to keep her 
creativity directed toward the goal of game design.  After that, like 
most of our projects, days came and went and I thought all was 
forgotten.<br/><br/>Fast forward to today.  I found myself trying to 
understand how to use the Go XML package to unmarshall an XML file into a
 set of types that I can use.  This was spurred by my daughter's recent 
question of, "Are you still working on our game, Daddy?"  So, today I 
was trying to read a COLLADA (3D model file) and display it into an 
OpenGL window.  My conclusion is that it isn't difficult at all.  It was
 actually easy; so easy, in fact, I felt compelled to write this post 
afterward.  This is a summary of my experience after a couple hours of 
effort.  Keep in mind, a lot of the time was directed towards 
remembering OpenGL, looking for examples to follow, and figuring out the
 COLLADA specification.  Here we focus on reading the COLLADA file.<br/><br/><i>Understanding the COLLADA</i><i> File<br/></i>The COLLADA file specification is a pretty extensive XML schema whose full specification can be found <a href="http://www.khronos.org/collada" rel="nofollow" target="_blank">here</a> and the summary that actually helped me understand it is found <a href="http://www.wazim.com/Collada_Tutorial_1.htm" rel="nofollow">here</a>. 
 In this post, I am focusing on the data I need to get to; which are 
vertices, normals, and triangles.  Here is an example file with only 
those portions I cared about remaining and the tags of particular 
interest highlighted in yellow.  <br/><br/><div class="sites-codeblock sites-codesnippet-block"><font size="3" style="color: rgb(153,153,153);"><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;</code><br/><code style="background-color: rgb(255,255,0);">&lt;COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1"&gt;</code><br/><code>  &lt;asset&gt;</code><br/><code>    &lt;contributor&gt;</code><br/><code>      &lt;author&gt;Blender User&lt;/author&gt;</code><br/><code>      &lt;authoring_tool&gt;Blender 2.58.0 r37702&lt;/authoring_tool&gt;</code><br/><code>    &lt;/contributor&gt;</code><br/><code>    &lt;created&gt;2011-07-26T02:34:24&lt;/created&gt;</code><br/><code>    &lt;modified&gt;2011-07-26T02:34:24&lt;/modified&gt;</code><br/><code>    &lt;unit name="meter" meter="1"/&gt;</code><br/><code>    &lt;up_axis&gt;Z_UP&lt;/up_axis&gt;</code><br/><code>  &lt;/asset&gt;</code><br/><code>  <span style="background-color: rgb(255,255,0);">&lt;library_geometries&gt;</span></code><br/><code>    <span style="background-color: rgb(255,255,0);">&lt;geometry id="Plane-mesh"&gt;</span></code><br/><code>      <span style="background-color: rgb(255,255,0);">&lt;mesh&gt;</span></code><br/><code>        <span style="background-color: rgb(255,255,0);">&lt;source id="Plane-mesh-positions"&gt;</span></code><br/><code>          <span style="background-color: rgb(255,255,0);">&lt;float_array
 id="Plane-mesh-positions-array" count="12"&gt;1 0.3503274 0 1 
-0.3503274 0 -1 -0.9999998 0 -0.9999997 1 0&lt;/float_array&gt;</span></code><br/><code>        &lt;/source&gt;</code><br/><code>        <span style="background-color: rgb(255,255,0);">&lt;source id="Plane-mesh-normals"&gt;</span></code><br/><code>          <span style="background-color: rgb(255,255,0);">&lt;float_array id="Plane-mesh-normals-array" count="6"&gt;0 0 1 0 0 1&lt;/float_array&gt;</span></code><br/><code>        &lt;/source&gt;</code><br/><code>        &lt;vertices id="Plane-mesh-vertices"&gt;</code><br/><code>          &lt;input semantic="POSITION" source="#Plane-mesh-positions"/&gt;</code><br/><code>        &lt;/vertices&gt;</code><br/><code>        <span style="background-color: rgb(255,255,0);">&lt;polylist count="2"&gt;</span></code><br/><code>          &lt;input semantic="VERTEX" source="#Plane-mesh-vertices" offset="0"/&gt;</code><br/><code>          &lt;input semantic="NORMAL" source="#Plane-mesh-normals" offset="1"/&gt;</code><br/><code>          <span style="background-color: rgb(255,255,0);">&lt;vcount&gt;3 3 &lt;/vcount&gt;</span></code><br/><code>          <span style="background-color: rgb(255,255,0);">&lt;p&gt;0 0 3 0 1 0 3 1 2 1 1 1&lt;/p&gt;</span></code><br/><code>        &lt;/polylist&gt;</code><br/><code>      &lt;/mesh&gt;</code><br/><code>    &lt;/geometry&gt;</code><br/><code>  &lt;/library_geometries&gt;</code><br/><code>&lt;/COLLADA&gt;</code></font></div><br/>When
 writing the code to read this file, I made some assumptions about the 
COLLADA file's data because I was the originator of the file and had 
control.  First, I assumed there was no texture coordinates in the file,
 this changes how one would parse the <font size="3" style="color: rgb(153,153,153);"><code><span style="background-color: rgb(255,255,0);">&lt;p&gt;0 0 3 0 1 0 3 1 2 1 1 1&lt;/p&gt;</span></code></font> section from file above (this summary describes the alternate form <a href="http://www.wazim.com/Collada_Tutorial_1.htm" rel="nofollow">here</a>). 
 Second, I assumed the &lt;polylist&gt; is always describing triangles 
and not quads.  The above assumptions would change for production code 
and it is easy enough to get the data that it wouldn't be a problem to 
handle more than the single case I handle here.<br/><br/><i>Organizing and Annotating Data Types in Preparation of Unmarshalling the COLLADA</i><i> File</i><br/>Using
 Go's XML package to read the file data in couldn't be any easier.  You 
create struct types that represent the tags you care about and 
'annotate' fields with metadata that tells the parser how to handle data
 and where to put it.  If you follow the rules properly (found in the 
XML package documentation), you should have no problem getting the XML 
package to load the data into your types for you.  In this case, there 
was some post processing required to get the &lt;float_array&gt; and 
&lt;p&gt; data into arrays of appropriate numeric types.  Here are the 
structures I used:<br/><br/><div class="sites-codeblock sites-codesnippet-block" style="color: rgb(7,55,99);"><font size="2" style="color: rgb(7,55,99);"><code>type Collada struct {</code><br/><code>    <span style="background-color: rgb(255,0,0); color: rgb(255,255,255);">Id                    string               `xml:"attr"`</span></code>  <br/><code>    Version               string               `xml:"attr"`</code><br/><code>    Library_Geometries    LibraryGeometries</code><br/><code>    Library_Visual_Scenes LibraryVisualScenes</code><br/><code>}</code><br/><br/><code>type LibraryGeometries struct{</code><br/><code>    <span style="background-color: rgb(255,153,0); color: rgb(255,255,255);">XMLName  xml.Name   `xml:"library_geometries"`</span></code><br/><code>    Geometry []Geometry</code><br/><code>} </code><br/><br/><code>type Geometry struct{ </code><br/><code>    XMLName xml.Name  `xml:"geometry"`</code><br/><code>    Id      string    `xml:"attr"` </code><br/><code>    Mesh    Mesh</code><br/><code>}</code><br/><br/><code>type Mesh struct { </code><br/><code>    XMLName  xml.Name `xml:"mesh"`</code><br/><code>    <span style="background-color: rgb(0,255,0);">Source   []Source</span></code><br/><code>    Polylist Polylist</code><br/><code>}</code><br/><br/><code>type Source struct{</code><br/><code>    XMLName     xml.Name   `xml:"source"`</code><br/><code>    Id          string     `xml:"attr"` </code><br/><code>    Float_array FloatArray `xml:"float_array"`</code><br/><code>}</code><br/><br/><code>type FloatArray struct{</code><br/><code>    XMLName xml.Name `xml:"float_array"`</code><br/><code>    Id      string   `xml:"attr"` </code><br/><code>    <span style="background-color: rgb(255,255,0);">CDATA   string   `xml:"chardata"`</span></code><br/><code>    Count   string   `xml:"attr"`</code><br/><code>}</code><br/><br/><code>type Polylist struct{</code><br/><code>    XMLName xml.Name  `xml:"polylist"`</code><br/><code>    Id      string    `xml:"attr"`</code><br/><code>    Count   string    `xml:"attr"`</code><br/><code>    </code><br/><code>    // List of integers, each specifying the number of vertices for one polygon</code><br/><code>    VCount  string    `xml:"vcount"`</code><br/><code>    </code><br/><code>    // list of integers that specify the vertex attributes </code><br/><code>    P       string    `xml:"p"`  </code><br/><code>}</code><br/><br/><code>type LibraryVisualScenes struct {</code><br/><code>    XMLName      xml.Name       `xml:"library_visual_scenes"`</code><br/><code>    VisualScene  VisualScene</code><br/><code>}</code><br/><br/><code>type VisualScene struct{</code><br/><code>    XMLName      xml.Name       `xml:"visual_scene"`</code><code>    </code><br/><code>}</code></font></div><br/>I highlighted sections above that were of interest.  The <font size="2" style="color: rgb(7,55,99);"><code><span style="background-color: rgb(255,0,0); color: rgb(255,255,255);">Id  string `xml:"attr"`</span></code></font>
 section shows how to inform the XML parser to load an attribute value 
into a field.  The field name should be exported (first letter 
capitalized) and be tagged with the `xml:"attr"` metadata.  The <font size="2" style="color: rgb(7,55,99);"><code><span style="background-color: rgb(255,153,0); color: rgb(255,255,255);">XMLName  xml.Name `xml:"library_geometries"`</span></code></font> section shows how you can identify that a structure is associated with a particular XML element.  The <font size="2" style="color: rgb(7,55,99);"><code><span style="background-color: rgb(0,255,0);">Source []Source </span></code></font> section represents an array that the XML parser will initialize and fill for you.  Finally, the <font size="2" style="color: rgb(7,55,99);"><code><span style="background-color: rgb(255,255,0);">CDATA string `xml:"chardata"`</span></code></font>
 section depicts how you tell the parser where to put text.  In this 
case, it loaded it with the string of float numbers found in this 
element:<br/><span>    </span><br/><span>    </span><span>    </span><font size="3" style="color: rgb(153,153,153);"><code><span style="background-color: rgb(255,255,0);">&lt;float_array
 id="Plane-mesh-positions-array" count="12"&gt;1 0.3503274 0 1 
-0.3503274 0 -1 -0.9999998 0 -0.9999997 1 0&lt;/float_array&gt;</span></code></font>   <br/><br/><i>Unmarshalling the COLLADA</i><i> File</i><br/>Oh, I almost forgot.  Once you've created your data types, the call to fill your data simply looks like the following:<br/><br/><div class="sites-codeblock sites-codesnippet-block"><font size="2"><code>//</code><br/><code>// Create meshes from COLLADA file</code><br/><code>// </code><br/><code>// There are some major limitations for this currently</code><br/><code>// 1) Must only contain Triangles</code><br/><code>// 2) No support for animation or materials at the moment</code><br/><code>// 3) Will not read translations or rotations</code><br/><code>//</code><br/><code><b>func</b> BuildModel(filename string) *data.Model{</code><br/><code>    file, err := os.Open(filename)</code><br/><code>    <b>if</b> err!= <b>nil</b>{</code><br/><code>        fmt.Println(err.String())    </code><br/><code>    }</code><br/><code>    </code><br/><code>    <span style="background-color: rgb(255,255,0);">c := <b>new</b>(Collada)</span></code><br/><code>    <span style="background-color: rgb(255,153,0);">err = xml.Unmarshal(file, c)</span></code><br/><code>    <b>if</b> err!= nil{</code><br/><code>        fmt.Println(err.String())    </code><br/><code>    }<br/><span>    </span>... <br/>}<br/></code></font></div><br/>In
 the above code, I've used a filename to open a file and I've 
constructed the root document element (the Collada type) on this line:<br/><br/><span>    </span><span>    </span> <font size="2"><code><span style="background-color: rgb(255,255,0);">c := new(Collada)</span></code></font><br/><br/>and
 called xml.Unmarshall passing the file and a reference to the Collada 
data type instance.  Everything we've properly modeled will be 
accessible from this root element.  Again, I had to do some 
post-processing to convert some textual numbers to float and int arrays,
 but in the end, an ugly model I built in Blender like this:<br/><br/><div style="display: block; text-align: left;"><a href="https://sites.google.com/a/kryas.com/kryas/recent_posts/readingxmlviago/blender-tree.png?attredirects=0"><img border="0" height="373" src="https://sites.google.com/a/kryas.com/kryas/_/rsrc/1340687250151/recent_posts/readingxmlviago/blender-tree.png" width="400"/></a></div><br/> was being shown in a Go COLLADA Model Viewer I built like this:<br/><br/> <div style="display: block; text-align: left;"><a href="https://sites.google.com/a/kryas.com/kryas/recent_posts/readingxmlviago/collada-viewer.png?attredirects=0"><img border="0" height="324" src="https://sites.google.com/a/kryas.com/kryas/_/rsrc/1340687288572/recent_posts/readingxmlviago/collada-viewer.png" width="400"/></a></div><br/><br/>Again,
 this was super easy and only took about 2-3 hours (I've been writing 
this post for about the same amount of time).  The next step will be to 
create and apply textures to the model and see how how to get it 
displayed in the model viewer.</div></td></tr></tbody></table></div>
    </content>
    <updated>2012-06-26T05:08:23Z</updated>
    <published>2011-07-29T19:40:32Z</published>
    <category label="announcement" scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#announcement"/>
    <author>
      <name>Stan Steel</name>
      <email>steel@kryas.com</email>
    </author>
    <source>
      <id>https://sites.google.com/feeds/content/kryas.com/kryas</id>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#post" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas/batch" rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas?parent=5119061230095011683&amp;kind=announcement" rel="self" type="application/atom+xml"/>
      <title>Posts of Development Blog</title>
      <updated>2012-10-18T04:10:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-8174427308880691686</id>
    <link href="http://mue.tideland.biz/feeds/8174427308880691686/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/06/using-sublime-text-2-with-gosublime.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/8174427308880691686" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/8174427308880691686" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/06/using-sublime-text-2-with-gosublime.html" rel="alternate" type="text/html"/>
    <title>Using Sublime Text 2 with GoSublime</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/><span style="background-color: white;">In </span><span style="background-color: white;"><a href="http://mue.tideland.biz/2012/02/convinced-by-sublime-text.html"><i>Convinced by Sublime Text</i></a></span><span style="background-color: white;"> I already wrote about <i>Sublime Text 2</i>, my preferred editor I'm using under OS X and Linux. It's already very powerful out of the box. But together with the <a href="http://wbond.net/sublime_packages/package_control" target="_blank">Package Control</a> plugin and the large number of available packages it gets even better. Searching, installing, updating, removing, everything works like a charm.</span><br/><br/>Today I want to show you the <a href="https://github.com/DisposaBoy/GoSublime" target="_blank">GoSublime</a> package by <i>DisposaBoy</i>. It provides<br/><br/><ul><li><span style="background-color: white;">the well-known code completion of <a href="https://github.com/nsf/gocode" target="_blank">gocode</a> by <i>nsf</i>,</span></li><li><span style="background-color: white;">own snippets for code-completion which intelligent - by type-comparison - try to use variables of the surrounding context,</span></li><li><span style="background-color: white;">simple adding and removing of imports,</span></li><li><span style="background-color: white;">direct jumps to imports, e.g. for defining an alias,</span></li><li><span style="background-color: white;">live error detection and highlighting using <i>gotype</i>; a list can be get with <i>Cmd-. Cmd-E</i>,</span></li><li><span style="background-color: white;">a build system simply based on the Go tools; so not only a <i>go build</i> or <i>go test</i> are possible, also variants like <i>go test -i</i> or <i>go test -test.cpu 8 -test.v</i>,</span></li><li><span style="background-color: white;">error cycling using <i>F4/Shift-F4</i> (beside clicking on the error in the output window),</span></li><li><span style="background-color: white;">simple jump between the errors in different files and back,</span></li><li><span style="background-color: white;">formatting of the source with <i>gofmt</i> automatically when saving or by command and</span></li><li><span style="background-color: white;">directly run/play the current file.</span></li></ul><br/>Most of those commands can be accessed via the <i>Cmd-. Cmd-.</i> shortcut. Some or directly part of the plugin and so developed in Python. But a lot is done in <a href="https://github.com/DisposaBoy/MarGo" target="_blank">MarGo</a>, also developed by <i>DisposaBoy</i>, but in Go. Both tools are not yet done but grow fast. Every few days the automatic update of Package Control shows new changes and the change log is very interesting. Soon there will be<br/><br/><ul><li><span style="background-color: white;">a system wide jump to the definition of a function or variable,</span></li><li><span style="background-color: white;">a display of Go docs in the editor and</span></li><li><span style="background-color: white;">a share of code from inside the editor in <i>play.golang.org</i> (it's already working in the developer releases of Sublime Text 2).</span></li></ul><br/> <span style="background-color: white;">So if you're a Go developer looking for a powerful environment try this duo.</span><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-8174427308880691686?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-06-25T10:14:02Z</updated>
    <published>2012-06-24T17:09:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="sublimetext"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="gosublime"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/06/25/wireshark</id>
    <link href="http://www.imperialviolet.org/2012/06/25/wireshark.html" rel="alternate" type="text/html"/>
    <title>Decrypting SSL packet dumps</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>We all love transport security but it can get in the way of a good tcpdump. Unencrypted protocols like HTTP, DNS etc can be picked apart for debugging but anything running over SSL can be impenetrable. Of course, that's an advantage too: the end-to-end principle is dead for any common, unencrypted protocol. But we want to have our cake <i>and</i> eat it.</p>

<p>Wireshark (a common tool for dissecting packet dumps) has long had the ability to decrypt some SSL connections given the private key of the server, but the private key isn't always something that you can get hold of, or want to spread around. MITM proxies (like <a href="http://www.fiddler2.com/fiddler2/">Fiddler</a>) can sit in the middle of a connection and produce plaintext, but they also alter the connection: SPDY, client-certificates etc won't work through them (at least not without special support).</p>

<p>So here's another option: if you get a dev channel release of Chrome and a trunk build of Wireshark you can run Chrome with the environment variable <tt>SSLKEYLOGFILE</tt> set to, say, <tt>/home/foo/keylog</tt>. Then, in Wireshark's preferences for SSL, you can tell it about that key log file. As Chrome makes SSL connections, it'll dump an identifier and the connection key to that file and Wireshark can read those and decrypt SSL connections.</p>

<p>The format of the key log file is described <a href="https://developer.mozilla.org/en/NSS_Key_Log_Format">here</a>. There's an older format just for RSA ciphersuites that I added when Wireshark decrypted purely based on RSA pre-master secrets. However, that doesn't work with <a href="http://www.imperialviolet.org/2011/11/22/forwardsecret.html">ECDHE ciphersuites</a> (amongst others) so the newer format can be used to decrypt any connection. (You need the trunk build of Wireshark to support the newer format.) Chrome currently writes records of both formats.</p>

<p>This can also be coupled with <a href="http://code.google.com/p/spdyshark/">spdy-shark</a> to dissect SPDY connections.</p>

<p>Since key log support is part of NSS, support will hopefully end up in Firefox in the future.</p></div>
    </content>
    <updated>2012-06-25T07:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-7066578632735787984</id>
    <link href="http://reneefrench.blogspot.com/feeds/7066578632735787984/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=7066578632735787984" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7066578632735787984" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7066578632735787984" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/12/blog-post_30.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://4.bp.blogspot.com/-J0YHiWNXASQ/Tv69jJ1_AHI/AAAAAAAAEdQ/dvzReNUfxLk/s1600/bjornstrand2.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5692195390678302834" src="http://4.bp.blogspot.com/-J0YHiWNXASQ/Tv69jJ1_AHI/AAAAAAAAEdQ/dvzReNUfxLk/s320/bjornstrand2.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 272px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-7066578632735787984?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:55:05Z</updated>
    <published>2011-12-31T07:45:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="A.T."/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-06-28T16:18:59Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-9047543468838742655</id>
    <link href="http://reneefrench.blogspot.com/feeds/9047543468838742655/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=9047543468838742655" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/9047543468838742655" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/9047543468838742655" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/01/blog-post_16.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://4.bp.blogspot.com/-EYppcLVcO20/TxUD548BOsI/AAAAAAAAEf8/psnivtF4yrQ/s1600/bjoernstrand.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5698465196578781890" src="http://4.bp.blogspot.com/-EYppcLVcO20/TxUD548BOsI/AAAAAAAAEf8/psnivtF4yrQ/s320/bjoernstrand.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 304px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-9047543468838742655?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:54:22Z</updated>
    <published>2012-01-17T05:15:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Monster story"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="A.T."/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-07-08T03:14:59Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-1497947711549125788</id>
    <link href="http://reneefrench.blogspot.com/feeds/1497947711549125788/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=1497947711549125788" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1497947711549125788" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1497947711549125788" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/01/blog-post_24.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://2.bp.blogspot.com/-tVOj3uC7urA/Tx80hVHLCQI/AAAAAAAAEiQ/j10bX6qp6EU/s1600/onmonday.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5701333400481892610" src="http://2.bp.blogspot.com/-tVOj3uC7urA/Tx80hVHLCQI/AAAAAAAAEiQ/j10bX6qp6EU/s320/onmonday.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 308px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-1497947711549125788?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:53:42Z</updated>
    <published>2012-01-24T22:45:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="A.T."/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-07-24T18:37:12Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-439810656438236360</id>
    <link href="http://reneefrench.blogspot.com/feeds/439810656438236360/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=439810656438236360" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/439810656438236360" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/439810656438236360" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/01/blog-post_29.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-oyyyAraFvsE/TyXScRCyQnI/AAAAAAAAEjk/XQSB5hW-pYw/s1600/afifthsunday.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5703195886187856498" src="http://3.bp.blogspot.com/-oyyyAraFvsE/TyXScRCyQnI/AAAAAAAAEjk/XQSB5hW-pYw/s320/afifthsunday.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 278px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-439810656438236360?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:53:01Z</updated>
    <published>2012-01-29T23:12:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Monster story"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="A.T."/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-07-28T21:55:34Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-5762492101014948650</id>
    <link href="http://reneefrench.blogspot.com/feeds/5762492101014948650/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=5762492101014948650" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/5762492101014948650" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/5762492101014948650" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/05/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-x60rfRP4cD0/T7Wou2NC4sI/AAAAAAAAEzk/Fy-4-1yhKYE/s1600/monsterface1.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://1.bp.blogspot.com/-x60rfRP4cD0/T7Wou2NC4sI/AAAAAAAAEzk/Fy-4-1yhKYE/s320/monsterface1.jpg" width="284"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-5762492101014948650?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:52:01Z</updated>
    <published>2012-05-18T01:41:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Monster story"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-09-22T03:58:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-3697557900031346208</id>
    <link href="http://reneefrench.blogspot.com/feeds/3697557900031346208/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=3697557900031346208" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3697557900031346208" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3697557900031346208" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/05/blog-post_23.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-I_JwFRdIeEQ/T73b-ybfWDI/AAAAAAAAE0s/bJHj78gRA9U/s1600/monsteroow.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="302" src="http://2.bp.blogspot.com/-I_JwFRdIeEQ/T73b-ybfWDI/AAAAAAAAE0s/bJHj78gRA9U/s320/monsteroow.jpg" width="320"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-3697557900031346208?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:49:42Z</updated>
    <published>2012-05-24T06:58:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Monster story"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-05T12:33:53Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-4030714017465847815</id>
    <link href="http://reneefrench.blogspot.com/feeds/4030714017465847815/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=4030714017465847815" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4030714017465847815" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4030714017465847815" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/05/blog-post_25.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-Ja9WQ-61wFs/T7-7G320hbI/AAAAAAAAE10/hpBbr-0sr-c/s1600/monsterbl.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="310" src="http://1.bp.blogspot.com/-Ja9WQ-61wFs/T7-7G320hbI/AAAAAAAAE10/hpBbr-0sr-c/s320/monsterbl.jpg" width="320"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-4030714017465847815?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:49:05Z</updated>
    <published>2012-05-25T17:02:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Monster story"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-2938489365359062033</id>
    <link href="http://reneefrench.blogspot.com/feeds/2938489365359062033/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=2938489365359062033" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2938489365359062033" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2938489365359062033" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/06/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-IWIvVK0MwoE/T8sIIDdBTYI/AAAAAAAAE40/ZKx0TLFKle8/s1600/bjornstranddown.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-IWIvVK0MwoE/T8sIIDdBTYI/AAAAAAAAE40/ZKx0TLFKle8/s320/bjornstranddown.jpg" width="278"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-2938489365359062033?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:47:48Z</updated>
    <published>2012-06-03T06:45:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-8743668750453439070</id>
    <link href="http://reneefrench.blogspot.com/feeds/8743668750453439070/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=8743668750453439070" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8743668750453439070" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8743668750453439070" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/06/blog-post_19.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-myDFrnC0w4I/T-FnSMgLg7I/AAAAAAAAE7A/UtSyf_7Prn0/s1600/bjornstrand34s.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-myDFrnC0w4I/T-FnSMgLg7I/AAAAAAAAE7A/UtSyf_7Prn0/s320/bjornstrand34s.jpg" width="317"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-8743668750453439070?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:44:34Z</updated>
    <published>2012-06-20T06:01:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="drawn while"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="f1 days"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-6430982353978510350</id>
    <link href="http://reneefrench.blogspot.com/feeds/6430982353978510350/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=6430982353978510350" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6430982353978510350" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6430982353978510350" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/06/blog-post_21.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-55KEw5BCHwQ/T-P8g3gKexI/AAAAAAAAE7w/Ric2u0cMEJg/s1600/bjornstrandbottle.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://3.bp.blogspot.com/-55KEw5BCHwQ/T-P8g3gKexI/AAAAAAAAE7w/Ric2u0cMEJg/s320/bjornstrandbottle.jpg" width="283"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-6430982353978510350?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-06-24T17:43:21Z</updated>
    <published>2012-06-22T05:03:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Bjornstrand story"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://www.miek.nl/blog/archives/2012/06/21/printing_mx_records_with_go_dns/index.html</id>
    <link href="http://www.miek.nl/blog/archives/2012/06/21/printing_mx_records_with_go_dns/index.html" rel="alternate" type="text/html"/>
    <title>Printing MX records with Go DNS</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><blockquote>
<p>Now that the API seems to stabilize it is time to update these items.</p>
</blockquote>
<p>We want to create a little program that prints out the MX records of domains, like so:</p>
<pre><code>% mx miek.nl
miek.nl.        86400   IN      MX      10 elektron.atoom.net.</code></pre>
<p>Or</p>
<pre><code>% mx microsoft.com 
microsoft.com.  3600    IN      MX      10 mail.messaging.microsoft.com.</code></pre>
<p>We are using my <a href="https://github.com/miekg/dns">Go DNS package</a>. First the normal header of a Go program, with a bunch of imports. We need the <code>dns</code> package:</p>
<pre><code>package main

import (
    "dns"
    "os"
    "fmt"
)</code></pre>
<p>Next we need to get the local nameserver to use:</p>
<pre><code>config, _ := dns.ClientConfigFromFile("/etc/resolv.conf")</code></pre>
<p>Then we create a <code>dns.Client</code> to perform the queries for us. In Go:</p>
<pre><code>c := new(dns.Client)</code></pre>
<p>We skip some error handling and assume a zone name is given. So we prepare our question. For that to work, we need:</p>
<ol style="">
<li>a new packet (<code>dns.Msg</code>);</li>
<li>setting some header bits (<code>dns.Msg.MsgHdr</code>);</li>
<li>define a question section;</li>
<li>fill out the question section: <code>os.Args[1]</code> contains the zone name.</li>
</ol>
<p>Which translates into:</p>
<pre><code>m := new(dns.Msg)
m.SetQuestion(dns.Fqdn(os.Args[1], dns.TypeMX)
m.MsgHdr.RecursionDesired = true</code></pre>
<p>Then we need to finally 'ask' the question. We do this by calling the <code>Exchange()</code> function.</p>
<pre><code>r, err := c.Exchange(m, config.Servers[0]+":"+config.Port)</code></pre>
<p>Check if we got something sane. The following code snippet prints the answer section of the received packet:</p>
<pre><code>if r != nil {
        if r.Rcode != dns.RcodeSuccess {
                fmt.Printf(" *** invalid answer name %s after MX query for %s\n", os.Args[1], os.Args[1])
                os.Exit(1)
        }
        // Stuff must be in the answer section
        for _, a := range r.Answer {
                fmt.Printf("%v\n", a)
        }
} else {
        fmt.Printf("*** error: %s\n", err.String())
}</code></pre>
<p>And we are done.</p>
<h2 id="full-source">Full source</h2>
<p>The full source of <code>mx.go</code> can be found over at <a href="https://github.com/miekg/dns/raw/master/_examples/mx/mx.go">github</a>. Compiling works with <code>go build</code>.</p></div>
    </summary>
    <updated>2012-06-21T08:30:41Z</updated>
    <category term="go, dns(sec)"/>
    <author>
      <name>Miek Gieben</name>
    </author>
    <source>
      <id>http://www.miek.nl/blog</id>
      <author>
        <name>Miek Gieben</name>
      </author>
      <link href="http://www.miek.nl/blog/archives/go/index-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.miek.nl/blog" rel="alternate" type="text/html"/>
      <subtitle>Thoughts on (technical) stuff</subtitle>
      <title>Filed under: go | Miek</title>
      <updated>2012-09-17T18:42:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:research.swtch.com,2012:research.swtch.com/gotour</id>
    <link href="http://research.swtch.com/gotour" rel="alternate" type="text/html"/>
    <title>A Tour of Go</title>
    <summary>A video introduction to Go: interfaces, reflection, concurrency</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p class="lp">
Last week, I gave a talk about Go at the Boston Google Developers
Group meeting. There were some problems with the recording, so I
have rerecorded the talk as a screencast and posted it on YouTube.
</p>

<center>
&lt;iframe allowfullscreen="allowfullscreen" frameborder="0" height="360" src="http://www.youtube.com/embed/ytEkHepK08c?rel=0" width="640"&gt;&lt;/iframe&gt;
</center>

<p class="lp">
Here are the answers to questions asked at the end of the talk.
</p>

<p class="lp">
<b>Q. How does Go work with debuggers?</b>
</p>
<p class="lp">
To start, both Go toolchains include debugging information that gdb
can read in the final binaries, so basic gdb functionality works on Go
programs just as it does on C programs.
</p>
<p class="lp">
We’ve talked for a while about a custom Go debugger, but there isn’t
one yet.
</p>
<p class="lp">
Many of the programs we want to debug are live, running programs. The
<a href="http://golang.org/pkg/net/http/pprof/">net/http/pprof</a> package provides debugging information like goroutine
stacks, memory profiling, and cpu profiling in response to special
HTTP requests.
</p>
<p class="lp">
<b>Q. If a goroutine is stuck reading from a channel with no other references, does the goroutine get garbage collected?</b>
</p>
<p class="lp">
No. From the garbage collection point of view, both sides of the
channel are represented by the same pointer, so it can’t distinguish
the receive and send sides. Even if we could detect this situation,
we’ve found that it’s very useful to keep these goroutines around,
because the program is probably heading for a deadlock. When a Go
program deadlocks, it prints all its goroutine stacks and then exits.
If we garbage collected the goroutines as they got stuck, the deadlock
handler wouldn’t have anything useful to print except "your entire
program has been garbage collected".
</p>
<p class="lp">
<b>Q. Can a C++ program call into Go?</b>
</p>
<p class="lp">
We wrote a tool called <a href="http://golang.org/cmd/cgo/">cgo</a> so that Go programs can call into C, and
we’ve implemented support for Go in SWIG, so that Go programs can call
into C++. In those programs, the C or C++ can in turn call back into
Go. But we don’t have support for a C or C++ program—one that starts
execution in the C or C++ world instead of the Go world—to call into
Go.
</p>
<p class="lp">
The hardest part of the cross-language calls is converting between the
C calling convention and the Go calling convention, specifically with
the regard to the implementation of segmented stacks. But that’s been
done and works.
</p>
<p class="lp">
Making the assumption that these mixed-language binaries start in Go
has simplified a number of parts of the implementation. I don’t
anticipate any technical surprises involved in removing these
assumptions. It’s just work.
</p>
<p class="lp">
<b>Q. What are the areas that you specifically are trying to improve the language?</b>
</p>
<p class="lp">
For the most part, I’m not trying to improve the language itself. Part
of the effort in preparing Go 1 was to identify what we wanted to
improve and do it. Many of the big changes were based on two or three
years of experience writing Go programs, and they were changes we’d
been putting off because we knew that they’d be disruptive. But now
that Go 1 is out, we want to stop changing things and spend another
few years using the language as it exists today. At this point we
don’t have enough experience with Go 1 to know what really needs
improvement.
</p>
<p class="lp">
My Go work is a small amount of fixing bugs in the libraries or in the
compiler and a little bit more work trying to improve the performance
of what’s already there.
</p>
<p class="lp">
<b>Q. What about talking to databases and web services?</b>
</p>
<p class="lp">
For databases, one of the packages we added in Go 1 is a standard
<a href="http://golang.org/pkg/database/sql/">database/sql</a> package. That package defines a standard API for
interacting with SQL databases, and then people can implement drivers
that connect the API to specific database implementations like SQLite
or MySQL or Postgres.
</p>
<p class="lp">
For web services, you’ve seen the support for JSON and XML encodings.
Those are typically good enough for ad hoc REST services. I recently
wrote a <a href="http://go.pkgdoc.org/code.google.com/p/rsc/smugmug">package for connecting to the SmugMug photo hosting API</a>, and there’s one
generic call that unmarshals the response into a struct of the
appropriate type, using <a href="http://golang.org/pkg/encoding/json/#Unmarshal">json.Unmarshal</a>. I expect that XML-based web
services like SOAP could be framed this way too, but I’m not aware of
anyone who’s done that.
</p>
<p class="lp">
Inside Google, of course, we have plenty of services, but they’re
based on protocol buffers, so of course there’s a good
<a href="http://code.google.com/p/goprotobuf/">protocol buffer library for Go</a>.
</p>
<p class="lp">
<b>Q. What about generics? How far off are they?</b>
</p>
<p class="lp">
People have asked us about generics from day 1. The answer has always
been, and still is, that it’s something we’ve put a lot of thought
into, but we haven’t yet found an approach that we think is a good fit
for Go. We’ve talked to people who have been involved in the design of
generics in other languages, and they’ve almost universally cautioned
us not to rush into something unless we understand it very well and
are comfortable with the implications. We don’t want to do something
that we’ll be stuck with forever and regret.
</p>
<p class="lp">
Also, speaking for myself, I don’t miss generics when I write Go
programs. What’s there, having built-in support for arrays, slices,
and maps, seems to work very well.
</p>
<p class="lp">
Finally, we just made this promise about backwards compatibility with
the release of Go 1. If we did add some form of generics, my guess is
that some of the existing APIs would need to change, which can’t
happen until Go 2, which I think is probably years away.
</p>
<p class="lp">
<b>Q. What types of projects does Google use Go for?</b>
</p>
<p class="lp">
Most of the things we use Go for I can’t talk about. One notable
exception is that Go is an App Engine language, which we announced at
I/O last year. Another is <a href="http://code.google.com/p/vitess/">vtocc</a>,
a MySQL load balancer used to manage database lookups in YouTube’s core infrastructure.
</p>
<p class="lp">
<b>Q. How does the Plan 9 toolchain differ from other compilers?</b>
</p>
<p class="lp">
It’s a completely incompatible toolchain in every way. The main
difference is that object files don’t contain machine code in the
sense of having the actual instruction bytes that will be used in the
final binary. Instead they contain a custom encoding of the assembly
listings, and the linker is in charge of turning those into actual
machine instructions. This means that the assembler, C compiler, and
Go compiler don’t all duplicate this logic. The main change for Go is
the support for segmented stacks.
</p>
<p class="lp">
I should add that we love the fact that we have two completely
different compilers, because it keeps us honest about really
implementing the spec.
</p>
<p class="lp">
<b>Q. What are segmented stacks?</b>
</p>
<p class="lp">
One of the problems in threaded C programs is deciding how big a stack
each thread should have. If the stack is too small, then the thread
might run out of stack and cause a crash or silent memory corruption,
and if the stack is too big, then you’re wasting memory. In Go, each
goroutine starts with a small stack, typically 4 kB, and then each
function checks if it is about to run out of stack and if so allocates
a new stack segment that gets recycled once it’s not needed anymore.
</p>
<p class="lp">
Gccgo supports segmented stacks, but it requires support added
recently to the new GNU linker, gold, and that support is only
implemented for x86-32 and x86-64.
</p>
<p class="lp">
Segmented stacks are something that lots of people have done before in
experimental or research systems, but they have never made it into the
C toolchains.
</p>
<p class="lp">
<b>Q. What is the overhead of segmented stacks?</b>
</p>
<p class="lp">
It’s a few instructions per function call. It’s been a long time since
I tried to measure the precise overhead, but in most programs I expect
it to be not more than 1-2%. There are definitely things we could do
to try to reduce that, but it hasn’t been a concern.
</p>
<p class="lp">
<b>Q. Do goroutine stacks adapt in size?</b>
</p>
<p class="lp">
The initial stack allocated for a goroutine does not adapt. It’s
always 4k right now. It has been other values in the past but always a
constant. One of the things I’d like to do is to look at what the
goroutine will be running and adjust the stack accordingly, but I
haven’t.
</p>
<p class="lp">
<b>Q. Are there any short-term plans for dynamic loading of modules?</b>
</p>
<p class="lp">
No. I don’t think there are any technical surprises, but assuming that
everything is statically linked simplified some of the implementation.
Like with calling Go from C++ programs, I believe it’s just work.
</p>
<p class="lp">
Gccgo might be closer to support for this, but I don’t believe that it
supports dynamic loading right now either.
</p>
<p class="lp">
<b>Q. How much does the language spec say about reflection?</b>
</p>
<p class="lp">
The spec is intentionally vague about reflection, but <a href="http://golang.org/pkg/reflect/">package
reflect’s API</a> is definitely part of the Go 1 definition. Any
conforming implementation would need to implement that API. In fact,
gc and gccgo do have different implementations of that package reflect
API, but then the packages that use reflect like <a href="http://golang.org/pkg/fmt/">fmt</a> and <a href="http://golang.org/pkg/encoding/json/">json</a> can be
shared.
</p>
<p class="lp">
<b>Q. Do you have a release schedule?</b>
</p>
<p class="lp">
We don’t have any fixed release schedule. We’re not keeping things
secret, but we’re also not making commitments to specific timelines.
</p>
<p class="lp">
Go 1 was in progress publicly for months, and if you watched you could
see the bug count go down and the release candidates announced, and so
on.
</p>
<p class="lp">
Right now we’re trying to slow down. We want people to write things
using Go, which means we need to make it a stable foundation to build
on. Go 1.0.1, the first bug release, was released four weeks after Go
1, and Go 1.0.2 was seven weeks after Go 1.0.1.
</p>
<p class="lp">
<b>Q. Where do you see Go in five years? What languages will it replace?</b>
</p>
<p class="lp">
I hope that it will still be at golang.org, that the Go project will
still be thriving and relevant. We built it to write the kinds of
programs we’ve been writing in C++, Java, and Python, but we’re not
trying to go head-to-head with those languages. Each of those has
definite strengths that make them the right choice for certain
situations. We think that there are plenty of situations, though,
where Go is a better choice.
</p>
<p class="lp">
If Go doesn’t work out, and for some reason in five years we’re
programming in something else, I hope the something else would have
the features I talked about, specifically the Go way of doing
interfaces and the Go way of handling concurrency.
</p>
<p class="lp">
If Go fails but some other language with those two features has taken
over the programming landscape, if we can move the computing world to
a language with those two features, then I’d be sad about Go but happy
to have gotten to that situation.
</p>
<p class="lp">
<b>Q. What are the limits to scalability with building a system with many goroutines?</b>
</p>
<p class="lp">
The primary limit is the memory for the goroutines. Each goroutine
starts with a 4kB stack and a little more per-goroutine data, so the
overhead is between 4kB and 5kB. That means on this laptop I can
easily run 100,000 goroutines, in 500 MB of memory, but a million
goroutines is probably too much.
</p>
<p class="lp">
For a lot of simple goroutines, the 4 kB stack is probably more than
necessary. If we worked on getting that down we might be able to
handle even more goroutines. But remember that this is in contrast to
C threads, where 64 kB is a tiny stack and 1-4MB is more common.
</p>
<p class="lp">
<b>Q. How would you build a traditional barrier using channels?</b>
</p>
<p class="lp">
It’s important to note that channels don’t attempt to be a concurrency
Swiss army knife. Sometimes you do need other concepts, and the
standard <a href="http://golang.org/pkg/sync/">sync</a> package has some helpers. I’d probably use a
<a href="http://golang.org/pkg/sync/#WaitGroup">sync.WaitGroup</a>.
</p>
<p class="lp">
If I had to use channels, I would do it like in the web crawler
example, with a channel that all the goroutines write to, and a
coordinator that knows how many responses it expects.
</p>
<p class="lp">
<b>Q. What is an example of the kind of application you’re working on performance for? How will you beat C++?</b>
</p>
<p class="lp">
I haven’t been focusing on specific applications. Go is still young
enough that if you run some microbenchmarks you can usually find
something to optimize. For example, I just sped up floating point
computation by about 25% a few weeks ago. I’m also working on more
sophisticated analyses for things like escape analysis and bounds
check elimination, which address problems that are unique to Go, or at
least not problems that C++ faces.
</p>
<p class="lp">
Our goal is definitely not to beat C++ on performance. The goal for Go
is to be near C++ in terms of performance but at the same time be a
much more productive environment and language, so that you’d rather
program in Go.
</p>
<p class="lp">
<b>Q. What are the security features of Go?</b>
</p>
<p class="lp">
Go is a type-safe and memory-safe language. There are no dangling
pointers, no pointer arithmetic, no use-after-free errors, and so on.
</p>
<p class="lp">
You can break the rules by importing package <a href="http://golang.org/pkg/unsafe/">unsafe</a>, which gives
you a special type unsafe.Pointer. You can convert any pointer or
integer to an unsafe.Pointer and back. That’s the escape hatch, which
you need sometimes, like for extracting the bits of a float64 as a
uint64. But putting it in its own package means that unsafe code is
explicitly marked as unsafe. If your program breaks in a strange way,
you know where to look.
</p>
<p class="lp">
Isolating this power also means that you can restrict it. On App
Engine you can’t import package unsafe in the code you upload for your
app.
</p>
<p class="lp">
I should point out that the current Go implementation does have
<a href="http://research.swtch.com/gorace">data races</a>, but they are not
fundamental to the language. It would be possible to eliminate the
races at some cost in efficiency, and for now we’ve decided not to do
that. There are also tools such as <a href="http://code.google.com/p/data-race-test/wiki/ThreadSanitizerGo">Thread Sanitizer</a> that help find these kinds of data races in Go
programs.
</p>
<p class="lp">
<b>Q. What language do you think Go is trying to displace?</b>
</p>
<p class="lp">
I don’t think of Go that way. We were writing C++ code before we did
Go, so we definitely wanted not to write C++ code anymore. But we’re
not trying to displace all C++ code, or all Python code, or all Java
code, except maybe in our own day-to-day work.
</p>
<p class="lp">
One of the surprises for me has been the variety of languages that new
Go programmers used to use. When we launched, we were trying to
explain Go to C++ programmers, but many of the programmers Go has
attracted have come from more dynamic languages like Python or Ruby.
</p>
<p class="lp">
<b>Q. How does Go make it possible to use multiple cores?</b>
</p>
<p class="lp">
Go lets you tell the runtime how many operating system threads to use
for executing goroutines, and then it muxes the goroutines onto those
threads. So if you’ve written a program that has four or more
goroutines executing simultaneously, you can tell the runtime to use
four OS threads and then you’re running on four cores.
</p>
<p class="lp">
We’ve been pleasantly surprised by how easy people find it to write
these kinds of programs. People who have not written parallel or
concurrent programs before write concurrent Go programs using channels
that can take advantage of multiple cores, and they enjoy the
experience. That’s more than you can usually say for C threads. Joe
Armstrong, one of the creators of Erlang, makes the point that
thinking about concurrency in terms of communication might be more
natural for people, since communication is something we’ve done for a
long time. I agree.
</p>
<p class="lp">
<b>Q. How does the muxing of goroutines work?</b>
</p>
<p class="lp">
It’s not very smart. It’s the simplest thing that isn’t completely
stupid: all the scheduling operations are O(1), and so on, but there’s
a shared run queue that the various threads pull from. There’s no
affinity between goroutines and threads, there’s no attempt to make
sophisticated scheduling decisions, and there’s not even preemption.
</p>
<p class="lp">
The goroutine scheduler was the first thing I wrote when I started
working on Go, even before I was working full time on it, so it’s just
about four years old. It has served us surprisingly well, but we’ll
probably want to replace it in the next year or so. We’ve been having
some discussions recently about what we’d want to try in a new
scheduler.
</p>
<p class="lp">
<b>Q. Is there any plan to bootstrap Go in Go, to write the Go compiler in Go?</b>
</p>
<p class="lp">
There’s no immediate plan. Go does ship with a Go program parser
written in Go, so the first piece is already done, and there’s an
experimental type checker in the works, but those are mainly for
writing program analysis tools. I think that Go would be a great
language to write a compiler in, but there’s no immediate plan. The
current compiler, written in C, works well.
</p>
<p class="lp">
I’ve worked on bootstrapped languages in the past, and I found that
bootstrapping is not necessarily a good fit for languages that are
changing frequently. It reminded me of climbing a cliff and screwing
hooks into the cliff once in a while to catch you if you fall. Once or
twice I got into situations where I had identified a bug in the
compiler, but then trying to write the code to fix the bug tickled the
bug, so it couldn’t be compiled. And then you have to think hard about
how to write the fix in a way that avoids the bug, or else go back
through your version control history to find a way to replay history
without introducing the bug. It’s not fun.
</p>
<p class="lp">
The fact that Go wasn’t written in itself also made it much easier to
make significant language changes. Before the initial release we went
through a handful of wholesale syntax upheavals, and I’m glad we
didn’t have to worry about how we were going to rebootstrap the
compiler or ensure some kind of backwards compatibility during those
changes.
</p>
<p class="lp">
Finally, I hope you’ve read Ken Thompson’s Turing Award lecture, <a href="http://cm.bell-labs.com/who/ken/trust.html">Reflections on Trusting Trust</a>. When we were planning the initial open
source release, we liked to joke that no one in their right mind would
accept a bootstrapped compiler binary written by Ken.
</p>
<p class="lp">
<b>Q. What does Go do to compile efficiently at scale?</b>
</p>
<p class="lp">
This is something that we talked about a lot in early talks about Go.
The main thing is that it cuts off transitive dependencies when
compiling a single module. In most languages, if package A imports B,
and package B imports C, then the compilation of A reads not just the
compiled form of B but also the compiled form of C. In large systems,
this gets out of hand quickly. For example, in C++ on my Mac,
including &lt;iostream&gt; reads 25,326 lines from 131 files. 
(C and C++ headers aren't “compiled form,” but the problem is the same.)
Go promises that each import reads a single compiled package file. If you
need to know something about other packages to understand that
package’s API, then the compiled file includes the extra information
you need, but only that.
</p>
<p class="lp">
Of course, if you are building from scratch and package A imports B
which imports C, then of course C has to be compiled first, and then
B, and then A. The import point is that when you go to compile A, you
don’t reload C’s object file. In a real program, the dependencies are
usually not a chain like this. We might have A1, A2, A3, and so on all
importing B. It’s a significant win if none of them need to reread C.
</p>
<p class="lp">
<b>Q. How do you identify a good project for Go?</b>
</p>
<p class="lp">
I think a good project for Go is one that you’re excited about writing
in Go. Go really is a general purpose programming language, and except
for the compiler work, it’s the only language I’ve written significant
programs in for the past four years.
</p>
<p class="lp">
Most of the people I know who are using Go are using it for networked
servers, where the concurrency features have something contribute, but
it’s great for other contexts too. I’ve used it to write a simple mail
reader, file system implementations to read old disks, and a variety
of other unnetworked programs.
</p>
<p class="lp">
<b>Q. What is the current and future IDE support for Go?</b>
</p>
<p class="lp">
I’m not an IDE user in the modern sense, so really I don’t know. We
think that it would be possible to write a really nice IDE
specifically for Go, but it’s not something we’ve had time to explore.
The Go distribution has a <a href="http://golang.org/misc">misc</a> directory that
contains basic Go support for common editors, and there is a
<a href="http://code.google.com/p/goclipse">Goclipse project</a> to write an
Eclipse-based IDE, but I don’t know much about those.
</p>
<p class="lp">
The development environment I use,
<a href="http://plan9.bell-labs.com/sys/doc/acme/acme.pdf">acme</a>, is great for
writing Go code, but not because of any custom Go support.
</p>

<p>
</p>

<p>
If you have more questions, please consult <a href="http://golang.org/help/">these resources</a>.
</p></div>
    </content>
    <updated>2012-06-21T00:00:00Z</updated>
    <published>2012-06-21T00:00:00Z</published>
    <source>
      <id>tag:research.swtch.com,2012:research.swtch.com</id>
      <author>
        <name>Russ Cox</name>
        <email>rsc@swtch.com</email>
        <uri>https://plus.google.com/116810148281701144465</uri>
      </author>
      <link href="http://research.swtch.com/feed.atom" rel="self" type="application/atom+xml"/>
      <title>research!rsc</title>
      <updated>2012-09-17T15:00:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-5660770457576065555</id>
    <link href="http://mue.tideland.biz/feeds/5660770457576065555/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/06/release-200-of-common-go-library.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/5660770457576065555" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/5660770457576065555" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/06/release-200-of-common-go-library.html" rel="alternate" type="text/html"/>
    <title>Release 2.0.0 of the Common Go Library</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>I'm happy to announce the Release 2.0.0 of the <i>Tideland Common Go Library</i>. Most important part is the rework of the <i>cells</i> package for event-driven applications. Thanks to the early adopters of this package and their very useful hints. I hope they all now benefit from the modifications and don't have too much problems with the needed API changes. To give all of you a better introduction in how <i>cells</i> is working and has to be used I added a scenario simulating a shop with ordering, its stock, manufacturing and delivering.<br/><br/>Here are the changes:<br/><br/><h4> Asserts</h4><ul><li>Better messages for a direct usage inside of editors</li><li>Renamed 'Substring' and 'Implementor' asserts</li></ul><h4> Cells</h4><ul><li>Larger rework with improvements of reliability, performance and convenience</li><li>Cell adding now lazy using a factory</li><li>Additional multiple cell adding and subscribing</li><li>Emits inside a cell now via an own type instead of a channel</li><li>Integrated configuration</li></ul><h4> Config</h4><ul><li>New package</li><li>Configuration is key/value based</li><li>Backends are configuration providers</li><li>Simple map based provider in this release; more to come</li></ul><h4> Monitoring</h4><ul><li>Simplified output of execution times</li><li>No more total time and theoretical operations per second</li></ul><br/>You'll find the library at <a href="http://code.google.com/p/tcgl/">http://code.google.com/p/tcgl/</a>.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-5660770457576065555?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-06-17T21:24:56Z</updated>
    <published>2012-06-17T21:21:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="cells"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="cgl"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="asserts"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="monitoring"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="config"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/06/08/tlsversions</id>
    <link href="http://www.imperialviolet.org/2012/06/08/tlsversions.html" rel="alternate" type="text/html"/>
    <title>New TLS versions</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>TLS is the protocol behind most secure connections on the Internet and most TLS is TLS 1.0, despite that fact that the <a href="https://tools.ietf.org/html/rfc2246">RFC for 1.0</a> was published in January 1999, over 13 years ago.</p>

<p>Since then there have a two newer versions of TLS: <a href="https://tools.ietf.org/html/rfc4346">1.1</a> (2006) and <a href="https://tools.ietf.org/html/rfc5246">1.2</a> (2008). TLS 1.1 added an explicit IV for CBC mode ciphers as a response to CBC weaknesses that eventually turned into the BEAST attack. TLS 1.2 changes the previous MD5/SHA1 combination hash to use SHA256 and introduces AEAD ciphers like AES-GCM.</p>

<p>However, neither of these versions saw any significant adoption for a long time because TLS's extension mechanism allowed 1.0 to adapt to new needs.</p>

<p>But things are starting to change:</p>

<ul>
  <li>Google servers now support up to TLS 1.2.</li>
  <li>iOS 5 clients support up to TLS 1.2.</li>
  <li>Chrome dev channel supports up to TLS 1.1.</li>
  <li>Twitter, Facebook and Cloudflare appear to be deploying TLS 1.2 support, although the nature of large deployments means that this may vary during a gradual deployment.</li>
  <li>Opera supports up to TLS 1.2, although I believe that 1.1 and 1.2 are disabled by default.</li>
</ul>

<p>In the long run, getting to 1.2 is worthwhile. The MD5/SHA1 hash combination used previous versions was hoped to be more secure than either hash function alone, but [1] suggests that it's probably only as secure as SHA1. Also, the GCM cipher modes allow AES to be used without the problems (and space overhead) of CBC mode. GCM is hardware accelerated in recent Intel and AMD chips along with AES itself.</p>

<p>But there are always realities to contend with I'm afraid:</p>

<p>Firstly, there's the usual problem of buggy servers. TLS has a version negotiation mechanism, but some servers will fail if a client indicates that it supports the newer TLS versions. (Last year, Yngve Pettersen <a href="http://www.imperialviolet.org/2011/02/04/oppractices.html">suggested</a> that 2% of HTTPS servers failed if the client indicated TLS 1.1 and 3% for TLS 1.2.)</p>

<p>Because of this Chrome implements a fallback from TLS 1.1 to TLS 1.0 if the server sends a TLS error. (And we have a fallback from TLS 1.0 to SSL 3.0 if we get another TLS error on the second try.) This, sadly, means that supporting TLS 1.1 cannot bring any security benefits because an attacker can cause us to fallback. Thankfully, the major security benefit of TLS 1.1, the explicit CBC IVs, was retrofitted to previous versions in the form of 1/n-1 record splitting after the BEAST demonstration.</p>

<p>Since these fallbacks can be a security concern (especially the fallback to SSLv3, which eliminates ECDHE forward secrecy) I fear that it's necessary to add a second, redundant version negotiation mechanism to the protocol. It's an idea which has been floated before and I <a href="http://www.ietf.org/mail-archive/web/tls/current/msg08861.html">raised it again recently</a>.</p>

<p>But buggy servers are something that we've known about for many years. Deploying new TLS versions has introduced a new problem: buggy networks.</p>

<p>Appallingly it appears that there are several types of network device that manage to break when confronted with new TLS versions. There are some that break any attempt to offer TLS 1.1 or 1.2, and some that break any connections that negotiate these versions. These failures, so far, manifest in the form of TCP resets, which isn't currently a trigger for Chrome to fallback. Although we may be forced to add it.</p>

<p>Chrome dev or iOS users suffering from the first type of device see all of their HTTPS connections fail. Users suffering the second type only see failures when connecting to sites that support TLS 1.1 or 1.2. (Which includes Google.). iOS leaves it up to the application to <a href="https://developer.apple.com/library/ios/#technotes/tn2287/_index.html#//apple_ref/doc/uid/DTS40011309">implement fallback</a> if they wish and adding TLS 1.2 support to Google's servers has caused some problems because of these bad networks.</p>

<p>We're working to track down the vendors with issues at the moment and to make sure that updates are available, and that they inform their customers of this. I'm very interested in any cases where Chrome 21 suddenly caused all or some HTTPS connections to fail with <tt>ERR_CONNECTION_RESET</tt>. If you hit this, please let me know (<tt>agl</tt> at <tt>chromium</tt> dot <tt>org</tt>).</p>

<p>([1] Antoine Joux, <i>Multicollisions in Iterated Hash Functions: Application to Cascaded Constructions</i>, CRYPTO (Matthew K. Franklin, ed.), Lecture Notes in Computer Science, vol. 3152, Springer, 2004, pp. 306–316.)</p></div>
    </content>
    <updated>2012-06-08T07:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/210741765500702720</id>
    <link href="http://twitter.com/_rsc/statuses/210741765500702720" rel="alternate" type="text/html"/>
    <title>_rsc: @JetBlue Printing a boarding pass on a Mac never prints the bar code. Have seen this over and over for a year or two. Any fixes planned?</title>
    <summary>_rsc: @JetBlue Printing a boarding pass on a Mac never prints the bar code. Have seen this over and over for a year or two. Any fixes planned?</summary>
    <updated>2012-06-07T14:35:26Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2012/06/07/weak-hackathon-done</id>
    <link href="http://www.codegrunt.co.uk/2012/06/07/weak-hackathon-done.html" rel="alternate" type="text/html"/>
    <title>Weak Hackathon Done</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>After a weekend of hacking on my chess engine <a href="https://github.com/lorenzo-stoakes/weak">weak</a>, I’ve taken it from handling only king and pawn moves to being able to handle moves for all pieces, and over the past couple of days I have also added castling. Major props to the absolutely amazing <a href="http://chessprogramming.wikispaces.com/">chess programming wiki</a> which has been an invaluable source throughout.</p>

<p>Next, I need to add pawn promotion and catch up on technical debt - the code is a little messy, and there is a backlog of unit tests to improve.</p>

<p>After that there comes the <a href="http://en.wikipedia.org/wiki/En_passant">hairier</a> <a href="http://en.wikipedia.org/wiki/Three-fold_repetition">chess</a> <a href="http://en.wikipedia.org/wiki/50_move_rule">rules</a>, and then, finally, we come on to the interesting stuff - getting the damn thing play well (it’s already beaten me, but that doesn’t say much :-)</p></div>
    </content>
    <updated>2012-06-06T23:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2012/06/01/weak-hackathon</id>
    <link href="http://www.codegrunt.co.uk/2012/06/01/weak-hackathon.html" rel="alternate" type="text/html"/>
    <title>Weak Hackathon</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>This long bank holiday weekend I am planning to hack on my chess engine, <a href="https://github.com/lorenzo-stoakes/weak">weak</a>, and take it from its current rather incomplete state where it can play some king and pawn moves to a place where it can actually play a game of chess (albeit without rules like <a href="http://en.wikipedia.org/wiki/En_passant">en passant</a>, <a href="http://en.wikipedia.org/wiki/Threefold_repetition">threefold repetition</a>, and the like).</p>

<p>Once I am done I plan to write a blog post discussing its implementation and the realm of computer chess engines in general.</p>

<p>I am also currently working on a rather large <a href="http://golang.org">Go</a> blog post which is ballooning into a lot more work than expected, hence the succinctness of this post :-)</p></div>
    </content>
    <updated>2012-05-31T23:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry>
    <id>https://sites.google.com/feeds/content/kryas.com/kryas/9115924489623376879</id>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/5119061230095011683" rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"/>
    <link href="https://sites.google.com/a/kryas.com/kryas/recent_posts/latenciestoremember" rel="alternate" type="text/html"/>
    <link href="https://sites.google.com/feeds/revision/kryas.com/kryas/9115924489623376879" rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/9115924489623376879" rel="self" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/9115924489623376879" rel="edit" type="application/atom+xml"/>
    <title>Latencies to Remember</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox"><tbody><tr><td class="sites-layout-tile sites-tile-name-content-1"><div dir="ltr"><pre><div>L1 cache reference                  0.5 ns</div><div>Branch mispredict                   5 ns</div><div>L2 cache reference                  7 ns</div><div>Mutex lock/unlock                   25 ns</div><div>Main memory reference               100 ns</div><div>Compress 1K bytes with Zippy        3,000 ns</div><div>Send 2K bytes over 1 Gbps network   20,000 ns</div><div>Read 1 MB sequentially from memory  250,000 ns</div><div>Round trip within same datacenter   500,000 ns</div><div>Disk seek                           10,000,000 ns</div><div>Read 1 MB sequentially from disk    20,000,000 ns</div><div>Send packet CA-&gt;Netherlands-&gt;CA     150,000,000 ns<br/><br/><pre>By Jeff Dean (http://research.google.com/people/jeff/) &amp;<br/>posted here: https://gist.github.com/2841832<br/></pre><br/></div></pre></div></td></tr></tbody></table></div>
    </content>
    <updated>2012-05-31T15:08:14Z</updated>
    <published>2012-05-31T15:08:14Z</published>
    <category label="announcement" scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#announcement"/>
    <author>
      <name>Stan Steel</name>
      <email>steel@kryas.com</email>
    </author>
    <source>
      <id>https://sites.google.com/feeds/content/kryas.com/kryas</id>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#post" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas/batch" rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas?parent=5119061230095011683&amp;kind=announcement" rel="self" type="application/atom+xml"/>
      <title>Posts of Development Blog</title>
      <updated>2012-10-18T04:10:00Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-US">
    <id>http://blog.nella.org/?p=879</id>
    <link href="http://blog.nella.org/?p=879" rel="alternate" type="text/html"/>
    <title>Zero Downtime upgrades of TCP servers in Go</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">A recent post on the golang-nuts mailing list mentioned that Nginx can upgrade on the fly without ever stopping listening to it’s listen socket. The trick is to unset close-on-exec on the listen socket, then fork/exec a new copy of … <a href="http://blog.nella.org/?p=879">Continue reading <span class="meta-nav">→</span></a></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>A recent post on the golang-nuts mailing list mentioned that Nginx can upgrade on the fly without ever stopping listening to it’s listen socket. The trick is to unset close-on-exec on the listen socket, then fork/exec a new copy of the server (on the upgraded binary) with an argument to tell it to use the inherited file descriptor instead of calling socket() and listen(s).</p>
<p>I wanted to see if I could achieve the same thing with Go, and what changes would be necessary to the standard libraries to make this possible. I got it working, without changing the standard library, so I wanted to explain what I did here.</p>
<p>The code for this post is <a href="http://code.google.com/p/jra-go/source/browse/#hg%2Fcmd%2Fupgradable">here</a>.</p>
<p>There are several interesting things I’d like to point out in this program. Twice, I used the pattern of “implement an interface in order to intercept method calls”. This is an important pattern in Go that I don’t think is widely understood and documented.</p>
<p>When I started thinking about this job I knew one of my problems would be to dig down inside of http.(*Server).Serve in order to get it to stop calling Accept() when the old server should shutdown gracefully. The problem is that there’s no hooks in there; the only way out of the loop (“accept, start go routine to process, do it again”) is for Accept to return an error. But if you think of Accept as a system call, you might think, “I can’t get in there and inject an error”. But Accept() is not a system call: it’s a method in the interface net.Listener. Which means that if you make your own object which satisfies net.Listener, you can pass that in to http.(*Server).Serve and do what you want in Accept().</p>
<p>The first time I read about embedding types in structures I got lost and confused. And when I tried it, I had pointers in the mix and I had lots of unexplained nil pointer errors. This time, I read it again and it made sense. Type embedding is essential when you want to interpose one of the methods of an interface. It lets you inherit all the implementations of the underlying object except for the one that you redefine. Take a look at stoppableListener in upgradable.go. The net.Listener interface requires three methods including Accept, Close, and Addr. But I only defined one of those, Accept(). How is it that stoppableListener still implements net.Listener? Because the other two methods “show through” from where they were embedded in it. Only Accept() has a more precise definition. When I wrote Accept(), then I needed to figure out how to talk to the underlying object, in order to pass on the Accept() call. The trick here is to understand that embedding a type creates a new field in your structure with the unqualified name of the type. So I can refer to the net.Listener inside of stoppableListener <em>sl</em> as sl.Listener, and I can call the underlying Accept() as sl.Listener.Accept().</p>
<p>Next I started wondering how to handle the “stopped” error code from Serve(). Immediately exiting with os.Exit(0) isn’t right, because there can still be go routines servicing HTTP clients. We need some way to know when each client is done. Interposition to the rescue again, since we can wrap up the net.Conn returned by Accept() and use it to decrement a count of the number of currently running connections. This technique of interposing the net.Conn object could have other interesting uses. For example, by trapping the Read() or Write() calls, you could enforce rate limiting on the connection, without needing the protocol implementation to know anything about it. You could even do other zany things like implement opportunistic encryption, again without the protocol knowing it was happening.</p>
<p>Once I knew that I would be able to stop my server gracefully, I needed to figure out how to start the new one on the correct file descriptor. Rog Peppe pointed me to the net.FileListener object, which one can construct from an *os.File (which you can make from a raw file descriptor in an int using os.NewFile).</p>
<p>The final problem is that net always sets the close-on-exec flag on file descriptors for sockets it opens. So I needed to turn that off on the listen socket, so that the file descriptor would still be valid in the new process.  Unfortunately syscall.CloseOnExec does not take a boolean to tell it what you want (do close or don’t close). So instead, I pulled out the stuff from syscall that I needed and put it directly in upgradable.go. Not pretty, but nicer than hacking the standard library. (This is a nice thing about Go: there’s almost always a way to do what you want, even if you have to hack around just a bit.)</p>
<p>I tested that it works manually (using command-line GETs from another window). I also tested it under load using <a href="http://www.acme.com/software/http_load/">http_load</a>. It is really cool to be able to set up a load test for 20 seconds and get 3937 fetches/sec, then do the test again, adding in a few “GET http://localhost:8000/upgrade” from another window and still getting 3880 fetches/sec, even as I replaced the running binary a few times <strong>during</strong> the load test!</p></div>
    </content>
    <updated>2012-05-29T12:09:16Z</updated>
    <category term="The Go Programming Language"/>
    <author>
      <name>jra</name>
    </author>
    <source>
      <id>http://blog.nella.org</id>
      <link href="http://blog.nella.org/?feed=rss2" rel="self" type="application/atom+xml"/>
      <link href="http://blog.nella.org" rel="alternate" type="text/html"/>
      <title>jra's thoughts</title>
      <updated>2012-10-15T17:00:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-6376213578647168534</id>
    <link href="http://reneefrench.blogspot.com/feeds/6376213578647168534/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=6376213578647168534" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6376213578647168534" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6376213578647168534" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/05/blog-post_7772.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://2.bp.blogspot.com/-EwKINdv6gow/T8AhSqaZIJI/AAAAAAAAE3c/8EVlgy9zC7g/s1600/shotgunguy.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://2.bp.blogspot.com/-EwKINdv6gow/T8AhSqaZIJI/AAAAAAAAE3c/8EVlgy9zC7g/s320/shotgunguy.jpg" width="298"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-6376213578647168534?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-05-26T00:18:24Z</updated>
    <published>2012-05-26T00:18:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-10-11T11:35:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-7018738182793927399</id>
    <link href="http://mue.tideland.biz/feeds/7018738182793927399/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/05/fun-with-interfaces-and-higher-order.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/7018738182793927399" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/7018738182793927399" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/05/fun-with-interfaces-and-higher-order.html" rel="alternate" type="text/html"/>
    <title>Fun with interfaces and higher-order functions</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>Imagine you're developing a runtime environment which can be used by other developers as a container for components. I've done it in my <i>cells</i> package for event-driven applications. Here the user has to implement an interface called <span style="font-family: 'Courier New', Courier, monospace;">Behavior</span>. It defines the four methods<br/><br/><ul><li><span style="font-family: 'Courier New', Courier, monospace;">Init(env *Environment, id string) error</span></li><li><span style="font-family: 'Courier New', Courier, monospace;">ProcessEvent(e Event, emitter Eventemitter)</span></li><li><span style="font-family: 'Courier New', Courier, monospace;">Recover(r interface{}, e Event)</span></li><li><span style="font-family: 'Courier New', Courier, monospace;">Stop() error</span></li></ul><br/>Those behavior implementations can now be deployed to an <span style="font-family: 'Courier New', Courier, monospace;">Environment</span> with user-defined id for later subscription/unsubscription or removing. But an id must not be used more than once. This has to be checked before the behavior instance will be created. Otherwise it could be that this type allocates memory or even opens files or network connections.<br/><br/>But how to do that? I simply created another type called <span style="font-family: 'Courier New', Courier, monospace;">BehaviorFactory</span> which is simply a <span style="font-family: 'Courier New', Courier, monospace;">func() Behavior</span>. So if the behavior implementation has a constructor function like<br/><br/><span style="font-family: 'Courier New', Courier, monospace;">func myBehaviorFactory() Behavior {</span><br/><span style="font-family: 'Courier New', Courier, monospace;">    return &amp;myBehavior{}</span><br/><span style="font-family: 'Courier New', Courier, monospace;">}</span><br/><br/>the deployment can be done with<br/><br/><span style="font-family: 'Courier New', Courier, monospace;">myEnv.AddCell("myId", myBehaviorFactory)</span><br/><span class="Apple-tab-span" style="white-space: pre;"> </span><br/>Now <span style="font-family: 'Courier New', Courier, monospace;">AddCell()</span> first checks if the id is free. Only in this case the instance is created by calling the factory function and then call <span style="font-family: 'Courier New', Courier, monospace;">Init()</span> on the new created behavior.<br/><br/>But sometimes you may need to pass some configuration data to a behavior. How can we realize that? Here <i>higher-order functions</i> are helping. Instead of writing a simple factory function just write a factory returning function.<br/><br/><span style="font-family: 'Courier New', Courier, monospace;">func newMyBehaviorFactory(fileName string) BehaviorFactory {</span><br/><span style="font-family: 'Courier New', Courier, monospace;">    return func() Behavior { return &amp;myBehavior{fileName} }</span><br/><span style="font-family: 'Courier New', Courier, monospace;">}</span><br/><span class="Apple-tab-span" style="white-space: pre;"> </span><br/>Now the deployment can be done with<br/><br/><span style="font-family: 'Courier New', Courier, monospace;">myEnv.AddCell("myId", newMyBehaviorFactory(fileName))</span><br/><span class="Apple-tab-span" style="white-space: pre;"> </span><br/>The call of <span style="font-family: 'Courier New', Courier, monospace;">newMyBehaviorFactory()</span> now creates the factory function which then is used inside of <span style="font-family: 'Courier New', Courier, monospace;">AddCell()</span>.<br/><br/>But there is more fun with interfaces. The behaviors shall be able to control some runtime aspects. Those are the length of the event queue (aka <i>channel</i>) and if the instances shall be pooled, how large the pool shall be and if the instances of this pool are stateful or not. Many behaviors don't care, they simply implement the <span style="font-family: 'Courier New', Courier, monospace;">Behavior</span> interface. But those who are interested implement the <span style="font-family: 'Courier New', Courier, monospace;">AsynchronousBehavior</span> interface with the method<br/><br/><ul><li><span style="font-family: 'Courier New', Courier, monospace;">QueueLength() int</span></li></ul><br/> and/or the <span style="font-family: 'Courier New', Courier, monospace;">PoolableBehavior</span> interface with the method<br/><br/><ul><li><span style="font-family: 'Courier New', Courier, monospace;">PoolConfig() (poolSize int, stateful bool)</span>.</li></ul><br/> Inside of <span style="font-family: 'Courier New', Courier, monospace;">AddCell()</span> the type assertion is now used to check if the behavior implements those interfaces like<br/><br/><span style="font-family: 'Courier New', Courier, monospace;">queueLength := 1</span><br/><span style="font-family: 'Courier New', Courier, monospace;">if ab, ok := behavior.(AsynchronousBehavior); ok {</span><br/><span style="font-family: 'Courier New', Courier, monospace;">    queueLength = ab.QueueLength()</span><br/><span style="font-family: 'Courier New', Courier, monospace;">}</span><br/><span class="Apple-tab-span" style="white-space: pre;"> </span><br/>This way the behaviors only have to implement those methods if needed, pretty simple. Go really is a wonderful pragmatic and flexible language.<br/><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-7018738182793927399?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-05-25T21:11:16Z</updated>
    <published>2012-05-25T21:11:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="cells"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="cgl"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2012/05/18/Whats-the-Appeal-of-Programming</id>
    <link href="http://www.codegrunt.co.uk/2012/05/18/Whats-the-Appeal-of-Programming.html" rel="alternate" type="text/html"/>
    <title>What's the Appeal of Programming?</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><h2 id="a_quick_aside">A Quick Aside</h2>

<p>Before I get stuck into this post, I want to quickly mention my <a href="http://www.codegrunt.co.uk/2012/05/08/Brittleness-Type-Hierarchies.html">last</a>. It got to the front page of <a href="http://news.ycombinator.com">Hacker News</a> and stayed there for around a day. I submitted it on a whim and did not expect it to get even the slightest bit of attention. Thank you everybody who upvoted it, I am amazed and humbled that people found it (at least somewhat) interesting.</p>

<p>I fully intend to investigate the issue further and to write a follow up. There were some great comments on the <a href="http://news.ycombinator.com/item?id=3943201">Hacker News thread</a> and on the article itself - leads for further research.</p>

<p>I also want to make it clear that the items listed on my <a href="http://www.codegrunt.co.uk/2012/04/26/Upcoming.html">upcoming</a> post are coming, however the posts on that list require a fair bit of work and I want to make sure they’re as good as I want them to be. In order to stick to my promised post/week I need to ‘buffer’ a number of meatier posts, meanwhile I am going to throw out ideas I’ve wanted to express for some time.</p>

<p>The subject of today’s post is one of these things I’ve wanted to write about for a while and by coincidence there was a recent <a href="http://news.ycombinator.com/item?id=3975744">HN furore</a> regarding <a href="http://www.codinghorror.com/">Jeff Atwood</a>’s latest blog post - <a href="http://www.codinghorror.com/blog/2012/05/please-dont-learn-to-code.html">Please Don’t Learn to Code</a> - which addresses related issues, so I was motivated to write this now. I will try to pull the threads together.</p>

<h2 id="why_do_i_code">Why Do I Code?</h2>

<p>Growing up I spent a lot of time playing around with BASIC on my <a href="http://en.wikipedia.org/wiki/Zx_spectrum">ZX Spectrum</a>, and more than anything got a massive kick out of seeing this stuff actually do something, actually <em>working</em> on my computer. It was so satisfying.</p>

<p>Ever since, it has been that kick of seeing something actually come together, actually doing something which has driven my interest in computing. It might sound petty, but this thrill has never quite left me, and I really do think it lies at the heart of the pleasure of the thing. To quote <a href="http://edweissman.com/">edw519</a>:-</p>

<blockquote>
<p>The best part is getting something working for the first time where nothing was there before. For me, this is so exciting that I still I do a “happy dance” every time.</p>
</blockquote>

<p>One utterly delightful aspect of programming is how low the barriers are to building things. If you wanted to design and build a car, say, you’d need lots of money and lots of people and a funnelling process from idea to physical reality to achieve your dreams, with plenty of difficult compromises in between. You’d certainly find it incredibly challenging not to mention expensive to try this on your own, to the extent it would be rather mad to try it at all.</p>

<p>Compare this to programming - all you need is a computer - even an ultra-cheap laptop is sufficient, and that combined with the web and all the free material out there is enough to get you from any level to really rather proficient limited only by your attitude and hard work. I can think of nothing else quite like it.</p>

<p><a href="http://en.wikipedia.org/wiki/Fred_Brooks">Fred Brooks</a> <a href="http://en.wikiquote.org/wiki/Fred_Brooks#The_Mythical_Man-Month:_Essays_on_Software_Engineering_.281975.2C_1995.29">put it</a> far more eloquently than I ever could:-</p>

<blockquote>
<p>The programmer, like the poet, works only slightly removed from pure thought-stuff. He builds castles in the air, from air, creating by exertion of the imagination. <span>…</span> Yet the program construct, unlike the poet’s words, is real in the sense that it moves and works, producing visible outputs separate from the construct itself. <span>…</span> The magic of myth and legend has come true in our time. One types the correct incantation on a keyboard, and a display screen comes to life, showing things that never were nor could be.</p>
</blockquote>

<p>Solving abstract problems with few constraints while still actually having an impact on the real world is a large part of the appeal of programming. It’s important <a href="http://www.youtube.com/watch?v=8r1CZTLk-Gk">not to forget</a> what a miracle this stuff is - we build things which ‘exist’ in what amounts to an imaginary world of electrons travelling around lumps of transmuted sand which somehow do things which people find useful, so useful in fact, that these ghosts in the machine have utterly revolutionised the world and continue to do so at an ever increasing rate.</p>

<h2 id="programming_and_talent">Programming and Talent</h2>

<p>It is my strong conviction that talent and intelligence are the smallest components of the make up of a good programmer. I do believe they make a difference, but are important to a lesser degree than many think.</p>

<p>You need to be able to think logically and be capable of keeping a certain degree of state in your mind, that’s the talent of it, and you need to be bright enough to explore a problem sufficiently to find a solution, which is where the intelligence lies. But these are only <em>pre-requisites</em>. If you have enough of both, then you are going to be able to program (it turns out that a surprising number of people <a href="http://www.codinghorror.com/blog/2007/02/why-cant-programmers-program.html">cannot</a>, though to what degree that is talent vs. attitude I dont know.)</p>

<p>Attitude is the really crucial component. The vast size of the subject matter and the vast complexity of the machine in front of you means hubris is the biggest error you can possibly make. You <em>will</em> make mistakes, do stupid things, and misunderstand what the computer is actually doing much of the time. The vital attitude to have in facing this reality is to remain <a href="http://www.cs.utexas.edu/users/EWD/transcriptions/EWD03xx/EWD340.html">humble</a>. As <a href="http://en.wikipedia.org/wiki/Edsger_W._Dijkstra">Dijkstra</a> put it:-</p>

<blockquote>
<p>The competent programmer is fully aware of the strictly limited size of his own skull; therefore he approaches the programming task in full humility, and among other things he avoids clever tricks like the plague.</p>
</blockquote>

<p>A programmer who lacks this humility can be absolutely nightmarish to deal with. Mistakes get brushed under the carpet, code remains an awful unmaintainable mess because ‘it works’ and that’s sufficient (that whole subject is likely to be an entire other ranty post), and things never improve because the first step in improving something is to admit that there’s something which needs improving. You can’t <a href="http://www.codinghorror.com/blog/2006/03/sucking-less-every-year.html">suck less every year</a> without admitted you suck in the first place.</p>

<p>The other, slightly less important, but still critical component of being a good programmer is hard work. Things are always harder than they seem. Any non-trivial problem you’re dealing with will screw you over repeatedly before you solve it, and not until you’ve felt like giving up 3 times will it finally decide to behave. Oh, and the final 10% of the project will <a href="http://en.wikipedia.org/wiki/Ninety-ninety_rule">take 90% of the time</a>. You just have to keep on going.</p>

<p>This latter point is in fact a lesson I’ve had to learn the hard way with personal projects. I have started several highly ambitious projects, only to hit problems early and give up (‘hey this is meant to be a hobby, this is no fun!’, etc.) - my chess engine project, <a href="https://github.com/lorenzo-stoakes/weak">weak</a>, may be progressing slowly, but it <em>is</em> progressing and I refuse to give up on it.</p>

<p>Another skill which matters rather a lot is the ability to communicate. If you can’t communicate your great idea or the fatal technical flaw in a proposed plan, then no matter how able you are as a developer your voice just won’t be heard. Also, if you can’t communicate well it’s a lot easier to end up in realms of unpleasantness with others, which gets in the way of everything.</p>

<h2 id="storm_in_a_teacup">Storm in a Teacup</h2>

<p>Back to the <a href="http://news.ycombinator.com/item?id=3975744">furore</a>. I strongly believe that programming should be open for all, and new programmers welcomed with open arms. This thing is amazing and nobody has the right to tell anybody that they can’t choose to learn this craft and get that wonderful kick out of making computers actually do stuff. The fact that there has been a <a href="http://codeyear.com/">big movement</a> to spread coding knowledge is great, the more the merrier I say.</p>

<p>Having said that, I think Jeff has hit on an inconvenient and slightly unpalatable truth which strongly links back to the two crucial characteristics of a good programmer. What we emphatically <em>don’t</em> need are new programmers who believe programming is incredibly easy yet wonder why their spaghetti monster runs so slowly, or managers who learn to write a very simple rails app and therefore get to treat you with less respect because it’s ‘all so easy’. Most of all, we don’t need people thinking developers are <a href="http://en.wikipedia.org/wiki/Fungible">fungible</a> commodities, because that simply ain’t so.</p>

<p>What’s needed is humility, commitment, and an understanding that it takes <a href="http://norvig.com/21-days.html">many years</a> to become truly proficient at this craft.</p>

<p>Another uncomfortable truth is that we professional programmers often feel threatened by the idea that all these young whippersnappers might come in and make us look incredibly stupid and redundant. The nightmare scenario of an inexperienced guy coming in and doing in 1 week what took you 4 months is not a pleasant thought.</p>

<p>The solution is to <a href="http://learncodethehardway.org/blog/MAY_15_2012.html">not attach your identity</a><sup>1</sup> too closely to your code. <a href="http://www.youtube.com/watch?v=wo-wkv8gW6k">You are not your job</a>. Personally I’ve found this a very hard lesson and it’s something I still struggle with<sup>2</sup>, but forming this separation is so clearly the answer that it’s worth the struggle.</p>

<p>Try to be the best programmer you can be. Focus on creating solutions to people’s problems because that’s ultimately what matters, but don’t forget that maintainability matters too and code quality informs a lot of the externally observable quality of your solution.</p>

<p>Have fun. Build stuff you’re proud of. And above all else, be <em>nice</em> to other people who are also trying to improve themselves. I know I fail at that often enough myself, and it can sometimes be incredibly difficult, but ultimately we are all idiots, so the best we can do is to try and help each other be a little less stupid.</p>

<h2 id="notes">Notes</h2>

<h3 id="1">1</h3>

<p>I reference this post in order to give credit where it’s due. I want to make it clear that I actually strongly dislike the tone of <a href="http://en.wikipedia.org/wiki/Zed_Shaw">Zed Shaw</a>’s blog post, not to mention many other occasions where he’s, in my opinion, acted in rather a bullying fashion (e.g. <a href="http://oppugn.us/posts/1272050135.html">this</a> and of course <a href="http://www.zedshaw.com.sharedcopy.com/rants/51489cec9386f7c13f69b3a58cd50b02.html">this</a>). He is a great programmer, and his books are equally brilliant, but his behaviour towards others is not.</p>

<p>As I <a href="http://news.ycombinator.net/item?id=3978685">commented</a> on <a href="http://news.ycombinator.com">hacker news</a>, my perception of that kind of bullying nastiness put me off working on anything public for a long while. I take responsibility for my lack of productivity, but that kind of attitude certainly didn’t help anything. I don’t think it helps anybody.</p>

<h3 id="2">2</h3>

<p>I don’t want to be too much of a pop psychologist, but I do wonder whether the stereotypical experience of feeling somewhat inadequate at school while finding a means of gaining a sense of value via programming/working with computers binds self worth to your work early on. Of course, this is by no means the experience of all programmers out there, but I do think it is the experience of a fair few, including myself.</p></div>
    </content>
    <updated>2012-05-17T23:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-14915826.post-5504160530843392212</id>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/5504160530843392212" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/5504160530843392212" rel="self" type="application/atom+xml"/>
    <link href="http://going-along.blogspot.com/2012/05/blog-post.html" rel="alternate" type="text/html"/>
    <title>走过这个城市</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-VV4z40HZbFg/T65PHK3IBWI/AAAAAAAAAKw/AETLhQ-boT0/s1600/2012-05-10%2B20.36.55.jpg" style="clear: right; float: right; margin-left: 1em; margin-bottom: 1em;"><img border="0" height="400" src="http://1.bp.blogspot.com/-VV4z40HZbFg/T65PHK3IBWI/AAAAAAAAAKw/AETLhQ-boT0/s400/2012-05-10%2B20.36.55.jpg" width="300"/></a></div><br/>
走在丝雨中，完全没有赶路的意思。一种安心，让我醉了。是陶醉在满足里。<br/>
<br/>
走在从美术馆回来的路上，再次驻足在那家咖啡店的外面。已经要打烊了。女主人还在忙着。临街的座位，就是我带走满意的地方。<br/>
<br/>
结帐时，我轻轻的问：“请问到底Forty Cafe里加了什么果实“？她答：”就只是这种高级的Espresso独特的香味。“。她朗朗的笑了一下。笑走了刚才满脸的倦意。是的，再用心做同一件事，久了也是无奈的疲态。但只需客人能略微的感动，就值回全心的付出了。<br/>
<br/>
是一种什么样的感觉？那味道是直达舌底的，很熟悉又不能想起。一次次的抚起杯子，让那香气帮我回忆。慢慢一口一口的咽下，舌跟挥之不去的思绪。淡淡的甜，但带着浓郁。是了是了，是小时候留口水的烤地瓜的味道。<br/>
<br/>
问好了去国美的路，目的是寻找这间咖啡店。刚好赶在饭口前，也因为没有预约，只能沿窗一排坐下。选好了生菜沙拉，清口。然后是一碗玉米粥配烤面包，适口。再下来主菜沙朗鹅肝。这时天已经完全黑了，店里也是满满的。但丝毫没有喧哗。大家都静静的交谈着，夹杂着轻碰玻璃杯的悦耳。忽然觉得腿有些麻了。原来是保持一个姿势太久了，太专注于沙朗的嫩和鹅肝的滑了。<br/>
<br/>
”台中有些慢，还有些人情味在。“昨天回来时，计程车司机说。他以为我从台北过来，一路和我慢慢的聊着。讲着小时候还能搭公车，可现在捷运还不知何时建好，公车也越来越少。每台车都等在场里，等着附近的电话招呼。满街都是小摩托。那我那天从逢甲夜市出来，能在交通灯口拦下一辆空车，是幸运的了。<br/>
<br/>
更幸运的是我能系上安全带。今天的计程车突然刹停。我的电脑包重重地甩到座位下。我也猛地从沉迷的书中抬起头来大喝怎么啦。司机大叔连声对不起，走下车，从路上拾起一个铁笼子，帮前面比卡的司机搬上去，却完全没有责怪的意思。这是个包容的城市，狭窄的路上忙乱的车流大家彼此迁就着。我也就不能再发作什么了。<br/>
<br/>
但也不尽然，前天的路险可是让我Oh My God。同事开车送我，就惊见一辆红色小面包突然从拐角冲出来，闪过一个要横穿马路的摩托，擦着我们就跑远了。Oh My God。几乎就撞到那个万幸的骑士，几乎我就亲眼目击一桩惨祸。<br/>
<br/>
今天的电视新闻，一辆花莲的旅游车，爬山路时换档不慎失去动力，载着13名南韩游客下滑翻覆到28米深的溪谷。万幸有树木拖住在8米处，又有一个管理员碰巧经过及时报警救援，得以保全每个人的生命。管理员的车载镜头录像了整个过程，使我们得以亲眼看到别人的不幸万幸，再庆幸。<br/>
<br/>
又是一场不幸，雪山隧道猛烈燃烧一户人家化为碳与青烟，小孩无从辨认需DNA验证。为什么这两天台湾事故连连？其实这世界每时每刻都在重复着幸与不幸的故事，只是没有人强迫我们做我们旁观者。来了台湾才发现媒体上充斥的都是这些负面，或者是一些喧哗燥浮。不。这肯定不是全部。至少我亲眼亲身的是一个和善安逸的社会。<br/>
<br/>
刚到台湾的第二天就去了日月潭。潭不大也不惊艳只是静静的绿水既不像日圆也没有月弯。和本岛游玩的人一样我租了一辆单车，就在和风煦日中远离了大团的游客。沿湖边一路骑行，轻松自在。偶尔停下看看，照个照片。偶尔猛骑一通，感受一下风的力度。不觉得3km的单车道到头要回头了，就不加思索的把车推上了山，准备来个33公里的环湖一圈。之前在游客中心问过要4个小时，也没注意到自己还穿着上班的牛仔T-shirt。等满身大汗气喘连连的爬到山顶，才后悔没换上短装。只好卷起裤腿坚持下去。还好下去的一路飞驰的痛快让我忘了刚刚的辛苦无奈。这样一路滑到12Km处，又是一段长长的上坡山路。37速的捷安特山地车也骑不动了，只能慢慢推行。沿路对面有些飞行而过的快乐骑士，还有个老太太冲我喊加油。感觉这到10Km处的两千米最为吃力。还好又是一路下坡直到玄奘寺渡口。当然想都没想做船横渡回去，还剩10公里已经想着老太太给的鼓励又上路了。这段上坡好辛苦，又要躲着大小汽车，又要担心峭壁的落石。还好带够了水一路不停地喝，又吃着飞机上留下来的杂果，熬过了午餐时段的饥饿，一路上上下下地到了尹达邵渡口。吃了山猪肉串和皮串，买了猫头鹰纪念，看看表已经骑了3个小时了，这剩下6公里的山路就坚持吧就坚持到了终点。车店的老板娘夸我厉害我只能苦笑着说很好玩然后等着晚上精疲力竭地和老婆Skype时再被夸赞损我go nuts。<br/>
<br/>
-- fango<br/><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/14915826-5504160530843392212?l=going-along.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-05-12T11:53:14Z</updated>
    <published>2012-05-10T14:48:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Life"/>
    <author>
      <name>Fango</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-14915826</id>
      <category term="MCU"/>
      <category term="D'sign"/>
      <category term="Life"/>
      <category term="Go"/>
      <category term="C"/>
      <category term="OS"/>
      <author>
        <name>Fango</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://going-along.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/14915826/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://going-along.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">#! contact | sed s@Fango@\ <i>fanhoward@g</i> | <i>mail</i> #!<i>.com</i> <br/>
#! fortune <br/>
  I'm a proud Go <a href="http://groups.google.com/group/golang-dev/browse_thread/thread/66d3092f4da31718">contributor </a>today. Wow.</div>
      </subtitle>
      <title>Going Along</title>
      <updated>2012-08-13T14:08:38Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-14915826.post-7939800001893883704</id>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/7939800001893883704" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/7939800001893883704" rel="self" type="application/atom+xml"/>
    <link href="http://going-along.blogspot.com/2012/05/blog-post_11.html" rel="alternate" type="text/html"/>
    <title>浪费半天在台北</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">6：40起床吃已经吃了七天腻到不行的饭店早餐。想到中午吃好点儿吧就几乎饿着check out搭计程车240元到高铁，用机器买8点的票到台北700元。一路翻译'银河搭车手册'转眼到站好像是9点。出站就直奔地图搞清楚捷运出口却发现搭669号公车也到101还能看街景就花了好长时间才找到Y8出口又等了更长时间才发现这号车40分钟才一趟直站到两腿发麻找个石凳坐下就这时来车了。已是10点了不过车票超级便宜15块就一路摇晃着看到了101就急忙下车了。正碰到new ipad开卖十几个模特摆pose就跟着媒体疯照了一通。信步走入101直奔5楼的观景售票点450元，但回身看到长长喧哗的观光队伍就立马没来兴致。发现旁边有寄存箱自设密码不要钱也没人用，就把沉重的电脑包扔进去一身轻松的window shopping lv channel等等国辱太太的最爱。没啥看的就下楼吃鼎泰封小笼包和最贵的450块5个的松露包饱餐之后就搭免费公车到捷运站。心想着抓紧时间到高铁的诚品买本书就按机器35块到板桥站。车过台北火车站时我不安了一下可是因为正忙着打这些字就一路出来捷运直奔高铁售票机器，看表是12点半就买1：44的票130元才突然发现我没去台北站却到了下一站新北。罢了罢了走到哪算哪开始绝望的到处转希望也能找个书店。这里可是啥都没有双肩开始发沉就走到检票口的长椅子上坐下把这段在手机上写完。写到1：15为打发时间就谈谈今天联合报发表的韩寒的博客讲他喜欢台湾人感谢港台保存了中华文化欲言又止。我可能可以说得更好但我不学鲁迅了投匕首被人捧痛苦到自己抽到烟死。1：30到起身等车10分钟就到了桃园。 顺便到华行柜台办理登机。要有行李在此托运快过到机场办理。坐公车30元到机场我还在坐着记录下这些文字。2：25到3：35才登机就在一家餐厅门口坐下享用他们的无线网络。下次来台北怎么也要住宿一晚，这是个越夜越美的城市好像每个人都要街上逛逛买些小吃走走看看打发时间。这次只是过路就在手机是草草记录也是打发时间吧。胡言乱语就此EOF。<br/>
<div class="separator" style="clear: both; text-align: center;"><a href="http://1.bp.blogspot.com/-m1qi8QbrRZk/T64pPLkcjJI/AAAAAAAAAKg/ORIyErIfn9g/s1600/2012-05-11%2B10.36.15.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="300" src="http://1.bp.blogspot.com/-m1qi8QbrRZk/T64pPLkcjJI/AAAAAAAAAKg/ORIyErIfn9g/s400/2012-05-11%2B10.36.15.jpg" width="400"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/14915826-7939800001893883704?l=going-along.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-05-12T09:13:16Z</updated>
    <published>2012-05-11T14:28:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Life"/>
    <author>
      <name>Fango</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-14915826</id>
      <category term="MCU"/>
      <category term="D'sign"/>
      <category term="Life"/>
      <category term="Go"/>
      <category term="yi"/>
      <category term="C"/>
      <category term="OS"/>
      <author>
        <name>Fango</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://going-along.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/14915826/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://going-along.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">#! contact | sed s@Fango@\ <i>fanhoward@g</i> | <i>mail</i> #!<i>.com</i> <br/>
#! fortune <br/>
  I'm a proud Go <a href="http://groups.google.com/group/golang-dev/browse_thread/thread/66d3092f4da31718">contributor </a>today. Wow.</div>
      </subtitle>
      <title>Going Along</title>
      <updated>2012-06-21T10:48:21Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2012/05/08/Brittleness-Type-Hierarchies</id>
    <link href="http://www.codegrunt.co.uk/2012/05/08/Brittleness-Type-Hierarchies.html" rel="alternate" type="text/html"/>
    <title>The Brittleness of Type Hierarchies</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>In this post I explore what I perceive to be a fundamental issue with object orientation via a type hierarchy.</p>

<h2 id="apologetic_preamble">Apologetic Preamble</h2>

<p>I want to make it clear that this post is emphatically not an attack on C# (a language I admire<sup>1</sup>), nor is C# the only language to implement type hierarchies (java is a better-known language which takes this approach), rather it’s a criticism of a general trait of the kind of object orientation implemented<sup>2</sup> by languages like C#, which due to my familiarity with it is the language I use in this post to explore my point.</p>

<h2 id="the_problem">The Problem</h2>

<p>When you write a program using a C#-like language you typically start by modelling your problem as a hierarchical set of classes which represent your domain. You then procede to ‘flesh out’ and expand upon these types with code which actually implements your program.</p>

<p>After a while you inevitably find an exception to the rules of the system you have created - your types turn out not to match the problem in some way. Typically this occurs later after a lot of work has already been done which is now strongly tied to the structure of your type hierarchy, so you are left with a problem - do you hack around the incongruity, usually the quickest solution, or restructure your types to adapt to the new requirement?</p>

<p>If you choose the former your hierarchy not only fails represent the problem anymore, it actively misleads you about it. If you choose the latter, you end up spending a long time <a href="http://en.wiktionary.org/wiki/yak_shaving">yak shaving</a> - working on something which has absolutely nothing to do with the problem itself and is purely a product of the system in which you are writing your program - the very definition of <a href="http://en.wikipedia.org/wiki/Accidental_complexity">accidental complexity</a>.</p>

<h2 id="a_concrete_example">A Concrete Example</h2>

<p>To explore this problem more concretely, let’s take a look at an actual example.</p>

<p>Note that, whatever example I choose, it’s inevitable that it will not fully capture this problem the way architecting a big project under deadline pressure will. However, exploring actual code is of such value that I think it worth doing regardless.</p>

<p>That said, let’s consider a type hierarchy which represents trades made on financial exchanges:-</p>
<div class="highlight"><pre><code class="csharp"><span class="k">class</span> <span class="nc">Exchange</span> <span class="p">{</span>
    <span class="k">public</span> <span class="kt">string</span> <span class="n">Bic</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
    <span class="k">public</span> <span class="kt">string</span> <span class="n">Name</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
<span class="p">}</span>

<span class="k">abstract</span> <span class="k">class</span> <span class="nc">Security</span> <span class="p">{</span>
    <span class="k">public</span> <span class="kt">string</span> <span class="n">Description</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
    <span class="k">public</span> <span class="n">Exchange</span> <span class="n">Exchange</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
    <span class="k">public</span> <span class="kt">string</span> <span class="n">Isin</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
<span class="p">}</span>

<span class="k">class</span> <span class="nc">Stock</span> <span class="p">:</span> <span class="n">Security</span> <span class="p">{</span>
<span class="p">}</span>

<span class="k">class</span> <span class="nc">Bond</span> <span class="p">:</span> <span class="n">Security</span> <span class="p">{</span>
    <span class="k">public</span> <span class="n">DateTime</span> <span class="n">Expiry</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
<span class="p">}</span>

<span class="k">class</span> <span class="nc">Trade</span> <span class="p">{</span>
    <span class="k">public</span> <span class="kt">decimal</span> <span class="n">Price</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
    <span class="k">public</span> <span class="kt">decimal</span> <span class="n">Quantity</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
    <span class="k">public</span> <span class="n">Security</span> <span class="n">Security</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
<span class="p">}</span>
</code></pre>
</div>
<p>So far, so good - this seems like a sensible approach and so we go ahead and write a lot of code around this hierarchy.</p>

<p>The code gradually becomes deeply <a href="http://en.wikipedia.org/wiki/Coupling_(computer_science)">coupled</a> to our type design - we expect all financial securities to possess an ISIN (an international identification number), a description and an exchange which itself possesses a name and a BIC (bank identification code), we expect stocks to possess no extra properties, bonds to possess expiry dates, and trades to possess a security, price and quantity. The client is happy, the system works well and your code is nice and clean.</p>

<p>Suddenly the client demands a change - they are about to trade options and need to bring them into the system. Fine you think, so you come up with a class:-</p>
<div class="highlight"><pre><code class="csharp"><span class="k">class</span> <span class="nc">Option</span> <span class="p">:</span> <span class="n">Security</span> <span class="p">{</span>
    <span class="k">public</span> <span class="kt">bool</span> <span class="n">Call</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
    <span class="k">public</span> <span class="kt">decimal</span> <span class="n">LotSize</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
    <span class="k">public</span> <span class="n">DateTime</span> <span class="n">Maturity</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
    <span class="k">public</span> <span class="kt">decimal</span> <span class="n">StrikePrice</span> <span class="p">{</span> <span class="k">get</span><span class="p">;</span> <span class="k">set</span><span class="p">;</span> <span class="p">}</span>
<span class="p">}</span>
</code></pre>
</div>
<p>But a problem arises - options are typically <em>not</em> assigned ISINs, and now we have a property which is meaningless for options. We are faced with the dilemma - a lot of the code is now reliant on <code>Isin</code>, and <code>NullReferenceException</code>s are getting thrown all over the place because the field isn’t getting populated. Do we remove the <code>Isin</code> field from <code>Security</code> and create a separate classification between physical and derivative securities (or perhaps ISIN-possessing instruments and non-ISIN-possessing instruments) - one containing <code>Isin</code> and one not? Or do we find some other, less salubrious way around the problem?</p>

<p>The client is getting angry now - there’s a hold up, developers are arguing about what to do, and the trading systems needs to be in place by the next day or some <a href="http://en.wikipedia.org/wiki/P45_(tax)">P45</a>s are going to be handed out. So it’s decided - quick-fix now, real fix later:-</p>
<div class="highlight"><pre><code class="csharp"><span class="c1">// Lots of:-</span>
<span class="k">if</span><span class="p">(</span><span class="n">security</span><span class="p">.</span><span class="n">Isin</span> <span class="p">==</span> <span class="k">null</span><span class="p">)</span> <span class="p">{</span>
    <span class="p">...</span>
<span class="p">}</span>

<span class="c1">// Not to mention:-</span>
<span class="k">if</span><span class="p">(</span><span class="n">security</span> <span class="k">is</span> <span class="n">Option</span><span class="p">)</span> <span class="p">{</span>
    <span class="p">...</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
    <span class="p">...</span>
<span class="p">}</span>

<span class="c1">// And maybe even some:-</span>
<span class="k">switch</span><span class="p">(</span><span class="n">security</span><span class="p">.</span><span class="n">GetType</span><span class="p">().</span><span class="n">Name</span><span class="p">)</span> <span class="p">{</span>
    <span class="k">case</span> <span class="s">"Option"</span><span class="p">:</span>
        <span class="p">...</span>
    <span class="k">case</span> <span class="s">"Stock"</span><span class="p">:</span>
        <span class="p">...</span>
    <span class="p">...</span>
<span class="p">}</span>
</code></pre>
</div>
<p>Our code is suddenly not looking so great. Our type hierarchy now falsely implies that all securities have ISINs, a particular issue for developers new to the project, we have hacks all over the place, maybe not enough (we’re fairly sure we got everything but there are always those nooks and crannies which slip through the test suite), we are forced to add new hacks as we go and confidence in our code is definitely eroded.</p>

<p>Suddenly a new requirement arises - it turns out securities need to refer to traded exchange which might be different for two otherwise identical securities, but our architecture has lumped exchange with securities. We are back to our dilemma again…</p>

<h2 id="an_imperfect_example">An Imperfect Example</h2>

<p>Again, I emphasise that the above example is necessarily imperfect, as to practically fit an example of this problem into a blog post necessitates quite some trivialising. That being said, hopefully it makes the point a little more concrete.</p>

<p>An objection here might be that these change requests merely exposed design mistakes made early on in the project whose impact inevitably got magnified down the line as code was written on the assumption that these mistakes were in fact valid. The problem with that argument is to me the problem with the <a href="http://en.wikipedia.org/wiki/Waterfall_method">waterfall method</a> for software development - it assumes you know a great deal up front, something which is <em>very</em> rarely the case.</p>

<p>The reality of software development is almost the opposite of that assumed by approaches which require large amounts of upfront structural foundations to be laid. Requirements and facts around your code tends to change constantly and often in utterly unexpected ways, so having a structure up front which lays down brittle laws about your system is setting yourself up to fail.</p>

<p>The brittleness of the laws is the real issue - if their failing didn’t result in hacks or yaks then there wouldn’t be as much of a problem.</p>

<h2 id="solutions">Solutions</h2>

<p>I hate to state a problem without suggesting solutions, I am after all a programmer, and our job is to solve problems, not <em>just</em> create them.</p>

<p>I am certainly not suggesting that object orientation is somehow fundamentally flawed, nor am I advocating writing code procedurally when it could benefit from the encapsulation, abstraction and de-duplication of an alternative approach purely out of <a href="http://en.wikipedia.org/wiki/Fear,_uncertainty_and_doubt">FUD</a> about potential future issues, rather I think that if you are going to write in a language which supports this approach it’s important to consider this issue before committing to representing your problem this way.</p>

<p>Some ideas:-</p>

<ul>
<li>
<p>There are methods and patterns for <a href="http://en.wikipedia.org/wiki/Separation_of_concerns">separation of concerns</a> and <a href="http://en.wikipedia.org/wiki/Coupling_(computer_science)">decoupling</a> of related code, including techniques like <a href="http://en.wikipedia.org/wiki/Dependency_injection">dependency injection</a>, which may help mitigate this problem to some degree while still using a C#-like language.</p>
</li>

<li>
<p><a href="http://en.wikipedia.org/wiki/Functional_programming">Functional programming</a> is enjoying a great upswing in interest and popularity these days. I wonder whether the stronger type systems of these languages and the greater guarantees about what a function does/does not do (i.e. less likely to produce side-effects, immutable state) might provide a means to more quickly adapt a change to the model at compile- rather than run-time.</p>
</li>

<li>
<p><a href="http://www.paulgraham.com/progbot.html">Bottom-up programming</a> in a language like <a href="http://en.wikipedia.org/wiki/Lisp">Lisp</a> offers an enormous amount of flexibility in <a href="http://en.wikipedia.org/wiki/Meta-programming">meta-programming</a> and might make downstream changes easier to introduce later in the development process.</p>
</li>

<li>
<p><a href="http://en.wikipedia.org/wiki/Dynamic_programming_language">Dynamic programming languages</a> like <a href="http://www.python.org/">Python</a>, <a href="http://www.ruby-lang.org/en/">Ruby</a> and Lisp provide a far less rigid type structure - types don’t necessarily need to be known at compile time, meaning you have a great deal of flexibility to write functions which are less tied to a previously-determined structure than in a statically-typed language.</p>
</li>

<li>
<p><a href="http://golang.org">Go</a> provides an intriguingly simplified version of static typing where no type hierarchy is permitted to be defined at all, rather you express relations between types through <a href="http://en.wikipedia.org/wiki/Go_(programming_language)#Type_system">implicit interfaces</a> which define types through what they do rather than what they are. They are implicit in that as soon as you’ve defined what you want, i.e. what methods a type possesses, then any type which possesses those methods implements the interface.</p>
</li>

<li>
<p><a href="http://en.wikipedia.org/wiki/Smalltalk">Smalltalk</a> implements object orientation in quite a different fashion from C#-like languages, with <a href="http://lists.squeakfoundation.org/pipermail/squeak-dev/1998-October/017019.html">emphasis on</a> passing messages between objects rather than the structure of the classes themselves. This could help reduce the dependency on initial structural decisions.</p>
</li>

<li>
<p><a href="http://en.wikipedia.org/wiki/Ecmascript">(ECMA|Java)script</a> allows you to define relations between objects based on object <a href="http://en.wikipedia.org/wiki/Prototype-based_programming">prototypes</a> rather than static classes, you simply can’t declare static user-defined types at all.</p>
</li>
</ul>

<p>I don’t want to advocate a particular solution above any other, as I am still undecided and exploring these ideas myself, not to mention the fact that a lot of this stuff sits decidedly in the grey area of rather subjective choices where it’s hard to <em>definitely</em> prove one approach is better than another.</p>

<p>I do however think that the brittleness of the upfront type hierarchy is a real issue which needs to be carefully considered <em>before</em> writing a large program and weighed up against other engineering approaches.</p>

<h2 id="notes">Notes</h2>

<h3 id="1">1</h3>

<p>I have spent several years working with <a href="http://en.wikipedia.org/wiki/C_Sharp_(programming_language)">C#</a>. Overall it’s a fantastic language which has grown ever more fantastic over time. Starting as, frankly, Microsoft Java, it has grown to incorporate <a href="http://en.wikipedia.org/wiki/Generic_programming">generics</a>, better support for functional style programming through a neat <a href="http://en.wikipedia.org/wiki/Lambda_(programming)">lambda</a> syntax, libraries offering standard functional-style methods such as <a href="http://en.wikipedia.org/wiki/Map_(higher-order_function)">map</a>, <a href="http://en.wikipedia.org/wiki/Filter_(higher-order_function)">filter</a> and <a href="http://en.wikipedia.org/wiki/Fold_(higher-order_function)">fold</a> (<a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.select.aspx">select</a>, <a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.where.aspx">where</a> and <a href="http://msdn.microsoft.com/en-us/library/system.linq.enumerable.aggregate.aspx">aggregate</a> respectively in C# parlance), a declarative syntax for querying generic collections via <a href="http://en.wikipedia.org/wiki/Linq">LINQ</a> as well as numerous other little features which make it a very nice language to work with. It’s well-engineered and surprisingly ambitious.</p>

<h3 id="2">2</h3>

<p>I say this, rather than just saying ‘I have a problem with object orientation’, as there are different interpretations as to how object orientation should be implemented, and a C#-ish implementation is just one approach - cf. smalltalk.</p></div>
    </content>
    <updated>2012-05-07T23:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry xml:lang="ja">
    <id>http://golang.jp/?p=3748</id>
    <link href="http://golang.jp/2012/05/3748" rel="alternate" type="text/html"/>
    <title>翻訳更新のお知らせ</title>
    <summary>Goプログラミング言語仕様の翻訳を最新にアップデートしました。 細かい更新箇所は多いのですが、前回の翻訳からの変更点は以下です。 マップの要素を削除するdelete組み込み関数が追加された。 rune型(他言語のchar [...]</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://golang.jp/go_spec">Goプログラミング言語仕様</a>の翻訳を最新にアップデートしました。<br/>
細かい更新箇所は多いのですが、前回の翻訳からの変更点は以下です。</p>
<ul>
<li>マップの要素を削除するdelete組み込み関数が追加された。</li>
<li>rune型(他言語のchar型のようなもの)が追加された。</li>
<li>init関数内でゴルーチンが起動できるようになった。</li>
<li>標準関数が返却するエラー情報は、新たに追加されたerror組み込み型を使用するようになった。</li>
</ul>
<p><em> ※2012/5/9 タイプミスを修正しました。報告いただきありがとうございました。</em></p></div>
    </content>
    <updated>2012-05-02T17:44:51Z</updated>
    <category term="&#x30C9;&#x30AD;&#x30E5;&#x30E1;&#x30F3;&#x30C8;"/>
    <author>
      <name>noboru</name>
    </author>
    <source>
      <id>http://golang.jp</id>
      <link href="http://golang.jp/feed" rel="self" type="application/atom+xml"/>
      <link href="http://golang.jp" rel="alternate" type="text/html"/>
      <subtitle>プログラミング言語Goの情報サイト</subtitle>
      <title>golang.jp</title>
      <updated>2012-08-23T08:00:21Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-6289467122030149854</id>
    <link href="http://reneefrench.blogspot.com/feeds/6289467122030149854/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=6289467122030149854" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6289467122030149854" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/6289467122030149854" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/04/blog-post_29.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="separator" style="clear: both; text-align: center;"><a href="http://4.bp.blogspot.com/-g6CTvIII_vM/T50PKTJnF0I/AAAAAAAAExc/gpeViA75ADc/s1600/ad3.jpg" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="320" src="http://4.bp.blogspot.com/-g6CTvIII_vM/T50PKTJnF0I/AAAAAAAAExc/gpeViA75ADc/s320/ad3.jpg" width="295"/></a></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-6289467122030149854?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-04-29T09:52:38Z</updated>
    <published>2012-04-29T09:51:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-09-07T23:08:36Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2012/04/26/Upcoming</id>
    <link href="http://www.codegrunt.co.uk/2012/04/26/Upcoming.html" rel="alternate" type="text/html"/>
    <title>Upcoming</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Okay, so I haven’t updated this blog in quite some time.</p>

<p>I don’t want to become one of those people whose blog consists of very few blog posts, mostly apologising for not blogging more, so I’ll keep this short and sweet and simply announce some posts I’m working on:-</p>

<ul>
<li>
<p>Why Go? - A post discussing the merits of <a href="http://golang.org">Go</a> and what makes it different from other programming languages.</p>
</li>

<li>
<p>Series: Algorithms - A series of posts on algorithms of interest, with a focus on exploring how you go about actually implementing them in code.</p>
</li>

<li>
<p>Series: Go Standard Library - A series of highly indulgent posts exploring Go’s standard libraries and how they are actually implemented in practice, in the vein of <a href="http://www.codinghorror.com/blog/2012/04/learn-to-read-the-source-luke.html">Jeff Atwood</a>’s and <a href="http://www.hanselman.com/blog/GivenILikeReadingSourceCodeByTheFireWithMySmokingJacketAndBrandySnifterAListOfBooks.aspx">Scott Hanselman</a>’s recent posts on reading other’s source code.</p>
</li>

<li>
<p>Series: Go Internals - A series of yet more indulgent posts exploring Go’s internal implementation details.</p>
</li>

<li>
<p>Series: Weak and Chess Engines - A series of posts on the implementation of <a href="https://github.com/lorenzo-stoakes/weak">Weak</a> and chess engines in general.</p>
</li>

<li>
<p>General Programming/Personal Topics of Interest - Basically whatever I happen to be thinking about at a given point. I think about programming a <em>lot</em>, and I think it’s time to put it out there, whether it’s coherent or of interest to other geeks out there, or not :-)</p>
</li>
</ul>

<p>I am committing to getting at least one blog post out a week. I intend to fill my blog with exactly the kind of stuff I love reading in other people’s blogs - lots of juicy, no messing about, unix-bearded, hardcore tech detail and geekery with pride.</p>

<p>Sorry <a href="http://www.quora.com/Brogramming/How-does-a-programmer-become-a-brogrammer">Brogrammers</a>, I’ve got nothing for you.</p></div>
    </content>
    <updated>2012-04-25T23:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry xml:lang="ja">
    <id>http://golang.jp/?p=3741</id>
    <link href="http://golang.jp/2012/04/3741" rel="alternate" type="text/html"/>
    <title>翻訳更新のお知らせ</title>
    <summary>久しぶりの翻訳更新です。 Go言語のインストールの翻訳を更新しました。 いままではGo言語をソースファイルから自分でコンパイルするしかなかったのですが、Version1からバイナリで配布されるようになりました。また、Wi [...]</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>久しぶりの翻訳更新です。<a href="http://golang.jp/install"><br/>
Go言語のインストール</a>の翻訳を更新しました。</p>
<p>いままではGo言語をソースファイルから自分でコンパイルするしかなかったのですが、Version1からバイナリで配布されるようになりました。また、Windowsも正式にサポートされるようになりました。</p>
<p> </p>
<p> </p></div>
    </content>
    <updated>2012-04-24T08:53:23Z</updated>
    <category term="&#x30C9;&#x30AD;&#x30E5;&#x30E1;&#x30F3;&#x30C8;"/>
    <author>
      <name>noboru</name>
    </author>
    <source>
      <id>http://golang.jp</id>
      <link href="http://golang.jp/feed" rel="self" type="application/atom+xml"/>
      <link href="http://golang.jp" rel="alternate" type="text/html"/>
      <subtitle>プログラミング言語Goの情報サイト</subtitle>
      <title>golang.jp</title>
      <updated>2012-08-23T08:00:21Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://kylelemons.net/?p=296</id>
    <link href="http://kylelemons.net/2012/04/rx-for-go-headaches/" rel="alternate" type="text/html"/>
    <title>Rx: My prescription for your Go dependency headaches</title>
    <summary>There has been a lot of discussion on the Go Nuts mailing list about how to manage versioning in the nascent Go package ecosystem.  We muttered about it at first, and then muttered about it some more when goinstall came about, and there has been a pretty significant uptick in discussion since the go [...]</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p/><div class="wp-caption alignright" style="width: 230px;"><a href="http://xkcd.com/281/"><img alt="XKCD: Online Package Tracking" src="http://imgs.xkcd.com/comics/online_package_tracking.png" title="I think this image, while talking about a completely unrelated meaning of the word "/></a><p class="wp-caption-text">Oddly appropriate, don't you think?</p></div><br/>
There has been a lot of discussion on the <a href="https://groups.google.com/forum/#!forum/golang-nuts">Go Nuts</a> mailing list about how to manage versioning in the nascent <a href="http://golang.org">Go</a> package ecosystem.  We muttered about it at first, and then muttered about it some more when <code>goinstall</code> came about, and there has been a pretty significant uptick in discussion since the <code>go</code> tool began to take shape and the <a href="http://golang.org/doc/go1.html">Go 1</a> release date approached.  In talking with other Gophers at the <a href="http://www.meetup.com/golangsf/">GoSF</a> meet-up recently, there doesn’t seem to be anyone who really has a good solution.<p/>
<p>TL;DR: <a href="http://kylelemons.net/go/rx">kylelemons.net/go/rx</a></p>
<h1>The Problem</h1>
<p>Before I get too far, let me first summarize the problem.</p>
<p>When developing a Go application, you will most likely find yourself depending on another package, often written by another author.  The ease of utilizing such third-party packages with the <code>go</code> tool makes this an even likelier scenario, and it is, in fact, encouraged.  Inevitably, however, the author of some package on which you depend will make a change to his package; this could be anything from an innocuous bug fix to a large-scale API reorganization, and you are suddenly left with two choices: stick with the version you have (often by cloning it locally) or bite the bullet and update.  This is complicated by the fact that you may both directly and indirectly depend on the same package, which means that both your project and your intermediate dependency need to agree on which of the above choices to take, and in a relatively timely manner.</p>
<p>There have been many proposals and complaints, both on- and offline, with respect to this problem.  It’s not a problem that’s unique to Go, either; tools like Apache’s <a href="http://maven.apache.org/">Maven</a>, Ruby’s <a href="http://gembundler.com/">Bundler</a>, etc all attempt to solve this problem to a greater or lesser degree.  It is such a prevalent theme in development that a term, <a href="http://en.wikipedia.org/wiki/DLL_Hell">DLL Hell</a> (and the more technically correct term <a href="http://en.wikipedia.org/wiki/Dependency_hell">dependency hell</a>), has come into common use to describe it.</p>
<h1>Strategies</h1>
<p>The most obvious thing to do is to be paranoid about package maintainers, and thus copy your dependencies into your project.  If this strategy is sufficient, I highly recommend checking out <a href="https://github.com/kr/goven">goven</a>, which will streamline this process (it even rewrites the imports!) for you.  I take a different tack because I am lazy and don’t want to have to maintain other people’s code.  I also don’t think this strategy simplifies the process of pulling in new changes from upstream, because you still have to update them one at a time until/unless something breaks.</p>
<p>The next obvious thing is to specify somewhere what version you want to check out, in the source code, so that go get knows about it and can do the right thing.  This essentially boils down to something like <code>import "path/package/version"</code> (though various proposals suggest using <code>@rev</code> or similar).  This is certainly a solution, and I suspect we will see tools emerge that will download source and update it to the proper revisions as a <code>go get</code> alternative.  I didn’t choose this solution because this requires rewriting import paths when you update code and it makes it difficult to ensure that there is only a single version of a library built into the same binary, which can cause problems (if there are more, the <code>init()</code> calls will run twice, for one thing).  It also doesn’t help with pulling in changes: you still are taking a chance that you’ll break something (sometimes without realizing it) whenever you pull from upstream.</p>
<p>Another reasonable strategy is to version-control the entire (or at least the dependencies within) GOPATH(s).  This has the advantage that multiple developers always check out the correct versions, and branches and merges work nicely.  A very simple tool along these lines is being developed as <a href="http://go.pkgdoc.org/github.com/davecheney/gogo">gogo</a>, which allows you to version control your dependencies and share them between developers.  As long as your version control system doesn’t mind having other version control systems’ (or its own) metadata stored inside it, this will work.  The downside of this is that you are storing a lot of redundant data in your vcs, and it <i>still</i> doesn’t address the issue of how to figure out when and if you can update what packages.</p>
<h1>Enter `rx`</h1>
<p>So, since my ancient pre-goinstall build tool has been obsoleted, I figured I’d try my hand at distilling a reasonable, achievable set of goals out of the sea of requirements and suggestions and turn them into a tool for people to use.  If you didn’t guess this from the previous section, the biggest problem that I think I can solve is helping you figure out what dependencies you can update without breaking your world.  This can probably work in addition to at least a few of the strategies listed above for a more complete versioning solution, depending on your particular needs.  Here are my informal design ideas/goals/requirements/notes:</p>
<ol>
<li>It shouldn’t try to “solve” dependency hell.  Making people’s lives easier is enough for now.</li>
<li>It should leverage the existing <code>go</code> tool and GOPATH conventions as much as possible.</li>
<li>It should be easy to see the versions of packages, and to change the active one.</li>
<li>It should be intelligent about updating and notice when an update breaks something else.</li>
<li>It should be able to save a “known good” set of versions for easy rollback and sharing.</li>
<li>It should be fun to use, and should not get in the way of the developer.</li>
</ol>
<p>In that vein, I have started work on <a href="http://kylelemons.net/go/rx">rx</a>, my prescription for your Go dependency version headaches.  It’s starting to approach a few of the the requirements above already.  To whet your appetite, here are a few examples of what it can do:</p>
<ul>
<li><code>rx list</code> will show you inter-repository dependencies</li>
<li><code>rx tags</code> will show you the what tags are available in a repository</li>
<li><code>rx prescribe</code> will update a repository and test its transitive dependents</li>
</ul>
<p>Each command also has plenty of fun options to play with; <code>rx tags</code> has, for instance, options to only show tags that are up- or downgrades. The structure of the program is strongly reminiscent of the design of the <code>go</code> tool (and, in fact, uses it for a lot of backend logic), and so should be familiar for most Gophers and fit nicely into your existing workflows.</p>
<p>Installation is, of course, rather simple:<br/>
<code>go get -u kylelemons.net/go/rx</code></p>
<p>Here’s a brief example of using <code>rx</code>:</p>
<pre class="syntax">$ rx --rescan list | grep rpc
/&lt;gopath&gt;/src/github.com/kylelemons/go-rpcgen: codec webrpc main main echoservice main main offload wire webrpc
$ rx tags go-rpcgen | egrep v\|HEAD
193746c88dfebdc5462382b93c1038a29496d9af v2.0.0
a6938fa6ec0fb6a63fefab2c462d3cd1102cc477 v1.2.0
bf28cdf3e683dd0919800f6916141c17aa93c36d HEAD
bf28cdf3e683dd0919800f6916141c17aa93c36d v1.1.0
f73c5c8ea85bdfbdc69e6aa24dd90b43c7265c67 v1.0.0
$ rx pre go-rpcgen v2.0.0
ok      github.com/kylelemons/go-rpcgen/codec   0.051s
ok      github.com/kylelemons/go-rpcgen/examples/echo   0.139s
ok      github.com/kylelemons/go-rpcgen/examples/remote 0.019s
ok      github.com/kylelemons/blightbot/bot     0.029s
ok      github.com/kylelemons/go-paxos/paxos    0.053s
$ rx tags go-rpcgen | egrep v\|HEAD
193746c88dfebdc5462382b93c1038a29496d9af HEAD
193746c88dfebdc5462382b93c1038a29496d9af v2.0.0
a6938fa6ec0fb6a63fefab2c462d3cd1102cc477 v1.2.0
bf28cdf3e683dd0919800f6916141c17aa93c36d v1.1.0
f73c5c8ea85bdfbdc69e6aa24dd90b43c7265c67 v1.0.0
&lt;/gopath&gt;</pre>
<p>There’s not a whole lot here, but you can see that the <code>list</code> command (in its short form) found the repository and listed the (short) names of the packages that exist under it.  The <code>--rescan</code> option told it to actually scan my repositories, instead of using the cached dependency graph.  The <code>tags</code> command then showed me the interesting tags in the repository (it’s git, so HEAD also shows where it was currently), and then the <code>prescribe</code> command updated it to the latest tag.  Notice that the repository’s tests were run, as well as tests for packages that depended on packages in that repository (transitively).  They were also built and installed (except binaries, by default), though this isn’t displayed unless you use the <code>-v</code> option.</p>
<h1>Expected Use Cases</h1>
<p>To help elucidate the problem I’m trying to solve, here are a few use cases that I’d like to support.</p>
<h2>Hobbyist Developer</h2>
<p>As a single developer, you’ve probably got a single GOPATH into which all of your dependencies are installed alongside your own projects.  You freely import between them, and everything generally works.  You don’t run <code>go get</code> very often to pull down remote packages, unless you find a bug that has been fixed or you find a new feature in a newer library.</p>
<ul>
<li>The <code>rx fetch</code> command will let you fetch the latest changesets without actually applying them.</li>
<li>The <code>rx tags --up</code> command will show you what tags you can upgrade to.</li>
<li>The <code>rx prescribe</code> command will allow you to update to a new tag.</li>
<li>The <code>rx prescribe</code> command automatically builds and tests depenants transitively.</li>
<li>The <code>rx prescribe</code> command will roll back the update if it turns out to have broken something.</li>
</ul>
<h2>Small Team</h2>
<p>As a small team working on a Go project, your concerns are much different from that of a single developer.  You want your team members to easily stay in sync with one another, and you will only rarely pull changes in from upstream once you have your project working with a particular dependency.</p>
<ul>
<li>The <code>--rxdir</code> flag and RX_DIR environment variable let you version or share an rx configuration.</li>
<li>The <code>rx cabinet --save</code> command saves the versions of all repositories.</li>
<li>The <code>rx cabinet --load</code> command reverts/upgrades repositories to their saved state.</li>
<li>The <code>rx cabinet --export</code> command saves a relocatable cabinet that can be sshared.</li>
<li>The <code>rx pin</code> command lets you configure what repositories are considered for upgrade.</li>
<li>The <code>rx auto</code> command will try to upgrade packages automatically, keeping seamless upgrades.</li>
</ul>
<p>The common theme among these commands is maintaining a cohesive group of dependency versions.  When you update a dependency (which we’ve seen that <code>rx prescribe</code> can do automatically), you can save that as a “known good” configuration that you can share, save, and (if things go south) restore later.  For packages that are known to misbehave or for the package you’re editing, the <code>rx pin</code> command allows you to specify manually what behavior they should have (never upgrade, always tip, never change, etc).  To help with exploring what updates might apply seamlessly, the <code>rx auto</code> command will do the heavy lifting of figuring out which repositories depend on each other and will successively try updates.</p>
<h2>Large Project</h2>
<p>On a large project, you care about most of the same things as a small team, but there is also a good chance that you are working on multiple versions of your software simultaneously.  There is also a good chance that any given developer may have multiple projects on his workstation which are independently versioned.</p>
<ul>
<li>The <code>rx cabinet --exclude</code> command (and friends) configure exactly what cabinets track.</li>
<li>The <code>rx cabinet --diff</code> command shows differences in dependencies between cabinets.</li>
<li>The advanced <code>rx prescribe</code> optiosn can manage package upgrades <code>auto</code> can’t handle.</li>
</ul>
<p>The theme here is that the same commands that worked in a small and medium environment continue to work, but that their concepts can be extended (and modified slightly) to accomodate the needs of a larger development team.  The larger the team is, the more chances are that there will be multiple branches in play, and <code>rx</code> will need to understand this.</p>
<h1>The Catch</h1>
<p>There are still problems with this approach.  As long as you start with a working project, you should generally be able to keep it working.  You may not be able to ever update a package if one of its dependents never comes into line, though, which leads me to the biggest problem with this approach: it doesn’t make it easy to simply install a remote repository that has external dependencies.  It’s intended primarily to support development and releasing of e.g. a binary, where your local development environment doesn’t matter to the end user.  I’d like for there to be a nice way to import a package’s cabinet file when you’re importing it (so that your version of rx learns about what versions do and don’t work with various dependency versions), but I haven’t fully mapped this out.</p>
<p>Another problem which remains currently unsolved is the requirement to manually update when a dependency’s API changes.  It would be nice to have some way for the author of a package to provide a way for dependent packages to fix themselves automatically; a tool like <code>gofix</code>.  If this convention were widespread enough, it could vastly simplify the process of updating packages.  This is something else about which I am thinking, and I hope that there are good libraries for easily making <code>gofix</code>-like tools in the future as well as a convention for including them in your projects.</p>
<h1>Coming Soon</h1>
<p>There is a lot of work to do, but I think it’s at the point where the best feedback is feedback from real users who have a real need for a tool like this.  The next priorities on my list are:</p>
<ol>
<li>Save and restore global repository state</li>
<li>Intelligently run “upgrade” experiments to find what new tags can be seamlessly integrated</li>
<li>Support branches and branch switching</li>
<li>Clean up and document more of the code</li>
</ol>
<p>Your feedback, constructive criticism, and pull requests are all greatly appreciated!</p>
<p>P.S. I’m slowly cleaning up my <a href="http://github.com/kylelemons">many side-projects</a> and making sure they work with Go 1.  I’ll be listing them on <a href="http://kylelemons.net/go">kylelemons.net/go</a> as I do, so feel free to e-mail me or find me on IRC if you have a favorite package that you want updated.</p></div>
    </content>
    <updated>2012-04-22T03:23:47Z</updated>
    <category term="Blog"/>
    <category term="Go"/>
    <category term="go"/>
    <category term="Programming"/>
    <author>
      <name>Kyle Lemons</name>
    </author>
    <source>
      <id>http://kylelemons.net</id>
      <link href="http://kylelemons.net/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://kylelemons.net" rel="alternate" type="text/html"/>
      <subtitle>A little curiosity goes a long way</subtitle>
      <title>Eko Foxtrot</title>
      <updated>2012-04-30T02:00:03Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-2796769412890469431</id>
    <link href="http://mue.tideland.biz/feeds/2796769412890469431/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/nice-technical-task.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/2796769412890469431" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/2796769412890469431" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/nice-technical-task.html" rel="alternate" type="text/html"/>
    <title>Nice technical task</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">A few days ago I've been mentioned in Google+ by Tyler Tallman who is using my <a href="http://code.google.com/p/tcgl/" target="_blank">Tideland Common Go Library</a> and here especially the <a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/cells" target="_blank">Cells</a> package. It is a framework for <i>event-driven applications</i> with networked cells which run a user-implemented behavior. He is using it for the rule-based evaluation of data streams with medical data, indeed a good use-case. And he already found something to optimize. I'm using maps for the subscription of cells to other cells. That has been ok for me so far, but not for the performance needs of Tyler. So he optimized it by using a tree here.<br/><br/>As a result I will also allow different implementations here later. A map like today, but also a B-tree. I've got an old implementation I've done several years ago in Java and now I port it to Go. But not as an exact copy. First steps already showed that the code is by far more compact. But I also want to use concurrency by implementing the nodes as goroutines (together with their data structure). The idea is to let complex stuff like balancing be done in the background as well as an optimal usage of resources, e.g. when iterating over the items.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-2796769412890469431?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-04-21T14:19:24Z</updated>
    <published>2012-04-21T14:19:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="cells"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="eda"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="cgl"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-791717656803021877</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/791717656803021877" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/791717656803021877" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/07/error-handling-and-go.html" rel="alternate" type="text/html"/>
    <title>Error handling and Go</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>If you have written any Go code you have probably encountered the built-in <code>error</code> type. Go code uses <code>error</code> values to indicate an abnormal state. For example, the <code>os.Open</code> function returns a non-nil <code>error</code> value when it fails to open a file. </p> <pre>func Open(name string) (file *File, err error)</pre> <p>The following code uses <code>os.Open</code> to open a file. If an error occurs it calls <code>log.Fatal</code> to print the error message and stop. </p> <pre>    f, err := os.Open("filename.ext")<br/>    if err != nil {<br/>        log.Fatal(err)<br/>    }<br/>    <span class="comment">// do something with the open *File f</span></pre> <p>You can get a lot done in Go knowing just this about the <code>error</code>type, but in this article we'll take a closer look at <code>error</code> and discuss some good practices for error handling in Go. </p> <p><b>The error type</b></p> <p>The <code>error</code> type is an interface type. An <code>error</code>variable represents any value that can describe itself as a string. Here is the interface's declaration: </p> <pre>type error interface {<br/>    Error() string<br/>}</pre> <p>The <code>error</code> type, as with all built in types, is <a href="http://golang.org/doc/go_spec.html#Predeclared_identifiers">predeclared</a> in the <a href="http://golang.org/doc/go_spec.html#Blocks">universe block</a>. </p> <p>The most commonly-used <code>error</code> implementation is the <a href="http://golang.org/pkg/errors/">errors</a> package's unexported <code>errorString</code> type. </p> <pre><span class="comment">// errorString is a trivial implementation of error.</span><br/>type errorString struct {<br/>    s string<br/>}<br/><br/>func (e *errorString) Error() string {<br/>    return e.s<br/>}</pre> <p>You can construct one of these values with the <code>errors.New</code>function. It takes a string that it converts to an <code>errors.errorString</code>and returns as an <code>error</code> value. </p> <pre><span class="comment">// New returns an error that formats as the given text.</span><br/>func New(text string) error {<br/>    return &amp;errorString{text}<br/>}</pre> <p>Here's how you might use <code>errors.New</code>: </p> <pre>func Sqrt(f float64) (float64, error) {<br/>    if f &lt; 0 {<br/>        return 0, errors.New("math: square root of negative number")<br/>    }<br/>    <span class="comment">// implementation</span><br/>}</pre> <p>A caller passing a negative argument to <code>Sqrt</code> receives a non-nil <code>error</code> value (whose concrete representation is an <code>errors.errorString</code> value). The caller can access the error string ("math: square root of...") by calling the <code>error</code>'s <code>Error</code> method, or by just printing it: </p> <pre>    f, err := Sqrt(-1)<br/>    if err != nil {<br/>        fmt.Println(err)<br/>    }</pre> <p>The <a href="http://golang.org/pkg/fmt/">fmt</a> package formats an <code>error</code> value by calling its <code>Error() string</code> method. </p> <p>It is the error implementation's responsibility to summarize the context. The error returned by <code>os.Open</code> formats as "open /etc/passwd: permission denied," not just "permission denied."  The error returned by our <code>Sqrt</code> is missing information about the invalid argument. </p> <p>To add that information, a useful function is the <code>fmt</code> package's <code>Errorf</code>. It formats a string according to <code>Printf</code>'s rules and returns it as an <code>error</code> created by <code>errors.New</code>. </p> <pre>    if f &lt; 0 {<br/>        return 0, fmt.Errorf("math: square root of negative number %g", f)<br/>    }</pre> <p>In many cases <code>fmt.Errorf</code> is good enough, but since <code>error</code> is an interface, you can use arbitrary data structures as error values, to allow callers to inspect the details of the error. </p> <p>For instance, our hypothetical callers might want to recover the invalid argument passed to <code>Sqrt</code>. We can enable that by defining a new error implementation instead of using <code>errors.errorString</code>: </p> <pre>type NegativeSqrtError float64<br/><br/>func (f NegativeSqrtError) Error() string {<br/>    return fmt.Sprintf("math: square root of negative number %g", float64(f))<br/>}</pre> <p>A sophisticated caller can then use a <a href="http://golang.org/doc/go_spec.html#Type_assertions">type assertion</a> to check for a <code>NegativeSqrtError</code> and handle it specially, while callers that just pass the error to <code>fmt.Println</code> or <code>log.Fatal</code> will see no change in behavior. </p> <p>As another example, the <a href="http://golang.org/pkg/encoding/json/">json</a> package specifies a <code>SyntaxError</code> type that the <code>json.Decode</code> function returns when it encounters a syntax error parsing a JSON blob. </p> <pre>type SyntaxError struct {<br/>    msg    string <span class="comment">// description of error</span><br/>    Offset int64  <span class="comment">// error occurred after reading Offset bytes</span><br/>}<br/><br/>func (e *SyntaxError) Error() string { return e.msg }</pre> <p>The <code>Offset</code> field isn't even shown in the default formatting of the error, but callers can use it to add file and line information to their error messages: </p> <pre>    if err := dec.Decode(&amp;val); err != nil {<br/>        if serr, ok := err.(*json.SyntaxError); ok {<br/>            line, col := findLine(f, serr.Offset)<br/>            return fmt.Errorf("%s:%d:%d: %v", f.Name(), line, col, err)<br/>        }<br/>        return err<br/>    }</pre> <p>(This is a slightly simplified version of some <a href="http://camlistore.org/code/?p=camlistore.git;a=blob;f=lib/go/camli/jsonconfig/eval.go#l68">actual code</a>from the <a href="http://camlistore.org">Camlistore</a> project.) </p> <p>The <code>error</code> interface requires only a <code>Error</code> method; specific error implementations might have additional methods. For instance, the <a href="http://golang.org/pkg/net/">net</a> package returns errors of type <code>error</code>, following the usual convention, but some of the error implementations have additional methods defined by the <code>net.Error</code>interface: </p> <pre>package net<br/><br/>type Error interface {<br/>    error<br/>    Timeout() bool   // Is the error a timeout?<br/>    Temporary() bool // Is the error temporary?<br/>}</pre> <p>Client code can test for a <code>net.Error</code> with a type assertion and then distinguish transient network errors from permanent ones. For instance, a web crawler might sleep and retry when it encounters a temporary error and give up otherwise. </p> <pre>        if nerr, ok := err.(net.Error); ok &amp;&amp; nerr.Temporary() {<br/>            time.Sleep(1e9)<br/>            continue<br/>        }<br/>        if err != nil {<br/>            log.Fatal(err)<br/>        }</pre> <p><b>Simplifying repetitive error handling</b></p> <p>In Go, error handling is important. The language's design and conventions encourage you to explicitly check for errors where they occur (as distinct from the convention in other languages of throwing exceptions and sometimes catching them). In some cases this makes Go code verbose, but fortunately there are some techniques you can use to minimize repetitive error handling. </p> <p>Consider an <a href="http://code.google.com/appengine/docs/go/">App Engine</a>application with an HTTP handler that retrieves a record from the datastore and formats it with a template. </p> <pre>func init() {<br/>    http.HandleFunc("/view", viewRecord)<br/>}<br/><br/>func viewRecord(w http.ResponseWriter, r *http.Request) {<br/>    c := appengine.NewContext(r)<br/>    key := datastore.NewKey(c, "Record", r.FormValue("id"), 0, nil)<br/>    record := new(Record)<br/>    if err := datastore.Get(c, key, record); err != nil {<br/>        http.Error(w, err.Error(), 500)<br/>        return<br/>    }<br/>    if err := viewTemplate.Execute(w, record); err != nil {<br/>        http.Error(w, err.Error(), 500)<br/>    }<br/>}</pre> <p>This function handles errors returned by the <code>datastore.Get</code>function and <code>viewTemplate</code>'s <code>Execute</code> method. In both cases, it presents a simple error message to the user with the HTTP status code 500 ("Internal Server Error"). This looks like a manageable amount of code, but add some more HTTP handlers and you quickly end up with many copies of identical error handling code. </p> <p>To reduce the repetition we can define our own HTTP <code>appHandler</code>type that includes an <code>error</code> return value: </p> <pre>type appHandler func(http.ResponseWriter, *http.Request) error</pre> <p>Then we can change our <code>viewRecord</code> function to return errors: </p> <pre>func viewRecord(w http.ResponseWriter, r *http.Request) error {<br/>    c := appengine.NewContext(r)<br/>    key := datastore.NewKey(c, "Record", r.FormValue("id"), 0, nil)<br/>    record := new(Record)<br/>    if err := datastore.Get(c, key, record); err != nil {<br/>        return err<br/>    }<br/>    return viewTemplate.Execute(w, record)<br/>}</pre> <p>This is simpler than the original version, but the <a href="http://golang.org/pkg/net/http/">http</a> package doesn't understand functions that return <code>error</code>. To fix this we can implement the <code>http.Handler</code> interface's <code>ServeHTTP</code> method on <code>appHandler</code>: </p> <pre>func (fn appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {<br/>    if err := fn(w, r); err != nil {<br/>        http.Error(w, err.Error(), 500)<br/>    }<br/>}</pre> <p>The <code>ServeHTTP</code> method calls the <code>appHandler</code> function and displays the returned error (if any) to the user.  Notice that the method's receiver, <code>fn</code>, is a function. (Go can do that!) The method invokes the function by calling the receiver in the expression <code>fn(w, r)</code>. </p> <p>Now when registering <code>viewRecord</code> with the http package we use the <code>Handle</code> function (instead of <code>HandleFunc</code>) as <code>appHandler</code> is an <code>http.Handler</code> (not an <code>http.HandlerFunc</code>).  </p> <pre>func init() {<br/>    http.Handle("/view", appHandler(viewRecord))<br/>}</pre> <p>With this basic error handling infrastructure in place, we can make it more user friendly. Rather than just displaying the error string, it would be better to give the user a simple error message with an appropriate HTTP status code, while logging the full error to the App Engine developer console for debugging purposes. </p> <p>To do this we create an <code>appError</code> struct containing an <code>error</code> and some other fields: </p> <pre>type appError struct {<br/>    Error   error<br/>    Message string<br/>    Code    int<br/>}</pre> <p>Next we modify the appHandler type to return <code>*appError</code> values: </p> <pre>type appHandler func(http.ResponseWriter, *http.Request) *appError</pre> <p>(It's usually a mistake to pass back the concrete type of an error rather than <code>error</code>, for reasons discussed in <a href="http://golang.org/doc/go_faq.html#nil_error">the Go FAQ</a>, but it's the right thing to do here because <code>ServeHTTP</code> is the only place that sees the value and uses its contents.) </p> <p>And make <code>appHandler</code>'s <code>ServeHTTP</code> method display the <code>appError</code>'s <code>Message</code> to the user with the correct HTTP status <code>Code</code> and log the full <code>Error</code> to the developer console: </p> <pre>func (fn appHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {<br/>    if e := fn(w, r); e != nil { <span class="comment">// e is *appError, not os.Error.</span><br/>        c := appengine.NewContext(r)<br/>        c.Errorf("%v", e.Error)<br/>        http.Error(w, e.Message, e.Code)<br/>    }<br/>}</pre> <p>Finally, we update <code>viewRecord</code> to the new function signature and have it return more context when it encounters an error:  </p> <pre>func viewRecord(w http.ResponseWriter, r *http.Request) *appError {<br/>    c := appengine.NewContext(r)<br/>    key := datastore.NewKey(c, "Record", r.FormValue("id"), 0, nil)<br/>    record := new(Record)<br/>    if err := datastore.Get(c, key, record); err != nil {<br/>        return &amp;appError{err, "Record not found", 404}<br/>    }<br/>    if err := viewTemplate.Execute(w, record); err != nil {<br/>        return &amp;appError{err, "Can't display record", 500}<br/>    }<br/>    return nil<br/>}</pre> <p>This version of <code>viewRecord</code> is the same length as the original, but now each of those lines has specific meaning and we are providing a friendlier user experience. </p> <p>It doesn't end there; we can further improve the error handling in our application. Some ideas: </p> <ul><li>give the error handler a pretty HTML template, </li><li>make debugging easier by writing the stack trace to the HTTP response when the user is an administrator, </li><li>write a constructor function for <code>appError</code> that stores the stack trace for easier debugging,  </li><li>recover from panics inside the <code>appHandler</code>, logging the error to the console as "Critical," while telling the user "a serious error has occurred." This is a nice touch to avoid exposing the user to inscrutable error messages caused by programming errors. See the <a href="http://golang.org/doc/articles/defer_panic_recover.html">Defer, Panic, and Recover</a>article for more details. </li></ul> <p><b>Conclusion</b></p> <p>Proper error handling is an essential requirement of good software. By employing the techniques described in this post you should be able to write more reliable and succinct Go code. </p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-791717656803021877?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-04-19T01:50:07Z</updated>
    <published>2011-07-12T16:30:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="type"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="interface"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="error"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/190988916042637312</id>
    <link href="http://twitter.com/_rsc/statuses/190988916042637312" rel="alternate" type="text/html"/>
    <title>_rsc: RT @iamdanw: This is proper New Aesthetic http://t.co/DkTdf0od disassemble the algorithms and make things with them</title>
    <summary>_rsc: RT @iamdanw: This is proper New Aesthetic http://t.co/DkTdf0od disassemble the algorithms and make things with them</summary>
    <updated>2012-04-14T02:24:40Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-7742641043423256008</id>
    <link href="http://mue.tideland.biz/feeds/7742641043423256008/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/concurrency-as-natural-paradigm.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/7742641043423256008" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/7742641043423256008" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/concurrency-as-natural-paradigm.html" rel="alternate" type="text/html"/>
    <title>Concurrency as a natural paradigm</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>Since I'm working with <i>Erlang/OTP</i> and <i>Go</i> and point out their powerful handling of <i>concurrency</i> I've often been asked what's special with it and how it can be used. Additionally many people just mixup concurrency and parallelism. So to make it more clear I have to start by leaving computer — don't panic, I'll return later.<br/><br/>I'm wondering what you're doing right now. Yes, one thing is reading this text. But please spend some seconds looking around. What do you see, what is your environment? Maybe you're sitting at home or at work in your office. Or you're possibly sitting in a café reading this text on your smartphone. Are you alone while the rest of the world is frozen when you started to read this text? No, definitely not. There are people around you, some you're interacting with and some you don't care for. So let's assume you are at work. Especially in our software business we use to work in teams. A number of people, sometimes smaller, sometimes larger, works on a project with different roles and different tasks. Some of those tasks can be handled by one developer alone, but many need the discussions between the colleagues, they have to fit into the rest of the software and be realized in a useful order.<br/><br/>The work in those environments is done concurrently. From an artifacts perspective it may look serialized from the requirements until deployment. But the people responsible for all those artifacts of a project work in an independent but structured way like it's done in house building or factories since many hundreds of years. And that's no pure human behavior, we already know it from nature. Just take a look at bees and ants or all other animals building prides or states. In fact we all have grown with it but so far haven't been able to handle it in our software.<br/><br/>Now times have changed. We not only have languages like <i>Go</i> and <i>Erlang/OTP</i> (and many others more), we also have computers and soon smartphones with a large number of cores. I'm writing this text on a quad-core with 8 hyper-threads, and that's only the beginning. Additionally our software has to handle more and more stuff independently but in a structured way. Think about server applications handling a large number of user sessions where each session may send several overlapping requests, inside the server we're communicating with databases (maybe several due to a business driven mix of traditional relational and NoSQL backends), directory servers or further external systems in case of a SOA. Even more may we've have to take care of a global state as well as time-based or other events.<br/><br/>Today we handle those tasks request by request in a serialized manner. And while we're waiting for the answer of a relative slow I/O based task like reading from a database our request execution kicks one's heels. Concurrent software follows a different idea. While analyzing your problem and designing your solution you have to ask yourself where your dependencies are, what can be handled independently and where the access have to be synchronized. So you break up your code in independent components which you now run and compose with the help of your selected language. In <i>Go</i> those are goroutines communicating via channels, in <i>Erlang/OTP</i> processes sending messages into their mailboxes. Goroutines and processes are lightweight threads and a system can run hundreds of thousands.<br/><br/>Let's show it with a little scenario. You have to read data from a source, transform it into an internal representation for further processing, enrich it with data from an additional external source, modify data in two further external targets, at last transform the enriched data into the target format and write it to a target in order — no real uncommon job. Let's now do a first naive implementation (pseudo language):<br/><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">// One serialized job execution.</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">fun Job(source, addSource, addTargetA, addTargetB, target) {</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    raw = source.Read()</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    internal = Modify(raw)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    enriched = addSource.Enrich(internal)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    modificationA = ExtractModificationA(enriched)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    modificationB = ExtractModificationB(enriched)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    addTargetA.Write(modificationA)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    addTargetB.Write(modificationB)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    result = Transform(enriched)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    target.Write(result)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">}</span><br/><br/>Nice job, step by step. With a lot of waiting due to the I/O and maybe longer processing steps. So let's speed it up by spawning it several times.<br/><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">// Starting our job a number of times.</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">fun Starter(source, addSource, addTargetA, addTargetB, target, count) {</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    for i = 1 to count {</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">        spawn Job(source, addSource, addTargetA, addTargetB, target)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    }</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">}</span><br/><br/>Wow, now with full speed, <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">Starter(…, 10)</span> brings ten times the power! But eh, stop, wait a moment. They all read in parallel from our source. Does it care for synchronization? And if so other jobs have to wait while one is reading. And the same trouble with the additional source, shit. And why do we have to wait for those two modification with their writings. We don't get any result, so we could go on to the transformation and the writing to the target. And here once again the synchronization problem. Additionally how do we handle the in-order writing and how do we know that all is done? Our starter returns immediately after all spawnings. (sigh)<br/><br/>So let's try a better approach. Not with brute-force, but more intelligent. Here we design our methods and functions so that they can read from channels or write to channels to pass data between them.<br/><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">// Pipelined job execution.</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">fun Job(source, addSource, addTargetA, addTargetB, target) {</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel raw</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel enriched</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel multicast</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel transform</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel transformed</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel modificationA</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel modifiedA</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel modificationB</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel modifiedB</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    channel done</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br/></span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    spawn source.Read(raw)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    spawn addSource.Enrich(raw, multicast)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    spawn fun () {</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">        for e in multicast {</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">            send e to transform</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">            send e to modificationA</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">            send e to modificationB</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">        }</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    }()</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    spawn Transform(transform, transformed)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    spawn target.Write(transformed, done)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    spawn ExtractModificationA(modificationA, modifiedA)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    spawn addTargetA.Write(modifiedA)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    spawn ExtractModificationB(modificationB, modifiedB)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    spawn addTargetA.Write(modifiedB)</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;"><br/></span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">    receive done</span><br/><span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">}</span><br/><br/>Uuuh! Looks a bit more difficult in the beginning? That's mostly due to my funny pseudo language. (smile) You just have to visualize it. The process <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">source.Read()</span> reads continuously out of the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">source</span> writes the data into the <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">raw</span> channel. There's no need for synchronization here. And while the next chunk of data is read the process <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">addSource.Enrich()</span> reads from <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">raw</span> and writes it result to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">multicast</span>. This one and the following anonymous function as process are needed to read from <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">multicast</span> and write to <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">transform</span>, <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">modificationA</span> and <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">modificationB</span>. This allows to handle the transformation and both modifications in parallel, here once again passing the data from process to process using a channel. I assume in my little pseudo runtime that the channels are buffered and spawned processes continue their work if their spawning process ends — you see I'm mixing <i>Go</i> and <i>Erlang/OTP</i> here. (smile) So we come to the final trick. While both modifications paths are fire and forget the transformation has a channel named <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">done</span>. This is for signalization of the end of processing. After the last data is read, enriched, transformed and written the process <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">target.Write()</span> sends a signal via <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">done</span> and our job function can return.<br/><br/>We see, we win a wonderful way of little processes doing their work almost independently and interacting via communication. There are still possible problems, e.g. <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">addSource.Enrich()</span> may block due to an internal error or an I/O problem. So you may need a kind of error signalization. Or at least time-outs like <i>Erlang/OTP</i> has in its <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">receive</span> statement and <i>Go</i> easily create with a <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">&lt;-time.After()</span> in a <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">select</span> statement. Like finding a proper design you have to take care for those kinds of errors. There's still no free lunch. But this — safety in concurrent applications — may be a topic in another blog entry.<br/><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-7742641043423256008?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-04-13T14:54:07Z</updated>
    <published>2012-04-13T14:54:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="erlang"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="parallelism"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="concurrency"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-4578344211207971419</id>
    <link href="http://reneefrench.blogspot.com/feeds/4578344211207971419/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=4578344211207971419" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4578344211207971419" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4578344211207971419" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/04/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://4.bp.blogspot.com/-VMKA5HC6VdA/T4gD1Sb4lcI/AAAAAAAAEtk/2-hmOIC56tU/s1600/astorstear.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5730834739845699010" src="http://4.bp.blogspot.com/-VMKA5HC6VdA/T4gD1Sb4lcI/AAAAAAAAEtk/2-hmOIC56tU/s320/astorstear.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 269px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-4578344211207971419?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-04-13T10:45:49Z</updated>
    <published>2012-04-13T10:05:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-08-28T08:54:20Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/190561688993529857</id>
    <link href="http://twitter.com/_rsc/statuses/190561688993529857" rel="alternate" type="text/html"/>
    <title>_rsc: RT @valueof: @tomdale @fat @pamelafox I got into tabs because of #golang.</title>
    <summary>_rsc: RT @valueof: @tomdale @fat @pamelafox I got into tabs because of #golang.</summary>
    <updated>2012-04-12T22:07:01Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/190526594203398144</id>
    <link href="http://twitter.com/_rsc/statuses/190526594203398144" rel="alternate" type="text/html"/>
    <title>_rsc: http://t.co/WWMD9IMy</title>
    <summary>_rsc: http://t.co/WWMD9IMy</summary>
    <updated>2012-04-12T19:47:34Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:research.swtch.com,2012:research.swtch.com/qart</id>
    <link href="http://research.swtch.com/qart" rel="alternate" type="text/html"/>
    <title>QArt Codes</title>
    <summary>How to make pictures with QR codes, part II</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">&lt;style type="text/css"&gt;
.matrix {
	font-family: sans-serif;
	font-size: 0.8em;
}
table.matrix {
	padding-left: 1em;
	padding-right: 1em;
	padding-top: 1em;
	padding-bottom: 1em;
}
.matrix td {
	padding-left: 0.3em;
	padding-right: 0.3em;
	border-left: 2px solid white;
	border-right: 2px solid white;
	text-align: center;
	color: #aaa;
}
.matrix td.gray {
	color: black;
	background-color: #ddd;
}
&lt;/style&gt;

<p class="pp">
QR codes are 2-dimensional bar codes that encode arbitrary
text strings.  A common use of QR codes is to encode URLs so
that people can scan a QR code (for example, on an advertising poster,
<a href="http://www.brandchannel.com/home/post/QR-Marketing-Google-Maps.aspx">building roof</a>, <a href="http://www.dailymail.co.uk/femail/article-2023726/Beach-volleyball-stars-sign-deal-advertising-bikini-clad-behinds.html">volleyball bikini</a>, <a href="http://www.flickr.com/photos/fluidforms/3524861901/">belt buckle</a>, or <a href="http://wtfqrcodes.com/post/18551054478/look-in-the-sky-its-a-bird-its-a-plane-its-the">airplane banner</a>)
to load a web site on a cell phone
instead of having to “type” in a URL.
</p>

<p class="pp">
QR codes are encoded using <a href="http://research.swtch.com/field">Reed-Solomon error-correcting codes</a>, so that
a QR scanner does not have to see every pixel correctly in order
to decode the content.  The error correction makes it possible
to introduce a few errors (fewer than the maximum that the algorithm
can fix) in order to make an image.
For example, in 2008, <a href="http://whomwah.com/2008/03/12/more-fun-with-qr-codes-and-the-bbc-logo/">Duncan Robertson</a> took a QR code for “http://bbc.co.uk/programmes” (left) and introduced errors in the form of a BBC logo (right):
</p>

<center>
<img src="http://research.swtch.com/qr-bbc.png"/>
</center>

<p class="lp">
That's a neat trick and a pretty logo, but it's uninteresting from
a technical standpoint.  Although the BBC logo pixels look like QR code
pixels, they are not contribuing to the QR code.
The QR reader can't tell much difference between the
BBC logo and the Union Jack.
There's just a bunch of noise in the middle either way.
</p>

<center>
<img src="http://research.swtch.com/qr-bbc1.png"/>
</center>

<p class="lp">
Since the BBC QR logo appeared, there have been many imitators.
Most just slap an obviously out-of-place logo in the middle of the
code.  This <a href="http://blog.cliffano.com/2009/05/18/qr-code-usage-in-japan/">Disney poster</a>
is notable for being more in the spirit of the BBC code.
</p>

<p class="pp">
There's a different way to put pictures in QR codes.
Instead of scribbling on redundant pieces and relying on error
correction to preserve the meaning, we can engineer the
encoded values to create the picture in a code with no inherent errors,
like these:
</p>

<center>

<img src="http://research.swtch.com/qart1.png"/>
<img src="http://research.swtch.com/qart2.png"/>
<img src="http://research.swtch.com/qart3.png"/>
<img src="http://research.swtch.com/qart4.png"/>

</center>

<p class="lp">
This post explains the math behind making codes like these, which I call QArt codes.
I have published the Go programs that generated these codes at
<a href="http://code.google.com/p/rsc/source/browse/qr">code.google.com/p/rsc</a>
and created a <a href="http://research.swtch.com/qr/draw">web site for creating these codes</a>.
</p>

<h3>
Background
</h3>

<p class="lp">For error correction, QR uses Reed-Solomon coding
(like nearly everything else).
For our purposes, Reed-Solomon coding has two important properties.
First, it is what coding theorists call a <i>systematic code</i>: you can
see the original message in the encoding.
That is, the Reed-Solomon encoding of “hello” is “hello” followed by some error-correction bytes.
Second, Reed-Solomon encoded messages can be XOR'ed:
if we have two different Reed-Solomon encoded blocks
b<sub>1</sub> and b<sub>2</sub> corresponding to messages m<sub>1</sub> and m<sub>2</sub>, 
b<sub>1</sub> ⊕ b<sub>2</sub> is also a Reed-Solomon encoded block; it corresponds
to the message m<sub>1</sub> ⊕ m<sub>2</sub>.  (Here, ⊕ means XOR.)
If you are curious about why these two properties are true,
see my earlier post, <a href="http://research.swtch.com/field">Finite Field Arithmetic and Reed-Solomon Coding</a>.
</p>

<h3>QR Codes</h3>

<p class="lp">
A QR code has a distinctive frame that help both people and computers
recognize them as QR codes.  The details of the frame depend on the
exact size of the code—bigger codes have room for more bits—but you
know one when you see it: the outlined squares are the giveaway.
Here are QR frames for a sampling of sizes:
</p>

<center>

<img src="http://research.swtch.com/qart16.png"/>
</center>

<p class="lp">
The colored pixels are where the Reed-Solomon-encoded data bits go.
Each code may have one or more Reed-Solomon blocks, depending on
its size and the error correction level.  The pictures show the bits from
each block in a different color.
The L encoding is the lowest amount of redundancy, about 20%.
The other three encodings increase the redundancy, using 38%, 55%, and 65%.
</p>

<center>

<img src="http://research.swtch.com/qart17.png"/>
</center>

<p class="lp">(By the way, you can read the redundancy level from
the top pixels in the two leftmost columns.  If black=0 and white=1, then
you can see that 00 is L, 01 is M, 10 is Q, and 11 is H.
Thus, you can tell that the QR code <a href="http://www.flickr.com/photos/johncarney/3515851216/">on the T-shirt in this picture</a>
is encoded at the highest redundancy level,
while <a href="http://store.xkcd.com/xkcd/#QRCodeShirt">this shirt</a> uses the lowest level and therefore might take longer or be harder to scan.
</p>

<p class="pp">
As I mentioned above, the original message bits are included directly
in the message's Reed-Solomon encoding.
Thus, each bit in the original message corresponds to a pixel in the QR code.
Those are the lighter pixels in the pictures above.
The darker pixels are the error correction bits.
The encoded bits are laid down in a vertical boustrophedon pattern in
which each line is two columns wide, starting at the bottom right corner
and ending on the left side:
</p>

<center>

<img src="http://research.swtch.com/qart18.png"/>
</center>

<p class="lp">
We can easily work out where each message bit ends up in the QR code.
By changing those bits of the message, we can change those pixels and draw a picture.
There are, however, a few complications that make things interesting.
</p>

<h3>QR Masks</h3>

<p class="lp">
The first complication is that the encoded data is XOR'ed with an obfuscating
mask to create the final code.  There are eight masks:
</p>

<center>

<img src="http://research.swtch.com/qart19.png"/>
</center>

<p class="lp">An encoder is supposed to choose the mask that best hides
any patterns in the data, to keep those patterns from being mistaken
for framing boxes.  In our encoder, however, we can choose
a mask before choosing the data.  This violates the spirit of the spec
but still produces legitimate codes.
</p>

<h3>QR Data Encoding</h3>

<p class="lp">The second complication is that we want the QR code's message
to be intelligible.
We could draw arbitrary pictures using arbitrary 8-bit data, but when
scanned the codes would produce binary garbage.
We need to limit ourselves to data that produces sensible messages.
Luckily for us, QR codes allow messages to be written using a few
different alphabets.  One alphabet is 8-bit data, which would require binary
garbage to draw a picture.  Another is numeric data, in which every
run of 10 bits defines 3 decimal digits.  That limits our choice of 
pixels slightly: we must not generate a 10-bit run with a value above 999.
That's not complete flexibility, but it's close: 9.96 bits of freedom out of 10.
If, after encoding an image, we find that we've generated an invalid number,
we pick one of the 5 most significant bits at random—all of them must be 1s
to make an invalid number—hard wire that bit to zero, and start over.
</p>

<p class="pp">Having only decimal messages would still not be very interesting:
the message would be a very large number.
Luckily for us (again), QR codes allow a single message to be
composed from pieces using different encodings.  The codes I have
generated consist of an 8-bit-encoded URL ending in a #
followed by a numeric-encoded number that draws the actual picture:
</p>

<center>
http://swtch.com/pjw/#123456789...
</center>

<p class="lp">
The leading URL is the first data encoded; it takes up the right
side of the QR code.  The error correction bits take up the left side.
</p>

<p class="pp">When the phone scans the QR code, it sees a URL; loading it in a 
browser visits the base page and then looks for an internal anchor on
the page with the given number.  The browser won't find such an anchor,
but it also won't complain.</p>

<p class="pp">The techniques so far let us draw codes like this one:</p>

<center>
<img src="http://research.swtch.com/qart5.png"/>
<img src="http://research.swtch.com/qart6.png"/>
</center>

<p class="lp">The second copy darkens the pixels that we have no
control over: the error correction bits on the left and the URL prefix on the right.
I appreciate the cyborg effect of Peter melting into the binary noise,
but it would be nice to widen our canvas.
</p>

<h3>Gauss-Jordan Elimination</h3>

<p class="lp">
The third complication, then, is that we want to draw using
more than just the slice of data pixels in the middle of the image.
Luckily, we can.
</p>

<p class="pp">
I mentioned above that Reed-Solomon
messages can be XOR'ed:
if we have two different Reed-Solomon encoded blocks
b<sub>1</sub> and b<sub>2</sub> corresponding to messages m<sub>1</sub> and m<sub>2</sub>, 
b<sub>1</sub> ⊕ b<sub>2</sub> is also a Reed-Solomon encoded block; it corresponds
to the message m<sub>1</sub> ⊕ m<sub>2</sub>.
(In the notation of the <a href="http://research.swtch.com/field">previous post</a>, this happens because
Reed-Solomon blocks correspond 1:1 with multiples of g(x).
Since b<sub>1</sub> and b<sub>2</sub> are multiples of g(x), their sum is
a multiple of g(x) too.)
This property means that we can build up a valid Reed-Solomon block
from other Reed-Solomon blocks.
In particular, we can construct the sequence of blocks
b<sub>0</sub>, b<sub>1</sub>, b<sub>2</sub>, ..., where b<sub>i</sub> is the block whose data bits are
all zeros except for bit i and whose error correction bits
are then set to correspond to a valid Reed-Solomon block.
That set is a <a href="http://en.wikipedia.org/wiki/Basis_(linear_algebra)">basis</a> for the entire vector space of valid Reed-Solomon blocks.
Here is the basis matrix for the space of blocks with 2 data bytes and 2 checksum bytes:
</p>

<center>
<table border="0" cellpadding="0" cellspacing="0" class="matrix">
<tbody><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td>1</td><td/><td>1</td><td/><td/><td>1</td><td>1</td><td>1</td><td/><td/><td>1</td><td/><td/><td>1</td><td>1</td><td>1</td></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td>1</td><td>1</td><td/><td>1</td><td>1</td><td>1</td><td/><td>1</td><td>1</td><td/><td/><td>1</td><td>1</td><td>1</td><td/><td>1</td></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td>1</td><td>1</td><td>1</td><td/><td/><td/><td/><td/><td>1</td><td>1</td><td/><td/><td/><td/><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td/><td>1</td><td>1</td><td>1</td><td/><td/><td/><td/><td/><td>1</td><td>1</td><td/><td/><td/><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td/><td/><td>1</td><td>1</td><td>1</td><td/><td/><td/><td/><td/><td>1</td><td>1</td><td/><td/><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td/><td/><td/><td>1</td><td>1</td><td>1</td><td/><td/><td/><td/><td/><td>1</td><td>1</td><td/><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td/><td/><td/><td/><td>1</td><td>1</td><td>1</td><td/><td/><td/><td/><td/><td>1</td><td>1</td><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td/><td/><td/><td/><td/><td>1</td><td>1</td><td>1</td><td/><td/><td/><td/><td/><td>1</td><td>1</td><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td>1</td><td/><td/><td>1</td><td>1</td><td>1</td><td/><td>1</td><td/><td/><td/><td>1</td><td>1</td><td>1</td><td/><td>1</td></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td>1</td><td>1</td><td/><td/><td/><td/><td/><td/><td>1</td><td/><td/><td/><td/><td/><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td/><td>1</td><td>1</td><td/><td/><td/><td/><td/><td/><td>1</td><td/><td/><td/><td/><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td/><td/><td>1</td><td>1</td><td/><td/><td/><td/><td/><td/><td>1</td><td/><td/><td/><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td class="gray"/><td/><td/><td/><td>1</td><td>1</td><td/><td/><td/><td/><td/><td/><td>1</td><td/><td/><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td class="gray"/><td/><td/><td/><td/><td>1</td><td>1</td><td/><td/><td/><td/><td/><td/><td>1</td><td/><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td class="gray"/><td/><td/><td/><td/><td/><td>1</td><td>1</td><td/><td/><td/><td/><td/><td/><td>1</td><td/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray"/><td class="gray">1</td><td/><td/><td/><td/><td/><td/><td>1</td><td>1</td><td/><td/><td/><td/><td/><td/><td>1</td><td/></tr><tr height="1"><td colspan="32">
</td></tr></tbody></table>
</center>

<p class="lp">
The missing entries are zeros.  The gray columns highlight the
pixels we have complete control over: there is only one row 
with a 1 for each of those pixels.
Each time we want to change such a pixel,
we can XOR our current data with its row to change that pixel,
not change any of the other controlled pixels, and
keep the error correction bits up to date.
</p>

<p class="pp">
So what, you say.  We're still just twiddling data bits.
The canvas is the same.
</p>

<p class="pp">
But wait, there's more!
The basis we had above lets us change individual
data pixels, but we can XOR rows together to create 
other basis matrices that trade data bits for error correction bits.
No matter what, we're not going to increase
our flexibility—the number of pixels we have direct control over
cannot increase—but we can redistribute that flexibility throughout
the image, at the same time smearing the uncooperative noise
pixels evenly all over the canvas.
This is the same procedure as Gauss-Jordan elimination,
the way you turn a matrix into row-reduced echelon form.
</p>

<p class="pp">
This matrix shows the result of trying to assert control
over alternating pixels (the gray columns):
</p>

<center>
<table border="0" cellpadding="0" cellspacing="0" class="matrix">
<tbody><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray">1</td><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray">1</td><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td>1</td><td class="gray">1</td><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray">1</td><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td>1</td></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray">1</td><td/><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray">1</td><td/><td class="gray"/><td/><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray">1</td><td/><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray">1</td><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray">1</td><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td>1</td></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td/><td class="gray"/><td/><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray">1</td><td/><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray">1</td><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray">1</td><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td>1</td><td class="gray"/><td>1</td></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr><tr>
<td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td>1</td><td class="gray"/><td/><td class="gray"/><td/><td class="gray"/><td/></tr><tr height="1"><td colspan="32">
</td></tr></tbody></table>
</center>

<p class="lp">
The matrix illustrates an important point about this trick:
it's not completely general.
The data bits are linearly independent, but there are 
dependencies between the error correction bits
that mean we often can't have every pixel we ask for.
In this example, the last four pixels we tried to get
were unavailable: our manipulations of the rows to
isolate the first four error correction bits zeroed out
the last four that we wanted.
</p>

<p class="pp">
In practice, a good approach is to create
a list of all the pixels in the Reed-Solomon block sorted by
how useful it would be to be able to set that pixel.
(Pixels from high-contrast regions of the image are less
important than pixels from low-contrast regions.)
Then, we can consider each pixel in turn, and if the basis matrix 
allows it, isolate that pixel.
If not, no big deal, we move on to the next pixel.
</p>

<p class="pp">
Applying this insight, we can build wider but noisier
pictures in our QR codes:
</p>

<center>
<img src="http://research.swtch.com/qart7.png"/>
<img src="http://research.swtch.com/qart8.png"/>
</center>

<p class="lp">
The pixels in Peter's forehead and on his right side have
been sacrificed for the ability to draw the full width of the picture.
</p>

<p class="pp">
We can also choose the pixels we want to control at random,
to make Peter peek out from behind a binary fog:
</p>

<center>
<img src="http://research.swtch.com/qart9.png"/>
<img src="http://research.swtch.com/qart10.png"/>
<img src="http://research.swtch.com/qart11.png"/>
</center>

<h3>Rotations</h3>

<p>
One final trick.  QR codes have no required orientation. 
The URL base pixels
that we have no control over are on the right side in the
canonical orientation, but we can rotate the QR code to 
move them to other edges.
</p>

<center>
<img src="http://research.swtch.com/qart12.png"/>
<img src="http://research.swtch.com/qart13.png"/>
<br/>
<img src="http://research.swtch.com/qart14.png"/>
<img src="http://research.swtch.com/qart15.png"/>
</center>

<h3>Further Information</h3>

<p class="lp">
All the source code for this post, including the web server, is at 
<a href="http://code.google.com/p/rsc/source/browse/qr">code.google.com/p/rsc/source/browse/qr</a>.
If you liked this, you might also like
<a href="http://research.swtch.com/2010/03/zip-files-all-way-down.html">Zip Files All The Way Down</a>.

</p><h3>Acknowledgements</h3>

<p class="lp">
Alex Healy pointed out that valid Reed-Solomon encodings are closed under XOR,
which is the key to spreading the picture into the error correction pixels.
Peter Weinberger has been nothing but gracious about the overuse of his binary likeness.
Thanks to both.
</p></div>
    </content>
    <updated>2012-04-12T19:00:00Z</updated>
    <published>2012-04-12T19:00:00Z</published>
    <source>
      <id>tag:research.swtch.com,2012:research.swtch.com</id>
      <author>
        <name>Russ Cox</name>
        <email>rsc@swtch.com</email>
        <uri>https://plus.google.com/116810148281701144465</uri>
      </author>
      <link href="http://research.swtch.com/feed.atom" rel="self" type="application/atom+xml"/>
      <title>research!rsc</title>
      <updated>2012-09-17T15:00:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/04/11/falsestart</id>
    <link href="http://www.imperialviolet.org/2012/04/11/falsestart.html" rel="alternate" type="text/html"/>
    <title>False Start's Failure</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a>Eighteen months ago(ish), </a><a href="http://www.imperialviolet.org/2010/09/05/blacklisting.html">Chrome started</a> using <a href="https://technotes.googlecode.com/git/falsestart.html">False Start</a>. False Start reduces the average time for an SSL handshake <a href="http://blog.chromium.org/2011/05/ssl-falsestart-performance-results.html">by 30%</a>.<p/>

<p>Since the biggest problem with transport security is that most sites don't use it, anything that reduces the latency impact of HTTPS is important. Making things faster doesn't just make them faster, it also makes them cheaper and more prevalent. When HTTPS is faster, it'll be used in more places than it would otherwise be.</p>

<p>But, sadly, False Start will be disabled, except for sites doing <a href="https://technotes.googlecode.com/git/nextprotoneg.html">NPN</a>, in Chrome 20. NPN is a TLS extension that we use to negotiate SPDY, although you don't have to use it to negotiate SPDY, you can advertise <tt>http/1.1</tt> if you wish.</p>

<p>False Start was known to cause problems with a very small number of servers and the <a href="http://www.imperialviolet.org/2010/09/05/blacklisting.html">initial announcement</a> outlined the uncommon scheme that we used to deploy it: we scanned the public Internet and built up a list of problematic sites. That list was built into Chrome and we didn't use False Start for connections to those sites. Over time the list was randomly eroded away and I'd try to address any issues that came up. (Preemptively so in the case of large sites.)</p>

<p>It did work to some extent. Many sites that had problems were fixed and it's a deployment scheme that is worth considering in the future. But it didn't ultimately work well enough for False Start.</p>

<p>Initially we believed that False Start issues were deterministic so long as the TLS Finished and application data records were sent in the same TCP packet. We changed Chrome to do this in the hopes of making False Start issues deterministic. However, we later discovered some HTTPS servers that were still non-deterministically False Start intolerant. I hypothesise that the servers run two threads per connection: one for reading and one for writing. Although the TCP packet was received atomically, thread scheduling could mean that the read thread may or may not be scheduled before the write thread had updated the connection state in response to the Finished.</p>

<p>This non-determinism made False Start intolerance difficult to diagnose and reduced our confidence in the blacklist.</p>

<p>The `servers' with problems were nearly always SSL terminators. These hardware devices terminate SSL connections and proxy unencrypted data to backend HTTP servers. I believe that False Start intolerance is very simple to fix in the code and one vendor suggested that was the case. None the less, of the vendors who did issue an update, most failed to communicate that fact to their customers. (A pattern that has repeated with the <a href="http://www.imperialviolet.org/2012/01/15/beastfollowup.html">BEAST fix</a>.)</p>

<p>One, fairly major, SSL terminator vendor refused to update to fix their False Start intolerance despite problems that their customers were having. I don't believe that this was done in bad faith, but rather a case of something much more mundane along the lines of “the SSL guy left and nobody touches that code any more”. However, it did mean that there was no good answer for their customers who were experiencing problems.</p>

<p>Lastly, it was becoming increasingly clear that we had a bigger problem internationally. Foreign admins have problems finding information on the subject (which is mostly in English) and foreign users have problems reporting bugs because we can't read them. We do have excellent agents in countries who liaise locally but it was still a big issue, and we don't cover every country with them. I also suspect that the distribution of problematic SSL terminators is substantially larger in some countries and that the experience with the US and Europe caused us to underestimate the problem.</p>

<p>In aggregate this lead us to decide that False Start was causing more problems than it was worth. We will now limit it to sites that support the NPN extension. This unfortunately means that it'll be an arcane, unused optimisation for the most part: at least until SPDY takes over the world.</p></div>
    </content>
    <updated>2012-04-11T07:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:research.swtch.com,2012:research.swtch.com/field</id>
    <link href="http://research.swtch.com/field" rel="alternate" type="text/html"/>
    <title>Finite Field Arithmetic and Reed-Solomon Coding</title>
    <summary>How to make pictures with QR codes, part I</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p class="lp">
Finite fields are a branch of algebra formally defined in the 1820s,
but interest in the topic can be traced back to
public sixteenth-century polynomial-solving contests.
For the next few centuries, finite fields had little practical value,
but all changed in the last fifty years.
It turns out that they are useful for many applications
in modern computing, such as encryption, data compression,
and error correction.
</p>

<p class="pp">In particular,
Reed-Solomon codes are an error-correcting code based
on finite fields and used everywhere today.
One early significant use was in the
<a href="http://en.wikipedia.org/wiki/Error_detection_and_correction#Deep-space_telecommunications">Voyager spacecraft</a>: the messages
it still sends back today, from the edge of the solar system, are heavily 
Reed-Solomon encoded so that even if only a small fragment
makes it back to Earth, we can still reconstruct the message.
Reed-Solomon coding is also used on CDs to withstand scratches,
in wireless communications to withstand transmission problems,
in QR codes to withstand scanning errors or smudges,
in disks to withstand loss of fragments of the media,
in high-level storage systems like Google's GFS and BigTable
to withstand data loss and also to reduce read latency
(the read can complete without waiting for all the responses to arrive).
</p>

<p class="pp">
This post shows how to implement finite field arithmetic efficiently
on a computer,
and then how to use that to implement Reed-Solomon encoding.
</p>

<h2>
What is a Finite Field?
</h2>

<p class="pp">
One way mathematicians study numbers 
is to abstract away the numbers themselves and focus
on the operations.  (This is kind of an object-oriented
approach to math.)
A <i>field</i> is defined as a set F and operators
+ and · on elements of F that satisfy the following properties:
</p>

<ol>
<li>(Closure) For all x, y in F, x+y and x·y are in F.
</li><li>(Associative) For all x, y, z in F, (x+y)+z = x+(y+z) and (x·y)·z = x·(y·z).
</li><li>(Commutative) For all x, y in F, x+y = y+x and x·y = y·x.
</li><li>(Distributive) For all x, y, z in F, x·(y+z) = (x·y)+(x·z).
</li><li>(Identity) There is some element we'll call 0 in F such that for all x in F, x+0 = x.
Similarly, there is some element we'll call 1 in F such that for all x in F, x·1 = x.
</li><li>(Inverse) For all x in F, there is some element y in F such that x+y = 0.  We write y = −x.
Similarly, for all x in F except 0, there is some element y in F such that x·y = 1.  We write y = 1/x.
</li></ol>

<p class="lp">
You probably recognize those properties from high school
algebra class: the most well-known example of a field
is the real numbers, where + is addition and · is multiplication.
Other examples are complex numbers and fractions.
</p>

<p class="pp">
A mathematician doesn't have to prove the same results over and over
for the real numbers ℝ, the complex numbers ℂ, the fractions ℚ, and so on.
Instead, she can prove that a particular result holds for all fields—by assuming only
the above properties, called the field axioms.  Then she can apply the result by
substituting a specific instance like the real numbers for the general idea of a field,
the same way that a programmer can implement just one <code>vector(T)</code>
and then instantiate it as <code>vector(int)</code>, <code>vector(string)</code> and so on.
</p>

<p class="pp">
The integers ℤ are not a field: they lack multiplicative inverses.
For example, there is no number that you can multiply by 2 to get 1, no 1/2.
Surprisingly, though, the integers modulo any prime p do
form a field.  For example, the integers modulo 5 are 0, 1, 2, 3, 4.
1+4 = 0 (mod 5), so we say that 4 = −1.  Similarly, 2·3 = 1 (mod 5),
so we say that 3 = 1/2.
After we've proved that ℤ/p is in fact a field,
all the results about fields can be applied to ℤ/p.
This is very useful: it lets us apply our intuition
about the very familiar real numbers
to these less familiar numbers.
This field is written ℤ/p to emphasize that we're dealing with
what's left after subtracting out all the p's.
That is, we're dealing with what's left if you assume that p = 0.
When you make that assumption, you get math that wraps around at p.
These fields are called finite fields because,
in contrast to fields like the real numbers,
they have a finite number of elements.
</p>

<p class="pp">
For a programmer, the most interesting finite field is
ℤ/2, which contains just the integers 0, 1.  Addition
is the same as XOR, and multiplication is the same as AND.
Note that ℤ/p is only a field when p is prime:
arithmetic on <code>uint8</code> variables corresponds
to ℤ/256, but it is not a field: there is no 1/2.
</p>

<h2>What can you do with a field?</h2>

<p class="pp">
The only problem with fields is that there's not a ton
you can do with just the field axioms.
One thing you <i>can</i> do is build polynomials,
which were the original motivation for the 
mathematicians who pioneered the use of fields
in the early 1800s.
If we introduce a symbolic variable x,
then we can build polynomials whose coefficients
are field values.
We'll write F[x] to denote the polynomials over x
using coefficients from F.
For example, if we use the real numbers ℝ as our field,
then the polynomials ℝ[x] include x<sup>2</sup>+1, x+2, and
3.14x<sup>2</sup> − 2.72x + 1.41.
Like integers, these polynomials can be added and multiplied,
but not always divided—what is (x<sup>2</sup>+1)/(x+2)?—so they are not a field.
However, remember how the integers are not a field but
the integers modulo a prime are a field?
The same happens here: polynomials are not a field
but polynomials modulo some prime polynomial <i>are</i>.
</p>

<p class="pp">
What does “polynomials modulo
some prime polynomial” mean anyway?
A prime polynomial is one that cannot be factored,
like x<sup>2</sup>+1 cannot be factored using real numbers.
The field ℤ/5 is what you get by doing math under
the assumption that 5 = 0; similarly, ℝ[x]/(x<sup>2</sup>+1)
is what you get by doing math under the assumption
that x<sup>2</sup>+1 = 0.  Just as ℤ/5 math never deals with
numbers as big as 5, ℝ[x]/(x<sup>2</sup>+1) math never deals
with polynomials as big as x<sup>2</sup>: anything bigger can
have some multiple of x<sup>2</sup>+1 subtracted out again.
That is, the polynomials in ℝ[x]/(x<sup>2</sup>+1) are bounded in size:
they have only x<sup>1</sup> and x<sup>0</sup> (constant) terms.
To add polynomials, we just add the coefficients using
the addition rule from the coefficient's field,
independently, like a vector addition.
To multiply polynomials, we have to do the
multiplication and then subtract out any x<sup>2</sup>+1 we can.
If we have 
(ax+b)·(cx+d), we can expand this to
(a·c)x<sup>2</sup> + (b·c+a·d)x + (b·d),
and then subtract (a·c)(x<sup>2</sup>+1) = (a·c)x<sup>2</sup> + (a·c),
producing the final result: (b·c+a·d)x + (b·d−a·c).
That might seem like a funny definition of multiplication,
but it does in fact obey the field axioms.
In fact, this particular field is more familiar than it
looks: it is the complex numbers ℂ,
but we've written x instead of the usual i.
Assuming that x<sup>2</sup>+1 = 0 is, except for a renaming,
the same as defining i<sup>2</sup> = −1.
</p>

<p class="pp">
Doing all our math modulo a prime polynomial
let us take the field of real numbers and produce
a field whose elements are pairs of real numbers.
We can apply the same trick to take a finite field
like ℤ/p and product a field whose elements are
fixed-length vectors of elements of ℤ/p.
The original ℤ/p has p elements.
If we construct (ℤ/p)[x]/f(x), where f(x) is a
prime polynomial of degree n (f's maximum x exponent is n), the resulting
field has p<sup>n</sup> elements: all
the vectors made up of n elements from ℤ/p.
Incredibly, the choice of prime polynomial
doesn't matter very much: any two finite fields of size
p<sup>n</sup> have identical structure, even if they give the
individual elements different names.
Because of this, it makes sense to refer to all the finite
fields of size p<sup>n</sup> as one concept: GF(p<sup>n</sup>).
The GF stands for Galois Field, in honor of Évariste Galois,
who was the first to study these.
The exact polynomial chosen to produce a particular
GF(p<sup>n</sup>) is an implementation detail.
</p>

<p class="pp">
For a programmer, the most interesting finite fields
constructed this way are GF(2<sup>n</sup>)—the polynomial
extensions of ℤ/2—because
the elements of GF(2<sup>n</sup>) are bit vectors of length n.
As a concrete example, consider (ℤ/2)[x]/(x<sup>8</sup>+x<sup>4</sup>+x<sup>3</sup>+x+1) .
The field has 2<sup>8</sup> elements: each can be
represented by a single byte.  The byte
with binary digits b<sub>7</sub>b<sub>6</sub>b<sub>5</sub>b<sub>4</sub>b<sub>3</sub>b<sub>2</sub>b<sub>1</sub>b<sub>0</sub> represents
the polynomial b<sub>7</sub>·x<sup>7</sup> + b<sub>6</sub>·x<sup>6</sup> + b<sub>5</sub>·x<sup>5</sup> + b<sub>4</sub>·x<sup>4</sup> + b<sub>3</sub>·x<sup>3</sup> + b<sub>2</sub>·x<sup>2</sup> + b<sub>1</sub>·x<sup>1</sup> + b<sub>0</sub>.
To add polynomials, we add coefficients.
Since the coefficients are from ℤ/2, adding coefficients
means XOR'ing each bit position separately,
which is something computer hardware can do easily.
Multiplying the polynomials is more difficult,
because standard multiplication hardware is based
on adding, but we need a multiplication based on XOR'ing.
Because the coefficient math wraps
at 2, (x<sup>2</sup>+x)·(x+1) = x<sup>3</sup>+2x<sup>2</sup>+x = x<sup>3</sup>+x,
while computer multiplication would choose
110<sub>2</sub>* 011<sub>2</sub> = 6 * 3 = 18 = 10010<sub>2</sub>.
However, it turns out that we can implement this
field multiplication with a simple lookup table.
In a finite field, there is always at least one
element α that can serve as a generator.
All the other non-zero elements are powers of α: α, α<sup>2</sup>, α<sup>3</sup>, and so on.
This α is not symbolic like x: it's a specific element.
For example, in ℤ/5, we can use α=2: {α, α<sup>2</sup>, α<sup>3</sup>, α<sup>4</sup>} = {2, 4, 8, 16} = {2, 4, 3, 1}.
In GF(2<sup>n</sup>) the math is more complex but still works.
If we know the generator, then we can, by repeated
multiplication, create a lookup table exp[i] = αⁱ and an 
inverse table log[αⁱ] = i.
Multiplication is then just a few table lookups:
assuming a and b are non-zero,
a·b = exp[log[a]+log[b]].
(That's a normal integer +, to add the exponents, not an XOR.)
</p>

<h2>Why do we care?</h2>

<p class="pp">
The fact that GF(2<sup>n</sup>) can be implemented efficiently
on a computer means that we can implement systems
based on mathematical theorems
without worrying about the usual overflow problems
you get when modeling integers or real numbers.
To be sure, GF(2<sup>n</sup>) behaves quite differently from
the integers in many ways, but if all you need is
the field axioms, it's good enough,
and it eliminates any need to worry about
overflow or arbitrary precision calculations.
Because of the lookup table, GF(2<sup>8</sup>) is by far the
most common choice of field in a computer algorithm.
For example, the Advanced Encryption Standard
(AES, formerly Rijndael) is built around GF(2<sup>8</sup>) arithmetic,
as are nearly all implementations of Reed-Solomon coding.
</p>

<h2>Code</h2>

<p class="lp">
Let's begin by defining a <code>Field</code> type that will
represent the specific instance of GF(2<sup>8</sup>) defined by a 
given polynomial.
The polynomial must be of degree 8, meaning that
its binary representation has the 0x100 bit set and no
higher bits set.
</p>

<pre>type Field struct {
    ...
}
</pre>

<p class="lp">
Addition is just XOR, no matter what the polynomial is:
</p>

<pre>// Add returns the sum of x and y in the field.
func (f *Field) Add(x, y byte) byte {
    return x ^ y
}
</pre>

<p class="lp">
Multiplication is where things get interesting.
If you'd used binary (and Go) in grade school, you might have learned
this algorithm for multiplying two numbers
(this is <i>not</i> finite field arithmetic):
</p>

<pre>// Grade-school multiplication in binary: mul returns the product x×y.
func mul(x, y int) int {
    z := 0
    for x &gt; 0 {
        if x&amp;1 != 0 {
            z += y
        }
        x &gt;&gt;= 1
        y &lt;&lt;= 1
    }
    return z
}
</pre>

<p class="lp">
The running total <code>z</code> accumulates the product of <code>x</code> and <code>y</code>.
The first iteration of this loop adds <code>y</code> to <code>z</code> if the
low bit (the 1s digit) of <code>x</code> is 1.
The next iteration adds <code>y*2</code> if the next bit (the 2s digit, now shifted down) of
<code>x</code> is 1.
The next iteration adds <code>y*4</code> if the 4s digit is 1, and so on.
Each iteration shifts x to the right to chop off the processed digit
and shifts y to the left to multiply by two.
</p>

<p class="pp">
To adapt this to multiply in a finite field, we need to make two changes.
First, addition is XOR, so we use <code>^=</code> instead of <code>+=</code>
to add to <code>z</code>.
Second, we need to make the multiply reduce modulo the polynomial.
Assuming that the inputs have already been reduced, the only chance
of exceeding the polynomial comes from the shift of <code>y</code>.
After the shift, then, we can check to see if we've overflowed, and if so,
subtract (XOR) out one copy of the polynomial.
The finite field version, then, is:
</p>

<pre>// GF(256) mutiplication: mul returns the product x×y mod poly.
func mul(x, y, poly int) int {
    z := 0
    for x &gt; 0 {
        if x&amp;1 != 0 {
            z ^= y
        }
        x &gt;&gt;= 1
        y &lt;&lt;= 1
        if y&amp;0x100 != 0 {
            y ^= poly
        }
    }
    return z
}
</pre>

<p class="lp">We might want to do a lot of multiplication, though,
and this loop is too slow.  There aren't that many inputs—only 2<sup>8</sup>×2<sup>8</sup> of them—so one
option is to build a 64kB lookup table.  With some cleverness, we can
build a smaller lookup table.
In the <code>NewField</code> 
constructor, we can compute α<sup>0</sup>, α<sup>1</sup>, α<sup>2</sup>, ..., record the sequence
in an <code>exp</code> array, and record the inverse in 
a <code>log</code> array.
Then we can reduce multiplication to addition of logarithms,
like a <a href="http://en.wikipedia.org/wiki/Slide_rule">slide rule</a> does.
</p>

<pre>// A Field represents an instance of GF(256) defined by a specific polynomial.
type Field struct {
    log [256]byte // log[0] is unused
    exp [510]byte
}

// NewField returns a new field corresponding to
// the given polynomial and generator.
func NewField(poly, α int) *Field {
    var f Field
    x := 1
    for i := 0; i &lt; 255; i++ {
        f.exp[i] = byte(x)
        f.exp[i+255] = byte(x)
        f.log[x] = byte(i)
        x = mul(x, α, poly)
    }
    f.log[0] = 255
    return &amp;f
}
</pre>

<p class="lp">
The values of the <code>exp</code> function cycle with period 255
(not 256, because 0 is impossible): α<sup>255</sup> = 1.
The straightforward way to implement <code>Exp</code>, then,
is to look up the entry given by the exponent modulo 255.
</p>

<pre>// Exp returns the base 2 exponential of e in the field.
// If e &lt; 0, Exp returns 0.
func (f *Field) Exp(e int) byte {
    if e &lt; 0 {
        return 0
    }
    return f.exp[e%255]
}
</pre>

<p class="lp">
<code>Log</code> is an even simpler table lookup, because the input
is only a byte:
</p>

<pre>// Log returns the base 2 logarithm of x in the field.
// If x == 0, Log returns -1.
func (f *Field) Log(x byte) int {
    if x == 0 {
        return -1
    }
    return int(f.log[x])
}
</pre>

<p class="lp">
<code>Mul</code> is where things get interesting.
The obvious implementation of <code>Mul</code> is <code>exp[(log[x]+log[y])%255]</code>,
but if we double the <code>exp</code> array, so that it is 510 elements long,
we can drop the relatively expensive <code>%255</code>:
</p>

<pre>// Mul returns the product of x and y in the field.
func (f *Field) Mul(x, y byte) byte {
    if x == 0 || y == 0 {
        return 0
    }
    return f.exp[int(f.log[x])+int(f.log[y])]
}
</pre>

<p class="lp">
<code>Inv</code> returns the multiplicative inverse, 1/x.
We don't implement divide: instead of x/y, we can use x · 1/y.
</p>

<pre>// Inv returns the multiplicative inverse of x in the field.
// If x == 0, Inv returns 0.
func (f *Field) Inv(x byte) byte {
    if x == 0 {
        return 0
    }
    return f.exp[255-f.log[x]]
}
</pre>

<h2>Reed-Solomon Coding</h2>

<p class="lp">In 1960, Irving Reed and Gustave Solomon proposed a way
to build an error-correcting code using GF(2<sup>n</sup>).
The method interpreted the m message bits as coefficients of a polynomial f of degree m−1
over GF(2<sup>n</sup>) and then sent f(0), f(α), f(α<sup>2</sup>), f(α<sup>3</sup>), ..., f(1).
Any m of these, if received correctly, suffice to reconstruct f,
and then the message can be read off the coefficients.
To find a correct set, Reed and Solomon's algorithm constructed the
f corresponding to every possible subset of m received values 
and then chose the most common one in a majority vote.
As long as no more than (2<sup>n</sup>−m)/2 values were corrupted
in transit, the majority will agree on the correct value of f.
This decoding algorithm is very expensive, too expensive for
long messages.
As a result, the Reed-Solomon approach sat unused for
almost a decade.
In 1969, however, Elwyn Berlekamp and James Massey
proposed a variant with an efficient decoding algorithm.
In the 1980s, Berlekamp and Lloyd Welch developed an
even more efficient decoding algorithm that is the one typically used today.
These decoding algorithms are based on
systems of equations far too complex to explain here;
in this post, we will only deal with encoding.
(I can't keep the decoding algorithms straight in my head for more than 
an hour or two at a time, much less explain them in finite space.)
</p>

<p class="pp">In Reed-Solomon encoding as it is practiced today,
the choice of finite field F and generator α defines a
generator polynomial g(x) = (x−1)(x−α)(x−α<sup>2</sup>)...(x−α<sup>n−m</sup>).
To encode a message m, the message is taken as the
top coefficients of a degree n polynomial f(x) =
m<sub>0</sub>x<sup>n−1</sup>+m<sub>1</sub>x<sup>n−2</sup>+...+m<sub>m</sub>x<sup>n−m−1</sup>.
Then that polynomial can be divided by g to produce the
remainder polynomial r(x), the unique polynomial of
degree less than n−m such that f(x) − r(x)
is a multiple of g(x).
Since r(x) is of degree less than n−m, subtracting r(x) does not
affect any of the message coefficients, just the lower terms,
so the polynomial f(x) − r(x) (= f(x) + r(x)) is taken as the
encoded message.  All encoded messages, then, are multiples of g(x).
On the receiving end, the decoder does some magic to figure
out the simplest changes needed to make the received
polynomial a multiple of g(x) and then reads the message
out of the top coefficients.
</p>

<p class="pp">While decoding is difficult, encoding is easy:
the first m bytes are the message itself, followed by
the c bytes defining the remainder of m·x<sup>c</sup>/g(x).
We can also check whether we received an error-free
message by checking whether the concatenation
defines a polynomial that is a multiple of g(x).
</p>

<h2>Code</h2>

<p class="lp">The Reed-Solomon encoding problem is this: given a message m interpreted as a polynomial m(x), compute the error correction bytes, m(x)·x<sup>c</sup> mod g(x).
</p>

<p class="pp">The grade-school division algorithm works well here.
If we fill in <code>p</code> with m(x)·x<sup>c</sup> (m followed by c zero bytes),
then we can replace <code>p</code> by the remainder by iteratively subtracting out
multiples of the generator polynomial g.
</p>

<pre>for i := 0; i &lt; len(m); i++ {
    k := f.Mul(p[i], f.Inv(gen[0]))  // k = p<sub>i</sub> / g<sub>0</sub>
    // p -= k·g
    for j, g := range gen {
        p[i+j] = f.Add(p[i+j], f.Mul(k, g))
    }
}
</pre>

<p class="lp">This implementation is correct but can be made
more efficient.  If you want to try, 
run:
</p>
<pre>go get code.google.com/p/rsc/gf256
go test code.google.com/p/rsc/gf256 -bench Blog
</pre>

<p class="lp">That benchmark measures
the speed of the implementation in <code>blog_test.go</code>,
which looks like the above.  Optimize away, or follow along.
</p>

<p class="pp">There's definitely room for improvement:</p>

<pre>$ go test code.google.com/p/rsc/gf256 -bench ECC
PASS
BenchmarkBlogECC   500000   7031 ns/op   4.55 MB/s
BenchmarkECC      1000000   1332 ns/op  24.02 MB/s
</pre>

<p class="lp">
To start, we can expand the definitions of <code>Add</code> and <code>Mul</code>.
The Go compiler's inliner would do this for us; the win here is not
the inlining but the simplifications it will enable us to make.
</p>

<pre>for i := 0; i &lt; len(m); i++ {
    if p[i] == 0 {
        continue
    }
    k := f.exp[f.log[p[i]] + 255 - f.log[gen[0]]]  // k = p<sub>i</sub> / g<sub>0</sub>
    // p -= k·g
    for j, g := range gen {
        p[i+j] ^= f.exp[f.log[k] + f.log[g]]
    }
}
</pre>

<p class="lp">
(The implementation handles <code>p[i] == 0</code> specially
because 0 has no log.)
</p>

<p class="pp">
The first thing to note is that we compute <code>k</code> but then use
<code>f.log[k]</code> repeatedly.  Computing the log will avoid that
memory access, and it is cheaper: we just take out the <code>f.exp[...]</code> lookup
on the line that computes <code>k</code>.  This is safe because <code>p[i]</code> is non-zero, so <code>k</code> must be non-zero.
</p>

<pre>for i := 0; i &lt; len(m); i++ {
    if p[i] == 0 {
        continue
    }
    lk := f.log[p[i]] + 255 - f.log[gen[0]]  // k = p<sub>i</sub> / g<sub>0</sub>
    // p -= k·g
    for j, g := range gen {
        p[i+j] ^= f.exp[lk + f.log[g]]
    }
}
</pre>

<p class="lp">
Next, note that we repeatedly compute <code>f.log[g]</code>.  Instead of doing that,
we can iterate <code>lgen</code>—an array holding the logs of the coefficients—instead of <code>gen</code>.
We'll have to handle zero somehow: let's say that the array has an entry set to 255
when the corresponding <code>gen</code> value is zero.
</p>

<pre>for i := 0; i &lt; len(m); i++ {
    if p[i] == 0 {
        continue
    }
    lk := f.log[p[i]] + 255 - f.log[gen[0]]  // k = p<sub>i</sub> / g<sub>0</sub>
    // p -= k·g
    for j, lg := range lgen {
        if lg != 255 {
            p[i+j] ^= f.exp[lk + lg]
        }
    }
}
</pre>

<p class="lp">
Next, we can notice that since the generator is defined as
</p>

<center>
g(x) = (x−1)(x−α)(x−α<sup>2</sup>)...(x−α<sup>n−m</sup>)
</center>

<p class="lp">
the first coefficient, g<sub>0</sub>, is always 1!
That means we can simplify the k = p<sub>i</sub> / g calculation
to just k = p<sub>i</sub>.  Also, we can drop the first element of lgen
and its subtraction, as long as we ignore the high bytes in the result
(we know they're supposed to be zero anyway).
</p>

<pre>for i := 0; i &lt; len(m); i++ {
    if p[i] == 0 {
        continue
    }
    lk := f.log[p[i]]
    // p -= k·g
    for j, lg := range lgen {
        if lg != 255 {
            p[i+1+j] ^= f.exp[lk + lg]
        }
    }
}
</pre>

<p class="lp">
The inner loop, which is where we spend all our time, has two 
additions by loop-invariant constants: <code>i+1+j</code> and <code>lk+lg</code>.
The <code>i+1</code> and <code>lk</code> do not change on each iteration.
We can avoid those additions by reslicing the arrays 
outside the loop:
</p>

<pre>for i := 0; i &lt; len(m); i++ {
    if p[i] == 0 {
        continue
    }
    lk := f.log[p[i]]
    // p -= k·g
    q := p[i+1:]
    exp := f.exp[lk:]
    for j, lg := range lgen {
        if lg != 255 {
            q[j] ^= exp[lg]
        }
    }
}
</pre>

<p class="lp">As one final trick, we can replace <code>p[i]</code> by a range variable.
The Go compiler does not yet use
loop invariants to eliminate bounds checks, but it does eliminate
bounds checks in the implicit indexing done by a range loop.
</p>

<pre>for i, pi := range p {
    if i == len(m) {
        break
    }
    if pi == 0 {
        continue
    }
    // p -= k·g
    q := p[i+1:]
    exp := f.exp[f.log[pi]:]
    for j, lg := range lgen {
        if lg != 255 {
            q[j] ^= exp[lg]
        }
    }
}
</pre>

<p class="lp">
The code is in context in
<a href="http://code.google.com/p/rsc/source/browse/gf256/gf256.go#120">gf256.go</a>.
</p>

<h2>Summary</h2>

<p class="lp">
We started with single bits 0 and 1.
From those we constructed 8-bit polynomials—the elements
of GF(2<sup>8</sup>)—with overflow-free, easy-to-implement 
mathematical operations.
From there we moved on to Reed-Solomon coding,
which constructs its own polynomials built using 
elements of GF(2<sup>8</sup>) as coefficients.
That is, each Reed-Solomon message is interpreted 
as a polynomial, and each coefficient in that polynomial
is itself a smaller polynomial.
</p>

<p class="pp">
Now that we know how to create Reed-Solomon encodings, the next post 
will look at some fun we can have with them.
</p></div>
    </content>
    <updated>2012-04-10T18:00:00Z</updated>
    <published>2012-04-10T18:00:00Z</published>
    <source>
      <id>tag:research.swtch.com,2012:research.swtch.com</id>
      <author>
        <name>Russ Cox</name>
        <email>rsc@swtch.com</email>
        <uri>https://plus.google.com/116810148281701144465</uri>
      </author>
      <link href="http://research.swtch.com/feed.atom" rel="self" type="application/atom+xml"/>
      <title>research!rsc</title>
      <updated>2012-09-17T15:00:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6983287.post-204147499802585288</id>
    <link href="http://www.blogger.com/feeds/6983287/posts/default/204147499802585288" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6983287/posts/default/204147499802585288" rel="self" type="application/atom+xml"/>
    <link href="http://commandcenter.blogspot.com/2012/04/byte-order-fallacy.html" rel="alternate" type="text/html"/>
    <title>The byte order fallacy</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div>Whenever I see code that asks what the native byte order is, it's almost certain the code is either wrong or misguided. And if the native byte order really does matter to the execution of the program, it's almost certain to be dealing with some external software that is either wrong or misguided. If your code contains <span class="Apple-style-span" style="font-family: 'trebuchet ms';">#ifdef BIG_ENDIAN</span> or the equivalent, you need to unlearn about byte order.</div><div><br/></div><div>The byte order of the computer doesn't matter much at all except to compiler writers and the like, who fuss over allocation of bytes of memory mapped to register pieces. Chances are you're not a compiler writer, so the computer's byte order shouldn't matter to you one bit.</div><div><br/></div><div>Notice the phrase "computer's byte order". What <i>does</i> matter is the byte order of a peripheral or encoded data stream, but--and this is the key point--the byte order of the computer doing the processing is irrelevant to the processing of the data itself. If the data stream encodes values with byte order B, then the algorithm to decode the value on computer with byte order C should be about B, <i>not about the relationship between B and C</i>.</div><div><br/></div><div>Let's say your data stream has a little-endian-encoded 32-bit integer. Here's how to extract it (assuming unsigned bytes):</div><blockquote><div><span class="Apple-style-span" style="font-family: 'trebuchet ms';">i = (data[0]&lt;&lt;0) | (data[1]&lt;&lt;8) | (data[2]&lt;&lt;16) | (data[3]&lt;&lt;24);</span></div></blockquote><div>If it's big-endian, here's how to extract it:</div><blockquote><div><span class="Apple-style-span" style="font-family: 'trebuchet ms';">i = (data[3]&lt;&lt;0) | (data[2]&lt;&lt;8) | (data[1]&lt;&lt;16) | (data[0]&lt;&lt;24);</span></div></blockquote><div>Both these snippets work on any machine, independent of the machine's byte order, independent of alignment issues, independent of just about anything. They are totally portable, given unsigned bytes and 32-bit integers.</div><div><br/></div><div>What you might have expected to see for the little-endian case was something like</div><div/><blockquote><div><span class="Apple-style-span" style="font-family: 'trebuchet ms';">i = *((int*)data);</span></div><div><span class="Apple-style-span" style="font-family: 'trebuchet ms';">#ifdef BIG_ENDIAN</span></div><div><span class="Apple-style-span" style="font-family: 'trebuchet ms';">  /* swap the bytes */</span></div><div><span class="Apple-style-span" style="font-family: 'trebuchet ms';">  i = ((i&amp;0xFF)&lt;&lt;24) | (((i&gt;&gt;8)&amp;0xFF)&lt;&lt;16) | (((i&gt;&gt;16)&amp;0xFF)&lt;&lt;8) | (((i&gt;&gt;24)&amp;0xFF)&lt;&lt;0);</span></div><div><span class="Apple-style-span" style="font-family: 'trebuchet ms';">#endif</span></div></blockquote><div>or something similar. I've seen code like that many times. Why not do it that way? Well, for starters:</div><div><ol><li>It's more code.</li><li>It assumes integers are addressable at any byte offset; on some machines that's not true.</li><li>It depends on integers being 32 bits long, or requires more <span class="Apple-style-span" style="font-family: 'trebuchet ms';">#ifdefs</span> to pick a 32-bit integer type.</li><li>It may be a little faster on little-endian machines, but not much, and it's slower on big-endian machines.</li><li>If you're using a little-endian machine when you write this, there's no way to test the big-endian code.</li><li>It swaps the bytes, a sure sign of trouble (see below).</li></ol></div><div><br/></div><div>By contrast, my version of the code:</div><div><ol><li>Is shorter.</li><li>Does not depend on alignment issues.</li><li>Computes a 32-bit integer value regardless of the local size of integers.</li><li>Is equally fast regardless of local endianness, and fast enough (especially on modern processsors) anyway.</li><li>Runs the same code on all computers: I can state with confidence that if it works on a little-endian machine it will work on a big-endian machine.</li><li>Never "byte swaps".</li></ol></div><div>In other words, it's simpler, cleaner, and utterly portable. There is no reason to ask about local byte order when about to interpret an externally provided byte stream.</div><div><br/></div><div>I've seen programs that end up swapping bytes two, three, even four times as layers of software grapple over byte order. In fact, byte-swapping is the surest indicator the programmer doesn't understand how byte order works.</div><div><br/></div><div>Why do people make the byte order mistake so often? I think it's because they've seen a lot of bad code that has convinced them byte order matters. "Here comes an encoded byte stream; time for an <span class="Apple-style-span" style="font-family: 'trebuchet ms';">#ifdef</span>." In fact, C may be part of the problem: in C it's easy to make byte order look like an issue. If instead you try to write byte-order-dependent code in a type-safe language, you'll find it's very hard. In a sense, byte order only bites you when you cheat.</div><div><br/></div><div>There's plenty of software that demonstrates the byte order fallacy is really a fallacy. The entire Plan 9 system ran, without architecture-dependent <span class="Apple-style-span" style="font-family: 'trebuchet ms';">#ifdefs</span> of any kind, on dozens of computers of different makes, models, and byte orders. I promise you, your computer's byte order doesn't matter even at the level of the operating system.</div><div><br/></div><div>And there's plenty of software that demonstrates how easily you can get it wrong. Here's one example. I don't know if it's still true, but some time back Adobe Photoshop screwed up byte order. Back then, Macs were big-endian and PCs, of course, were little-endian. If you wrote a Photoshop file on the Mac and read it back in, it worked. If you wrote it on a PC and tried to read it on a Mac, though, it wouldn't work unless back on the PC you checked a button that said you wanted the file to be readable on a Mac. (Why wouldn't you? Seriously, why wouldn't you?) Ironically, when you read a Mac-written file on a PC, it always worked, which demonstrates that someone at Adobe figured out something about byte order. But there would have been no problems transferring files between machines, and no need for a check box, if the people at Adobe wrote proper code to encode and decode their files, code that could have been identical between the platforms. I guarantee that to get this wrong took far more code than it would have taken to get it right.</div><div><br/></div><div>Just last week I was reviewing some test code that was checking byte order, and after some discussion it turned out that there was a byte-order-dependency bug in the code being tested. As is often the case, the existence of byte-order-checking was evidence of the presence of a bug. Once the bug was fixed, the test no longer cared about byte order.</div><div><br/></div><div>And neither should you, because byte order doesn't matter.</div><div><br/></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6983287-204147499802585288?l=commandcenter.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-04-05T04:49:27Z</updated>
    <published>2012-04-04T05:22:00Z</published>
    <author>
      <name>rob</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/18259238879445421354</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6983287</id>
      <author>
        <name>rob</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/18259238879445421354</uri>
      </author>
      <link href="http://commandcenter.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6983287/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://commandcenter.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <title>command center</title>
      <updated>2012-09-23T03:33:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-3956487528994742648</id>
    <link href="http://mue.tideland.biz/feeds/3956487528994742648/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/yesterdays-go-talk.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/3956487528994742648" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/3956487528994742648" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/yesterdays-go-talk.html" rel="alternate" type="text/html"/>
    <title>Yesterdays Go talk</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Yesterday afternoon I had my talk about Google Go at the <a href="http://bremen.gtugs.org/">GTUG Bremen</a> - which soon btw. will be the GDG Bremen. The audience has been about 25 people, a good number. And the interest has been high, I got many questions during the talk. This interaction is definitely a lot better than just talking to a silent audience.<br/><br/>But there's still room for improvement. The presentation maybe should have been shorter, followed by a practical workshop. I prepared a little toy program that will be published like the slides. I wanted to show how Go looks in reality and to demonstrate, how to implement a wanted feature. But sadly due to the long talk there only has been little room left for that.<br/><br/>The GTUG team recorded the talk on a video that will be published soon and I just will fix some small detected errors on the slides and then publish it too. You'll find a notice here.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-3956487528994742648?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-04-03T14:25:22Z</updated>
    <published>2012-04-03T14:25:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="talk"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-3043711970952155265</id>
    <link href="http://mue.tideland.biz/feeds/3043711970952155265/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/quick-reminder-go-talk-today-at-gtug.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/3043711970952155265" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/3043711970952155265" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/quick-reminder-go-talk-today-at-gtug.html" rel="alternate" type="text/html"/>
    <title>Quick reminder: Go talk today at GTUG Bremen</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Just a quick reminder: Today is the monthly regulars' table of the <a href="http://bremen.gtugs.org/events/stammtischapril2012" target="_blank">GTUG Bremen</a>. This time I'll give a talk about Google Go.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-3043711970952155265?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-04-02T08:03:40Z</updated>
    <published>2012-04-02T08:03:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="talk"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-566870244872597765</id>
    <link href="http://mue.tideland.biz/feeds/566870244872597765/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/common-go-library-updated-for-go-1.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/566870244872597765" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/566870244872597765" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/04/common-go-library-updated-for-go-1.html" rel="alternate" type="text/html"/>
    <title>Common Go Library updated for Go 1</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">A few days ago the Go team has released Go 1. Congratulations again from my side, what a great work. I've used the last weeks with the both release candidates to apply some last changes to my <b>Tideland Common Go Library</b>. Especially the error handling using the new <span class="Apple-style-span" style="font-family: 'Courier New', Courier, monospace;">error</span> type and own implementations of this interface, the flexible logging and the testing have been improved. So today I checked the new release in and tagged it for Go 1.<br/><br/>The packages are:<br/><ul><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/applog" target="_blank">applog</a>: Logging with multiple levels, caller details in debug and critical situations and pluggable own logging behavior.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/asserts" target="_blank">asserts</a>: Tests which can be used inside of unit tests or at runtime.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/cache" target="_blank">cache</a>: Cache values which will be refreshed on demand.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/cells" target="_blank">cells</a>: A framework for event and behavior based applications.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/identifier" target="_blank">identifier</a>: Generate UUIDs and other identifiers.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/mapreduce" target="_blank">mapreduce</a>: Use Googles great algorthim for data processing and aggregating.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/markup" target="_blank">markup</a>: A simple markup language as an alternative to XML.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/monitoring" target="_blank">monitoring</a>: Keep track of the performance, stay-set variables and dynamically retrieved statuses.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/numerics" target="_blank">numerics</a>: Some numerical types, intended to use them e.g. for statistical problems.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/redis" target="_blank">redis</a>: A powerful client for the Redis database.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/sort" target="_blank">sort</a>: A parallel quicksort to use the power of multiple cores.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/state" target="_blank">state</a>: A generic finite state machine.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/time" target="_blank">time</a>: Functions to work with times and an internal crontab server.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/util" target="_blank">util</a>: Some more smaller utilities.</li><li><a href="http://gopkgdoc.appspot.com/pkg/code.google.com/p/tcgl/web" target="_blank">web</a>: A lean web framework. Especially the combination of REST and JSON is supported.</li></ul>The next releases will contain a goroutine supervisor like they are inside the Erlang/OTP and an optional web interface for the monitoring package.<br/><br/>Beside that I'm now restart a project I've initially started for the Google App Engine. It's a web application using HTML / CSS / JavaScript / jQuery for the frontend, communicating with a Go backend via HTTP / JSON and using Redis for persistency. The kind of application? That's still a secret. <i>(smile)</i><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-566870244872597765?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-04-01T20:59:45Z</updated>
    <published>2012-04-01T20:59:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="cgl"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:research.swtch.com,2012:research.swtch.com/randhash</id>
    <link href="http://research.swtch.com/randhash" rel="alternate" type="text/html"/>
    <title>Random Hash Functions</title>
    <summary>Go ahead, call rand in your hash function.</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>
A hash function for a particular hash table should always be deterministic, right?
At least, that's what I thought until a few weeks ago, when I was able to fix a
performance problem by calling <i>rand</i> inside a hash function.
</p>

<p>
A hash table is only as good as its hash function, which ideally satisfies two properties for any key pair <i>k<sub>1</sub></i>, <i>k<sub>2</sub></i>:
</p>
<ol>
<li>
If <i>k<sub>1</sub></i> == <i>k<sub>2</sub></i>, hash(<i>k<sub>1</sub></i>) == hash(<i>k<sub>2</sub></i>).
</li><li>
If <i>k<sub>1</sub></i> != <i>k<sub>2</sub></i>, it should be likely that hash(<i>k<sub>1</sub></i>) != hash(<i>k<sub>2</sub></i>).
</li></ol>

<p>
Normally, following rule 1 would prohibit the use of random bits while computing
the hash, because if you pass in the same key again, you'd use different random bits
and get a different hash value.  That's why the fact that I got to call <i>rand</i> in a
hash function is so surprising.
</p>

<p>
If the hash function violates rule 1, your hash table just breaks: you can't find things
you put in, because you are looking in the wrong places.  If the hash function satisfies rule 1 but violates
rule 2 (for example, “return 42”), the hash table will be slow due to the large number of hash collisions.
You'll still be able to find the things you put in, but you might as well be using a list.
</p>

<p>
The phrasing of rule 1 is very important.  It is not sufficient to say simply
“hash(<i>k<sub>1</sub></i>) == hash(<i>k<sub>1</sub></i>)”, because that does not take into account the
definition of equality of keys.  If you are building a hash table with case-insensitive,
case-preserving string keys, then “HELLO” and “hello” need to hash to the same value.
In fact, “hash(<i>k<sub>1</sub></i>) == hash(<i>k<sub>1</sub></i>)” is
not even strictly necessary.  How could it <i>not</i> be necessary?  By reversing rule 1,
hash(<i>k<sub>1</sub></i>) and hash(<i>k<sub>1</sub></i>) can be unequal 
if <i>k<sub>1</sub></i> != <i>k<sub>1</sub></i>, that is, if <i>k<sub>1</sub></i> does not equal itself.
</p>

<p>
How can that happen?  It happens if <i>k<sub>1</sub></i> is the floating-point value NaN (not-a-number),
which by convention is not equal to anything, not even itself.
</p>

<p>
Okay, but why bother?  Well, remember rule 2.  Since NaN != NaN, it should be
likely that hash(NaN) != hash(NaN), or else the hash table will have bad performance.
This is very strange: the same input is hashed twice,
and we're supposed to (at least be likely to) return different hash values.
Since the inputs are identical, we need a source of external entropy, like <i>rand</i>.
</p>

<p>
What if you don't?  You get hash tables that don't perform very well if someone
can manage to trick you into storing things under NaN repeatedly:
</p>

<pre>$ cat nan.py
#!/usr/bin/python
import timeit
def build(n):
	m = {}
	for i in range(n):
		m[float("nan")] = 1
n = 1
for i in range(20):
	print "%6d %10.6f" % (n, timeit.timeit('build('+str(n)+')',
	    'from __main__ import build', number=1))
	n *= 2

$ python nan.py
     1   0.000006
     2   0.000004
     4   0.000004
     8   0.000008
    16   0.000011
    32   0.000028
    64   0.000072
   128   0.000239
   256   0.000840
   512   0.003339
  1024   0.012612
  2048   0.050331
  4096   0.200965
  8192   1.032596
 16384   4.657481
 32768  22.758963
 65536  91.899054
$
</pre>

<p>
The behavior here is quadratic: double the input size and the run time quadruples.
You can run the <a href="http://play.golang.org/p/P7ZC7OjC6F">equivalent Go program</a> 
on the Go playground.  It has the NaN fix and runs in linear time.
(On the playground, wall time stands still, but you can see that it's executing in far
less than 100s of seconds.  Run it locally for actual timing.)
</p>

<p>
Now, you could argue that putting a NaN in a hash table is a dumb idea, and also that treating NaN != NaN in a hash table is also a dumb idea, and you'd be right on both counts.
</p>

<p>
But the alternatives are worse:
</p>

<ul>
<li>If you define that NaN is equal to itself during hash key comparisons,
now you have a second parallel definition of equality, to handle
NaNs inside structs and so on, only used for map lookups.
Languages typically have too many equality operators anyway;
introducing a new one for this special case seems unwise.

</li><li>If you define that NaN cannot appear as a hash table key,
then you have a similar problem: you need to build up logic to test for invalid keys such as NaNs inside structs or arrays, and then you have to deal with the fact that your hash table might return an error or throw an exception when inserting values under certain keys.
</li></ul>

<p>
The most consistent thing to do is to accept the implications of NaN != NaN:
m[NaN] = 1 always creates a new hash table element (since the key is unequal
to any existing entry), reading m[NaN] never finds any data (same reason), and iterating over
the hash table yields each of the inserted NaN entries.
</p>

<p>
Behaviors surrounding NaN are always surprising, but if NaN != NaN elsewhere,
the least surprising thing you can do is make your hash tables respect that. 
To do that well, it needs to be likely that hash(NaN) != hash(NaN).
And you probably already have a custom floating-point hash function
so that +0 and −0 are treated as the same value.
Go ahead, call <i>rand</i> for NaN.
</p>

<p>
(Note: this is different from the hash table performance problem that
was circulating in December 2011.  In that case, the predictability of
collisions on ordinary data was solved by making each different table
use a randomly chosen hash function; there's no randomness inside
the function itself.)
</p></div>
    </content>
    <updated>2012-04-01T19:00:00Z</updated>
    <published>2012-04-01T19:00:00Z</published>
    <source>
      <id>tag:research.swtch.com,2012:research.swtch.com</id>
      <author>
        <name>Russ Cox</name>
        <email>rsc@swtch.com</email>
        <uri>https://plus.google.com/116810148281701144465</uri>
      </author>
      <link href="http://research.swtch.com/feed.atom" rel="self" type="application/atom+xml"/>
      <title>research!rsc</title>
      <updated>2012-09-17T15:00:00Z</updated>
    </source>
  </entry>

  <entry xml:lang="ja">
    <id>http://golang.jp/?p=3725</id>
    <link href="http://golang.jp/2012/03/3725" rel="alternate" type="text/html"/>
    <title>Go言語Version 1 リリース</title>
    <summary>Go言語のVersion 1 がとうとうリリースされました。 http://blog.golang.org/2012/03/go-version-1-is-released.html</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Go言語のVersion 1 がとうとうリリースされました。</p>
<p><a href="http://blog.golang.org/2012/03/go-version-1-is-released.html" target="_blank">http://blog.golang.org/2012/03/go-version-1-is-released.html</a></p></div>
    </content>
    <updated>2012-03-29T13:22:14Z</updated>
    <category term="&#x30CB;&#x30E5;&#x30FC;&#x30B9;"/>
    <author>
      <name>noboru</name>
    </author>
    <source>
      <id>http://golang.jp</id>
      <link href="http://golang.jp/feed" rel="self" type="application/atom+xml"/>
      <link href="http://golang.jp" rel="alternate" type="text/html"/>
      <subtitle>プログラミング言語Goの情報サイト</subtitle>
      <title>golang.jp</title>
      <updated>2012-08-23T08:00:21Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://soniacodes.wordpress.com/?p=827</id>
    <link href="http://soniacodes.wordpress.com/2012/03/28/go-1-release/" rel="alternate" type="text/html"/>
    <title>Go 1 release</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The news, if you hadn’t heard. :)  It’s a big thing with me because I’ve put so much time into using it—well, mostly playing with it.  I do write and maintain some Go programs for work, but most of my … <a href="http://soniacodes.wordpress.com/2012/03/28/go-1-release/">Continue reading <span class="meta-nav">→</span></a><img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=soniacodes.wordpress.com&amp;blog=17218877&amp;post=827&amp;subd=soniacodes&amp;ref=&amp;feed=1" width="1"/></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://blog.golang.org/2012/03/go-version-1-is-released.html">The news</a>, if you hadn’t heard. :)  It’s a big thing with me because I’ve put so much time into using it—well, mostly playing with it.  I do write and maintain some Go programs for work, but most of my time with Go has been spent contributing solutions to <a href="http://rosettacode.org/wiki/Rosetta_Code">Rosetta Code</a>.  I’ve contributed hundreds of Go solutions over the last year or so, and Go has been in the top 10 languages there for some time now.  Recently I’ve tried to review all of the solutions to update them to Go 1, and I’m happy to announce that they (almost) all work with Go 1 now.</p>
<p>I wish I could announce that it represents a large body of idiomatic Go code, available as reference solutions common programming tasks, but I’m afraid it’s not.  Firstly, I’m not sure how idiomatic my code is.  I’ve worked mostly in isolation, and my code almost certainly displays my idiosyncrasies as much as it displays accepted idioms.  Secondly of course, is the nature of of the RC site, which is more a wonderland than reference library.</p>
<p>Still, I’d like to invite people to come and visit.  Browse the <a href="http://rosettacode.org/wiki/Category:Go">existing Go solutions</a> and be amused or enlightened, hopefully both.  But then I’d <em>really</em> like to encourage people to make improvements as they can.  That’s the nature of a wiki, and as I said, since such a large fraction of the Go code is mine, there is certainly much room for the code to be improved.</p>
<p>Next there is the list of existing RC <a href="http://rosettacode.org/wiki/Reports:Tasks_not_implemented_in_Go">tasks with no Go solution</a> yet.  Most of these are tasks that awkward for me because I don’t have a computer, and can’t freely do things like install software on the computers I do have access to.  If you have or can install up-to-date libraries and software on your computer, some of these tasks should be easy!  Please browse the list and contribute any solutions you can.  A few of them are simply tasks for which I don’t have the knowledge.  For example the <a href="http://rosettacode.org/wiki/HTTP_Request">HTTP task</a> seemed simple enough, but I don’t know enough to do the <a href="http://rosettacode.org/wiki/HTTPS">HTTPS task</a>.</p>
<p>Finally, if you really enjoy the site, consider contributing a new task that you feel really shows off some feature of Go.  I’ve added just a few, but probably still be designed are some great tasks illuminating interfaces, concurrency, and the varied capabilities of the Go standard package library.</p>
<br/>  <a href="http://feeds.wordpress.com/1.0/gocomments/soniacodes.wordpress.com/827/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soniacodes.wordpress.com/827/"/></a> <img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=soniacodes.wordpress.com&amp;blog=17218877&amp;post=827&amp;subd=soniacodes&amp;ref=&amp;feed=1" width="1"/></div>
    </content>
    <updated>2012-03-29T00:04:42Z</updated>
    <category term="golang"/><geo:lat xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">42.375097</geo:lat><geo:long xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">-71.105608</geo:long>
    <author>
      <name>Sonia</name>
    </author>
    <source>
      <id>http://soniacodes.wordpress.com</id>
      <logo>http://s2.wp.com/i/buttonw-com.png</logo>
      <link href="http://soniacodes.wordpress.com/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://soniacodes.wordpress.com" rel="alternate" type="text/html"/>
      <link href="http://soniacodes.wordpress.com/osd.xml" rel="search" type="application/opensearchdescription+xml"/>
      <link href="http://soniacodes.wordpress.com/?pushpress=hub" rel="hub" type="text/html"/>
      <subtitle>Programming in Go</subtitle>
      <title>Sonia Codes</title>
      <updated>2012-10-18T04:00:43Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/185054007604162560</id>
    <link href="http://twitter.com/_rsc/statuses/185054007604162560" rel="alternate" type="text/html"/>
    <title>_rsc: go1 has been my goto language for a while now. - dlsspy on hacker news  #golang</title>
    <summary>_rsc: go1 has been my goto language for a while now. - dlsspy on hacker news  #golang</summary>
    <updated>2012-03-28T17:21:28Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-8538947736732401453</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/8538947736732401453" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/8538947736732401453" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2012/03/go-version-1-is-released.html" rel="alternate" type="text/html"/>
    <title>Go version 1 is released</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div style="float: left; margin-right: 20px;"><img src="http://3.bp.blogspot.com/-HYvxB0YqCEQ/T3JlGrhEgcI/AAAAAAAAAGM/197_O-LtIyI/s1600/gophermega.jpg"/></div>Today marks a major milestone in the development of the Go programming language. We're announcing Go version 1, or Go 1 for short, which defines a language and a set of core libraries to provide a stable foundation for creating reliable products, projects, and publications.<br/><div style="clear: left;"/>Go 1 is the first release of Go that is available in supported binary distributions. They are available for Linux, FreeBSD, Mac OS X and, we are thrilled to announce, Windows.<br/><br/>The driving motivation for Go 1 is stability for its users. People who write Go 1 programs can be confident that those programs will continue to compile and run without change, in many environments, on a time scale of years. Similarly, authors who write books about Go 1 can be sure that their examples and explanations will be helpful to readers today and into the future.<br/><br/>Forward compatibility is part of stability. Code that compiles in Go 1 should, with few exceptions, continue to compile and run throughout the lifetime of that version, even as we issue updates and bug fixes such as Go version 1.1, 1.2, and so on. The <a href="http://golang.org/doc/go1compat.html">Go 1 compatibility document</a> explains the compatibility guidelines in more detail.<br/><br/>Go 1 is a representation of Go as it is used today, not a major redesign. In its planning, we focused on cleaning up problems and inconsistencies and improving portability. There had long been many changes to Go that we had designed and prototyped but not released because they were backwards-incompatible. Go 1 incorporates these changes, which provide significant improvements to the language and libraries but sometimes introduce incompatibilities for old programs. Fortunately, the <a href="http://golang.org/cmd/go/#Run_go_tool_fix_on_packages">go fix</a> tool can automate much of the work needed to bring programs up to the Go 1 standard.<br/><br/>Go 1 introduces changes to the language (such as new types for <a href="http://golang.org/doc/go1.html#rune">Unicode characters</a> and <a href="http://golang.org/doc/go1.html#errors">errors</a>) and the standard library (such as the new <a href="http://golang.org/doc/go1.html#time">time package</a> and renamings in the <a href="http://golang.org/doc/go1.html#strconv">strconv package</a>). Also, the package hierarchy has been rearranged to group related items together, such as moving the networking facilities, for instance the <a href="http://golang.org/pkg/net/rpc/">rpc package</a>, into subdirectories of net. A complete list of changes is documented in the <a href="http://golang.org/doc/go1.html">Go 1 release notes</a>. That document is an essential reference for programmers migrating code from earlier versions of Go.<br/><br/>We also restructured the Go tool suite around the new <a href="http://golang.org/doc/go1.html#cmd_go">go command</a>, a program for fetching, building, installing and maintaining Go code. The go command eliminates the need for Makefiles to write Go code because it uses the Go program source itself to derive the build instructions. No more build scripts! <br/><br/>Finally, the release of Go 1 triggers a new release of the <a href="https://developers.google.com/appengine/docs/go">Google App Engine SDK</a>. A similar process of revision and stabilization has been applied to the App Engine libraries, providing a base for developers to build programs for App Engine that will run for years.<br/><br/>Go 1 is the result of a major effort by the core Go team and our many contributors from the open source community. We thank everyone who helped make this happen.<br/><br/>There has never been a better time to be a Go programmer. Everything you need to get started is at <a href="http://golang.org/">golang.org</a>.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-8538947736732401453?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-03-28T16:32:47Z</updated>
    <published>2012-03-28T16:00:00Z</published>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-1056583158994494433</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/1056583158994494433" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/1056583158994494433" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/09/go-image-package.html" rel="alternate" type="text/html"/>
    <title>The Go image package</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>The <a href="http://golang.org/pkg/image/">image</a> and <a href="http://golang.org/pkg/image/color/">image/color</a> packages define a number of types: <code>color.Color</code> and <code>color.Model</code> describe colors, <code>image.Point</code> and <code>image.Rectangle</code> describe basic 2-D geometry, and <code>image.Image</code> brings the two concepts together to represent a rectangular grid of colors. A <a href="http://golang.org/doc/articles/image_draw.html">separate article</a> covers image composition with the <a href="http://golang.org/pkg/image/draw/">image/draw</a> package. </p> <p><b>Colors and Color Models</b></p> <p><a href="http://golang.org/pkg/image/color/#Color">Color</a> is an interface that defines the minimal method set of any type that can be considered a color: one that can be converted to red, green, blue and alpha values. The conversion may be lossy, such as converting from CMYK or YCbCr color spaces. </p> <pre>type Color interface {<br/>    <span class="comment">// RGBA returns the alpha-premultiplied red, green, blue and alpha values</span><br/>    <span class="comment">// for the color. Each value ranges within [0, 0xFFFF], but is represented</span><br/>    <span class="comment">// by a uint32 so that multiplying by a blend factor up to 0xFFFF will not</span><br/>    <span class="comment">// overflow.</span><br/>    RGBA() (r, g, b, a uint32)<br/>}</pre> <p>There are three important subtleties about the return values. First, the red, green and blue are alpha-premultiplied: a fully saturated red that is also 25% transparent is represented by RGBA returning a 75% r. Second, the channels have a 16-bit effective range: 100% red is represented by RGBA returning an r of 65535, not 255, so that converting from CMYK or YCbCr is not as lossy. Third, the type returned is <code>uint32</code>, even though the maximum value is 65535, to guarantee that multiplying two values together won't overflow. Such multiplications occur when blending two colors according to an alpha mask from a third color, in the style of <a href="https://en.wikipedia.org/wiki/Alpha_compositing">Porter and Duff's</a>classic algebra: </p> <pre><br/>dstr, dstg, dstb, dsta := dst.RGBA()<br/>srcr, srcg, srcb, srca := src.RGBA()<br/>_, _, _, m := mask.RGBA()<br/>const M = 1&lt;&lt;16 - 1<br/>// The resultant red value is a blend of dstr and srcr, and ranges in [0, M].<br/>// The calculation for green, blue and alpha is similar.<br/>dstr = (dstr*(M-m) + srcr*m) / M<br/></pre> <p>The last line of that code snippet would have been more complicated if we worked with non-alpha-premultiplied colors, which is why <code>Color</code> uses alpha-premultiplied values. </p> <p>The image/color package also defines a number of concrete types that implement the <code>Color</code> interface. For example, <a href="http://golang.org/pkg/image/color/#RGBA"><code>RGBA</code></a> is a struct that represents the classic "8 bits per channel" color. </p> <pre>type RGBA struct {<br/>    R, G, B, A uint8<br/>}</pre> <p>Note that the <code>R</code> field of an <code>RGBA</code> is an 8-bit alpha-premultiplied color in the range [0, 255]. <code>RGBA</code> satisfies the <code>Color</code> interface by multiplying that value by 0x101 to generate a 16-bit alpha-premultiplied color in the range [0, 65535]. Similarly, the <a href="http://golang.org/pkg/image/color/#NRGBA"><code>NRGBA</code></a> struct type represents an 8-bit non-alpha-premultiplied color, as used by the PNG image format. When manipulating an <code>NRGBA</code>'s fields directly, the values are non-alpha-premultiplied, but when calling the <code>RGBA</code> method, the return values are alpha-premultiplied. </p> <p>A <a href="http://golang.org/pkg/image/color/#Model"><code>Model</code></a> is simply something that can convert <code>Color</code>s to other <code>Color</code>s, possibly lossily. For example, the <code>GrayModel</code> can convert any <code>Color</code> to a desaturated <a href="http://golang.org/pkg/image/color/#Gray"><code>Gray</code></a>. A <code>Palette</code> can convert any <code>Color</code> to one from a limited palette. </p> <pre>type Model interface {<br/>    Convert(c Color) Color<br/>}</pre> <pre>type Palette []Color</pre> <p><b>Points and Rectangles</b></p> <p>A <a href="http://golang.org/pkg/image/#Point"><code>Point</code></a> is an (x, y) co-ordinate on the integer grid, with axes increasing right and down. It is neither a pixel nor a grid square. A <code>Point</code> has no intrinsic width, height or color, but the visualizations below use a small colored square. </p> <pre>type Point struct {<br/>    X, Y int<br/>}</pre> <p><img height="300" src="http://golang.org/doc/articles/image-package-01.png" width="400"/></p> <pre>    p := image.Point{2, 1}</pre> <p>A <a href="http://golang.org/pkg/image/#Rectangle"><code>Rectangle</code></a> is an axis-aligned rectangle on the integer grid, defined by its top-left and bottom-right <code>Point</code>.  A <code>Rectangle</code> also has no intrinsic color, but the visualizations below outline rectangles with a thin colored line, and call out their <code>Min</code> and <code>Max</code> <code>Point</code>s. </p> <pre>type Rectangle struct {<br/>    Min, Max Point<br/>}</pre> <p>For convenience, <code>image.Rect(x0, y0, x1, y1)</code> is equivalent to <code>image.Rectangle{image.Point{x0, y0}, image.Point{x1, y1}}</code>, but is much easier to type. </p> <p>A <code>Rectangle</code> is inclusive at the top-left and exclusive at the bottom-right. For a <code>Point p</code> and a <code>Rectangle r</code>, <code>p.In(r)</code> if and only if <code>r.Min.X &lt;= p.X &amp;&amp; p.X &lt; r.Max.X</code>, and similarly for <code>Y</code>. This is analagous to how a slice <code>s[i0:i1]</code> is inclusive at the low end and exclusive at the high end. (Unlike arrays and slices, a <code>Rectangle</code> often has a non-zero origin.) </p> <p><img height="300" src="http://golang.org/doc/articles/image-package-02.png" width="400"/></p> <pre>    r := image.Rect(2, 1, 5, 5)<br/>    <span class="comment">// Dx and Dy return a rectangle's width and height.</span><br/>    fmt.Println(r.Dx(), r.Dy(), image.Pt(0, 0).In(r)) <span class="comment">// prints 3 4 false</span></pre> <p>Adding a <code>Point</code> to a <code>Rectangle</code> translates the <code>Rectangle</code>. Points and Rectangles are not restricted to be in the bottom-right quadrant. </p> <p><img height="300" src="http://golang.org/doc/articles/image-package-03.png" width="400"/></p> <pre>    r := image.Rect(2, 1, 5, 5).Add(image.Pt(-4, -2))<br/>    fmt.Println(r.Dx(), r.Dy(), image.Pt(0, 0).In(r)) <span class="comment">// prints 3 4 true</span></pre> <p>Intersecting two Rectangles yields another Rectangle, which may be empty. </p> <p><img height="300" src="http://golang.org/doc/articles/image-package-04.png" width="400"/></p> <pre>    r := image.Rect(0, 0, 4, 3).Intersect(image.Rect(2, 2, 5, 5))<br/>    <span class="comment">// Size returns a rectangle's width and height, as a Point.</span><br/>    fmt.Printf("%#v\n", r.Size()) <span class="comment">// prints image.Point{X:2, Y:1}</span></pre> <p>Points and Rectangles are passed and returned by value. A function that takes a <code>Rectangle</code> argument will be as efficient as a function that takes two <code>Point</code> arguments, or four <code>int</code> arguments. </p> <p><b>Images</b></p> <p>An <a href="http://golang.org/pkg/image/#Image">Image</a> maps every grid square in a <code>Rectangle</code> to a <code>Color</code> from a <code>Model</code>. "The pixel at (x, y)" refers to the color of the grid square defined by the points (x, y), (x+1, y), (x+1, y+1) and (x, y+1). </p> <pre>type Image interface {<br/>    <span class="comment">// ColorModel returns the Image's color model.</span><br/>    ColorModel() color.Model<br/>    <span class="comment">// Bounds returns the domain for which At can return non-zero color.</span><br/>    <span class="comment">// The bounds do not necessarily contain the point (0, 0).</span><br/>    Bounds() Rectangle<br/>    <span class="comment">// At returns the color of the pixel at (x, y).</span><br/>    <span class="comment">// At(Bounds().Min.X, Bounds().Min.Y) returns the upper-left pixel of the grid.</span><br/>    <span class="comment">// At(Bounds().Max.X-1, Bounds().Max.Y-1) returns the lower-right one.</span><br/>    At(x, y int) color.Color<br/>}</pre> <p>A common mistake is assuming that an <code>Image</code>'s bounds start at (0, 0). For example, an animated GIF contains a sequence of Images, and each <code>Image</code> after the first typically only holds pixel data for the area that changed, and that area doesn't necessarily start at (0, 0). The correct way to iterate over an <code>Image</code> m's pixels looks like: </p> <pre><br/>b := m.Bounds()<br/>for y := b.Min.Y; y &lt; b.Max.Y; y++ {<br/> for x := b.Min.X; y &lt; b.Max.X; x++ {<br/>  doStuffWith(m.At(x, y))<br/> }<br/>}<br/></pre> <p><code>Image</code> implementations do not have to be based on an in-memory slice of pixel data. For example, a <a href="http://golang.org/pkg/image/#Uniform"><code>Uniform</code></a> is an <code>Image</code> of enormous bounds and uniform color, whose in-memory representation is simply that color. </p> <pre>type Uniform struct {<br/>    C color.Color<br/>}</pre> <p>Typically, though, programs will want an image based on a slice. Struct types like <a href="http://golang.org/pkg/image/#RGBA"><code>RGBA</code></a> and <a href="http://golang.org/pkg/image/#Gray"><code>Gray</code></a> (which other packages refer to as <code>image.RGBA</code> and <code>image.Gray</code>) hold slices of pixel data and implement the <code>Image</code> interface. </p> <pre>type RGBA struct {<br/>    <span class="comment">// Pix holds the image's pixels, in R, G, B, A order. The pixel at</span><br/>    <span class="comment">// (x, y) starts at Pix[(y-Rect.Min.Y)*Stride + (x-Rect.Min.X)*4].</span><br/>    Pix []uint8<br/>    <span class="comment">// Stride is the Pix stride (in bytes) between vertically adjacent pixels.</span><br/>    Stride int<br/>    <span class="comment">// Rect is the image's bounds.</span><br/>    Rect Rectangle<br/>}</pre> <p>These types also provide a <code>Set(x, y int, c color.Color)</code> method that allows modifying the image one pixel at a time. </p> <pre>    m := image.NewRGBA(image.Rect(0, 0, 640, 480))<br/>    m.Set(5, 5, color.RGBA{255, 0, 0, 255})</pre> <p>If you're reading or writing a lot of pixel data, it can be more efficient, but more complicated, to access these struct type's <code>Pix</code> field directly. </p> <p>The slice-based <code>Image</code> implementations also provide a <code>SubImage</code> method, which returns an <code>Image</code> backed by the same array. Modifying the pixels of a sub-image will affect the pixels of the original image, analagous to how modifying the contents of a sub-slice <code>s[i0:i1]</code> will affect the contents of the original slice <code>s</code>. </p> <img height="300" src="http://golang.org/doc/articles/image-package-05.png" width="400"/> <pre>    m0 := image.NewRGBA(image.Rect(0, 0, 8, 5))<br/>    m1 := m0.SubImage(image.Rect(1, 2, 5, 5)).(*image.RGBA)<br/>    fmt.Println(m0.Bounds().Dx(), m1.Bounds().Dx()) <span class="comment">// prints 8, 4</span><br/>    fmt.Println(m0.Stride == m1.Stride)             <span class="comment">// prints true</span></pre> <p>For low-level code that works on an image's <code>Pix</code> field, be aware that ranging over <code>Pix</code> can affect pixels outside an image's bounds. In the example above, the pixels covered by <code>m1.Pix</code> are shaded in blue. Higher-level code, such as the <code>At</code> and <code>Set</code>methods or the <a href="http://golang.org/pkg/image/draw/">image/draw package</a>, will clip their operations to the image's bounds. </p> <p><b>Image Formats</b></p> <p>The standard package library supports a number of common image formats, such as GIF, JPEG and PNG. If you know the format of a source image file, you can decode from an <a href="http://golang.org/pkg/io/#Reader"><code>io.Reader</code></a> directly. </p> <pre><br/>import (<br/> "image/jpeg"<br/> "image/png"<br/> "io"<br/>)<br/><br/>// convertJPEGToPNG converts from JPEG to PNG.<br/>func convertJPEGToPNG(w io.Writer, r io.Reader) error {<br/> img, err := jpeg.Decode(r)<br/> if err != nil {<br/>  return err<br/> }<br/> return png.Encode(w, img)<br/>}<br/></pre> <p>If you have image data of unknown format, the <a href="http://golang.org/pkg/image/#Decode"><code>image.Decode</code></a> function can detect the format. The set of recognized formats is constructed at run time and is not limited to those in the standard package library. An image format package typically registers its format in an init function, and the main package will "underscore import" such a package solely for the side effect of format registration. </p> <pre><br/>import (<br/> "image"<br/> "image/png"<br/> "io"<br/><br/> _ "code.google.com/p/vp8-go/webp"<br/> _ "image/jpeg"<br/>)<br/><br/>// convertToPNG converts from any recognized format to PNG.<br/>func convertToPNG(w io.Writer, r io.Reader) error {<br/> img, _, err := image.Decode(r)<br/> if err != nil {<br/>  return err<br/> }<br/> return png.Encode(w, img)<br/>}<br/></pre><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-1056583158994494433?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-03-28T03:31:23Z</updated>
    <published>2011-09-22T03:40:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="image"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="libraries"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-9063170459733978169</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/9063170459733978169" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/9063170459733978169" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/09/go-imagedraw-package.html" rel="alternate" type="text/html"/>
    <title>The Go image/draw package</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><a href="http://golang.org/pkg/image/draw/">Package image/draw</a> defines only one operation: drawing a source image onto a destination image, through an optional mask image. This one operation is surprisingly versatile and can perform a number of common image manipulation tasks elegantly and efficiently.   </p> <p>Composition is performed pixel by pixel in the style of the Plan 9 graphics library and the X Render extension. The model is based on the classic "Compositing Digital Images" paper by Porter and Duff, with an additional mask parameter: <code>dst = (src IN mask) OP dst</code>. For a fully opaque mask, this reduces to the original Porter-Duff formula: <code>dst = src OP dst</code>. In Go, a nil mask image is equivalent to an infinitely sized, fully opaque mask image. </p> <p>The Porter-Duff paper presented <a href="http://www.w3.org/TR/SVGCompositing/examples/compop-porterduff-examples.png">12 different composition operators</a>, but with an explicit mask, only 2 of these are needed in practice: source-over-destination and source. In Go, these operators are represented by the <code>Over</code> and <code>Src</code> constants. The <code>Over</code> operator performs the natural layering of a source image over a destination image: the change to the destination image is smaller where the source (after masking) is more transparent (that is, has lower alpha). The <code>Src</code> operator merely copies the source (after masking) with no regard for the destination image's original content. For fully opaque source and mask images, the two operators produce the same output, but the <code>Src</code> operator is usually faster. </p> <p><b>Geometric Alignment</b></p> <p>   Composition requires associating destination pixels with source and mask pixels. Obviously, this requires destination, source and mask images, and a composition operator, but it also requires specifying what rectangle of each image to use. Not every drawing should write to the entire destination: when updating an animating image, it is more efficient to only draw the parts of the image that have changed. Not every drawing should read from the entire source: when using a sprite that combines many small images into one large one, only a part of the image is needed. Not every drawing should read from the entire mask: a mask image that collects a font's glyphs is similar to a sprite. Thus, drawing also needs to know three rectangles, one for each image. Since each rectangle has the same width and height, it suffices to pass a destination rectangle `r` and two points <code>sp</code> and <code>mp</code>: the source rectangle is equal to <code>r</code>translated so that <code>r.Min</code> in the destination image aligns with  <code>sp</code> in the source image, and similarly for <code>mp</code>. The effective rectangle is also clipped to each image's bounds in their respective co-ordinate space. </p> <p><img src="http://1.bp.blogspot.com/-nb32oBx4A-8/ToQHSoUgqVI/AAAAAAAAAAQ/UTDxB-meu_0/s1600/20.png"/></p> <p>The <a href="http://golang.org/pkg/image/draw/#DrawMask"><code>DrawMask</code></a>function takes seven arguments, but an explicit mask and mask-point are usually unnecessary, so the <a href="http://golang.org/pkg/image/draw/#Draw"><code>Draw</code></a> function takes five: </p> <pre><br/>// Draw calls DrawMask with a nil mask.<br/>func Draw(dst Image, r image.Rectangle, src image.Image, sp image.Point, op Op)<br/>func DrawMask(dst Image, r image.Rectangle, src image.Image, sp image.Point,<br/> mask image.Image, mp image.Point, op Op)<br/></pre> <p>The destination image must be mutable, so the image/draw package defines a <a href="http://golang.org/pkg/image/draw/#Image"><code>draw.Image</code></a>interface which has a <code>Set</code> method. </p> <pre>type Image interface {<br/>    image.Image<br/>    Set(x, y int, c color.Color)<br/>}</pre>   <p><b>Filling a Rectangle</b></p> <p>To fill a rectangle with a solid color, use an <code>image.Uniform</code>source. The <code>ColorImage</code> type re-interprets a <code>Color</code> as a practically infinite-sized <code>Image</code> of that color. For those familiar with the design of Plan 9's draw library, there is no need for an explicit "repeat bit" in Go's slice-based image types; the concept is subsumed by <code>Uniform</code>. </p> <pre>    <span class="comment">// image.ZP is the zero point -- the origin.</span><br/>    draw.Draw(dst, r, &amp;image.Uniform{c}, image.ZP, draw.Src)</pre> <p>To initialize a new image to all-blue: </p> <pre>    m := image.NewRGBA(image.Rect(0, 0, 640, 480))<br/>    blue := color.RGBA{0, 0, 255, 255}<br/>    draw.Draw(m, m.Bounds(), &amp;image.Uniform{blue}, image.ZP, draw.Src)</pre> <p>To reset an image to transparent (or black, if the destination image's color model cannot represent transparency), use <code>image.Transparent</code>, which is an <code>image.Uniform</code>: </p> <pre>    draw.Draw(m, m.Bounds(), image.Transparent, image.ZP, draw.Src)</pre>   <p><img src="http://4.bp.blogspot.com/-eIPV646VFDc/ToQH6PkJCXI/AAAAAAAAAAY/dbz4VBFR_Gk/s1600/2a.png"/></p>   <p><b>Copying an Image</b></p> <p>To copy from a rectangle <code>sr</code> in the source image to a rectangle starting at a point <code>dp</code> in the destination, convert the source rectangle into the destination image's co-ordinate space: </p> <pre>    r := image.Rectangle{dp, dp.Add(sr.Size())}<br/>    draw.Draw(dst, r, src, sr.Min, draw.Src)</pre>   <p>Alternatively: </p> <pre>    r := sr.Sub(sr.Min).Add(dp)<br/>    draw.Draw(dst, r, src, sr.Min, draw.Src)</pre>   <p>To copy the entire source image, use <code>sr = src.Bounds()</code>. </p>   <p><img src="http://4.bp.blogspot.com/-XX27nYpNH3E/ToQH6Lf9QJI/AAAAAAAAAAg/D12dmCczBpM/s1600/2b.png"/></p>  <p><b>Scrolling an Image</b></p> <p>Scrolling an image is just copying an image to itself, with different destination and source rectangles. Overlapping destination and source images are perfectly valid, just as Go's built-in copy function can handle overlapping destination and source slices. To scroll an image m by 20 pixels: </p> <pre>    b := m.Bounds()<br/>    p := image.Pt(0, 20)<br/>    <span class="comment">// Note that even though the second argument is b,</span><br/>    <span class="comment">// the effective rectangle is smaller due to clipping.</span><br/>    draw.Draw(m, b, m, b.Min.Add(p), draw.Src)<br/>    dirtyRect := b.Intersect(image.Rect(b.Min.X, b.Max.Y-20, b.Max.X, b.Max.Y))</pre>   <p><img src="http://4.bp.blogspot.com/-YXpkmnSWkdM/ToQH6aT8VqI/AAAAAAAAAAo/tkEqCU1ahYA/s1600/2c.png"/></p>  <p><b>Converting an Image to RGBA</b></p> <p>The result of decoding an image format might not be an <code>image.RGBA</code>: decoding a GIF results in an <code>image.Paletted</code>, decoding a JPEG results in a <code>ycbcr.YCbCr</code>, and the result of decoding a PNG depends on the image data. To convert any image to an <code>image.RGBA</code>: </p> <pre>    b := src.Bounds()<br/>    m := image.NewRGBA(image.Rect(0, 0, b.Dx(), b.Dy()))<br/>    draw.Draw(m, m.Bounds(), src, b.Min, draw.Src)</pre>   <p><img src="http://3.bp.blogspot.com/-voJE_0Xzh-Y/ToQH6tbG-7I/AAAAAAAAAAw/2gsbjqVpE34/s1600/2d.png"/></p> <p><b>Drawing Through a Mask</b></p> <p>To draw an image through a circular mask with center <code>p</code> and radius <code>r</code>: </p> <pre>type circle struct {<br/>    p image.Point<br/>    r int<br/>}<br/><br/>func (c *circle) ColorModel() color.Model {<br/>    return color.AlphaModel<br/>}<br/><br/>func (c *circle) Bounds() image.Rectangle {<br/>    return image.Rect(c.p.X-c.r, c.p.Y-c.r, c.p.X+c.r, c.p.Y+c.r)<br/>}<br/><br/>func (c *circle) At(x, y int) color.Color {<br/>    xx, yy, rr := float64(x-c.p.X)+0.5, float64(y-c.p.Y)+0.5, float64(c.r)<br/>    if xx*xx+yy*yy &lt; rr*rr {<br/>        return color.Alpha{255}<br/>    }<br/>    return color.Alpha{0}<br/>}</pre><pre>    draw.DrawMask(dst, dst.Bounds(), src, image.ZP, &amp;circle{p, r}, image.ZP, draw.Over)</pre>   <p><img src="http://4.bp.blogspot.com/-BkVQG5YVsL0/ToQH6mx7OhI/AAAAAAAAAA4/FbA_GLiY5hQ/s1600/2e.png"/></p> <p><b>Drawing Font Glyphs</b></p> <p>  To draw a font glyph in blue starting from a point <code>p</code>, draw with an <code>image.ColorImage</code> source and an <code>image.Alpha mask</code>. For simplicity, we aren't performing any sub-pixel positioning or rendering, or correcting for a font's height above a baseline. </p> <pre>    src := &amp;image.Uniform{color.RGBA{0, 0, 255, 255}}<br/>    mask := theGlyphImageForAFont()<br/>    mr := theBoundsFor(glyphIndex)<br/>    draw.DrawMask(dst, mr.Sub(mr.Min).Add(p), src, image.ZP, mask, mr.Min, draw.Over)</pre> <p><img src="http://4.bp.blogspot.com/-MYNfsmQvRHQ/ToQJJz8uDwI/AAAAAAAAABA/BDV82mhF2-Y/s1600/2f.png"/></p>   <p><b>Performance</b></p> <p>The image/draw package implementation demonstrates how to provide an image manipulation function that is both general purpose, yet efficient for common cases. The <code>DrawMask</code> function takes arguments of interface types, but immediately makes type assertions that its arguments are of specific struct types, corresponding to common operations like drawing one <code>image.RGBA</code> image onto another, or drawing an <code>image.Alpha</code> mask (such as a font glyph) onto an <code>image.RGBA</code> image. If a type assertion succeeds, that type information is used to run a specialized implementation of the general algorithm. If the assertions fail, the fallback code path uses the generic <code>At</code> and <code>Set</code> methods. The fast-paths are purely a performance optimization; the resultant destination image is the same either way. In practice, only a small number of special cases are necessary to support typical applications.   </p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-9063170459733978169?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-03-27T07:37:13Z</updated>
    <published>2011-09-29T16:50:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="image"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="draw"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="libraries"/>
    <author>
      <name>Nigel Tao</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/05861448236603053531</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-919876060887016959</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/919876060887016959" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/919876060887016959" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/03/godoc-documenting-go-code.html" rel="alternate" type="text/html"/>
    <title>Godoc: documenting Go code</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>The Go project takes documentation seriously. Documentation is a huge part of making software accessible and maintainable. Of course it must be well-written and accurate, but it also must be easy to write and to maintain. Ideally, it should be coupled to the code itself so the documentation evolves along with the code. The easier it is for programmers to produce good documentation, the better for everyone. </p> <p>To that end, we have developed the <a href="http://golang.org/cmd/godoc/">godoc</a> documentation tool. This article describes godoc's approach to documentation, and explains how you can use our conventions and tools to write good documentation for your own projects. </p> <p>Godoc parses Go source code - including comments - and produces documentation as HTML or plain text. The end result is documentation tightly coupled with the code it documents. For example, through godoc's web interface you can navigate from a function's <a href="http://golang.org/pkg/strings/#HasPrefix">documentation</a> to its <a href="http://golang.org/src/pkg/strings/strings.go#L312">implementation</a> with one click. </p> <p>Godoc is conceptually related to Python's <a href="http://www.python.org/dev/peps/pep-0257/">Docstring</a> and Java's <a href="http://www.oracle.com/technetwork/java/javase/documentation/index-jsp-135444.html">Javadoc</a>, but its design is simpler. The comments read by godoc are not language constructs (as with Docstring) nor must they have their own machine-readable syntax (as with Javadoc). Godoc comments are just good comments, the sort you would want to read even if godoc didn't exist. </p> <p>The convention is simple: to document a type, variable, constant, function, or even a package, write a regular comment directly preceding its declaration, with no intervening blank line. Godoc will then present that comment as text alongside the item it documents. For example, this is the documentation for the <code>fmt</code> package's <a href="http://golang.org/pkg/fmt/#Fprint"><code>Fprint</code></a>function: </p> <pre><span class="comment">// Fprint formats using the default formats for its operands and writes to w.</span><br/><span class="comment">// Spaces are added between operands when neither is a string.</span><br/><span class="comment">// It returns the number of bytes written and any write error encountered.</span><br/>func Fprint(w io.Writer, a ...interface{}) (n int, err error) {</pre> <p>Notice this comment is a complete sentence that begins with the name of the element it describes. This important convention allows us to generate documentation in a variety of formats, from plain text to HTML to UNIX man pages, and makes it read better when tools truncate it for brevity, such as when they extract the first line or sentence. </p> <p>Comments on package declarations should provide general package documentation. These comments can be short, like the <a href="http://golang.org/pkg/sort/"><code>sort</code></a>package's brief description: </p> <pre><span class="comment">// Package sort provides primitives for sorting slices and user-defined</span><br/><span class="comment">// collections.</span><br/>package sort</pre> <p>They can also be detailed like the <a href="http://golang.org/pkg/encoding/gob/">gob package</a>'s overview. That package uses another convention for packages that need large amounts of introductory documentation: the package comment is placed in its own file, <a href="http://golang.org/src/pkg/encoding/gob/doc.go">doc.go</a>, which contains only those comments and a package clause. </p> <p>When writing package comments of any size, keep in mind that their first sentence will appear in godoc's <a href="http://golang.org/pkg/">package list</a>. </p> <p>Comments that are not adjacent to a top-level declaration are omitted from godoc's output, with one notable exception. Top-level comments that begin with the word <code>"BUG(who)”</code> are recognized as known bugs, and included in the "Bugs” section of the package documentation. The "who” part should be the user name of someone who could provide more information. For example, this is a known issue from the <a href="http://golang.org/pkg/bytes/#bugs">bytes package</a>: </p> <pre><br/>// BUG(r): The rule Title uses for word boundaries does not handle Unicode punctuation properly.<br/></pre> <p>Godoc treats executable commands somewhat differently. Instead of inspecting the command source code, it looks for a Go source file belonging to the special package "documentation”. The comment on the "package documentation” clause is used as the command's documentation. For example, see the <a href="http://golang.org/cmd/godoc/">godoc documentation</a> and its corresponding <a href="http://golang.org/src/cmd/godoc/doc.go">doc.go</a> file. </p> <p>There are a few formatting rules that Godoc uses when converting comments to HTML: </p> <ul><li>Subsequent lines of text are considered part of the same paragraph; you must leave a blank line to separate paragraphs. </li><li>Pre-formatted text must be indented relative to the surrounding comment text (see gob's <a href="http://golang.org/src/pkg/encoding/gob/doc.go">doc.go</a> for an example). </li><li>URLs will be converted to HTML links; no special markup is necessary. </li></ul> <p>Note that none of these rules requires you to do anything out of the ordinary. </p> <p>In fact, the best thing about godoc's minimal approach is how easy it is to use. As a result, a lot of Go code, including all of the standard library, already follows the conventions. </p> <p>Your own code can present good documentation just by having comments as described above. Any Go packages installed inside <code>$GOROOT/src/pkg</code>and any <code>GOPATH</code> work spaces will already be accessible via godoc's command-line and HTTP interfaces, and you can specify additional paths for indexing via the <code>-path</code> flag or just by running <code>"godoc ."</code>in the source directory. See the <a href="http://golang.org/cmd/godoc/">godoc documentation</a>for more details. </p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-919876060887016959?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-03-27T07:31:37Z</updated>
    <published>2011-03-31T16:30:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="godoc"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-07-02T15:58:29Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-8813821428918283782</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/8813821428918283782" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/8813821428918283782" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/09/laws-of-reflection.html" rel="alternate" type="text/html"/>
    <title>The Laws of Reflection</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Reflection in computing is the ability of a program to examine its own structure, particularly through types; it's a form of metaprogramming. It's also a great source of confusion. </p> <p>In this article we attempt to clarify things by explaining how reflection works in Go. Each language's reflection model is different (and many languages don't support it at all), but this article is about Go, so for the rest of this article the word "reflection" should be taken to mean "reflection in Go". </p> <p><b>Types and interfaces</b></p> <p>Because reflection builds on the type system, let's start with a refresher about types in Go. </p> <p>Go is statically typed. Every variable has a static type, that is, exactly one type known and fixed at compile time: <code>int</code>, <code>float32</code>, <code>*MyType</code>, <code>[]byte</code>, and so on. If we declare </p> <pre>type MyInt int<br/><br/>var i int<br/>var j MyInt</pre> <p>then <code>i</code> has type <code>int</code> and <code>j</code>has type <code>MyInt</code>. The variables <code>i</code> and <code>j</code> have distinct static types and, although they have the same underlying type, they cannot be assigned to one another without a conversion. </p> <p>One important category of type is interface types, which represent fixed sets of methods. An interface variable can store any concrete (non-interface) value as long as that value implements the interface's methods. A well-known pair of examples is <code>io.Reader</code> and <code>io.Writer</code>, the types <code>Reader</code> and <code>Writer</code> from the <a href="http://golang.org/pkg/io/">io package</a>: </p> <pre><span class="comment">// Reader is the interface that wraps the basic Read method.</span><br/>type Reader interface {<br/>    Read(p []byte) (n int, err error)<br/>}<br/><br/><span class="comment">// Writer is the interface that wraps the basic Write method.</span><br/>type Writer interface {<br/>    Write(p []byte) (n int, err error)<br/>}</pre> <p>Any type that implements a <code>Read</code> (or <code>Write</code>) method with this signature is said to implement <code>io.Reader</code> (or <code>io.Writer</code>). For the purposes of this discussion, that means that a variable of type <code>io.Reader</code> can hold any value whose type has a <code>Read</code> method: </p> <pre>    var r io.Reader<br/>    r = os.Stdin<br/>    r = bufio.NewReader(r)<br/>    r = new(bytes.Buffer)<br/>    <span class="comment">// and so on</span></pre> <p>It's important to be clear that whatever concrete value <code>r</code> may hold, <code>r</code>'s type is always <code>io.Reader</code>: Go is statically typed and the static type of <code>r</code> is <code>io.Reader</code>.</p> <p>An extremely important example of an interface type is the empty interface: </p> <pre><br/>interface{}<br/></pre> <p>It represents the empty set of methods and is satisfied by any value at all, since any value has zero or more methods. </p> <p>Some people say that Go's interfaces are dynamically typed, but that is misleading. They are statically typed: a variable of interface type always has the same static type, and even though at run time the value stored in the interface variable may change type, that value will always satisfy the interface. </p> <p>We need to be precise about all this because reflection and interfaces are closely related. </p> <p><b>The representation of an interface</b></p> <p>Russ Cox has written a <a href="http://research.swtch.com/2009/12/go-data-structures-interfaces.html">detailed blog post</a> about the representation of interface values in Go. It's not necessary to repeat the full story here, but a simplified summary is in order. </p> <p>A variable of interface type stores a pair: the concrete value assigned to the variable, and that value's type descriptor. To be more precise, the value is the underlying concrete data item that implements the interface and the type describes the full type of that item. For instance, after </p> <pre>    var r io.Reader<br/>    tty, err := os.OpenFile("/dev/tty", os.O_RDWR, 0)<br/>    if err != nil {<br/>        return nil, err<br/>    }<br/>    r = tty</pre> <p><code>r</code> contains, schematically, the (value, type) pair, (<code>tty</code>, <code>*os.File</code>). Notice that the type <code>*os.File</code> implements methods other than <code>Read</code>; even though the interface value provides access only to the <code>Read</code> method, the value inside carries all the type information about that value. That's why we can do things like this: </p> <pre>    var w io.Writer<br/>    w = r.(io.Writer)</pre> <p>The expression in this assignment is a type assertion; what it asserts is that the item inside <code>r</code> also implements <code>io.Writer</code>, and so we can assign it to <code>w</code>. After the assignment, <code>w</code> will contain the pair (<code>tty</code>, <code>*os.File</code>). That's the same pair as was held in <code>r</code>. The static type of the interface determines what methods may be invoked with an interface variable, even though the concrete value inside may have a larger set of methods. </p> <p>Continuing, we can do this: </p> <pre>    var empty interface{}<br/>    empty = w</pre> <p>and our empty interface value <code>e</code> will again contain that same pair, (<code>tty</code>, <code>*os.File</code>). That's handy: an empty interface can hold any value and contains all the information we could ever need about that value. </p> <p>(We don't need a type assertion here because it's known statically that <code>w</code> satisfies the empty interface. In the example where we moved a value from a <code>Reader</code> to a <code>Writer</code>, we needed to be explicit and use a type assertion because <code>Writer</code>'s methods are not a subset of <code>Reader</code>'s.) </p> <p>One important detail is that the pair inside an interface always has the form (value, concrete type) and cannot have the form (value, interface type). Interfaces do not hold interface values. </p> <p>Now we're ready to reflect. </p> <p><b>The first law of reflection</b></p> <p><b>1. Reflection goes from interface value to reflection object.</b></p> <p>At the basic level, reflection is just a mechanism to examine the type and value pair stored inside an interface variable. To get started, there are two types we need to know about in <a href="http://golang.org/pkg/reflect/">package reflect</a>: <a href="http://golang.org/pkg/reflect/#Type">Type</a> and <a href="http://golang.org/pkg/reflect/#Value">Value</a>. Those two types give access to the contents of an interface variable, and two simple functions, called <code>reflect.TypeOf</code> and <code>reflect.ValueOf</code>, retrieve <code>reflect.Type</code>and <code>reflect.Value</code> pieces out of an interface value. (Also, from the <code>reflect.Value</code> it's easy to get to the <code>reflect.Type</code>, but let's keep the <code>Value</code> and <code>Type</code> concepts separate for now.) </p> <p>Let's start with <code>TypeOf</code>: </p> <pre>package main<br/><br/>import (<br/>    "fmt"<br/>    "reflect"<br/>)<br/><br/>func main() {<br/>    var x float64 = 3.4<br/>    fmt.Println("type:", reflect.TypeOf(x))<br/>}</pre> <p>This program prints </p> <pre><br/>type: float64<br/></pre> <p>You might be wondering where the interface is here, since the program looks like it's passing the <code>float64</code>variable <code>x</code>, not an interface value, to <code>reflect.TypeOf</code>. But it's there; as <a href="http://golang.org/pkg/reflect/#Type.TypeOf">godoc reports</a>, the signature of <code>reflect.TypeOf</code> includes an empty interface: </p> <pre><br/>// TypeOf returns the reflection Type of the value in the interface{}.<br/>func TypeOf(i interface{}) Type<br/></pre> <p>When we call <code>reflect.TypeOf(x)</code>, <code>x</code> is first stored in an empty interface, which is then passed as the argument; <code>reflect.TypeOf</code> unpacks that empty interface to recover the type information. </p> <p>The <code>reflect.ValueOf</code> function, of course, recovers the value (from here on we'll elide the boilerplate and focus just on the executable code): </p> <pre>    var x float64 = 3.4<br/>    fmt.Println("value:", reflect.ValueOf(x))</pre> <p>prints </p> <pre><br/>value: &lt;float64 Value&gt;<br/></pre> <p>Both <code>reflect.Type</code> and <code>reflect.Value</code> have lots of methods to let us examine and manipulate them. One important example is that <code>Value</code> has a <code>Type</code> method that returns the <code>Type</code> of a <code>reflect.Value</code>. Another is that both <code>Type</code>and <code>Value</code> have a <code>Kind</code> method that returns a constant indicating what sort of item is stored: <code>Uint</code>, <code>Float64</code>, <code>Slice</code>, and so on. Also methods on <code>Value</code> with names like <code>Int</code> and <code>Float</code> let us grab values (as <code>int64</code> and <code>float64</code>) stored inside: </p> <pre>    var x float64 = 3.4<br/>    v := reflect.ValueOf(x)<br/>    fmt.Println("type:", v.Type())<br/>    fmt.Println("kind is float64:", v.Kind() == reflect.Float64)<br/>    fmt.Println("value:", v.Float())</pre> <p>prints </p> <pre><br/>type: float64<br/>kind is float64: true<br/>value: 3.4<br/></pre> <p>There are also methods like <code>SetInt</code> and <code>SetFloat</code> but to use them we need to understand settability, the subject of the third law of reflection, discussed below. </p> <p>The reflection library has a couple of properties worth singling out. First, to keep the API simple, the "getter" and "setter" methods of <code>Value</code> operate on the largest type that can hold the value: <code>int64</code> for all the signed integers, for instance. That is, the <code>Int</code> method of <code>Value</code> returns an <code>int64</code> and the <code>SetInt</code> value takes an <code>int64</code>; it may be necessary to convert to the actual type involved: </p> <pre>    var x uint8 = 'x'<br/>    v := reflect.ValueOf(x)<br/>    fmt.Println("type:", v.Type())                            <span class="comment">// uint8.</span><br/>    fmt.Println("kind is uint8: ", v.Kind() == reflect.Uint8) <span class="comment">// true.</span><br/>    x = uint8(v.Uint())                                       <span class="comment">// v.Uint returns a uint64.</span></pre> <p>The second property is that the <code>Kind</code> of a reflection object describes the underlying type, not the static type. If a reflection object contains a value of a user-defined integer type, as in </p> <pre>    type MyInt int<br/>    var x MyInt = 7<br/>    v := reflect.ValueOf(x)</pre> <p>the <code>Kind</code> of <code>v</code> is still <code>reflect.Int</code>, even though the static type of <code>x</code> is <code>MyInt</code>, not <code>int</code>. In other words, the <code>Kind</code> cannot discriminate an int from a <code>MyInt</code> even though the <code>Type</code> can. </p> <p><b>The second law of reflection</b></p> <p><b>2. Reflection goes from reflection object to interface value.</b></p> <p>Like physical reflection, reflection in Go generates its own inverse. </p> <p>Given a <code>reflect.Value</code> we can recover an interface value using the <code>Interface</code> method; in effect the method packs the type and value information back into an interface representation and returns the result: </p> <pre><br/>// Interface returns v's value as an interface{}.<br/>func (v Value) Interface() interface{}<br/></pre> <p>As a consequence we can say </p> <pre>    y := v.Interface().(float64) <span class="comment">// y will have type float64.</span><br/>    fmt.Println(y)</pre> <p>to print the <code>float64</code> value represented by the reflection object <code>v</code>. </p> <p>We can do even better, though. The arguments to <code>fmt.Println</code>, <code>fmt.Printf</code> and so on are all passed as empty interface values, which are then unpacked by the <code>fmt</code> package internally just as we have been doing in the previous examples. Therefore all it takes to print the contents of a <code>reflect.Value</code> correctly is to pass the result of the <code>Interface</code> method to the formatted print routine: </p> <pre>    fmt.Println(v.Interface())</pre> <p>(Why not <code>fmt.Println(v)</code>? Because <code>v</code> is a <code>reflect.Value</code>; we want the concrete value it holds.) Since our value is a <code>float64</code>, we can even use a floating-point format if we want: </p> <pre>    fmt.Printf("value is %7.1e\n", v.Interface())</pre> <p>and get in this case </p> <pre><br/>3.4e+00<br/></pre> <p>Again, there's no need to type-assert the result of <code>v.Interface()</code> to <code>float64</code>; the empty interface value has the concrete value's type information inside and <code>Printf</code> will recover it. </p> <p>In short, the <code>Interface</code> method is the inverse of the <code>ValueOf</code> function, except that its result is always of static type <code>interface{}</code>. </p> <p>Reiterating: Reflection goes from interface values to reflection objects and back again. </p> <p><b>The third law of reflection</b></p> <p><b>3. To modify a reflection object, the value must be settable.</b></p> <p>The third law is the most subtle and confusing, but it's easy enough to understand if we start from first principles. </p> <p>Here is some code that does not work, but is worth studying. </p> <pre>    var x float64 = 3.4<br/>    v := reflect.ValueOf(x)<br/>    v.SetFloat(7.1) <span class="comment">// Error: will panic.</span></pre> <p>If you run this code, it will panic with the cryptic message </p> <pre><br/>panic: reflect.Value.SetFloat using unaddressable value<br/></pre> <p>The problem is not that the value <code>7.1</code> is not addressable; it's that <code>v</code> is not settable. Settability is a property of a reflection <code>Value</code>, and not all reflection <code>Values</code> have it. </p> <p>The <code>CanSet</code> method of <code>Value</code> reports the settability of a <code>Value</code>; in our case, </p> <pre>    var x float64 = 3.4<br/>    v := reflect.ValueOf(x)<br/>    fmt.Println("settability of v:", v.CanSet())</pre> <p>prints </p> <pre><br/>settability of v: false<br/></pre> <p>It is an error to call a <code>Set</code> method on an non-settable <code>Value</code>. But what is settability? </p> <p>Settability is a bit like addressability, but stricter. It's the property that a reflection object can modify the actual storage that was used to create the reflection object. Settability is determined by whether the reflection object holds the original item. When we say </p> <pre>    var x float64 = 3.4<br/>    v := reflect.ValueOf(x)</pre> <p>we pass a <em>copy</em> of <code>x</code> to <code>reflect.ValueOf</code>, so the interface value created as the argument to <code>reflect.ValueOf</code> is a <em>copy</em> of <code>x</code>, not <code>x</code> itself. Thus, if the statement </p> <pre>    v.SetFloat(7.1)</pre> <p>were allowed to succeed, it would not update <code>x</code>, even though <code>v</code> looks like it was created from <code>x</code>. Instead, it would update the copy of <code>x</code>stored inside the reflection value and <code>x</code> itself would be unaffected. That would be confusing and useless, so it is illegal, and settability is the property used to avoid this issue. </p> <p>If this seems bizarre, it's not. It's actually a familiar situation in unusual garb. Think of passing <code>x</code> to a function: </p> <pre><br/>f(x)<br/></pre> <p>We would not expect <code>f</code> to be able to modify <code>x</code> because we passed a copy of <code>x</code>'s value, not <code>x</code> itself. If we want <code>f</code> to modify <code>x</code> directly we must pass our function the address of <code>x</code> (that is, a pointer to <code>x</code>):</p> <p><code>f(&amp;x)</code></p> <p>This is straightforward and familiar, and reflection works the same way. If we want to modify <code>x</code> by reflection, we must give the reflection library a pointer to the value we want to modify. </p> <p>Let's do that. First we initialize <code>x</code> as usual and then create a reflection value that points to it, called <code>p</code>. </p> <pre>    var x float64 = 3.4<br/>    p := reflect.ValueOf(&amp;x) <span class="comment">// Note: take the address of x.</span><br/>    fmt.Println("type of p:", p.Type())<br/>    fmt.Println("settability of p:", p.CanSet())</pre> <p>The output so far is </p> <pre><br/>type of p: *float64<br/>settability of p: false<br/></pre> <p>The reflection object <code>p</code> isn't settable, but it's not <code>p</code> we want to set, it's (in effect) <code>*p</code>. To get to what <code>p</code> points to, we call the <code>Elem</code>method of <code>Value</code>, which indirects through the pointer, and save the result in a reflection <code>Value</code> called <code>v</code>: </p> <pre>    v := p.Elem()<br/>    fmt.Println("settability of v:", v.CanSet())</pre> <p>Now <code>v</code> is a settable reflection object, as the output demonstrates, </p> <pre><br/>settability of v: true<br/></pre> <p>and since it represents <code>x</code>, we are finally able to use <code>v.SetFloat</code> to modify the value of <code>x</code>: </p> <pre>    v.SetFloat(7.1)<br/>    fmt.Println(v.Interface())<br/>    fmt.Println(x)</pre> <p>The output, as expected, is </p> <pre><br/>7.1<br/>7.1<br/></pre> <p>Reflection can be hard to understand but it's doing exactly what the language does, albeit through reflection <code>Types</code> and <code>Values</code> that can disguise what's going on. Just keep in mind that reflection Values need the address of something in order to modify what they represent. </p> <p><b>Structs</b></p> <p>In our previous example <code>v</code> wasn't a pointer itself, it was just derived from one. A common way for this situation to arise is when using reflection to modify the fields of a structure. As long as we have the address of the structure, we can modify its fields. </p> <p>Here's a simple example that analyzes a struct value, <code>t</code>. We create the reflection object with the address of the struct because we'll want to modify it later. Then we set <code>typeOfT</code> to its type and iterate over the fields using straightforward method calls (see  <a href="http://golang.org/pkg/reflect/">package reflect</a> for details). Note that we extract the names of the fields from the struct type, but the fields themselves are regular <code>reflect.Value</code>objects. </p> <pre>    type T struct {<br/>        A int<br/>        B string<br/>    }<br/>    t := T{23, "skidoo"}<br/>    s := reflect.ValueOf(&amp;t).Elem()<br/>    typeOfT := s.Type()<br/>    for i := 0; i &lt; s.NumField(); i++ {<br/>        f := s.Field(i)<br/>        fmt.Printf("%d: %s %s = %v\n", i,<br/>            typeOfT.Field(i).Name, f.Type(), f.Interface())<br/>    }</pre> <p>The output of this program is </p> <pre><br/>0: A int = 23<br/>1: B string = skidoo<br/></pre> <p>There's one more point about settability introduced in passing here: the field names of <code>T</code> are upper case (exported) because only exported fields of a struct are settable. </p> <p>Because <code>s</code> contains a settable reflection object, we can modify the fields of the structure. </p> <pre>    s.Field(0).SetInt(77)<br/>    s.Field(1).SetString("Sunset Strip")<br/>    fmt.Println("t is now", t)</pre> <p>And here's the result: </p> <pre><br/>t is now {77 Sunset Strip}<br/></pre> <p>If we modified the program so that <code>s</code> was created from <code>t</code>, not <code>&amp;t</code>, the calls to <code>SetInt</code> and <code>SetString</code> would fail as the fields of <code>t</code> would not be settable. </p> <p><b>Conclusion</b></p> <p>Here again are the laws of reflection: </p> <ol><li>Reflection goes from interface value to reflection object.</li><li>Reflection goes from reflection object to interface value.</li><li>To modify a reflection object, the value must be settable.</li></ol> <p>Once you understand these laws reflection in Go becomes much easier to use, although it remains subtle. It's a powerful tool that should be used with care and avoided unless strictly necessary. </p> <p>There's plenty more to reflection that we haven't covered — sending and receiving on channels, allocating memory, using slices and maps, calling methods and functions — but this post is long enough. We'll cover some of those topics in a later article. </p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-8813821428918283782?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-03-27T07:27:07Z</updated>
    <published>2011-09-06T22:18:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="reflect"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="type"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="interface"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-334104267483015715</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/334104267483015715" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/334104267483015715" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/03/gobs-of-data.html" rel="alternate" type="text/html"/>
    <title>Gobs of data</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>To transmit a data structure across a network or to store it in a file, it mustbe encoded and then decoded again. There are many encodings available, ofcourse: <a href="http://www.json.org/">JSON</a>,<a href="http://www.w3.org/XML/">XML</a>, Google's<a href="http://code.google.com/p/protobuf">protocol buffers</a>, and more.And now there's another, provided by Go's <a href="http://golang.org/pkg/encoding/gob/">gob</a>package.</p><p>Why define a new encoding? It's a lot of work and redundant at that. Why notjust use one of the existing formats? Well, for one thing, we do! Go has<a href="http://golang.org/pkg/">packages</a> supporting all the encodings just mentioned (the<a href="http://code.google.com/p/goprotobuf">protocol buffer package</a> is ina separate repository but it's one of the most frequently downloaded). And formany purposes, including communicating with tools and systems written in otherlanguages, they're the right choice.</p><p>But for a Go-specific environment, such as communicating between two serverswritten in Go, there's an opportunity to build something much easier to use andpossibly more efficient.</p><p>Gobs work with the language in a way that an externally-defined,language-independent encoding cannot. At the same time, there are lessons to belearned from the existing systems.</p><p><b>Goals</b></p><p>The gob package was designed with a number of goals in mind.</p><p>First, and most obvious, it had to be very easy to use. First, because Go hasreflection, there is no need for a separate interface definition language or"protocol compiler". The data structure itself is all the package should needto figure out how to encode and decode it. On the other hand, this approachmeans that gobs will never work as well with other languages, but that's OK:gobs are unashamedly Go-centric.</p><p>Efficiency is also important. Textual representations, exemplified by XML andJSON, are too slow to put at the center of an efficient communications network.A binary encoding is necessary.</p><p>Gob streams must be self-describing. Each gob stream, read from the beginning,contains sufficient information that the entire stream can be parsed by anagent that knows nothing a priori about its contents. This property means thatyou will always be able to decode a gob stream stored in a file, even longafter you've forgotten what data it represents.</p><p>There were also some things to learn from our experiences with Google protocolbuffers.</p><p><b>Protocol buffer misfeatures</b></p><p>Protocol buffers had a major effect on the design of gobs, but have threefeatures that were deliberately avoided. (Leaving aside the property thatprotocol buffers aren't self-describing: if you don't know the data definitionused to encode a protocol buffer, you might not be able to parse it.)</p><p>First, protocol buffers only work on the data type we call a struct in Go. Youcan't encode an integer or array at the top level, only a struct with fieldsinside it. That seems a pointless restriction, at least in Go. If all you wantto send is an array of integers, why should you have to put it into astruct first?</p><p>Next, a protocol buffer definition may specify that fields <code>T.x</code> and<code>T.y</code> are required to be present whenever a value of type<code>T</code> is encoded or decoded.  Although such required fields may seemlike a good idea, they are costly to implement because the codec must maintain aseparate data structure while encoding and decoding, to be able to report whenrequired fields are missing.  They're also a maintenance problem. Over time, onemay want to modify the data definition to remove a required field, but that maycause existing clients of the data to crash. It's better not to have them in theencoding at all.  (Protocol buffers also have optional fields. But if we don'thave required fields, all fields are optional and that's that. There will bemore to say about optional fields a little later.)</p><p>The third protocol buffer misfeature is default values. If a protocol bufferomits the value for a "defaulted" field, then the decoded structure behaves asif the field were set to that value. This idea works nicely when you havegetter and setter methods to control access to the field, but is harder tohandle cleanly when the container is just a plain idiomatic struct. Requiredfields are also tricky to implement: where does one define the default values,what types do they have (is text UTF-8? uninterpreted bytes? how many bits in afloat?) and despite the apparent simplicity, there were a number ofcomplications in their design and implementation for protocol buffers. Wedecided to leave them out of gobs and fall back to Go's trivial but effectivedefaulting rule: unless you set something otherwise, it has the "zero value"for that type - and it doesn't need to be transmitted.</p><p>So gobs end up looking like a sort of generalized, simplified protocol buffer.How do they work?</p><p><b>Values</b></p><p>The encoded gob data isn't about <code>int8</code>s and <code>uint16</code>s.Instead, somewhat analogous to constants in Go, its integer values are abstract,sizeless numbers, either signed or unsigned. When you encode an<code>int8</code>, its value is transmitted as an unsized, variable-lengthinteger. When you encode an <code>int64</code>, its value is also transmitted asan unsized, variable-length integer. (Signed and unsigned are treateddistinctly, but the same unsized-ness applies to unsigned values too.) If bothhave the value 7, the bits sent on the wire will be identical. When the receiverdecodes that value, it puts it into the receiver's variable, which may be ofarbitrary integer type. Thus an encoder may send a 7 that came from an<code>int8</code>, but the receiver may store it in an <code>int64</code>. Thisis fine: the value is an integer and as a long as it fits, everything works. (Ifit doesn't fit, an error results.) This decoupling from the size of the variablegives some flexibility to the encoding: we can expand the type of the integervariable as the software evolves, but still be able to decode old data.</p><p>This flexibility also applies to pointers. Before transmission, all pointers areflattened. Values of type <code>int8</code>, <code>*int8</code>,<code>**int8</code>, <code>****int8</code>, etc. are all transmitted as aninteger value, which may then be stored in <code>int</code> of any size, or<code>*int</code>, or <code>******int</code>, etc. Again, this allows forflexibility.</p><p>Flexibility also happens because, when decoding a struct, only those fieldsthat are sent by the encoder are stored in the destination. Given the value</p><pre>type T struct{ X, Y, Z int } <span class="comment">// Only exported fields are encoded and decoded.</span><br/>var t = T{X: 7, Y: 0, Z: 8}</pre><p>the encoding of <code>t</code> sends only the 7 and 8. Because it's zero, thevalue of <code>Y</code> isn't even sent; there's no need to send a zero value.</p><p>The receiver could instead decode the value into this structure:</p><pre>type U struct{ X, Y *int8 } <span class="comment">// Note: pointers to int8s</span><br/>var u U</pre><p>and acquire a value of <code>u</code> with only <code>X</code> set (to theaddress of an <code>int8</code> variable set to 7); the <code>Z</code> field isignored - where would you put it? When decoding structs, fields are matched byname and compatible type, and only fields that exist in both are affected. Thissimple approach finesses the "optional field" problem: as the type<code>T</code> evolves by adding fields, out of date receivers will stillfunction with the part of the type they recognize. Thus gobs provide theimportant result of optional fields - extensibility - without any additionalmechanism or notation.</p><p>From integers we can build all the other types: bytes, strings, arrays, slices,maps, even floats. Floating-point values are represented by their IEEE 754floating-point bit pattern, stored as an integer, which works fine as long asyou know their type, which we always do. By the way, that integer is sent inbyte-reversed order because common values of floating-point numbers, such assmall integers, have a lot of zeros at the low end that we can avoidtransmitting.</p><p>One nice feature of gobs that Go makes possible is that they allow you to defineyour own encoding by having your type satisfy the<a href="http://golang.org/pkg/encoding/gob/#GobEncoder">GobEncoder</a> and<a href="http://golang.org/pkg/encoding/gob/#GobDecoder">GobDecoder</a> interfaces, in a manneranalogous to the <a href="http://golang.org/pkg/encoding/json/">JSON</a> package's<a href="http://golang.org/pkg/encoding/json/#Marshaler">Marshaler</a> and<a href="http://golang.org/pkg/encoding/json/#Unmarshaler">Unmarshaler</a> and also to the<a href="http://golang.org/pkg/fmt/#Stringer">Stringer</a> interface from<a href="http://golang.org/pkg/fmt/">package fmt</a>. This facility makes it possible torepresent special features, enforce constraints, or hide secrets when youtransmit data. See the <a href="http://golang.org/pkg/encoding/gob/">documentation</a> fordetails.</p><p><b>Types on the wire</b></p><p>The first time you send a given type, the gob package includes in the datastream a description of that type. In fact, what happens is that the encoder isused to encode, in the standard gob encoding format, an internal struct thatdescribes the type and gives it a unique number. (Basic types, plus the layoutof the type description structure, are predefined by the software forbootstrapping.) After the type is described, it can be referenced by its typenumber.</p><p>Thus when we send our first type <code>T</code>, the gob encoder sends adescription of <code>T</code> and tags it with a type number, say 127. Allvalues, including the first, are then prefixed by that number, so a stream of<code>T</code> values looks like:</p><pre><br/>("define type id" 127, definition of type T)(127, T value)(127, T value), ...<br/></pre><p>These type numbers make it possible to describe recursive types and send valuesof those types. Thus gobs can encode types such as trees:</p><pre>type Node struct {<br/>    Value       int<br/>    Left, Right *Node<br/>}</pre><p>(It's an exercise for the reader to discover how the zero-defaulting rule makesthis work, even though gobs don't represent pointers.)</p><p>With the type information, a gob stream is fully self-describing except for theset of bootstrap types, which is a well-defined starting point.</p><p><b>Compiling a machine</b></p><p>The first time you encode a value of a given type, the gob package builds alittle interpreted machine specific to that data type. It uses reflection onthe type to construct that machine, but once the machine is built it does notdepend on reflection. The machine uses package unsafe and some trickery toconvert the data into the encoded bytes at high speed. It could use reflectionand avoid unsafe, but would be significantly slower. (A similar high-speedapproach is taken by the protocol buffer support for Go, whose design wasinfluenced by the implementation of gobs.) Subsequent values of the same typeuse the already-compiled machine, so they can be encoded right away.</p><p>Decoding is similar but harder. When you decode a value, the gob package holdsa byte slice representing a value of a given encoder-defined type to decode,plus a Go value into which to decode it. The gob package builds a machine forthat pair: the gob type sent on the wire crossed with the Go type provided fordecoding. Once that decoding machine is built, though, it's again areflectionless engine that uses unsafe methods to get maximum speed.</p><p><b>Use</b></p><p>There's a lot going on under the hood, but the result is an efficient,easy-to-use encoding system for transmitting data. Here's a complete exampleshowing differing encoded and decoded types. Note how easy it is to send andreceive values; all you need to do is present values and variables to the<a href="http://golang.org/pkg/encoding/gob/">gob package</a> and it does all the work.</p><pre>package main<br/><br/>import (<br/>    "bytes"<br/>    "encoding/gob"<br/>    "fmt"<br/>    "log"<br/>)<br/><br/>type P struct {<br/>    X, Y, Z int<br/>    Name    string<br/>}<br/><br/>type Q struct {<br/>    X, Y *int32<br/>    Name string<br/>}<br/><br/>func main() {<br/>    <span class="comment">// Initialize the encoder and decoder.  Normally enc and dec would be</span><br/>    <span class="comment">// bound to network connections and the encoder and decoder would</span><br/>    <span class="comment">// run in different processes.</span><br/>    var network bytes.Buffer        <span class="comment">// Stand-in for a network connection</span><br/>    enc := gob.NewEncoder(&amp;network) <span class="comment">// Will write to network.</span><br/>    dec := gob.NewDecoder(&amp;network) <span class="comment">// Will read from network.</span><br/>    <span class="comment">// Encode (send) the value.</span><br/>    err := enc.Encode(P{3, 4, 5, "Pythagoras"})<br/>    if err != nil {<br/>        log.Fatal("encode error:", err)<br/>    }<br/>    <span class="comment">// Decode (receive) the value.</span><br/>    var q Q<br/>    err = dec.Decode(&amp;q)<br/>    if err != nil {<br/>        log.Fatal("decode error:", err)<br/>    }<br/>    fmt.Printf("%q: {%d,%d}\n", q.Name, *q.X, *q.Y)<br/>}</pre><p>You can compile and run this example code in the<a href="http://play.golang.org/p/_-OJV-rwMq">Go Playground</a>.</p><p>The <a href="http://golang.org/pkg/net/rpc/">rpc package</a> builds on gobs to turn thisencode/decode automation into transport for method calls across the network.That's a subject for another article.</p><p><b>Details</b></p><p>The <a href="http://golang.org/pkg/encoding/gob/">gob package documentation</a>, especially thefile <a href="http://golang.org/src/pkg/encoding/gob/doc.go">doc.go</a>, expands on many of thedetails described here and includes a full worked example showing how theencoding represents data. If you are interested in the innards of the gobimplementation, that's a good place to start.</p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-334104267483015715?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2012-03-27T07:25:58Z</updated>
    <published>2011-03-24T16:30:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="protobuf"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="gob"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="xml"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="json"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-03-28T07:57:29Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-14915826.post-3134780612228523745</id>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/3134780612228523745" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/3134780612228523745" rel="self" type="application/atom+xml"/>
    <link href="http://going-along.blogspot.com/2012/03/mikespook-httpwww.html" rel="alternate" type="text/html"/>
    <title>自由的翼，鹏翔</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">有感MikeSpook的小诗，作新体诗一首：<br/>
<br/>
自由的翼<br/>
——和http://www.mikespook.com/2012/03/73字小诗<br/>
<br/>
桌面<br/>
照片里的苍鹰<br/>
在飞越高山<br/>
可是它却<br/>
无法<br/>
飞过<br/>
压住它的玻璃板<br/>
<br/>
尽管<br/>
不一样的世界<br/>
就在<br/>
无形的墙外面<br/>
但不知<br/>
天的另一边<br/>
是否有<br/>
可以停留的驿站<br/>
不知<br/>
自己的下一步<br/>
是不是<br/>
就到了终点<br/>
<br/>
如果<br/>
真是自由的翼<br/>
就不会在乎<br/>
在冲撞中折断<br/>
<br/>
<br/>
附，发到golang-china里的旧体诗：<br/>
<br/>
鹏翔<br/>
<br/>
孤鹏展翅勿彷徨，<br/>
冬去春回枝满霜。<br/>
负笈含辛十数载，<br/>
墙外开花墙内香。<br/><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/14915826-3134780612228523745?l=going-along.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-03-26T03:49:01Z</updated>
    <published>2012-03-26T03:48:00Z</published>
    <author>
      <name>Fango</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-14915826</id>
      <category term="MCU"/>
      <category term="D'sign"/>
      <category term="Life"/>
      <category term="Go"/>
      <category term="yi"/>
      <category term="C"/>
      <category term="OS"/>
      <author>
        <name>Fango</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://going-along.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/14915826/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://going-along.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">#! contact | sed s@Fango@\ <i>fanhoward@g</i> | <i>mail</i> #!<i>.com</i> <br/>
#! fortune <br/>
  I'm a proud Go <a href="http://groups.google.com/group/golang-dev/browse_thread/thread/66d3092f4da31718">contributor </a>today. Wow.</div>
      </subtitle>
      <title>Going Along</title>
      <updated>2012-06-21T10:48:21Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-5437446516873944266</id>
    <link href="http://reneefrench.blogspot.com/feeds/5437446516873944266/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=5437446516873944266" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/5437446516873944266" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/5437446516873944266" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/03/blog-post_22.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://1.bp.blogspot.com/-T7tv_av6Xqs/T2shNETTPxI/AAAAAAAAErE/qvGiD-YSGOo/s1600/factoryface.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5722704259881058066" src="http://1.bp.blogspot.com/-T7tv_av6Xqs/T2shNETTPxI/AAAAAAAAErE/qvGiD-YSGOo/s320/factoryface.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 276px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-5437446516873944266?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-03-22T12:55:28Z</updated>
    <published>2012-03-22T12:54:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-08-18T18:51:20Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-596082203403197400</id>
    <link href="http://mue.tideland.biz/feeds/596082203403197400/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/03/go-talk-at-gtug-bremen.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/596082203403197400" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/596082203403197400" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/03/go-talk-at-gtug-bremen.html" rel="alternate" type="text/html"/>
    <title>Go talk at GTUG Bremen</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">The next regulars' table of the <a href="http://bremen.gtugs.org/" target="_blank">GTUG Bremen</a> will be on April, 2nd. This time I'll give a talk on Googles programming language <b>Go</b>.<b> </b>Topics will be<br/><br/><ul><li>a short introduction into the history,</li><li>the basic features,</li><li>the special combination of elegance and power, and</li><li>Go in the wilderness.</li></ul>The talk will be in English and the slides will be available afterwords via SlideShare.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-596082203403197400?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-03-18T20:27:51Z</updated>
    <published>2012-03-18T20:27:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="talk"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-7889693708089772801</id>
    <link href="http://reneefrench.blogspot.com/feeds/7889693708089772801/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=7889693708089772801" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7889693708089772801" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7889693708089772801" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/03/blog-post_18.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-MICi-nFwqjM/T2XIYqD1beI/AAAAAAAAEqk/XKLFGPP58uM/s1600/ibis.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5721199227576872418" src="http://3.bp.blogspot.com/-MICi-nFwqjM/T2XIYqD1beI/AAAAAAAAEqk/XKLFGPP58uM/s320/ibis.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 282px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-7889693708089772801?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-03-18T11:35:09Z</updated>
    <published>2012-03-18T11:34:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-08-05T00:42:18Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/03/17/rsados</id>
    <link href="http://www.imperialviolet.org/2012/03/17/rsados.html" rel="alternate" type="text/html"/>
    <title>Very large RSA public exponents</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>After <a href="http://www.imperialviolet.org/2012/03/16/rsae.html">yesterday's post</a> that advocated using RSA public exponents of 3 or 2<sup>16</sup>+1 in DNSSEC for performance, Dan Kaminsky asked me whether there was a potential DoS vector by using <i>really</i> big public exponents.</p>

<p>Recall that the RSA signature verification core is <i>m<sup>e</sup></i> mod <i>n</i>. By making <i>e</i> and <i>n</i> larger, we can make the operation slower. But there are limits, at least in OpenSSL:</p>

<pre>/* for large moduli, enforce exponent limit */
if (BN_num_bits(rsa-&gt;n) &gt; OPENSSL_RSA_SMALL_MODULUS_BITS) {
        if (BN_num_bits(rsa-&gt;e) &gt; OPENSSL_RSA_MAX_PUBEXP_BITS) {
                RSAerr(RSA_F_RSA_EAY_PUBLIC_ENCRYPT, RSA_R_BAD_E_VALUE);
                return -1;
        }
}</pre>

<p>So, if <i>n</i> is large, we enforce a limit on <i>e</i>. The values of the #defines are such that for <i>n&gt;</i>3072 bits, <i>e</i> must be less than or equal to 64 bits. So the slowest operations happen with an <i>n</i> and <i>e</i> of 3072 bits. (The fact that <i>e&lt;n</i> is enforced earlier in the code.)</p>

<p>So I setup <tt>*.bige.imperialviolet.org</tt>. This is a perfectly valid and well signed zone which happens to use a 3072-bit key with a 3072-bit public exponent. (I could probably have slowed things down more by picking a public exponent with lots of 1s in its binary representation, but it's just a random number in this case.) One can resolve records <tt>1.bige.imperialviolet.org</tt>, <tt>2.bige.imperialviolet.org</tt>, … and the server doesn't have to sign anything because it's a wildcard: a single signature covers all of the names. However, the resolver validates the signature every time.</p>

<p>On my 2.66GHz, Core 2 laptop, 15 requests per second causes <a href="http://unbound.net/">unbound</a> to take 95% of a core. A couple hundred queries per second would probably put most DNSSEC resolvers in serious trouble.</p>

<p>So I'd recommend limiting the public exponent size in DNSSEC to 2<sup>16</sup>+1, except that people are already mistakenly using 2<sup>32</sup>+1, so I guess that needs to be the limit. The DNSSEC spec <a href="https://tools.ietf.org/html/rfc3110#section-2">limits</a> the modulus size to 4096-bits, and 4096-bit signatures are about 13 times slower to verify than the typical 1024-bit signatures used in DNSSEC. But that's a lot less of a DoS vector than <tt>bige.imperialviolet.org</tt>, which is 2230 times slower than normal.</p></div>
    </content>
    <updated>2012-03-17T07:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/03/16/rsae</id>
    <link href="http://www.imperialviolet.org/2012/03/16/rsae.html" rel="alternate" type="text/html"/>
    <title>RSA public exponent size</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>RSA public operations are much faster than private operations. Thirty-two times faster for a 2048-bit key on my machine. But the two operations are basically the same: take the message, raise it to the power of the public or private exponent and reduce modulo the key's modulus.</p>

<p>What makes the public operations so much faster is that the public exponent is typically tiny, while the private exponent should be the same size as the modulus. One can actually use a public exponent of three in RSA, and clearly cubing a number should be faster than raising it to the power of a 2048-bit number.</p>

<p>In 2006, Daniel Bleichenbacher (a fellow Googler) gave a <a href="http://www.imc.org/ietf-openpgp/mail-archive/msg06063.html">talk at the CRYPTO 2006 rump session</a> where he outlined a bug in several, very common RSA signature verification implementations at the time. The bug wasn't nearly as bad as it could have been because it only affected public keys that used a public exponent of three and most keys used a larger exponent: 2<sup>16</sup>+1. But the fact that a slightly larger public exponent saved these buggy verifiers cemented 2<sup>16</sup>+1 as sensible default value for the public exponent.</p>

<p>But there's absolutely no reason to think that a public exponent larger than 2<sup>16</sup>+1 does any good. I even checked that with Bleichenbacher before writing this. Three should be fine, 2<sup>16</sup>+1 saved some buggy software a couple of times and any larger is probably a mistake.</p>

<p>Because of that, when writing the Go RSA package, I didn't bother supporting public exponents larger than 2<sup>31</sup>-1. But then several people <a href="http://code.google.com/p/go/issues/detail?id=3161">reported</a> that they couldn't verify some DNSSEC signatures. Sure enough, the DNSKEY records for <tt>.cz</tt> and <tt>.us</tt> are using a public exponent of 2<sup>32</sup>+1.</p>

<p>DNSSEC is absolutely the last place to use large, public exponents. Busy DNS resolvers have to resolve tens or hundreds of thousands of records a second; fast RSA signature verification is big deal in DNSSEC. So I measured the speed impact of various public exponent sizes with OpenSSL (1.0.1-beta3):</p>

<table>
  <tbody><tr><th>Public exponent</th><th>Verification time (µs)</th></tr>
  <tr><td>3</td><td>10.6</td></tr>
  <tr><td>2<sup>16</sup>+1</td><td>23.9</td></tr>
  <tr><td>2<sup>32</sup>+1</td><td>42.7</td></tr>
  <tr><td>2<sup>127</sup>-1</td><td>160.7</td></tr>
</tbody></table>

<p>So a public exponent of 2<sup>32</sup>+1 makes signature verification over four times slower than an exponent of three. As DNSSEC grows, and DNSSEC resolvers too, that extra CPU time is going to be a big deal.</p>

<p>It looks like the zones using a value of 2<sup>32</sup>+1 are just passing the <tt>-e</tt> flag to BIND's <tt>dnssec-keygen</tt> utility. There's some suggestion that <tt>-e</tt> used to select 2<sup>16</sup>+1 but silently changed semantics in some release.</p>

<p>So today's lesson is <b>don't pass <tt>-e</tt> to <tt>dnssec-keygen</tt></b>! The default of <tt>dnssec-keygen</tt> is 2<sup>16</sup>+1 and that's certainly safe. The <tt>.com</tt> zone uses a value of three and I think that's probably the best choice given the CPU cost and the fact that the original Bleichenbacher bug has been long since fixed.</p></div>
    </content>
    <updated>2012-03-16T07:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-8507858026690221665</id>
    <link href="http://reneefrench.blogspot.com/feeds/8507858026690221665/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=8507858026690221665" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8507858026690221665" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8507858026690221665" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/03/blog-post_07.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://1.bp.blogspot.com/-7yXg5QCJ2rU/T1gm0abZqwI/AAAAAAAAEqA/7LDCbez7MhM/s1600/hotlunch.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5717362408836147970" src="http://1.bp.blogspot.com/-7yXg5QCJ2rU/T1gm0abZqwI/AAAAAAAAEqA/7LDCbez7MhM/s320/hotlunch.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 249px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-8507858026690221665?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-03-08T03:26:14Z</updated>
    <published>2012-03-08T02:58:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-08-04T13:17:04Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-4541162593570603761</id>
    <link href="http://mue.tideland.biz/feeds/4541162593570603761/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/03/added-commit-log.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/4541162593570603761" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/4541162593570603761" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/03/added-commit-log.html" rel="alternate" type="text/html"/>
    <title>Added commit log</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">For those of your who are using my <a href="http://code.google.com/p/tcgl/" target="_blank">Tideland Common Go Library</a> I've added a commit log to this blog. So you can easily see how it evolves. Currently I'm working on a refactoring of the <span style="font-family: 'Courier New', Courier, monospace;">cells</span> package for event-driven applications. The handling has been too complex and uncomfortable and I also want to provide more default cell behaviors for an easy start.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-4541162593570603761?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-03-05T09:34:23Z</updated>
    <published>2012-03-05T09:34:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://www.miek.nl/blog/archives/2012/03/04/super-short_guide_to_getting_q_part_ii/index.html</id>
    <link href="http://www.miek.nl/blog/archives/2012/03/04/super-short_guide_to_getting_q_part_ii/index.html" rel="alternate" type="text/html"/>
    <title>Super-short guide to getting q (Part II)</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>The development of the language <a href="http://www.golang.org">Go</a> is
going at a fast pace, hence an updated version of
<a href="http://www.miek.nl/blog/archives/2012/01/23/super-short_guide_to_getting_q/index.html">Super-short guide to gettinq q</a>.</p>

<p>Get the latest version (called <code>weekly</code>) of Go:</p>

<ol>
<li><p>Get Go: <code>hg clone -u release https://go.googlecode.com/hg/ go</code>
Note the directory you have downloaded it to and set add its <code>bin</code>
directory to your PATH: <code>PATH=$PWD/go/bin</code>.</p></li>
<li><p>Update Go to the latest weekly: <code>cd go; hg pull; hg update weekly</code></p></li>
<li><p>Compile Go: <code>cd src</code>, you should now sit in <code>go/src</code>.
And compile: <code>./all.bash</code></p></li>
</ol>

<blockquote>
  <p>Install missing commands (gcc, sed, bison, etc.) if needed.</p>
</blockquote>

<p>The latest Go is now installed. You should now have the <code>go</code>-tool,
this is the central interface to all Go program building tasks.</p>

<pre><code>$ go
Go is a tool for managing Go source code.

Usage: go command [arguments]

The commands are:

build       compile packages and dependencies
clean       remove object files
doc         run godoc on package sources
fix         run go tool fix on packages
....
....
lost more
</code></pre>

<p>If you can not run <code>go</code>, check your PATH.</p>

<h2>Install Go DNS and set GOPATH</h2>

<p>The GOPATH variable specifies (among things) where <em>your</em> Go
code lives. Using the <code>go</code> tool does bring a few requirements
to the table in how to layout the directory structure.</p>

<ol>
<li>Create toplevel directory (<code>~/g</code>) for your code: <code>mkdir -p ~/g/src</code></li>
<li>Set GOPATH to this toplevel directory: <code>export GOPATH=~/g</code></li>
<li>Get dns: <code>cd ~/g/src; git clone git://github.com/miekg/dns.git</code></li>
<li>Compile it: <code>cd dns; go build</code></li>
<li>Compile and install the examples, there is a helper <code>Makefile</code> here, but it
just calls <code>go</code> multiple times: <code>cd ex; make</code></li>
<li>Look in <code>$GOPATH/bin</code> for the binaries, in this setup that will be <code>~/g/bin</code></li>
<li>Query with q: <code>~/g/bin/q mx miek.nl</code> (or add <code>~/g/bin</code> to your $PATH too)</li>
<li>Report bugs</li>
</ol></div>
    </summary>
    <updated>2012-03-04T08:54:04Z</updated>
    <category term="go, dns(sec)"/>
    <author>
      <name>Miek Gieben</name>
    </author>
    <source>
      <id>http://www.miek.nl/blog</id>
      <author>
        <name>Miek Gieben</name>
      </author>
      <link href="http://www.miek.nl/blog/archives/go/index-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.miek.nl/blog" rel="alternate" type="text/html"/>
      <subtitle>Thoughts on (technical) stuff</subtitle>
      <title>Filed under: go | Miek</title>
      <updated>2012-09-17T18:42:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-3206310955105084723</id>
    <link href="http://reneefrench.blogspot.com/feeds/3206310955105084723/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=3206310955105084723" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3206310955105084723" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3206310955105084723" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/03/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-042MOD9r_28/T1K6DBA-WKI/AAAAAAAAEoQ/8ehLn8XJiXc/s1600/wales44.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5715835438061476002" src="http://3.bp.blogspot.com/-042MOD9r_28/T1K6DBA-WKI/AAAAAAAAEoQ/8ehLn8XJiXc/s320/wales44.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 244px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-3206310955105084723?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-03-04T00:40:55Z</updated>
    <published>2012-03-04T00:40:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-08-03T15:03:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/03/02/ieecdhe</id>
    <link href="http://www.imperialviolet.org/2012/03/02/ieecdhe.html" rel="alternate" type="text/html"/>
    <title>Forward secrecy for IE and Safari too</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>When we <a href="http://www.imperialviolet.org/2011/11/22/forwardsecret.html">announced</a> forward secrecy for Google HTTPS we noted that “we hope to support IE in the future”. It wasn't that we didn't want to support IE, but IE doesn't implement the combination of ECDHE with RC4. IE (or rather, SChannel) does implement ECDHE with AES on Vista and Windows 7, but I only wanted to make one change at a time.</p>

<p>With the release of <a href="http://technet.microsoft.com/en-us/security/bulletin/ms12-006">MS12-006</a> a month ago to address the BEAST weakness in TLS 1.0's CBC design, we've now made ECDHE-RSA-AES128-SHA our second preference cipher. That means that Chrome and Firefox will still use ECDHE-RSA-RC4-SHA, but IE on Vista and Windows 7 will get ECDHE now. This change also means that we support ECDHE with Safari (at least on Lion, where I tried it.)</p></div>
    </content>
    <updated>2012-03-02T08:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://www.airs.com/blog/?p=549</id>
    <link href="http://feedproxy.google.com/~r/Airs-IanLanceTaylor/~3/cGImXgIACPc/549" rel="alternate" type="text/html"/>
    <title>Piece of PIE</title>
    <summary>Modern ELF systems can randomize the address at which shared libraries are loaded. This is generally referred to as Address Space Layout Randomization, or ASLR. Shared libraries are always position independent, which means that they can be loaded at any address. Randomizing the load address makes it slightly harder for attackers of a running program [...]</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Modern ELF systems can randomize the address at which shared libraries are loaded.  This is generally referred to as Address Space Layout Randomization, or ASLR.  Shared libraries are always position independent, which means that they can be loaded at any address.  Randomizing the load address makes it slightly harder for attackers of a running program to exploit buffer overflows or similar problems, because they have no fixed addresses that they can rely on.  ASLR is part of defense in depth: it does not by itself prevent any attacks, but it makes it slightly more difficult for attackers to exploit certain kinds of programming errors in a useful way beyond simply crashing the program.</p>
<p>Although it is straightforward to randomize the load address of a shared library, an ELF executable is normally linked to run at a fixed address that can not be changed.  This means that attackers have a set of fixed addresses they can rely on.  Permitting the kernel to randomize the address of the executable itself is done by generating a Position Independent Executable, or PIE.</p>
<p>It turns out to be quite simple to create a PIE: a PIE is simply an executable shared library.  To make a shared library executable you just need to give it a PT_INTERP segment and appropriate startup code.  The startup code can be the same as the usual executable startup code, though of course it  must be compiled to be position independent.</p>
<p>When compiling code to go into a shared library, you use the -fpic option.  When compiling code to go into a PIE, you use the -fpie option.  Since a PIE is just a shared library, these options are almost exactly the same.  The only difference is that since -fpie implies that you are building the main executable, there is no need to support symbol interposition for defined symbols.  In a shared library, if function f1 calls f2, and f2 is globally visible, the code has to consider the possibility that f2 will be interposed.  Thus, the call must go through the PLT.  In a PIE, f2 can not be interposed, so the call may be made directly, though of course still in a position independent manner.  Similarly, if the processor can do PC-relative loads and stores, all global variables can be accessed directly rather than going through the GOT.</p>
<p>Other than that ability to avoid the PLT and GOT in some cases, a PIE is really just a shared library.  The dynamic linker will ask the kernel to map it at a random address and will then relocate it as usual.</p>
<p>This does imply that a PIE must be dynamically linked, in the sense of using the dynamic linker.  Since the dynamic linker and the C library are closely intertwined, linking the PIE statically with the C library is unlikely to work in general.  It is possible to design a statically linked PIE, in which the program relocates itself at startup time.  The dynamic linker itself does this.  However, there is no general mechanism for this at present.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/AYpo50wJXKLjGTzUTTRA8vG-8jI/0/da"><img border="0" ismap="true" src="http://feedads.g.doubleclick.net/~a/AYpo50wJXKLjGTzUTTRA8vG-8jI/0/di"/></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/AYpo50wJXKLjGTzUTTRA8vG-8jI/1/da"><img border="0" ismap="true" src="http://feedads.g.doubleclick.net/~a/AYpo50wJXKLjGTzUTTRA8vG-8jI/1/di"/></a></p><img height="1" src="http://feeds.feedburner.com/~r/Airs-IanLanceTaylor/~4/cGImXgIACPc" width="1"/></div>
    </content>
    <updated>2012-02-29T15:33:40Z</updated>
    <category term="Programming"/><feedburner:origLink xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://www.airs.com/blog/archives/549</feedburner:origLink>
    <author>
      <name>Ian Lance Taylor</name>
    </author>
    <source>
      <id>http://www.airs.com/blog</id>
      <link href="http://www.airs.com/blog" rel="alternate" type="text/html"/>
      <link href="http://feeds.feedburner.com/Airs-IanLanceTaylor" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>Ian Lance Taylor</subtitle>
      <title>Airs - Ian Lance Taylor</title>
      <updated>2012-03-04T21:00:32Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-3340424700683543634</id>
    <link href="http://mue.tideland.biz/feeds/3340424700683543634/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/go-usage-at-google.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/3340424700683543634" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/3340424700683543634" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/go-usage-at-google.html" rel="alternate" type="text/html"/>
    <title>Go usage at Google</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Go is an interesting language moving towards its first release Go 1. And it's really exciting to see how it gets better each weekly release. But so far there are only few projects known where Go is used for real productive software (<a href="http://go-lang.cat-v.org/organizations-using-go" target="_blank">here</a> is a first list containing also my employer Canonical). And it would be helpful to know that Google itself trusts in Go for their systems.<br/><br/>One first step has been the adding of Go to the <a href="http://code.google.com/intl/en/appengine/docs/go/overview.html" target="_blank">Google App Engine</a>, another one the usage of Go for the <a href="http://code.google.com/p/codesearch/" target="_blank">code search</a>. Sadly that service has been shut down. But now they presented <a href="http://code.google.com/p/vitess/" target="_blank">vitess</a>, a project for the scaling of MySQL. And it's no theoretical project, it's used at YouTube.<br/><br/>There are also two interesting quotes by the developers why they've chosen Go:<br/><blockquote class="tr_bq">"Go is miles ahead of C++ and Java in terms of expressibility and close in terms of performance. It is also relatively simple and has a straightforward interaction with Linux system calls."</blockquote>It's the same experience I made using Go in professional and personal projects. But the next quote shows the importance of the improvement of the garbage collector:<br/><blockquote class="tr_bq">"The main drawback is also its strength - the garbage collector. vtocc has made spot optimizations to minimize most of the adverse effects of Go’s stop-the-world gc. At this point, we are trading some amount of performance for greater creativity and efficiency at lower layers. unless you’re trying to max out on qps for your servers, you should see acceptable performance from vtocc. Also, go’s garbage collector is being improved. So, this should only get better over time. Go’s existing mark-and-sweep garbage collector is sub-optimal for systems that use large amounts of static memory (like caches). In the case of vtocc, this would be the row cache. To alleviate this, we intend to use memcache for the time being. If the gc ends up addressing this, it should be fairly trivial to switch to an in-memory row cache. Note that the row cache functionality is not fully ready yet."</blockquote>Here I'm really looking forward to the next releases.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-3340424700683543634?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-02-29T09:59:15Z</updated>
    <published>2012-02-29T08:38:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-2244322753981090824</id>
    <link href="http://mue.tideland.biz/feeds/2244322753981090824/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/go-environment-setup.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/2244322753981090824" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/2244322753981090824" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/go-environment-setup.html" rel="alternate" type="text/html"/>
    <title>Go environment setup</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><br/>A good start for Go development is a root directory for all further directories like <span style="font-family: 'Courier New', Courier, monospace;">/home/themue/projects</span>. It will be the home for the Go SDK, 3rd party packages and own projects. The current weekly will be installed with the command <span style="font-family: 'Courier New', Courier, monospace;">hg clone -u weekly https://code.google.com/p/go</span> in the directory <span style="font-family: 'Courier New', Courier, monospace;">go</span>. <a href="http://weekly.golang.org/doc/install.html">http://weekly.golang.org/doc/install.html</a> documents all needed steps in detail. The two other directories have to be created by hand, together with a <span style="font-family: 'Courier New', Courier, monospace;">src</span> and a <span style="font-family: 'Courier New', Courier, monospace;">pkg</span> subdirectory each. This way you get the structure<br/><blockquote class="tr_bq"><span style="font-family: 'Courier New', Courier, monospace;">/home/themue/projects<br/>        /go<br/>                /bin<br/>                ...<br/>                /test<br/>        /own<br/>                /pkg<br/>                /src<br/>        /3rdparty<br/>                /pkg<br/>                /src</span></blockquote>Why this 3rd party directory? The new Go tools have a very intelligent way to install external packages in a different directory than own packages. It's based on the environment variable <span style="font-family: 'Courier New', Courier, monospace;">$GOPATH</span>. The naming already shows that it's a path, not only one directory. <span style="font-family: 'Courier New', Courier, monospace;">$GOPATH</span> is the path where commands like <span style="font-family: 'Courier New', Courier, monospace;">go build</span> and <span style="font-family: 'Courier New', Courier, monospace;">go install</span> look for referenced packages they need to compile and link the software. To do so external packages have to be installed before. The command <span style="font-family: 'Courier New', Courier, monospace;">go get</span> will install the sources and the compiled package into the first directory of the path. So the order in the case above should be<br/><blockquote class="tr_bq"><span style="font-family: 'Courier New', Courier, monospace;">GOPATH=$HOME/projects/3rdparty:$HOME/projects/own</span></blockquote>When installing own packages which source is located in <span style="font-family: 'Courier New', Courier, monospace;">.../own/src</span> it will be installed into <span style="font-family: 'Courier New', Courier, monospace;">.../own/pkg</span>.<br/><br/>Which environment variables else are needed? One is <span style="font-family: 'Courier New', Courier, monospace;">$GOROOT</span>. It has to point to the root of the Go SDK, here <span style="font-family: 'Courier New', Courier, monospace;">/home/themue/projects/go</span>. The compiled binaries will by default be installed in <span style="font-family: 'Courier New', Courier, monospace;">$GOROOT/bin</span>. But there are two further options for the work with the SDK:<br/><br/><ul><li>The location for the binaries is ok. Here the standard <span style="font-family: 'Courier New', Courier, monospace;">$PATH</span> should point to this directory too with <span style="font-family: 'Courier New', Courier, monospace;">PATH=$PATH:$HOME/projects/go/bin</span>.</li><li>The other way is that you've got a directory like <span style="font-family: 'Courier New', Courier, monospace;">$HOME/bin</span> for all your private binaries and scripts and it's already in your <span style="font-family: 'Courier New', Courier, monospace;">$PATH</span>. In this case you can set <span style="font-family: 'Courier New', Courier, monospace;">GOBIN=$HOME/bin</span> before installing the Go SDK. In this case after the compilation the Go binaries get installed in your <span style="font-family: 'Courier New', Courier, monospace;">$HOME/bin</span>.</li></ul><br/>Inside your own source directory you may need further subdirectories for your different projects. Their naming depends on possible external SCM environments you're using. Mine is <a href="http://code.google.com./">code.google.com.</a> So for the <i>Tideland Common Go Library</i> (see <a href="http://code.google.com/p/tcgl">http://code.google.com/p/tcgl</a>) I placed the source in<br/><span style="font-family: 'Courier New', Courier, monospace;">.../own/src/code.google.com/p/tcgl</span><span style="font-family: inherit;">. </span>This project contains several packages which I now can import as <span style="font-family: 'Courier New', Courier, monospace;">code.google.com/p/tcgl/foo</span>, regardless if I'm inside the same project or another one. And more important is that people who are taking a look into my code can easily see how to get and import it as their 3rd party code.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-2244322753981090824?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-02-29T09:01:18Z</updated>
    <published>2012-02-27T07:37:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-2471679847867564225</id>
    <link href="http://mue.tideland.biz/feeds/2471679847867564225/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/convinced-by-sublime-text.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/2471679847867564225" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/2471679847867564225" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/convinced-by-sublime-text.html" rel="alternate" type="text/html"/>
    <title>Convinced by Sublime Text</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">During my now almost 30 years of software development I've used many editors (as well as IDEs). And you know, once you found your favorite one it's hard to change. There are holy wars on the net between the different fan groups. And everyone surely knows enough advantages for his <i>acme</i>, <i>emacs, vim</i> or any other one. After <i>SPF/2</i> and <i>SNiFF++</i> my favorite for about 17 years has been <i>gvim</i>. Straight, powerful, extendable and multi-platform. Also when working on remote machines via ssh the <i>vim</i> is a great partner. I've also tried <i>emacs</i> for some time and have been impressed by its power. But I stuck too deep into <i>vim</i>, so I never switched.<br/><br/>Now the situation changed. It started with the announcement of <a href="http://www.sublimetext.com/blog/articles/sublime-text-2-build-2165" target="_blank">Sublime Text 2 Build 2165</a>. Based on the good user resonance I gave it a try. It's available for my two operating systems <i>Linux</i> and <i>OS X</i> as well as for <i>Windows</i>, that's an important fact. I've been impressed immediately. The usage is exactly like expected, the feature list is long, all my languages a supported very well and there are many ways to extend and customized the system.<br/><br/><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-8L533AJLbGc/T0ymRwV6bnI/AAAAAAAAEjM/MRxU6pvTwWA/s1600/SublimeText2.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="504" src="http://3.bp.blogspot.com/-8L533AJLbGc/T0ymRwV6bnI/AAAAAAAAEjM/MRxU6pvTwWA/s640/SublimeText2.png" width="640"/></a></div><br/>What I like most are the high level view on the content and the very good code completion. The later not only narrows the choices based on your written text from left to right. It analyzes all tokens the way the <span style="font-family: 'Courier New', Courier, monospace;">panicFailFunc()</span> mentioned in the screenshot above may be found by entering <span style="font-family: 'Courier New', Courier, monospace;">pff</span> or even <span style="font-family: 'Courier New', Courier, monospace;">pfc</span>. Together with the language depending intelligent code snippets which are part of the code completion too it makes you really fast.<br/><br/>So for my Go code I'm writing <span style="font-family: 'Courier New', Courier, monospace;">tf</span> which almost always leads directly to the <i>tfunc</i> snippet. Now a tab and the body of a type based function (aka method) is printed. The cursor is right in the type brackets. I'm typing <span style="font-family: 'Courier New', Courier, monospace;">m *mft</span> and tab again which is expanded to <span style="font-family: 'Courier New', Courier, monospace;">m *MyFantasticType</span>. Now the cursor is right where I've got to add the function name, after that where to put the argument, then the result and then right indented inside the function body. And here I can use other snippets as well as the intelligent code completion again. That's fun.<br/><br/>Also the navigation in the code is great. Cursor movement like expected doesn't wonder. But jumping word by word in an identifier like <span style="font-family: 'Courier New', Courier, monospace;">myLongFunctionNameExample() </span>is great. Or jumping to a line (nothing new), jumping to a symbol (with the same way of code recognition like when coding) or just to any file in the current project (yes, it also has a project management). Also the highlighting of other occurrences of the selected text, multi-select, the Vintage mode for <i>vim</i> fans, powerful find and replace, and, and, and ...<br/><br/>But what do you do in case of missing parts? Here <i>Sublime Text 2</i> is very configurable, so that the integration of new tools and programming languages is simple. Additionally you can record macros or extend the system using <i>Python</i>. Additionally there are many packages, most of them can be installed easily by <a href="http://wbond.net/sublime_packages/package_control" target="_blank">Sublime Package Control</a>. I used it so far to install <a href="https://github.com/SublimeText/SublimeHg" target="_blank">SublimeHg</a> for an easy access to <i>Mercurial</i> and <a href="https://github.com/wuub/SublimeREPL" target="_blank">SublimeREPL</a> for different REPL environments - in my case <i>LISP</i> and the shell.<br/><br/>I haven't yet discovered everything, but I've been able to use it fluently with a remarkable speed-up from day 1. So I switched and use it now on Linux and Mac.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-2471679847867564225?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-02-28T11:18:01Z</updated>
    <published>2012-02-28T11:18:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="editor"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="sublimetext"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-1141734908360556643</id>
    <link href="http://mue.tideland.biz/feeds/1141734908360556643/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/new-article-about-redis.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/1141734908360556643" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/1141734908360556643" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/new-article-about-redis.html" rel="alternate" type="text/html"/>
    <title>New article about Redis</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Tomorrow it will be available at the shops, I've got my copy already today like the other subscribers too: the new (German) <a href="http://www.heise.de/ix/" target="_blank">iX magazine</a> 3/2012. This time it contains my newest article about the great NoSQL database <a href="http://redis.io/" target="_blank">Redis</a>. Its fantastic mix of performance and powerful data types and commands makes it my choice for my current <i>Tideland</i> project.<br/><br/>For those who need a Go client for Redis take a look at <a href="http://code.google.com/p/tcgl/">http://code.google.com/p/tcgl/</a>.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-1141734908360556643?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-02-27T15:19:43Z</updated>
    <published>2012-02-27T12:47:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="redis"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="article"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="golang"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6368548039472655543.post-1862502399071774359</id>
    <link href="http://mue.tideland.biz/feeds/1862502399071774359/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/so-re-started-this-blog.html#comment-form" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/1862502399071774359" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default/1862502399071774359" rel="self" type="application/atom+xml"/>
    <link href="http://mue.tideland.biz/2012/02/so-re-started-this-blog.html" rel="alternate" type="text/html"/>
    <title>Restart of this blog</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">So, re-started this blog. It is now hosted at <i>blogger.com</i> and focussed on software development. Privat topics are handled at <a href="http://frank.mweb.de/">frank.mweb.de</a>. But that blog is in German. The first topics are in the pipe, so stay tuned.<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6368548039472655543-1862502399071774359?l=mue.tideland.biz" width="1"/></div></div>
    </content>
    <updated>2012-02-26T19:41:58Z</updated>
    <published>2012-02-26T19:39:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="blogging"/>
    <author>
      <name>Frank Müller</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6368548039472655543</id>
      <category term="alias"/>
      <category term="meta"/>
      <category term="editor"/>
      <category term="supervisor"/>
      <category term="erlang"/>
      <category term="gosublime"/>
      <category term="talk"/>
      <category term="cgl"/>
      <category term="redis"/>
      <category term="cells"/>
      <category term="parallelism"/>
      <category term="import"/>
      <category term="asserts"/>
      <category term="article"/>
      <category term="monitoring"/>
      <category term="eda"/>
      <category term="blogging"/>
      <category term="golang"/>
      <category term="concurrency"/>
      <category term="sublimetext"/>
      <category term="config"/>
      <category term="repository"/>
      <author>
        <name>Frank Müller</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://mue.tideland.biz/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6368548039472655543/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://mue.tideland.biz/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>the best way to predict the future is to invent it - alan kay</subtitle>
      <title>embrace change</title>
      <updated>2012-10-02T20:44:23Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-8817036019902827478</id>
    <link href="http://reneefrench.blogspot.com/feeds/8817036019902827478/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=8817036019902827478" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8817036019902827478" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8817036019902827478" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/02/blog-post_25.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-YJ42w0yXSQo/T0mPpZxS49I/AAAAAAAAEoA/71E3rL7q9gE/s1600/tiarad.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5713255543751238610" src="http://3.bp.blogspot.com/-YJ42w0yXSQo/T0mPpZxS49I/AAAAAAAAEoA/71E3rL7q9gE/s320/tiarad.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 250px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-8817036019902827478?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-02-26T01:49:38Z</updated>
    <published>2012-02-26T01:49:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-08-02T06:35:39Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-8705129710378953802</id>
    <link href="http://reneefrench.blogspot.com/feeds/8705129710378953802/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=8705129710378953802" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8705129710378953802" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8705129710378953802" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/02/blog-post_12.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://2.bp.blogspot.com/-Bnu4r9-9ElM/Tzi8ZSrCGXI/AAAAAAAAEmk/8ssF-oZ_LS4/s1600/portrait628.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5708519670387186034" src="http://2.bp.blogspot.com/-Bnu4r9-9ElM/Tzi8ZSrCGXI/AAAAAAAAEmk/8ssF-oZ_LS4/s320/portrait628.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 251px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-8705129710378953802?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-02-13T07:32:02Z</updated>
    <published>2012-02-13T07:29:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-08-01T07:10:55Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/02/12/rsaconf</id>
    <link href="http://www.imperialviolet.org/2012/02/12/rsaconf.html" rel="alternate" type="text/html"/>
    <title>RSA 2012</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Just a brief note that I'll be at RSA 2012 in San Francisco at the end of the month and will be speaking with several others about certificate revocation. (<tt>tech-106</tt>, Tuesday, 1pm.).</p>

<p>If you want to chat and don't manage to grab me then, drop me an email. (<tt>agl</tt> at <tt>imperialviolet.org</tt> if you didn't already know.)</p></div>
    </content>
    <updated>2012-02-12T08:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-10-08T21:18:10Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://www.miek.nl/blog/archives/2012/02/11/godns_is_now_dns/index.html</id>
    <link href="http://www.miek.nl/blog/archives/2012/02/11/godns_is_now_dns/index.html" rel="alternate" type="text/html"/>
    <title>godns is now dns</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Due to the new <code>go</code> tool (long story), I've renamed <code>godns</code> to <code>dns</code>. 
This means the <a href="https://github.com/miekg/dns">github repo is also somewhere else</a>.</p>

<p><code>godns</code> installed itself as <code>dns</code> so code using it does <em>not</em> need to be changed.</p></div>
    </summary>
    <updated>2012-02-11T21:09:30Z</updated>
    <category term="go, dns(sec)"/>
    <author>
      <name>Miek Gieben</name>
    </author>
    <source>
      <id>http://www.miek.nl/blog</id>
      <author>
        <name>Miek Gieben</name>
      </author>
      <link href="http://www.miek.nl/blog/archives/go/index-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.miek.nl/blog" rel="alternate" type="text/html"/>
      <subtitle>Thoughts on (technical) stuff</subtitle>
      <title>Filed under: go | Miek</title>
      <updated>2012-09-17T18:42:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-14915826.post-1726541299931924385</id>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/1726541299931924385" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/1726541299931924385" rel="self" type="application/atom+xml"/>
    <link href="http://going-along.blogspot.com/2011/05/google-app-engine-with-go-1.html" rel="alternate" type="text/html"/>
    <title>Google App Engine with Go [1]</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Google 的 App Engine 简称 GAE, 那我们的就叫 GAE Go, 读作"给够".<br/>
<br/>
众所周知, GAE 就是谷歌"云运算"的那个"云". 为什么叫"云"? 传统的说法是互联网的模型画在纸上画不出来, 就随便圈几笔代表抽象的远端共享的意思, 据说又是继承了20世纪初老平电话系统的伟大光荣正确的优良传统. 而另一个貌似科学的说法, 是说云就是天上的水啊, 是湖里海里的水蒸腾上去, 再化成甘露滋润大地. 这番云雨过程, 是我们这些刚刚开始摆脱稍微软些的硬体束缚的 flower children 所热切渴望的. 我之所以要云雨呀的, 是想让程序员告诉另一半, 我们所从的业, 不总是干巴巴的, 有时也可以很湿润.<br/>
<br/>
言归正传. GAE 开发者把 python 或 Java 的代码传上去, 申请一个 URL 指向它, 就可以用浏览器运行那些代码提供的服务了. 现在, 或说, 马上, 我们也可以在云端运行 Go 的云代码了.<br/>
<br/>
开始写云代码的第一步, 当然是下载一个<a href="http://code.google.com/appengine/downloads.html">软件开发包</a>. 没有 Linux 或 OSX 的窗口们, 还要再等等, 或者如前篇所示, 先 coLinux 着.<br/>
<br/>
展开压缩包, 用 console 进入目录, 遵照传统仪式执行我们的第一个打招呼程式.<br/>
<br/>
./dev_appserver.py demos/go-helloworld<br/>
<br/>
GAE一直坚持使用Python 2.5, 所以可能会有个提醒说你的Python太新了会出问题. 现在还不会, 所以, 如果出了错, 可能是你拼写错了, 找不到 go-helloworld.<br/>
<br/>
如果一切 ok, 它会说到 http://localhost:8080 看结果. 那我们就要用浏览器了. 记住这是云运算, 接收雨露要打开世界之窗, 把自己闭锁在再伟大的长墙里, 也造不出好车, 只能自己慢慢臭掉, 要死了也没人知道.<br/>
<br/>
作为程序员, 我们不能只满足弄出个活就完了. 我们要有强烈的求知欲和审美观, 要揭开表面看内涵, 要学着鉴别那些僵化的, 冗长的, 低效的, 缺乏监督的东西, 是用再多钱也美化不了的丑, 再强权也遮掩不住的陋. 同时, 要欣赏那种灵活的, 简洁的, 能极速运行又有 compiler 滴水不漏纪律检查的体制设计, 所能带给我们的实实在在的安全和舒适.<br/>
<br/>
又是口水一滩. 再次回到正题, 我们逐行审视这个招呼程式:<br/>
<br/>
package counter             <br/>
<br/>
应该是个笔误, 叫 package helloworld 比较准确, 但其实只要不叫 main, 又没和其他用到的 package 重名, 叫什么都无所谓. main 比较特殊, 它是每个 Go 程式的入口, 此处由 GAE 提供. 我们程式的入口, 是 init.<br/>
<br/>
import(<br/>
    "fmt"<br/>
    "http"<br/>
)<br/>
<br/>
引入 package fmt 和 http 这两个 Go 的标准包, 以便使用其提供的 format 和 http 功能.<br/>
<br/>
func init(){<br/>
   http.HandleFunc("/", handle)<br/>
}<br/>
<br/>
我们程序的入口, 注册 URL 根路径的访问由 handle 处理.<br/>
<br/>
func handle(w http.ResponseWriter, r *http.Request) {<br/>
    w.Header().Set("Content-Type", "text/plain; charset=utf-8")<br/>
    fmt.Fprint(w, "Hello, World!\n")<br/>
}<br/>
<br/>
我们的 handle 中, 浏览器的访问请求由 r 指向, 回应写入 w 缓冲区, 在 handle 返回时, 交由 GAE 传送给浏览器.<br/>
<br/>
为了让 GAE 能正确找到我们的程序, 在 go-helloworld 目录下要准备一个叫 app.yaml 的配置文件, 主要内容为:<br/>
<br/>
runtime: go<br/>
<br/>
指定 GAE 运行的不是什么 Python 或 Java 模块, 而是我们亲爱的 Go.<br/>
<br/>
handlers:<br/>
- url: /.*<br/>
  script: _go_app<br/>
<br/>
告诉 GAE 把 / 下所有路径都交由 _go_app 处理. 小心不要拼错, 否则会莫明其妙的一堆 Python 错误, 害我浪费3个小时, 试图搞明白 Python 到底想告诉我什么. 其实也搞不明白, 因为它压根儿没提是我用 vi 的时候, 不小心在 _go_app 后面, 留下一个 d.<br/>
<br/>
这个 _go_app 出现在 google/appengine/ext/go/ 的 __init__.py 里, 它是架通 _dev_appserver.py 和我们 Go 程序的桥梁.  当浏览器指向我们的 URL 的时候, _dev_appserver 会编译我们的 Go 程序, 并存放在 /tmp 下新创建一个的目录. 不出所料, 文件名就叫 _go_app, 是个货真价实的可执行文件, 而不像 Python 和 Java 那样要委身虚假机. 文件很大, 2.8兆个字节, 所有用到的库和运行环境全部打包独立自主, 不存在外部依赖, SAC? Stand-Alone Complex, 每个 _go_app 都是孤胆特种兵.<br/>
<br/>
/tmp 下还有两个文件用来通信, 有兴趣就自己看看<a href="http://code.google.com/p/appengine-go/source/checkout">源代码</a>, Open Source 在行政主管头里只是另一个主义, 在我们程序员眼里, 是破除封建迷信, 重拾科学民主精神的身体力行的源动力. <br/>
<br/>
本来要就此收笔, 可 blogger 维修下线了, 就多唠叨两句, 也算是发个呼吁: "咱们搞语言的人, 可别荒废了母语, 大家多认真写写, 即整理思路, 总结经验, 也给别人个参考. 利己利人, 共同进步."<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/14915826-1726541299931924385?l=going-along.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-02-09T04:26:37Z</updated>
    <published>2011-05-13T23:52:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Go"/>
    <author>
      <name>Fango</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-14915826</id>
      <category term="MCU"/>
      <category term="D'sign"/>
      <category term="Go"/>
      <category term="yi"/>
      <category term="C"/>
      <category term="OS"/>
      <author>
        <name>Fango</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://going-along.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/14915826/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://going-along.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">#! contact | sed s@Fango@\ <i>fanhoward@g</i> | <i>mail</i> #!<i>.com</i> <br/>
#! fortune <br/>
  I'm a proud Go <a href="http://groups.google.com/group/golang-dev/browse_thread/thread/66d3092f4da31718">contributor </a>today. Wow.</div>
      </subtitle>
      <title>Going Along</title>
      <updated>2012-02-28T02:52:54Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-14915826.post-7359456623346660082</id>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/7359456623346660082" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/7359456623346660082" rel="self" type="application/atom+xml"/>
    <link href="http://going-along.blogspot.com/2011/05/google-app-engine-with-go-2.html" rel="alternate" type="text/html"/>
    <title>Google App Engine with Go [2]</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">上篇我们和"给够"打了招呼. 一回生, 二回熟, 这次我们再看一个 SDK 的 demo, 主要针对对'给够'感兴趣, 还没接触 Go 的, 但有 C/C++, Java/Javascript 等 C 类语言基础的同学, 能对 Go 大体有个了解, 进而激发深入的情趣. 其实, Go 很简单, 简单到一夜 html 就能把最真实的全部, 完整细致的<a href="http://golang.org/doc/go_spec.html">规范</a>出来. <br/>
<br/>
上篇 go-helloworld 的 package 叫 counter, 可能是此处 go-counter 的笔误:<br/>
<br/>
package counter<br/>
<br/>
import (<br/>
    "fmt"<br/>
    "http"<br/>
    "io"<br/>
    "os"<br/>
    "strconv"<br/>
<br/>
    "appengine"<br/>
    "appengine/memcache"<br/>
)<br/>
<br/>
我们看到 Go 要求列出所有引用的包, 哪怕, 比如, 如果你查找 os, 只有一处提到 os, 是 os.Error, 是 Go 中习惯使用的错误处理类型. 所谓"习惯", idiom, 在 Go 中有很大的分量. Go 的标准库是 open source 的, 是鼓励大家去学习, 去体会, 去习惯 Go 语言的各种使用方法的. 如果大家都默契的使用同一种约定俗成的 idiomatic use, 便可以更容易的架构和维护很大的项目.<br/>
<br/>
<br/>
func serveError(c appengine.Context, w http.ResponseWriter, err os.Error) {<br/>
    w.WriteHeader(http.StatusInternalServerError)<br/>
    w.Header().Set("Content-Type", "text/plain")<br/>
    io.WriteString(w, "Internal Server Error")<br/>
    c.Logf("%v", err)<br/>
}<br/>
<div>
<br/></div>
<div>
和 C 类的其它语言不同, Go 的变量类型放在名后, 例如 err 是 os.Error 类型. 目的是<a href="http://blog.golang.org/2010/07/gos-declaration-syntax.html">使复杂的类型更容易理解</a>. 函数由 func 定义, 此处的 serveError 函数, 使用 w 提供的函数, 和 io 包的函数, 在 http 缓冲区写入标准的出错返回. 同时, c, 作为 appengine 的 Context 类型, 提供一个 Logf 函数, 类似 printf, 打印记录 err. </div>
<div>
<br/></div>
<div>
w 提供 http 回应缓存界面. 界面 - interface, 是 Go 的一个发明, 规定其类型必须实现此界面定义的那些函数. 例如, ResponseWriter 界面类型, 就定义了 Header, Write 和 WriteHeader 三个函数. </div>
<div>
<br/></div>
<div>
<div>
func handle(w http.ResponseWriter, r *http.Request) {</div>
<div>
<br/></div>
<div>
"给够"的 URL 服务函数, r 指针指向 http 请求. Go 和 C 一样,  使用 &amp; 取内存地址,  使用 * 作为内存地址指针, 但没有指针操作, 即不存在 *p++ 这种用法. 目的是把程序员从内存管理中解放出来, 交由 GC 处理, 同时, 也允许, 并鼓励程序员明确的使用内存, 从而在安全方便和时空效率两方便取得平衡. 多说几句, 在 Go 之前, 我挣扎着用过 Erlang, 其不可思议的 OTP (one time programmable) 变量, 据说从根本上避免 race condition, 但大量 GC 之低效, 大量无中生有的创造新变量名, 加上其古怪的模式匹配和 tail recursion, 让我如同被钓起的鱼, 窒息中体味针扎般死亡的恐惧. </div>
<div>
<br/></div>
<div>
    c := appengine.NewContext(r)</div>
<div>
    n := 0</div>
<div>
    item, err := memcache.Get(c, r.URL.Path)</div>
<div>
<br/></div>
<div>
Go 的赋值和变量类型声明可以放在一起, 由 := 完成, 编译器会从赋值推导出对应变量的类型. 例如, c 是 App Engine 的(新的)上下文类型. n 是整数型, 其值为0. item 和 err 同时得到 Get 返回值, 及其类型. 多重赋值也是 Go 的一个新颖之处, 例如 a, b = b, a 可交换 a 和 b 的值.</div>
<div>
<br/></div>
<div>
    if err == memcache.ErrCacheMiss { </div>
<div>
    <span class="Apple-tab-span" style="white-space: pre;"> </span>// Not found, new item<span class="Apple-tab-span" style="white-space: pre;"> </span> </div>
<div>
    } else if err != nil { </div>
<div>
    <span class="Apple-tab-span" style="white-space: pre;"> </span>//  Error</div>
<div>
        serveError(c, w, err)</div>
<div>
        return</div>
<div>
    } else { </div>
<div>
    <span class="Apple-tab-span" style="white-space: pre;"> </span>// Got</div>
<div>
    <span class="Apple-tab-span" style="white-space: pre;"> </span>n, err = strconv.Atoi(string(item.Value))</div>
<div>
    <span class="Apple-tab-span" style="white-space: pre;"> </span>if err != nil {</div>
<div>
    <span class="Apple-tab-span" style="white-space: pre;">  </span>serveError(c, w, err)</div>
<div>
    <span class="Apple-tab-span" style="white-space: pre;">  </span>return</div>
<div>
    <span class="Apple-tab-span" style="white-space: pre;"> </span>}</div>
<div>
    } </div>
<div>
<br/></div>
<div>
此处我故意对原文做了修改, 以突出三种可能的 err 及其分支处理. 这又是一个习惯, 明确全部逻辑分支, 并尽早出错返回. </div>
<div>
        </div>
<div>
    n++</div>
<div>
    item = &amp;memcache.Item{</div>
<div>
        Key:   r.URL.Path,</div>
<div>
        Value: []byte(strconv.Itoa(n)),</div>
<div>
    }</div>
<div>
<br/></div>
<div>
Item 是 memcache 包里定义的一个 struct, 除了 Key 和 Value 在此处赋值之外, 还有 Object, Flags 和 Expiration 三个项, 没有在 {} 里赋值, 所以都默认为 0. {} 这种赋值格式称为 literal, &amp; 取地址, 以符合下面 Set 指针 item 的要求.</div>
<div>
<br/></div>
<div>
    err = memcache.Set(c, item)</div>
<div>
    if err != nil {</div>
<div>
        serveError(c, w, err)</div>
<div>
        return</div>
<div>
    }</div>
<div>
<br/></div>
<div>
    w.Header().Set("Content-Type", "text/plain")</div>
<div>
    fmt.Fprintf(w, "%q has been visited %d times", r.URL.Path, n)</div>
<div>
}</div>
</div>
<div>
<br/></div>
<div>
如果有错, 交由 serveError 返回标准出错信息. 否则, 如果 Get 没有找到对应的 URL, n 是 0. 然后访问次数加一, Set 回 memchache 的对应 URL 项, 由 http (即 w) 完成显示.</div>
<div>
<br/></div>
<div>
新上手的同学, 可以到 golang.org 查看大量的文档. 中文部分, 可以参考 golang-china.org, 以及笔者翻译的<a href="http://ac-me.googlecode.com/files/fango.pdf">入门指导, 效率手册和部分的语言规范</a>. 还有一个出于好玩写的 <a href="http://ac-me.googlecode.com/files/going_v1.pdf">Go 编程小说</a>, 可以无聊时读读.  </div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/14915826-7359456623346660082?l=going-along.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-02-09T04:26:27Z</updated>
    <published>2011-05-15T14:53:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Go"/>
    <author>
      <name>Fango</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-14915826</id>
      <category term="MCU"/>
      <category term="D'sign"/>
      <category term="Go"/>
      <category term="yi"/>
      <category term="C"/>
      <category term="OS"/>
      <author>
        <name>Fango</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://going-along.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/14915826/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://going-along.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">#! contact | sed s@Fango@\ <i>fanhoward@g</i> | <i>mail</i> #!<i>.com</i> <br/>
#! fortune <br/>
  I'm a proud Go <a href="http://groups.google.com/group/golang-dev/browse_thread/thread/66d3092f4da31718">contributor </a>today. Wow.</div>
      </subtitle>
      <title>Going Along</title>
      <updated>2012-02-28T02:52:54Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-14915826.post-1489053855148725911</id>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/1489053855148725911" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/14915826/posts/default/1489053855148725911" rel="self" type="application/atom+xml"/>
    <link href="http://going-along.blogspot.com/2011/05/google-app-engine-with-go-3.html" rel="alternate" type="text/html"/>
    <title>Google App Engine with Go [3]</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">'给够'三部曲: "一顾钟情", "再顾倾城", 现在我们来"三顾", 请高人出世.<br/>
<br/>
我们温习一下 Andrew 和 Rob 在 <a href="http://www.youtube.com/watch?v=-i0hat7pdpk">Google IO</a> 演示的 moustach-io 的 http.go, 以此了解一个貌似实用的 App Engine 程序, 是怎样使用 Go 的高级知识的. 当然, 我们还是用 dev_appserver 来冒充真正的云运算.<br/>
<br/>
import (<br/>
    "bytes"<br/>
    "fmt"<br/>
    "http"<br/>
    "image"<br/>
    "image/jpeg"<br/>
    _ "image/png" // import so we can read PNG files.<br/>
<div>
<br/></div>
此例中的图像压缩使用 JPEG 的函数, 所以引入 image/jpeg 包. image.Decode 图像解压(读取)也可以使用 PNG 格式. 但由于 Go 不允许引入没用到其函数的包, 例如, 此程序没有 png 的函数. 所以, 用 _ 空白标识符来引入 image/png 包, 目的是为了使用其 init 函数注册 decode 用的 PNG 格式.<br/>
<br/>
<span class="Apple-tab-span" style="white-space: pre;"> </span>    "io"<br/>
    "json"<br/>
    "os"<br/>
    "strconv"<br/>
    "template"<br/>
    "goauth2.googlecode.com/hg/oauth"<br/>
)<br/>
<div>
<br/></div>
goauth2 和 freetype (在 draw.go中 ) 是独立于'给够' SDK 外的第三方的库, 参考 README 用 hg clone 安装, 以便能编译到 _go_app 可执行代码中.<br/>
<br/>
import (<br/>
    "appengine"<br/>
    "appengine/datastore"<br/>
    "appengine/urlfetch"<br/>
    "crypto/sha1"<br/>
    "resize"<br/>
)<br/>
<br/>
const (<br/>
    CLIENT_ID     = "Your Client ID here."<br/>
    CLIENT_SECRET = "Your Client Secret here."<br/>
)<br/>
<div>
<br/></div>
var (<br/>
    uploadTemplate = template.MustParseFile("upload.html", nil)<br/>
    editTemplate   *template.Template // set up in init()<br/>
    postTemplate   = template.MustParseFile("post.html", nil)<br/>
    errorTemplate  = template.MustParseFile("error.html", nil)<br/>
)<br/>
<div>
<br/></div>
<div>
常量 const 和变量 var 声明也可以使用类似 import 的格式, 并可多次出现. </div>
<div>
template 是 Go 的一个标准包, 匹配文件或字串中定义的模式变量, 用真正变量的值替换. </div>
<div>
<br/></div>
<div>
<div>
func init() {<br/>
    http.HandleFunc("/", errorHandler(upload))<br/>
    http.HandleFunc("/edit", errorHandler(edit))<br/>
    http.HandleFunc("/img", errorHandler(img))<br/>
    http.HandleFunc("/share", errorHandler(share))<br/>
    http.HandleFunc("/post", errorHandler(post))<br/>
    editTemplate = template.New(nil)<br/>
    editTemplate.SetDelims("{{{", "}}}")<br/>
    if err := editTemplate.ParseFile("edit.html"); err != nil {<br/>
        panic("can't parse edit.html: " + err.String())<br/>
    }<br/>
}<br/>
<div>
<br/></div>
</div>
</div>
<div>
我们程序的入口, 注册 URL 路径的处理函数, 模式变量的分隔符设定为三个{}, 因为默认的{}和 Javascript 起冲突. errorHandler 很有趣, 我们先来和 check 一起看一下.<br/>
<br/>
func errorHandler(fn http.HandlerFunc) http.HandlerFunc {<br/>
    return func(w http.ResponseWriter, r *http.Request) {<br/>
        defer func() {<br/>
            if err, ok := recover().(os.Error); ok {<br/>
                w.WriteHeader(http.StatusInternalServerError)<br/>
                errorTemplate.Execute(w, err)<br/>
            }<br/>
        }()<br/>
        fn(w, r)<br/>
    }<br/>
}<br/>
<br/>
// check aborts the current execution if err is non-nil.<br/>
func check(err os.Error) {<br/>
    if err != nil {<br/>
        panic(err)<br/>
    }<br/>
}<br/>
<br/>
<a href="http://golang.org/doc/go_spec.html#Handling_panics">panic, defer 和 recover</a> 是 Go 的崭新的异常处理方式. 可以这样看: 当 check 的 err 非空时, panic, 导致 check 及其调用栈的所有函数 (例如 upload 和 errorHandler) 立即退出. 但 errorHandler 定义了 defer, 会在退出前执行, 而其定义了 recover, 会拿到 panic 的变量, 即 err, 使用 <a href="http://golang.org/doc/go_spec.html#Type_assertions">type assertion</a> 肯定它是 os.Error 类型, 并结束 panic 导致的退出, 从而在此处完成 panic 引起的异常, 用 errorTemplate 的模版在浏览器显示出错信息. 如果没有 panic, 或 panic 传入的不是 os.Error 类型, defer 没有动作.<br/>
<br/>
另外, 注意到没有? errorHandler 接受一个函数, 包装 defer 后, 返回一个无名函数. Go 的函数可以像普通变量一样使用, 还可以使用 closure, 等一下会看到.<br/>
<br/>
type Image struct {<br/>
    Data []byte<br/>
}<br/>
<div>
<br/></div>
<div>
定义 Image 结构, 其 Data 项是 byte slice, 字节切片, 能方便安全的完成类似 C 的指针操作, 因为, slice 其实就是个指针指向某块内存, 但同时记录目前的长度 len, 供读写, 还有容量 cap, 供编译器地址越界检查. </div>
<br/>
func upload(w http.ResponseWriter, r *http.Request) {<br/>
    if r.Method != "POST" {<br/>
        // No upload; show the upload form.<br/>
        uploadTemplate.Execute(w, nil)<br/>
        return<br/>
    }<br/>
<br/>
    f, _, err := r.FormFile("image")<br/>
    check(err)<br/>
    defer f.Close()<br/>
<div>
<br/></div>
<div>
defer 是在函数 (upload) 退出时执行的, 紧跟着打开文件写, 以防忘记关闭. 并且每个 err 都用 check 异常处理. </div>
<div>
<br/></div>
<div>
<div>
    var buf bytes.Buffer</div>
<div>
    io.Copy(&amp;buf, f)</div>
<div>
    i, _, err := image.Decode(&amp;buf)</div>
<div>
    check(err)</div>
</div>
<div>
<br/></div>
<div>
bytes.Buffer 能自动管理字节内存, io.Copy 可以最高效的从文件 f 拷贝内存到 buf 的地址. image.Decode 能分析图像格式, 并自动用 jpeg 或 png 包的 Decode 函数解压. </div>
<div>
<br/></div>
<div>
<div>
    const max = 1200</div>
<div>
    if b := i.Bounds(); b.Dx() &gt; max || b.Dy() &gt; max {</div>
</div>
<div>
<br/></div>
<div>
if 语句可以有初始赋值子句. 此处的变量 b 只在 if 后的 {} 块里有效, 即其作用域由 {} 限定.</div>
<div>
<br/></div>
<div>
<div>
        if b.Dx() &gt; 2*max || b.Dy() &gt; 2*max {</div>
<div>
            w, h := max, max</div>
<div>
            if b.Dx() &gt; b.Dy() {</div>
<div>
                h = b.Dy() * h / b.Dx()</div>
<div>
            } else {</div>
<div>
                w = b.Dx() * w / b.Dy()</div>
<div>
            }</div>
<div>
            i = resize.Resample(i, i.Bounds(), w, h)</div>
<div>
            b = i.Bounds()</div>
<div>
        }</div>
<div>
        w, h := max/2, max/2</div>
<div>
        if b.Dx() &gt; b.Dy() {</div>
<div>
            h = b.Dy() * h / b.Dx()</div>
<div>
        } else {</div>
<div>
            w = b.Dx() * w / b.Dy()</div>
<div>
        }</div>
<div>
        i = resize.Resize(i, i.Bounds(), w, h)</div>
<div>
    }</div>
</div>
<div>
<br/></div>
<div>
由于变量的局部作用域, 变量名可以很短, 而不用担心会和作用域外的同名变量起冲突.</div>
<div>
<br/></div>
<div>
<div>
    // Encode as a new JPEG image.</div>
<div>
    buf.Reset()</div>
<div>
    err = jpeg.Encode(&amp;buf, i, nil)</div>
<div>
    check(err)</div>
<div>
<br/></div>
<div>
    // Create an App Engine context for the client's request.</div>
<div>
    c := appengine.NewContext(r)</div>
<div>
<br/></div>
<div>
    // Save the image under a unique key, a hash of the image.</div>
<div>
    key := datastore.NewKey("Image", keyOf(buf.Bytes()), 0, nil)</div>
<div>
    _, err = datastore.Put(c, key, &amp;Image{buf.Bytes()})</div>
<div>
    check(err)</div>
<div>
<br/></div>
<div>
    // Redirect to /edit using the key.</div>
<div>
    http.Redirect(w, r, "/edit?id="+key.StringID(), http.StatusFound)</div>
<div>
}</div>
</div>
<div>
<br/></div>
<div>
用 r 的 FromFile 从浏览器上传的图像, 解压检查, 重新采样改变大小, 再压缩回 JPEG 格式, 放入 App Engine 的 datastore, 再让浏览器重定向到 edit 编辑页面, 添加大胡子. </div>
<br/></div>
<div>
func edit(w http.ResponseWriter, r *http.Request) {<br/>
    editTemplate.Execute(w, r.FormValue("id"))<br/>
}<br/>
<div>
<br/></div>
<div>
由 init() 中指定处理 URL /edit 的请求, 简单的执行对应的模版. </div>
<div>
<br/></div>
<div>
<div>
func keyOf(data []byte) string {</div>
<div>
    sha := sha1.New()</div>
<div>
    sha.Write(data)</div>
<div>
    return fmt.Sprintf("%x", string(sha.Sum())[0:8])</div>
<div>
}</div>
</div>
<div>
<br/></div>
<div>
由 sha1 得到对应数据的唯一指纹, 注意看其 API 是多么的简单, 一写一读即告完成. </div>
<div>
<br/></div>
<div>
<div>
func img(w http.ResponseWriter, r *http.Request) {</div>
<div>
    c := appengine.NewContext(r)</div>
<div>
    key := datastore.NewKey("Image", r.FormValue("id"), 0, nil)</div>
<div>
    im := new(Image)</div>
<div>
    err := datastore.Get(c, key, im)</div>
<div>
    check(err)</div>
<div>
<br/></div>
<div>
    m, _, err := image.Decode(bytes.NewBuffer(im.Data))</div>
<div>
    check(err)</div>
<div>
<br/></div>
<div>
    get := func(n string) int { // helper closure</div>
<div>
        i, _ := strconv.Atoi(r.FormValue(n))</div>
<div>
        return i</div>
<div>
    }</div>
<div>
    x, y, s, d := get("x"), get("y"), get("s"), get("d")</div>
<div>
<br/></div>
<div>
这里用到了 closure. get 是只限此处使用的函数, 其内部的 r 从外包的函数传入 (闭包), n 和 i 是正常的参数和返回值. </div>
<div>
<br/></div>
<div>
    if x &gt; 0 { // only draw if coordinates provided</div>
<div>
        m = moustache(m, x, y, s, d)</div>
<div>
    }</div>
<div>
<br/></div>
<div>
moustache 在 draw.go 中定义, 也使用 package moustachio, 编译器会把他们一起编译. </div>
<div>
<br/></div>
<div>
    w.Header().Set("Content-type", "image/jpeg")</div>
<div>
    jpeg.Encode(w, m, nil)</div>
<div>
}</div>
</div>
<div>
<br/></div>
<div>
如此简单的把 jpeg 图像传回浏览器. </div>
<div>
<br/></div>
<div>
<div>
func share(w http.ResponseWriter, r *http.Request) {</div>
<div>
    url := config(r.Host).AuthCodeURL(r.URL.RawQuery)</div>
<div>
    http.Redirect(w, r, url, http.StatusFound)</div>
<div>
}</div>
</div>
<div>
<br/></div>
<div>
使用 OAuth 签证用户, 在 dev_appserver 不可用, 和其后的 post 及 postPhoto 一起, 此处就不深入了 . </div>
<div>
<br/></div>
<div>
这样, 我们分三步学习了 Go 在 Google App Engine 的使用. 读过的会忘记, 写过的会留下些什么, 但只有做过错过改过的才会刻骨铭心. 为了大家不错过这个推广 Go 的好时机, 特作此文, 希望大家多多推介, 让笔者最钟爱的编程语言, 能迅速的普及开. 谢谢.<br/>
<br/>
<br/></div>
<div>
<br/></div>
</div>
<div>
<br/></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/14915826-1489053855148725911?l=going-along.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-02-09T04:25:52Z</updated>
    <published>2011-05-16T03:28:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Go"/>
    <author>
      <name>Fango</name>
      <email>noreply@blogger.com</email>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-14915826</id>
      <category term="MCU"/>
      <category term="D'sign"/>
      <category term="Go"/>
      <category term="yi"/>
      <category term="C"/>
      <category term="OS"/>
      <author>
        <name>Fango</name>
        <email>noreply@blogger.com</email>
      </author>
      <link href="http://going-along.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/14915826/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://going-along.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">#! contact | sed s@Fango@\ <i>fanhoward@g</i> | <i>mail</i> #!<i>.com</i> <br/>
#! fortune <br/>
  I'm a proud Go <a href="http://groups.google.com/group/golang-dev/browse_thread/thread/66d3092f4da31718">contributor </a>today. Wow.</div>
      </subtitle>
      <title>Going Along</title>
      <updated>2012-02-28T02:52:54Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-8928209137365247961</id>
    <link href="http://reneefrench.blogspot.com/feeds/8928209137365247961/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=8928209137365247961" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8928209137365247961" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8928209137365247961" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/02/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://1.bp.blogspot.com/-BMyR2Tnu7qM/TzI9WjWi6SI/AAAAAAAAEmM/PMn38R1APwM/s1600/mangosteen.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5706691135488059682" src="http://1.bp.blogspot.com/-BMyR2Tnu7qM/TzI9WjWi6SI/AAAAAAAAEmM/PMn38R1APwM/s320/mangosteen.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 273px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-8928209137365247961?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-02-08T09:16:32Z</updated>
    <published>2012-02-08T09:15:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-07-29T06:56:54Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:research.swtch.com,2012:research.swtch.com/goblog</id>
    <link href="http://research.swtch.com/goblog" rel="alternate" type="text/html"/>
    <title>go blog()</title>
    <summary>Sorry about the RSS trouble.</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p class="lp">Let my start by apologizing for the noisy duplicate
posts.  I know that people using RSS software to read this blog
got a whole bunch of old posts shown as new yesterday, and the
same thing happened again just now.  I made some mistakes
while moving the blog from one platform to another, which caused
the first burp, and then I had to fix the mistakes, which caused the
second burp.
But it's done, and there won't be another batch of duplicates
waiting for you tomorrow.
</p>

<p class="pp">
I've moved this blog off of Blogger onto App Engine,
running on a custom app written in Go.  The down side is that
I had to implement functionality that Blogger used to handle
for me, like generating the RSS feed, and that's both extra work
and a chance to make mistakes, which I took full advantage of.
The up side, however, is that it makes it significantly easier for
me to automate the writing and publishing of posts, and to create
posts with a computational aspect to the content.
I'll be blogging in the coming months about both the new setup,
which has some interesting technical aspects behind it
(I can edit live posts in a real text editor, for one thing),
and about other topics that can make use of the computation.
</p>

<p class="pp">
For now, though, it's just the same content on a new server.  Enjoy.
</p></div>
    </content>
    <updated>2012-02-07T05:00:00Z</updated>
    <published>2012-02-07T05:00:00Z</published>
    <source>
      <id>tag:research.swtch.com,2012:research.swtch.com</id>
      <author>
        <name>Russ Cox</name>
        <email>rsc@swtch.com</email>
        <uri>https://plus.google.com/116810148281701144465</uri>
      </author>
      <link href="http://research.swtch.com/feed.atom" rel="self" type="application/atom+xml"/>
      <title>research!rsc</title>
      <updated>2012-09-17T15:00:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/02/05/crlsets</id>
    <link href="http://www.imperialviolet.org/2012/02/05/crlsets.html" rel="alternate" type="text/html"/>
    <title>Revocation checking and Chrome's CRL</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>When a browser connects to an HTTPS site it receives signed certificates which allow it to verify that it's really connecting to the domain that it should be connecting to. In those certificates are pointers to services, run by the Certificate Authorities (CAs) that issued the certificate, that allow the browser to get up-to-date information.</p>

<p>All the major desktop browsers will contact those services to inquire whether the certificate has been revoked. There are two protocols/formats involved: OCSP and CRL, although the differences aren't relevant here. I mention them only so that readers can recognise the terms in other discussions.</p>

<p>The problem with these checks, that we call online revocation checks, is that the browser can't be sure that it can reach the CA's servers. There are lots of cases where it's not possible: captive portals are one. A captive portal frequently requires you to sign in on an HTTPS site, but blocks traffic to all other sites, including the CA's OCSP servers.</p>

<p>If browsers were to insist on talking to the CA before accepting a certificate, all these cases would stop working. There's also the concern that the CA may experience downtime and it's bad engineering practice to build in single points of failure.</p>

<p>Therefore online revocation checks which result in a network error are effectively ignored (this is called “soft-fail”). I've previously <a href="http://www.imperialviolet.org/2011/03/18/revocation.html">documented</a> the resulting behaviour of several browsers.</p>

<p>But an attacker who can intercept HTTPS connections can also make online revocation checks appear to fail and so bypass the revocation checks! In cases where the attacker can only intercept a subset of a victim's traffic (i.e. the SSL traffic but not the revocation checks), the attacker is likely to be a backbone provider capable of DNS or BGP poisoning to block the revocation checks too.</p>

<p>If the attacker is close to the server then online revocation checks can be effective, but an attacker close to the server can get certificates issued from many CAs and deploy different certificates as needed. In short, even revocation checks don't stop this from being a real mess.</p>

<p>So soft-fail revocation checks are like a seat-belt that snaps when you crash. Even though it works 99% of the time, it's worthless because it only works when you don't need it.</p>

<p>While the benefits of online revocation checking are hard to find, the costs are clear: online revocation checks are slow and compromise privacy. The median time for a successful OCSP check is ~300ms and the mean is nearly a second. This delays page loading and discourages sites from using HTTPS. They are also a privacy concern because the CA learns the IP address of users and which sites they're visiting.</p>

<p>On this basis, we're currently planning on disabling online revocation checks in a future version of Chrome. (There is a class of higher-security certificate, called an EV certificate, where we haven't made a decision about what to do yet.)</p>


<h4>Pushing a revocation list</h4>

<p>Our current method of revoking certificates in response to major incidents is to push a software update. Microsoft, Opera and Firefox also push software updates for serious incidents rather than rely on online revocation checks. But our software updates require that users restart their browser before they take effect, so we would like a lighter weight method of revoking certificates.</p>

<p>So Chrome will start to reuse its existing update mechanism to maintain a list of revoked certificates, as first proposed to the CA/Browser Forum by Chris Bailey and Kirk Hall of AffirmTrust last April. This list can take effect without having to restart the browser.</p>

<p>An attacker can still block updates, but they have to be able to maintain the block constantly, from the time of revocation, to prevent the update. This is much harder than blocking an online revocation check, where the attacker only has to block the checks during the attack.</p>

<p>Since we're pushing a list of revoked certificates anyway, we would like to invite CAs to contribute their revoked certificates (CRLs) to the list. We have to be mindful of size, but the vast majority of revocations happen for purely administrative reasons and can be excluded. So, if we can get the details of the more important revocations, we can improve user security. Our criteria for including revocations are:</p>

<ol>
 <li>The CRL must be crawlable: we must be able to fetch it over HTTP and robots.txt must not exclude GoogleBot.</li>
 <li>The CRL must be valid by RFC 5280 and none of the serial numbers may be negative.</li>
 <li>CRLs that cover EV certificates are taken in preference, while still considering point (4).</li>
 <li>CRLs that include revocation reasons can be filtered to take less space and are preferred.</li>
</ol>

<p>For the curious, there is a tool for fetching and parsing Chrome's list of revoked certificates at <a href="https://github.com/agl/crlset-tools">https://github.com/agl/crlset-tools</a>.</p></div>
    </content>
    <updated>2012-02-05T08:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-09-21T18:57:08Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/165482540000485377</id>
    <link href="http://twitter.com/_rsc/statuses/165482540000485377" rel="alternate" type="text/html"/>
    <title>_rsc: https://t.co/iRXEwiWm @goroutine @app_engine @go_nuts #golang</title>
    <summary>_rsc: https://t.co/iRXEwiWm @goroutine @app_engine @go_nuts #golang</summary>
    <updated>2012-02-03T17:11:26Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/01/30/mozillaroots</id>
    <link href="http://www.imperialviolet.org/2012/01/30/mozillaroots.html" rel="alternate" type="text/html"/>
    <title>Extracting Mozilla's Root Certificates</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>When people need a list of root certificates, they often turn to Mozilla's. However, Mozilla doesn't produce a nice list of PEM encoded certificates. Rather, they keep them in a form which is convenient for NSS to build from: <a href="https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1"><tt>https://mxr.mozilla.org/mozilla/source/security/nss/lib/ckfw/builtins/certdata.txt?raw=1</tt></a>.</p>

<p>Several people have written quick scripts to try and convert this into PEM format, but they often miss something critical: some certificates are explicitly <i>distrusted</i>. These include the DigiNotar certificates and the misissued COMODO certificates. If you don't parse the trust records from the NSS data file, then you end up trusting these too! There's at least one, major example of this that I know of.</p>

<p>(Even with a correct root file, unless you do hard fail revocation checking you're still vulnerable to the misissued COMODO certificates.)</p>

<p>So, at the prodding of Denton Gentry, I've open-sourced a tool for converting NSS's file to PEM format: <a href="https://github.com/agl/extract-nss-root-certs">extract-nss-root-certs</a>. (At the time of writing it requires a 6g built from the weekly or current tree (<tt>hg -r weekly</tt>), not the release tree. A few of the APIs have changed since the last Go release was done. This will be resolved when Go 1.0 is released.) </p></div>
    </content>
    <updated>2012-01-30T08:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-07-19T18:14:46Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2012/01/29/The-Wisdom-of-Fearless-Stupidity</id>
    <link href="http://www.codegrunt.co.uk/2012/01/29/The-Wisdom-of-Fearless-Stupidity.html" rel="alternate" type="text/html"/>
    <title>The Wisdom of Fearless Stupidity</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>A problem I’ve had for a long while has been the fear of looking stupid. It’s held back projects, study, blog posts (you can see this from the sparseness of <a href="http://www.codegrunt.co.uk/archive.html">this blog</a>), and more generally things I’ve wanted to do which risk looking stupid - translated: worthwhile things.</p>

<p>Ironically this fear has often been self-fulfilling as I’ve ran through the familiar cycle of publicly promising to do something → fearing looking stupid since this thing is tough and I’ve hit up on a brick wall → engaging in endless procrastination → end up looking stupid for not having made progress on said thing.</p>

<p>This is all highly applicable to programming. Computers are so ridiculously complicated that there will always be something to defeat you, the field so wide that there will always be something you don’t know about, or even if you do know something relatively deeply there is always something (actually many things) which will crop up to surprise you (C sharpies should read Eric Lippert’s <a href="http://blogs.msdn.com/b/ericlippert/">blog</a> to bring this point home).</p>

<p>A curious aspect of our craft is how quickly you can find yourself in a situation where your particular problem is a unique enough combination of factors for you to be out there on your own at least in some regard or another. That is enough to make the most hardened, experienced developer insecure and is yet another factor in my own battle with the stupid.</p>

<p>Another consequence of this fear is that, since it’s really impossible to improve at something without questioning whether you have the best approach to the problem at hand (and thus risking looking stupid for having got something wrong), you end up less great than you could potentially be.</p>

<p>In terms of programming this fear stands in the way of better code. Without considering whether your code might be suboptimal (and therefore you possibly looking stupid), you end up almost definitely ensuring your code will be suboptimal. This is not unconnected to the <a href="http://www.osnews.com/story/19266/WTFs_m">only valid measure of code quality</a>.</p>

<p>Clearly a big factor in all of this is pride, especially when you consider future employability, and especially when you have a name which is globally unique over the whole of the internet (the intersection of people with forename of Lorenzo and people with surname of Stoakes, rather than the more common Stokes, is small).</p>

<p>Fuck pride. Fuck not doing things you want to do because you might end up looking stupid, fuck getting stuck on a problem and not bringing the <a href="http://stackoverflow.com">awesome</a> <a href="http://www.quora.com/">power</a> <a href="http://codereview.stackexchange.com/">of</a> <a href="http://www.codinghorror.com/blog/2008/09/stack-overflow-none-of-us-is-as-dumb-as-all-of-us.html">crowdsourcing</a> to bear on it.</p>

<p>Expect some stupidity going forward, but also intelligence as I work hard on fixing my stupidity, little-by-little. <a href="http://www.codinghorror.com/blog/2006/03/sucking-less-every-year.html">Sucking a little less each year</a>.</p></div>
    </content>
    <updated>2012-01-29T00:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://www.miek.nl/blog/archives/2012/01/28/dns_fingerprinting/index.html</id>
    <link href="http://www.miek.nl/blog/archives/2012/01/28/dns_fingerprinting/index.html" rel="alternate" type="text/html"/>
    <title>DNS Fingerprinting</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><h2>Announcing FP</h2>

<p><em>The</em> tool for DNS fingerprinting is <a href="https://github.com/kirei/fpdns">fpdns</a>, which is Perl based.
In recent times development seems to have picked up, but a little competition never hurt
anyone, so I wrote <code>fp</code> in Go. Fp is also a fingerprint program for DNS servers. Its aim is to
be more readable then <code>fpdns</code> is (was?). And make it more easy to add new server types.</p>

<h2>Help needed!</h2>

<p>Do you have some old(er) nameserver laying around that can be queried? Does your (sick) mind
know of a few extra evil queries that can be sent to nameservers? If so, please contact
me: <code>query@evilquery.nl</code>. I want to get to a point where <code>fp</code> sends about 10 queries that
can be used to identify a server. </p>

<h2>Fingerprint</h2>

<p>A fingerprint in <code>fp</code> looks like this:</p>

<pre><code>.,CH,TXT,QUERY,NOERROR,qr,aa,tc,RD,ra,ad,cd,z,1,0,0,0,DO,4097,NSID
</code></pre>

<p>It has 20 fields, which are:</p>

<ol>
<li>Domain name, <code>.</code> in this example;</li>
<li>Class, <code>CH</code> here;</li>
<li>Type, <code>TXT</code> here;</li>
<li>Opcode, <code>QUERY</code>;</li>
<li>Rcode, <code>NOERROR</code>;</li>
<li>Query response, <code>qr</code>, lowercase means false (not set), uppercase means true;</li>
<li>Authoritative, <code>aa</code>, lowercase. Thus not set here;</li>
<li>Truncated, <code>tc</code>, not set;</li>
<li>Recursion Desired, <code>RD</code>, uppercase, thus set;</li>
<li>Recursion Available, <code>ra</code>;</li>
<li>Authenticated Data, <code>ad</code>;</li>
<li>Checking Disabled, <code>cd</code>;</li>
<li>Zero, <code>z</code>;</li>
<li>Question section length, 1 here;</li>
<li>Answer section length, 0;</li>
<li>Authoritative section length, 0;</li>
<li>Additional section length, 0;</li>
<li>DNSSEC OK, <code>DO</code> (uppercase, thus set);</li>
<li>UDP bufsize, set to 4097;</li>
<li>NSID, uppercase: request NSID (or NSID was set).</li>
</ol>

<p>These fingerprints are also used in <em>creating</em> the DNS queries that are send to nameserver(s)
being tested.</p>

<p>A full nameserver fingerprint consists out of multiple of these fingerprints. Right now
<code>fp</code> fires off 3 queries to test a server, so each nameserver fingerprint <em>must</em> also
consist out of 3 fingerprints. The nameserver <a href="https://github.com/miekg/godns/tree/master/examples/fp/data/Bind9">fingerprint of BIND9</a>
looks like:</p>

<pre><code># BIND9 fingerprints
.,CH,TXT,QUERY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,1,DO,4096,NSID
auThoRs.bInD.,CH,TXT,QUERY,NOERROR,QR,AA,tc,rd,ra,ad,cd,z,1,15,1,0,do,0,nsid
bind.,NONE,SOA,NOTIFY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,0,do,0,nsid
</code></pre>

<p>When <code>fp</code> is extended with an extra fingerprint, this BIND9 fingerprint also
needs to get an extra fingerprint.</p>

<h2>Trying it yourself</h2>

<p>As said, Currently <code>fp</code> only uses three queries, but this is expected to be increased in the
near future. In the <a href="https://github.com/miekg/godns/tree/master/examples/fp/data">data directory</a>, 
the file <code>q</code> holds the fingerprints of the queries to ask. Currently
<a href="https://github.com/miekg/godns/tree/master/examples/fp/data/q">it</a> looks like this:</p>

<pre><code># These are the queries that we ask the nameserver being identified
#
# The order is important, as the data files of the known nameservers are compared
# in this order.
.,CH,TXT,QUERY,NOERROR,qr,aa,tc,RD,ra,ad,cd,z,1,0,0,0,DO,4097,NSID
auThoRs.bInD.,CH,TXT,QUERY,NOERROR,qr,aa,tc,rd,ra,ad,cd,z,1,0,0,0,do,0,nsid
bind.,NONE,SOA,NOTIFY,NOERROR,qr,AA,tc,RD,ra,ad,cd,Z,1,0,0,0,do,0,nsid
</code></pre>

<p>A local run looks like this (this is abbreviated):</p>

<pre><code>% ./fp @localhost
Server type     Diffs       Fingerprint         Recevied
Bind9   0 .,CH,TXT,QUERY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,1,DO,4096,NSID .,CH,TXT,QUERY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,1,DO,4096,NSID
Bind9   0 auThoRs.bInD.,CH,TXT,QUERY,NOERROR,QR,AA,tc,rd,ra,ad,cd,z,1,15,1,0,do,0,nsid auThoRs.bInD.,CH,TXT,QUERY,NOERROR,QR,AA,tc,rd,ra,ad,cd,z,1,15,1,0,do,0,nsid
Bind9   0 bind.,NONE,SOA,NOTIFY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,0,do,0,nsid bind.,NONE,SOA,NOTIFY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,0,do,0,nsid
        =
Differences:    0

Nsd3    2 .,CH,TXT,QUERY,NOERROR,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,1,DO,4096,nsid .,CH,TXT,QUERY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,1,DO,4096,NSID
Nsd3    3 auThoRs.bInD.,CH,TXT,QUERY,NOERROR,QR,aa,tc,rd,ra,ad,cd,z,1,0,0,0,do,0,nsid auThoRs.bInD.,CH,TXT,QUERY,NOERROR,QR,AA,tc,rd,ra,ad,cd,z,1,15,1,0,do,0,nsid
Nsd3    6 .,CLASS0,TYPE0,NOTIFY,NXDOMAIN,QR,AA,tc,RD,ra,ad,cd,z,0,0,0,0,do,0,nsid bind.,NONE,SOA,NOTIFY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,0,do,0,nsid
            =
Differences:    11
</code></pre>

<p>What do you see here? On the left the nameserver type we're testing, then a number. This number represent the number of <em>differences</em> with the
stored fingerprint for this server. When this number is zero, it means the reply from the unknown server is an <em>exact</em> match with
one of the stored fingerprints. In general, the lower the number, the more exact the hit was.
For <code>bind9</code> in the example above, the accumulated number of differences is zero. This indicates the server is probably a BIND9 server.</p>

<p>For <code>nsd3</code> the story is completely different. The accumulated number of differences is 11, so this server probably isn't a NSD3 server.</p>

<h3>Report</h3>

<p>With, <code>-report</code> fp will just show the fingerprint of a nameserver. If the server is positively identified, the finger
print can be added to <code>fp</code>:</p>

<pre><code>% ./fp -report @localhost
# Fingerprint of &lt;Nameserver&gt; &lt;version&gt;
# Supplied by &lt;Name&gt; on &lt;Date&gt;
#
.,CH,TXT,QUERY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,1,DO,4096,NSID
auThoRs.bInD.,CH,TXT,QUERY,NOERROR,QR,AA,tc,rd,ra,ad,cd,z,1,15,1,0,do,0,nsid
bind.,NONE,SOA,NOTIFY,REFUSED,QR,aa,tc,RD,ra,ad,cd,z,1,0,0,0,do,0,nsid
</code></pre></div>
    </summary>
    <updated>2012-01-28T14:03:46Z</updated>
    <category term="go, dns(sec)"/>
    <author>
      <name>Miek Gieben</name>
    </author>
    <source>
      <id>http://www.miek.nl/blog</id>
      <author>
        <name>Miek Gieben</name>
      </author>
      <link href="http://www.miek.nl/blog/archives/go/index-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.miek.nl/blog" rel="alternate" type="text/html"/>
      <subtitle>Thoughts on (technical) stuff</subtitle>
      <title>Filed under: go | Miek</title>
      <updated>2012-09-17T18:42:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2012/01/28/Rulemotion</id>
    <link href="http://www.codegrunt.co.uk/2012/01/28/Rulemotion.html" rel="alternate" type="text/html"/>
    <title>Rulemotion</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>For those who didn’t know, I have quit my job at a hedge fund to work at a startup - <a href="http://rulemotion.com/">Rulemotion</a> (website under construction). Exciting! Scary! Awesome! All at the same time :-)</p>

<p>I don’t move until early March, at which I point I am sure I shall blog some more about what I’m getting up to there/what we are all about.</p>

<p>Already looking to be an interesting year, this!</p></div>
    </content>
    <updated>2012-01-28T00:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://www.miek.nl/blog/archives/2012/01/23/super-short_guide_to_getting_q/index.html</id>
    <link href="http://www.miek.nl/blog/archives/2012/01/23/super-short_guide_to_getting_q/index.html" rel="alternate" type="text/html"/>
    <title>Super-short guide to getting q</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Get the latest version (called <code>weekly</code>) of Go:</p>

<ol>
<li><p>Get Go: <code>hg clone -u release https://go.googlecode.com/hg/ go</code>
Note the directory you have downloaded it to and set 
$GOROOT to it: <code>export GOROOT=$PWD/go</code>.
Add the GOROOT bin directory to your path: <code>PATH=$PATH:$GOROOT/bin</code></p></li>
<li><p>Update Go to the latest weekly: <code>cd $GOROOT; hg pull; hg update weekly</code></p></li>
<li><p>Compile Go: <code>cd $GOROOT/src ; ./all.bash</code></p>

<p>Install missing commands (gcc, sed, bison, etc.) if needed.</p></li>
</ol>

<p>The latest Go is now installed.</p>

<h2>Install GoDNS</h2>

<ol>
<li>Get GoDNS: <code>cd ~; git clone git://github.com/miekg/godns.git</code></li>
<li>Compile it: <code>cd godns; make ; make install</code></li>
<li>Compile the examples; <code>cd examples; make ; make install</code></li>
<li>Query with q: <code>q mx miek.nl</code></li>
<li>Report bugs</li>
</ol></div>
    </summary>
    <updated>2012-01-23T16:07:43Z</updated>
    <category term="go, dns(sec)"/>
    <author>
      <name>Miek Gieben</name>
    </author>
    <source>
      <id>http://www.miek.nl/blog</id>
      <author>
        <name>Miek Gieben</name>
      </author>
      <link href="http://www.miek.nl/blog/archives/go/index-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.miek.nl/blog" rel="alternate" type="text/html"/>
      <subtitle>Thoughts on (technical) stuff</subtitle>
      <title>Filed under: go | Miek</title>
      <updated>2012-09-17T18:42:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-5027546459740387773</id>
    <link href="http://reneefrench.blogspot.com/feeds/5027546459740387773/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=5027546459740387773" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/5027546459740387773" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/5027546459740387773" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/01/blog-post_2873.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://4.bp.blogspot.com/-fqSaZYDBlyw/TxpXXSc25yI/AAAAAAAAEhM/B0D_2XgaHWo/s1600/dragon.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5699964335992268578" src="http://4.bp.blogspot.com/-fqSaZYDBlyw/TxpXXSc25yI/AAAAAAAAEhM/B0D_2XgaHWo/s320/dragon.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 263px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-5027546459740387773?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-01-21T06:12:57Z</updated>
    <published>2012-01-21T06:12:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-07-23T17:35:28Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-2012561896688559614</id>
    <link href="http://reneefrench.blogspot.com/feeds/2012561896688559614/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=2012561896688559614" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2012561896688559614" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2012561896688559614" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/01/blog-post_20.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://1.bp.blogspot.com/-Ih5yeFzeWVk/Txkl5BtpfJI/AAAAAAAAEhA/t61xh5vAc10/s1600/bjoernstrandagain.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5699628465056742546" src="http://1.bp.blogspot.com/-Ih5yeFzeWVk/Txkl5BtpfJI/AAAAAAAAEhA/t61xh5vAc10/s320/bjoernstrandagain.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 290px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-2012561896688559614?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-01-20T08:29:28Z</updated>
    <published>2012-01-20T08:29:00Z</published>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-07-16T18:24:40Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/160029943961632770</id>
    <link href="http://twitter.com/_rsc/statuses/160029943961632770" rel="alternate" type="text/html"/>
    <title>_rsc: Miss Code Search? https://t.co/5LLDCqVv</title>
    <summary>_rsc: Miss Code Search? https://t.co/5LLDCqVv</summary>
    <updated>2012-01-19T16:04:46Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:research.swtch.com,2012:research.swtch.com/regexp4</id>
    <link href="http://research.swtch.com/regexp4" rel="alternate" type="text/html"/>
    <title>Regular Expression Article #4</title>
    <summary>Regular Expression Matching with a Trigram Index, or, How Google Code Search Worked</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p/><p class="lp">In January 2007 I posted an article on my web site titled “<a href="http://swtch.com/~rsc/regexp/regexp1.html">Regular Expression Matching Can Be Simple And Fast.</a>”  I intended this to be the first of three; the second would explain how to do submatching using automata, and the third would explain how to make a really fast DFA.  These were inspired by my work on Google Code Search.
</p>

<p class="pp">
Today, the <a href="http://swtch.com/~rsc/regexp/regexp4.html">fourth article</a> in my three-part series is available, accompanied by source code (as usual).  This one describes how Code Search worked.
</p><p/></div>
    </content>
    <updated>2012-01-19T00:00:00Z</updated>
    <published>2012-01-19T00:00:00Z</published>
    <source>
      <id>tag:research.swtch.com,2012:research.swtch.com</id>
      <author>
        <name>Russ Cox</name>
        <email>rsc@swtch.com</email>
        <uri>https://plus.google.com/116810148281701144465</uri>
      </author>
      <link href="http://research.swtch.com/feed.atom" rel="self" type="application/atom+xml"/>
      <title>research!rsc</title>
      <updated>2012-09-17T15:00:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-3586349961235390608</id>
    <link href="http://reneefrench.blogspot.com/feeds/3586349961235390608/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=3586349961235390608" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3586349961235390608" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3586349961235390608" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/01/blog-post_15.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://4.bp.blogspot.com/-7_ycykB4r5E/TxMjFAkKb3I/AAAAAAAAEfg/7JTEBGkbagg/s1600/breeze.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5697936522511806322" src="http://4.bp.blogspot.com/-7_ycykB4r5E/TxMjFAkKb3I/AAAAAAAAEfg/7JTEBGkbagg/s320/breeze.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 274px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-3586349961235390608?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-01-15T19:03:59Z</updated>
    <published>2012-01-15T19:03:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-07-07T00:52:36Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/01/15/beastfollowup</id>
    <link href="http://www.imperialviolet.org/2012/01/15/beastfollowup.html" rel="alternate" type="text/html"/>
    <title>BEAST followup</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>(See the <a href="http://www.imperialviolet.org/2011/09/23/chromeandbeast.html">original post</a> for background.)</p>

<p>Everyone seems to have settled on 1/n-1 record splitting as a workaround for the BEAST attack in TLS 1.0 and SSLv3. Briefly: 1/n-1 record splitting breaks CBC encrypted records in two: the first with only a single byte of application data and the second with the rest. This effectively randomises the IV and stops the attack.</p>

<p>The workaround which OpenSSL tried many years ago, and which hit significant issues, was 0/n record splitting. It's the same thing, but with the first record being empty. The problem with it was that many stacks processed the empty record and returned a 0-byte read, which higher levels took to mean EOF.</p>

<p>1/n-1 record splitting doesn't hit that problem, but it turns out that there's a fair amount of code out there that assumes that the entire HTTP request comes in a single read. The single byte record breaks that.</p>

<p>We first implemented 1/n-1 record splitting in Chrome 15 but backed off after only a couple of days because logging into several large sites broke. But that did motivate the sites to fix things so that we could switch it on in Chrome 16 and it stuck that time.</p>

<p>Opera also implemented it around this time, but I think Chrome took the brunt of the bug reports and it's time consuming dealing with them. Myself and a colleague have been emailing and phoning a lot of sites and vendors while dealing with upset users and site admins. Chrome certainly paid a price for moving before Firefox and IE but then we're nice like that.</p>

<p>Thankfully, this week, Microsoft released a <a href="http://technet.microsoft.com/en-us/security/bulletin/ms12-006">security update</a> which implements 1/n-1 record splitting in SChannel and switches it on in IE. (Although it defaults to off for other users of SChannel, unlike NSS.) Now the sites which broke with Chrome 16 are also broken in a patched IE and that takes some pressure off us. In a few weeks, Firefox 10 should be released and then we'll be about as good as we're going to get.</p>

<p>After taking the brunt with Chrome 16, there is one case that I'm not going to fight: Plesk can't handle POST payloads that don't come in a single read. Chrome (currently) sends POSTs as two writes: one for the HTTP headers and a second for the POST body. That means that each write is split into two records and Plesk breaks because of the second split. IE and Firefox send the headers and body in a single write, so there's only a single split in the HTTP headers, which Plesk handles.</p>

<p>Chrome will start merging small POST bodies into the headers with Chrome 17 (hopefully) and this will fix Plesk. Also, merging as Firefox and IE do saves an extra packet so it's worthwhile on its own. Once again, anything that's mostly true soon becomes an unwritten rule on the Internet.</p>

<p>It's worth contrasting the BEAST response to the renegotiation attack. The BEAST workaround caused a number of problems, but it worked fine for the vast majority of sites. The renegotiation fix requires that very nearly every HTTPS site on the Internet be updated and then that browsers refuse to talk to unpatched servers.</p>

<p>I'd bet that we'll not manage to get enough patched servers for any browser to require it this side of 2020. Unpatched servers can still disable renegotiation to protect themselves, but it's still not hard to find major sites that allow insecure renegotiation (<tt>www.chase.com</tt> was literally the second site that I tried).</p></div>
    </content>
    <updated>2012-01-15T08:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-07-15T14:54:12Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2012/01/14/gootr</id>
    <link href="http://www.imperialviolet.org/2012/01/14/gootr.html" rel="alternate" type="text/html"/>
    <title>OTR in Go</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>“Off the record” is, unfortunately, an overloaded term. To many it's feature in gTalk and AOL IM which indicates that the conversation isn't logged. However, to crypto folks it's <a href="http://www.cypherpunks.ca/otr/">a protocol for secure chat</a>.</p>

<p>(In fact, resoloving the ambiguity is on <a href="https://www.eff.org/deeplinks/2011/12/effs-holiday-wish-list">the EFF's wish list</a>.)</p>

<p>Pidgin has been my chat client of choice for some time because it's pretty fully featured and supports OTR via a plugin. However, I just don't trust it from a security point of view. The latest incident was only a couple of weeks ago: <a href="http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2011-3919">CVE-2011-3919</a>.</p>

<p>So, I implemented <a href="http://code.google.com/p/gocrypto/source/browse/#git%2Fotr">otr in Go</a>, as well as an XMPP <a href="https://github.com/agl/xmpp">library</a> and <a href="https://github.com/agl/xmpp-client">client</a>. It's an absolutely minimal client (except for OTR support) and implements only what I absolutely need in a client.</p>

<p>But it does mean that the whole stack, including the TLS library, is implemented in a memory safe language. (On the other hand, pretty much everything in that stack, from the modexp function to the terminal handling code was written by me and has never really been audited. I'm a decent programmer but I'm sure there are some howlers of security issues in there somewhere.)</p></div>
    </content>
    <updated>2012-01-14T08:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-06-08T18:41:32Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-4565620894159197823</id>
    <link href="http://reneefrench.blogspot.com/feeds/4565620894159197823/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=4565620894159197823" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4565620894159197823" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/4565620894159197823" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2012/01/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://2.bp.blogspot.com/-46gqqSQ2mv4/TwKoaRpwLJI/AAAAAAAAEd8/gahVCJmda7g/s1600/anderson.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5693298048318319762" src="http://2.bp.blogspot.com/-46gqqSQ2mv4/TwKoaRpwLJI/AAAAAAAAEd8/gahVCJmda7g/s320/anderson.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 290px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-4565620894159197823?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-01-13T08:07:36Z</updated>
    <published>2012-01-03T07:03:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Houses"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-07-04T18:55:35Z</updated>
    </source>
  </entry>

  <entry>
    <id>https://sites.google.com/feeds/content/kryas.com/kryas/2598528436182931524</id>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/5119061230095011683" rel="http://schemas.google.com/sites/2008#parent" type="application/atom+xml"/>
    <link href="https://sites.google.com/a/kryas.com/kryas/recent_posts/mygraphicslibrary" rel="alternate" type="text/html"/>
    <link href="https://sites.google.com/feeds/revision/kryas.com/kryas/2598528436182931524" rel="http://schemas.google.com/sites/2008#revision" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/2598528436182931524" rel="self" type="application/atom+xml"/>
    <link href="https://sites.google.com/feeds/content/kryas.com/kryas/2598528436182931524" rel="edit" type="application/atom+xml"/>
    <title>2D Graphics Library</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><table cellspacing="0" class="sites-layout-name-one-column sites-layout-hbox"><tbody><tr><td class="sites-layout-tile sites-tile-name-content-1"><div dir="ltr"><div style="display: block; text-align: left;">I've been writing a graphics library in Go for the mental exercise of the task.  I'll be posting examples in here.</div><div><img border="0" src="https://sites.google.com/a/kryas.com/kryas/_/rsrc/1326441688133/recent_posts/mygraphicslibrary/line_example.png" style="display: block; margin-left: auto; text-align: right;"/></div><div><br/></div><div><div><div class="sites-embed-align-left-wrapping-off"><div class="sites-embed-border-on sites-embed sites-embed-full-width" style="width: 100%;"><h4 class="sites-embed-title">How the above image was created</h4><div class="sites-embed-content sites-embed-type-text"><div class="sites-embed-content-textbox"><div dir="ltr"><div><font size="1"><code>package main</code></font></div><div><font size="1"><br/></font></div><div><font size="1"><code>import(</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>. "image"</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>"image/color"</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>. "mgl"</code></font></div><div><font size="1"><code>)</code></font></div><div><font size="1"><br/></font></div><div><font size="1"><code>// Used for visual inspection of line drawing  </code></font></div><div><font size="1"><code>func main() {</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// Create an image of the given size</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>dst := NewRGBA(Rectangle{Point{0,0}, Point{460, 300}})</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// Set the background of the image</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>FillRGBA(dst, color.RGBA{0,0,0,250})</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>FillAreaRGBA(dst, Rectangle{Point{0,0}, Point{dst.Rect.Max.X, 30}}, ColorMap[COBALT])</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// Draw Title</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>style := NewStyle()</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>style.FontSize </code><span style="white-space: pre;">	</span><code>   = 18</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>style.FontFilePath = "../../fonts/Actor/Actor-Regular.ttf"</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>style.Foreground   = ColorMap[WHITE]</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>DrawFontAt(dst, Point{5,3}, style, "MGL v0.1.12 - Line Comparisons")</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// line color</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>blue := color.RGBA{0,0,30,255}</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// Create a circle so that we can query for points</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>cir := Circle{Point{110, 150}, 100}</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// Iterate over circle</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>// note: its flipped hoizontally  </code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>//       because in this coordinate </code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>//       space (Y grows downward)</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>for i:=0.0; i &lt;= 6.28; i+=0.628 {</code></font></div><div><span style="white-space: pre;"><font size="1">				</font></span></div><div><font size="1"><span style="white-space: pre;">		</span><code>// draw a line from the center of the circle </code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>// to the circle </code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>p    := cir.GetPointForAngle(i)</code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>line := Line{cir.Centre, p}</code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>line.Draw(dst, blue)</code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>blue.G += 10</code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>blue.B += 20</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>}</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// Draw Text At Default Location</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>style.FontSize = 14</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>cir.Centre.Y  += cir.Radius + 10</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>cir.Centre.X  -= cir.Radius</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>DrawFontAt(dst, cir.Centre, style, "Fig.1a- Anti-aliased Lines @ Width 1")</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// Create another circle so that we can query for points</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>cir  = Circle{Point{350, 150}, 100}</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// reset the line color</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>blue = color.RGBA{0,0,30,255}</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>for i:=0.0; i &lt;= 6.28; i+=0.628 {</code></font></div><div><span style="white-space: pre;"><font size="1">				</font></span></div><div><font size="1"><span style="white-space: pre;">		</span><code>// draw a line from the center of the circle </code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>// to the circle </code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>p    := cir.GetPointForAngle(i)</code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>line := Line{cir.Centre, p}</code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>line.Bresenham(dst, blue)</code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>blue.G += 10</code></font></div><div><font size="1"><span style="white-space: pre;">		</span><code>blue.B += 20</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>}</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// Draw Text At Default Location</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>cir.Centre.Y += cir.Radius+10</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>cir.Centre.X -= cir.Radius</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>DrawFontAt(dst, cir.Centre, style, "Fig.1b- Aliased Lines @ Width 1")</code></font></div><div><span style="white-space: pre;"><font size="1">	</font></span></div><div><font size="1"><span style="white-space: pre;">	</span><code>// Write Output to File</code></font></div><div><font size="1"><span style="white-space: pre;">	</span><code>WritePNG("line_example.png", dst)</code></font></div><div><font size="1"><code>}</code></font></div></div></div></div></div></div></div><br/></div></div></td></tr></tbody></table></div>
    </content>
    <updated>2012-01-13T08:06:06Z</updated>
    <published>2012-01-13T07:50:37Z</published>
    <category label="announcement" scheme="http://schemas.google.com/g/2005#kind" term="http://schemas.google.com/sites/2008#announcement"/>
    <author>
      <name>Stan Steel</name>
      <email>steel@kryas.com</email>
    </author>
    <source>
      <id>https://sites.google.com/feeds/content/kryas.com/kryas</id>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas" rel="http://schemas.google.com/g/2005#post" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas/batch" rel="http://schemas.google.com/g/2005#batch" type="application/atom+xml"/>
      <link href="https://sites.google.com/feeds/content/kryas.com/kryas?parent=5119061230095011683&amp;kind=announcement" rel="self" type="application/atom+xml"/>
      <title>Posts of Development Blog</title>
      <updated>2012-10-18T04:10:00Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-2938251417686087172</id>
    <link href="http://reneefrench.blogspot.com/feeds/2938251417686087172/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=2938251417686087172" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2938251417686087172" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/2938251417686087172" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/11/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/--iaK2V9nY5k/TrN3cvq3UcI/AAAAAAAAES0/rcqrD0SU6Mg/s1600/shineyassface.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5671007691505881538" src="http://3.bp.blogspot.com/--iaK2V9nY5k/TrN3cvq3UcI/AAAAAAAAES0/rcqrD0SU6Mg/s320/shineyassface.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 318px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-2938251417686087172?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-01-13T08:03:35Z</updated>
    <published>2011-11-04T05:25:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="A.T."/>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="line drawings"/>
      <category term="photographs"/>
      <category term="A.T."/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-04-28T01:03:23Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://kylelemons.net/?p=293</id>
    <link href="http://kylelemons.net/2012/01/quote-gentleness-and-strength/" rel="alternate" type="text/html"/>
    <title>Quote: Gentleness and Strength</title>
    <summary>“Nothing is so strong as gentleness, nothing so gentle as real strength”
- St. Francis de Sales</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>“Nothing is so strong as gentleness, nothing so gentle as real strength”<br/>
- St. Francis de Sales</p></div>
    </content>
    <updated>2012-01-11T22:16:30Z</updated>
    <category term="Quotes"/>
    <author>
      <name>Kyle Lemons</name>
    </author>
    <source>
      <id>http://kylelemons.net</id>
      <link href="http://kylelemons.net/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://kylelemons.net" rel="alternate" type="text/html"/>
      <subtitle>A little curiosity goes a long way</subtitle>
      <title>Eko Foxtrot</title>
      <updated>2012-04-30T02:00:03Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://kylelemons.net/?p=240</id>
    <link href="http://kylelemons.net/2012/01/go-new-language-new-year/" rel="alternate" type="text/html"/>
    <title>Go: A New Language for a New Year</title>
    <summary>p{text-indent:1em}

As 2011 makes its way out and 2012 takes its place, it’s time for a bit of reflection and a bit of looking forward. I haven’t been writing software professionally for particularly long, but I have written software in a number of languages (everything from Pascal to Python), and I think we can all agree [...]</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div class="wp-caption alignright" id="attachment_248" style="width: 160px;"><a href="http://golang.org/"><img alt="Go Gopher Logo" class="size-thumbnail wp-image-248" height="150" src="http://kylelemons.net/wp-content/uploads/2011/12/gophercolor-150x150.png" title="Go Gopher Logo" width="150"/></a><p class="wp-caption-text">Go Gopher</p></div>
&lt;style&gt;p{text-indent:1em}&lt;/style&gt;
<p>
As 2011 makes its way out and 2012 takes its place, it’s time for a bit of reflection and a bit of looking forward. I haven’t been writing software professionally for particularly long, but I have written software in a number of languages (everything from Pascal to Python), and I think we can all agree that none of the usual suspects are particularly ideal. If you’re like me, you hunker down with your favorite set of language features and write your code in as much isolation as possible, so that you can work around or ignore whatever problems your language and/or environment cause you. You probably have some tools lying around to help you do various things for which the language or your editor/environment aren’t well-equipped. You probably don’t even realize all of the things that bother you about the language after awhile, because it’s the norm: every programmer has to deal with them, it just comes with the territory. Please note: I will be comparing Go to other languages extensively in this blog post; do not take it to be an indictment of them or even, really, as reasons to not use them. I’m simply giving my opinion on their differences and why I personally find that Go is a more suitable language for my development. I have used all of the languages that I discuss and will continue to use them when their particular strengths are required.
</p>
<p>
Let’s start with <a href="http://python.org/">Python</a>.  I loved my time writing Python, because I felt like I could be really productive.  I created a library that my team and I could use to replace huge pieces of boilerplate with a few lines of very terse but legible code.  I used just about every new, shiny feature of Python on which I could get my grubby little hands: I used context objects, generators, fancy inheritance and especially I abused the data model in ways that now make me cringe.  My code was a pleasure to read and even more of a pleasure to write.  It got the job done with a really small amount of code, and my team and managers loved me for how productive I was and how productive I was making my team.  What I knew somewhere in the back of my mind but didn’t tell anyone was how horribly painful it was to debug the code written this way.  My code reviewers were able to read the code and admit that it looked right, see that the test cases were comprehensive enough and verify that I was covering all of the requirements, but I doubt that they had any idea what was really going on behind-the-scenes or how brittle some of the libraries could be.  Since I had written one of the libraries myself and knew most of the nuances of the Python features employed, I was able to debug problems with the library (or my use of it) with relative ease.  Unfortunately, it often meant tracing through many layers and scrutinizing pieces of code with a fine-toothed comb to find all of the places where Python was secretly calling (or not calling) out to other pieces of code.  Often, it was simply a matter of hiding yet another __special__ function to an object to handle a new use case (for those of you familiar with C++ and the <a href="http://en.wikipedia.org/wiki/Rule_of_three_(C++_programming)">Rule of 3</a>, there needs to be a Python Rule of 17 or something…) that wasn’t already covered.  The rest of the team pretty much just used my example code as a template and never ran into these issues, but if they’re still using this particular library I really hope that it’s not causing them more problems than it solved.  I’m not even going to get into the various issues that flimsy duck-typing and non-static typing can cause, often a long time after the offending code is written…  What remains clear to me is that Python (and langauges like it) are not suitable for large-scale development without very strict adherence to a style guide which precludes almost all of what I described above, and to me that would just take all of the fun out of it.
</p>
<p>
That, however, is Python, and is the price you expect to pay for such a dynamic language.  Even lower-level languages like C and Pascal have their issues.  Don’t get me wrong, I absolutely love C and feel like I am a <i>deus intra machinam</i> whenever I write it; I still think it’s the first programming language that a student should learn, and that they shouldn’t be able to move to a higher- or lower-level language until they’ve mastered it.  The problem with these languages, especially C, is that you have to take such care when writing and reviewing any significant amount of code that verifying that the code is correct, robust, and has no memory leaks is the next closest thing to impossible.  The boilerplate and the bookkeeping that have to be done before you even get to the meat of your application or algorithm are tedious and error-prone in the worst way.  There are certainly situations in which such lower-level languages are the only language that <i>can</i> solve your problem, whether it be for performance, real-time/deterministic execution or bare metal proximity reasons, but they just aren’t the most suitable languages for large-scale development.
</p>
<p>
I’ve also done a bit of graphical (read: drag-and-drop, flow chart) programming, which is interesting to say the least.  I won’t go into much detail here, except to say that from my limited exposure, it seems best suited as a special-purpose tool for small- to medium-scale logic at best, and should probably not be used when there are more than a few developers on a particular piece of “code.”  It’s fun at first, but the limitations show up fast, and after awhile it seems more tedious, repetitive, and limiting than anything else.
</p>
<div class="wp-caption alignright" style="width: 210px;"><a href="http://www.squishable.com/pc/gopher_understudy/Squishable_Understudies/Gopher+Understudy"><img alt="Go Gopher Understudy from Squishable" height="200" src="http://www.squishable.com/mm5/graphics/00000001/gopher_understudy.jpg" title="Go Gopher" width="200"/></a><p class="wp-caption-text">Go even has an adorable mascot</p></div>
<p>
Enter <a href="http://golang.org">Go</a>.  It is a new programming language by pretty much any definition, despite having been in development at Google since 2007 and as an open source project since 2009.  It’s a compiled, statically typed, garbage collected language with some cool primitives for concurrency.  Despite being compiled and statically typed, it has a very dynamic feel.  The syntax has some concise shortcuts to minimize repetition and variable typing.  The presence of closures, a garbage collector, and a fairly expansive standard library also contribute to its dynamic feel.  These things, coupled with the clarity and explicit nature of Go source code, all help make Go one of the best general purpose languages that I have ever used.  I won’t be providing code directly (this blog post is long enough already), but many of the links I provide will be to the documentation or to the relevant portions of the <a href="http://tour.golang.org/">Go Tour</a>, where you can play with the features yourself.
</p>
<p>
We look forward to the first long-term stable release of the Go standard library and compilers sometime early this year: <a href="http://blog.golang.org/2011/10/preview-of-go-version-1.html">Go version 1</a>.  I’ve been convinced for awhile now that Go is a production-ready language, but in my mind this piece is really the last thing left barring wider adoption.  There are some exciting language changes leading up to this Go 1 release, and I am really excited to see what gets done after it is finished.  To date, the fast pace at which Go has evolved (both the language and the standard libraries) has posed a challenge for third-party library maintainers, who often have to maintain both a “release” branch of their code and a “weekly” branch due to the rate at which the weekly branch progresses and the relatively high percentage of Go users who are doing their development at (or beyond) the “weekly” branch to take advantage of the new, shiny features or to get the latest bug fixes.  With Go 1 this should change, and the number of libraries available to use with a single command (more on that later) will be able to grow even faster.
</p>
<h2>Why Go?</h2>
<p>
Compared to most languages in use today, Go was designed with many programmers, concurrent systems, and large-scale problems in mind.  Some languages, like C, were simply not designed at a time where multicore and multiprocessor systems were in broad deployment.  Some languages, like Python, weren’t originally intended to scale well onto multiple cores and have been slow to adopt strategies for utilizing such resources.  Many languages to this day don’t have networking libraries which work predictably and have a clean, understandable API.  Programs written in many languages, especially those with operator overloading, require in-depth knowledge of both the architecture of the program itself and the libraries in use in order to be able to understand the code well.  Go attempts to address all of these problems and more; in my opinion, it does so brilliantly.
</p>
<p>
Two of the first things you will hear most people talk about when you hear about Go are channels and goroutines.  They’re certainly two of the “shiniest” features of the language, and are the reasons why I tried out Go back in late 2009.  They’re far from the biggest reasons why I think you should try Go, but they’re as good a place as any to start.
</p>
<h3>Channels and Goroutines</h3>
<p>
<a href="http://tour.golang.org/#61">These two features</a> are inspired by Hoare’s Communicating Sequential Processes (<a href="http://en.wikipedia.org/wiki/Communicating_sequential_processes">CSP</a>).  A goroutine (similar to a <a href="http://en.wikipedia.org/wiki/Coroutine">coroutine</a>) is a function that runs independently of the calling function.  They’re similar to threads in that a scheduler manages which ones are running at any given time, but they are much lighter-weight than their operating system counterparts.  In fact, a Go application with many thousands of goroutines can run comfortably on a single operating system thread.
</p>
<p>
Channels are a data type in Go which allows for simple, clear communication between goroutines.  They are first-class values that have a data type associated with them.  Any value of the associated type can be sent over the channel and then received from the channel, usually by another goroutine.  They can be passed into functions and goroutines, stored in objects, even sent through other channels.
</p>
<p>
In most programming languages, when you have multiple threads that need to share data or communicate, you arrange to do so via the use of mutual exclusion locks (<a href="http://en.wikipedia.org/wiki/Mutex">mutexes</a>).  At first glance, it seems simple: before you access the data you lock it, and when you’re done you unlock it.  It gets <a href="http://en.wikipedia.org/wiki/Dining_philosophers_problem">more</a> <a href="http://en.wikipedia.org/wiki/Sleeping_barber_problem">complicated</a> <a href="http://en.wikipedia.org/wiki/Producers-consumers_problem">very</a> <a href="http://en.wikipedia.org/wiki/Readers-writers_problem">quickly</a>, of course.  In Go, a mutex (while available) is not the preferred solution to most problems.  As stated in <a href="http://golang.org/doc/effective_go.html#sharing">Effective Go</a>, the slogan has become:<br/>
<span style="display: block; padding: 8px 12px;"><i>Do not communicate by sharing memory; instead, share memory by communicating.</i></span>Thus instead of using a mutex to protect a shared, global object, you either pass the object around (changing ownership as you do) or you maintain a single owner and all other goroutines access the object by sending requests to that goroutine.
</p>
<p>
Using these two tools, it turns out to be quite easy to implement solutions to a problem that make logical sense and that very closely reflect the way we might solve the problem in our head.  Small, focused pieces of code are concerned with specific aspects of the solution, and are either given their input via the usual way (function parameters) or continually from channels (they also have the same alternatives available for their output).  Ownership of data is clear, communication is explicit, the code is highly legible.  Such designs are also often easy to unit test; simulating the input and verifying the output via channels is straightforward and very common.
</p>
<h3>Closures and Deferred Functions</h3>
<p>
One of the many features of Go that makes it have a very dynamic feel are <a href="http://tour.golang.org/#37">closures</a>.  Like lambdas in python or blocks in ruby, a function can be declared as a local variable or even passed as a literal to a function.  All local variables in scope at the closure declaration are also in scope within the closure.  They’re powerful tools for functional-style APIs and can be a really fun alternative to (or improvement upon) callbacks.  They are also commonly executed directly as a goroutine.
</p>
<p>
In addition to the “go” directive that runs a function in its own goroutine, Go also has a <a href="http://golang.org/doc/effective_go.html#defer">“defer” directive</a>.  When a function (or closure) call is preceded by the “defer,”, the call is evaluated but not executed until just before the function returns.  Multiple deferred calls will be executed in reverse order.  This turns out to be a very powerful tool for using any object or API which requires cleanup: as soon as you create it or lock it, you can defer the cleanup or unlock.  This makes it very easy to spot when you forgot to close a file descriptor or (should you find yourself using one) unlocking a mutex.
</p>
<p>
These two features provide the ability to confine relevant code all in the same place, which in turn makes reading, debugging, and maintaining the code easier.  This is a common theme, and I think was at or near the top of the Go designers’ priority list when designing the language.  The concepts are simple, orthogonal, and flexible without sacrificing readability, debuggability, or maintainability.
</p>
<h3>Interfaces</h3>
<p>
<a href="http://tour.golang.org/#53">Interfaces</a> in Go are a welcome twist on a familiar concept.  Typically, in a language like Java, interfaces must be explicitly declared by any implementing class. This, of course, means that adding a new interface requires modifying (and having access to modify) all classes that you plan to use in values of that interface type.  The paradigm in Go is reversed: instead of defining an interface and declaring all of the objects that satisfy it, the interface is defined and any object which could satisfy the interface can implicitly be used as a value of the interface.  This also provides a useful tool, the empty interface, which acts as a container for any possible value (similar to Java’s Object, from which all classes are derived) because all values satisfy it.
</p>
<p>
In contrast to interfaces in other languages (for instance, in Java), Go interfaces are often very small, and contain one or just a few methods.  Because of the presence of such small interfaces in the standard library, they have naturally given rise to some common, idiomatic function names and signatures.  Possibly the <a href="http://golang.org/pkg/io/#Reader">best</a> <a href="http://golang.org/pkg/io/#Writer">examples</a> of these from the standard library are the <code>io.Reader</code> and <code>io.Writer</code> interfaces.  Because of the prevalence of objects which implement these two interfaces, stringing together producers and consumers of a data stream is often reminiscent of a unix pipeline.  It is simple, for instance, to open a file, unzip it, decrypt its contents, and stream it directly to an HTTP client because all of these interfaces satisfy or consume the above interfaces.  Even Go’s version of the old favorite <code>printf</code> can write to any object which satisfies the <code>io.Writer</code> interface, which gives rise to the very concise <a href="http://tour.golang.org/#56">web-based version of “Hello, World!” in Go</a>.
</p>
<h3>Simplicity and Explicitness</h3>
<p>
Some of the best features of Go are, unlike those listed above, not something you’ll find listed in the specification.  They probably stem from the <a href="http://golang.org/doc/go_faq.html#principles">guiding philosophy</a> behind its design more than anything else.  I think that the simplicity, orthogonality, and explicitness of the features of the Go language make it a prime candidate for a teaching language, especially at the middle- or high-school level.
</p>
<p>
First, the features of Go are simple and minimal.  The <a href="http://golang.org/doc/go_spec.html">entire language specification</a> fits in 45 printed pages.  By contrast, the C++ specification clocks in at 750 pages and Javascript has nearly 250.  It is short enough that an average programmer can actually read it, understand it, and internalize it in its entirety.  This turns out to be quite an asset in a large project setting with multiple developers, each of whom will have a slightly different coding style and may utilize a different different set of features.  Being able to understand all of the language features in use, their nuances, and their side effects turns out to be easy in Go when it could be a nearly impossible task in many others.
</p>
<p>
Second, the features of Go are designed to be orthogonal to one another.  When you understand two concepts independently, you understand them together.  I have already given one example of this: deferred function calls.  If you understand defer (e.g. that it doesn’t make the call immediately, that it evaluates arguments at the defer site, and that it is executed after any subsequent defer calls as the function returns) and you understand closures (that any local variables are in scope, etc), you already understand what happens if you defer a call to a function literal.  Compare this to my Python anecdotes earlier, and you’ll find that this is not as ubiquitous a quality as you might expect.  There are also a fair number of C++ and Java features that interact non-orthogonally and require some more in-depth understanding (hence the 750-page C++ specification).
</p>
<h3>Ease of Development</h3>
<p>
This one is more difficult to quantify.  I have found, qualitatively, that writing Go is easier and more fun than pretty much any other language I have used to date.  Dynamic languages like Python and Ruby are fun to learn and are fun languages with which to experiment, but I have found that the amount of time spent debugging them (especially when it’s somebody else’s code) takes almost all of the fun out of large project and multi-developer situations.  By contrast, languages like C and C++ (and to a somewhat lesser extent, Java) are more painful to write up front but have well-established tools that make analyzing and debugging them a much more pleasant experience.  Until I tried Go, I accepted this as the nature of the beast.  You just had to to choose.  With Go, however, I think the designers managed to strike a balance.
</p>
<p>
On the development side, I have found that it is easy to translate designs into code.  As I mentioned previously, channels and goroutines make it easy to implement your design in pieces that all connect together and communicate.  The lack of verbose syntaxes for declarations and the implicit nature of interfaces reduce the amount of arguably unnecessary up-front work.  The simplicity of the type system lets you (or forces you to) focus on the implementation instead of fixating on design patterns or type hierarchies.  The lack of certain features in the language like operator overloading, destructors, exceptions, and the like all force code to be explicit.  An oft-quoted mailing list post by Andrew Gerrand states that “[in] Go, the code does exactly what it says on the page.”  Error handling, function calls, math, map/slice access and inter-goroutine communication all look exactly like what they are.  When examining a function in isolation, it is a relatively small feat to understand the side-effects of a given statement, which makes the debugging process much more pleasant than in some other languages in which the simplest statement like “a+b” could potentially have unlimited side effects.
</p>
<p>
Outside of the code itself, there are many benefits to the Go programming language.  The standard library is very complete, cohesive, and easy to understand.  The third party package ecosystem is nurtured by the Go team, and the standard distribution includes an application called “<a href="http://golang.org/cmd/goinstall/">goinstall</a>” (soon to be bundled into a <a href="http://tip.goneat.org/cmd/go/">“go” meta-command</a>) by means of which a package hosted in any web-accessible Git, Mercurial, or Subversion repository can be installed (and any such dependencies, ad infinitum) with a single command.  By default, such installations are anonymized and aggregated on a package dashboard, which shows the most- and most-recently installed packages as well as their build status as of the latest release.  The standard distribution also includes a formatting tool called “gofmt” which knows how to format a piece of source code according to “Go style,” which reduces or eliminates the need for unproductive debating within a project about things like brace placement or whitespace around operators.  There is also a tool called “gofix” which contains modules to automatically fix up any mechanical changes that have been made to the standard library or language between releases (for instance, changing function names, package imports or method signatures) where possible.  The last of the tools that I will mention is “godoc,” which is similar to pydoc or javadoc.  It uses the comments in the source to provide easily accessible documentation both on the command-line and from a web browser.  All of these tools add up to make even the experience of development that doesn’t involve code production as easy as possible.
</p>
<h2>Summary</h2>
<p>Go is an industrial-strength programming language for solving industrial-sized problems.  There are many features that I haven’t even touched upon, like the fact that Go is now the third runtime on Google App Engine, which could probably fill another equally long blog post.  If you read this far, I hope you at least take the time to <a href="http://tour.golang.org">take the Go tour</a> or <a href="http://golang.org/doc/go_spec.html">peruse the language specification</a>.  Keep an eye out for future projects or tools where you might be able to try out a new language.  You may not like it, it may not be accepted in your place of work, or it may simply not be adequate for your needs, but I think that it has the potential to make significant waves in the software industry and I encourage everyone (even if you’ve never programmed before in your life) to give it a shot.</p></div>
    </content>
    <updated>2012-01-06T19:30:29Z</updated>
    <category term="Blog"/>
    <category term="Go"/>
    <category term="Programming"/>
    <category term="go"/>
    <category term="open source"/>
    <author>
      <name>Kyle Lemons</name>
    </author>
    <source>
      <id>http://kylelemons.net</id>
      <link href="http://kylelemons.net/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://kylelemons.net" rel="alternate" type="text/html"/>
      <subtitle>A little curiosity goes a long way</subtitle>
      <title>Eko Foxtrot</title>
      <updated>2012-04-30T02:00:03Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-6983287.post-3287673047354124772</id>
    <link href="http://www.blogger.com/feeds/6983287/posts/default/3287673047354124772" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/6983287/posts/default/3287673047354124772" rel="self" type="application/atom+xml"/>
    <link href="http://commandcenter.blogspot.com/2011/12/esmereldas-imagination.html" rel="alternate" type="text/html"/>
    <title>Esmerelda's Imagination</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><div>An actress acquaintance of mine—let's call her Esmerelda—once said, "I can't imagine being anything except an actress."  To which the retort was given, "You can't be much of an actress then, can you?"</div><div><br/></div><div>I was reminded of this exchange when someone said to me about Go, "I can't imagine programming in a language that doesn't have generics."  My retort, unspoken this time, was, "You can't be much of a programmer, then, can you?"</div><div><br/></div><div>This is not an essay about generics (which are a fine thing and may arrive in Go one day, or may not) but about imagination, or at least what passes for imagination among computer programmers: complaint. A friend observed that the definitive modern pastime is to complain on line. For the complainers, it's fun, for the recipients of the complaint it can be dispiriting. As a recipient, I am pushing back—by complaining, of course.</div><div><br/></div><div>Not so long ago, a programmer was someone who programs, but that seems to be the last thing programmers do nowadays. Today, the definition of a programmer is someone who complains unless the problem being solved has already been solved and whose solution can be expressed in a single line of code. (From the point of view of a language designer, this reduces to a corollary of language success: every program must be reducible to single line of code or your language sucks. The lessons of APL have been lost.)</div><div><br/></div><div>A different, more liberal definition might be that a programmer is someone who approaches every problem exactly the same way and complains about the tools if the approach is unsuccessful.</div><div><br/></div><div>For the programmer population, the modern pastime demands that if one is required to program, or at least to think while programming, one blogs/tweets/rants instead. I have seen people write thousands of words of on-line vituperation that problem X requires a few extra keystrokes than it might otherwise, missing the irony that had they spent those words on programming, they could have solved the problem many times over with the saved keystrokes. But, of course, that would be programming.</div><div><br/></div><div>Two years ago Go went public. This year, Dart was announced. Both came from Google but from different teams with different goals; they have little in common. Yet I was struck by a property of the criticisms of Dart in the first few days: by doing a global substitution of "Go" for "Dart", many of the early complaints about Go would have fit right into the stream of Dart invective. It was unnecessary to try Go or Dart before commenting publicly on them; in fact, it was important not to (for one thing, trying them would require programming). The criticisms were loud and vociferous but irrelevant because they weren't about the languages at all. They were just a standard reaction to something new, empty of meaning, the result of a modern programmer's need to complain about everything different. Complaints are infinitely recyclable. ("I can't imagine programming in a language without XXX.") After all, they have a low quality standard: they need not be checked by a compiler.</div><div><br/></div><div>A while after Go launched, the criticisms changed tenor somewhat. Some people had actually tried it, but there were still many complainers, including the one quoted above. The problem now was that imagination had failed: Go is a language for writing Go programs, not Java programs or Haskell programs or any other language's programs. You need to think a different way to write good Go programs. But that takes time and effort, more than most will invest. So the usual story is to translate one program from another language into Go and see how it turns out. But translation misses idiom. A first attempt to write, for example, some Java construct in Go will likely fail, while a different Go-specific approach might succeed and illuminate. After 10 years of Java programming and 10 minutes of Go programming, any comparison of the language's capabilities is unlikely to generate insight, yet here come the results, because that's a modern programmer's job.</div><div><br/></div><div>It's not all bad, of course. Two years on, Go has lots of people who've spent the time to learn how it's meant to be used, and for many willing to invest such time the results have been worthwhile. It takes time and imagination and programming to learn how to use any language well, but it can be time well spent. The growing Go community has generated lots of great software and has given me hope, hope that there may still be actual programmers out there.</div><div><br/></div><div>However, I still see far too much ill-informed commentary about Go on the web, so for my own protection I will start 2012 with a resolution:</div><div><br/></div><div><i>I resolve to recognize that a complaint reveals more about the complainer than the complained-about. Authority is won not by rants but by experience and insight, which require practice and imagination. And maybe some programming.</i></div><div><br/></div><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/6983287-3287673047354124772?l=commandcenter.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2012-01-01T19:17:50Z</updated>
    <published>2012-01-01T02:15:00Z</published>
    <author>
      <name>rob</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/18259238879445421354</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-6983287</id>
      <author>
        <name>rob</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/18259238879445421354</uri>
      </author>
      <link href="http://commandcenter.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/6983287/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://commandcenter.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <title>command center</title>
      <updated>2012-09-23T03:33:33Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2011/12/31/New-Year</id>
    <link href="http://www.codegrunt.co.uk/2011/12/31/New-Year.html" rel="alternate" type="text/html"/>
    <title>New Year</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>It’s been a long time since I’ve updated this blog, and a completely crazy past few months, so I hope to rectify the former by using the latter as the basis for this post :)</p>

<p>I turned 30 this September, and the force of switching from the deferring-friendly 20’s (‘I can achieve these things, don’t worry, I’m still young’) to the ‘oh shit I’m an adult now’ 30’s has hit harder than I expected (in fact, to be honest, I didn’t expect it at all).</p>

<p>So what’s happened? Well in my personal life, I finally did something about my weight issue and lost ~3.5 stone (~50lb, ~23kg).</p>

<p>In my intellectual/geek life I committed to the <a href="https://www.ai-class.com/home/">open Stanford AI course</a> and completed it with a <a href="http://dl.dropbox.com/u/140966/letter018865_signed.pdf">98.7% average</a>*, and wrote <a href="https://github.com/lorenzo-stoakes/stanford-ai">notes</a> for the purposes of actual applying the course to real things (the notes are not yet fully complete, however I do plan to finish that later), which has really helped with my recently very low intellectual confidence.</p>

<p>Two fundamental things have changed - firstly I’ve got organised about things (for weight loss - food diary, for study - committed, realistic work schedule), secondly and far more importantly, I’ve stopped beating myself up quite as badly about everything. Beating yourself up like that makes you incapable of doing <em>anything</em> since you feel constantly bad about whatever it is you’re doing, and thus reticent to do it, which means you don’t improve/change anything, which means you beat yourself up more, etc. - a vicious, vicious cycle.</p>

<p>Another thing to note here is the amazing usefulness of <a href="http://en.wikipedia.org/wiki/Timeboxing">timeboxing</a>. The past week I have got more hacking done in a week than I have for hundreds of weeks prior.</p>

<p>So what about resolutions? Over the coming year I plan to contribute considerably more to <a href="http://golang.org">go</a>, and build <a href="https://github.com/lorenzo-stoakes/weak">weak</a> into a fully-fledged chess engine (though I can make no guarantees to its eventual strength) and I intend to work on improving my algorithmic and computer science fundamentals knowledge. On the final bit - I plan to enter the <a href="http://code.google.com/codejam/">google code jam</a> and blog about the experience, though I don’t expect or predict any sort of performance, it’s more of a motivation and point of focus.</p>

<p>Happy New Year!</p>

<p>* I’m not boasting here. I fell considerably below the performance of many other participants and wish I’d been more careful with many of the answers. Also I realised how rusty I am at this stuff. Also I couldn’t stand to carry on attending the meetup I was attending given how erudite, intelligent and informed the other people were compared to me.</p></div>
    </content>
    <updated>2011-12-31T00:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://www.airs.com/blog/?p=544</id>
    <link href="http://feedproxy.google.com/~r/Airs-IanLanceTaylor/~3/wL_kswWUhns/544" rel="alternate" type="text/html"/>
    <title>Non-free Services</title>
    <summary>As both of my faithful readers can see, my blog postings have dropped significantly. I’ve been posting my random little comments on Google+ instead. Which leads me to the following. There is a hard-core group of people who only use free software. I’m not quite that hard-core, but in practice I do use only free [...]</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>As both of my faithful readers can see, my blog postings have dropped significantly.  I’ve been posting my random little comments on Google+ instead.</p>
<p>Which leads me to the following.  There is a hard-core group of people who only use free software.  I’m not quite that hard-core, but in practice I do use only free software, except perhaps for some binary drivers in the kernel (I don’t actually know whether the systems I’m running use binary drivers or not, and I’m not hard-core enough to find out).</p>
<p>I’ve seen some people argue that if you are serious about using free software, you should also only use Internet services which are themselves free software.  For example, you should not use Facebook or Google+, because the software used to run those services is not free.</p>
<p>I don’t agree with that argument.  The key goal of free software is that I always have the right to change the software that I am running.  When I use an Internet service like Google+, I am not running the software.  Even if I had a copy of the software, I would not be able to run it, because I don’t have enough servers.  And even if I had enough servers, it would be useless for me to run the software, because I don’t have the data.  And there is no way to grant me access to the data, because that would violate the reasonable privacy choices of everybody else using the service.</p>
<p>When it comes to a service like Google+, whether the software is free is not important.  Releasing the software would not give me any more freedom than I already have.  Google+ is only interesting when many people are operating out of a single shared data base, and that data base must have privacy safeguards to ensure that it is not copied.</p>
<p>What matters with Google+ is not the software, but the data.  It is important that I be able to retrieve all my data associated with Google+, and that I be able to retrieve it in a way that makes it possible to use with other software.  That is, I should be able to retrieve my posts, my comments on other people’s posts, my list of followers, my photos, etc.  And I should be able to plug them into some other software service if I so choose.</p>
<p>In fact Google+ does have a set of APIs which permit me to retrieve my data.  I haven’t verified that all Google+ data is available via the APIs, but all the obvious stuff seems to be available.  Given those APIs, it should be possible for me to move all my data to some other service which provides te required APIs itself.</p>
<p>So I personally don’t see any reason why even a hard-core free software supporter should avoid using a service like Google+.  This isn’t to say that it wouldn’t be nice if Google freed up the software and accepted patches from outside users.  It’s just that that is not a critical part of freedom to use software.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/nQUnNDoCoVV3l3bmAOr2SWFlGcA/0/da"><img border="0" ismap="true" src="http://feedads.g.doubleclick.net/~a/nQUnNDoCoVV3l3bmAOr2SWFlGcA/0/di"/></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/nQUnNDoCoVV3l3bmAOr2SWFlGcA/1/da"><img border="0" ismap="true" src="http://feedads.g.doubleclick.net/~a/nQUnNDoCoVV3l3bmAOr2SWFlGcA/1/di"/></a></p><img height="1" src="http://feeds.feedburner.com/~r/Airs-IanLanceTaylor/~4/wL_kswWUhns" width="1"/></div>
    </content>
    <updated>2011-12-27T17:54:00Z</updated>
    <category term="Programming"/><feedburner:origLink xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://www.airs.com/blog/archives/544</feedburner:origLink>
    <author>
      <name>Ian Lance Taylor</name>
    </author>
    <source>
      <id>http://www.airs.com/blog</id>
      <link href="http://www.airs.com/blog" rel="alternate" type="text/html"/>
      <link href="http://feeds.feedburner.com/Airs-IanLanceTaylor" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>Ian Lance Taylor</subtitle>
      <title>Airs - Ian Lance Taylor</title>
      <updated>2012-03-04T21:00:32Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-8903278430838134596</id>
    <link href="http://reneefrench.blogspot.com/feeds/8903278430838134596/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=8903278430838134596" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8903278430838134596" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8903278430838134596" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/12/blog-post_22.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://2.bp.blogspot.com/-eM0kWPxS5b0/TvOSVQAnqsI/AAAAAAAAEcU/94Qx0y65QXA/s1600/prow.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5689051648071543490" src="http://2.bp.blogspot.com/-eM0kWPxS5b0/TvOSVQAnqsI/AAAAAAAAEcU/94Qx0y65QXA/s320/prow.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 283px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-8903278430838134596?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-22T20:26:07Z</updated>
    <published>2011-12-22T20:25:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="Bjornstrand story"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-06-26T07:21:35Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-6022389222427866794</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/6022389222427866794" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/6022389222427866794" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/12/getting-to-know-go-community.html" rel="alternate" type="text/html"/>
    <title>Getting to know the Go community</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Over the past couple of years Go has attracted a lot of users and contributors, and I've had a great time meeting and talking with many of you. However, for every Gopher I know there are dozens I know nothing about. In order to address this imbalance I've prepared a survey for Go users everywhere.<br/><br/>The survey is short. It asks about you, your involvement with Go, and and your interest in Go-related events. Among other things, this data will help myself and the rest of the Go team plan future Go events and schedule conference appearances.<br/><br/>Please take a minute to <a href="https://docs.google.com/spreadsheet/viewform?hl=en_US&amp;formkey=dFdxOTU1Mm92VFA3eHdkekFPamJjUnc6MQ#gid=0">complete the survey now</a>.<br/><br/>Thanks!<br/>Andrew<div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-6022389222427866794?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2011-12-21T23:55:02Z</updated>
    <published>2011-12-21T23:54:00Z</published>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-4874790252976560918</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/4874790252976560918" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/4874790252976560918" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/12/building-stathat-with-go.html" rel="alternate" type="text/html"/>
    <title>Building StatHat with Go</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>My name is Patrick Crosby and I'm the founder of a company called Numerotron. We recently released <a href="http://www.stathat.com">StatHat</a>.  This post is about why we chose to develop StatHat in <a href="http://golang.org">Go</a>, including details about how we are using Go. </p> <p><a href="http://www.stathat.com">StatHat</a> is a tool to track statistics and events in your code.  Everyone from HTML designers to backend engineers can use StatHat easily, as it supports sending stats from HTML, JavaScript, Go, and twelve other languages. </p> <p>You send your numbers to StatHat; it generates beautiful, fully-embeddable graphs of your data.  StatHat will alert you when specified triggers occur, send you daily email reports, and much more.  So instead of spending time writing tracking or reporting tools for your application, you can concentrate on the code.  While you do the real work, StatHat remains intensely vigilant, like an eagle in its mountaintop nest, or a babysitter on meth. </p> <p>Here's an example of a StatHat graph of the temperature in NYC, Chicago, and San Francisco: </p> <p/><div class="separator" style="clear: both; text-align: center;"><a href="http://3.bp.blogspot.com/-tjeZA4l2b9k/Tuld_bk2MWI/AAAAAAAAAEs/gXHOPRUutuA/s1600/weather.png" style=""><img border="0" height="277" src="http://3.bp.blogspot.com/-tjeZA4l2b9k/Tuld_bk2MWI/AAAAAAAAAEs/gXHOPRUutuA/s400/weather.png" width="400"/></a><br/><small>(click to enlarge)</small></div><p/> <p><b>Architecture Overview</b></p> <p>StatHat consists of two main services:  incoming statistic/event API calls and the web application for viewing and analyzing stats.  We wanted to keep these as separate as possible to isolate the data collection from the data interaction.   We did this for many reasons, but one major reason is that we anticipate handling a ton of automated incoming API HTTP requests and would thus have different optimization strategies for the API service than a web application interacting with humans. </p> <p><img src="http://3.bp.blogspot.com/-yJiQlSjOTfo/TuleFyFgdFI/AAAAAAAAAE4/H7n3mamijlQ/s1600/stathat_architecture.png"/></p> <p>The web application service is multi-tiered.  The web server processes all requests and sends them to an interactor layer.  For simple tasks, the interactor will handle generating any necessary data.  For complex tasks, the interactor relies on multiple application servers to handle tasks like generating graphs or analyzing data sets.  After the interactor is finished, the web server sends the result to a presenter.  The presenter responds to the HTTP request with either HTML or JSON.  We can horizontally scale the web, API, application servers, and databases as the demand for services grows and changes over time.  There is no single point of failure as each application server has multiple copies running.  The interactor layer allows us to have different interfaces to the system:  http, command line, automated tests, mobile API.  StatHat uses MySQL for data storage. </p> <p><b>Choosing Go</b></p> <p>When we designed StatHat, we had the following check list for our development tools: </p> <ul><li>same programming language for backend and frontend systems </li><li>good, fast HTML templating system </li><li>fast start-up, recompilation, testing for lots of tinkering </li><li>lots of connections on one machine </li><li>language tools for handling application-level concurrency </li><li>good performance </li><li>robust RPC layer to talk between tiers </li><li>lots of libraries </li><li>open source </li></ul> <p>We evaluated many popular and not-so-popular web technologies and ended up choosing to develop it in Go. </p> <p>When Go was released in November 2009, I immediately installed it and loved the fast compilation times, goroutines, channels, garbage collection, and all the packages that were available.  I was especially pleased with how few lines of code my applications were using.  I soon experimented with making a web app called <a href="http://langalot.com/">Langalot</a> that concurrently searched through five foreign language dictionaries as you typed in a query.  It was blazingly fast.  I put it online and it's been running since February, 2010. </p> <p>The following sections detail how Go meets StatHat's requirements and our experience using Go to solve our problems. </p> <p><b>Runtime</b></p> <p>We use the standard Go <a href="http://golang.org/pkg/http/">http package</a> for our API and web app servers.  All requests first go through Nginx and any non-file requests are proxied to the Go-powered http servers.  The backend servers are all written in Go and use the <a href="http://golang.org/pkg/rpc/">rpc package</a> to communicate with the frontend. </p> <p><b>Templating</b></p> <p>We built a template system using the standard <a href="http://golang.org/pkg/template/">template package</a>.  Our system adds layouts, some common formatting functions, and the ability to recompile templates on-the-fly during development.  We are very pleased with the performance and functionality of the Go templates. </p> <p><b>Tinkering</b></p> <p>In a previous job, I worked on a video game called Throne of Darkness that was written in C++.  We had a few header files that, when modified, required a full rebuild of the entire system, 20-30 minutes long.  If anyone ever changed `Character.h`, he would be subject to the wrath of every other programmer.  Besides this suffering, it also slowed down development time significantly. </p> <p>Since then, I've always tried to choose technologies that allowed fast, frequent tinkering.  With Go, compilation time is a non-issue.  We can recompile the entire system in seconds, not minutes.  The development web server starts instantly, tests complete in a few seconds.  As mentioned previously, templates are recompiled as they change.  The result is that the StatHat system is very easy to work with, and the compiler is not a bottleneck. </p> <p><b>RPC</b></p> <p>Since StatHat is a multi-tiered system, we wanted an RPC layer so that all communication was standard.  With Go, we are using the <a href="http://golang.org/pkg/rpc/">rpc package</a> and the <a href="http://golang.org/pkg/gob/">gob package</a> for encoding Go objects.  In Go, the RPC server just takes any Go object and registers its exported methods.  There is no need for an intermediary interface description language.  We've found it very easy to use and many of our core application servers are under 300 lines of code. </p> <p><b>Libraries</b></p> <p>We don't want to spend time rewriting libraries for things like SSL, database drivers, JSON/XML parsers.  Although Go is a young language, it has a lot of system packages and a growing number of user-contributed packages.  With only a few exceptions, we have found Go packages for everything we have needed. </p> <p><b>Open source</b></p> <p>In our experience, it has been invaluable to work with open source tools. If something is going awry, it is immensely helpful to be able to examine the source through every layer and not have any black boxes.  Having the code for the language, web server, packages, and tools allows us to understand how every piece of the system works.  Everything in Go is open source.  In the Go codebase, we frequently read the tests as they often give great examples of how to use packages and language features. </p> <p><b>Performance</b></p> <p>People rely on StatHat for up to the minute analysis of their data and we need the system to be as responsive as possible.  In our tests, Go's performance blew away most of the competition.  We tested it against Rails, Sinatra, OpenResty, and Node.  StatHat has always monitored itself by tracking all kinds of performance metrics about requests, the duration of certain tasks, the amount of memory in use.  Because of this, we were able to easily evaluate different technologies.  We've also taken advantage of the benchmark performance testing features of the Go testing package. </p> <p><b>Application-Level Concurrency</b></p> <p>In a former life, I was the CTO at OkCupid.  My experience there using OKWS taught me the importance of async programming, especially when it comes to dynamic web applications.  There is no reason you should ever do something like this synchronously:  load a user from the database, then find their stats, then find their alerts.  These should all be done concurrently, yet surprisingly, many popular frameworks have no async support.  Go supports this at the language level without any callback spaghetti.  StatHat uses goroutines extensively to run multiple functions concurrently and channels for sharing data between goroutines. </p> <p><b>Hosting and Deployment</b></p> <p>StatHat runs on Amazon's EC2 servers.  Our servers are divided into several types: </p> <ul><li>API </li><li>Web </li><li>Application servers </li><li>Database </li></ul> <p>There are at least two of each type of server, and they are in different zones for high availability.  Adding a new server to the mix takes just a couple of minutes. </p> <p>To deploy, we first build the entire system into a time-stamped directory. Our packaging script builds the Go applications, compresses the CSS and JS files, and copies all the scripts and configuration files.  This directory is then distributed to all the servers, so they all have an identical distribution.  A script on each server queries its EC2 tags and determines what it is responsible for running and starts/stops/restarts any services. We frequently only deploy to a subset of the servers. </p> <p><b>More</b></p> <p>For more information on StatHat, please visit <a href="http://www.stathat.com">stathat.com</a>.  We are releasing some of the Go code we've written. Go to <a href="http://www.stathat.com/src">www.stathat.com/src</a>for all of the open source StatHat projects. </p> <p>To learn more about Go, visit <a href="http://golang.org/">golang.org</a>. </p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-4874790252976560918?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2011-12-19T17:00:05Z</updated>
    <published>2011-12-19T17:00:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="rpc"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="guest"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://go.hokapoka.com/?p=716</id>
    <link href="http://feedproxy.google.com/~r/GoOnWeb/~3/4CnXkqaI1Z8/" rel="alternate" type="text/html"/>
    <title>Go lang on OS X (lion)</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Recently I’ve moved from linux to OS X, yep I’m using a so-called “hackintosh”.   Having spent the past week learning how to live in the environment, which for the record I really live, it’s time to hack some Go! … <a href="http://go.hokapoka.com/uncategorized/go-lang-on-os-x-lion/">Continue reading <span class="meta-nav">→</span></a>
<p><a href="http://feedads.g.doubleclick.net/~a/wCqCVSEy0n2WQxsRfxDFS_W3yPk/0/da"><img border="0" ismap="true" src="http://feedads.g.doubleclick.net/~a/wCqCVSEy0n2WQxsRfxDFS_W3yPk/0/di"/></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/wCqCVSEy0n2WQxsRfxDFS_W3yPk/1/da"><img border="0" ismap="true" src="http://feedads.g.doubleclick.net/~a/wCqCVSEy0n2WQxsRfxDFS_W3yPk/1/di"/></a></p><img height="1" src="http://feeds.feedburner.com/~r/GoOnWeb/~4/4CnXkqaI1Z8" width="1"/></div>
    </summary>
    <updated>2011-12-17T11:43:05Z</updated>
    <category term="Uncategorized"/>
    <category term="go"/><feedburner:origLink xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://go.hokapoka.com/uncategorized/go-lang-on-os-x-lion/</feedburner:origLink>
    <author>
      <name>hokapoka</name>
    </author>
    <source>
      <id>http://go.hokapoka.com</id>
      <link href="http://go.hokapoka.com" rel="alternate" type="text/html"/>
      <link href="http://feeds.feedburner.com/GoOnWeb" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>Creating web content on Go</subtitle>
      <title>Go on web</title>
      <updated>2012-05-11T11:00:22Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-8453683069427342700</id>
    <link href="http://reneefrench.blogspot.com/feeds/8453683069427342700/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=8453683069427342700" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8453683069427342700" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/8453683069427342700" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/12/blog-post_15.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-J4J9sbKZm_o/TupDRhjg0zI/AAAAAAAAEaE/5pOAHuGljt8/s1600/thelawn1.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5686431447852831538" src="http://3.bp.blogspot.com/-J4J9sbKZm_o/TupDRhjg0zI/AAAAAAAAEaE/5pOAHuGljt8/s320/thelawn1.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 269px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-8453683069427342700?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-15T18:58:25Z</updated>
    <published>2011-12-15T18:57:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Houses"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-06-22T03:41:29Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-254114538233262349</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/254114538233262349" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/254114538233262349" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/12/from-zero-to-go-launching-on-google.html" rel="alternate" type="text/html"/>
    <title>From zero to Go: launching on the Google homepage in 24 hours</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p><i>This article was written by Reinaldo Aguiar, a software engineer from the Search team at Google. He shares his experience developing his first Go program and launching it to an audience of millions - all in one day!</i></p> <p>I was recently given the opportunity to collaborate on a small but highly visible "20% project": the <a href="http://www.google.com/logos/2011/thanksgiving.html">Thanksgiving 2011 Google Doodle</a>. The doodle features a turkey produced by randomly combining different styles of head, wings, feathers and legs. The user can customize it by clicking on the different parts of the turkey. This interactivity is implemented in the browser by a combination of JavaScript, CSS and of course HTML, creating turkeys on the fly. </p> <p><img src="http://3.bp.blogspot.com/-zMg-g0i8USY/TufjpLaNgkI/AAAAAAAAAD8/3_gzbA2E4XA/s1600/image00.png"/></p> <p>Once the user has created a personalized turkey it can be shared with friends and family by posting to Google+. Clicking a "Share" button (not pictured here) creates in the user's Google+ stream a post containing a snapshot of the turkey. The snapshot is a single image that matches the turkey the user created. </p> <p>With 13 alternatives for each of 8 parts of the turkey (heads, pairs of legs, distinct feathers, etc.) there are more than than 800 million possible snapshot images that could be generated. To pre-compute them all is clearly infeasible. Instead, we must generate the snapshots on the fly. Combining that problem with a need for immediate scalability and high availability, the choice of platform is obvious: Google App Engine! </p> <p>The next thing we needed to decide was which App Engine runtime to use. Image manipulation tasks are CPU-bound, so performance is the deciding factor in this case. </p> <p>To make an informed decision we ran a test. We quickly prepared a couple of equivalent demo apps for the new <a href="http://code.google.com/appengine/docs/python/python27/newin27.html">Python 2.7 runtime</a> (which provides <a href="http://www.pythonware.com/products/pil/">PIL</a>, a C-based imaging library) and the Go runtime. Each app generates an image composed of several small images, encodes the image as a JPEG, and sends the JPEG data as the HTTP response. The Python 2.7 app served requests with a median latency of 65 milliseconds, while the Go app ran with a median latency of just 32 milliseconds. </p> <p>This problem therefore seemed the perfect opportunity to try the experimental Go runtime. </p> <p>I had no previous experience with Go and the timeline was tight: two days to be production ready. This was intimidating, but I saw it as an opportunity to test Go from a different, often overlooked angle: development velocity. How fast can a person with no Go experience pick it up and build something that performs and scales? </p> <p><b>Design</b></p> <p>The approach was to encode the state of the turkey in the URL, drawing and encoding the snapshot on the fly. </p> <p>The base for every doodle is the background: </p> <p><img src="http://4.bp.blogspot.com/-PSBglYfknwE/Tufj1I-SeBI/AAAAAAAAAEI/HR2qE5xVk_4/s1600/image01.jpg"/></p> <p>A valid request URL might look like this: <a href="http://google-turkey.appspot.com/thumb/20332620">http://google-turkey.appspot.com/thumb/20332620</a></p> <p>The alphanumeric string that follows "/thumb/" indicates (in hexadecimal) which choice to draw for each layout element, as illustrated by this image: </p> <p><img src="http://2.bp.blogspot.com/-Un5APcocGtc/Tufj8_odUQI/AAAAAAAAAEU/-ZhuX_wjTHQ/s1600/image03.png"/></p> <p>The program's request handler parses the URL to determine which element is selected for each component, draws the appropriate images on top of the background image, and serves the result as a JPEG.  </p> <p>If an error occurs, a default image is served. There's no point serving an error page because the user will never see it - the browser is almost certainly loading this URL into an image tag.  </p> <p><b>Implementation</b></p> <p>In the package scope we declare some data structures to describe the elements of the turkey, the location of the corresponding images, and where they should be drawn on the background image. </p> <pre>var (<br/>    // dirs maps each layout element to its location on disk.<br/>    dirs = map[string]string{<br/>        "h": "img/heads",<br/>        "b": "img/eyes_beak",<br/>        "i": "img/index_feathers",<br/>        "m": "img/middle_feathers",<br/>        "r": "img/ring_feathers",<br/>        "p": "img/pinky_feathers",<br/>        "f": "img/feet",<br/>        "w": "img/wing",<br/>    }<br/><br/>    // urlMap maps each URL character position to<br/>    // its corresponding layout element.<br/>    urlMap = [...]string{"b", "h", "i", "m", "r", "p", "f", "w"}<br/><br/>    // layoutMap maps each layout element to its position<br/>    // on the background image.<br/>    layoutMap = map[string]image.Rectangle{<br/>        "h": {image.Pt(109, 50), image.Pt(166, 152)},<br/>        "i": {image.Pt(136, 21), image.Pt(180, 131)},<br/>        "m": {image.Pt(159, 7), image.Pt(201, 126)},<br/>        "r": {image.Pt(188, 20), image.Pt(230, 125)},<br/>        "p": {image.Pt(216, 48), image.Pt(258, 134)},<br/>        "f": {image.Pt(155, 176), image.Pt(243, 213)},<br/>        "w": {image.Pt(169, 118), image.Pt(250, 197)},<br/>        "b": {image.Pt(105, 104), image.Pt(145, 148)},<br/>    }<br/>)</pre> <p>The geometry of the points above was calculated by measuring the actual location and size of each layout element within the image. </p> <p>Loading the images from disk on each request would be wasteful repetition, so we load all 106 images (13 * 8 elements + 1 background + 1 default) into global variables upon receipt of the first request. </p> <pre>var (<br/>    // elements maps each layout element to its images.<br/>    elements = make(map[string][]*image.RGBA)<br/><br/>    // backgroundImage contains the background image data.<br/>    backgroundImage *image.RGBA<br/><br/>    // defaultImage is the image that is served if an error occurs. <br/>    defaultImage *image.RGBA<br/><br/>    // loadOnce is used to call the load function only on the first request.<br/>    loadOnce <a href="http://golang.org/pkg/sync/#Once">sync.Once</a><br/>)<br/><br/>// load reads the various PNG images from disk and stores them in their<br/>// corresponding global variables.<br/>func load() {<br/>    defaultImage = loadPNG(defaultImageFile)<br/>    backgroundImage = loadPNG(backgroundImageFile)<br/>    for dirKey, dir := range dirs {<br/>        paths, err := filepath.Glob(dir + "/*.png")<br/>        if err != nil {<br/>            panic(err)<br/>        }<br/>        for _, p := range paths {<br/>            elements[dirKey] = append(elements[dirKey], loadPNG(p))<br/>        }<br/>    }<br/>}</pre> <p>Requests are handled in a straightforward sequence: </p> <p/><ol><li>Parse the request URL, decoding the decimal value of each character in the path.</li><li>Make a copy of the background image as the base for the final image.</li><li>Draw each image element onto the background image using the layoutMap to determine where they should be drawn.</li><li>Encode the image as a JPEG</li><li>Return the image to user by writing the JPEG directly to the HTTP response writer.</li></ol><p/> <p>Should any error occur, we serve the defaultImage to the user and log the error to the App Engine dashboard for later analysis. </p> <p>Here's the code for the request handler with explanatory comments: </p> <pre>func handler(w http.ResponseWriter, r *http.Request) {<br/>    // <a href="http://blog.golang.org/2010/08/defer-panic-and-recover.html">Defer</a> a function to recover from any panics.<br/>    // When recovering from a panic, log the error condition to<br/>    // the App Engine dashboard and send the default image to the user.<br/>    defer func() {<br/>        if err := recover(); err != nil {<br/>            c := appengine.NewContext(r)<br/>            c.Errorf("%s", err)<br/>            c.Errorf("%s", "Traceback: %s", r.RawURL)<br/>            if defaultImage != nil {<br/>                w.Header().Set("Content-type", "image/jpeg")<br/>                jpeg.Encode(w, defaultImage, &amp;imageQuality)<br/>            }<br/>        }<br/>    }()<br/><br/>    // Load images from disk on the first request.<br/>    loadOnce.Do(load)<br/><br/>    // Make a copy of the background to draw into.<br/>    bgRect := backgroundImage.Bounds()<br/>    m := image.NewRGBA(bgRect.Dx(), bgRect.Dy())<br/>    draw.Draw(m, m.Bounds(), backgroundImage, image.ZP, draw.Over)<br/><br/>    // Process each character of the request string.<br/>    code := strings.ToLower(r.URL.Path[len(prefix):])<br/>    for i, p := range code {<br/>        // Decode hex character p in place.<br/>        if p &lt; 'a' {<br/>            // it's a digit<br/>            p = p - '0'<br/>        } else {<br/>            // it's a letter<br/>            p = p - 'a' + 10<br/>        }<br/><br/>        t := urlMap[i]    // element type by index<br/>        em := elements[t] // element images by type<br/>        if p &gt;= len(em) {<br/>            panic(fmt.Sprintf("element index out of range %s: "+<br/>                "%d &gt;= %d", t, p, len(em)))<br/>        }<br/><br/>        // Draw the element to m,<br/>        // using the layoutMap to specify its position.<br/>        draw.Draw(m, layoutMap[t], em[p], image.ZP, draw.Over)<br/>    }<br/><br/>    // Encode JPEG image and write it as the response.<br/>    w.Header().Set("Content-type", "image/jpeg")<br/>    w.Header().Set("Cache-control", "public, max-age=259200")<br/>    jpeg.Encode(w, m, &amp;imageQuality)<br/>}</pre> <p>For brevity, I've omitted several helper functions from these code listings. See the <a href="http://code.google.com/p/go-thanksgiving/source/browse/">source code</a> for the full scoop. </p> <p><b>Performance</b></p> <p><a href="http://3.bp.blogspot.com/-3dpdQWv1nzQ/TufkFj0bS-I/AAAAAAAAAEg/hONAssh_D9c/s1600/image02.png"><img border="0" height="99" src="http://3.bp.blogspot.com/-3dpdQWv1nzQ/TufkFj0bS-I/AAAAAAAAAEg/hONAssh_D9c/s400/image02.png" width="400"/></a></p> <p>This chart - taken directly from the App Engine dashboard - shows average request latency during launch. As you can see, even under load it never exceeds 60 ms, with a median latency of 32 milliseconds. This is wicked fast, considering that our request handler is doing image manipulation and encoding on the fly. </p> <p><b>Conclusions</b></p> <p>I found Go's syntax to be intuitive, simple and clean. I have worked a lot with interpreted languages in the past, and although Go is instead a statically typed and compiled language, writing this app felt more like working with a dynamic, interpreted language.  </p> <p>The development server provided with the <a href="http://code.google.com/appengine/downloads.html#Google_App_Engine_SDK_for_Go">SDK</a> quickly recompiles the program after any change, so I could iterate as fast as I would with an interpreted language. It's dead simple, too - it took less than a minute to set up my development environment. </p> <p>Go's great documentation also helped me put this together fast. The docs are generated from the source code, so each function's documentation links directly to the associated source code. This not only allows the developer to understand very quickly what a particular function does but also encourages the developer to dig into the package implementation, making it easier to learn good style and conventions. </p> <p>In writing this application I used just three resources: App Engine's <a href="http://code.google.com/appengine/docs/go/gettingstarted/helloworld.html">Hello World Go example</a>, <a href="http://golang.org/pkg/">the Go packages documentation</a>, and <a href="http://blog.golang.org/2011/09/go-imagedraw-package.html">a blog post showcasing the Draw package</a>. Thanks to the rapid iteration made possible by the development server and the language itself, I was able to pick up the language and build a super fast, production ready, doodle generator in less than 24 hours. </p> <p>Download the full app source code (including images) at <a href="http://code.google.com/p/go-thanksgiving/source/browse/">the Google Code project</a>. </p> <p>Special thanks go to Guillermo Real and Ryan Germick who designed the doodle.</p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-254114538233262349?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2011-12-14T23:23:56Z</updated>
    <published>2011-12-13T23:57:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="google"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="guest"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="appengine"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-1077868041528884488</id>
    <link href="http://reneefrench.blogspot.com/feeds/1077868041528884488/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=1077868041528884488" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1077868041528884488" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1077868041528884488" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/12/blog-post_12.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://2.bp.blogspot.com/-NIXW9qX73OU/TucCn3q1SSI/AAAAAAAAEZo/GDqKk_71wzU/s1600/thatactor.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5685515938560297250" src="http://2.bp.blogspot.com/-NIXW9qX73OU/TucCn3q1SSI/AAAAAAAAEZo/GDqKk_71wzU/s320/thatactor.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 285px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-1077868041528884488?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-13T07:45:42Z</updated>
    <published>2011-12-13T07:45:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-06-03T13:51:44Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-987865605111097896</id>
    <link href="http://reneefrench.blogspot.com/feeds/987865605111097896/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=987865605111097896" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/987865605111097896" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/987865605111097896" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/12/blog-post_11.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://2.bp.blogspot.com/-7aKFEglC_fk/TuWL7c1ZFRI/AAAAAAAAEY8/D54XqWqvuPk/s1600/astorstear8c.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5685103958093796626" src="http://2.bp.blogspot.com/-7aKFEglC_fk/TuWL7c1ZFRI/AAAAAAAAEY8/D54XqWqvuPk/s320/astorstear8c.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 286px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-987865605111097896?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-12T05:07:09Z</updated>
    <published>2011-12-12T05:06:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="story a"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-06-01T04:54:30Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-7267495688617918762</id>
    <link href="http://reneefrench.blogspot.com/feeds/7267495688617918762/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=7267495688617918762" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7267495688617918762" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7267495688617918762" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/12/blog-post_6254.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-ZA0o08OC2aM/TuPJ9kpPZ6I/AAAAAAAAEYw/OTFPpERek_0/s1600/postitfancyface3.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5684609214317553570" src="http://3.bp.blogspot.com/-ZA0o08OC2aM/TuPJ9kpPZ6I/AAAAAAAAEYw/OTFPpERek_0/s320/postitfancyface3.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 320px; height: 307px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-7267495688617918762?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-10T21:07:10Z</updated>
    <published>2011-12-10T21:06:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="post it show"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-05-25T17:02:34Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-1020160445062900438</id>
    <link href="http://reneefrench.blogspot.com/feeds/1020160445062900438/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=1020160445062900438" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1020160445062900438" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1020160445062900438" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/12/blog-post_1299.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-_tuQi-4XCXg/TuPI4RfwlpI/AAAAAAAAEYk/jxNB6cxOo-I/s1600/postitfancyface.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5684608023766537874" src="http://3.bp.blogspot.com/-_tuQi-4XCXg/TuPI4RfwlpI/AAAAAAAAEYk/jxNB6cxOo-I/s320/postitfancyface.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 290px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-1020160445062900438?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-10T21:02:36Z</updated>
    <published>2011-12-10T20:58:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="post it show"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="Monster story"/>
      <category term="line drawings"/>
      <category term="photographs"/>
      <category term="A.T."/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-05-24T08:10:03Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-3439118811583709525</id>
    <link href="http://reneefrench.blogspot.com/feeds/3439118811583709525/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=3439118811583709525" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3439118811583709525" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3439118811583709525" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/12/blog-post_10.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://4.bp.blogspot.com/-d0XW-Wq_X7g/TuPH6xU7O0I/AAAAAAAAEYY/sXiSBYZGPhQ/s1600/theturn23a.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5684606967159143234" src="http://4.bp.blogspot.com/-d0XW-Wq_X7g/TuPH6xU7O0I/AAAAAAAAEYY/sXiSBYZGPhQ/s320/theturn23a.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 268px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-3439118811583709525?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-10T20:58:32Z</updated>
    <published>2011-12-10T20:54:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="line drawings"/>
      <category term="photographs"/>
      <category term="A.T."/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-05-24T02:58:07Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/145279193217908737</id>
    <link href="http://twitter.com/_rsc/statuses/145279193217908737" rel="alternate" type="text/html"/>
    <title>_rsc: RT @littlecalculist: "The syntax is weird." — Everyone, of every new language, ever</title>
    <summary>_rsc: RT @littlecalculist: "The syntax is weird." — Everyone, of every new language, ever</summary>
    <updated>2011-12-09T23:10:33Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/143692879150321664</id>
    <link href="http://twitter.com/_rsc/statuses/143692879150321664" rel="alternate" type="text/html"/>
    <title>_rsc: RT @cahooon: watching the #golang html parser's progress (http://t.co/UuYbADmd) is impressive, and makes me excited to never write an ht ...</title>
    <summary>_rsc: RT @cahooon: watching the #golang html parser's progress (http://t.co/UuYbADmd) is impressive, and makes me excited to never write an ht ...</summary>
    <updated>2011-12-05T14:07:06Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/143692303507259393</id>
    <link href="http://twitter.com/_rsc/statuses/143692303507259393" rel="alternate" type="text/html"/>
    <title>_rsc: RT @ehedgehog: These three considerations ... bring us to the year -292277022399. #golang #epoch #newtimeAPI</title>
    <summary>_rsc: RT @ehedgehog: These three considerations ... bring us to the year -292277022399. #golang #epoch #newtimeAPI</summary>
    <updated>2011-12-05T14:04:49Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-7604849652182089169</id>
    <link href="http://reneefrench.blogspot.com/feeds/7604849652182089169/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=7604849652182089169" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7604849652182089169" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7604849652182089169" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/12/blog-post.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://3.bp.blogspot.com/-LEIzNT3qj3w/TtffgmkPOGI/AAAAAAAAEUs/53wrOIpm-So/s1600/meinebirdsm.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5681255206152517730" src="http://3.bp.blogspot.com/-LEIzNT3qj3w/TtffgmkPOGI/AAAAAAAAEUs/53wrOIpm-So/s320/meinebirdsm.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 236px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-7604849652182089169?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-01T20:12:15Z</updated>
    <published>2011-12-01T20:08:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="tonal drawings"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="line drawings"/>
      <category term="photographs"/>
      <category term="A.T."/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-05-16T14:02:04Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-7300216677776758754</id>
    <link href="http://reneefrench.blogspot.com/feeds/7300216677776758754/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=7300216677776758754" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7300216677776758754" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/7300216677776758754" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/07/blog-post_31.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://2.bp.blogspot.com/-b4cKVDw6D8k/TjU-PdklrDI/AAAAAAAADso/zsBMTUvzet0/s1600/gopherport.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5635478944081095730" src="http://2.bp.blogspot.com/-b4cKVDw6D8k/TjU-PdklrDI/AAAAAAAADso/zsBMTUvzet0/s320/gopherport.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 283px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-7300216677776758754?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-01T06:42:28Z</updated>
    <published>2011-07-31T11:36:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="line drawings"/>
      <category term="A.T."/>
      <category term="photographs"/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-01-15T19:03:27Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-1716117008706565599</id>
    <link href="http://reneefrench.blogspot.com/feeds/1716117008706565599/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=1716117008706565599" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1716117008706565599" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/1716117008706565599" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/09/blog-post_26.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://4.bp.blogspot.com/-F5cPRnDQO8A/ToFqzcOPKgI/AAAAAAAAEEs/TzIb-mIm9RM/s1600/themonster..jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5656920038935833090" src="http://4.bp.blogspot.com/-F5cPRnDQO8A/ToFqzcOPKgI/AAAAAAAAEEs/TzIb-mIm9RM/s320/themonster..jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 277px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-1716117008706565599?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-01T06:41:35Z</updated>
    <published>2011-09-27T06:18:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="portrait"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="line drawings"/>
      <category term="photographs"/>
      <category term="A.T."/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-03-04T19:45:44Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-5192082.post-3657053844381908358</id>
    <link href="http://reneefrench.blogspot.com/feeds/3657053844381908358/comments/default" rel="replies" type="application/atom+xml"/>
    <link href="http://www.blogger.com/comment.g?blogID=5192082&amp;postID=3657053844381908358" rel="replies" type="text/html"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3657053844381908358" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/5192082/posts/default/3657053844381908358" rel="self" type="application/atom+xml"/>
    <link href="http://reneefrench.blogspot.com/2011/10/blog-post_23.html" rel="alternate" type="text/html"/>
    <title/>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><a href="http://1.bp.blogspot.com/-MShYe0MPp5o/TqRL-ofMJMI/AAAAAAAAEPg/DkmObNVE_Kc/s1600/tlbcmonsm.jpg"><img alt="" border="0" id="BLOGGER_PHOTO_ID_5666737770531136706" src="http://1.bp.blogspot.com/-MShYe0MPp5o/TqRL-ofMJMI/AAAAAAAAEPg/DkmObNVE_Kc/s320/tlbcmonsm.jpg" style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; cursor: hand; width: 285px; height: 320px;"/></a><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/5192082-3657053844381908358?l=reneefrench.blogspot.com" width="1"/></div></div>
    </content>
    <updated>2011-12-01T06:40:13Z</updated>
    <published>2011-10-23T17:16:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="Houses"/>
    <author>
      <name>renee</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/04038449165206577034</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-5192082</id>
      <category term="eyes"/>
      <category term="line drawings"/>
      <category term="photographs"/>
      <category term="A.T."/>
      <category term="post it show"/>
      <category term="big drawings"/>
      <category term="story w"/>
      <category term="etching"/>
      <category term="drawn while"/>
      <category term="bunny"/>
      <category term="story sl"/>
      <category term="trap drawings"/>
      <category term="nipples"/>
      <category term="story t"/>
      <category term="rocks"/>
      <category term="story l"/>
      <category term="story c"/>
      <category term="f1 days"/>
      <category term="waiting room drawings"/>
      <category term="used match"/>
      <category term="portrait"/>
      <category term="story a"/>
      <category term="story z"/>
      <category term="flies"/>
      <category term="rabbits"/>
      <category term="Photograph"/>
      <category term="beakhead"/>
      <category term="f1days"/>
      <category term="Houses"/>
      <category term="road drawings"/>
      <category term="tonal drawings"/>
      <category term="story s"/>
      <category term="series h"/>
      <category term="tower"/>
      <category term="maps"/>
      <category term="detail"/>
      <category term="drawings"/>
      <category term="story m"/>
      <category term="painting"/>
      <category term="road"/>
      <category term="story h"/>
      <category term="notes"/>
      <author>
        <name>renee</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/04038449165206577034</uri>
      </author>
      <link href="http://reneefrench.blogspot.com/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://reneefrench.blogspot.com/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/5192082/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <subtitle>click to make them bigger</subtitle>
      <title>renee french</title>
      <updated>2012-04-11T02:56:07Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2011/11/29/certtransparency</id>
    <link href="http://www.imperialviolet.org/2011/11/29/certtransparency.html" rel="alternate" type="text/html"/>
    <title>Certificate Transparency</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>(<i>I don't have comments on this blog, but you can comment on my <a href="https://plus.google.com/u/1/118082204714636759510/posts/NZ8NrLXx4Uj">Google+ post</a>.</i>)</p>

<p><a href="http://www.links.org/">Ben Laurie</a> and I have been working on a longer term plan for improving the foundations of the certificate infrastructure on which most Internet transport security is based on these days. Although Chrome has <a href="http://www.imperialviolet.org/2011/05/04/pinning.html">public key pinning</a> for some domains, which limits the set of permitted certificates, we don't see public key pinning as a long term solution (and nor was it ever designed to be).</p>

<p>For the 10 second summary of the plan, I'll <a href="http://www.links.org/?p=1212">quote Ben</a>: “certificates are registered in a public audit log. Servers present proofs that their certificate is registered, along with the certificate itself. Clients check these proofs and domain owners monitor the logs.”. I would add only that anyone can check the logs: the certificate infrastructure would be fully transparent.</p>

<p>We now have an <a href="http://www.links.org/files/CertificateAuthorityTransparencyandAuditability.pdf">outline of the basic idea</a> and will be continuing to flesh it out in the coming months, hopefully in conjunction with other browser vendors.</p>

<p>But I thought that, at the outset, it would be helpful to describe some of the limitations to the design space, as I see them:</p>

<h4>No side-channels</h4>

<p>As I've <a href="http://www.imperialviolet.org/2011/10/08/certaxis.html">previously described</a>, side-channels occur when a browser needs to contact a server other than the immediate destination in order to verify a certificate. Revocation checking with OCSP is an example of a side-channel used today.</p>

<p>But in order to be effective, side-channels invariably need to block the certificate verification until they complete, and that's a big problem. The Internet isn't fully connected. Captive portals, proxies and firewalls all mean that the only thing you can really depend on talking to is the immediate destination server. Because of this, browsers have never been able to make OCSP lookups blocking, and therefore <a href="http://www.imperialviolet.org/2011/03/18/revocation.html">OCSP is basically useless for security</a>.</p>

<p>And that's not to mention the privacy, performance and functionality issues that arise from needing side-channels. (What happens when the side-channel server goes down?)</p>

<p>So our design requires that the servers send us the information that we require. We can use side-channels to check up on the logs, but it's an asynchronous lookup.</p>

<h4>It's not opt-in, it's all-in</h4>

<p><a href="http://www.thoughtcrime.org/software/sslstrip/">SSL Stripping</a> is a very easy and very effective attack. <a href="https://en.wikipedia.org/wiki/HTTP_Strict_Transport_Security">HSTS</a> prevents it and is as easy to deploy as anything can be for HTTPS sites. But, despite all this, and despite a significant amount of evangelism, take up has been very limited, even by sites which are HTTPS only and the subject of attacks.</p>

<p>While HSTS really has to be opt-in, a solution to the certificate problem doesn't. Although our scheme is incrementally deployable, the eventual aim is that it's required for everybody. Thankfully, since certificates have to be renewed there's an obvious means to incrementally deploy it: require it for certificates issued after a certain date. Although an eventual hard requirement is still needed, it's a lot less of a problem.</p>

<h4>It's easy on the server operator</h4>

<p>Since the aim is to make it a requirement for all servers, we've sacrificed a lot in order to make it very easy on the server operator. For most server operators, their CA will probably take care of fetching the audit proofs, meaning there's <i>no</i> additional work at all.</p>

<p>Some initial designs included short-lived log signatures, which would have solved the revocation problem. (Revocation would simply be a matter of instructing the logs to stop signing a given certificate.) However, this would have required server operators to update their audit proofs on a near-daily basis. After discussions it became clear that such a requirement wouldn't be tenable for many and so we reluctantly dropped it.</p>

<p>We are also sacrificing decentralisation to make things easy on the server. As I've previously argued, decentralisation isn't all it's cracked up to be in most cases because 99.99% of people will never change any default settings, so we haven't given up much. Our design does imply a central set of trusted logs which is universally agreed. This saves the server from possibly having to fetch additional audit proofs at runtime, something which requires server code changes and possible network changes.</p>

<h4>There are more valid certificates than the one that's currently serving</h4>

<p>Cheap virtual hosting and EC2 have made multi-homed services common. Even small to medium scale sites have multiple servers these days. So any scheme that asserts that the currently serving certificate is the only valid certificate will run into problems when certificates change. Unless all the servers are updated at <i>exactly</i> the same time, then users will see errors during the switch. These schemes also make testing a certificate with a small number of users impossible.</p>

<p>In the end, the only real authority on whether a certificate is valid <a href="http://dankaminsky.com/2011/08/31/notnotar/">is the site itself</a>. So we don't rely on external observations to decide on whether a certificate is valid, instead to seek to make the set of valid certificates for a site public knowledge (which it currently isn't), so that the site can determine whether it's correct.</p>

<h4>It's not easy to do</h4>

<p>We believe that this design will have a significant, positive impact on an important part of Internet security and that it's deployable. We also believe that any design that shares those two properties ends up looking a lot like it. (It's no coincidence that we share several ideas with the EFF's <a href="https://www.eff.org/deeplinks/2011/11/sovereign-keys-proposal-make-https-and-email-more-secure">Sovereign Keys</a>.)</p>

<p>None the less, deployment won't be easy and, hopefully, we won't be pushing it alone.</p></div>
    </content>
    <updated>2011-11-29T08:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-04-12T16:16:15Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/139412388377141248</id>
    <link href="http://twitter.com/_rsc/statuses/139412388377141248" rel="alternate" type="text/html"/>
    <title>_rsc: Road maps are more fun if you pretend they're Feynman diagrams.</title>
    <summary>_rsc: Road maps are more fun if you pretend they're Feynman diagrams.</summary>
    <updated>2011-11-23T18:37:58Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/139094971486711809</id>
    <link href="http://twitter.com/_rsc/statuses/139094971486711809" rel="alternate" type="text/html"/>
    <title>_rsc: @sdegutis If I remember correctly, lack of FFI is exactly why John McCarthy didn't use #golang to implement the first Lisp.</title>
    <summary>_rsc: @sdegutis If I remember correctly, lack of FFI is exactly why John McCarthy didn't use #golang to implement the first Lisp.</summary>
    <updated>2011-11-22T21:36:40Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.imperialviolet.org/2011/11/22/forwardsecret</id>
    <link href="http://www.imperialviolet.org/2011/11/22/forwardsecret.html" rel="alternate" type="text/html"/>
    <title>Forward secrecy for Google HTTPS</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>As <a href="http://googleonlinesecurity.blogspot.com/2011/11/protecting-data-for-long-term-with.html">announced</a> on the Google Security Blog, Google HTTPS sites now support forward secrecy. What this means in practice is two things:</p>

<p>Firstly, the preferred cipher suite for most Google HTTPS servers is <tt>ECDHE-RSA-RC4-SHA</tt>. If you have a client that supports it, you'll be using that ciphersuite. Chrome and Firefox, at least, support it.</p>

<p>Previously we were using RSA-RC4-SHA, which means that the client (i.e. browser) picks a random key for the session, encrypts it with the server's public key and sends it to the server. Since only the holder of the private key can decrypt the session key, the connection is secure.</p>

<p>However, if an attacker obtains the private key in the future then they can decrypt recorded traffic. The encrypted session key can be decrypted just as well in ten years time as it can be decrypted today and, in ten years time, the attacker has much more computing power to break the server's public key. If an attacker obtains the private key, they can decrypt everything encrypted to it, which could be many months of traffic.</p>

<p><tt>ECDHE-RSA-RC4-SHA</tt> means elliptic curve, ephemeral Diffie-Hellman, signed by an RSA key. You can see a <a href="http://www.imperialviolet.org/2010/12/04/ecc.html">previous post about elliptic curves</a> for an introduction, but the use of elliptic curves is an implementation detail.</p>

<p>Ephemeral Diffie-Hellman means that the server generates a new Diffie-Hellman public key for each session and signs the public key. The client also generates a public key and, thanks to <a href="http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange">the magic of Diffie-Hellman</a> they both generate a mutual key that no eavesdropper can know.</p>

<p>The important part here is that there's a different public key for each session. If the attacker breaks a single public key then they can decrypt only a single session. Also, the elliptic curve that we're using (P-256) is estimated to be as strong as a 3248-bit RSA key (by <a href="http://www.keylength.com/en/3/">ECRYPT II</a>), so it's unlikely that the attacker will ever be able to break a single instance of it without a large, quantum computer.</p>

<p>While working on this, Bodo Möller, Emilia Kasper and I wrote fast, constant-time implementations of P-224, P-256 and P-521 for OpenSSL. This work has been open-sourced and submitted upstream to OpenSSL. We also fixed several bugs in OpenSSL's ECDHE handling during deployment and those bug fixes are in OpenSSL 1.0.0e.</p>

<h4>Session Tickets</h4>

<p>The second part of forward secrecy is dealing with <a href="http://www.ietf.org/rfc/rfc5077">TLS session tickets</a>.</p>

<p>Session tickets allow a client to resume a previous session without requiring that the server maintain any state. When a new session is established the server encrypts the state of the session and sends it back to the client, in a session ticket. Later, the client can echo that encrypted session ticket back to the server to resume the session.</p>

<p>Since the session ticket contains the state of the session, and thus keys that can decrypt the session, it too must be protected by ephemeral keys. But, in order for session resumption to be effective, the keys protecting the session ticket have to be kept around for a certain amount of time: the idea of session resumption is that you can resume the session in the future, and you can't do that if the server can't decrypt the ticket!</p>

<p>So the ephemeral, session ticket keys have to be distributed to all the frontend machines, without being written to any kind of persistent storage, and frequently rotated.</p>

<h4>Result</h4>

<p>We believe that forward secrecy provides a fairly significant benefit to our users and we've contributed our work back to OpenSSL in the hope that others will make use of it.</p></div>
    </content>
    <updated>2011-11-22T08:00:00Z</updated>
    <source>
      <id>http://www.imperialviolet.org/</id>
      <author>
        <name>Adam Langley</name>
      </author>
      <link href="http://www.imperialviolet.org/iv-rss.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.imperialviolet.org/" rel="alternate" type="text/html"/>
      <title>ImperialViolet</title>
      <updated>2012-03-19T13:07:53Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://kylelemons.net/?p=227</id>
    <link href="http://kylelemons.net/2011/11/generic-types-in-go/" rel="alternate" type="text/html"/>
    <title>Throwing My Hat into the Ring</title>
    <summary>I won’t bore you with the details here; read the PDF for those.  Here are some examples to whet your appetite.

A somewhat comprehensive example:

// Package gen provides some example generic functionality.
package gen

// Generic types for this package
type Value generic
type Result generic
type ReduceFunc func(Result, Value) Result

// Tern is the ternary operator: Tern(cond,t,f) == (cond?t:f)
func Tern(cond [...]</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><h3><a href="http://kylelemons.net/download/GoGenericsProposal.pdf" title="Downloaded 277 times">Generics in Go</a> - A proposal for Generic Types in the Go language</h3>
<p>I won’t bore you with the details here; read the PDF for those.  Here are some examples to whet your appetite.</p>
<p/>
<p>A somewhat comprehensive example:</p>
<pre class="syntax Go">// Package gen provides some example generic functionality.
package gen

// Generic types for this package
type Value generic
type Result generic
type ReduceFunc func(Result, Value) Result

// Tern is the ternary operator: Tern(cond,t,f) == (cond?t:f)
func Tern(cond bool, t, f Value) Value {
  if cond {
    return t
  }
  return f
}

// Reduce returns the result of running the ReduceFunc on each successive value
// in list along with the last result.
func (red ReduceFunc) Reduce(r0 Result, list ...Value) Result {
  for _, v := range list {
    r0 = red(r0, v)
  }
  return r0
}

// Check strips out the os.Error return from a function call for use inline.
func Check(val Value, err os.Error) Value {
  if err != nil {
    panic(err)
  }
  return val
}
</pre>
<p/>
<p>Using that package:</p>
<pre class="syntax Go">package main

import (
  "fmt"
  "gen"
  "strconv"
)

func main() {
  add := gen.ReduceFunc(func(x0 int, x1 string) int {
    return x0 + gen.Check(strconv.Atoi(x1))
  })

	nums := os.Args[1:]
  fmt.Printf("Sum of your %s: %v\n",
    "number" + gen.Tern(len(nums)==1, "", "s"),
    add.Reduce(0, os.Args))
}
</pre>
<p/>
<p>Everybody’s favorite generic interface:</p>
<pre class="syntax Go">type Value generic
type Equaler interface {
  Equals(other Value) bool
}

// Integer implements Equaler.
type Integer int
func (i Integer) Equals(j Integer) bool {
	return i == j
}

// Compile-time check.
var _ Equaler = Integer(0)

// Search returns the index of the first element for which list[idx].Equal(val)
// returns true.
func Search(list []Equaler, val Value) int {
  for i, v := range list {
    if v.Equal(val) {
      return i
    }
  }
  return -1
}
</pre>
<p/>
<p>The proposal’s source can be found <a href="https://github.com/kylelemons/genericsproposal">on github</a>.</p></div>
    </content>
    <updated>2011-11-12T08:08:56Z</updated>
    <category term="Go"/>
    <category term="Programming"/>
    <category term="downloads"/>
    <category term="generics"/>
    <category term="go"/>
    <category term="types"/>
    <author>
      <name>Kyle Lemons</name>
    </author>
    <source>
      <id>http://kylelemons.net</id>
      <link href="http://kylelemons.net/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://kylelemons.net" rel="alternate" type="text/html"/>
      <subtitle>A little curiosity goes a long way</subtitle>
      <title>Eko Foxtrot</title>
      <updated>2012-04-30T02:00:03Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/135040708666081280</id>
    <link href="http://twitter.com/_rsc/statuses/135040708666081280" rel="alternate" type="text/html"/>
    <title>_rsc: RT @sesamestreet: Today is definitely brought to you by the number 11.</title>
    <summary>_rsc: RT @sesamestreet: Today is definitely brought to you by the number 11.</summary>
    <updated>2011-11-11T17:06:28Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-2412118057829967138</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/2412118057829967138" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/2412118057829967138" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/11/go-programming-language-turns-two.html" rel="alternate" type="text/html"/>
    <title>The Go Programming Language turns two</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Two years ago a small team at Google went public with their fledgling project - the Go Programming Language. They presented a language spec, two compilers, a modest standard library, some novel tools, and plenty of accurate (albeit succinct) documentation. They watched with excitement as programmers around the world began to play with Go. The team continued to iterate and improve on what they had built, and were gradually joined by dozens - and then hundreds - of programmers from the open source community. <p>The Go Authors went on to produce lots of libraries, new tools, and reams of <a href="http://golang.org/doc/docs.html">documentation</a>. They celebrated a successful year in the public eye with a <a href="http://blog.golang.org/2010/11/go-one-year-ago-today.html">blog post</a> last November that concluded "Go is certainly ready for production use, but there is still room for improvement. Our focus for the immediate future is making Go programs faster and more efficient in the context of high performance systems." </p><p>Today is the second anniversary of Go's release, and Go is faster and more stable than ever. Careful tuning of Go's code generators, concurrency primitives, garbage collector, and core libraries have increased the performance of Go programs, and native support for <a href="http://blog.golang.org/2011/06/profiling-go-programs.html">profiling</a> and <a href="http://blog.golang.org/2011/10/debugging-go-programs-with-gnu-debugger.html">debugging</a> makes it easier to detect and remove performance issues in user code. Go is also now easier to learn with <a href="http://tour.golang.org/">A Tour of Go</a>, an interactive tutorial you can take from the comfort of your web browser. </p><p>This year we introduced the experimental <a href="http://code.google.com/appengine/docs/go/">Go runtime</a> for Google's App Engine platform, and we have been steadily increasing the Go runtime's support for App Engine's APIs. Just this week we released <a href="http://code.google.com/appengine/downloads.html">version 1.6.0</a> of the Go App Engine SDK, which includes support for <a href="http://code.google.com/appengine/docs/go/backends/overview.html">backends</a> (long-running processes), finer control over datastore indexes, and various other improvements. Today, the Go runtime is near feature parity with - and is a viable alternative to - the Python and Java runtimes. In fact, we now serve <a href="http://golang.org/">golang.org</a> by running a version of <a href="http://golang.org/cmd/godoc/">godoc</a> on the App Engine service.  </p><p>While 2010 was a year of discovery and experimentation, 2011 was a year of fine tuning and planning for the future. This year we issued several "<a href="http://golang.org/doc/devel/release.html">release</a>" versions of Go that were more reliable and better supported than weekly snapshots. We also introduced <a href="http://golang.org/cmd/gofix/">gofix</a> to take the pain out of migrating to newer releases. Furthermore, last month we announced a <a href="http://blog.golang.org/2011/10/preview-of-go-version-1.html">plan for Go version 1</a> - a release that will be supported for years to come. Work toward Go 1 is already underway and you can observe our progress by the latest weekly snapshot at <a href="http://weekly.golang.org/pkg/">weekly.golang.org</a>. </p><p>The plan is to launch Go 1 in early 2012. We hope to bring the Go App Engine runtime out of "experimental" status at the same time. </p><p/><p>But that's not all. 2011 was an exciting year for the gopher, too. He has manifested himself as a plush toy (a highly prized gift at Google I/O and other Go talks) and in vinyl form (received by every attendee at OSCON and now available at the <a href="http://www.googlestore.com/Fun/Go+Gopher+Figurine.axd">Google Store</a>). </p><p><img src="http://1.bp.blogspot.com/-Wo2tN9kQyas/TrxkB7WfioI/AAAAAAAAADk/qOzlWSIzrKQ/s1600/gophers.jpg"/></p><p>And, most surprisingly, at Halloween he made an appearance with his gopher girlfriend! </p><p><img src="http://3.bp.blogspot.com/-_LT12eYgAbY/TrxkJFQY3bI/AAAAAAAAADw/fWCHEytwdec/s1600/costume.jpg"/><br/><small>Photograph by <a href="https://plus.google.com/106640494112897458359/posts">Chris Nokleberg</a>.</small></p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-2412118057829967138?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2011-11-11T00:28:42Z</updated>
    <published>2011-11-10T23:45:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="community"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="gopher"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="appengine"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://soniacodes.wordpress.com/?p=811</id>
    <link href="http://soniacodes.wordpress.com/2011/11/09/horse-racing-and-ant-colonies/" rel="alternate" type="text/html"/>
    <title>Horse racing and ant colonies</title>
    <summary type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">This post might be about a worker synchronization idiom—whatever an idiom is.  I don’t know.  Is it a way to solve a common problem in a particular language?  I don’t even know if idioms are good or bad. Anyway, suppose … <a href="http://soniacodes.wordpress.com/2011/11/09/horse-racing-and-ant-colonies/">Continue reading <span class="meta-nav">→</span></a><img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=soniacodes.wordpress.com&amp;blog=17218877&amp;post=811&amp;subd=soniacodes&amp;ref=&amp;feed=1" width="1"/></div>
    </summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>This post might be about a worker synchronization idiom—whatever an idiom is.  I don’t know.  Is it a way to solve a common problem in a particular language?  I don’t even know if idioms are good or bad.</p>
<p>Anyway, suppose you have a data structure and you want to let multiple workers concurrently read from it and, each doing things slightly differently, compute independent results.  The workers all need to see the entire data structure, but that’s okay because the data isn’t changing during this read and compute phase.  The results need to be combined and reduced.  When all the results are in and reduced, the result is used to update the shared data structure.  Then it all needs to be repeated for some number of iterations.  Is this common?  Are there physical simulations or stochastic algorithms that are like this?  I would think so.</p>
<p>I know, it’s not sounding like idiomatic Go.  It’s communicating by sharing memory.  But still, if it’s a common thing and there’s a way to do it in the language, isn’t that an idiom?  (Maybe it’s a <em>bad</em> idiom.  Then, I’ve heard people say all idioms are bad.  Maybe it’s a good idiom for doing a bad thing…)  Sometimes though, you have an existing algorithm and you want to follow it, even if it does communicate by sharing memory.</p>
<p>The important feature of the algorithm seemed to be the checkpoints (or barriers or whatever) that separate the phases.</p>
<p>Initialization | processing | update | processing | update | …</p>
<ul>
<li>Initialization is a single thread that sets up the shared data.</li>
<li>Processing involves multiple concurrent workers, and can only start after initialization is complete.</li>
<li>Update is a single thread again and can only start after all workers rendezvous.</li>
<li>The next iteration of processing can only start after the update is complete.</li>
</ul>
<p>It’s not too hard, and surely, like exercise #69 (it seems to be #70 now) there must be lots of ways to do it.  Before showing my complete program though, I tried reducing it to a minimal program that would show the just synchronization without the clutter of everything else.  It was at that point that the problem struck me as analogous to a horse race.</p>
<p>Initialization is like getting the track groomed and everything all set up.  It has to happen without the horses running around.  There is just one track.  It is shared.  To keep the horses from starting, there is a gate that holds them.  They all wait at the gate until the gate opens and lets them run.  Then they all begin to run concurrently.  They finish at different times and some data is recorded.  At some point, the gates must close in preparation for the next race.</p>
<p/><pre class="brush: plain;">package main

import (
    "fmt"
    "math/rand"
    "sync"
    "time"
)

var horses = []string{"pie", "biscuit", "lap", "derpy"}

const nRaces =  4

var startSignal, gates sync.WaitGroup
var finish = make(chan string, len(horses))

func main() {
    startSignal.Add(1)
    for _, name := range horses {
        go horse(name)
    }

    places := make([]string, len(horses))

    for r := 1; r &lt;= nRaces; r++ {
        gates.Add(len(horses))
        startSignal.Done()
        gates.Wait()
        startSignal.Add(1)

        for i := range horses {
            places[i] = &lt;-finish
        }
        fmt.Println("race", r, places)
    }
}

func horse(horseName string) {
    rnd := rand.New(rand.NewSource(time.Nanoseconds()))
    for {
        // wait for start signal
        startSignal.Wait()
        gates.Done()

        // do something
        time.Sleep(9e7+rnd.Int63n(2e7))

        // return result
        finish &lt;- horseName
    }
}
</pre><p/>
<p>Example output:</p>
<pre>race 1 [lap derpy biscuit pie]
race 2 [derpy pie biscuit lap]
race 3 [biscuit derpy lap pie]
race 4 [biscuit derpy pie lap]</pre>
<p>It seems a little clunky and mousetrap-like, but I think that might just be the nature of communicating by sharing memory. Results are gathered with a channel in the usual way, and then I use two WaitGroups to implement the latch mechanism of the starting gate. startSignal is binary and is a 1 to N broadcast. All of the horses wait on it to fall to zero, implementing the starting gates opening. Then there is the problem of setting it back to 1 for the start of the next race. It needs to be done before the first horse finishes, or else the horse will find the gate open and begin to run again. It cannot be done immediately on the next line of code however, because that leads to the gate snapping shut before some of the horses have had a chance to leave. The solution was a a separate WaitGroup, this one used in the more common N to 1 mode indicating when each goroutine has completed the step of the horse leaving the gate.</p>
<p>Finally now, the fun program. It’s still just a toy problem, but I coded up an <a href="http://www.cs.nott.ac.uk/~gxk/papers/cec05knights.pdf">ant colony solution</a>” of the <a href="http://en.wikipedia.org/wiki/Knight%27s_tour">knight’s tour problem</a> as described by Philip Hingston and Graham Kendall. It was fun to reproduce their results and get the same number for cumulative production rate. (Although I couldn’t figure out what they were doing to get the .09 number for mean production rate.</p>
<p/><pre class="brush: plain; collapse: true; light: false; toolbar: true;">package main

import (
    "fmt"
    "math/rand"
    "sync"
    "time"
)

const boardSize = 8
const nSquares = boardSize * boardSize
const completeTour = nSquares - 1
const cycles = 27000

// pheromone representation read by ants
var tNet = make([]float64, nSquares*8)

// row, col deltas of legal moves
var drc = [][]int{{1, 2}, {2, 1}, {2, -1}, {1, -2},
    {-1, -2}, {-2, -1}, {-2, 1}, {-1, 2}}

// get square reached by following edge k from square (r, c)
func dest(r, c, k int) (int, int, bool) {
    r += drc[k][0]
    c += drc[k][1]
    return r, c, r &gt;= 0 &amp;&amp; r &lt; boardSize &amp;&amp; c &gt;= 0 &amp;&amp; c &lt; boardSize
}

// struct represents a pheromone amount associated with a move
type rckt struct {
    r, c, k int
    t       float64
}

func main() {
    // waitGroups for ant release clockwork
    var start, reset sync.WaitGroup
    start.Add(1)
    // channel for ants to return tours with pheromone updates
    tch := make(chan []rckt)

    // create an ant for each square
    for r := 0; r &lt; boardSize; r++ {
        for c := 0; c &lt; boardSize; c++ {
            go ant(r, c, &amp;start, &amp;reset, tch)
        }
    }

    // accumulator for new pheromone amounts
    tNew := make([]float64, nSquares*8)

    // map for collecting set of complete tours
    allUnique := make(map[string]int)
    tbuf := make([]byte, 2+completeTour) // for building map key

    // heading
    fmt.Println("Board size:", boardSize)
    fmt.Println("Cycles per repeat:", cycles)
    fmt.Println("          Unique                        Production   Cumm.")
    fmt.Println("        complete     Cumm.      Total   rate         prod.")
    fmt.Println("Repeat     tours    unique   attempts   this repeat  rate")

    // each iteration is a "repeat" as described in the paper
    for repeat := 1; ; repeat++ {
        unique := make(map[string]int) // complete tours this repeat

        // initialize board
        for r := 0; r &lt; boardSize; r++ {
            for c := 0; c &lt; boardSize; c++ {
                for k := 0; k &lt; 8; k++ {
                    if _, _, ok := dest(r, c, k); ok {
                        tNet[(r*boardSize+c)*8+k] = 1e-6
                    }
                }
            }
        }

        // each iteration is a "cycle" as described in the paper
        for i := 0; i &lt; cycles; i++ {
            // evaporate pheromones
            for i := range tNet {
                tNet[i] *= .75
            }

            reset.Add(nSquares) // number of ants to release
            start.Done()        // release them
            reset.Wait()        // wait for them to begin searching
            start.Add(1)        // reset start signal for next cycle

            // gather tours from ants
            for i := 0; i &lt; nSquares; i++ {
                tour := &lt;-tch
                // accumulate complete tours
                if len(tour) == completeTour {
                    tbuf[0] = byte(tour[0].r)
                    tbuf[1] = byte(tour[0].c)
                    for i, m := range tour {
                        tbuf[i+2] = byte(m.k)
                    }
                    key := string(tbuf)
                    unique[key] = 1
                    allUnique[key] = 1
                }
                // accumulate pheromone amounts from all ants
                for _, move := range tour {
                    tNew[(move.r*boardSize+move.c)*8+move.k] += move.t
                }
            }

            // update pheromone amounts on network, reset accumulator
            for i, tn := range tNew {
                tNet[i] += tn
                tNew[i] = 0
            }
        }

        // print statistics
        //  fmt.Println("          Unique                        Production   Cumm.")
        //  fmt.Println("        complete     Cumm.       Total   rate         prod.")
        //  fmt.Println("Repeat     tours    unique    attempts   this repeat  rate")
        fmt.Printf("%6d %9d %9d %10d   %6.4f       %6.4f\n",
            repeat, len(unique), len(allUnique), repeat*cycles*nSquares,
            float64(len(unique))/float64(cycles*nSquares),
            float64(len(allUnique))/float64(repeat*cycles*nSquares))
    }
}

func printTour(tour []rckt) {
    seq := make([]int, nSquares)
    for i, sq := range tour {
        seq[sq.r*boardSize+sq.c] = i + 1
    }
    last := tour[len(tour)-1]
    r, c, _ := dest(last.r, last.c, last.k)
    seq[r*boardSize+c] = nSquares
    fmt.Println("Move sequence:")
    for r := 0; r &lt; boardSize; r++ {
        for c := 0; c &lt; boardSize; c++ {
            m := seq[r*boardSize+c]
            if m &gt; 0 {
                fmt.Printf(" %3d", seq[r*boardSize+c])
            } else {
                fmt.Print("    ")
            }
        }
        fmt.Println()
    }
}

type square struct {
    r, c int
}

func ant(r, c int, start, reset *sync.WaitGroup, tourCh chan []rckt) {
    rnd := rand.New(rand.NewSource(time.Nanoseconds()))
    tabu := make([]square, nSquares)
    moves := make([]rckt, nSquares)
    unexp := make([]rckt, 8)
    tabu[0].r = r
    tabu[0].c = c

    for {
        // cycle initialization
        moves = moves[:0]
        tabu = tabu[:1]
        r := tabu[0].r
        c := tabu[0].c

        // wait for start signal
        start.Wait()
        reset.Done()

        for {
            // choose next move
            unexp = unexp[:0]
            var tSum float64
        findU:
            for k := 0; k &lt; 8; k++ {
                dr, dc, ok := dest(r, c, k)
                if !ok {
                    continue
                }
                for _, t := range tabu {
                    if t.r == dr &amp;&amp; t.c == dc {
                        continue findU
                    }
                }
                tk := tNet[(r*boardSize+c)*8+k]
                tSum += tk
                // note:  dest r, c stored here
                unexp = append(unexp, rckt{dr, dc, k, tk})
            }
            if len(unexp) == 0 {
                break // no moves
            }
            rn := rnd.Float64() * tSum
            var move rckt
            for _, move = range unexp {
                if rn &lt;= move.t {
                    break
                }
                rn -= move.t
            }

            // move to new square
            move.r, r = r, move.r
            move.c, c = c, move.c
            tabu = append(tabu, square{r, c})
            moves = append(moves, move)
        }

        // compute pheromone amount to leave
        for i := range moves {
            moves[i].t = float64(len(moves)-i) / float64(completeTour-i)
        }

        // return tour found for this cycle
        tourCh &lt;- moves
    }
}
</pre><p/>
<p>Output:</p>
<pre>Board size: 8
Cycles per repeat: 27000
          Unique                        Production   Cumm.
        complete     Cumm.      Total   rate         prod.
Repeat     tours    unique   attempts   this repeat  rate
     1    176027    176027    1728000   0.1019       0.1019
     2    172491    348518    3456000   0.0998       0.1008
     3    201836    550354    5184000   0.1168       0.1062
     4    104574    654928    6912000   0.0605       0.0948
     5    117130    772058    8640000   0.0678       0.0894
...
    95    193387  12424890  164160000   0.1119       0.0757
    96     37647  12462537  165888000   0.0218       0.0751
    97    121887  12584424  167616000   0.0705       0.0751
    98    145072  12729496  169344000   0.0840       0.0752
    99    162658  12892154  171072000   0.0941       0.0754
   100    206599  13098753  172800000   0.1196       0.0758</pre>
<br/>  <a href="http://feeds.wordpress.com/1.0/gocomments/soniacodes.wordpress.com/811/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/soniacodes.wordpress.com/811/"/></a> <a href="http://feeds.wordpress.com/1.0/godelicious/soniacodes.wordpress.com/811/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/soniacodes.wordpress.com/811/"/></a> <a href="http://feeds.wordpress.com/1.0/gofacebook/soniacodes.wordpress.com/811/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/soniacodes.wordpress.com/811/"/></a> <a href="http://feeds.wordpress.com/1.0/gotwitter/soniacodes.wordpress.com/811/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/soniacodes.wordpress.com/811/"/></a> <a href="http://feeds.wordpress.com/1.0/gostumble/soniacodes.wordpress.com/811/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/soniacodes.wordpress.com/811/"/></a> <a href="http://feeds.wordpress.com/1.0/godigg/soniacodes.wordpress.com/811/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/soniacodes.wordpress.com/811/"/></a> <a href="http://feeds.wordpress.com/1.0/goreddit/soniacodes.wordpress.com/811/" rel="nofollow"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/soniacodes.wordpress.com/811/"/></a> <img alt="" border="0" height="1" src="http://stats.wordpress.com/b.gif?host=soniacodes.wordpress.com&amp;blog=17218877&amp;post=811&amp;subd=soniacodes&amp;ref=&amp;feed=1" width="1"/></div>
    </content>
    <updated>2011-11-10T01:07:28Z</updated>
    <category term="golang"/><geo:lat xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">42.375097</geo:lat><geo:long xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#">-71.105608</geo:long>
    <author>
      <name>Sonia</name>
    </author>
    <source>
      <id>http://soniacodes.wordpress.com</id>
      <logo>http://s2.wp.com/i/buttonw-com.png</logo>
      <link href="http://soniacodes.wordpress.com/feed/" rel="self" type="application/atom+xml"/>
      <link href="http://soniacodes.wordpress.com" rel="alternate" type="text/html"/>
      <link href="http://soniacodes.wordpress.com/osd.xml" rel="search" type="application/opensearchdescription+xml"/>
      <link href="http://soniacodes.wordpress.com/?pushpress=hub" rel="hub" type="text/html"/>
      <subtitle>Programming in Go</subtitle>
      <title>Sonia Codes</title>
      <updated>2012-03-28T23:00:18Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/133979257788563456</id>
    <link href="http://twitter.com/_rsc/statuses/133979257788563456" rel="alternate" type="text/html"/>
    <title>_rsc: RT @thehistoryguy: BBC reporter: 'This could be the worst crisis Greece has ever known'. There speaks a man without a history degree.</title>
    <summary>_rsc: RT @thehistoryguy: BBC reporter: 'This could be the worst crisis Greece has ever known'. There speaks a man without a history degree.</summary>
    <updated>2011-11-08T18:48:38Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry xml:lang="en">
    <id>http://www.airs.com/blog/?p=540</id>
    <link href="http://feedproxy.google.com/~r/Airs-IanLanceTaylor/~3/GVQpclW21hM/540" rel="alternate" type="text/html"/>
    <title>Anonymous</title>
    <summary>There is no chance that Edward de Vere, the Earl of Oxford, wrote the plays attributed to William Shakespeare. That said, I found the movie Anonymous to be reasonably watchable, although I thought many of Vanessa Redgrave’s scenes as the older Queen Elizabeth were ridiculous. But since the movie claims (perhaps as a joke) to [...]</summary>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>There is no chance that Edward de Vere, the Earl of Oxford, wrote the plays attributed to William Shakespeare.</p>
<p>That said, I found the movie Anonymous to be reasonably watchable, although I thought many of Vanessa Redgrave’s scenes as the older Queen Elizabeth were ridiculous.  But since the movie claims (perhaps as a joke) to be seriously advocating the position that Oxford wrote the plays, I was surprised that they did such a poor job of supporting the theory.</p>
<p>Oxford was shown as being tutored at length on topics other than poetry.  He traveled abroad, he intrigued at court.  When would he have had time to write the plays and the sonnets?  The movie essentially presents Oxford as being mysterious gifted by the ability to write; he speaks of continual voices in his head.  That could happen to anybody, and perhaps describes the real Shakespeare–if anybody could have written Shakespeare’s plays, then why not Shakespeare himself?</p>
<p>Oxford is shown as using the plays to support his court intrigues.  Is it possible to imagine Shakespeare, with his clear vision of humanity, thinking that he could achieve such ends through his plays?  One of the strongest examples of that in the movie was the suggestion that it was odd that Shakespeare portrayed Richard III as a hunchback, but even I know that Richard III was popularly (and probably falsely) considered to be a hunchback long before Shakespeare’s time.</p>
<p>Of course it’s conceivable if unlikely that somebody else wrote Shakepeare’s plays.  But the undercurrent of the Oxford theory has always been that a member of the nobility would be more likely as the playwright than a commoner.  But this reverses reality.  The nobility were highly trained from birth in their roles in society.  They were busy people with lots to do.  It was far less likely that an earl could write the plays than a member of the middle class.  As far as I know only one member of the English nobility ever achieved any note as an author: Lord Dunsany, who lived much later.</p>
<p>The movie did have a couple of nice (non-Shakespearean) lines, one of which, by the Ben Jonson character, was simply the truth: the only reason future ages remember the people who lived then was because they were alive when Shakespeare was writing.</p>

<p><a href="http://feedads.g.doubleclick.net/~a/rCisNH10194M8hdWw0FljpXPJF0/0/da"><img border="0" ismap="true" src="http://feedads.g.doubleclick.net/~a/rCisNH10194M8hdWw0FljpXPJF0/0/di"/></a><br/>
<a href="http://feedads.g.doubleclick.net/~a/rCisNH10194M8hdWw0FljpXPJF0/1/da"><img border="0" ismap="true" src="http://feedads.g.doubleclick.net/~a/rCisNH10194M8hdWw0FljpXPJF0/1/di"/></a></p><img height="1" src="http://feeds.feedburner.com/~r/Airs-IanLanceTaylor/~4/GVQpclW21hM" width="1"/></div>
    </content>
    <updated>2011-11-07T18:09:41Z</updated>
    <category term="Movies"/><feedburner:origLink xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0">http://www.airs.com/blog/archives/540</feedburner:origLink>
    <author>
      <name>Ian Lance Taylor</name>
    </author>
    <source>
      <id>http://www.airs.com/blog</id>
      <link href="http://www.airs.com/blog" rel="alternate" type="text/html"/>
      <link href="http://feeds.feedburner.com/Airs-IanLanceTaylor" rel="self" type="application/atom+xml"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <subtitle>Ian Lance Taylor</subtitle>
      <title>Airs - Ian Lance Taylor</title>
      <updated>2012-03-04T21:00:32Z</updated>
    </source>
  </entry>

  <entry xml:lang="en-us">
    <id>http://twitter.com/_rsc/statuses/131933868046548994</id>
    <link href="http://twitter.com/_rsc/statuses/131933868046548994" rel="alternate" type="text/html"/>
    <title>_rsc: RT @Eris: When you think about it, the Bat Signal was probably the first cloud-based push notification.</title>
    <summary>_rsc: RT @Eris: When you think about it, the Bat Signal was probably the first cloud-based push notification.</summary>
    <updated>2011-11-03T03:21:00Z</updated>
    <source>
      <id>http://twitter.com/_rsc</id>
      <author>
        <name>RSC</name>
      </author>
      <link href="http://twitter.com/_rsc" rel="alternate" type="text/html"/>
      <link href="http://twitter.com/statuses/user_timeline/22455722.rss" rel="self" type="application/atom+xml"/>
      <subtitle>Twitter updates from Russ Cox / _rsc.</subtitle>
      <title>Twitter / _rsc</title>
      <updated>2012-10-10T18:01:16Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-4785765652966302237</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/4785765652966302237" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/4785765652966302237" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/11/writing-scalable-app-engine.html" rel="alternate" type="text/html"/>
    <title>Writing scalable App Engine applications</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Back in May, we <a href="http://blog.golang.org/2011/05/go-and-google-app-engine.html">announced</a> the Go runtime for App Engine. Since then, we've opened it up for everyone to use, added many new APIs, and improved performance. We have been thrilled by all the interesting ways that people are using Go on App Engine. <p>One of the key benefits of the Go runtime, apart from working in a fantastic language, is that it has high performance. Go applications compile to native code, with no interpreter or virtual machine getting between your program and the machine. </p><p>Making your web application fast is important because it is well known that a web site's latency has a measurable impact on user happiness, and <a href="http://googlewebmastercentral.blogspot.com/2010/04/using-site-speed-in-web-search-ranking.html">Google web search uses it as a ranking factor</a>. Also announced in May was that App Engine would be <a href="http://googleappengine.blogspot.com/2011/05/year-ahead-for-google-app-engine.html">leaving its Preview status</a> and transitioning to a <a href="http://www.google.com/enterprise/cloud/appengine/pricing.html">new pricing model</a>, providing another reason to write efficient App Engine applications. </p><p>To make it easier for Go developers using App Engine to write highly efficient, scalable applications, we recently updated some existing App Engine articles to include snippets of Go source code and to link to relevant Go documentation.  </p><ul><li><a href="http://code.google.com/appengine/articles/scaling/overview.html">Best practices for writing scalable applications</a></li><li><a href="http://code.google.com/appengine/articles/managing-resources.html">Managing Your App's Resource Usage</a></li></ul> <i>By David Symonds, November 2011</i><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-4785765652966302237?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2011-11-02T01:49:56Z</updated>
    <published>2011-11-02T01:49:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="optimization"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="appengine"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>tag:blogger.com,1999:blog-891002498403287956.post-9029139748344709384</id>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/9029139748344709384" rel="edit" type="application/atom+xml"/>
    <link href="http://www.blogger.com/feeds/891002498403287956/posts/default/9029139748344709384" rel="self" type="application/atom+xml"/>
    <link href="http://blog.golang.org/2011/10/debugging-go-programs-with-gnu-debugger.html" rel="alternate" type="text/html"/>
    <title>Debugging Go programs with the GNU Debugger</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml">Last year we <a href="http://blog.golang.org/2010/11/debugging-go-code-status-report.html">reported</a> that Go's <a href="http://golang.org/cmd/gc/">gc</a>/<a href="http://golang.org/cmd/6l/">ld</a> toolchain produces DWARFv3 debugging information that can be read by the GNU Debugger (GDB). Since then, work has continued steadily on improving support for debugging Go code with GDB. <p>Among the improvements are the ability to inspect goroutines and to print native Go data types, including structs, slices, strings, maps, interfaces, and channels. </p><p>To learn more about Go and GDB, see the <a href="http://golang.org/doc/debugging_with_gdb.html">Debugging with GDB</a> article.</p><div class="blogger-post-footer"><img alt="" height="1" src="https://blogger.googleusercontent.com/tracker/891002498403287956-9029139748344709384?l=blog.golang.org" width="1"/></div></div>
    </content>
    <updated>2011-10-31T02:06:23Z</updated>
    <published>2011-10-31T02:05:00Z</published>
    <category scheme="http://www.blogger.com/atom/ns#" term="debug"/>
    <category scheme="http://www.blogger.com/atom/ns#" term="gdb"/>
    <author>
      <name>Andrew Gerrand</name>
      <email>noreply@blogger.com</email>
      <uri>http://www.blogger.com/profile/00278048990682977366</uri>
    </author>
    <source>
      <id>tag:blogger.com,1999:blog-891002498403287956</id>
      <category term="tour"/>
      <category term="goroutine"/>
      <category term="slice"/>
      <category term="reflect"/>
      <category term="pprof"/>
      <category term="websocket"/>
      <category term="gopher"/>
      <category term="community"/>
      <category term="benchmark"/>
      <category term="syntax"/>
      <category term="recover"/>
      <category term="protobuf"/>
      <category term="interface"/>
      <category term="lzw"/>
      <category term="lagomorph"/>
      <category term="gob"/>
      <category term="function"/>
      <category term="draw"/>
      <category term="video"/>
      <category term="codewalk"/>
      <category term="image"/>
      <category term="lexer"/>
      <category term="gofmt"/>
      <category term="debug"/>
      <category term="xml"/>
      <category term="gif"/>
      <category term="type"/>
      <category term="v1"/>
      <category term="rpc"/>
      <category term="gdb"/>
      <category term="channel"/>
      <category term="talk"/>
      <category term="godoc"/>
      <category term="guest"/>
      <category term="gopath"/>
      <category term="cgo"/>
      <category term="concurrency"/>
      <category term="learn"/>
      <category term="libraries"/>
      <category term="c"/>
      <category term="appengine"/>
      <category term="gofix"/>
      <category term="moustache"/>
      <category term="panic"/>
      <category term="playground"/>
      <category term="closure"/>
      <category term="optimization"/>
      <category term="heroku"/>
      <category term="release"/>
      <category term="defer"/>
      <category term="error"/>
      <category term="profiling"/>
      <category term="json"/>
      <category term="google"/>
      <category term="rodent"/>
      <author>
        <name>Andrew Gerrand</name>
        <email>noreply@blogger.com</email>
        <uri>http://www.blogger.com/profile/00278048990682977366</uri>
      </author>
      <link href="http://blog.golang.org/feeds/posts/default" rel="http://schemas.google.com/g/2005#feed" type="application/atom+xml"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default" rel="self" type="application/atom+xml"/>
      <link href="http://blog.golang.org/" rel="alternate" type="text/html"/>
      <link href="http://pubsubhubbub.appspot.com/" rel="hub" type="text/html"/>
      <link href="http://www.blogger.com/feeds/891002498403287956/posts/default?start-index=26&amp;max-results=25" rel="next" type="application/atom+xml"/>
      <title>The Go Programming Language Blog</title>
      <updated>2012-09-04T05:19:37Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2011/10/30/Brain-Thaw</id>
    <link href="http://www.codegrunt.co.uk/2011/10/30/Brain-Thaw.html" rel="alternate" type="text/html"/>
    <title>Brain Thaw</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>After writing my <a href="http://www.codegrunt.co.uk/2011/10/23/AI-ML-Brain-Melt.html">last post</a>, I again worked my arse off this week to study both the Stanford <a href="http://ai-class.com">AI</a> and <a href="http://www.ml-class.org/">ML</a> classes in a less crunchy fashion than the week before. Unfortunately the crunch avoidance did not come to pass and I was up until 3am this morning (well, 2am if you take into account the clocks going back :-) cramming on AI.</p>

<p>Since I actually want to <em>learn</em> about AI (and apply it to <a href="https://github.com/lorenzo-stoakes/weak">weak</a>) I am not finding this cramming aspect of the study particularly beneficial. In my experience, cramming simply wears you out and gets you ready for a given short-term task (e.g. homework, later exams) before the information you’ve learned largely plops out of your brain.</p>

<p>For that reason, and for the sake of keeping this doable, I’ve decided to drop the machine learning course and focus fully on AI. There is an irony in that - I have found the AI work to be considerably more involved and challenging than machine learning (that’s not a comment on the relative quality of one course vs. the other by the way), however a. AI is of more relevance to what I want to do, and b. focusing on one thing reduces the stressful feeling of distraction that maintaing another course which requires homework, etc. brings.</p>

<p>I am still very interested in machine learning, so I might very well go over the machine learning course material at a later date. Additionally, the AI course contains some cross-over material so I won’t do entirely without.</p>

<p>Another aspect is that I would like to maintain my <a href="https://github.com/lorenzo-stoakes/stanford-ml-ai">notes</a> to a better standard than I have (and which more time would allow me to achieve), rather than having to rush them out because of time constraints. There are almost certainly better notes for the course out there, however there is nothing quite like having a set of notes to refer to you which you’ve written in your own style and to your own tastes. Not invented here syndrome, perhaps!</p>

<h2 id="metablog_tediousness">Meta-Blog Tediousness</h2>

<p>On an entirely different subject, you may have noticed I’ve deleted a number of posts. This is because I felt they were of little value and often quite negative. This blog is meant to be a diary of where I’m at in my tech life, and yes that involves both positive and negative, however there is nothing more tedious than wading through either rather mediocre technical posts, or moany personal ones. I’d like to maximise the chances of me (and to some degree others of course :-) actually enjoying reading this blog.</p>

<p>I can only apologise to those few whose comments have consequently been deleted from this site. Hopefully you can understand why I’ve done it.</p></div>
    </content>
    <updated>2011-10-29T23:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.mprescient.com/journal/2011/10/23/two-weeks-with-sprint.html</id>
    <link href="http://www.mprescient.com/journal/2011/10/23/two-weeks-with-sprint.html" rel="alternate" type="text/html"/>
    <title>Two weeks with Sprint</title>
    <content type="xhtml" xml:lang="en-US"><div xmlns="http://www.w3.org/1999/xhtml"><p><span id="internal-source-marker_0.10067513794638216">The lure of Sprint was too strong to pass up, but ultimately ended in letdown and abandon. </span><br/><br/><span>Sprint's pitch was simple. Where else can you get an all you can eat data plan and ample minutes for $75.00 including the government’s taxation scheme that Karl Marx would be proud of? Done. Sign me up.</span><br/><br/><span>Choosing a phone for Sprint's network was not as easy. They offer three compelling choices. </span><br/><br/><span>First, you can speak random thoughts of consciousness in a Sprint store, and if a customer has pressed the Siri button on the display model iPhone 4s, you'll likely get verbal confirmation to choose it. </span><br/><br/><span>For those flirting with escape from Jobs’ utopia, the gorilla glass encased false god of Android is eager to entice, with a Samsung Galaxy S II. Like a hollywood celeb it's light weight and beautiful. </span><br/><br/><span>But for some, age brings truth, hence the third option, a year old Samsung Nexus S anointed with the purity of plain Gingerbread. I chose this option.</span><br/><br/><span>Despite the sweetness of Gingerbread, there is nothing tasty about Samsung’s Nexus S. Extremely poor antennas for wifi, 3g and 4g? Check. A battery that can’t last ½ day with light to moderate use? Check. Screen jitter while scrolling through your twitter feed? Check. </span><br/><br/><span>Needless to say the phone went back to the Sprint store. This left two choices left. The iPhone 4s and the Galaxy S II. I opted with the Galaxy S II. </span><br/><br/><span>The Galaxy S II represents everything that is right and wrong about Android, the device manufacturers, and the carriers. </span><br/><br/><span>On the Galaxy S II, gone is the jerky scrolling of the Nexus S. The screen is vibrant and huge. Samsung retained its use of a plastic enclosure, yet improved its sturdiness, a move that makes the device feel better quality. The antennas are dramatically better, resulting in greater wifi availability and improved call quality.</span><br/><br/><span>Unfortunately, the battery still sucks. And Samsung managed to load the device up with crap ware that you cannot delete from the application menu. </span><br/><br/><span>To mitigate the battery life, I bought a few chargers to plant at strategic locations at home, in the car and at the office. And most of the crap ware can be stashed in a folder on the desktop. This uncluttered  things enough to pass inspection.</span><br/><br/><span>Just as I was getting used to the device, and on the last day of my free trial, Sprint dropped the mother of all bombs. They announced the ending of the unlimited data plan. Furthermore, current users would not be grandfathered in, and thus would be subject to huge data overage charges.</span></p>
<p>This triggered my immediate cancellation of the Sprint plan.</p>
<p><span>The data plan was the only reason why I went to Sprint in the first place. With Sprint customers faced a trade-off. You received unlimited data for a unreliable network that has poor coverage in rural areas. </span></p>
<p>With their latest decision, there is no tradeoff, and therefore no logical reason why anyone whould choose Sprint over another network.</p>
<p>I leveraged the "winback" program AT&amp;T offers customers who made the transgression of choosing another carrier. They put you back on the program exactly as you left it at no charge. </p>
<p><span>So here I am, back with AT&amp;T using a feature phone with nothing but time to ponder my next move. </span><br/><br/><span>Do I wait three weeks for Samsung’s Galaxy Nexus that boasts Ice Cream Sandwich, Google’s new OS? Do l let lust get the best of me, and choose a Windows Phone 7, with the Mango update, knowing I'll likely be ultiamtely dissapointed with its feature incompleteness? Or do I return to utopia with an iPhone 4s? </span><br/><br/><span>The reality is that in this temporal existence, utopia doesn’t exist and there is no perfect phone. Therefore, I’m sticking with my wife’s old feature phone. </span></p></div>
    </content>
    <updated>2011-10-23T19:40:19Z</updated>
    <published>2011-10-23T19:40:19Z</published>
    <category term="AT&amp;T"/>
    <category term="Galaxy S II"/>
    <category term="Nexus S"/>
    <category term="Samsung"/>
    <category term="Sprint"/>
    <category term="iPhone 4s"/>
    <author>
      <name>Charles Thompson</name>
    </author>
    <source>
      <id>http://www.mprescient.com/journal/</id>
      <link href="http://www.mprescient.com/journal/" rel="alternate" type="application/xhtml+xml"/>
      <link href="http://www.mprescient.com/journal/atom.xml" rel="self" type="application/atom+xml"/>
      <subtitle>Journal</subtitle>
      <title>Journal</title>
      <updated>2011-10-23T19:56:41Z</updated>
    </source>
  </entry>

  <entry>
    <id>http://www.codegrunt.co.uk/2011/10/23/AI-ML-Brain-Melt</id>
    <link href="http://www.codegrunt.co.uk/2011/10/23/AI-ML-Brain-Melt.html" rel="alternate" type="text/html"/>
    <title>AI/ML Brain Melt</title>
    <content type="xhtml"><div xmlns="http://www.w3.org/1999/xhtml"><p>Am currently attempting to do both the Stanford <a href="http://ai-class.com">AI</a> and <a href="http://www.ml-class.org/">Machine Learning</a> courses at once. My brain is melting.</p>

<p>I’m keeping my ongoing rough notes <a href="https://github.com/lorenzo-stoakes/stanford-ml-ai">on github</a>, I’m writing them in markdown so they render relatively nicely there.</p>

<p>I have realised that, if I am actually going to see both courses through to the end, I am going to have to put <em>everything else</em> on hold until they’re done.</p>

<p>Luckily, they both pertain to greater or lesser degrees to <a href="https://github.com/lorenzo-stoakes/weak">weak</a> so its not entirely a pause on other <a href="http://www.codegrunt.co.uk/projects.html">projects</a>. Also, I might choose to hack on weak from time-to-time since I am chomping at the bit to get it moving.</p></div>
    </content>
    <updated>2011-10-22T23:00:00Z</updated>
    <source>
      <id>http://www.codegrunt.co.uk/</id>
      <author>
        <name>Lorenzo Stoakes</name>
        <email>lstoakes@gmail.com</email>
      </author>
      <link href="http://www.codegrunt.co.uk/atom.xml" rel="self" type="application/atom+xml"/>
      <link href="http://www.codegrunt.co.uk/" rel="alternate" type="text/html"/>
      <title>codegrunt.co.uk</title>
      <updated>2012-08-08T21:27:53Z</updated>
    </source>
  </entry>
</feed>
