'Intro to programming' class

Last Monday was session #2 for the Introduction to programming class (with Python!) that I'm teaching in Tog.

The class was starting at 7pm and I freaked out a little when by 7.15 only 2 people from the week before had showed up, plus one brand new student (was I that bad?!) Thankfully people trickled down and although 3 people sent an excuse we had a nice group going by 7.30.

Exercises

I guess here, the fact that I like to start with exercises helped so that even people showing up a bit late wouldn't miss anything important and could simply start on the exercises as they came in. I like to give a few exercises about the concepts previously learnt, the idea being that everyone must solve at least one before we move on to a new concept, and people who finish early can do more of them instead of waiting. I realise it's kind of counter-intuitive to the usual way of teaching with exercises coming at the end instead, but I find it works well (with sessions lasting more than 1 hour in any case). It helps reinforce previously learnt concepts and for the students to refresh their minds. I don't really expect people to find the time to try exercises and practice coding in their own time (yet!) and it certainly didn't work with my high school students. Perhaps next week I will be proven wrong as people were asking for practice exercises as the class ended :)

Pace

We actually only had time to learn one new concept this time, the first loop. It was the same when I taught the teenagers before, and I thought it was because there had been 3 weeks between the first and second session, but we ended up doing roughly as much here. Perhaps my exercises take too long to do, or perhaps I take a while to go through, er, the "while" loop. I'm not too worried about it to be honest. This is the first exposure to many programming concepts, and the exercises using "if" and the rest are the first programs bigger than 3 lines (10 to 25 usually) that the students are writing. Of course it takes time.

A session lasts 2h30 this time. Unlike the kids the adults were not very good at reminding me to take breaks ;) I think after doing the initial exercises we were all eager to move on to learning something new, and then I kinda forgot to take a break. I was wrecked and nearly dizzy by 9.15, I suspect the students kinda felt the same. Must take a break around 8.20 next week. For both my sake and the students'! Perhaps after the exercises and after having a short overview/first taste of a new concept...

Preparing

For preparation, once again I mostly cannibalised and expanded on what I taught the first time :) I also changed the odd exercise, and removed a few references to high school. A new exercise was writing a fake GUI with a couple of options and it ended up being a killer and great fun! (Although the backslashes caused a couple of unfortunate escaping issues, I guess I'll make the character wave the other way around next time, at least!)

 ______________________________________
|                                     |
|         HELLO!                      |
|       /                             |
|    \O         Choose an             |
|     |\             option           |
|    / \                              |
|                                     |
|              a. Say hi              |
|              b. Say goodbye         |
|              c. Fortune cookie      |
|_____________________________________|

I remember last time, I thought I introduced 'random' too late considering how excited the students were after we transformed their program into a real game. Note to self: I think I may have introduced it too early this time! Probably after we add "hints" (too low/too high) to the game would be the best place to bring it up.

The students

Once again people are a lot more active. They ask questions, they describe their understanding until the point they're stuck and then ask for clarifications. If I'm not being clear at explaining something, they let me know. I really enjoy this. They also spontaneously explain things to each other and form groups, then explain to each other, ask and answer questions among themselves, copy and try to modify to understand ;) All of this is also great for me, I listen and learn new, different ways of explaining what I just taught.

Overall, the students look like they're having a lot of fun, and are happy to be learning new things and new ways of thinking! This is great, I was very happy to see that and at how well it went.

Stuff I want to watch out for

Like last time I taught this course, I notice people have a lot of trouble translating a problem into programming steps, even if they know all the programming pieces to solve it (e.g. add a limit to the number of guesses in a "Guess the number" game). It's normal since people are really just starting out, but I really want to do whatever I can to help address this as early as possible.

My plan will be to try to include some code reading, perhaps at the beginning of a session, hopefully starting next week. It has to be a clever and readable way of solving a problem, that won't take us too much time to go through but will ideally show a new way of using a concept we know or using it to solve a new kind of problem. For the simpler stuff I will likely have to write those snippets myself, I hope I can come up with something good involving while for Monday (I have family over this week-end as well, though).

