<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Code on</title><link>http://salopst.yearl.us/categories/code/</link><description>Recent content in Code on</description><generator>Hugo</generator><language>en</language><copyright>&lt;a href="https://creativecommons.org/licenses/by-nc/4.0/" target="_blank" rel="noopener"&gt;CC BY-NC 4.0&lt;/a&gt;</copyright><lastBuildDate>Tue, 21 Sep 2021 02:22:00 +0100</lastBuildDate><atom:link href="http://salopst.yearl.us/categories/code/index.xml" rel="self" type="application/rss+xml"/><item><title>Wranglergram decoder in ruby</title><link>http://salopst.yearl.us/wranglergram-decoder-in-ruby/</link><pubDate>Fri, 01 Jun 2018 17:35:03 +0000</pubDate><guid>http://salopst.yearl.us/wranglergram-decoder-in-ruby/</guid><description>&lt;p&gt;My local radio station has a quiz every once in a while. The questions are hardly &amp;ldquo;University Challenge&amp;rdquo;, but there is one question that always is fiendishly tricksy and slippery: to identify a place in the county from an anagram of it.&lt;/p&gt;&#10;&lt;p&gt;Constantly getting all but one question correct, it is, of course time to &lt;del&gt;cheat&lt;/del&gt; use lateral thinking.&lt;/p&gt;&#10;&lt;ul&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;#1 get a list of place names. A &lt;a href="https://britishplacenames.uk/england/shropshire"&gt;gazetteer&lt;/a&gt; should do.&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;li&gt;&#10;&lt;p&gt;#2 Build an index (hash). First thoughts were to md5 the names, but there&amp;rsquo;s an easier way: equalise case, remove spaces and punctuation, order the string&amp;hellip;&lt;/p&gt;&#10;&lt;/li&gt;&#10;&lt;/ul&gt;</description></item><item><title>rubypress</title><link>http://salopst.yearl.us/rubypress/</link><pubDate>Mon, 01 Sep 2014 18:35:07 +0000</pubDate><guid>http://salopst.yearl.us/rubypress/</guid><description>&lt;p&gt;Happy enough with the output of koiné word of the day for the time being. Maybe I&amp;rsquo;ll make it into a wordpress plugin or something at some point in the future, but probably not. For now it makes sense to have the local script interface with Wordpress&amp;rsquo; APIs. One of the more commonly used and updated rubygem is &lt;a href="https://github.com/zachfeldman/rubypress"&gt;rubypress&lt;/a&gt;, so let&amp;rsquo;s start there.&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$gem install rubypress&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;==&amp;gt; write permission error&lt;/p&gt;&#10;&lt;div class="highlight"&gt;&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;-webkit-text-size-adjust:none;"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo chown -R &lt;span style="color:#e6db74"&gt;`&lt;/span&gt;whoami&lt;span style="color:#e6db74"&gt;`&lt;/span&gt; /Library/Ruby/Gems/2.0.0&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$gem install rubypress&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo gem update&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo gem install rubygems-update&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo update_rubygems&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$sudo gem update --system&#10;&lt;/span&gt;&lt;/span&gt;&lt;span style="display:flex;"&gt;&lt;span&gt;$gem -v&#10;&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;==&amp;gt; 2.4.1&lt;/p&gt;</description></item><item><title>Mathematica/Minecraft</title><link>http://salopst.yearl.us/mathematica-minecraft/</link><pubDate>Mon, 18 Feb 2013 17:28:22 +0000</pubDate><guid>http://salopst.yearl.us/mathematica-minecraft/</guid><description>&lt;p&gt;Since summer I&amp;rsquo;ve been running a little minecraft server on a VPS in the UK. It is a pretty low-end system, and I didn&amp;rsquo;t imagine more than a handful of the primary school chums of 74111101 playing on it. A nice, secure, white-listed place away from the craziness of the net. As is inevitable with such things, numbers grew and shrank. I was waiting for a stable population before setting something more concrete&amp;ndash; allocating relevant resources, branching out into mods and so forth.&lt;/p&gt;</description></item></channel></rss>