<?xml version="1.0" encoding="UTF-8"?>
<feed
  xmlns="http://www.w3.org/2005/Atom"
  xmlns:thr="http://purl.org/syndication/thread/1.0"
  xml:lang="en"
   >
  <title type="text">All Unkept</title>
  <subtitle type="text"></subtitle>

  <updated>2013-05-16T09:47:00Z</updated>
  <generator uri="http://blogofile.com/">Blogofile</generator>

  <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog" />
  <id>http://lukeplant.me.uk/blog/feed/atom/</id>
  <link rel="self" type="application/atom+xml" href="http://lukeplant.me.uk/blog/feed/atom/" />
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[Family Fortunes]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/family-fortunes/" />
    <id>http://lukeplant.me.uk/blog/posts/family-fortunes/</id>
    <updated>2011-05-13T13:57:27Z</updated>
    <published>2011-05-13T13:57:27Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Personal and misc" />
    <category scheme="http://lukeplant.me.uk/blog" term="Web development" />
    <category scheme="http://lukeplant.me.uk/blog" term="Software projects" />
    <summary type="html"><![CDATA[Family Fortunes]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/family-fortunes/"><![CDATA[<div class="document">
<p>Yesterday I needed to play Family Fortunes (a.k.a. Family Feud) at our church youth group. Our church doesn't have internet connection, so I needed something that would work offline.</p>
<p>There were quite a few versions you could download — for a fee. But as well as the price, getting the computer to do it all is often not so much fun as something with humans more in control, and you're limited to what the computer can do — not easy to fix when you type something in wrong.</p>
<p>So in the end, with a couple of hours to go before the club started, I reckoned I could code up a simple implementation of the score board in a web browser. I scraped some questions from <a class="reference external" href="http://www.pub-quiz.net/Family-Fortunes-quiz.htm">here</a>, used a bit of Python to parse and convert to JSON, then used jQuery and HTML5 audio to get <a class="reference external" href="http://lukeplant.me.uk/familyfortunes/">something that works pretty well</a> for our purposes and doesn't need an internet connection.</p>
<p>Usage and source code on <a class="reference external" href="https://bitbucket.org/spookylukey/familyfortunes/overview">bitbucket</a>. In brief:</p>
<ul class="simple">
<li>n - next question</li>
<li>p - previous</li>
<li>1-5 - correct answer</li>
<li>x - wrong answer</li>
</ul>
<p>We set up my laptop as the screen, with some speakers for increased volume, and one of the other leaders used a USB keyboard to control it and decide on correct answers, while I was the game show host. It ended up being pretty fun, and I can imagine re-using on a church holiday etc, with a projector perhaps.</p>
<p>I was also impressed by just how much you can do in a browser these days, with so little time and effort. Recently the brilliant <a class="reference external" href="http://code.google.com/p/flot/">flot</a> library made me realise the same thing — more and more, web development is beating desktop development in terms of APIs, speed of development, ease of development, and even the performance of the result. I very quickly produced a great set of graphs gathering some stats on a website&nbsp;— both attractive and interactive — and realised that even with many of the easiest charting solutions for the desktop, I would not have been able to produce anything like the results.</p>
</div>
]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[Bible memorisation web app]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/bible-memorisation-web-app/" />
    <id>http://lukeplant.me.uk/blog/posts/bible-memorisation-web-app/</id>
    <updated>2008-04-01T23:59:12Z</updated>
    <published>2008-04-01T23:59:12Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Python" />
    <category scheme="http://lukeplant.me.uk/blog" term="Django" />
    <category scheme="http://lukeplant.me.uk/blog" term="Web development" />
    <category scheme="http://lukeplant.me.uk/blog" term="Software projects" />
    <category scheme="http://lukeplant.me.uk/blog" term="Christianity" />
    <summary type="html"><![CDATA[Bible memorisation web app]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/bible-memorisation-web-app/"><![CDATA[
<p>EDIT: </p>

<p>Nearly four years later, I've created a much more complete <a href="http://learnscripture.net/">Bible memorization service - LearnScripture.net</a>.</p>

<p>The rest of this post is left for the sake of history. What used to be there at http://lukeplant.me.uk/bibleverses/ now redirects to learnscipture.net</p>

<hr>



<p>I recently decided to get more serious about memorising parts of the Bible.  I've found I can learn one a day fairly easily, with the right system, and realised I needed two things:</p>

<ul>
  <li>A system for ensuring I have a good coverage of topics.</li>
  <li>A method for keeping track of what I have memorised so far</li>
</ul>

<p>It is now just about ready for public consumption, so I present my:</p>
<div style="text-align: center">
<a href="http://lukeplant.me.uk/bibleverses/index.html">Bible Memorisation Schemes</a>
</div>
<br/>
<p>It should be fairly self explanatory. (read: I haven't had time to write any help yet).  At the most basic level, it is a set of pages with verse lists.  But if you register and log in, check boxes appear which you can use to indicate verses you have already learnt, and this data is stored on the server.</p>

<h3>Details</h3>

<p>I solved the first of my two aims with a set of <a href="http://www.yaml.org/">YAML</a> documents that define sets of verses and a hierarchy of topics, along with some Python scripts that combine them (into pages on <a href="http://lukeplant.me.uk/blog.php?id=1107301682">my personal wiki</a> first of, and now into an <a href="http://lukeplant.me.uk/bibleverses/topics.html">HTML version</a>), allowing me to see what I'm missing.</p>

<p>YAML proves to be very convenient for this type of thing:  you can use search and replace to do changes to more than one area, and can easily add new functionality.  For example, the <a href="http://hg.lukeplant.me.uk/python/luke/file/tip/lukeplant_me_uk/bibleverses/yaml/BibleMemorisationSchemeYaml?style=gitweb">scheme definitions</a> are perfectly readable in English, but exceptional easy to turn into nice data structures in Python to manipulate the data.  The Python scripts generate the actual schemes, which makes it very easy to add new verses and still have schemes that are balanced and varied (or focused, if that's what your scheme definition says).
</p>

<p>The web app is written in Python, using CGI.  (It is a very basic app, which talks only JSON, and uses just two database tables&mdash;so I didn't want to rely on a heavy framework that would have special hosting requirements).  I started using <a href="http://webpy.org/">web.py</a> at first, but had two problems with it:</p>
<ul>
  <li>For an AJAX CGI app, it is much too heavyweight, as "hello world" on my server took about 1.2 seconds due to everything that was being imported.<br/><br/></li>
  <li>Frankly, I thought it sucked.  I have been spoilt by the lovely design of Django.  web.py really has a different niche to Django, but given <a href="http://www.aaronsw.com/weblog/rewritingreddit">Aaron's dismissiveness of Django's API design</a> I was expecting he would have learnt more from it, such as:<br/><br/>
<ul><li>Views are functions.  Using classes which have 'GET' and 'POST' methods may seem like a good idea, but often it isn't due to the duplication between the two responses.  Going from a function based system to a class based system is very easy (just implement <code>SomeBaseClassForViews.__call__()</code>).  But going the other way around is ugly.<br/><br/></li>
<li>View functions simply take request objects and return response objects.  In web.py, parts of the request path are passed into the function, as in Django, but you have to call <code>web.input()</code> to get query data and posted data (where <code>web</code> is a module, not an object passed in).  But, even worse, you call web.header() to write headers, while the body of the response is '<code>print</code>'ed out (or returned as a string in version 0.3).  This is horrible.  <br/><br/>With Django's method, you can do amazing things like the <a href="http://www.djangoproject.com/documentation/authentication/#the-login-required-decorator">@login_required decorator</a> (it is very cool -- seamlessly persists any posted data, passing it along to the view once the user has successfully logged in [EDIT - see comment below]).  And the implementation is robust and straightforward, not magical (though not completely simple either, due to the nature of the case).  You can also do cache control decorators, and write a <a href="http://lukeplant.me.uk/resources/djangovalidator/">validator middleware</a> etc.  This is simply from following standard good programming practice, in which side effects are avoided where possible, and function outputs depend only on inputs.<br/><br/></li>

</ul>

<p>Some of Aaron Swartz's design decisions just niggled me too.  It is claimed that "web.py lets you write web apps in Python", but to me it seems more like something which is reminiscent of Python, but sloppier.  Take for instance the definition of URLs.  If it had been this:</p>
<pre class="python">
urls = [
    ('/(.*)', 'hello')
]
</pre>
<p>...I would have understood it straight away.  Instead, I stared at this for a while:
<pre class="python">
urls = (
      '/(.*)', 'hello'
  )
</pre>
<p>...and eventually found that the explanation is <a href="http://webpy.org/faq">it'd be a lot more typing</a> to do it the sensible way.  I guess readability doesn't count for anything.</p>
</li>
</ul>

<p>So anyway, I happily ditched web.py, wrote my own Django-inspired mini framework that does just what I need, and fixed my performance problem (the 'framework' is in <a href="http://hg.lukeplant.me.uk/python/luke/file/tip/lukeplant_me_uk/bibleverses/web/cgi-bin/lib/bibleverses/webutils.py?style=gitweb">webutils.py</a>, see the <a href="http://hg.lukeplant.me.uk/python/luke/file/tip/lukeplant_me_uk/bibleverses/web/cgi-bin/lib/bibleverses/views.py?style=gitweb">views.py</a> file for example usage.  Most of it was developed using TDD, which turned out to be a big timesaver&mdash;it's just so quick to make big changes and be sure you haven't broken anything.
</p>

<p>Anyway, it has been a nice little project, and I'm hoping that it will actually prove useful to me and others!</p>
]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[Django validator updated]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/django-validator-updated/" />
    <id>http://lukeplant.me.uk/blog/posts/django-validator-updated/</id>
    <updated>2007-04-18T14:26:26Z</updated>
    <published>2007-04-18T14:26:26Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Python" />
    <category scheme="http://lukeplant.me.uk/blog" term="Software projects" />
    <category scheme="http://lukeplant.me.uk/blog" term="Web development" />
    <category scheme="http://lukeplant.me.uk/blog" term="Django" />
    <summary type="html"><![CDATA[Django validator updated]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/django-validator-updated/"><![CDATA[
<p>I've updated my <a href="http://lukeplant.me.uk/resources/djangovalidator/">validator app</a> to latest Django trunk and finally done a release. (It's a small but very useful Django app that does HTML validation of all outgoing pages, logging errors) </p>

<p>I've also added a small feature -- the app detects duplicate error messages for the same URL, so you no longer get the same page cluttering up the list of validation failures.</p>

]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[Updated validator and CsrfMiddleware]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/updated-validator-and-csrfmiddleware/" />
    <id>http://lukeplant.me.uk/blog/posts/updated-validator-and-csrfmiddleware/</id>
    <updated>2005-12-14T23:45:01Z</updated>
    <published>2005-12-14T23:45:01Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Software projects" />
    <category scheme="http://lukeplant.me.uk/blog" term="Django" />
    <summary type="html"><![CDATA[Updated validator and CsrfMiddleware]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/updated-validator-and-csrfmiddleware/"><![CDATA[
<p>I've released some small updates to my 'Django validator app' and 'CsrfMiddleware'.  The main changes are:</p>
<ul>
<li>added a setup.py to both of them, after working out how these work and a lot of fiddling around.</li>
<li>added support for mod_python to the validator app (thanks nesh)</li>
<li>added a setting to allow the validator to ignore certain paths.</li>
</ul>

<p>Get them here:</p>
<ul>
<li><a href="http://lukeplant.me.uk/resources/djangovalidator/">Django Validator</a></li>
<li><a href="http://lukeplant.me.uk/resources/csrfmiddleware/">CsrfMiddleware</a></li>
</ul>

<p>I've also discovered that my CsrfMiddleware is currently number 6 in a google search for <tt>Cross Site Request Forgery</tt>, which is rather pleasing, or perhaps it just tells you how little there is on the web about this exploit.</p>

]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[My blog code]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/my-blog-code/" />
    <id>http://lukeplant.me.uk/blog/posts/my-blog-code/</id>
    <updated>2005-02-16T13:15:21Z</updated>
    <published>2005-02-16T13:15:21Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Software development" />
    <category scheme="http://lukeplant.me.uk/blog" term="Software projects" />
    <summary type="html"><![CDATA[My blog code]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/my-blog-code/"><![CDATA[
<p>If anyone's interested, you can get the <a href='downloads/lukesblogcode-2005-02-15.tar.gz'>code for my blog</a> here.  I've put it together pretty quickly - I've just packaged everything from my own directories that you need for it to work without error, plus a README.  If you actually wanted to use it you'd need to replace at least the main page template and customise the others and the CSS.  You could remove some things completely (like my blogroll  and related functions).</p>

<p>It's licensed under the MIT license, so you can do pretty much anything with it.  As it is, it might be useful for anyone with some PHP knowledge who wants a simple but powerful blog.  It's got admin functions for managing posts, comments and categories (quite basic looking at the moment, but they do the job). The design is fairly clean so adding features to it should be pretty easy.</p>

<p>I'll try and add some more code comments (which are rather lacking at the moment), and I'll also be doing a few quick articles on the methods I've used, which are a more important product of what I've learnt than the blog software itself.</p>

<hr>

<p>Update: See <a href='websitecode.html'>Website code</a> for a new version of the code.</p>

]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[CodeExporter 1.0]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/codeexporter-1-0/" />
    <id>http://lukeplant.me.uk/blog/posts/codeexporter-1-0/</id>
    <updated>2004-07-20T19:30:18Z</updated>
    <published>2004-07-20T19:30:18Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Software projects" />
    <summary type="html"><![CDATA[CodeExporter 1.0]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/codeexporter-1-0/"><![CDATA[
New version of CodeExporter, ironing out the first bug I've found in ages, so it's probably pretty mature now, and has helped me out lots already. <a href='codeexporter.html'>Get it here.</a>
]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[CodeExporter 0.2]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/codeexporter-0-2/" />
    <id>http://lukeplant.me.uk/blog/posts/codeexporter-0-2/</id>
    <updated>2004-05-18T00:48:39Z</updated>
    <published>2004-05-18T00:48:39Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Software projects" />
    <summary type="html"><![CDATA[CodeExporter 0.2]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/codeexporter-0-2/"><![CDATA[
Uploaded release 0.2 of CodeExporter, the only difference being that the modules are no longer password protected, so you can get at the code.
]]></content>
  </entry>
  <entry>
    <author>
      <name></name>
      <uri>http://lukeplant.me.uk/blog</uri>
    </author>
    <title type="html"><![CDATA[VBA modules]]></title>
    <link rel="alternate" type="text/html" href="http://lukeplant.me.uk/blog/posts/vba-modules/" />
    <id>http://lukeplant.me.uk/blog/posts/vba-modules/</id>
    <updated>2004-05-18T00:13:41Z</updated>
    <published>2004-05-18T00:13:41Z</published>
    <category scheme="http://lukeplant.me.uk/blog" term="Software projects" />
    <summary type="html"><![CDATA[VBA modules]]></summary>
    <content type="html" xml:base="http://lukeplant.me.uk/blog/posts/vba-modules/"><![CDATA[<div class="document">
<p>I uploaded a public release of some VBA modules I use,  <a class="reference external" href="/vbamodules.html">download here</a>.</p>
</div>
]]></content>
  </entry>
</feed>