Looking forward to next Monday!

Leave a comment

A couple of science-fiction book recs

For the past few years I read very few, if any, fiction at all. Techie books, check, biographies and other real-life-documentary-like books, sure, but for some reason I couldn't stick to fiction storylines anymore.

Then a couple months ago I rehashed an old pet peeve of mine to a friend, about how most science-fiction books try so hard to focus on an idea that they don't care about making interesting, believable characters and sometimes don't ever bother that much with plot either. It's all about "the idea" and it makes for a dull read, that has been keeping me mostly away from SF literature.

In response I was lent "Flowers for Algernon" by Daniel Keyes, and wow, what that interesting and moving and with absolutely non-bland characters! I really enjoyed it, and finished it in a few days once I actually took the time to sit down and start it. It was a very good read. The summary on the back cover kinda gives away a lot, but it doesn't take at all from the story, because the point is following the main character's evolution and changes and personality and struggles. I hear there's a movie too, I'd like to watch it at some point.

Then a couple of weeks back, I was walking in Waterstones and saw a book with this awesome cover (and a title that can only attract a software developer, "The Turing Test"!) Who cares about not judging a book by its cover, it inspired me. It's actually a collection of short stories by Chris Beckett, who I hadn't heard of before (the introduction by Alistair Reynolds is interesting in a meta sort of way), and the stories are just fantastic. They use SF as a way of exploring inherently human concepts like identity, life, art, soul, with characters that are profoundly humans (except when they're not... or are they, really?) and endearing. The stories suck you right in. Many of the worlds keep vividly haunting my mind long after I moved on to the next story. Some of the stories overlap, either set in the same world at different times or having you meet similar characters or concepts again. It's awesome. I loved it. I'd say I loved them all but I actually had a bit of trouble understanding the first story which gives its name to the book... Do not let this stop you!! Keep reading!

After this, the next time I saw another book by the same author, Holy Machine, I acquired it and happily realised it was set in the same world than one of the stories I really-really enjoyed in the Turing Test, likely set a bit later in the world's history. It was a delightful read and I finished it in a couple of days. Recommended too! I'll definitely keep looking out for the author's other books. :)

Thanks for hooking me again on reading fiction, Barry!

Leave a comment | 2 so far

Teaching, edition #2

Last Monday I started teaching my introduction to programming course, edition #2 to a small group of adults this time. Here are a few thoughts from the evening.

Installing Python and an IDE

First of all, as expected getting Python to work on multiple platforms as well as more or less getting everyone to use the same editor was a misery. I settled on having Geany or IDLE in the end. We kinda gave up on Windows, though I got some additional info from a friend since then that should be helpful if necessary. Despite that experience, I would expect just as much pain next time. Note to self: bring several usb sticks with all the binaries to pass around, one isn't enough. I wish Geany would work out of the box with Python on any platform, that would be so awesome and convenient. It really is a great IDE!

I was briefly pondering whether it'd make sense to simply make everyone use Ubuntu (e.g. as a LiveCD, with a usb stick to save), but Jannette made a good point that people would likely never look at it again after the course.

Pace

I suspect one, perhaps two people are a bit frustrated by the pace but I think it works for most otherwise. I'm not interested in rushing through concepts in any case, but next time I may have to work even harder at explaining that this course is an introduction to programming, not to Python.

It would appear I've somewhat learnt to size my lessons better. To be verified at the next session though, I had no control over how long the installation phase lasted.

Preparations

For the material, I reused and expanded on my lessons from last time. As before, I had the same issue with the lack of exercises for simple concepts, although I still believe they matter a lot. If people miss anything at this point they will struggle to the end. I must find and create more of those. (Ideas welcome! Mostly exercises to do with text display/variables/user input, and nothing more.)

Interacting with the students

I didn't like when someone popped in and was a bit disruptive, making disparaging comments about Python and comparing concepts with other languages. I don't think it's helpful to do that when someone is learning them for the first time, you need to give a chance to let concepts sink in before explaining variations. I was very bummed out by the whole episode and also by my reaction, all in all it was a very light hearted interruption and if I want to become a better teacher and go back to teaching teenagers, I really need to stay cool and not get flustered. Cutting myself some slack this time, I'm still an apprentice and this is the first time teaching in the big outside world, but definitely something to keep an eye on and improve upon...

Overall adult students are a lot more active than when I taught younger people! They ask a lot of questions, which makes me very happy :) It does make sense, the whole "I have lots of adult responsibilities therefore very little time, if I show up, sacrificing the time I could be using to do other things, and also pay money for something I will make the most of it!" Or well, that is my theory behind this variation so far.

