<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom"><title>Alex's Adventures on the Infobahn - org-mode</title><link href="https://www.bennee.com/~alex/" rel="alternate"></link><link href="https://www.bennee.com/~alex/blog/tag/org-mode/feed" rel="self"></link><id>https://www.bennee.com/~alex/</id><updated>2018-03-26T11:19:00+01:00</updated><subtitle>the wanderings of a supposed digital native</subtitle><entry><title>Solving the HKG18 puzzle with org-mode</title><link href="https://www.bennee.com/~alex/blog/2018/03/26/solving-the-hkg18-puzzle-with-org-mode/" rel="alternate"></link><published>2018-03-26T11:19:00+01:00</published><updated>2018-03-26T11:19:00+01:00</updated><author><name>alex</name></author><id>tag:www.bennee.com,2018-03-26:/~alex/blog/2018/03/26/solving-the-hkg18-puzzle-with-org-mode/</id><summary type="html">&lt;p&gt;One of the traditions I like about Linaro's Connect event is the
conference puzzle. Usually set by &lt;a href="https://www.linaro.org/author/dave-pigott/"&gt;Dave Piggot&lt;/a&gt; they provide a challenge
to your jet lagged brain. Full disclosure: I did not complete the
puzzle in time. In fact when Dave explained it I realised the answer
had been …&lt;/p&gt;</summary><content type="html">&lt;p&gt;One of the traditions I like about Linaro's Connect event is the
conference puzzle. Usually set by &lt;a href="https://www.linaro.org/author/dave-pigott/"&gt;Dave Piggot&lt;/a&gt; they provide a challenge
to your jet lagged brain. Full disclosure: I did not complete the
puzzle in time. In fact when Dave explained it I realised the answer
had been staring me in the face. However I thought a successful walk
through would make for a more entertaining read ;-)&lt;/p&gt;
&lt;p&gt;First the Puzzle:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;Take the clues below and solve them. Once solved, figure out what the
hex numbers mean and then you should be able to associate each of the
clue solutions with their respective hex numbers.&lt;/p&gt;
&lt;/blockquote&gt;
&lt;table id="org530cfaf" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"&gt;


&lt;colgroup&gt;
&lt;col  class="org-left" /&gt;

&lt;col  class="org-left" /&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th scope="col" class="org-left"&gt;Clue&lt;/th&gt;
&lt;th scope="col" class="org-left"&gt;Hex Number&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;

&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="org-left"&gt;Lava Ale Code&lt;/td&gt;
&lt;td class="org-left"&gt;1114DBA&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Be Google Roe&lt;/td&gt;
&lt;td class="org-left"&gt;114F6BE&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Natural Gin&lt;/td&gt;
&lt;td class="org-left"&gt;114F72A&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Pope Charger&lt;/td&gt;
&lt;td class="org-left"&gt;121EE50&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Dolt And Hunk&lt;/td&gt;
&lt;td class="org-left"&gt;12264BC&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Monk Hops Net&lt;/td&gt;
&lt;td class="org-left"&gt;122D9D9&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Is Enriched Tin&lt;/td&gt;
&lt;td class="org-left"&gt;123C1EF&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Bran Hearing Kin&lt;/td&gt;
&lt;td class="org-left"&gt;1245D6E&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Enter Slim Beer&lt;/td&gt;
&lt;td class="org-left"&gt;127B78E&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Herbal Cabbages&lt;/td&gt;
&lt;td class="org-left"&gt;1282FDD&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Jan Venom Hon Nun&lt;/td&gt;
&lt;td class="org-left"&gt;12853C5&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;A Cherry Skull&lt;/td&gt;
&lt;td class="org-left"&gt;1287B3C&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Each Noun Lands&lt;/td&gt;
&lt;td class="org-left"&gt;1298F0B&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Wave Zone Kits&lt;/td&gt;
&lt;td class="org-left"&gt;12A024C&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Avid Null Sorts&lt;/td&gt;
&lt;td class="org-left"&gt;12A5190&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Handcars All Trim&lt;/td&gt;
&lt;td class="org-left"&gt;12C76DC&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;h1&gt;Clues&lt;/h1&gt;
&lt;p&gt;It looks like all the clues are anagrams. I was lazy and just used the
first online anagram solver that Google pointed me at. However we can
automate this by combining org-mode with Python and the excellent
Beautiful Soup library.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="kn"&gt;from&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;bs4&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;BeautifulSoup&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;requests&lt;/span&gt;
&lt;span class="kn"&gt;import&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="nn"&gt;re&lt;/span&gt;

