Archives for September 2010


'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 | 4 so far

Python Ireland September meetup Profiling, lambada, cloud computing

Python logo

The talks

I attended the September event of Python Ireland yesterday night, another great meetup! The first talk ended up being the long awaited "Distributed profiling with Redis", instead of 'buildout' as the speaker was sick (initially the Redis talk was planned for August, but got postponed due to sickness as well... Could the Python folks be more fragile?!). That talk made me curious to look more into profiling, and to also dig into what other gems Python core might be hiding. Sadly the only command I remember out of the talk is this:

python -m cProfile --sort=cumulative my_program.py 

but I'm sure that'll be enough to come up with some awesome things! I'll poke a bit at the examples once the speaker makes his code available. It was the sort of code that jumps at your face in a "OMG what is this all about!" kind of way but I'm sure it'll make more sense once I can actually play with it. It was built such that it could also be used as, say, a profiling middleware in Django, which sounds fairly cool.

There was then a lightning talk by Rory about "Lambada", a way to do functional programming using Python. I wish I had a code example to show what this was all about, but. At the same time, I mostly don't. It was funny though! ;)

Alan concluded the talks with "Python for Cloud Computing" which gave us a nice overview of the different cloud services available out there, and what kind of Python is available for them. Infrastructure as a Service, Platform as a Service, Software as a Service, Google AppEngine with Python (limited to certain modules, no C allowed), Google AppEngine with Java and Jython (good for XSLT), all with NoSQL databases, Amazon Web Services with EC2 and S3 and, stuff. Very buzzword-full but with explanations too! Boto looks like a very nice Python API to explore, as a front-end to communicate with AWS. 

The pub

We ended the evening in the lovely Trinity Capital Hotel again, where Vishal showed a few of us the Python app he wrote for his Android phone and some of the code, in preparation for his OSSBarCamp talk. Many people asked me how the course was going, which delighted me, people are really curious about it! I nearly feel bad that I don't have many Python-related nuggets to share, I'm mostly learning how to teach. It would all be a hell of a lot harder to do without Python, but at the same time there is no "Python is awesome!!" chant at the beginning of every session nor Python prayers at the end. It's just the language we use and have fun learning with.

I brought up with a few people my idea of teaching a Python "crash course" over an afternoon, for people with previous programming experience. I was actually kind of losing enthusiasm about it, thinking about standing up in front of a bunch of hardcore programmers ready to dish out all sorts of real-life flaming but people thought it was pretty cool and had helpful suggestions. I guess I was kind of forgetting that it would be mostly people with an interest in learning rather than common Internet trolls :) The idea would be to get everyone's environment set up, have a quick overview of the syntax (I reckon no more than 20-30 minutes) and then give people something to do to have them cut their teeth on a cool Python project. It wouldn't happen before November, but I'll need to find a few good ideas -- suggestions welcome!! It could be real fun, done well.

Leave a comment

Book review: Stones into Schools, by Greg Mortenson & Mike Bryan Promoting peace with books, not bombs, in Afghanistan and Pakistan

Stones into Schools is the follow-up story to Three cups of tea, starting in 2003 where we left Greg Mortenson looking to expand the Central Asia Institute mission to building schools in Afghanistan. As expected the story is just as engaging and fascinating as the one narrated in the first book, and beautifully advocates for education, especially girl education and promoting literacy for girls and women. It also offers a candid view of life in countries suffering from their proximity or association with the Talibans, and of people and their daily life that's otherwise difficult to grasp from only watching the news.

It's heartbreaking to read about their work and the descriptions of horrors and tragedies during the earthquake in Pakistan in 2005, when nearly every day we hear about the terrible flooding the country is now suffering from. I wonder how many schools and CAI schools are affected and if the CAI is able to help...

Despite and around all this, I found myself getting excited and worried and anxious every time the CAI "Dirty Dozen" worked their ass off to get a new school built, as each always seems to bring so much suspense and so many challenges. I think their school tally is up to 131, at the end of this book completed around August 2009.

The story gives an interesting perspective on the American military, that I certainly appreciated as someone usually suspicious of that establishment. Conversely, the narrator isn't always very kind when comparing the CAI work style with that of other NGOs working in those areas. Other NGOs tend to appear out of touch, e.g. traversing poor areas in expensive black SUVs with gigantic antennas... Perhaps the sentiment is justified.

A minor grip I have with the book would be a writing style quirk whereby every few pages a section ends with a phrasing like "but little did they know blah blah", it feels a bit like a cheap trick especially used so heavily, when it's unnecessary considering how compelling the story is on its own merit.