I hope the students will feel free to share more of what what works and doesn't as the courses goes on. I definitely plan on asking for overall course feedback at the end, and hope people will share their thoughts to give me a chance to improve :)

I got some helpful feedback already:

  • I was told I went too fast on explaining int(), what it is, the conversion and why it's needed. The truth is once again I ended up giving an exercise that required using int() to convert user input and forgot to spend time explaining it properly beforehand. Grumbles!
  • So far, Mike is happy \o/
Leave a comment | 5 so far

Django admin actions and intermediate pages Tagging multiple articles at once

The other day I created an "Ireland" tag on this blog and thought, hey, wouldn't it be cool to go back and tag all the posts I wrote about events in Ireland, so I have an easy way to see what's going on locally?

Of course retagging each post manually would suck so I decided to create a new Django admin action, with an intermediate page that would present me with my current list of tags so I could select one, then update.

I also wanted:

  1. To keep the Django admin look and feel
  2. To have the nice admin message "X posts were successfully updated"

Now the Django documentation is very clear at explaining and showing how to do each of those, but not together.

Here's how I ended up doing it, see links at the end for other helpful resources. I'm quite pleased with this solution because it's done the Django way (through the use of forms, etc) rather than by working around Django.

Directly in the ModelAdmin section for blog posts, create an inner class for the new form (tag picker in my case), and a function to process the form like you would in a normal view. Don't forget to add the new method to the actions list.

    actions = ['add_tag']

    class AddTagForm(forms.Form):
        _selected_action = forms.CharField(widget=forms.MultipleHiddenInput)
        tag = forms.ModelChoiceField(Tag.objects)

    def add_tag(self, request, queryset):
        form = None

        if 'apply' in request.POST:
            form = self.AddTagForm(request.POST)

            if form.is_valid():
                tag = form.cleaned_data['tag']

                count = 0
                for article in queryset:
                    article.tags.add(tag)
                    count += 1

                plural = ''
                if count != 1:
                    plural = 's'

                self.message_user(request, "Successfully added tag %s to %d article%s." % (tag, count, plural))
                return HttpResponseRedirect(request.get_full_path())

        if not form:
            form = self.AddTagForm(initial={'_selected_action': request.POST.getlist(admin.ACTION_CHECKBOX_NAME)})

        return render_to_response('admin/add_tag.html', {'articles': queryset,
                                                         'tag_form': form,
                                                        })
    add_tag.short_description = "Add tag to articles"

And here's my intermediate page (quite simple!), which uses the admin look & feel and is located in templates/admin/add_tag.html.

{% extends "admin/base_site.html" %}

{% block content %}

<p>Select tag to apply:</p>

<form action="" method="post">

    {{ tag_form }}

    <p>The tag will be applied to:</p>

    <ul>{{ articles|unordered_list }}</ul>

    <input type="hidden" name="action" value="add_tag" />
    <input type="submit" name="apply" value="Apply tag" />
</form>

{% endblock %}

The hidden field is essential for Django to recognise the form submission as an admin action.

