<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet href="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/rss-style.xsl" type="text/xsl"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	    xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	     xmlns:dc="http://purl.org/dc/elements/1.1/"
	   xmlns:atom="http://www.w3.org/2005/Atom"
	     xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	  xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>
<channel>
	<title>coding &#8211; Terence Eden’s Blog</title>
	<atom:link href="https://shkspr.mobi/blog/tag/coding/feed/" rel="self" type="application/rss+xml" />
	<link>https://shkspr.mobi/blog</link>
	<description>Regular nonsense about tech and its effects 🙃</description>
	<lastBuildDate>Mon, 23 Feb 2026 09:25:11 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://shkspr.mobi/blog/wp-content/uploads/2023/07/cropped-avatar-32x32.jpeg</url>
	<title>coding &#8211; Terence Eden’s Blog</title>
	<link>https://shkspr.mobi/blog</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title><![CDATA[Are there any open APIs left?]]></title>
		<link>https://shkspr.mobi/blog/2026/01/are-there-any-open-apis-left/</link>
					<comments>https://shkspr.mobi/blog/2026/01/are-there-any-open-apis-left/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 28 Jan 2026 12:34:01 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[coding]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=61807</guid>

					<description><![CDATA[One of the dreams of Web 2.0 was that website would speak unto website. An &#34;Application Programming Interface&#34; (API) would give programmatic access to structured data, allowing services to seamlessly integrate content from each other. Users would be able to quickly grab data from multiple sources and use them for their own purposes.  No registration or API keys, no tedious EULAs or meetings. Just …]]></description>
										<content:encoded><![CDATA[<p>One of the dreams of Web 2.0 was that website would speak unto website. An "Application Programming Interface" (API) would give programmatic access to structured data, allowing services to seamlessly integrate content from each other. Users would be able to quickly grab data from multiple sources and use them for their own purposes.  No registration or API keys, no tedious EULAs or meetings. Just pure synergy!</p>

<p>Is that dream dead? If so, what killed it?</p>

<p>A decade ago, I posted a plea looking for <a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/">Easy APIs Without Authentication</a> with a <a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/">follow up post two years later</a>.  I wanted some resources that students could use with minimal fuss. Are any of the APIs from 10 years ago still alive?</p>

<h2 id="alive"><a href="https://shkspr.mobi/blog/2026/01/are-there-any-open-apis-left/#alive">Alive</a></h2>

<p>These ones are still around:</p>

<ul style="list-style-type:'✅';">
<li><a href="https://api.wikimedia.org/wiki/Core_REST_API">Wikipedia</a> - Yes! Still going strong.
</li><li><a href="https://data.police.uk/">Police.uk</a> - Yes! After a <a href="https://data.police.uk/docs/authentication/">brief dalliance with API registration</a>, it is now back to being completely free and open.
</li><li><a href="https://www.googleapis.com/books/v1/volumes?q=isbn:9781408864401">Google Books ISBN</a> - Yes! Obviously Google have forgotten it exists; otherwise it would have been killed off by now!
</li><li><a href="https://itunes.apple.com/search?term=beatles&amp;entity=musicVideo">iTunes Lookup</a> - Yes! Possibly the only thing Apple don't charge a premium for.
</li><li><a href="https://pokeapi.co/">Pokémon API</a> - and still receiving frequent updates.
</li><li><a href="https://musicbrainz.org/doc/MusicBrainz_API">MusicBrainz</a> - this Internet stalwart will never die.
</li><li><a href="http://open-notify.org/">Open Notify</a> - a collection of space APIs, although the code hasn't been updated in ages.
</li></ul>

<h2 id="dead"><a href="https://shkspr.mobi/blog/2026/01/are-there-any-open-apis-left/#dead">Dead</a></h2>

<p>These have shuffled off this mortal coil:</p>

<ul style="list-style-type:'❌';">
<li>BBC Radio 1 - No.
</li><li>Twitter URL statistics - LOLSOB No.
</li><li>Star Wars API - No.
</li><li>British National Bibliography - No. Dead due, I think to the British Library's cyber attack.
</li><li><a href="https://web.archive.org/web/20160511215743/http://api.football-data.org/code_samples">Football Data</a> - gone.
</li></ul>

<h2 id="api-key-required"><a href="https://shkspr.mobi/blog/2026/01/are-there-any-open-apis-left/#api-key-required">API Key Required</a></h2>

<p>These are still alive, but you either need to pay or register to use them:</p>

<ul style="list-style-type:'🔑';">
<li>Google Location
</li><li><a href="https://api.spotify.com/v1/search?q=bowie&amp;type=artist">Spotify</a>
</li><li><a href="https://www.omdbapi.com/?t=star%20wars&amp;y=&amp;plot=short&amp;r=json">OpenMovieDB</a>
</li><li><a href="https://docs.openaq.org/using-the-api/api-key">Open Air Quality</a>
</li></ul>

<h2 id="what-happened"><a href="https://shkspr.mobi/blog/2026/01/are-there-any-open-apis-left/#what-happened">What Happened?</a></h2>

<p>Something something … enshittification … blah blah … zero interest rate phenomenon … yadda yadda our incredible journey …</p>

<p>But back in the land of rationality, I've had a lots of experiences running APIs and helping people who run them.  The closure and lockdown of APIs usually comes down to one or more of the following.</p>

<p>APIs cost money to run. Yes, even the static ones have a non-zero cost. That's fine if you're prepared to endless subsidise them - but it is hard to justify if there's no return on investment. Anyway, who is using all this bandwidth? Which leads on to:</p>

<p>Lack of analytics. Yes, I know tracking is the devil, but it is hard to build a service if you don't know who is using it. Sure, you can see traffic, but you can't tell if it is useful to the end consumer, or what value you can share. There's no way to communicate with an anonymous consumer. Which, of course, takes us to the next barrier:</p>

<p>Communication is key. If you need to change your API, there's no way to tell users that a change is coming. That might be the announcement of a deprecation, an outage, or an enhancement. You can try smuggling error messages into your responses and hoping someone notices a failing service somewhere - but it's much easier to email everyone who has an API key.  And you know what else keys are good for?</p>

<p>Stopping abuse. It'd be nice if everyone played nice online; but some people are raging arseholes. Being able to throttle bad actors (figuratively or literally) is a desirable feature.  On a resource constrained service, you sometimes have to put rules in place.</p>

<p>Still, if you know of any good open APIs which don't require registration, and that you think will survive until 2036, please drop a link in the comments.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=61807&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2026/01/are-there-any-open-apis-left/feed/</wfw:commentRss>
			<slash:comments>22</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Unicode operators for semantically correct programming]]></title>
		<link>https://shkspr.mobi/blog/2023/01/unicode-operators-for-semantically-correct-programming/</link>
					<comments>https://shkspr.mobi/blog/2023/01/unicode-operators-for-semantically-correct-programming/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Thu, 26 Jan 2023 12:34:13 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[unicode]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=44621</guid>

					<description><![CDATA[Why do most programming languages use the / character when we have a perfectly good ÷ symbol?  Similarly, why use != instead of ≠? Or =&#62; rather than →?  The obvious answer is that the humble keyboard usually only has around 100 keys - and most humans have a hard time remembering where thousands of alternate characters are.  Some programming fonts attempt to get around this with ligatures. That all…]]></description>
										<content:encoded><![CDATA[<p>Why do most programming languages use the <code>/</code> character when we have a perfectly good <code>÷</code> symbol?  Similarly, why use <code>!=</code> instead of <code>≠</code>? Or <code>=&gt;</code> rather than <code>→</code>?</p>

<p>The obvious answer is that the humble keyboard usually only has around 100 keys - and most humans have a hard time remembering where thousands of alternate characters are.</p>

<p>Some <a href="https://betterwebtype.com/articles/2020/02/13/5-monospaced-fonts-with-cool-coding-ligatures/">programming fonts attempt to get around this with ligatures</a>. That allows the user to type <code>&lt;=</code> but have the font display <code>≤</code></p>

<p>Are there any modern programming languages which allow the use of semantically correct Unicode symbols as operators?</p>

<p>As far as I can tell, there's only one!</p>

<h2 id="scala"><a href="https://shkspr.mobi/blog/2023/01/unicode-operators-for-semantically-correct-programming/#scala">Scala</a></h2>

<p>Here's a trivial example which creates the <code>÷</code> operator:</p>

<pre><code class="language-scala">case class A(v: Float) {
  def ÷(b: A): A = A(v / b.v)
}
val a = A(9)
val b = A(5)
a ÷ b
</code></pre>

<p>According to the <a href="https://docs.scala-lang.org/scala3/reference/syntax.html#">Scala reference documentation</a>, valid characters for operators include "Unicode categories Sm, So".</p>

<p>That's "<a href="https://www.fileformat.info/info/unicode/category/Sm/list.htm">Symbols, maths</a>" and "<a href="https://www.fileformat.info/info/unicode/category/So/list.htm">Symbols, others</a>".  That covers quite a lot of useful symbols. Including some Emoji!  So you could have <code>☺</code> as an operator.</p>

<p><a href="https://scastie.scala-lang.org/bUmhTgQEQB2rAPInMgVnJQ">Try it in your browser</a>.</p>

<h2 id="others"><a href="https://shkspr.mobi/blog/2023/01/unicode-operators-for-semantically-correct-programming/#others">Others</a></h2>

<p>I took a quick scan through some other modern languages:</p>

<ul>
<li>Ruby

<ul>
<li>Ruby has a <a href="https://github.com/collectiveidea/unicode_math">Unicode Math gem</a> which lets you write code like <code>∛ 27</code>.  But, as far as I can tell, there's no way to create your own operators.</li>
</ul></li>
<li>Haskell

<ul>
<li>There's <a href="https://downloads.haskell.org/ghc/latest/docs/users_guide/exts/unicode_syntax.html">an extension for <em>some</em> Unicode characters</a>. But there's not many there and no way to create new ones.</li>
</ul></li>
<li>Python

<ul>
<li>Nope. There's no way to create your own operators. <a href="https://peps.python.org/pep-3131/">And function names can only contain a subset of Unicode</a>.</li>
</ul></li>
<li>C++

<ul>
<li>Nope. You can overload existing operators but cannot define your own.</li>
</ul></li>
<li>Go

<ul>
<li>No.</li>
</ul></li>
<li>Rust

<ul>
<li><a href="https://doc.rust-lang.org/std/ops/index.html">Also no</a>.</li>
</ul></li>
<li>Java

<ul>
<li>Nuh-uh.</li>
</ul></li>
<li>Javascript

<ul>
<li><a href="https://www.destroyallsoftware.com/talks/wat">WAT</a>.</li>
</ul></li>
</ul>

<p>In fact, according to the inimitable <a href="http://xahlee.info/comp/unicode_support_ruby_python_elisp.html">Xah Lee</a> the only other languages which allow user-defined Unicode operators are Julia and Wolfram.</p>

<p>Julia, I had some difficulty with, but this works:</p>

<pre><code class="language-julia">☺(x)=sqrt(x)
print(☺(25))

÷(x,y)=x/y
print(25 ÷ 6)
</code></pre>

<p>I am, sadly, not clever enough to even understand the <em>documentation</em> for the Wolfram language.</p>

<h2 id="what-next"><a href="https://shkspr.mobi/blog/2023/01/unicode-operators-for-semantically-correct-programming/#what-next">What next?</a></h2>

<p>Obviously I am now a convert to Scala and will henceforth rewrite all my code in it using multiple Unicode symbols.</p>

<p>But, more practically, I wonder if there's demand for a (new) programming language which treats Unicode operators a first class citizens?  Or perhaps future versions of your favourite language should embrace the loving warmth of the Unicode consortium?</p>

<p>Thoughts?</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=44621&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2023/01/unicode-operators-for-semantically-correct-programming/feed/</wfw:commentRss>
			<slash:comments>29</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Easy APIs Without Authentication]]></title>
		<link>https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/</link>
					<comments>https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 25 May 2016 14:58:26 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[codeclub]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[hacking]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=22868</guid>

					<description><![CDATA[This is a curated list of APIs which do not require usernames, passwords, access tokens, signing, accept-headers, or anything more complicated than sticking a URL in a browser. (This is an update to my post from two years ago.)  When I introduce people to the concept of using RESTful APIs, they immediately get how powerful it is to retrieve information from the Internet and then manipulate it in…]]></description>
										<content:encoded><![CDATA[<p>This is a curated list of APIs which do not require usernames, passwords, access tokens, signing, accept-headers, or anything more complicated than sticking a URL in a browser. (This is <a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/">an update to my post from two years ago</a>.)</p>

<p>When I introduce people to the concept of using RESTful APIs, they immediately get how powerful it is to retrieve information from the Internet and then manipulate it in software.</p>

<p>I used to give Twitter and Flickr as examples - they're both fairly well known and have interesting content.  The only problem is that both <strong>require</strong> authentication.  I'm an adult with two decades of programming experience and I <em>still</em> find OAuth-dances tricky!  I've no idea how to create a foolproof guide for a child to get authentication tokens.  Added to the fact that under-13 year-olds often can't legally enter into agreements with these companies.</p>

<p>So, here's a list of APIs which don't require any authentication.  They are free (gratis), fun, and friendly for beginners.</p>

<p><a href="https://www.flickr.com/photos/threecheersformcr_xo/5340309206/"><img src="https://shkspr.mobi/blog/wp-content/uploads/2016/05/A-pet-cat-typing-on-a-computer-keyboard.jpg" alt="A pet cat typing on a computer keyboard" width="640" height="426" class="aligncenter size-full wp-image-22870"></a></p>

<h2 id="pokemon-api-star-wars-api"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#pokemon-api-star-wars-api">Pokemon API / Star Wars API</a></h2>

<p>The inimitable <a href="https://github.com/phalt">Paul Hallett</a> has created these two marvellous resources.</p>

<p><a href="http://www.pokeapi.co/">Pokéapi</a> - as the name suggests - is a comprehensive database of Pokemon.
<a href="https://swapi.co/">Star Wars API</a> - contains information about all the ships, planets, and inhabitants of the Star Wars Universe.</p>

<p>Both are great fun to play with and have excellent documentation.</p>

<h2 id="wikipedia"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#wikipedia">Wikipedia</a></h2>

<blockquote class="social-embed" id="social-embed-426273875178307584" lang="es" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><blockquote class="social-embed" id="social-embed-426271643980546048" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/edent" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRkgBAABXRUJQVlA4IDwBAACQCACdASowADAAPrVQn0ynJCKiJyto4BaJaQAIIsx4Au9dhDqVA1i1RoRTO7nbdyy03nM5FhvV62goUj37tuxqpfpPeTBZvrJ78w0qAAD+/hVyFHvYXIrMCjny0z7wqsB9/QE08xls/AQdXJFX0adG9lISsm6kV96J5FINBFXzHwfzMCr4N6r3z5/Aa/wfEoVGX3H976she3jyS8RqJv7Jw7bOxoTSPlu4gNbfXYZ9TnbdQ0MNnMObyaRQLIu556jIj03zfJrVgqRM8GPwRoWb1M9AfzFe6Mtg13uEIqrTHmiuBpH+bTVB5EEQ3uby0C//XOAPJOFv4QV8RZDPQd517Khyba8Jlr97j2kIBJD9K3mbOHSHiQDasj6Y3forATbIg4QZHxWnCeqqMkVYfUAivuL0L/68mMnagAAA" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Terence Eden is on Mastodon</p>@edent</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody">What's an interesting / popular API which does NOT require authentication / API key?<br>Trying to inspire new coders without terrifying them!</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/edent/status/426271643980546048"><span aria-label="2 likes" class="social-embed-meta">❤️ 2</span><span aria-label="0 replies" class="social-embed-meta">💬 0</span><span aria-label="1 reposts" class="social-embed-meta">🔁 1</span><time datetime="2014-01-23T08:34:14.000Z" itemprop="datePublished">08:34 - Thu 23 January 2014</time></a></footer></blockquote><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/invisiblecomma" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRooCAABXRUJQVlA4IH4CAABwDACdASowADAAPq1EmEmmI6IhNVgNUMAViWoAqSbiMb2PxbRmnuD40w5eWlpTWg00xs/0ti/OME7rYyhkvgdPEFG7gh/T+BhQeAvPjE98IvaUCdE6ayEDMcus0OBYKv5S+LaeOZ71l5up/aAA/vtoCp/t6e1PPYLXt63NDZIpKR5lniwDv4MxUNVQ1604iWUXk4kRL8JFxOn6n37+CWgyhtPhSNyVwKIRJupPynn/hHtjFNdPXpm33ntI0v3fKLsZCTShGY3YPlbw0Iv0P80ScgdB3Fx4hAq7os0y2syP3YW3c454NPmtOH3p/y8Hgw8NbvUbxGXKSNzj1Mk82+/zCllPP7rQVp5s0XJ1CoaAXb3XEaO0wHHqe8XSKRXlOVAnUvk2Eyghohbguh8NI11S6CXMohgMuc65sNp20JfdUkcT8ywBBNfzCvmlezyXQekjl9hrehrOFeKgdKkCZj3RCm7ky0sI2W9i9yFdZ69TDw/EeNaJma0OoTUb9qXb2oceqokiRvPbO7xnc5l2CzbGUwGgL+0A9L0AJ4DoWnBn4MNU7mM82XlUuQS1BJT31uQVAe2nXyC58jhYghB7DCsI/vZYVkcfWurbxSqKUsoMbWRXLv7qbDy9KcxU1nSxwMOYT4TeDusQR4kvkKBqcTZkrftf5IZVFL9+k4MKeZQeALvRobhEoeRUCtNQMw65s39mf4Aoe2eU9+kGNHbrV4kMXWCmSGXNfIB4+xpz08dQWbWpFWgrt0VO2m5reCeK5HWip+EMbZ7nMT7SfjvJC99AdbiHIv2m3Ub18u8/RTpag9LdcLwBogVCJOQGH1lnFiySlDjUVuWzdWwJ3AAAAA==" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Alf Eaton</p>@invisiblecomma</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody"><small class="social-embed-reply"><a href="https://twitter.com/edent/status/426271643980546048">Replying to @edent</a></small><a href="https://twitter.com/edent">@edent</a> Wikipedia?</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/invisiblecomma/status/426273875178307584"><span aria-label="2 likes" class="social-embed-meta">❤️ 2</span><span aria-label="1 replies" class="social-embed-meta">💬 1</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2014-01-23T08:43:06.000Z" itemprop="datePublished">08:43 - Thu 23 January 2014</time></a></footer></blockquote>

<p>The <a href="http://en.wikipedia.org/w/api.php?">Wikipedia API is self documenting</a> - although a little intense for a first time programmer.  It will also <a href="https://en.wikipedia.org/w/api.php?action=query&amp;titles=Albert_Einstein&amp;prop=images">pretty-print the information in a browser</a> - which makes it much more readable to a novice.</p>

<h2 id="police-uk"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#police-uk">Police UK</a></h2>

<blockquote class="social-embed" id="social-embed-426278057846919169" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/ayymanduh" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRv4CAABXRUJQVlA4IPICAADwCwCdASowADAAPrVKnUqnJCKhqqwA4BaJZgCzs3H+IuZyJDeXiL5owgKmpyy4gVaDU/JXr/RzDZp849wuL2gPPRMr/n4wAzCjjyfmadW445F6LSQ49gdgSmSL73B/LYyxHsalogUYgAD++9Ur9XMV/h/u0H3ITvFwyGKHv36ZFiG7CaxS+oFuGkMuJO0+PCytCgzYfrCkv5cQb143i0Ti9r8cfqovELVOQB8f3E/x/Is5LoYz43xhFKuUFztvAMWq7UAJ5U3jS1Dozq1q928722eoMwmq5T7eIk3ir9JyFGmLmxWgAPNWeXPQ16llDWb08HHRgFxUdfSUO+EO4Ha0DbprbUrPOTbU+fWKNWNKncBiaxBBYoV3sPI8ulEepBaDM7G1/vTZfvnVozNTqWHWrvWsdez+DJXId3hu6BGrjNV+DUaU1JYiKJBFwO6s2rdGONyAHmRDACW7lYURsQ8J4Y8qzAILHAUPOtCtAjGud55tl4ILS9BNyGRDKMDLSuBTGxtvjTNBsEkKK1Mq/Sllud44Jb/UTQsqf4rknVAW5GZ1FQj9MIZdWcebhl6PYqLKHL/Sz6/1WkIVqL5WgL08g9Ob4qz1RRV0IyYRBN+d0EmFgkUEAqFZHlwcvbXuCKJgxhAsy1R+Nvn5jRiLmNkJv6s3toewdznGQCpD2ymdCTFdInAKhGcpVS16jRvg4GRgDK7vqPpc4myH9djbCRrRQWKvAMmku5Qkj2vylYaETE161vUlu/xbj5/Vn0fmNAdmU4eN4cYg3fJf25ffEFuD2DVl18w8Ja5Iklm4VUUuMYa8m8GGzYLQLiG9fgTqNr0YEoizgHzU//DojexbUvyMz4Rq0LUByr3hFR/Ha69PKaOb6761fbLdouzT3+ti6ymrOtcgt3gqn7P/vmLCYs8Oy2v5fqJaBUy1M5v4py7/dpA6+PumLkJ1hFbgGlYyWbkJDfEIZvKpPkZ8d5+UO0LdjEOnf7Oe9zIJ6z1v07JCBWQA" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Amanda 🏳️‍🌈🔮</p>@ayymanduh</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody"><small class="social-embed-reply"><a href="https://twitter.com/edent/status/426271643980546048">Replying to @edent</a></small><a href="https://twitter.com/edent">@edent</a> I'm *slightly* biased here, but <a href="http://data.police.uk/docs/">data.police.uk/docs/</a>? : )</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/ayymanduh/status/426278057846919169"><span aria-label="0 likes" class="social-embed-meta">❤️ 0</span><span aria-label="0 replies" class="social-embed-meta">💬 0</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2014-01-23T08:59:43.000Z" itemprop="datePublished">08:59 - Thu 23 January 2014</time></a></footer></blockquote>

<p>Not great for international audiences - but a fantastic resource for students in the UK.  All sorts of crime statistics.</p>

<h2 id="google-books"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#google-books">Google Books</a></h2>

<p>Google provides a <a href="https://developers.google.com/books/">free book search API</a> which is simple to use.</p>

<p><a href="https://www.googleapis.com/books/v1/volumes?q=isbn:0747532699">https://www.googleapis.com/books/v1/volumes?q=isbn:0747532699</a></p>

<p>And you get pretty-printed JSON back with information about the book.</p>

<h2 id="british-national-bibliography"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#british-national-bibliography">British National Bibliography</a></h2>

<p>A bit niche, but the <a href="http://bnb.data.bl.uk/" british="" national="" bibliography=""></a> is ace.  You can take a URl like <a href="http://bnb.data.bl.uk/doc/resource/007446989">http://bnb.data.bl.uk/doc/resource/007446989</a> and then add <code>.json</code> or <code>.xml</code> at the end to get the data.</p>

<p>e.g. <a href="http://bnb.data.bl.uk/doc/resource/007446989.json">http://bnb.data.bl.uk/doc/resource/007446989.json</a></p>

<h2 id="google-location"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#google-location">Google Location</a></h2>

<p>Google has a pretty good location API which doesn't require a login.</p>

<p><a href="https://maps.googleapis.com/maps/api/geocode/json?address=Oxford%20University,%20uk&amp;sensor=false">https://maps.googleapis.com/maps/api/geocode/json?address=Oxford%20University,%20uk&amp;sensor=false</a></p>

<p>Again, with some pretty printed JSON.</p>

<h2 id="spotify"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#spotify">Spotify</a></h2>

<p>Music streamer <a href="https://developer.spotify.com/web-api/">Spotify has a great API</a> for discovering music.</p>

<p>The results from something like <a href="https://api.spotify.com/v1/search?q=bowie&amp;type=artist">https://api.spotify.com/v1/search?q=bowie&amp;type=artist</a> are pretty printed and fairly easy to decipher.</p>

<h2 id="apple"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#apple">Apple</a></h2>

<p>Apple are surprisingly friendly.  They have a <a href="https://web.archive.org/web/20160528230229/https://affiliate.itunes.apple.com/resources/documentation/itunes-store-web-service-search-api/">simple API for looking up iTunes content</a>.</p>

<p>Here, for example is all of Beyoncé's music videos.</p>

<p><a href="https://itunes.apple.com/search?term=beyonce&amp;entity=musicVideo">https://itunes.apple.com/search?term=beyonce&amp;entity=musicVideo</a></p>

<h2 id="open-movie-database"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#open-movie-database">Open Movie Database</a></h2>

<p>Sadly, there's no API for IMDb, but there's is the <a href="https://www.omdbapi.com/">Open Movie Database API</a>.
<a href="https://www.omdbapi.com/?t=star%20wars&amp;y=&amp;plot=short&amp;r=json">https://www.omdbapi.com/?t=star%20wars&amp;y=&amp;plot=short&amp;r=json</a></p>

<h2 id="space-apis"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#space-apis">Space APIs</a></h2>

<p>There are a handful of Outer Space APIs avilable for free at <a href="http://open-notify.org/">http://open-notify.org/</a></p>

<h2 id="football-data"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#football-data">Football Data</a></h2>

<p>If you like historical football data, take a look at <a href="https://web.archive.org/web/20160511215743/http://api.football-data.org/code_samples">http://api.football-data.org/code_samples</a></p>

<h2 id="open-air-quality"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#open-air-quality">Open Air Quality</a></h2>

<p>A huge amount of environmental data available for free at <a href="https://docs.openaq.org/">https://docs.openaq.org/</a>.</p>

<h2 id="what-else"><a href="https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/#what-else">What Else?</a></h2>

<p>I'm sure I've missed loads.  If you know of any, please drop a link in the comments.</p>

<p>Remember, the criteria are...</p>

<ol>
<li>No authentication needed.</li>
<li>Well structured output.</li>
<li>Interesting data.</li>
<li>Child friendly.</li>
<li>Up to date.</li>
<li>Preferably free (libre and gratis).</li>
</ol>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=22868&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2016/05/easy-apis-without-authentication/feed/</wfw:commentRss>
			<slash:comments>18</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[3D Printed, Arduino Powered, Educational, Open Source, Micro-Robots!]]></title>
		<link>https://shkspr.mobi/blog/2016/02/3d-printed-arduino-powered-educational-open-source-micro-robots/</link>
					<comments>https://shkspr.mobi/blog/2016/02/3d-printed-arduino-powered-educational-open-source-micro-robots/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Wed, 17 Feb 2016 12:01:23 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[3d printing]]></category>
		<category><![CDATA[arduino]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[hacking]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[zowi]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=22434</guid>

					<description><![CDATA[Last week I was invited to attend a product launch by BQ.  They&#039;re a small company based out of Spain who create some curiously innovative products - including smartphones which natively run Cyanogen.  I&#039;m particularly looking forward to reviewing their Ubuntu Tablet later in the year.  The thing which really caught my eye was Zowi (pronounced Zoë).  It looks like this:  And it dances like this:  …]]></description>
										<content:encoded><![CDATA[<p>Last week I was invited to attend a product launch by <a href="https://web.archive.org/web/20160220202059/http://www.bq.com/uk/">BQ</a>.  They're a small company based out of Spain who create some curiously innovative products - including smartphones which natively run Cyanogen.  I'm particularly looking forward to <a href="https://shkspr.mobi/blog/2016/01/finding-the-perfect-linux-laptop/">reviewing their Ubuntu Tablet</a> later in the year.</p>

<p>The thing which <strong>really</strong> caught my eye was <a href="https://web.archive.org/web/20160216200436/http://www.bq.com/uk/zowi">Zowi</a> (pronounced Zoë).</p>

<p>It looks like this:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/Zowi.jpg" alt="Zowi" width="1024" height="576" class="aligncenter size-full wp-image-22437">
And it <em>dances</em> like this:</p>

<p></p><div style="width: 620px;" class="wp-video"><video class="wp-video-shortcode" id="video-22434-2" width="620" height="348" autoplay="" preload="metadata" controls="controls"><source type="video/mp4" src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.mp4?_=2"><source type="video/webm" src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.webm?_=2"><source type="video/ogg" src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.ogv?_=2"><a href="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.mp4">https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.mp4</a></video></div><p></p>

<p>Ok, but what is it?</p>

<p>Here's what you need to know.  It's an Arduino powered robot which you can control via BlueTooth.  It's full extensible and <strong>IT COMES WITH AN ALLEN KEY!</strong></p>

<p>This "toy" is designed to be taken apart, remixed, and reassembled.  Undo two screws and get right inside its guts.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/Inside-Zowi-.jpg" alt="Inside Zowi-" width="1022" height="576" class="aligncenter size-full wp-image-22440">

<p>GPIO pins, LED display board, ultrasound sensors, motors, external buttons, and a micro-USB socket.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/Decapitated-Zowi-.jpg" alt="Decapitated Zowi-" width="1024" height="576" class="aligncenter size-full wp-image-22442">

<p>Oh, what's that? You don't like the two-legged style? OK - 3D print your own body for it, like this:</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2016/02/Remixed-Zowi-.jpg" alt="Remixed Zowi-" width="1024" height="576" class="aligncenter size-full wp-image-22445">

<p>They have <a href="https://github.com/bq">very active GitHub repositories</a> which also include <a href="https://github.com/bq/zowi">the 3D designs if you want to print your own Zowi</a>.</p>

<p>At the demo they had a <a href="https://web.archive.org/web/20160208010442/https://play.google.com/store/apps/details?id=com.bq.zowi">Scratch-like programming interface running on their Android tablets</a>.  Program the robot and play games with it, all from your phone. No PC needed.</p>

<p>My favourite part? "<a href="https://github.com/bqlabs/zowi">This robot is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.</a>"</p>

<p>The <a href="https://web.archive.org/web/20160216200436/http://www.bq.com/uk/zowi">Zowi will be £80 on launch</a> and I can't wait to get my hands on one.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=22434&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2016/02/3d-printed-arduino-powered-educational-open-source-micro-robots/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		<enclosure url="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.webm" length="272276" type="video/webm" />
<enclosure url="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.mp4" length="295948" type="video/mp4" />
<enclosure url="https://shkspr.mobi/blog/wp-content/uploads/2016/02/zowi.ogv" length="503999" type="video/ogg" />

			</item>
		<item>
		<title><![CDATA[WordPress Archive Calendar Widget]]></title>
		<link>https://shkspr.mobi/blog/2015/11/wordpress-archive-calendar-widget/</link>
					<comments>https://shkspr.mobi/blog/2015/11/wordpress-archive-calendar-widget/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sun, 15 Nov 2015 12:57:55 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[WordPress]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=21706</guid>

					<description><![CDATA[One of the most addicting aspects of Open Source software is the ability to scratch one&#039;s own itches.  I&#039;ve been blogging since 2004 - and while I&#039;d never mistake longevity for expertise - I do take a certain pride in letting my readers know that I&#039;ve spent over a decade bashing out words.  So, I decided to build a simple widget which would display my posting history in a calendar style.  And…]]></description>
										<content:encoded><![CDATA[<p>One of the most addicting aspects of Open Source software is the ability to scratch one's own itches.</p>

<p>I've been blogging since 2004 - and while I'd never mistake longevity for expertise - I do take a certain pride in letting my readers know that I've spent over a decade bashing out words.</p>

<p>So, I decided to build a simple widget which would display my posting history in a calendar style.  And now, it's time to release it to the world!</p>

<p>It's <a href="https://github.com/edent/WordPress-Calendar-Widget">available on GitHub</a> and the <a href="https://wordpress.org/plugins/edents-archive-calendar-widget/">official WordPress plugin site</a>.</p>

<h2 id="what-it-looks-like"><a href="https://shkspr.mobi/blog/2015/11/wordpress-archive-calendar-widget/#what-it-looks-like">What It Looks Like</a></h2>

<p>It's a simple WordPress sidebar widget - displaying the archive as a table.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/10/WordPress-Archive-Calendar-Widget-fs8.png" alt="WordPress Archive Calendar Widget-fs8" width="475" height="601" class="aligncenter size-full wp-image-21709">

<h2 id="how-it-works"><a href="https://shkspr.mobi/blog/2015/11/wordpress-archive-calendar-widget/#how-it-works">How It Works</a></h2>

<p>Getting all the months which have published posts within them is pretty simple:</p>

<pre lang="php">$query = "SELECT YEAR(post_date)  AS `year`,
         MONTH(post_date) AS `month`,
         count(ID)        AS `posts`
FROM $wpdb-&gt;posts
WHERE post_type = 'post' AND post_status = 'publish'
GROUP BY YEAR(post_date), MONTH(post_date)
ORDER BY post_date ASC
LIMIT 256";
</pre>

<p>It returns each month with an associated year and number of posts - e.g.</p>

<pre lang="php">array(
    array('year' =&gt; '2004','month' =&gt;  '5','posts' =&gt; '5'),
    array('year' =&gt; '2004','month' =&gt;  '6','posts' =&gt; '3'),
    array('year' =&gt; '2004','month' =&gt;  '7','posts' =&gt; '1'),
    array('year' =&gt; '2006','month' =&gt;  '4','posts' =&gt; '1'),
    array('year' =&gt; '2006','month' =&gt; '11','posts' =&gt; '1'),
    array('year' =&gt; '2007','month' =&gt; '11','posts' =&gt; '4'),
    array('year' =&gt; '2007','month' =&gt; '12','posts' =&gt; '5'),
    array('year' =&gt; '2008','month' =&gt;  '1','posts' =&gt; '2'),
    ...
</pre>

<p>It's then just a case of iterating through the array and constructing the tables.</p>

<h2 id="future-developments"><a href="https://shkspr.mobi/blog/2015/11/wordpress-archive-calendar-widget/#future-developments">Future Developments</a></h2>

<ul>
    <li>Colour Picker - I'm no æsthete, so people may prefer to choose their own colour scheme.</li>
    <li>Sorting - allowing reverse date order.</li>
    <li>Font sizes - on a smaller sidebar, the longer month names wrap.</li>
    <li>Tests - because why not :-)</li>
    <li>Better CSS - not my strong suit!</li>
    <li>i18n - some people have the temerity to speak languages other than English. Savages!</li>

</ul>

<p>The <a href="https://github.com/edent/WordPress-Calendar-Widget">source code is available on GitHub</a>  and the <a href="https://wordpress.org/plugins/edents-archive-calendar-widget/">official WordPress plugin site</a>.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=21706&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2015/11/wordpress-archive-calendar-widget/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Idiot's Guide To Getting Started with Raspberry Pi's GPIO Pins]]></title>
		<link>https://shkspr.mobi/blog/2015/05/idiots-guide-to-getting-started-with-raspberry-pis-gpio-pins/</link>
					<comments>https://shkspr.mobi/blog/2015/05/idiots-guide-to-getting-started-with-raspberry-pis-gpio-pins/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 11 May 2015 10:27:16 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[electronics]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Raspberry Pi]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=21011</guid>

					<description><![CDATA[The idiot in question being... me!  It&#039;s been ages since I did any real electronics.  Most of my work involves software and pre-assembled bits of kit.  I thought that it was time I reacquainted myself with the joys of electricity :-)  Because I&#039;m fundamentally lazy, I purchased the all-in-one Raspberry Pi 2 kit from Vilros.    Lots of LEDs, some buttons, a nice case, all the cables, resistors,…]]></description>
										<content:encoded><![CDATA[<p>The idiot in question being... me!</p>

<p>It's been ages since I did any real electronics.  Most of my work involves software and pre-assembled bits of kit.  I thought that it was time I reacquainted myself with the joys of electricity :-)</p>

<p>Because I'm fundamentally lazy, I purchased the <a href="http://www.amazon.co.uk/gp/product/B00T538MAS/ref=as_li_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B00T538MAS&amp;linkCode=as2&amp;tag=shkspr-21&amp;linkId=JTCFMMXKTUME2K4C">all-in-one Raspberry Pi 2 kit from Vilros</a>.</p>

<p><a href="http://www.amazon.co.uk/gp/product/B00T538MAS/ref=as_li_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B00T538MAS&amp;linkCode=as2&amp;tag=shkspr-21&amp;linkId=JTCFMMXKTUME2K4C"><img src="https://shkspr.mobi/blog/wp-content/uploads/2015/05/Raspberry-Pi-Kit.jpg" alt="Raspberry Pi Kit" width="800" height="800" class="alignnone size-full wp-image-21014"></a></p>

<p>Lots of LEDs, some buttons, a nice case, all the cables, resistors, and all sorts of bits and bobs.  Including a breadboard!</p>

<h2 id="whats-a-breadboard"><a href="https://shkspr.mobi/blog/2015/05/idiots-guide-to-getting-started-with-raspberry-pis-gpio-pins/#whats-a-breadboard">What's A Breadboard?</a></h2>

<p>I remember - from school - that a breadboard is a.... thing... that lets you... electricity?</p>

<p>Honestly, it wasn't until I saw this diagram from Adafruit that it all finally clicked into place:</p>

<p><a href="https://learn.adafruit.com/assets/17437"><img src="https://shkspr.mobi/blog/wp-content/uploads/2015/05/Breadboard-Diagram.jpg" alt="Photo by Collin Cunningham - Attribution-ShareAlike Creative Commons " width="640" height="480" class="alignnone size-full wp-image-21013"></a></p>

<p>Aha!</p>

<p>The kit comes with a T-Shaped Cobbler which fits onto the breadboard and means you have a neatly labelled system with fewer wires running about the place.
<a href="http://www.amazon.co.uk/gp/product/B00T538MAS/ref=as_li_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B00T538MAS&amp;linkCode=as2&amp;tag=shkspr-21&amp;linkId=JTCFMMXKTUME2K4C"><img src="https://shkspr.mobi/blog/wp-content/uploads/2015/05/t-shape_cobler.jpg" alt="t-shape_cobler" width="480" height="277" class="alignnone size-full wp-image-21018"></a></p>

<p>I <a href="https://projects.drogon.net/raspberry-pi/gpio-examples/tux-crossing/gpio-examples-1-a-single-led/">followed a sample tutorial</a> on how to wire in an LED to be permanently on.  Basically +3.3v → long leg of LED.  Short leg of LED → 330Ω resistor → Ground.</p>

<p>Ok, that was easy.  Now lets make it flash on command!</p>

<p>The wiring is fairly similar, but we use a controlable GPIO pin instead.</p>

<p>GPIO pin 21 → long leg of LED.  Short leg of LED → 330Ω resistor → Ground.</p>

<p>Here's what it looks like:
<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/05/GPIO-LED-Tutorial.jpg" alt="GPIO LED Tutorial" width="1024" height="646" class="alignnone size-full wp-image-21020"></p>

<p>And here's the Python code to switch it on, then off.</p>

<pre lang="python">import RPi.GPIO as GPIO
GPIO.setmode(GPIO.BCM)
led = 21
GPIO.setup(led, GPIO.OUT)
# Switch on
GPIO.output(led, 1)
# Switch off
GPIO.output(led, 0)
</pre>

<p>Wooo!</p>

<p>Ok, so, next thing - how to get information <em>in</em> to the Pi?</p>

<p>I was confused about exactly how the push switch worked - why were their four pins?</p>

<p>I read the <a href="http://razzpisampler.oreilly.com/ch07.html">O'Reilly Raspbery Pi Tutorial</a> and became enlightened.
<a href="http://razzpisampler.oreilly.com/ch07.html"><img src="https://shkspr.mobi/blog/wp-content/uploads/2015/05/Push-Switch-fs8-1024x269.png" alt="Push Switch" width="640" height="168" class="alignnone size-large wp-image-21023"></a></p>

<p>So, lets create a thingumy which lights up an LED when a button is pressed.</p>

<p>The LED will be the same as the above.  The button will be wired as:
GPIO pin 19 → Button A.  Button B → Ground.</p>

<img src="https://shkspr.mobi/blog/wp-content/uploads/2015/05/Push-Button-Pi.jpg" alt="Push Button Pi" width="1024" height="576" class="alignnone size-full wp-image-21026">

<p>And the code is:</p>

<pre lang="python">import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)

# Pin 19 will sense for button pushing
button = 19
GPIO.setup(button, GPIO.IN, pull_up_down=GPIO.PUD_UP)

# The LED
led = 21
GPIO.setup(led, GPIO.OUT)

while True:
    input_state = GPIO.input(button) # Sense the button
    if input_state == False:
        print('Button Pressed')
        time.sleep(0.2)
        # Switch on LED
        GPIO.output(led, 1)
    else :
        # Switch off LED
        GPIO.output(led, 0)
</pre>

<p>I'm not <em>entirely</em> sure why <code>if input_state == False:</code> is the logic for the button being pressed. Seems like it ought to be <code>True</code>, no?  Anyway, there's <a href="http://sourceforge.net/p/raspberry-gpio-python/wiki/Inputs/">a long discussion about all the ways sensors can be read</a> on the raspberry-gpio-python pages.</p>

<p>Well, there you have it. An utterly simple guide to getting started. I just hope future-me finds this useful!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=21011&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2015/05/idiots-guide-to-getting-started-with-raspberry-pis-gpio-pins/feed/</wfw:commentRss>
			<slash:comments>13</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Overlapping Animated GIFs]]></title>
		<link>https://shkspr.mobi/blog/2015/02/overlapping-animated-gifs/</link>
					<comments>https://shkspr.mobi/blog/2015/02/overlapping-animated-gifs/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sun, 15 Feb 2015 17:24:36 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[HTML]]></category>
		<guid isPermaLink="false">https://shkspr.mobi/blog/?p=20524</guid>

					<description><![CDATA[Just a couple of silly experiments on a Sunday afternoon.  I think it&#039;s beautiful to overly animated GIFs on top of one another.  If the topmost GIF has a transparent background it becomes hypnotic to see the synchronisity which appears to develop - akin to listening to Dark Side of the Moon while the Wizard of Oz is on the TV.    The background and foreground have differing periods of motion,…]]></description>
										<content:encoded><![CDATA[<p>Just a couple of silly experiments on a Sunday afternoon.</p>

<p>I think it's beautiful to overly animated GIFs on top of one another.  If the topmost GIF has a transparent background it becomes hypnotic to see the synchronisity which appears to develop - akin to listening to Dark Side of the Moon while the Wizard of Oz is on the TV.</p>

<div style="height: 500px;"><img src="https://shkspr.mobi/blog/wp-content/uploads/2015/02/infinite.gif" alt="infinite" width="500" height="500" style="position: absolute;"><img src="https://shkspr.mobi/blog/wp-content/uploads/2015/02/loop2.gif" alt="loop2" width="500" height="500" style="position: absolute;"></div>

<p>The <a href="http://www.reddit.com/r/perfectloops/comments/2v0n3a/welcome_to_infinity_it_only_goes_up_from_here/">background</a> and <a href="http://netgrind.tumblr.com/post/91481904259/spiral-transparent">foreground</a> have differing periods of motion, which gives a rather pleasing effect.</p>

<p>It's also possible to overlay GIFs to use as sprites.  In this example, there's an animated background image (I got bored moving the clouds!), the ? blocks are separate GIFs positioned with CSS, as are the Goomba and Mario.</p>

<p>If you click on the frame, you can control Mario with your left and right cursor keys.</p>

<iframe src="https://shkspr.mobi/gifs/index.html" width="100%" height="550px"></iframe>

<p>The movement and flipping is controlled with JavaScript altering the CSS of the image.  The code itself is rather trivial - and I haven't added any collision detection - but it's works fairly well. You probably wouldn't want to build an entire game this way, but it's quite fun to see what's possible with just a couple of lines of code.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=20524&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2015/02/overlapping-animated-gifs/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Pair Programing At The Code Club]]></title>
		<link>https://shkspr.mobi/blog/2014/11/pair-programing-at-the-code-club/</link>
					<comments>https://shkspr.mobi/blog/2014/11/pair-programing-at-the-code-club/#respond</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 07 Nov 2014 12:35:02 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[codeclub]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=10217</guid>

					<description><![CDATA[Running a Code Club sometimes means thinking quickly on your feet.  I recently started a new Code Club at work. We thought we had everything set up perfectly when disaster struck.  We went in to our assigned room half an hour before the club started and began to set up. Of the eleven computers we needed, only three had mice!  Nicola - my co-educator - frantically rushed around the building…]]></description>
										<content:encoded><![CDATA[<p>Running a <a href="http://codeclub.org.uk/">Code Club</a> sometimes means thinking quickly on your feet.</p>

<p>I recently started a new Code Club at work. We thought we had everything set up perfectly when disaster struck.</p>

<p>We went in to our assigned room half an hour before the club started and began to set up. Of the eleven computers we needed, only three had mice!</p>

<p>Nicola - my co-educator - frantically rushed around the building looking for spare pointing devices. I started switching the machines on. Half of them were unplugged. So, I began crawling underneath the desks to plug them back in. Fun!</p>

<p>I brought the kids in while Nicola logged into the machines. Once settled, I took the neophytes through the basics of the Code Club.</p>

<p>As the kids and I discussed the ethics of free software and the dangers of unchecked buffer overruns, Nicola signalled something was wrong. In a fit of genius, someone had decided to "liberate" most of the Ethernet cables from the computers.</p>

<p>In the end, we had 4 working computers and 10 children. This was a sub-optimal situation which needed immediate rectification. With just under an hour to get these kids hooked on Scratch, I took the decision to implement a Pair Programing regime.</p>

<p>I put a girl on each computer and split the boys between them - trying to mix the ages up a little. I explained how they had to help each other and <em>share</em> the keyboard and mouse.</p>

<p>Surprisingly, it worked pretty well! There were the usual clamour of hands raised to ask why Felix the Cat wasn't behaving <em>exactly </em>as they wanted - but having two people looking over the worksheets seemed to temper some of the more basic errors.</p>

<p>All the kids finished the first exercise, and some of them managed to stamp their own unique designs on the finished result.</p>

<p>Are we going to carry on with multiple kids to a single computer? Probably not. I felt guilty that a few of the kids didn't get as much time as they should have working directly on the projects. More than once I had to swap a pair round to make sure they got even time creating the program. There's a very real difference between seeing code being created and actually manipulating it yourself. It was a great way to introduce the kids to each other - and made for a fun and chatty classroom.</p>

<p>If you're running a Code Club, do be prepared for the odd mishap and try, where possible, to turn it into a learning experience for all involved.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=10217&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/11/pair-programing-at-the-code-club/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Wanted! Simple APIs Without Authentication]]></title>
		<link>https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/</link>
					<comments>https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Mon, 07 Apr 2014 11:02:53 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[api]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[Python Pals]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=9614</guid>

					<description><![CDATA[As some of you may know, I&#039;m writing a series of short stories to help young people learn how to code.  One of the things I wanted to do was introduce the concept of using RESTful APIs.  It&#039;s so powerful to show people that they can retrieve information from the Internet and then manipulate it in software.  Originally, I had wanted to use Twitter and Flickr as examples - they&#039;re both fairly well…]]></description>
										<content:encoded><![CDATA[<p>As some of you may know, I'm writing <a href="https://github.com/edent/PythonPals">a series of short stories to help young people learn how to code</a>.</p>

<p>One of the things I wanted to do was introduce the concept of using RESTful APIs.  It's so powerful to show people that they can retrieve information from the Internet and then manipulate it in software.</p>

<p>Originally, I had wanted to use Twitter and Flickr as examples - they're both fairly well known and have interesting content.  The only problem is that both <strong>require</strong> authentication.  I'm an adult with two decades of programming experience and I <em>still</em> find OAuth-dances tricky!  I've no idea how to create a foolproof guide for a child to get authentication tokens.  Added to the fact that under-13 year-olds often can't legally enter into agreements with these companies.</p>

<p>So, after <a href="https://twitter.com/edent/status/426271643980546048">posting the question on Twitter</a>, I've decided to make a list of fun and useful APIs which can be accessed without any form of authentication.</p>

<h2 id="wikipedia"><a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/#wikipedia">Wikipedia</a></h2>

<blockquote class="social-embed" id="social-embed-426273875178307584" lang="es" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><blockquote class="social-embed" id="social-embed-426271643980546048" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/edent" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRkgBAABXRUJQVlA4IDwBAACQCACdASowADAAPrVQn0ynJCKiJyto4BaJaQAIIsx4Au9dhDqVA1i1RoRTO7nbdyy03nM5FhvV62goUj37tuxqpfpPeTBZvrJ78w0qAAD+/hVyFHvYXIrMCjny0z7wqsB9/QE08xls/AQdXJFX0adG9lISsm6kV96J5FINBFXzHwfzMCr4N6r3z5/Aa/wfEoVGX3H976she3jyS8RqJv7Jw7bOxoTSPlu4gNbfXYZ9TnbdQ0MNnMObyaRQLIu556jIj03zfJrVgqRM8GPwRoWb1M9AfzFe6Mtg13uEIqrTHmiuBpH+bTVB5EEQ3uby0C//XOAPJOFv4QV8RZDPQd517Khyba8Jlr97j2kIBJD9K3mbOHSHiQDasj6Y3forATbIg4QZHxWnCeqqMkVYfUAivuL0L/68mMnagAAA" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Terence Eden is on Mastodon</p>@edent</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody">What's an interesting / popular API which does NOT require authentication / API key?<br>Trying to inspire new coders without terrifying them!</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/edent/status/426271643980546048"><span aria-label="2 likes" class="social-embed-meta">❤️ 2</span><span aria-label="0 replies" class="social-embed-meta">💬 0</span><span aria-label="1 reposts" class="social-embed-meta">🔁 1</span><time datetime="2014-01-23T08:34:14.000Z" itemprop="datePublished">08:34 - Thu 23 January 2014</time></a></footer></blockquote><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/invisiblecomma" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRooCAABXRUJQVlA4IH4CAABwDACdASowADAAPq1EmEmmI6IhNVgNUMAViWoAqSbiMb2PxbRmnuD40w5eWlpTWg00xs/0ti/OME7rYyhkvgdPEFG7gh/T+BhQeAvPjE98IvaUCdE6ayEDMcus0OBYKv5S+LaeOZ71l5up/aAA/vtoCp/t6e1PPYLXt63NDZIpKR5lniwDv4MxUNVQ1604iWUXk4kRL8JFxOn6n37+CWgyhtPhSNyVwKIRJupPynn/hHtjFNdPXpm33ntI0v3fKLsZCTShGY3YPlbw0Iv0P80ScgdB3Fx4hAq7os0y2syP3YW3c454NPmtOH3p/y8Hgw8NbvUbxGXKSNzj1Mk82+/zCllPP7rQVp5s0XJ1CoaAXb3XEaO0wHHqe8XSKRXlOVAnUvk2Eyghohbguh8NI11S6CXMohgMuc65sNp20JfdUkcT8ywBBNfzCvmlezyXQekjl9hrehrOFeKgdKkCZj3RCm7ky0sI2W9i9yFdZ69TDw/EeNaJma0OoTUb9qXb2oceqokiRvPbO7xnc5l2CzbGUwGgL+0A9L0AJ4DoWnBn4MNU7mM82XlUuQS1BJT31uQVAe2nXyC58jhYghB7DCsI/vZYVkcfWurbxSqKUsoMbWRXLv7qbDy9KcxU1nSxwMOYT4TeDusQR4kvkKBqcTZkrftf5IZVFL9+k4MKeZQeALvRobhEoeRUCtNQMw65s39mf4Aoe2eU9+kGNHbrV4kMXWCmSGXNfIB4+xpz08dQWbWpFWgrt0VO2m5reCeK5HWip+EMbZ7nMT7SfjvJC99AdbiHIv2m3Ub18u8/RTpag9LdcLwBogVCJOQGH1lnFiySlDjUVuWzdWwJ3AAAAA==" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Alf Eaton</p>@invisiblecomma</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody"><small class="social-embed-reply"><a href="https://twitter.com/edent/status/426271643980546048">Replying to @edent</a></small><a href="https://twitter.com/edent">@edent</a> Wikipedia?</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/invisiblecomma/status/426273875178307584"><span aria-label="2 likes" class="social-embed-meta">❤️ 2</span><span aria-label="1 replies" class="social-embed-meta">💬 1</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2014-01-23T08:43:06.000Z" itemprop="datePublished">08:43 - Thu 23 January 2014</time></a></footer></blockquote>

<p>Why didn't I think of this first!?  The <a href="http://en.wikipedia.org/w/api.php?">Wikipedia API is self documenting</a> - although a little intense for a first time programmer.  It will also <a href="https://en.wikipedia.org/w/api.php?action=query&amp;titles=Albert_Einstein&amp;prop=images">pretty-print the information in a browser</a> - which makes it much more readable to a novice.</p>

<h2 id="radio-1"><a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/#radio-1">Radio 1</a></h2>

<p>The BBC offers a <a href="http://www.bbc.co.uk/radio1/developers/api/">bunch of developer APIs for Radio 1</a>.</p>

<p>Sadly, lots of the data returned is out of date, or simply broken. It is possible to get the latest Radio 1 playlist</p>

<pre>http://www.bbc.co.uk/radio1/playlist.json
</pre>

<p>But it's not wonderfully informative and links to XML documents if you want to actually play MP3 snippets.</p>

<h2 id="police-uk"><a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/#police-uk">Police UK</a></h2>

<blockquote class="social-embed" id="social-embed-426278057846919169" lang="en" itemscope="" itemtype="https://schema.org/SocialMediaPosting"><header class="social-embed-header" itemprop="author" itemscope="" itemtype="https://schema.org/Person"><a href="https://twitter.com/ayymanduh" class="social-embed-user" itemprop="url"><img class="social-embed-avatar social-embed-avatar-circle" src="data:image/webp;base64,UklGRv4CAABXRUJQVlA4IPICAADwCwCdASowADAAPrVKnUqnJCKhqqwA4BaJZgCzs3H+IuZyJDeXiL5owgKmpyy4gVaDU/JXr/RzDZp849wuL2gPPRMr/n4wAzCjjyfmadW445F6LSQ49gdgSmSL73B/LYyxHsalogUYgAD++9Ur9XMV/h/u0H3ITvFwyGKHv36ZFiG7CaxS+oFuGkMuJO0+PCytCgzYfrCkv5cQb143i0Ti9r8cfqovELVOQB8f3E/x/Is5LoYz43xhFKuUFztvAMWq7UAJ5U3jS1Dozq1q928722eoMwmq5T7eIk3ir9JyFGmLmxWgAPNWeXPQ16llDWb08HHRgFxUdfSUO+EO4Ha0DbprbUrPOTbU+fWKNWNKncBiaxBBYoV3sPI8ulEepBaDM7G1/vTZfvnVozNTqWHWrvWsdez+DJXId3hu6BGrjNV+DUaU1JYiKJBFwO6s2rdGONyAHmRDACW7lYURsQ8J4Y8qzAILHAUPOtCtAjGud55tl4ILS9BNyGRDKMDLSuBTGxtvjTNBsEkKK1Mq/Sllud44Jb/UTQsqf4rknVAW5GZ1FQj9MIZdWcebhl6PYqLKHL/Sz6/1WkIVqL5WgL08g9Ob4qz1RRV0IyYRBN+d0EmFgkUEAqFZHlwcvbXuCKJgxhAsy1R+Nvn5jRiLmNkJv6s3toewdznGQCpD2ymdCTFdInAKhGcpVS16jRvg4GRgDK7vqPpc4myH9djbCRrRQWKvAMmku5Qkj2vylYaETE161vUlu/xbj5/Vn0fmNAdmU4eN4cYg3fJf25ffEFuD2DVl18w8Ja5Iklm4VUUuMYa8m8GGzYLQLiG9fgTqNr0YEoizgHzU//DojexbUvyMz4Rq0LUByr3hFR/Ha69PKaOb6761fbLdouzT3+ti6ymrOtcgt3gqn7P/vmLCYs8Oy2v5fqJaBUy1M5v4py7/dpA6+PumLkJ1hFbgGlYyWbkJDfEIZvKpPkZ8d5+UO0LdjEOnf7Oe9zIJ6z1v07JCBWQA" alt="" itemprop="image"><div class="social-embed-user-names"><p class="social-embed-user-names-name" itemprop="name">Amanda 🏳️‍🌈🔮</p>@ayymanduh</div></a><img class="social-embed-logo" alt="Twitter" src="data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%0Aaria-label%3D%22Twitter%22%20role%3D%22img%22%0AviewBox%3D%220%200%20512%20512%22%3E%3Cpath%0Ad%3D%22m0%200H512V512H0%22%0Afill%3D%22%23fff%22%2F%3E%3Cpath%20fill%3D%22%231d9bf0%22%20d%3D%22m458%20140q-23%2010-45%2012%2025-15%2034-43-24%2014-50%2019a79%2079%200%2000-135%2072q-101-7-163-83a80%2080%200%200024%20106q-17%200-36-10s-3%2062%2064%2079q-19%205-36%201s15%2053%2074%2055q-50%2040-117%2033a224%20224%200%2000346-200q23-16%2040-41%22%2F%3E%3C%2Fsvg%3E"></header><section class="social-embed-text" itemprop="articleBody"><small class="social-embed-reply"><a href="https://twitter.com/edent/status/426271643980546048">Replying to @edent</a></small><a href="https://twitter.com/edent">@edent</a> I'm *slightly* biased here, but <a href="http://data.police.uk/docs/">data.police.uk/docs/</a>? : )</section><hr class="social-embed-hr"><footer class="social-embed-footer"><a href="https://twitter.com/ayymanduh/status/426278057846919169"><span aria-label="0 likes" class="social-embed-meta">❤️ 0</span><span aria-label="0 replies" class="social-embed-meta">💬 0</span><span aria-label="0 reposts" class="social-embed-meta">🔁 0</span><time datetime="2014-01-23T08:59:43.000Z" itemprop="datePublished">08:59 - Thu 23 January 2014</time></a></footer></blockquote>

<p>Not great for international audiences - but a fantastic resource for students in the UK.  All sorts of crime statistics.</p>

<h2 id="google-books"><a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/#google-books">Google Books</a></h2>

<p>Google provides a free book search API which is simple to use.</p>

<pre>https://www.googleapis.com/books/v1/volumes?q=isbn:0747532699
</pre>

<p>And you get pretty-printed JSON back with information about the book.</p>

<h2 id="google-location"><a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/#google-location">Google Location</a></h2>

<p>Google has a pretty good location API which doesn't require a login.</p>

<pre>https://maps.googleapis.com/maps/api/geocode/json?address=Oxford%20University,%20uk&amp;sensor=false
</pre>

<p>Again, with some pretty printed JSON.</p>

<h2 id="twitter-url-count"><a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/#twitter-url-count">Twitter URL Count</a></h2>

<p>Twitter's APIs are usually heavily locked down - but there is one which is open.  It allows you to enter any URL and see how often it has been shared.</p>

<pre>http://urls.api.twitter.com/1/urls/count.json?url=http://www.bbc.co.uk/news/technology-26879185
</pre>

<p>The response is pretty simple.</p>

<pre>{"count":685,"url":"http://www.bbc.co.uk/news/technology-26879185/"}
</pre>

<h2 id="apple"><a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/#apple">Apple</a></h2>

<p>Apple are surprisingly friendly.  They have a <a href="https://www.apple.com/itunes/affiliates/resources/documentation/itunes-store-web-service-search-api.html">simple API for looking up iTunes content</a>.</p>

<p>Here, for example is all of Beyoncé's music videos.</p>

<pre>https://itunes.apple.com/search?term=beyonce&amp;entity=musicVideo
</pre>

<h2 id="what-else"><a href="https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/#what-else">What Else?</a></h2>

<p>I'm sure I've missed loads.  If you know of any, please drop a link in the comments.</p>

<p>Remember, the criteria are...</p>

<ol>
<li>No authentication needed.</li>
<li>Well structured output.</li>
<li>Interesting data.</li>
<li>Child friendly.</li>
<li>Current.</li>
<li>Preferably free (libre and gratis).</li>
</ol>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=9614&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2014/04/wanted-simple-apis-without-authentication/feed/</wfw:commentRss>
			<slash:comments>15</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Code Club Lessons - The Checklist]]></title>
		<link>https://shkspr.mobi/blog/2013/02/code-club-lessons-the-checklist/</link>
					<comments>https://shkspr.mobi/blog/2013/02/code-club-lessons-the-checklist/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Sat, 23 Feb 2013 12:00:01 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[checklist]]></category>
		<category><![CDATA[checklist manifesto]]></category>
		<category><![CDATA[codeclub]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[coding for kids]]></category>
		<category><![CDATA[codingforkids]]></category>
		<category><![CDATA[pens]]></category>
		<category><![CDATA[scratch]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=7649</guid>

					<description><![CDATA[Somehow, simultaneously, all 10 children in my CodeClub shoot their hands up.  &#34;Terence! Terence! Why doesn&#039;t this work?  &#34;Help! My bird isn&#039;t flapping!&#34;  &#34;What do I press to set this variable?&#34;  I am run off my feet. I dash from workstation to workstation, troubleshooting the problems.  In every case, my response is the same.  &#34;Did you follow the instructions on the sheet?&#34; I say.  &#34;YES!&#34; Comes…]]></description>
										<content:encoded><![CDATA[<p>Somehow, simultaneously, all 10 children in my CodeClub shoot their hands up.</p>

<p>"Terence! Terence! Why doesn't this work?</p>

<p>"Help! My bird isn't flapping!"</p>

<p>"What do I press to set this variable?"</p>

<p>I am run off my feet. I dash from workstation to workstation, troubleshooting the problems.  In <em>every</em> case, my response is the same.</p>

<p>"Did you follow the instructions on the sheet?" I say.</p>

<p>"YES!" Comes the howl of protestation.</p>

<p>"Even this one where it tells you to click on cat before making the changes?"</p>

<p>"Oh... Oh! That makes sense! Thanks." and off they go.</p>

<p>I'm quite serious.  For five lessons, I extolled the virtues of reading the worksheets.  Of double-checking one's workings.  Of re-reading the instructions and making sure they had been followed.</p>

<p>No impact.</p>

<p>So, I bought out the big guns!</p>

<p><a href="http://www.amazon.co.uk/gp/product/B004DBHR2Q/ref=as_li_ss_il?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B004DBHR2Q&amp;linkCode=as2&amp;tag=shkspr-21"><img border="0" src="https://images-eu.ssl-images-amazon.com/images/I/5101VHponmL._SL1600_.jpg"></a></p>

<p>Yeah, that's right. Biro pens!</p>

<p>"Next to every step," I intoned, in my most schoolmasterly voice "is a check box."</p>

<p>I showed them the worksheets created by <a href="http://www.codeclub.org.uk/">Code Club</a>.
<a href="https://shkspr.mobi/blog/wp-content/uploads/2013/02/Scratch-Worksheet.jpg"><img src="https://shkspr.mobi/blog/wp-content/uploads/2013/02/Scratch-Worksheet.jpg" alt="Scratch Worksheet" width="663" height="628" class="aligncenter size-full wp-image-7650"></a>
"Once you have completed a step," I continued, "You are to tick the box with your pen.  Then, and <strong>only then</strong> can you proceed to the next step.  And woe betide any child who calls me over for help without first having made sure they have completed all the necessary steps..."</p>

<p>I then set them off and braced for the inevitable flurry of hands.</p>

<p>Nothing!  Blissful silence as the kids toiled away over their Scratch projects.</p>

<p>I waited and waited.  Slowly, a hand raised.</p>

<p>"Terence," the girl's voice wavered, "I've instantiated my variables but I don't know whether they should have global scope or merely be restricted to local scope."</p>

<p>(Ok... ok... She didn't word it <em>quite</em> like that - but that's what she meant.)</p>

<p>A few minutes later a boy stuck up his hand.</p>

<p>"I've found an interesting race condition which occurs when two scripts are initialised simultaneously.  Is there any way to guard against this?"</p>

<p>(Again, I've embellished. Look, these are 9 year olds learning Scratch. Their computer science vocabulary is somewhat limited.)</p>

<p>In fact, there were only a couple of questions which could be answered by saying "read the text thoroughly and tell me what you've missed."</p>

<p>The majority were interesting questions about Scratch, how to craft fun games, general computing problems, and the philosophical nature of whether a horse could outrace a bat.</p>

<p>And all because I'd handed each kid a pen and taught them how to use it.</p>

<h2 id="ticking-all-the-boxes"><a href="https://shkspr.mobi/blog/2013/02/code-club-lessons-the-checklist/#ticking-all-the-boxes">Ticking All The Boxes</a></h2>

<p>By complete coincidence, I have just finished reading <a href="http://www.amazon.co.uk/gp/product/B0037Z8SLI/ref=as_li_ss_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B0037Z8SLI&amp;linkCode=as2&amp;tag=shkspr-21">The Checklist Manifesto by Atul Gawande </a></p>

<p><a href="http://www.amazon.co.uk/gp/product/B0037Z8SLI/ref=as_li_ss_il?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B0037Z8SLI&amp;linkCode=as2&amp;tag=shkspr-21"><img border="0" src="https://images-eu.ssl-images-amazon.com/images/I/41KbpPiGF7L._SL1600_.jpg"></a></p>

<p>Much like Malcolm Gladwell's books, its premise can be summed up in a single sentence.  People doing complex tasks often forget basic steps - following a checklist helps prevent errors.</p>

<p>In <a href="http://en.wikipedia.org/wiki/Atul_Gawande">Atul Gawande</a>'s book, he talks about his success at introducing a checklist at hospitals.  By reminding surgical teams to make sure they were operating on the correct side of the patient, had appropriately sterilised the equipment, and knew of any likely complications - they were able to prevent thousands of mistakes and save hundreds of lives.</p>

<p>It sounds too good to be true, doesn't it?  Having a tickbox which says "check patient has suitable anaesthesia" (or whatever) actually works.  To quote from <a href="http://www.nejm.org/doi/full/10.1056/NEJMsa0810119">a study of the checklist published in the New England Journal of Medicine</a>:</p>

<blockquote><p>The rate of death was 1.5% before the checklist was introduced and declined to 0.8% afterward (P=0.003). Inpatient complications occurred in 11.0% of patients at baseline and in 7.0% after introduction of the checklist (P&lt;0.001).</p></blockquote>

<p>You can find <a href="https://web.archive.org/web/20130525073749/https://gawande.com/articles">links to some peer reviewed articles about the success of the checklist on Gawande's website</a>.</p>

<p>While I recommend <a href="http://www.amazon.co.uk/gp/product/B0037Z8SLI/ref=as_li_ss_tl?ie=UTF8&amp;camp=1634&amp;creative=19450&amp;creativeASIN=B0037Z8SLI&amp;linkCode=as2&amp;tag=shkspr-21">buying the book</a> - you can read for free the <a href="http://www.newyorker.com/reporting/2007/12/10/071210fa_fact_gawande?currentPage=all">original article which inspired it</a> in the New Yorker.</p>

<p>It's important to realise that a checklist isn't a universal panacea.  The checklist itself has to be well designed and easy to use.  But after seeing how it transformed a cluster of kids in a Code Club, I'm a convert.  Before, they struggled to reach the end of a worksheet because they spend so much time correcting their mistakes. With the checklist, they were easily able to reach the end and could spend more time playing, coding, designing, and having fun.</p>

<p>More importantly, the kids didn't seem to mind having to occasionally tick a box to move on to the next step. It didn't interrupt their flow or stifle their imagination.</p>

<p>An <a href="http://qualitysafety.bmj.com/content/20/1/102.abstract">article in the British Medical Journal about the effectiveness of the checklist</a> in surgical situations concluded with:</p>

<blockquote><p>The checklist was considered easy to use by 80.2% of respondents, while 19.8% felt that it took a long time to complete, and 78.6% felt that the programme prevented errors.</p></blockquote>

<p>The real kicker is the final line.</p>

<blockquote><p>Overall, 93.4% would want the checklist used if they were undergoing operation.</p></blockquote>

<p>If you're teaching kids or adult - consider seeing what a simple checklist can do for your students.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=7649&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2013/02/code-club-lessons-the-checklist/feed/</wfw:commentRss>
			<slash:comments>1</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Python Pals and the Letter Logjam]]></title>
		<link>https://shkspr.mobi/blog/2012/11/python-pals-write-a-worry/</link>
					<comments>https://shkspr.mobi/blog/2012/11/python-pals-write-a-worry/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Tue, 06 Nov 2012 07:50:56 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Python Pals]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=6631</guid>

					<description><![CDATA[This is the second of my &#34;Python Pals&#34; short stories.  They&#039;re designed to be solve-it-yourself puzzle stories to help kids learn the basics of programming.  All feedback welcome!  The Python Pals Write A Wrong  Poppy&#039;s mother, Ada, was not happy. &#34;I don&#039;t care about that,&#34; she shouted down the phone, &#34;Why am I always the one who has to pick up the pieces?&#34;  She carried on ranting.  Penny and…]]></description>
										<content:encoded><![CDATA[<p>This is the second of my <a href="https://shkspr.mobi/blog/2012/11/the-python-pals-program-a-problem/">"Python Pals" short stories</a>.</p>

<p>They're designed to be solve-it-yourself puzzle stories to help kids learn the basics of programming.</p>

<p>All feedback welcome!</p>

<h2 id="the-python-pals-write-a-wrong"><a href="https://shkspr.mobi/blog/2012/11/python-pals-write-a-worry/#the-python-pals-write-a-wrong">The Python Pals Write A Wrong</a></h2>

<p>Poppy's mother, Ada, was <strong>not</strong> happy.
"I don't care about that," she shouted down the phone, "Why am I always the one who has to pick up the pieces?"</p>

<p>She carried on ranting.  Penny and Poppy were sat in the lounge. Even though the TV volume was quite high, they could still hear snatches of the conversation.
Suddenly, the door burst open and Ada stormed in, "What are you two doing right now?" she demanded.</p>

<p>"Just watching TV," said Poppy, "It's the episode where they..." but before she got a chance to finish, her mother interrupted.
"Nothing then. Good. You can make yourselves useful."
"But <em>mum</em>!"
"But nothing.  I need to go into town to deal with.... just into town. I'm not going to have a chance to type up all these thank you letters. So I need you to do it."
Penny smiled sweetly at her friend's mother, "Sure thing, Ada, we'd be happy to!"
"Good. It's settled. And please get them all done by the time I get back. I need to get them sent and I..." she looked close to tears.
"Don't worry, mum, we'll get them done."
Ada gave a weak smile, kissed her daughter on the forehead, and left without saying a word.</p>

<p>Penny turned to her pal and said, "Let's get cracking!"</p>

<p>They ran into Ada's work room.  It was plainly furnished, although the desk was a mess of papers.  A vase sat in the corner, its flowers long since withered.</p>

<p>"What's all this about, Poppy?" asked Penny.</p>

<p>"There's loads of really yucky diseases out there and mum's been raising money to make sure that young women stay healthy. Now, where does my mum keep her pen and paper?"</p>

<p>Penny fixed Poppy with a steely glare - the one she usually reserved for people who asked if she wanted to take up cross-country running, or some other mad sport.</p>

<p>"What do you want to write them all by hand for?" She asked.  Out of her blue and white school rucksack she pulled her Raspberry Pi and set it up on the desk.</p>

<p>Poppy passed Penny a USB stick which had been nestling in a collection of newspaper clippings on her mother's desk, "All of the donors should be on there."</p>

<p>Penny plugged the stick into the Raspberry Pi.  She fiddled around until she could see its file system.</p>

<p>"Aha, there we go!" Penny said triumphantly "Let me just open it up."</p>

<p>A few clicks later and the text file displayed on the screen.  It showed the names of all the donors and how much they'd given.</p>

<pre>Anna 2.50
Beth 5.93
Cath 23.50
Dom 15
Erik 3.14
...
</pre>

<p>(<a href="https://shkspr.mobi/blog/wp-content/uploads/2012/11/donors.txt">You can download the file to your computer</a>)</p>

<p>The file kept on scrolling and scrolling.</p>

<p>Poppy shrieked, "There's well over a hundred names here! We're never going to be able to finish all these letters by the time my mum comes back! Not even you are that fast a typist."</p>

<p>"Pops," said Penny, "I don't want to be mean - but you're being <em>incredibly</em> thick. So utterly, mind bendingly dense that I'm not sure if we can be friends any more." Very loudly and slowly she said "We have a computer, you prat! We'll get the Pi to do the hard work for us!"</p>

<p>Poppy looked sheepish, "Oh... Yeah. Wait! I suppose we can use Python to get this done in a few minutes?"</p>

<p>Penny put on her cheesiest American accent and drawled, "Got it in one, partner."</p>

<p>When they had both regained their composure, Penny perched on a chair with both legs tucked underneath her. Poppy hopped up on the windowsill so she could see the screen and her friend at the same time.</p>

<p>Poppy started, "Well, let's break it down in to easy to manage chunks.  You've got a file with the names and amounts people have given, right?"
"Right."
"Ok, so we want to read in each line of the file, then create a letter based on the information."
"That should be pretty easy, Pops." Penny stretched out her fingers and started typing. She was most at home when her fingers were flying over the keyboard.  As she typed, she spoke.</p>

<p>"It just takes one line of code to open a file. You just tell Python where the file is, and if you want to read to the file or write to the file."</p>

<pre lang="python">textfile = open('donors.txt', 'r')
</pre>

<p>"Our file is in the same directory as this Python program, and we only want to read it.  To see if we've got the right file, we can tell Python to display its contents."</p>

<pre lang="python">print textfile.readlines()
</pre>

<p>She saved the program and ran it.  The file displayed itself in the console.</p>

<p>"Great," said Poppy, grinning, "One task down. Now every line just has the person's name and how much they donated, right?"
"Yup. So we can read the file a line at a time and do something with each line.  Watch."</p>

<p>She deleted her code and started again</p>

<pre lang="python">textfile = open('donors.txt', 'r')
lines = textfile.readlines()

for line in lines:
   chunks = line.split()
   donor_name = chunks[0]
   donor_amount = chunks[1]
   print donor_name
</pre>

<p>"So," she said methodically, "We open the file. We get every line. We split every line based on spaces. Of those two chunks, we called the first the donor's name, and the second the donor amount. Then we print out the donor's name - just to be sure."</p>

<p>Her finger hovered over the keyboard. Just as she was about to run the program, Poppy interrupted.</p>

<p>"Hang on. Why is 'donor_name' coming from chunk zero? Shouldn't it be from one - and the amount from chunk two?"</p>

<p>"Ah," said Penny, "In Python - and most other languages - lists always start from zero."
"That's dumb," said Poppy.
"You get used to it."
"But what's the point in that?"
"Well, think of the years. We're in the 2000s now.  The first year of the 2000 was - obviously - 2000. The second year was 2001, the third was 2002 and so on."
"Oh!" said Poppy, as things clicked into place, "That makes sense... kinda..."
"As I said, you get used to it. Now, where were we?"
"Right, we want to say something like 'Dear donor_name, Thanks for your donation, blah blah blah, etc'"
"You are <em>so eloquent</em>!" Penny's sarcasm flew out before she could stop herself.  She carried on typing, adding the following lines.</p>

<pre lang="python">   letter = "Dear " + donor_name + ", "
   letter += "Thank you for your donation of " + donor_amount
   print letter</pre>

<p>"When you add two strings of text together," she explained, "Python just sticks them next to each other - it's called concatenation."
"But what are those plus-equals symbols for?"
"If you want to add something on to an existing variable, you could say</p>

<pre>whatever = whatever + something</pre>

<p>but it's quicker to say</p>

<pre>whatever += something</pre>

<p>"
"Ooooh!" gasped Poppy - who was very good at interjecting with what she perceived as helpful comments, "Make it say 'Generous Donation'!"
"Yeah, but some of the people <em>weren't</em> very generous."
"Well, that's easy enough to solve. Only say generous if they gave more than £10."
"Of course!" Said Penny, "Why didn't I think of that?"
"Hey! That's why we're such good friends - I'm the brains and you're the...." Poppy trailed off.
"The typist?" Penny said scornfully as she, hammered the keys angrily.</p>

<pre lang="python">   letter += "Thank you for your "
   if float(donor_amount) &gt; 10:
</pre>

<p>"What does 'float' mean?" asked Poppy.
Penny turned in her chair to face her friend, "Ok, our Python code has read a string of text from the file, right?"
"Yup"
"So it thinks that '5' is the character '5' not the <em>number</em> '5'."
"Ah! So if you had '5'+'2' it would be '52'."
"Bazinga! So, we need to 'cast' the character into the number. Think of it like casting a spell on someone to look like a frog."
The light dawned on Poppy's face. "I see! So when you say 'float(donor_amount)' you're saying to Python 'Imagine that this is a number'"
Penny nodded and carried on typing.</p>

<pre lang="python">   letter += "Thank you for your "
   if float(donor_amount) &gt; 10:
      letter += "very generous "
   letter += "donation of " + donor_amount
   print letter
</pre>

<p>"It's just simple maths. You can use &gt; for seeing if something is greater than something else, or &lt; for less than."
Poppy peered at the keyboard.  She cleaned her glasses and peered again. "So where's the greater-than-or-equal-to key?"
"There isn't one.  You just have to type the equals key afterwards like &gt;= or &lt;="
"Nifty. Oh, and not to criticise, but you left off the £ symbol on the donor amount."</p>

<p>Penny deftly changed the line to read:</p>

<pre lang="python">   letter += "donation of £" + donor_amount
</pre>

<p>But this time, when she ran the program, something unexpected happened.</p>

<p><small>Now run the code on your computer</small></p>

<pre>SyntaxError: Non-ASCII character 'xc2' in file letter.py on line 9, but no encoding declared; see http://www.python.org/peps/pep-0263.html for details</pre>

<p>Both girls swore in unison.  There always seemed to be something to trip them up.
"Computers," opined Penny, "Can be really dumb sometimes. They hate it when you use funny symbols."
Poppy considered this, "So we need to tell it what characters we'll be using?"
"Pretty much. We just need to pop this line at the top of our code." Penny scrolled to the top and tapped out the magic incantation.</p>

<pre lang="python"># This Python file uses the following encoding: utf-8
</pre>

<p>"That ought to do it."
"So, we've got their name, a message, and how much they donated. What else is there?
"Nothing!" sang Penny, "Let's carry on watching TV."
"How about," continued Poppy, blithely ignoring her friend, "How about we told them what their donation has bought?"
"Or, we could <em>carry on watching TV</em>!"
"No, if a job's worth doing, it's worth doing properly."
"<em>Fine</em>!" Penny huffed, "How much did each vaccination cost?"
Poppy scrabbled around on her mother's desk, studiously ignoring all the legal papers on there, until she found the document she was looking for.
"£1.34 per vaccine."</p>

<p>"That's pretty easy," said Penny, "We'll create a variable for the vaccine cost, then divide the amount donated by that.</p>

<pre lang="python">vaccine_cost = 1.34
vaccines_bought = float(donor_amount) / vaccine_cost
letter += ".  That enabled us to buy " + str(vaccines_bought) + " vaccines."
</pre>

<p>"Obviously, we'll have to cast the number back to a string so we can stick it in to the letter." said Penny.</p>

<p>Poppy got a smug grin on her face, "You're going to have a problem there, Pen."
"What on Earth are you talking about?"
"Run it and see..."</p>

<p><small>Now run the code on your computer</small></p>

<p>Penny ran the program. She stared at the output, twitched her nose and shouted "Rattlesnakes!"
"The problem," Poppy sighed, "is that computers are <em>really</em> precise. Much more so than humans."
"Stupid humans," muttered Penny.
"So, can we just round things down using the 'round()' function?" said Poppy, conspicuously ignoring her friend's desire to transcend humanity and become one with the machines.
Penny typed away.</p>

<pre lang="python">round( float(donor_amount) / vaccine_cost )
</pre>

<p>"That's pretty much it, isn't it?" asked Penny plaintively.
"Yup, let's run off these letters and get back to the TV. If we're lucky, we won't have missed too much."</p>

<p>A short while later, Ada swung into the house, her humour looking much improved.
"Girls? Where are you?"
"In here, mum," called Poppy.
"What on Earth are you doing in the TV room?" Said Ada, suddenly looking furious, "I thought I asked you to..."
"Chill, mum," her daughter interrupted. "It's all done."
"What?" Said Ada, clearly baffled, "How could you have done all of those letters? There were at least a hundred."
"One hundred and twenty-eight," chimed in Penny.</p>

<p>They handed over a sheaf of paper to a dumbstruck Ada.</p>

<p>"But this is marvellous!" she cried, "What wonderful letters - and how clever of you to add in the details about how many vaccines their donations were worth!"</p>

<p>"Oh, it was nothing," said Poppy airily. "Now," she continued, "We're quite exhausted after all our hard work. Perhaps you would be so kind as to bring us some ice cream?"</p>

<p>"After all this," beamed Ada, "Ice cream floats for the pair of you!"</p>

<p>"With chocolate sprinkles?"</p>

<p>"Don't push your luck, young lady!" And with that, she twirled off into the kitchen.</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=6631&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2012/11/python-pals-write-a-worry/feed/</wfw:commentRss>
			<slash:comments>5</slash:comments>
		
		
			</item>
		<item>
		<title><![CDATA[Time To Resurrect The Byte Brothers?]]></title>
		<link>https://shkspr.mobi/blog/2012/11/time-to-resurrect-the-byte-brothers/</link>
					<comments>https://shkspr.mobi/blog/2012/11/time-to-resurrect-the-byte-brothers/#comments</comments>
				<dc:creator><![CDATA[@edent]]></dc:creator>
		<pubDate>Fri, 02 Nov 2012 11:30:46 +0000</pubDate>
				<category><![CDATA[/etc/]]></category>
		<category><![CDATA[byte brothers]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[NaBloPoMo]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[Python Pals]]></category>
		<category><![CDATA[scratch]]></category>
		<guid isPermaLink="false">http://shkspr.mobi/blog/?p=6446</guid>

					<description><![CDATA[I&#039;m currently getting involved in the Coding For Kids scene. I&#039;m setting up a workshop in my local library to teach kids programming - specifically, the MIT language Scratch.  I&#039;ve been left slightly dissatisfied with the unstructured nature of the Scratch teaching materials. While it&#039;s quite fun to teach a cat to dance - it doesn&#039;t seem to be building up to anything.  I&#039;m also working with…]]></description>
										<content:encoded><![CDATA[<p>I'm currently getting involved in the <a href="http://www.codeclub.org.uk/">Coding For Kids scene</a>. I'm setting up a workshop in my local library to teach kids programming - specifically, the MIT language <a href="http://scratch.mit.edu/">Scratch</a>.</p>

<p>I've been left slightly dissatisfied with the unstructured nature of the Scratch teaching materials. While it's quite fun to teach a cat to dance - it doesn't seem to be building up to anything.</p>

<p>I'm also working with <a href="http://appsforgood.org/">AppsForGood</a> - it's a project run in secondary schools which aims to get students to research, design, and build a mobile application which will be useful to them or their community.</p>

<p>One of the things I love about it is the students are often trying to solve their own real-world issues. There's a definite sense that they have identified a problem and are working towards a goal.</p>

<p>That's when I remembered The Byte Brothers! In the mid-eighties I somehow chanced upon the mysterious sounding <a href="http://openlibrary.org/works/OL15553835W/The_Bytes_Brothers_go_to_a_getaway">The Byte Brothers Go To A Getaway by Lois &amp; Floyd McCoy.</a></p>

<p><a href="http://www.computinghistory.org.uk/det/12994/The-Bytes-Brothers-Program-a-Problem-2/"><img class="alignleft  wp-image-6447" title="Byte Brothers Cover" src="https://shkspr.mobi/blog/wp-content/uploads/2012/10/Byte-Brothers-Cover.jpg" alt="Byte Brothers Cover" width="237" height="384"></a></p>

<p>"The Byte Brothers" were a series of "solve it yourself" adventures. You read the story, and had to attempt to solve the mystery using BASIC. A typical puzzle involved working out average speed, learning how to use loops to generate "I must not cheat in class" lines for detention, and decoding Morse code.</p>

<p>They stepped through the code as they went - explaining how it all worked and what you could do to change the program. You coded as you went along, until you completed the task.</p>

<p>I <em>loved</em> them. I was a sucker for adventure books, and I adored the thrill of being able to solve a crime using my trusty BBC Micro.</p>

<p>The books, sadly, seem <a href="http://www.goodreads.com/author/show/349264.Lois_McCoy">out of print</a>. There is virtually no information on the web about the Byte Brothers, nor Lois McCoy. Even Wikipedia is silent on the subject.</p>

<p>I think it's time to resurrect the spirit of the Byte Brothers! Is it possible to create a series of mystery short stories which can solved using, say, Python?</p>

<p>I think so!  I'll try to write a few solve-it-yourself adventure stories and publish them on here.  If you want to write a story - go ahead. If we get enough momentum behind this, I think it could really engage kids (and adults) into learning to code.</p>

<p>So, stay tuned for tomorrow's exciting story "The Python Pals Program A Problem"!</p>
<img src="https://shkspr.mobi/blog/wp-content/themes/edent-wordpress-theme/info/okgo.php?ID=6446&HTTP_REFERER=RSS" alt="" width="1" height="1" loading="eager">]]></content:encoded>
					
					<wfw:commentRss>https://shkspr.mobi/blog/2012/11/time-to-resurrect-the-byte-brothers/feed/</wfw:commentRss>
			<slash:comments>7</slash:comments>
		
		
			</item>
	</channel>
</rss>