&lt;span class="c1"&gt;# ask internet to solve the puzzle&lt;/span&gt;
&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;http://anagram-solver.net/&lt;/span&gt;&lt;span class="si"&gt;%s&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;%&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;anagram&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;%20&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;requests&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;get&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;url&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="c1"&gt;# fish out the answers&lt;/span&gt;
&lt;span class="n"&gt;soup&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;BeautifulSoup&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;page&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="n"&gt;answers&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="n"&gt;soup&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;ul&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;class_&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;answers&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;answers&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;find_all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;li&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;li&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;text&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# filter out non computer related or poor results&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="ow"&gt;in&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Elmer Berstein&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Tim-Berners Lee&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Babbage Charles&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;Calude Shannon&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;]:&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;continue&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="c1"&gt;# filter out non proper names&lt;/span&gt;
&lt;span class="w"&gt;    &lt;/span&gt;&lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;re&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;&amp;quot;[a-z] [A-Z]&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
&lt;span class="w"&gt;        &lt;/span&gt;&lt;span class="k"&gt;break&lt;/span&gt;

&lt;span class="k"&gt;return&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;result&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So with &lt;code&gt;:var anagram=clues[2,0]&lt;/code&gt; we get&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;Ada Lovelace
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;I admit the "if result in []" is a bit of hack.&lt;/p&gt;
&lt;h1&gt;Hex Numbers&lt;/h1&gt;
&lt;p&gt;The hex numbers could be anything. But lets first start by converting
to something else.&lt;/p&gt;
&lt;table id="orgf38fe0d" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"&gt;


&lt;colgroup&gt;
&lt;col  class="org-left" /&gt;

&lt;col  class="org-right" /&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th scope="col" class="org-left"&gt;Hex Prompt&lt;/th&gt;
&lt;th scope="col" class="org-right"&gt;Number&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;