Resources:

Leave a comment

Mozilla Drumbeat Festival Learning, Freedom and the Web

This sounds so, so cool: Mozilla Drumbeat Festival. "Join us in Barcelona for three days of making, teaching, hacking, inventing and shaping the future of education and the web."

Three days in the middle of the week, in another country, it's unlikely I'll be able to go, but damn... I'll certainly follow closely.

Leave a comment

OSS Bar Camp // September 2010

The new shiny OSS Bar Camp website is up! University College Dublin, week-end of the 25th and 26th of September. Many awesome people already signed up. Register now!

Leave a comment

Oh, sweet! The Sugar learning environment

I did my talk in TOG tonight. I think it went quite well! I certainly got some positive feedback afterwards. Lots of room for improvements still, of course, many "um"s especially at the beginning, and it probably would have been better if I had rehearsed more, to remove the attachment to my notes for prompts when I got stuck, but otherwise it flowed well and people seemed clear and happy on what Sugar was, what it looks like and the type of learning it tries to encourage. Very nice audience, smallish and I knew most people! Many interesting questions, and having 4 laptops running Sugar (2 XOs with 0.82, 2 Eee with Mirabelle) for people to try out afterwards was a hit, I was delighted to see people rushing toward them and trying out all sorts of activities. (Delightful, noisy Tam Tam!)

The "Presentation Zen" style of presenting worked well too, I think, and I got a few questions about this and the pictures I used. I still need to practice more and become a stronger speaker to support this style better, though. (Motivated!)

Here are the presentation slides, for the curious. In true "Presentation Zen" style they are much less useful without me chatting in front of them, but you'll find most of the information I used for content on http://sugarlabs.org and http://wiki.sugarlabs.org ! :)

Leave a comment | 2 so far

Book review: Presentation Zen, by Garr Reynolds

As part of my quest of becoming better at public speaking, I recently finished reading Presentation Zen. The first striking thing about the book is how beautifully designed it is all along (probably another one that wouldn't work well on an e-reader), which of course highlights the principles the book aims to impart.

The structure flows well, and every chapter contains lots of tips and clear steps to look at when preparing a presentation. Often a chapter will offer some background on why something work, or why you should try to get away from the traditional (and boring) way of doing presentations. Also why it might be difficult to do so, depending on the culture you live in.

The book is nowhere only about slides, but in the chapters about designing and preparing them I really enjoyed that there were so many examples, including "before" (traditional) and "after" (following the presentation zen principles). Mostly what the book really describes is a general attitude one should develop with regard to presenting, preparing for a presentation and respecting your audience.

It's an absolutely fantastic read if you want to get better at presenting and generally get away from being boring and hampered by bullet points, but you don't know where to start.

I'm trying these new principles now for my Sugar talk. I think it definitely improved my preparation, by helping me think more about flow and using slides to support what I say rather than as a crutch. When it comes to being able to deliver the talk though, it'll be another story. We'll see!

Leave a comment

Python Ireland August meetup Community building & education

Python logo

The talks

I happily went along to the August meetup of Python Ireland last Wednesday, where as I expected the community talk was very interesting. Kevin showed us the results of the surveys he sent out after PyCon Ireland (survey says: 100% satisfaction!), and a second one to understand the Irish Python community better -- mostly, "who we are" since we don't really know! Some people show up at meetups, or events, many many more are on the mailing list. Vicky posted up her notes of the talk for an idea of what the survey touched on. I was interested in the results although they are to be taken with a grain of salt: not everyone filled out the survey, and perhaps some questions could have been phrased differently as I found myself realising a couple of times that I completely misunderstood the question as Kevin was explaining "we asked about blah blah blah". Oops! I'm sure the data is mostly valid still :o)