This really is a fantastic, inspiring and instructive story, I would recommend to anyone with either an interest in education or who generally enjoys reading to give one of these two books a try.

Leave a comment

'Intro to programming', session #3

I suspect I must have sounded particularly freaked out when people were late last week, because this time (last Monday) several people added a variant of "but I love the course!" at the end of their message letting me know they couldn't attend, haha! I once again left full of positive energy, there is a great atmosphere and everyone looks to be having a good time.

Exercises

I've been told having many exercises works well, it means people don't get bored nor have to wait around. That was my goal when I started this system so great it's working! More microblogging feedback.

I still feel people have a lot of trouble getting started though. I believe lots of code reading and writing would help, but this has to be done in one's own time. I wonder how I can help mitigate this in my 2 to 3 hours sessions though, or how I could help with understanding how to break down large problems into smaller ones.

Having a little "code reading" snippet at the beginning works nicely. It only took us 10-15 minutes and generated interesting questions and a bit of discussion, hopefully without being confusing. It's less cool for people trickling in late, but well. The code is available, and I always make myself available for questions as well.

Notes and e-learning

I put the notes up online, and have been told that it's harder to learn through them. It's sort of a conscious choice. I focus on making the face-to-face learning as effective and interesting as possible, and post up the notes as a courtesy and a summary of what we looked at. Making a good e-learning course in addition to the face-to-face teaching would take a lot of time and effort.

Promoting the course

Initially, after the first posts and emails about the course went out, I spent an incredible amount of time answering emails from people who already knew how to program but had read "learn + Python" and were interested in learning the language (side-note: there should be an afternoon Python crash course coming for you in November, people, keep an eye out!). Obviously they weren't the target for the course and would likely have been upset at the pace, so I spent a lot of time learning to tease out people's previous knowledge and kindly explaining why this wouldn't be a good fit for them. It was both time-consuming and stressful and I promised myself I wouldn't mention Python at all next time I teach the course.

However, it turns out that knowing the course would be taught using Python was a key factor for at least one student's decision to sign up. I guess when you spend time in tech communities, you start picking up on the levels of difficulty of different languages whether you program yourself or not. I won't leave Python completely out next time, and it's good promotion for the language too, but I certainly won't put it in the title :)

Format

Students, and other people I know outside who are learning Python on the side, have asked whether I would follow-up with an 'Intermediate' level sort of course. I have no plans to do so, so far. The next step from the course I'm teaching is: practice, practice, practice. Write and read a lot of code. Learn what you need to learn to solve the problems you want to tackle.

There's more thinking I want to do on the format though. It's kind of compact at the moment, 5 evenings of 2h30 sessions and I think I picked that up from the previous iteration I taught, where I had no control over the time slots and ended up with 4 sessions of 3 hours. If I were to want to make the course longer, what would I change? How differently would I teach? If I go to a school and they offer me a weekly 1-hour long time slot over ten weeks, what adaptations would my current material require? Someone asked at the Python meetup what kind of people attended the course, e.g. unemployed people perhaps looking to pick up new skills? My course would be very inappropriate for such a goal, and mostly aims to attract people curious about and interested in learning the basics of programming. Which is only one skill you'd need to become a software developer, but still, if I were to expand that course over say 10 evenings, or if I had the opportunity to teach it full-time to teenagers for a week as part of a summer camp, how would I do it?

...Hm. As I said, that's stuff I want to think about! Any thought on this, whether half-baked or fully fleshed out are very welcome.

Leave a comment | 2 so far

Identi.ca and XMPP

I've been trying out micro-blogging through Identi.ca recently. (I'm jpichon, if you're curious.) I find their integration with XMPP both awesome and handy, so here's a quick guide to setting it up and using it, if you haven't given it a try yet.

Activating it

Start by adding update@identi.ca to your buddy list. Then, log in to your Identi.ca account, go to Connect -> I.M. and enter your XMPP enabled address. They say any Jabber or GTalk account will work, I'd be surprised if it didn't work with any XMPP account.

Authorise update@identi.ca when it asks to add you, and tadam! You are set to send and receive updates, depending on the options you selected on that initial Connect -> I.M. screen.

How to use it

Don't trust the Identi.ca help page as it appears new commands have been added since it was last updated. If you open a chat with your new update@identi.ca buddy and type 'help', you'll see the following menu:

(12:34:56) update@identi.ca: [Identi.ca] Commands:
on - turn on notifications
off - turn off notifications
help - show this help
follow <nickname> - subscribe to user
groups - lists the groups you have joined
subscriptions - list the people you follow
subscribers - list the people that follow you
leave <nickname> - unsubscribe from user
d <nickname> <text> - direct message to user
get <nickname> - get last notice from user
whois <nickname> - get profile info on user
lose <nickname> - force user to stop following you
fav <nickname> - add user's last notice as a 'fave'
fav #<notice_id> - add notice with the given id as a 'fave'
repeat #<notice_id> - repeat a notice with a given id
repeat <nickname> - repeat the last notice from user
reply #<notice_id> - reply to notice with a given id
reply <nickname> - reply to the last notice from user
join <group> - join group
login - Get a link to login to the web interface
drop <group> - leave group
stats - get your stats
stop - same as 'off'
quit - same as 'off'
sub <nickname> - same as 'follow'
unsub <nickname> - same as 'leave'
last <nickname> - same as 'get'
on <nickname> - not yet implemented.
off <nickname> - not yet implemented.
nudge <nickname> - remind a user to update.
invite <phone number> - not yet implemented.
track <word> - not yet implemented.
untrack <word> - not yet implemented.
track off - not yet implemented.
untrack all - not yet implemented.
tracks - not yet implemented.
tracking - not yet implemented.

(As a side-note, if you see me saying 'help' on Identi.ca, I'm not in trouble, I probably fat-fingered the command. Ignore!)

These are all the cool commands to do basic micro-blogging tasks from the comfort of your IM client, as well as a few house-keeping tasks. I particularly like the commands using ids: Identi.ca has a feature I find very nice, the link "in context" under notices that let you follow the flow of a conversation (see an example). Replying / repeating with id lets you preserve this link.

For a bit of context (heh!), when you have your IM client open and someone you're subscribed to writes a notice, you'll see something like this:

(21:23:51) update@identi.ca: CoolKid789: Hello, world! [12345]

12345 is the notice id, so you still don't need to open a browser. Usually, both the id and the person name appear as hyperlinks, if you'd like quick access to the web view. To preserve the link, I would reply:

reply #12345 @CoolKid789 OHAI!

The actual notice posted (and associated character count) will start from @, and the 'in context' information will be preserved.

Something to watch out for: When I initially tried this, I kept getting a "Message too long" error, even when writing very short notices. It turns out that when I was copying the ids in my IM client, Pidgin, I was also copying the url for the initial notice, even if I couldn't see it. Right-click -> Reset formatting in the text area and the problem is solved. Have fun!

Leave a comment | 2 so far

Gnome Development Documentation and Tools Hackfest

This is very spooky to me, but I've signed myself up for the Gnome development documentation and tools hackfest this December.

It's spooky because I'm not a Gnome developer (except for that one Gnome-love patch... which is much past its expiry date by now, I must move on!). I met some fantastic people at GUADEC though, and I very much look forward to meeting them again and being inspired by them again. This particular hackfest aims to improve the documentation and tools for people starting out with Gnome development, so I should be the perfect target and I hope I will be able to help and contribute meaningfully.

If it doesn't work out, well, I guess I can excuse myself and go visit Berlin. I've never been to Germany. The flights and days off are booked... All that's left is accommodation, which I'll look into after a bit of research. Ideally, before December comes!

Leave a comment

TEDx Dublin 4

Last Thursday I happily attended TEDx Dublin 4.0 at the Science Gallery. I thought it was a bit too computer sciency slanted (I really enjoyed the 3rd edition, with talks on physical product design, or shark slime, and other very interesting things I would never have thought about otherwise), but still the talks were tremendously interesting and I had a lovely time hearing about...

  • ...Non-Destructive Testing as a way to build your company
  • ...a talk on tradition, translation and transmission that ended up not going any further than tradition but offered quite an interesting view of Ireland, using the word of tradition in the sense of "identity". Ireland will be 100 year old in 2021!
  • ...a energising TED talk video about classical music and Chopin, by Benjamin Zander
  • ...the mathematics of bullet time by a Trinity lecturer who worked on the Matrix, although I must say I understood "which picture looks the best" better than the actual maths :)
  • ...Josh Klein on the topic of his new book "Hacking work", an entertaining talk with advice mixed with real world anecdotes. I just started reading the book, and so far it follows the same enjoyable pattern.

It's a very nice event to attend, I wish they were organised more often. Looking forward to the next one, once again!

Leave a comment

Teaching programming, conclusions

Last Monday was the last session of my short "Introduction to programming, with Python" class. Eight adults signed up, the course lasted for 5 weeks on Monday evenings and overall the impressions are positive. I made progress in places, and learnt how to improve in others.

Expanding