&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="org-left"&gt;1114DBA&lt;/td&gt;
&lt;td class="org-right"&gt;17911226&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;114F6BE&lt;/td&gt;
&lt;td class="org-right"&gt;18151102&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;114F72A&lt;/td&gt;
&lt;td class="org-right"&gt;18151210&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;121EE50&lt;/td&gt;
&lt;td class="org-right"&gt;19000912&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;12264BC&lt;/td&gt;
&lt;td class="org-right"&gt;19031228&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;122D9D9&lt;/td&gt;
&lt;td class="org-right"&gt;19061209&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;123C1EF&lt;/td&gt;
&lt;td class="org-right"&gt;19120623&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;1245D6E&lt;/td&gt;
&lt;td class="org-right"&gt;19160430&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;127B78E&lt;/td&gt;
&lt;td class="org-right"&gt;19380110&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;1282FDD&lt;/td&gt;
&lt;td class="org-right"&gt;19410909&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;12853C5&lt;/td&gt;
&lt;td class="org-right"&gt;19420101&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;1287B3C&lt;/td&gt;
&lt;td class="org-right"&gt;19430204&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;1298F0B&lt;/td&gt;
&lt;td class="org-right"&gt;19500811&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;12A024C&lt;/td&gt;
&lt;td class="org-right"&gt;19530316&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;12A5190&lt;/td&gt;
&lt;td class="org-right"&gt;19550608&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;12C76DC&lt;/td&gt;
&lt;td class="org-right"&gt;19691228&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The #+TBLFM: is &lt;code&gt;$1='(identity remote(clues,@@#$2))::$2='(string-to-number $1 16)&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;This is where I went down a blind alley. The fact all they all had the
top bit set made me think that Dave was giving a hint to the purpose
of the hex number in the way many &lt;a href="https://en.wikipedia.org/wiki/Cryptic_crossword"&gt;cryptic crosswords&lt;/a&gt; do (I know he is
a fan of these). However the more obvious answer is that everyone in
the list was born in the last millennium.&lt;/p&gt;
&lt;h1&gt;Looking up Birth Dates&lt;/h1&gt;
&lt;p&gt;Now I could go through all the names by hand and look up their birth
dates but as we are automating things perhaps we can use computers for
what they are good at. Unfortunately there isn't a simple web-api for
looking up this stuff. However there is a project called &lt;a href="http://wiki.dbpedia.org/about"&gt;DBpedia&lt;/a&gt; which
takes Wikipedia's data and attempts to make it semantically useful. We
can query this using a semantic query language called SparQL. If only
I could call it from Emacs&amp;#x2026;&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;select distinct ?birthDate {
  dbr:$name dbo:birthDate|dbp:birthDate ?birthDate
}
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;So calling with &lt;code&gt;:var name="Ada_Lovelace"&lt;/code&gt; we get&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&amp;quot;birthDate&amp;quot;
1815-12-10
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Of course it shouldn't be a surprise this exists. And in what I hope
is a growing trend &lt;a href="https://github.com/ljos/sparql-mode"&gt;sparql-mode&lt;/a&gt; supports org-mode out of the box. The
$name in the snippet is expanded from the passed in variables to the
function. This makes it a general purpose lookup function we can use
for all our names.&lt;/p&gt;
&lt;p&gt;There are a couple of wrinkles. We need to format the name we are
looking up with underscores to make a valid URL. Also the output spits
out a header and possible multiple birth dates. We can solve this with
a little wrapper function. It also introduces some rate limiting so we
don't smash DBpedia's public SPARQL endpoint.&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="p"&gt;;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;rate&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;limit&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sleep&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="mh"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;;;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="k"&gt;do&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;the&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;query&lt;/span&gt;
&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;let&lt;/span&gt;&lt;span class="o"&gt;*&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;((&lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;all&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;&amp;#39;((&lt;/span&gt;&lt;span class="s"&gt;&amp;quot; &amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;_&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;&amp;quot;Von&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;von&amp;quot;&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;name&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;
&lt;span class="w"&gt;       &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;ret&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;eval&lt;/span&gt;
&lt;span class="w"&gt;             &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;
&lt;span class="w"&gt;              &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;read&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;from&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;string&lt;/span&gt;
&lt;span class="w"&gt;               &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;format&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;(org-sbe get-dob (name $&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s"&gt;%s&lt;/span&gt;&lt;span class="se"&gt;\&amp;quot;&lt;/span&gt;&lt;span class="s"&gt;))&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;str&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;span class="w"&gt;  &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="k"&gt;string&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;to&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;number&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;replace&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;regexp&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;in&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="k"&gt;string&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;-&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="s"&gt;&amp;quot;&amp;quot;&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;car&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;cdr&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;s&lt;/span&gt;&lt;span class="o"&gt;-&lt;/span&gt;&lt;span class="n"&gt;lines&lt;/span&gt;&lt;span class="w"&gt; &lt;/span&gt;&lt;span class="n"&gt;ret&lt;/span&gt;&lt;span class="p"&gt;))))))&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;p&gt;Calling with &lt;code&gt;:var name="Ada Lovelace"&lt;/code&gt; we get&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre&gt;&lt;span&gt;&lt;/span&gt;&lt;code&gt;&lt;span class="mf"&gt;18151210&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;

&lt;h1&gt;Full Solution&lt;/h1&gt;
&lt;p&gt;So now we know what we are doing we need to solve all the puzzles and
lookup the data. Fortunately org-mode's tables are fully functional
spreadsheets except they are not limited to simple transformations.
Each formula can be a fully realised bit of elisp, calling other
source blocks as needed.&lt;/p&gt;
&lt;table id="orgb836df6" border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides"&gt;


&lt;colgroup&gt;
&lt;col  class="org-left" /&gt;

&lt;col  class="org-left" /&gt;

&lt;col  class="org-right" /&gt;
&lt;/colgroup&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th scope="col" class="org-left"&gt;Clue&lt;/th&gt;
&lt;th scope="col" class="org-left"&gt;Solution&lt;/th&gt;
&lt;th scope="col" class="org-right"&gt;DOB&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;

&lt;tbody&gt;
&lt;tr&gt;
&lt;td class="org-left"&gt;Herbal Cabbages&lt;/td&gt;
&lt;td class="org-left"&gt;Charles Babbage&lt;/td&gt;
&lt;td class="org-right"&gt;17911226&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Be Google Roe&lt;/td&gt;
&lt;td class="org-left"&gt;George Boole&lt;/td&gt;
&lt;td class="org-right"&gt;18151102&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Lava Ale Code&lt;/td&gt;
&lt;td class="org-left"&gt;Ada Lovelace&lt;/td&gt;
&lt;td class="org-right"&gt;18151210&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;A Cherry Skull&lt;/td&gt;
&lt;td class="org-left"&gt;Haskell Curry&lt;/td&gt;
&lt;td class="org-right"&gt;19000912&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Jan Venom Hon Nun&lt;/td&gt;
&lt;td class="org-left"&gt;John Von Neumann&lt;/td&gt;
&lt;td class="org-right"&gt;19031228&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Pope Charger&lt;/td&gt;
&lt;td class="org-left"&gt;Grace Hopper&lt;/td&gt;
&lt;td class="org-right"&gt;19061209&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Natural Gin&lt;/td&gt;
&lt;td class="org-left"&gt;Alan Turing&lt;/td&gt;
&lt;td class="org-right"&gt;19120623&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Each Noun Lands&lt;/td&gt;
&lt;td class="org-left"&gt;Claude Shannon&lt;/td&gt;
&lt;td class="org-right"&gt;19160430&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Dolt And Hunk&lt;/td&gt;
&lt;td class="org-left"&gt;Donald Knuth&lt;/td&gt;
&lt;td class="org-right"&gt;19380110&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Is Enriched Tin&lt;/td&gt;
&lt;td class="org-left"&gt;Dennis Ritchie&lt;/td&gt;
&lt;td class="org-right"&gt;19410909&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Bran Hearing Kin&lt;/td&gt;
&lt;td class="org-left"&gt;Brian Kernighan&lt;/td&gt;
&lt;td class="org-right"&gt;19420101&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Monk Hops Net&lt;/td&gt;
&lt;td class="org-left"&gt;Ken Thompson&lt;/td&gt;
&lt;td class="org-right"&gt;19430204&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Wave Zone Kits&lt;/td&gt;
&lt;td class="org-left"&gt;Steve Wozniak&lt;/td&gt;
&lt;td class="org-right"&gt;19500811&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Handcars All Trim&lt;/td&gt;
&lt;td class="org-left"&gt;Richard Stallman&lt;/td&gt;
&lt;td class="org-right"&gt;19530316&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Enter Slim Beer&lt;/td&gt;
&lt;td class="org-left"&gt;Tim Berners-Lee&lt;/td&gt;
&lt;td class="org-right"&gt;19550608&lt;/td&gt;
&lt;/tr&gt;


&lt;tr&gt;
&lt;td class="org-left"&gt;Avid Null Sorts&lt;/td&gt;
&lt;td class="org-left"&gt;Linus Torvalds&lt;/td&gt;
&lt;td class="org-right"&gt;19691228&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;

&lt;p&gt;The #+TBLFM: is &lt;code&gt;$1='(identity remote(clues,@@#$1))::$2='(org-sbe solve-anagram (anagram $$1))::$3='(org-sbe frob-dob (name $$2))&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;The hex numbers are helpfully sorted so as long as we sort the clues
table by the looked up date of birth using &lt;em&gt;M-x org-table-sort-lines&lt;/em&gt;
we are good to go.&lt;/p&gt;</content><category term="geek"></category><category term="connect"></category><category term="emacs"></category><category term="linaro"></category><category term="org-mode"></category></entry><entry><title>Workbooks for Benchmarking</title><link href="https://www.bennee.com/~alex/blog/2018/02/21/workbooks-for-benchmarking/" rel="alternate"></link><published>2018-02-21T20:34:00+00:00</published><updated>2018-02-21T20:34:00+00:00</updated><author><name>alex</name></author><id>tag:www.bennee.com,2018-02-21:/~alex/blog/2018/02/21/workbooks-for-benchmarking/</id><summary type="html">&lt;p&gt;While working on a major re-factor of &lt;a class="reference external" href="http://lists.gnu.org/archive/html/qemu-devel/2018-02/msg01330.html"&gt;QEMU's softfloat code&lt;/a&gt; I've been doing a lot of benchmarking. It can be quite tedious work as you need to be careful you've run the correct steps on the correct binaries and keeping notes is important. It is a task that cries out …&lt;/p&gt;</summary><content type="html">&lt;p&gt;While working on a major re-factor of &lt;a class="reference external" href="http://lists.gnu.org/archive/html/qemu-devel/2018-02/msg01330.html"&gt;QEMU's softfloat code&lt;/a&gt; I've been doing a lot of benchmarking. It can be quite tedious work as you need to be careful you've run the correct steps on the correct binaries and keeping notes is important. It is a task that cries out for scripting but that in itself can be a compromise as you end up stitching a pipeline of commands together in something like perl. You may script it all in a language designed for this sort of thing like R but then find your final upload step is a pain to implement.&lt;/p&gt;
&lt;p&gt;One solution to this is to use a literate programming workbook like &lt;a class="reference external" href="https://github.com/stsquad/testcases/blob/master/aarch64/benchmark.org"&gt;this&lt;/a&gt;. Literate programming is a style where you interleave your code with natural prose describing the steps you go through. This is different from simply having well commented code in a source tree. For one thing you do not have to leap around a large code base as everything you need is on the file you are reading, from top to bottom. There are many solutions out there including &lt;a class="reference external" href="https://github.com/jupyter/jupyter/wiki/A-gallery-of-interesting-Jupyter-Notebooks"&gt;various python based examples&lt;/a&gt;. Of course being a happy Emacs user I use one of its stand-out features &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Org-mode"&gt;org-mode&lt;/a&gt; which comes with multi-language &lt;a class="reference external" href="https://orgmode.org/worg/org-contrib/babel/"&gt;org-babel&lt;/a&gt; support. This allows me to document my benchmarking while scripting up the steps in a variety of &amp;quot;languages&amp;quot; depending on the my needs at the time. Let's take a look at the first section:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p class="rubric" id="orgb7da4a0"&gt;1 Binaries To Test&lt;/p&gt;
&lt;div id="text-1" class="outline-text-2"&gt;&lt;div class="line-block"&gt;
&lt;div class="line"&gt;Here we have several tables of binaries to test. We refer to the&lt;/div&gt;
&lt;div class="line"&gt;current benchmarking set from the next stage, Run Benchmark.&lt;/div&gt;
&lt;/div&gt;
&lt;div class="line-block"&gt;
&lt;div class="line"&gt;For a final test we might compare the system QEMU with a reference&lt;/div&gt;
&lt;div class="line"&gt;build as well as our current build.&lt;/div&gt;
&lt;/div&gt;
&lt;table border="1" class="docutils"&gt;
&lt;colgroup&gt;
&lt;col width="81%" /&gt;
&lt;col width="19%" /&gt;
&lt;/colgroup&gt;
&lt;thead valign="bottom"&gt;
&lt;tr&gt;&lt;th class="head"&gt;Binary&lt;/th&gt;
&lt;th class="head"&gt;title&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody valign="top"&gt;
&lt;tr&gt;&lt;td&gt;/usr/bin/qemu-aarch64&lt;/td&gt;
&lt;td&gt;system-2.5.log&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;~/lsrc/qemu/qemu-builddirs/arm-targets.build/aarch64-linux-user/qemu-aarch64&lt;/td&gt;
&lt;td&gt;master.log&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;~/lsrc/qemu/qemu.git/aarch64-linux-user/qemu-aarch64&lt;/td&gt;
&lt;td&gt;softfloat-v4.log&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;
&lt;/blockquote&gt;&lt;p&gt;Well that is certainly fairly explanatory. These are named org-mode tables which can be referred to in other code snippets and passed in as variables. So the next job is to run the benchmark itself:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p class="rubric" id="org5a36bd2"&gt;2 Run Benchmark&lt;/p&gt;
&lt;div id="text-2" class="outline-text-2"&gt;&lt;p&gt;This runs the benchmark against each binary we have selected above.&lt;/p&gt;
&lt;pre class="literal-block"&gt;
import subprocess
import os

runs=[]

for qemu,logname in files:
cmd=&amp;quot;taskset -c 0 %s ./vector-benchmark -n %s | tee %s&amp;quot; % (qemu, tests, logname)
    subprocess.call(cmd, shell=True)
    runs.append(logname)

    return runs
&lt;/pre&gt;
&lt;/div&gt;&lt;/blockquote&gt;
&lt;p&gt;So why use python as the test runner? Well truth is whenever I end up munging arrays in shell script I forget the syntax and end up jumping through all sorts of hoops. Easier just to have some simple python. I use python again later to read the data back into an org-table so I can pass it to the next step, graphing:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre class="literal-block"&gt;
set title &amp;quot;Vector Benchmark Results (lower is better)&amp;quot;
set style data histograms
set style fill solid 1.0 border lt -1

set xtics rotate by 90 right
set yrange [:]
set xlabel noenhanced
set ylabel &amp;quot;nsecs/Kop&amp;quot; noenhanced
set xtics noenhanced
set ytics noenhanced
set boxwidth 1
set xtics format &amp;quot;&amp;quot;
set xtics scale 0
set grid ytics
set term pngcairo size 1200,500

plot for [i=2:5] data using i:xtic(1) title columnhead
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;This is a &lt;a class="reference external" href="https://en.wikipedia.org/wiki/Gnuplot"&gt;GNU Plot&lt;/a&gt; script which takes the data and plots an image from it. org-mode takes care of the details of marshalling the table data into GNU Plot so all this script is really concerned with is setting styles and titles. The language is capable of some fairly advanced stuff but I could always pre-process the data with something else if I needed to.&lt;/p&gt;
&lt;p&gt;Finally I need to upload my graph to an image hosting service to share with my colleges. This can be done with a elaborate curl command but I have another trick at my disposal thanks to the excellent &lt;a class="reference external" href="https://github.com/pashky/restclient.el"&gt;restclient-mode&lt;/a&gt;. This mode is actually designed for interactive debugging of REST APIs but it is also easily to use from an org-mode source block. So the whole thing looks like a HTTP session:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre class="literal-block"&gt;
:client_id = feedbeef

# Upload images to imgur
POST https://api.imgur.com/3/image
Authorization: Client-ID :client_id
Content-type: image/png

&amp;lt; benchmark.png
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;Finally because the above dumps all the headers when run (which is very handy for debugging) I actually only want the URL in most cases. I can do this simply enough in elisp:&lt;/p&gt;
&lt;blockquote&gt;
&lt;pre class="literal-block"&gt;
#+name: post-to-imgur
#+begin_src emacs-lisp :var json-string=upload-to-imgur()
  (when (string-match
         (rx &amp;quot;link&amp;quot; (one-or-more (any &amp;quot;\&amp;quot;:&amp;quot; whitespace))
             (group (one-or-more (not (any &amp;quot;\&amp;quot;&amp;quot;)))))
         json-string)
    (match-string 1 json-string))
#+end_src
&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;p&gt;The :var line calls the restclient-mode function automatically and passes it the result which it can then extract the final URL from.&lt;/p&gt;
&lt;p&gt;And there you have it, my entire benchmarking workflow document in a single file which I can read through tweaking each step as I go. This isn't the first time I've done this sort of thing. As I use org-mode extensively as a logbook to keep track of my upstream work I've slowly grown a series of scripts for common tasks. For example every patch series and pull request I post is done via org. I keep the whole thing in a git repository so each time I finish a sequence I can commit the results into the repository as a permanent record of what steps I ran.&lt;/p&gt;
&lt;p&gt;If you want even more inspiration I suggest you look at John Kitchen's &lt;a class="reference external" href="http://kitchingroup.cheme.cmu.edu/scimax"&gt;scimax&lt;/a&gt; work. As a publishing scientist he makes extensive use of org-mode when writing his papers. He is able to include the main prose with the code to plot the graphs and tables in a single source document from which his camera ready documents are generated. Should he ever need to reproduce any work his exact steps are all there in the source document. Yet another example of why org-mode is awesome ;-)&lt;/p&gt;
&lt;/div&gt;&lt;/blockquote&gt;
</content><category term="general"></category><category term="benchmark"></category><category term="emacs"></category><category term="linaro"></category><category term="org-mode"></category><category term="qemu"></category></entry><entry><title>Getting organised</title><link href="https://www.bennee.com/~alex/blog/2012/01/13/getting-organised/" rel="alternate"></link><published>2012-01-13T10:38:00+00:00</published><updated>2012-01-13T10:38:00+00:00</updated><author><name>alex</name></author><id>tag:www.bennee.com,2012-01-13:/~alex/blog/2012/01/13/getting-organised/</id><summary type="html">&lt;p&gt;What with becoming a parent and getting promoted I suddenly find myself needing to become a lot more organised. Although I've been using &lt;a class="reference external" href="http://orgmode.org/"&gt;org-mode&lt;/a&gt; for a bit I need to get a lot more organised with it.&lt;/p&gt;
&lt;p&gt;Previously I had two sets of org notes. My personal set where sitting …&lt;/p&gt;</summary><content type="html">&lt;p&gt;What with becoming a parent and getting promoted I suddenly find myself needing to become a lot more organised. Although I've been using &lt;a class="reference external" href="http://orgmode.org/"&gt;org-mode&lt;/a&gt; for a bit I need to get a lot more organised with it.&lt;/p&gt;
&lt;p&gt;Previously I had two sets of org notes. My personal set where sitting on my server which I could access via the terminal. I generally accessed this at home on the odd occasion when I was doing things like the annual round of insurance quote gathering. The second set was a fairly simple time sheet type affair that I was using at work to keep a vague track of where all my time was spent. The big missing part of this is when I'm on the move.&lt;/p&gt;
&lt;p&gt;I've just recently upgraded my phone to the latest &lt;a class="reference external" href="http://www.bennee.com/~alex/blog/2012/01/06/nexus-of-possibilities/"&gt;Galaxy Nexus&lt;/a&gt; which is a fine Google enabled device. I make no apologies for using Google's calendering and shared document services. They work very well and importantly allow me to share things with my wife who doesn't quite share my desire to run everything from a text editor. However for my personal task lists on the move and remembering what's coming up at work it doesn't quite cut it. Besides I like org-mode and I'd heard about &lt;a class="reference external" href="http://mobileorg.ncogni.to/"&gt;MobileOrg&lt;/a&gt; so I endeavoured to set it up.&lt;/p&gt;
&lt;p&gt;MobileOrg has been around some time for the iPhone but the mechanisms it uses for integrating with org-mode are fairly well documented. As a result there is a couple of Android implementations for it. Matthew Jone's &lt;a class="reference external" href="https://github.com/matburt/mobileorg-android"&gt;mobileorg-android&lt;/a&gt; was the first version I tried.&lt;/p&gt;
&lt;p&gt;The original sync method for MobileOrg was to use a service like Dropbox to sync files. Given the history of Dropbox's security I wasn't about to move my files into the proprietary cloud. The alternative is to enable &lt;a class="reference external" href="http://en.wikipedia.org/wiki/WebDAV"&gt;WebDAV&lt;/a&gt; on my web-server and therefor enable two way communication via HTTP. It was a little concerning to see self-signed SSL wasn't supported as this does open up a potential attack vector on my machine. I've mitigated it a little by using digest authentication instead of basic-auth but I'd still prefer to be conducting these read-write operations over something more secure.&lt;/p&gt;
&lt;p&gt;Initial results were a little underwhelming. After some messing around with the format of org-links I eventually got a basic outline summary up. Unfortunately I can't seem to sync notes created on my phone to the server. This seems to be a Apache problem which I shall have to dig into later.&lt;/p&gt;
&lt;p&gt;After perusing the market some more I noticed there is a new project in town. Konstantin's &lt;a class="reference external" href="https://github.com/kvj/mobileorg-android"&gt;MobileOrgNG&lt;/a&gt; was forked some time ago from Matthew's code and on installing I found it looked an awful lot better. I've still be unable to post any locally added notes (due to previously mentioned Apache config issues). However it's presentation is a lot slicker and it shows a lot of potential for being a good MobileOrg client.&lt;/p&gt;
&lt;p&gt;I'm now stuck with a classic open source fork dilemma. The code bases look to have diverged enough that these two projects are essential going their own way. Looking at the two &lt;a class="reference external" href="https://github.com/matburt/mobileorg-android/graphs/impact"&gt;impact&lt;/a&gt; &lt;a class="reference external" href="https://github.com/kvj/mobileorg-android/graphs/impact"&gt;graphs&lt;/a&gt; it looks like they diverged around August 2011 and since then MobileOrgNG looks pretty much like a solo effort albeit with an impressive commit rate of new features.&lt;/p&gt;
&lt;p&gt;So the questions for my readers. Which code base should I jump on? Has anyone got experience with the two different code bases and the reason they split? Are there any other Android clients for org-mode I should be looking at?&lt;/p&gt;
</content><category term="geek"></category><category term="emacs"></category><category term="life"></category><category term="org-mode"></category></entry><entry><title>org-mode and clocking in</title><link href="https://www.bennee.com/~alex/blog/2011/09/20/org-mode-and-clocking-in/" rel="alternate"></link><published>2011-09-20T17:06:00+01:00</published><updated>2011-09-20T17:06:00+01:00</updated><author><name>alex</name></author><id>tag:www.bennee.com,2011-09-20:/~alex/blog/2011/09/20/org-mode-and-clocking-in/</id><summary type="html">&lt;p&gt;I've recently started using &lt;a class="reference external" href="http://orgmode.org/"&gt;org-mode&lt;/a&gt;'s time tracking to keep track of what I spend my time doing at work. This was in response to being asked by one of my managers what I spend my time doing and basically being forced to guess.&lt;/p&gt;
&lt;p&gt;Setting up a clock page is …&lt;/p&gt;</summary><content type="html">&lt;p&gt;I've recently started using &lt;a class="reference external" href="http://orgmode.org/"&gt;org-mode&lt;/a&gt;'s time tracking to keep track of what I spend my time doing at work. This was in response to being asked by one of my managers what I spend my time doing and basically being forced to guess.&lt;/p&gt;
&lt;p&gt;Setting up a clock page is fairly simple. It's then just a case of C-c C-x C-i and C-c C-x C-o on the appropriate sub tasks. Dynamic blocks can then be added to your org-document to generate &lt;a class="reference external" href="http://orgmode.org/manual/The-clock-table.html#The-clock-table"&gt;weekly, monthly or annual reports&lt;/a&gt; based on the clock lines in the document.&lt;/p&gt;
&lt;p&gt;So far the results have been illuminating and certainly shows how optimistic I can be in predicting how much time I spend doing my core job hacking on the code. However one thing that is captured but hard to summarise is interruption cost. I've taken to switching task every-time I'm interrupted in person or by phone call (I'm not counting IM/IRC as it's less disruptive). I can eyeball the raw data and see that some weeks are exceptionally bad for task switching. However what would useful is a break-down of mean and median clock lengths against each task to give some sort of indication of how much straight line hacking I've gotten done. I have a feeling the :formula and :formatter options could be used for this but I've been struggling to find any example. Does anyone do a similar analysis with their org-mode clock data?&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;UPDATED&lt;/strong&gt;: fixed keystrokes.&lt;/p&gt;
</content><category term="geek"></category><category term="clocks"></category><category term="emacs"></category><category term="org-mode"></category><category term="time"></category></entry></feed>