An important section of the survey and thus of the talk was about what we we could -- and wanted to -- do as a community to raise Python's profile and reach in Ireland. The survey had many cool ideas, asking non-anonymously what people would be willing to *actually* help out with. Likely subgroups of 5 people or so will be formed to follow up on some of these ideas, with people with not as much time welcome to chime in if they're interested.

The Redis presentation got cancelled, but Brian gave us a quick tour of the highlights of EuroPycon. I've never been, but from what I understand despite being quite good it was not as good as the previous years.

Pub topics

We headed out to the pub afterwards, where we promptly tried the concept of "topics" that Kevin had brought up in his talk. Basically you divide people/tables by topics and interested people can gather around and discuss and/or make progress on something. I'm not sure whether that kind of structure can really work in a pub context, it tends to be more ad-hoc. You start something along and then you call people over you know would be interested. It was a bit difficult to get started but based on the interesting conversations that ensued I'd be willing and curious to try it again.

If someone dangles a piece of paper with "Education" written on it there's no way I can *not* pay attention so I broke from my current conversation to sit at the table.

Education: Second level

We basically divided the group of people we could reach out to ("educate" I guess) into 4 groups: secondary level, third level, professionals and hobbyists, kinda merging the 2 latter as the discussion progressed. For some reason I just don't care about reaching out to professionals, or about certifications. Those topics are plain uninteresting to me. Ah well. Teaching high school students and somehow getting through to college students is a lot more interesting, and we agreed transition year students were really the best target for the secondary level cause. I want to look into this again once I'm done with my adult course.

There were suggestions of training secondary level teachers so they can teach how to program, which struck me first as a bit unfair. If there are interested teachers though, that's very very cool and I'm more than willing to help out! But I wonder how realistic that would be. The few teachers I met seemed either overwhelmed or stoically accepting of how much more knowledgeable and comfortable their students are with computers. On the other hand I was never asked any particularly complex questions by my teenage students during my short course, so it might very well be worthwhile to focus on teaching the basics of programming to teachers instead. They would certainly have a better reach.

Education: Third level

Third level outreach would be about giving more perspective and teach an additional language to students, who tend to be only exposed to Java through college years. That's the strange relationship between employers and Universities, employers want graduates they can put to work instantly, Universities would like to teach computer science, and students would like to learn something that will get them a job. So I understand why students might limit themselves to Java initially, but still if we present Python correctly, as an alternative it would be very worthwhile. There was the idea of helping students through their homework, using Python to solve the problems. I wonder if it would attract the right kind of students but it sounds worth a try. Outside of the meetup I had also talked about this with Cheryl who suggested I might try to teach an introduction to programming (using Python) to college students before their course begins. Particularly targeting women to help even the playing field a little (see this link about meritocracy & third level computing courses) though of course open to everyone.

Alan and Kevin should be posting their notes from the evening and the various "what we can do" for each target group. What I'm transcribing here is a mix of the actual conversation and my bubbling thoughts :)

I left as the group kind of disbanded to crash the "website / online presence" table topic, as this came up many times while we were talking: we should highlight what companies are using Python, and link to resources for people looking to get started with the language. From the response to my course, people in Ireland definitely have an interest in learning!

Leave a comment

Hackerspaces Week

There hasn't been much public info about it yet, but inspired by Cheryl's Hackerspace Week teaser I'm going to start speaking about it too! The first Irish Hackerspaces week will happen soon in August, from the 14th to 22nd, and I'll be talking about Sugar.

My talk will last about 30 minutes, in the evening of the 17th in Tog.

Come and learn about Sugar, the learning platform for children. Sugar offers an innovative desktop environment designed to encourage collaboration and critical thinking through Activities. Initially developed as part of the One Laptop Per Child project, Sugar is now community led and can run on any machine thanks to Sugar on a Stick.

There will be plenty of other interesting talks, workshops, demos and more... that I will happily link to once more information starts surfacing!

EDIT: It's alive! Full schedule of the week now available.

Leave a comment | 2 so far

<~ Older posts


Archives