I didn't write last week, though my main thought at the time was that I would really like to expand the course. Likely it's linked to teaching such a nice crowd in such a nice atmosphere! I did know 3 people before they took the course, with helped get the banter started early on. Note to self: breaks are important for reasons mentioned before, but also because they enable students to chat together and get to know each other.

I wouldn't go about making the course longer without having the material ready beforehand though. Despite having a lot of material already for the first 3 sessions, I underestimated how exhausting teaching and preparing the material would wind up being. With the rest of "Life" in general filling many other evenings, I ended up with little breathing time and thinking time. Must prepare more!

Difficulty levels

Although I had taken the time to break down the exercises further than I did the first time, and spent more time on explaining file handling and a few string manipulation functions, rot13 ended up being waaay over everyone's head again. It breaks my heart but I think I will have to give up on that exercise for now! I love the idea because it brings every concept studied so far so nicely together. However going from 3-10 lines exercises to 25+ is too much of a leap. If I want to reintroduce rot13 I need to build up a better progression up to that level.

Something I'm thinking about trying in the meantime: give exercises with code partially written, and ask students to fill in the blanks. That way we can go straight to the interesting sections without getting bogged down with stuff that is not as relevant at that particular moment.

I introduced functions during the last session... Should I teach again over 5+ sessions I would reverse the topics of 4 and 5 to have more time to explain functions and solve more related exercises.

In general it's obvious people started having more issues from session 4 (confirmed by the feedback form and chit chats) and that the flow was not as good. The difficulty seems to start from the "For loop" exercises, studied the previous week, so I'll be going over them as well before teaching the course again.

Scheduling

This was the first time I had time to introduce functions. My initial assessment, after my first scheduling successes, that I had learnt how much to fit in one session was mistaken. It turns out that when teaching a concept for the first time I still seriously underestimate how much I take for granted (say, what is meant when I say to "call" the function), and therefore how long it will take to explain (...and to make up for the information I unintentionally left out).

Although I get some of the "details" of scheduling wrong, I still think I've gotten better at both guessing what will fit in 1 hour as well as how much new content I want to go through during one session (that's important too!). Perhaps I'll outline my next course in 1 hour increments.

I'm very happy with how sessions 1 to 3 went (so are the students, according to the feedback form!) -- although I could do with more very simple exercises for the first session, only using print/variables and perhaps user input. I'm guessing it went well because those are the concepts I taught previously and I was able to improve my initial explanations based on the feedback and misunderstandings of my first teaching experience. I had also taught session 4 and file handling, but it didn't go well because of the rot13 exercise, and my attempts to introduce the concepts in more depth and to break down the exercises were insufficient once again.

Student feedback

Disclaimer: There is obviously a bias to the feedback, in that although the form was anonymous I was in the same room, and by then the students knew me a little too!

Most people are happy, and the course either matched or exceeded their expectations, which is, yay \o/

My favourite questions is "3 words to describe the course". As before, very often it contains a mix of "challenging", "hard" together with "interesting" or "enjoyable". My goal exactly :o)

The leap in difficulty between the first 3 sessions and 4 & 5 came back several times (well, I did hand the feedback form after students had spent 1h making excruciatingly slow progress on rot13).

Surprisingly, there was a vote in favour of mandatory homework, to help keep the momentum in between sessions. I think I will try some version of that next time I teach to adults. Often the exercises for the next sessions were available beforehand, but that wasn't quite sufficient for people to find the time to look at them. I'm not sure if I would do it when teaching to high school teens again though, when I would be competing against all sorts of other boring and/or important homework assignments.

Someone mentioned wishing it was clearer how that stuff was used in other programs. That's something I'll think about so that it is, next time.

Several people mentioned wishing the course was longer or that they would sign up for a "level 2" follow-up to the course. Should I want to do this, I don't think it would happen in time for this particular instance. I have too much to do in the next couple of months, and waiting any longer we probably would have to start looking at the very basics again. That's unfortunate, though I'll keep thinking about it and possible alternatives.

I want to expand the course next time so we can look at a couple more concepts and spend more time on others, but I'm not convinced in general by the idea of teaching more courses levels... When does it stop? At some point one has to find a problem they want to solve for themselves and start programming on their own. Perhaps the course is a bit too self-contained at the moment. I should try to open up more possibilities, rather than solving in class every problem we encounter (well... or do it more gracefully to avoid the nasty feelings left from rot13!) Someone suggested giving links to websites with Python/programming exercises, which sounds like a great next step for people to explore.

Material

A succinct version of what we did is available here.

Leave a comment | 4 so far

Archives