Dark Side of the Spoon

Code, food, and stuff

Wednesday at Young Rewired State

This week I am volunteering at the Young Rewired State centre in Edinburgh.

Young Rewired State (YRS) is a national event running during a week in early August where young people from up and down the country gather in centres to sit and make something with the help of volunteer mentors from the local area.

This year the theme is open data with the participants taking data from a variety of sources to try and make something interesting from it.

A quick scan of the hashtag #YRS2012 will reveal both the number of projects people are working on, the passion of both the kids and the mentors is teaching and demonstration their skills, and the fun people are having.

We have only two kids here at the Edinburgh centre, being hosted by the University of Edinburgh’s School of Informatics in Appleton Tower and the Mentors outnumber the participants by 2:1. This has not been a problem as the expertise of the mentors is reasonably well spread.

The knowledge and enthusiasm that the teenagers brought here has been breathtaking. Within 3 hours of getting here they had already selected their project and had got down to it.

It has been called Project F, mostly started as a joke, but it kind of stuck. All to be released shortly as soon as they get it working. But they are presenting at Edinburgh Techmeetup tonight so hopefully they will have something working by then.

I am enjoying myself. I have always enjoyed teaching and teaching people who actively want to learn is a joy.

We head down to Birmingham on Friday for the Festival of Code. Centres from all over the country will gather in the Custard Factory to hear presentations, win awards, eat pizza, and generally have good time.

The Book What Started It

I want to tell you about the pleasure, the sheer unbridled joy, of cooking without a recipe.

An odd start to a recipe book, but once you get into it you understand what Nigel Slater is on about in his book, ‘Appetite’.

This was the first cookbook I really read, picking it out of the many books on my Dad’s bookshelf purely because its orange spine stood out from the rest. Before I had made things from memory and on my parents advice, my repertoire consisting of a few pasta dishes and a fruit salad.

It is Slater’s manifesto of cooking, his mission statement for the kitchen.

The first third of the book doesn’t really contain any recipes at all rather explaining his passion for cooking in drool inducing language with full page gastronomic pornographic images. It talks about what you really need in your kitchen, the little number of pans and knifes you really need, how and where to shop, what flavours really go together, and when fruit and veg are in season and at their best. He tells you that you should cook for fun, that you don’t have to cook every night, that its fine to get a takeaway every so often.

His recipes are written in the way people cook. He understands that we don’t all cook like they do on Blue Peter, with each ingredient pre-measured and put in its own little dish all lined up ready to go. It’s not 20g of basil it’s a good handful. It encourages experimentation and the recipes should be treated more as templates than anything else.

My copy is well thumbed and a couple of the pages are stuck together at the back when the flat above me water pipe burst. The recipes I use on a regular basis and flecked and stained with cooking debris. I love it.

I would recommend this book to people starting to cook or who have cooked for a while.

Ant Javadoc and GitHub

During our Systems Design Project course at Edinburgh we hit the problem of a large team coding on separate parts of a system and not having instant access to each other like we would in a development office environment.

We wanted to create a easy, automated way to share documentation about code which was being worked on in separate branches. The code was already being documented by JavaDoc and some of use were generating it adhoc to look at other peoples stuff.

I had used Github pages service before (this site is hosted there). Since our code was already hosted there this would create an easy platform to view the generated JavaDoc as a web page, independent of the branch it was on.

Ant was being used to build the code so it was a simple task to add an ant task into generate the JavaDoc and then call a script that would upload it Github pages.

Ant Task

<target name="javadocgenerate"> 
    <javadoc packagenames="uk.ac.ed.inf.sdp2012.group7.*"
        sourcepath="src" 
        destdir="../pcdoc" 
        author="true" 
        version="false"
        windowtitle="Group 7 PC code"> 
    </javadoc> 
    <exec executable="/bin/bash"> 
        <arg value="publish.sh"/> 
    </exec> 
</target>

Bash Script

#!/bin/sh
# Push javadoc files to a website hosted by github <http://pages.github.com/>.
# Before executing this script, generate the javadoc files into pcdoc
#
#David Fraser

# find out the current branch so we know where to switch back
OLD_BRANCH=`git branch --no-color | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`

git checkout gh-pages || exit $?

# Clear out the old files: (files which will be served)
rm -rf javadoc/* 

# Replace them with new files and commit them:
cp -pr pcdoc/* javadoc \
&& git add javadoc \
&& git commit -a -m "generated javadoc"

#Remove the generated doc
rm -rf pcdoc/*

git push origin gh-pages || exit $?

# Switch back to the old branch
git checkout $OLD_BRANCH || exit $?

All the user has to do is call ‘ant javadocgenerate’ and any JavaDoc they have added to the code will be generate and put online. It does take 5 or 10 minutes for the docs to appear online but Github notify you when the page is built.

Links

Github pages
Ant JavaDoc

Example from SDP