Python meet-up, November 2012: DevOps 101 DevOps 101

Shame on me for not blogging about PyCon Ireland this year, another success where I happily spent a big chunk of time greeting attendees at the registration desk and attended some interesting talks.

The stylish volunteers:

PyCon Ireland 2012 Volunteers

In the meantime, I took better notes at the November Python Ireland meet-up, where Ulrich took us through DevOps 101, going from the basics of what it is and all sort of related tools to help, mostly Python-based.

I thought interesting that Ulrich worked from a specific definition of DevOps that differs from the ones I heard. There was a time when I used to call myself "a devop" because in addition to development work I was also maintaining production and test servers and handling deployments, etc. However at the time I learnt from other sources that "a devop" was actually a system admin who also writes code to make their job easier... so I just stopped using the word ;) Ulrich based his talk on the premise  of development and operations working together.

Development tends to move fast while operations are more stable and conservative, why would you put these groups together?

The need to scale is an important one. You need the knowledge that the developers have of the application itself, but you also need to understand infrastructure. For instance if you deploy something and suddenly the number of requests spikes, you want devs and ops to be close together to solve the problem.

Following a "release early, release often" principle where you might deploy several times a day makes that collaboration important.

Environments are complicated and it's important for people to integrate ; if the departments remain separate people tend to stick only with the same group of people.

Devops enable better communication and understanding. Developers can move fast and deploy faster as they know what ops need. This also helps mitigate risk thanks to the regular deployments: fewer changes are deployed at once (helpful to determine what breaks) and it becomes easier to do.

The talk then moved on to tools, including advice on how to create a simple django app to keep track of which versions of software are deployed where -- very simple and yet usually enough.

Some of the projects that were mentioned:

  • Using Sword instead of puppet (...which is still best, apparently) if you want to stick to Python, though it's a very young project. Using such tools you can start versioning your configuration and environment, and store reasons for changes in commit messages.
  • Fabric for ssh the Python way :)
  • Virtualenv to isolate Python and manage dependencies
  • Buildout is like Maven for Python projects. It's used to maintain dependencies and deploy, though it can be overkill for many projects...
  • Augeas is not Python specific and supports many configuration formats

Ulrich then went through some of Martin Fowler's principles for refactoring among other things, and also talked about Jenkins, not Python but known as the "Wordpress of Continuous Integration" because it has so many plugins. Sonar can be used for code quality.


We tried something different for the second part of the evening and watched a video of a Pyramid talk. I don't think it quite worked, even at 30 minutes it felt too long. Perhaps we should try again with a video more likely to appeal to a wider range of people, or simply shorter talks. Fair play to Diarmuid for standing up and taking the heat of answering questions afterwards ;)

Leave a comment

wvdial: stackmaster assertion failure & EuroPython

At EuroPython, I happily took advantage of the prepaid SIM card that you could order together with your ticket. However tethering with Wind (Italy) was not to work that simply. On Debian Wheezy I ended up with the following error:

[...]
--> Modem initialized.
wvdial: utils/wvtask.cc:409: static void WvTaskMan::_stackmaster(): Assertion `magic_number == -0x123678' failed.

A bit of astute googling reveals that libwvstreams needs to be downgraded.

$ aptitude versions libwvstreams4.6-base # or apt-cache policy libwvstreams4.6-base
Package libwvstreams4.6-base:                        
p A 4.6.1-1                                       stable                    500 
i A 4.6.1-4                                       testing,unstable          500 
$ sudo aptitude install libwvstreams4.6-base=4.6.1-1

Tadam! wvdial now works. The same configuration as last year seems to do the trick (though on Fedora 16, the Network Manager's Mobile Broadband tool was easy to set up with Wind without  bothering with wvdial.)

[Dialer wind]
Modem Type = USB Modem
Modem = /dev/ttyACM0
Username = "wind"
Password = "wind"
Init6= AT+CGDCONT=1,"IP","internet.wind"
Leave a comment

EuroPython 2012 Let's go

I'm very happy to be going to EuroPython again this year :) Once more the talks I'm most looking forward to are mainly related to scalability, perhaps with a dash of internationalisation/encoding on the side. The tutorial on Django testing with Selenium should be interesting too.

Say hi if you see me! :)

Python Logo

Leave a comment | 2 so far

Python meetup, June 2012: Message brokers & Python ActiveMQ

Last Wednesday was June's monthly Python Ireland meet-up, this time with a talk by Fernando Ciciliati about message brokers and Python.

After a general  introduction on the advantages and concepts behind messaging, the main part of the talk was about ActiveMQ, a message broker under the Apache umbrella. Fernando explained that this was a broker mostly used by Java people and required a bit of work on their part to get it to play nicely with Python. They had to make significant changes and improvements to the existing libraries.

ActiveMQ is written in Java and designed for high-performance as opposed to reliability, and the default configuration reflects this. If you want your messages to persist after reboot and never be dropped, you will have to tweak the default setup.

The community is very active... which also means lots of bugs! Fernando recommends reading the tracker, as there will certainly be a couple of bugs that are relevant to your situation.

Thanks to the provided binaries, ActiveMQ is easy to install. You get a nice web interface to manage and monitor your queues and messages.

By default, STOMP is not installed and ActiveMQ is only configured to talk to Java via OpenWire. Enabling STOMP support is simply a matter of adding one line to an XML configuration file, and is the easiest way to communicate with Python.

There are several Python libraries available: stomp.py, stompy, Twisted also supports it... They selected stomp.py.

To test your ActiveMQ setup, you can simply telnet into the port and send messages, while using the web interface to see what's happening. The protocol is similar to SMTP.

The terminology used by ActiveMQ differs a bit from other message brokers, be careful when comparing them. (I wonder if this is due to using STOMP vs. using AMQP?). For instance, "topics" seem to be a way to broadcast in ActiveMQ, rather than a way to filter interesting messages.

As usual, the technical talks continued in the pub afterwards :)

Leave a comment

Adventures in Japan

In the middle of May, I went away for a couple of weeks in lovely Fukuoka, Japan with the goal of expanding my knowledge of Japanese.

Every weekday, I went to a language school, GenkiJACS. On the first day, my level was accurately evaluated through a written test and interview, and on the same afternoon I was put into a small class (5 people, myself included) with students at a similar level from all over the world. The lessons were held entirely in Japanese, with students' chitchat also happening in Japanese -- a lovely atmosphere :)

Support from the staff, both by email during the preceding months and during my stay, was top notch. The school also offers all sorts of native language materials for students to borrow, though considering the building was right above Mandarake, a manga/video games/DVD/etc shop, I must say I mostly bought my own... :)

I stayed with a host family for the whole time, which was wonderful in terms of language practice, making friends and experiencing varied aspects of Japanese daily life. The perceived lack of independence made me a bit twitchy at times though.

The concepts and vocabulary I learnt in and out of class have stuck well so far -- the class format is very good, with lots of reviewing after a new concept is introduced. In the end though, 2 weeks isn't enough time to acquire that much new knowledge and I mostly treat the experience as a very thorough level check. There are lots of conversations I had I didn't realise were within my grasp. Because Japanese people are often reluctant or unable to speak English (but always so nice and helpful!), I had plenty of opportunities to practice in varied contexts and I'm now a lot less shy about speaking in Japanese.

With only 2 weeks, unfortunately there was little time for tourism, though what I saw of Fukuoka City (Canal City, Kushida shrine and many other temples, Oohori Park, my local yakitori izakaya and kappazushi...) and the Fukuoka Prefecture (Dazaifu, Abura yama...) was delightful.

Definitely a wonderful experience. Study-wise, it was good for building confidence and boosting motivation. It was also good for cheaply acquiring plenty of contents in the language for practice... and making new friends! :)

Wooden staircase in the forest

Leave a comment

CESI 2012 "TEACHnology: Merging teaching and technology in schools"

Last Saturday I attended CESI 2012, a conference organised by the Computers in Education Society of Ireland. It's a conference aimed at teachers and this was the first time I attended. Even though as an IT professional I wasn't really the target audience, I really enjoyed the talks and left the day with my head full of ideas and really happy with the interesting conversations I had.

Random highlights and talk summaries from the day...

Opening talks

As part of the opening talks, Gerard McHugh told us that the lack of engaging content explains failing western schools. Even though many things in life have become more engaging over the decades, school hasn't: we need it to be more interactive, more collaborative and encourage participatory active learning.

For the keynote, Stephen Howell animately encouraged school teachers to do the PR for third-level courses :-) and help students find that spark to discover if they would enjoy a career in IT. The "3 Ds" should be taught in school: Design, Develop and Debug -- not all of them require computers or knowing how to code. Using software such as Scratch, students can be moved to a producer role as opposed to what they do with most wonderful modern devices such as the iPad or xBox, that are slanted toward consuming content. The goal is to get them to make their own games. The Scratch + Kinect demo was quite impressive :)

A brief history of the near future

John Hefferman looked at what technologies are currently being created, citing an interesting quote: "The future is already there, it's just not evenly distributed." If we look at what R&D departments are working on right now, there will be less of a surprise when it arrives into the classroom in 10 or 20 years. "The Horizon Report" relates technological innovations that are coming up. John ended the talk by telling us examples of how all this will affect history teaching and the classroom in general.

One of the questions was about how to bring some of the tools to the classroom, when there are school and curriculum constraints. The answer was that it's better to ask for forgiveness that permission, and start under the radar initially.

Game-based learning in Irish education

Patrick Felicia is doing research on the impact of games in education. His surveys indicate that most teachers agree games are a good learning tool, that improves plenty of skills (with a bit of hesitation regarding social skills, which is likely due to people having different types of game in mind). However despite agreeing on the benefits, only a tiny percentage have actually used any in their classroom. Most of the talk took the form of a conversation with the audience, aiming to figure out why this is and people's thoughts about it.

The main problems and constraints strongly relate to the curriculum and time constraints. There is not a lot of content tailored for the Irish market. Teachers suggested a portal of suitable games, and bringing workshops on how to use them to the schools to make sure people attend and learn about it.

Someone suggested, inspired by Stephen Howell's keynote, to have children develop the content :-) This way they get to use their creativity, meaningful content is created and they are taking responsibility for it. Teach to create!

The iGBL is an Irish conference on game-based learning.

The LiveScribe pen in action

Adrienne Webb explained to us what the LiveScribe pen is, how it can be used and how she uses it to provide additional resources to her students. The pen is a very interesting piece of technology that records what you're writing and your voice, which you can then upload or send as a video. There are cool additional little features, such as clicking an element of the video to listen to the playback of what was said when that particular element was drawn.

She used it to provide sample exam answers, so the students can focus on what they want and ask questions only on what they are having difficulty with. This worked better and more efficiently that trying to cover every question for everyone over 40 minutes. The students - in an exam year - really took to it.

Social networking with our students

Catherine Cronin related her very interesting experience on using social media such as Twitter and Google Plus to interact with students for a third-level module, touching on themes such as digital identity, privacy and authenticity.

Currently there is a tension between the current model of delivering education, standardised, static and stale versus a student-centred model. Meaningful learning occurs with knowledge construction, not knowledge reproduction.

There are 5 stages to go through:

  • Awareness (of what is going on)
  • Commitment (which requires time and learning)
  • Access (to the appropriate technology)
  • Authority (to change things, which is easier at the 3rd level since you can do what you want for the modules you teach)
  • Design

This is about challenging students while still honouring who they are and how they work.

The Google Plus experiment was leaky (in that G+ makes it easy to re-share stuff that was submitted privately to a circle), though this accidentally made the conversation more authentic by allowing the author of a book they were studying, Jeff Jarvis, to join in.

There is of course a dilemma between being graded and having an authentic discussion. From the student's point of view, there was a wide spectrum of opinions with regard to the usefulness of social networks, thoughts on privacy and comfort expressing opinions in public.

Student comments covered a wide range in terms of appreciation of the experiment. The general opinion seems to be that it was useful, but/and messy!

The talk Q&A reflected on the dangers of having students participate in that kind of public discussions, at a stage where they're likely still trying on different identities to find themselves. This is going to happen anyway, so it might as well be within the context of a class with someone to offer guidance.

Moodle in the classroom

Declan Donnelly gave a nice introduction to Moodle by explaining to us how his primary school uses it -- all of which is also applicable to the secondary level.

The presentation mainly focused on the possibilities offered by interactive exercises, notably by linking with SCORM compatible software like Hot Potatoes, which is better than the basic Moodle quizzes.

Thanks to Moodle it's easier to share resources and do grading and assessment. It acts as a digital link between home and school, both to do the work (including drafts) and show off accomplishments to the family.

This link also applies to staff, as the school they use Moodle to publish policies and meeting notes, in a section only accessible by the staff.

Enhanced Learning Futures

After a full day of listening to tremendously interesting talks coming straight from the classroom trenches, I felt the "capstone address" resonated a bit hollow -- it was an excellent presentation but it nearly felt too polished!

Still Steve Wheeler brought up plenty of good ideas and food for thought, regarding the direction society, technology and education are going toward. Tools shape our behaviour, the more we use them.

Some examples of societal shifts: Amazon now sells more Kindle books than paper books. 1.5 billion mobile phones have been sold. Girls are catching up in terms of gaming trends. The gamification of learning can lead to deeper learning because we want to repeat the experience.

Learners need to acquire "digital wisdom". Lovely new term: darwikinism! The survival of the fittest content.


Looking forward to next year's event :-)

Leave a comment

Teaching Webcraft / Audience Who are your learners?

The second task for the Teaching webcraft course is about making up profiles for people we're hoping to help. The couple of biographies that follow do not cover it all, but should still be a fair sample :-)

* * *

Jessie is a high school student, and although she thinks about it often, what she wants to do after her final year still very much depends on what catches her interest the most any given week. She navigates the web effortlessly, and hangs out online in all the social networks her friends are into. She never really considered programming as something she could learn, but when presented with the opportunity to join an intro course she thinks maybe there she'll learn enough code to be able to personalise her blog, and make it look unique and more interactive.

This course will teach Jessie how to create her first program, and that programming is more similar to puzzle solving than inputting number in Excel to do sums like in the ICT class. Perhaps something worth exploring further...

*

Jon is working hard at his PhD thesis in social sciences. He has a lot of statistics to parse and go through every day, results of experiments to reproduce before building on them and so on. He has a dozen of Excel spreadsheets set up with insane macros that save him a lot of time, but still wastes many hours manually inputting data taken from websites or articles. He's hoping learning to program will enable him to spend less time on drudge work and more time exploring the interesting questions.

This course will teach Jon how to automate more of his experimental work, and in the process make him realise there are other areas where some scripting would make writing his dissertation more efficient.

*

Paula doesn't consider herself a power user, but she knows the keyboard shortcuts for every application she uses, is familiar with the file system layout of her computer (and learnt what a file system is) thanks to a couple of misadventures clicking on interesting looking icons, and is known to her friends and colleagues as the go-to person whenever a computer misbehaves. Though she doesn't plan on making a career out of it, she is curious to gain an understanding of what's under the hood of all these applications she uses.

This course will teach Paula the fundamental steps and "bricks" that every program is made of, and help her understand why bugs happen and what makes them difficult to eradicate. Maybe putting together a short script to randomly assign secret Santas for the next Christ Kindle wouldn't be too hard, though...

Leave a comment

Teaching Webcraft / Compare your practices to IES report's recommendations

I'm taking an online course at the P2P University, on "How to teach webcraft and programming to free-range students" taught by Greg Wilson.

Looking at the initial comments on the course it's possible I misunderstood what "free-range students" means ; from the course description I took it to mean teaching in various non-traditional settings, but it might actually be specifically about online learning (?). It's fine, the general concepts of "what is good teaching", "how people learn" and how to encourage independent learning will be helpful anyway. :)

First task

Our first task is to take a look at the IES (Institution of Educational Sciences) report on "Organizing Instruction and Study to Improve Student Learning" (summarised in Greg's post here) and compare their recommendations to our own approach to teaching programming.

For the record, I teach sporadically in my own time, to small groups of 6 to 10 complete beginners, usually-but-not-always adults, in the local hackerspace.

Recommendation 1: Space learning over time.

Arrange to review key elements of course content after a delay of several weeks to several months after initial presentation.

In a 5 or 6 weeks-long course, this can be difficult. However, most concepts do build on top on each other: once learnt, they will be used every week from then on. The later concepts could benefit from regular review, but by then the course is about finished unfortunately.

Recommendation 2: Interleave worked example solutions with problem-solving exercises.

Have students alternate between reading already worked solutions and trying to solve problems on their own.

From the 2nd session of the course, I start by showing a short, working program to the class and ask them to think about what it could be doing, (trying to) figure out as a group what could be its purpose. This sounds more like review though, as it reuses the previous concepts. The report also reads that alternating working examples + exercises is hugely important. "Worked example solutions" should go into much more details than what I've been doing as well (showing intermediate steps, rather than only the final solution).

Recommendation 3: Combine graphics with verbal descriptions.

Combine graphical presentations (e.g., graphs, figures) that illustrate key processes and procedures with verbal descriptions.

I can't say that I'm really doing this. I'm projecting code, sometimes working out solutions in front of the class but this isn't particularly graphical. I'm not sure how to do this either. It actually reminds me of the approach to learning that Sean O'Leary mentioned in his talk on differentiated learning at the Reimagining Learning conference, where he told us about adding visual cues to quizzes and concepts to help dyslexic learners and students with a more visual approach. Although useful, this doesn't exactly match the IES report recommendation which advocates making sure the graphical element is directly relevant to the concept being taught.

Recommendation 4: Connect and integrate abstract and concrete representations of concepts.

Connect and integrate abstract representations of a concept with concrete representations of the same concept.

The report explains that students gain an understanding faster when using concrete examples, but then don't know how to transfer the knowledge to new problems ; while students who learn the concept abstractly struggle more initially but are then more flexible with the knowledge. The report advocates mixing up both, which I'm not doing or not doing well as my students tend to have trouble reusing previous concepts to break down more intricate problems on their own.

Recommendation 5: Use quizzing to promote learning.

Use quizzing with active retrieval of information at all phases of the learning process to exploit the ability of retrieval directly to facilitate long-lasting memory traces.

5a. Use pre-questions to introduce a new topic. I don't do this. I wonder if "previewing" an unknown programming concept would help learning, or increase confusion. It'd definitely need to solve a concrete problem, ideally that we encountered in the previous session.

5b. Use quizzes to re-expose students to key content. I don't do this either. (Actually, reading on the report, presenting small programs and asking students to figure out what it does may be considered a quiz, as it encourages them to retrieve previously learnt material). It's interesting, and I wonder how to apply it to teaching practical programming while keeping the questions short and meaningful (maybe tiny programs with missing bits, with a multiple choice as to what to fill the blank with?)

Recommendation 6: Help students allocate study time efficiently.

Assist students in identifying what material they know well, and what needs further study, by teaching children how to judge what they have learned.

6a. Teach students how to use delayed judgements of learning to identify content that needs further study. I'm not doing this, except perhaps brutally when giving exercises that a student doesn't know how to solve.

6b. Use tests and quizzes to identify content that needs to be learned. This advises giving a quiz, written or oral, could be done as a game, right after presenting new material, so students can assess what they actually do remember. I don't do this. Considering most of my students don't make the time for homework or studying at home, I don't know if this would be very effective on its own. Or perhaps it would highlight that they do need to study outside of the class and encourage them to do so...

Recommendation 7: Ask deep explanatory questions.

Use instructional prompts that encourage students to pose and answer “deep-level” questions on course material. These questions enable students to respond with explanations and supports deep understanding of taught material.

I do a tiny bit of this when I introduce a new concept or explain what an existing program does, but not very deeply, nor involving the class enough (it can be tough generating discussion!). Some of the suggestions include having students think aloud, then comment and build on each other's understanding.

Leave a comment

Debugging udev rules under Debian

I've been playing with the Finch, however today I was unhappy to discover that the robot stopped working again for non-root users. The Finch documentation helpfully links to this blog post on how to write a udev rule, which is the script I was using in the first place.

SUBSYSTEM=="usb", SYSFS{idVendor}=="2354", SYSFS{idProduct}=="1111", MODE="0660", GROUP="plugdev"

Time to figure out how to debug udev rules! The debian wiki hints at a tool called udevtest, which doesn't exist on my system or in aptitude. Turns out nowadays one should use udevadm test instead. Here we go: thanks to lsusb I know that the Finch is on bus 001, device 007.

# udevadm test /dev/bus/001/007

In the output around the rules file for the finch, there is this:

add_rule: unknown key 'SYSFS{idVendor}' in /etc/udev/rules.d/55-finch.rules:1
add_rule: invalid rule '/etc/udev/rules.d/55-finch.rules:1'

Looking for documentation on how to write udev rules, one would find the following guide, which indicates that ATTR should be used instead of SYSFS. Let's rewrite the rule:

SUBSYSTEM=="usb", ATTR{idVendor}=="2354", ATTR{idProduct}=="1111", MODE="0660", GROUP="plugdev"

The error doesn't show in the udevadm test output anymore, and unplugging/replugging the Finch makes it usable by non-root users again. Victory!

Leave a comment | 4 so far

Teaching programming to beginners Latest roundup

An overdue post on the latest course I taught, which ended about 2 weeks ago. I taught a group of 9 people (8 adults, 1 teenager) of various backgrounds the basics of programming, using Python. It went well overall, and the class atmosphere was enjoyable.

For...

Unfortunately I still fail to explain some concepts clearly -- namely the dreaded for loop. I kept telling myself I needed to change the way I introduce it and finally did so, and wow. It went even worse than before. I could see in my student's eyes how they were trying to understand, until eventually shrugging it off when I couldn't find any different way to explain it. It may have come across a bit better eventually when we started working with files and used for loops to go through every line, but introducing the concept went very blergh. Definitely need to do it differently next time. I think I will try to introduce the for loop over 2 sessions: one where we only see and do exercises related to "for i in range(0, x)" and separately introduce "for item in my_list".

I don't know if I just forgot before, but failing to get a concept across is really, really depressing. I was bummed out for a while afterwards, wondering if I'm just making more damage than good and messing up my goal of making programming less intimidating.

...Yet another reason to do better next time!

Exercises

I should make sure to have at least one "Fill in the blanks" and "Change this existing program so that..." type of exercises for every concept. I think they encourage students to read and try to understand existing code -- an important skill to develop, and it also makes the first attempt at using a new structure more manageable.

In general, I'd really like if I could find a neat program that could be cut down into exercises relating to each concept, that'd build up to something cool and awesome as the course goes on. It would help get across that complex programs are really made up of simpler pieces ; if you can't figure out how to do something, break it down further. I haven't really figured out a program that fits the bill yet.

Overall, material-wise I'm getting there (except for For :|), it'd be worthwhile focusing on improving the exercises for the next course.

Homework

OMG some people actually did the exercises as homework this time :O Wow. I tip my hat to them, it's great and it paid dividends for them. Unfortunately it also meant they had nothing to do while the others were catching up, so... I should probably give away only a portion of the exercises as homework, and save a few for the actual session. (The idea with the exercises is that everybody should get at least 1 done before we move on ; having many gives the faster students something to do while others don't feel too rushed.)

Duration

I taught over 5 weeks this time (2h30 in the evening with a 20-30mins break), and I will do 6 weeks next time. For real beginners it's still reasonable and it will let me take more time on concepts like For, and maybe an opportunity to show at the end what else there is to programming, and give ideas on which direction they could go on from here (GUIs, web development, robots...).

Speaking of robots

At the last session I brought a Finch, which I still haven't had much time to play with :') But with the Jython bindings it was possible to show a 5 lines Python program that has an effect in the real world. The Finch was very popular!

I want to play with the robot more, and see if perhaps it would make sense to use it to teach the whole beginner course at some point in the future (which would bring its own set of issues, $$$-wise).

Student feedback

As usual I asked if students could fill in a feedback form.

Everybody agreed they learnt a lot. "Fun" and "interesting" were in about everyone's "3 words to describe the course", with"hard" and "challenging" occasionally thrown in there :) "Useful" came up in half the forms too, which makes me happy.

The projector wasn't great with yellow which unfortunately was the default colour for strings in the IDE. It would have been worthwhile spending the time on fixing that rather than let people squint (sorry :().

A couple of requests to link more clearly exercises with the real world. So very difficult when we're still introducing new concepts! But definitely something to strive for.

Someone suggested writing a sample program where every line is explained (e.g. if x:    <-- this will do...). I think it's a good idea, I will try for next time. It would be useful as a reference.


I should be teaching this course again around March. Any pointers to beginner exercises, general comments, teaching advice, teaching programming tips all very much welcome!

Leave a comment | 5 so far

<~ Older posts Newer posts ~>


Archives