writing

You are currently browsing the archive for the writing category.

In a moment of either inspiration or madness (I’m pinning my hopes on the fact that there’s a thin line between madness and genius), I decided to start work on a version of SWFK for the OLPC.

There are a couple of reasons why this is more of a challenge than the other versions of the book:

  1. I don’t have an OLPC
  2. The version of Python installed on the OLPC includes neither Tkinter nor, more importantly, the turtle module.

The first point is easy to solve. I’ve been running OLPC on VirtualBox (occasionally) for a few months now, so at least I have a vague idea of how to interact with the Sugar interface.

The second point is slightly more problematic. As far as I’m aware, the OLPC runs GTK, and so the pygtk module is available — but I have yet to come across a turtle implementation for gtk (ignoring, for the moment, the TurtleArt activity already installed on the OLPC, which I don’t think is particularly useful for my purposes).

It seems like quite a fun project — implementing the turtle module using pygtk — until you consider the arcane pygtk API, the (IMHO) lack of reasonable documentation (I’m not particularly impressed by the pygtk reference manual… particularly the lack of index), and simple examples to expand from.

Technical issues aside, a week later, I’m considering the semantics of an OLPC edition of the book. SWFK for Windows, Mac and Linux, all target the same fundamental audience. An OLPC edition has a completely different potential audience. The Western+English market is, no doubt, vanishingly small — so while, to date, I’ve had over 6500 downloads, I’m guessing an OLPC edition might garner less than 1-3% more. The real market would be translated versions (assuming the interest in translating actually results in translations) — but that begs another question: will kids in non-Western countries actually understand some of the references? Is talk of DVD players, in-car computers, Nintendos, etc (i.e. some of the references in chapter one, for example), at all meaningful in the developing world? I’m doubtful.

Which leads me to posit the question, is it worth the not-so-insignificant effort?

What do you think?

Genius or madness?

Long awaited by… well a couple of people at least… I’ve recently been working on splitting out Snake Wrangling for Kids into 3 separate editions: one for Windows, one for Mac and one for Linux.

This proved rather more challenging than expected (rather characteristic of LaTeX as a whole actually), and I haven’t fully proofed the final result yet. Those interested can check out the new editions here:

SWFK - Linux Edition
SWFK - Mac Edition
SWFK - Windows Edition

The Mercurial repository (here) containing the LaTeX source has also been updated with the latest changes.

So I’ve sort-of figured out how to do conditional blocks. The following LaTeX initially appears to work:

\newboolean{cond1}
\newboolean{cond2}

\setboolean{cond1}{false}
\setboolean{cond2}{true}

\ifthenelse{\boolean{cond1}}
{
A block of conditional text in here.
blah blah
}

\ifthenelse{\boolean{cond2}}
{
A separate block of conditional text in here.
blah blah
}

I say initially appears to work, because it works fine for the first 4 or 5 attempts, but then some combination of blocks (\begin{verbatim} for example), causes it to break on the 6 attempt. If I include a verbatim block in that 6 attempt, latex outputs an obscure error message… something along the lines of:

Runaway argument?
some code here \end {verbatim} \end {listing}
! Paragraph ended before \@xverbatim was complete.
<to be read again>

Which is rather infuriating, considering that I’ve got verbatim blocks in the previous conditional sections (it doesn’t complain about those), and because I’ve almost got the answer to my problem.

I’ve had a few requests to release the “source” to Snake Wrangling for Kids, by people interested in translating the text into another language.

SWFK is still a work in progress — although that progress has been rather slow since we moved to the UK — but I can’t see any reason why I should put off releasing the LaTex source until some sort of mythical completion date, particularly not when there are willing participants out there.

So for those who are interested in translating SWFK to another language, the latex “source” can be found in the following Mercurial repository:

http://www.briggs.net.nz/hg/swfk

Note that it isn’t “buildable” in its current state. I haven’t added the image files yet because some of them are rather large (the cover alone is over 2MB) — the wonders of the EPS format. Mercurial doesn’t seem to handle excessively large image files that well (at least not on my web host it doesn’t), so if anyone has ideas on that front, let me know.

Version 0.7

I’ve just uploaded the latest version of SWFK. This fixes a few issues with continuity (such as referring to functions before they were actually explained), adds a basic explanation about the use of brackets and order of operations (which I think was a serious omission given the context), and other minor grammatical and code fixes.

The only major change is to add a few exercises to the end of some of the chapters, plus a new appendix for the answers. This is a work in progress. Exercises are currently missing from Chapter 9, and possibly aren’t as detailed (nor fun) as they should be.

But they’re a start…

The latest version of “Snake Wrangling for Kids” has been uploaded, and is now available on the main page. This is the LaTeX conversion I mentioned in a previous post — but I’ve now applied a Python code checker to 99% of the example source code. Hence I’ve fixed up a few omissions, bugs, and so on.

Automating the testing of example code proved more challenging than expected. In the end, I failed miserably to get doctest working they way I wanted, and had to roll my own testing code which works for a majority of the examples. It’s not perfect, but picked up a few problems, so I’m reasonably happy with the end result… even if it is a complete hackjob.

I’ve finished the initial part of my conversion of SWFK from Word Processor format to LaTeX. Positive aspects? Looks much better than the original; I like working in a text-based format plus I’ll be able to automate the double-checking of my examples (not completed yet); and lastly the file size is a 3rd of what it was (hoorah for my bandwidth!). Negative aspects: the format is more obscure (not a big problem obviously) and the number of pages has significantly increased. LaTeX is a lot more liberal with whitespace than I was, plus I’ve probably accidentally increased the size of some of the images, which won’t have helped. So my apologies to anyone who wants to print it, and has to kill more trees as a consequence.

Download is available from this link, but I haven’t updated the main page yet. Note that this is a draft-draft. In other words, it already was a draft, and now it’s more of a draft… ;-) I still need to tidy up some of my layout ‘messes’, plus re-check all example code, and a few other bits and pieces. Another positive aspective of converting to LaTeX is that I found a bunch of naff typos that appeared in latter chapters (and appendices), where my editing prowess obviously rather severely tailed off…

Feedback on the new format/layout welcome.

Version 0.5

The newest version of Snake Wrangling for Kids includes some minor corrections dotted throughout the book (thanks to commentors on the SWFK page and the Edu-Sig mailing list members, once again), as well as a basic clarification as to why floating point calculations don’t always result in the number you were quite expecting (not too detailed an explanation, of course, because that would be boring… ;-) ).

The inclusion of SWFK on Pythonware’s Daily Python URL (thanks guys!), resulted in a sudden flurry of downloads, and some really useful feedback.

As usual, the download is available in zipped, PDF format.