Tuesday, September 19, 2017

Kivy Basics - explaining widgets

This is my video that has gained some small amount of traction on YouTube that explains the passing of information becak and forth between py and kv files.



Example 1:  Coin Toss

main.py
CoinToss.kv

Example 2: Noob basic shape
main.py
noob.kv

Hope this is useful to people trying to get started in Kivy.




Tuesday, June 20, 2017

The Day I fell out of love with UNSW ProgComp

I love programming. 


I really like getting into a problem I find difficult. I quite relish the heart pounding self doubt before I finally untangle my own thoughts and get a stupid machine to do my bidding. I'm not very good at it, I am not able to intuit node traversal or dynamic programming or (god forbid) prolog parsing but I love having a go and am completely addicted to the euphoria when I get a problem out. Cryptic crosswords are a similar joy (except Fridays in the smh, gah!). So with all this love in me I try to engender the same kind of relish for tricky problems with my students.

I run a code club and teach years 8, 9 10 and 11 and have some form of programming in the teaching programs for all of those years with Year 11 studying the NSW Software Design syllabus. These students are encouraged to seek out ways to stretch themselves forward rather than just do what already feels comfortable. 

Every year for the last several years we've had a ProgComp Party!

ProgComp is an annual competition run by UNSW where the grand prize is scholarship money towards the winning students' future tuition. It's part of the UNSW outreach program and is more about recruitment for them but also purportedly about getting more students engaged with tricky programming problems.

What's a ProgComp Party? The students spend several weeks (for an hour or so a week) honing their Python skills, I order Pizza for lunch and buy a stupid amount of lollies. I book out a computer lab and we move all the library's portable white boards in. The students have some code snippets to get started with and when it kicks off at 2PM I print 10 copies of all the questions and teams do their best to hack together an answer or two. 

We're not very good. We're never going to get into the finals and I have been known to prod the younger students a bit to get them over the line of completing a question. We don't mind not being real contenders though. As one of my Year 9s said "It's not about winning it's about getting a bit better each year."

We usually get to the end of the 2 hours feeling bruised and battered and exhausted but happy in our small successes.

Not this year however. This year the atmosphere was completely different and I had to convince some of my students not to leave early -- that's never happened before.

What was it about this year that was different? It was harder and more mathy, more impenetrable and much less accessible to my students. The questions were so poorly explained that I had to read them multiple times to work out how to retell them to the students in a way that would get them started. 

I understand that we're not the target market for this competition. It's about attracting the super-geeks and encouraging them to put UNSW first on their uni application. But my goal is to present kids with tricky problems that will whet their appetites and sharpen their thinking skills and have them feel more efficacious than they did the year before. 

I'm not a maths teacher but I do run the maths club at school (although that might be a grandiose title for what it is), and I'm not afraid of a bit of maths but it's intimidating for kids to see formulae they don't understand. 

The Junior question was not very hard once you understood it. It involved file processing and formula following but it was so badly framed that my juniors were at sea and I was giving far more help than I ought to have just to have them feel like they were still part of it.

The first question after the junior was quite a tricky problem with a mapping of the shape of strings necessary. It took a serious amount of time to decompose before even thinking about syntax. 

Needless to say we're not going to the finals but my concern is that the on-ramp was so steep that I might lose some of my students who walk away thinking this programming thing is impossible. Now I'm going to make it my mission in life to ensure that doesn't happen but I can't see booking a room with the whiteboards and the Pizzas and the lollies again next year. Maybe we'll attempt the Friday cryptic crossword instead. 

Sunday, June 11, 2017

Edutech talk

It was my privilege to be invited to speak at Edutech this year. This is  my talk from the main stage in the expo. What an amazing event!

STEM is Hard but Valuable

SUPERGIRL
There’s an 11-year-old girl I know and she’s a force to be reckoned with. She’s not your average kid, she’s been coding in Python and scripting HTML from the age of 8 and she’s completed the National Computer Science School Intermediate Challenge with a perfect score. She’s no fading violet either. She’s a scout, she competes in martial arts tournaments and rides a road bike at nearly 30 km/hr and when she occasionally falls off she wipes the blood off and gets right back on again. She is resilient and she has some mad skills.
The other day she was working on a harder competition and was faced with a coding problem she didn’t know how to solve. She burst into tears. She said she didn’t feel good enough at programming.

RESEARCH?
All of the research I’ve read suggests that confidence issues in Technology and Maths stem from bad experiences when young, negative attitudes to technology and Maths from female role models such as primary school teachers, negative attitudes to technology and maths from the mother – none of these applied here. And maybe it was a bad example, maybe she was tired?, having a bad day?, it’s by no means a representative sample but it struck me none-the-less. How can this happen? How can a capable, resilient, skilled young girl feel so overwhelmed by a tricky coding problem? And what hope is there for the rest of us?

IS THE ON-RAMP TOO STEEP
I’ve told this story to people I know.
My teacher friends say – the problem was too hard, the student needed more scaffolding, the on-ramp was too steep. Who agrees with that?  I don’t really think so. I know the kinds of problems this kid has solved in the past – I think it *was* appropriately on-ramped and I’m a bit of a geek so I enjoy this stuff but, if you scaffold things too much I think it takes the fun away and makes learning a tutorial. People get frustrated by tutorials.
My tech friends have a different take. The kid cared too much about the mark and not enough about the problem. It was a motivation issue.
This feels true. We heard about this kind of thing from Carol Dweck. The kid was crossing that line to the Fixed mindset rather than the Growth mindset. She was pushing herself forward to achieve an arbitrary outcome – it was an intellectual exercise. The only reason to complete the problem was to say she completed the problem. Let’s look at the rest of her life and see if we can determine her motivation in other things.

She is an active Scout. Scouts involves social games and problem solving and small fabric arbitrary outcomes that you can sew onto your uniform. You can even get a small fabric arbitrary outcome for sewing other arbitrary outcomes onto your uniform. But I get the feeling that the motivation is more playing around in the dirt and lighting fires than it is about the badges and research seems to agree with me. There’s a fun article by Deci, Koestner and Ryan that argues with the previous debunking of the original paper that posits that badges probably undermine intrinsic motivation (I like tracking the arguments) -- but it all kind of depends on the learner and the type of learning.

The next thing we know about the kid is that she trains in Martial Arts. Martial Arts definitely involves extrinsic motivation but it’s by no means arbitrary. If you watch a Martial Arts class you see that the belt colours are more a representation of levels like in a computer game. They are motivating because they define the ranking in the class and the social structures are all built around the levelling. Those high-ranked colours earn you some respect but they’re also not the reason you work hard, they just keep track of where you are on the continuum!

Finally, we know that she rides a bike, not in competitions but for the joy of getting from one place to another fast. It’s not about ranking or winning (except she thinks it’s awesome to “beat” her brother -- but doesn’t everyone?).
None of these things only derive a sense of accomplishment from the checking off of tasks – the completion of the next pre-defined difficult problem. But so often our school type problems – and particularly abstract STEM challenges do.
So how can we help our girl to continue to grow her skills in STEM without breaking her spirit? We must make the problems meaningful to her. The Digital Technologies Curriculum and the draft Curriculum for NSW Digital Technologies both talk about “real world” problems.

REAL WORLD
So, what is a “real world” problem?
Dan Meyer is one of my favourite educational bloggers. He’s a former maths teacher who did a TEDx talk on how we should do Maths differently – it went kind of edu-viral a few years back. He makes a distinction between real world problems and interesting problems. He says the interesting problems are the ones that hook the kids to have them want to know the answer – or indeed to come up with their own questions. This is actually how I define “real world” problems when I read them in the syllabus documents. This reminds me of the Melbourne Declaration which states “Successful learners– are creative, innovative and resourceful, and are able to solve problems in ways that draw upon a range of learning areas and disciplines.”

STEM-EMBEDDED AUTHENTIC PROJECTS
The place to start is STEM embedded in authentic projects. The challenge our original little girl was faced with was a difficult file processing problem. Now I don’t teach many 11 year olds but I do teach a bunch of high schoolers and in a bunch of my classes we have to do file processing with code. I can teach the iteration and what to do with strings line by line and slowly watch the kids’ eyes glaze over as I lose them. Or I can have them make a computer game. Once students have been making a game for a while and they’ve had some success and let their friends play some of the early levels they start to ask how they can keep track of high scores even after the program is closed down. How can they do that? Computers don’t do a good job of holding onto information after the power has turned off. – The students need to do it by writing to a file. And when they open the game the next time the first thing that game has to do is open up that file and process the information in it. Suddenly the kids care about file processing and teaching them how to solve those problems are no longer my idea but theirs – it’s practically no longer teaching!
So all we have to do is make our students care about each individual content dot point and everything will be rosy! Except…

THE SITUATION SO FAR
In primary schools Science and Technology make up a minimum of 6% of indicative teaching time. The Technology portion is 3% (charitably) In the shape of the new curriculum Technology is made up of Design Technologies and Digital Technologies so that leaves 25 minutes per week to work on a programming project. Tricky to get to those moments where the students are begging to learn the thing they need to solve the next problem.
Google talks about future careers being CS + X where CS is computer science and X is whatever it is you’re interested in. I think this needs to be reversed in our classrooms, particularly in primary schools. Our focus is not to make hundreds of thousands of computer scientists but to teach students authentic problem solving and algorithmic thinking and STEM is just a hammer with which to hit that particular nail. Steve Jobs once said “Everyone should learn how to code because it teaches you how to think.” So let’s enrich Maths, English, Arts, HSIE with projects that incorporate STEM. Designing projects that allow us to do double duty lets us make the most of the time we have with the students.

PROJECTS
I have a few projects I can talk about here as integrated with STEM to make the best of time with students while also meeting DT outcomes. The first is a Mandatory Technology project in the area of textiles that has been adapted to incorporate computational thinking and coding. The students were encouraged to design their own outline and features for a monster soft toy with ahidden switch and soft circuitry. They then worked with Arduino version of C to write a simple program. Some of the students extended their project to incorporate a squeeze switch to change the sequence. The good thing about this project is that it’s student defined (within a defined framework) it hits the required outcomes, it’s engaging, it extends the original textiles project and it’s scalable to meet the skills of the students. The difficulties with this project were the frustration with sewing unshielded conductive thread with beginners stitching… can you say zigzags and short circuits? Debugging of the circuit is only possible once complete lines of stitching are done but then fixing that requires the unpicking of complete lines of stitching. Unpicking is very hard on motivation. It’s slow and arduous and we watched students become slightly less enamoured with their monster with each time they had to unpick anything.

The second case is a cross curricular project centring around Health from PDHPE. The students spend 19 weeks (totalling about 30 lessons) learning the components of health and how they’re measured. They also concurrently learn about using MIT Appinventor and being reminded of the design cycle by following the design thinking model. The students then define their line of inquiry, choose a target audience and develop an app that meets the need of their target audience to try to improve a component of health. The benefits of this project are that it is student led, they choose their audience, their area of health, their motivation techniques and they use the LMS to learn the skills they need Just in Time. The detriments were that the time was quite short all told and the students had pretty high expectations for what they could achieve in that time. --- 
It is a problem these days. Even when I first started teaching the skills required to make something that looked professional were within the grasp of the average computing student but now everything is so slick and the User experience is so good that there’s a chasm between what our students can make in the time allocated and what they see on their phones every day. ---
That said it was an extremely successful project and we’re looking forward to running it again.
One of my favourite concepts was an app where young children were encouraged to move more to earn points to get water and food and accessories for their pet cactus. Cactuses are way cool with 14-year-olds right now.

The showcase was a “shark tank” like presentation where the students showed their Minimum Viable Product to a panel of judges to ask for investment (the most persuasive presentation got a gold bar {of chocolate}). This project shows that you can meet outcomes from very disparate KLA silos. It showcases the best of the idea behind X + CS. But STEM is still hard.

WHAT'S NEXT?
I believe that things are going to get easier. As Digital Technologies implementation gets smoother and teachers become more comfortable with the content, as senior primary teachers can start to rely on the kids they teach to come into upper primary with sound algorithmic thinking skills from lower years and high school teachers can build even further. The kids are going to be bouncing off the walls if we give them a Scratch project or Blocks based App inventor project – they’ll want to break any benchmark we set them now.
The girl from the beginning of my story is fine. She slept on it, asked some questions, picked herself up, wiped off the blood and cracked the problem the next day. But it’s still not the best way to motivate a student to push themselves in STEM learning.

Authentic real world projects involving student autonomy that are well designed to cover syllabus outcomes and allow for embedded just in time learning. I just said that so quickly it sounds almost easy. I don’t think that’s easy that’s what they say in the tech biz is a non-trivial problem. Extremely difficult but not impossible. So I’m going to leave you with a question to take home just before I open for questions from you. Can you think of ways to incorporate authentic STEM enriched projects into your non-tech units?



Monday, February 13, 2017

New Year - New Everything

It's a new year and I'm changing just about everything just to keep it interesting and to try to make the vibe of Digital Technologies come alive in NSW classrooms before we officially get a curriculum.

First Change: Year 8 technology this year will be using the ATTINY85 with usb interface to program our electronic plush monsters (See Tutorial here)

Second Change: Year 8 needed an Interdisciplinary Unit because they are transitioning to MYP. I put forward a proposal with PDHPE to create a new STEM-Health Subject. We'll be helping the students to make Android Apps using Appinventor 2 to motivate users to be more healthy.

Third Change: I have the largest group of external students ever in Software Design and Development (Preliminary) and I'm looking forward to helping them to bond and work together as a class as they progress towards the mastery of HSC Software Design.

I also have the Australian Computing Academy which will start talking over more and more of my life as I help integrate Digital Technologies resources into classrooms across Australia. 

This is going to be fun!

Thursday, January 12, 2017

NCSS Day 9 - The All Nighter

7:00 - What the heck am I doing awake? I mean, Good Morning and welcome to the day of the very little sleep. Shower and breakfast and then a quest for the necessities of life... Campos coffee.

8:45 - Some very bleary-eyed students, teachers and tutors at morning roll-call. There was a minor war for the couches.

9:00 - At SIT - No lecture this morning. Instead the embedded teams work to prepare their minimum viable product for about lunch time. 

9:30 - Ran a mini-lecture on multiplexing and how to share pins between multiple LEDs to allow for efficient use of the pins. Some of the students went a little glassy eyed so we agreed to make the MVP with a minimal number of LEDs and work on animating the fade (requiring multiplexing) only after MVP is nailed.

10:00 - Decided to utilize any down time to learn Recursive parsing and evaluation. This is something that has stressed me for a while so it's a logical goal. Working on recursively parsing mathematical statements first - then move on to Prolog. Students are jumping in and out of the labs to have "mock" interviews with sponsor companies - a very cool part of the program.

11:00 - Gah, parsing fights with my brain but progress appears to be being made.

12:00 - Got the parsing finished - break for morning tea.

12:30 - Once the parsing was finished, the evaluation was surprisingly easy. Had to tweak the input a little and the program actually reverses the list of tokens so that the order of operations works for the math statements -- nailed it.
<< My code (well, image thereof)

12:45 - Students went off to thank sponsors and get some generalized feedback on the interviews and I went off to lunch in Newtown.


2:00 - We had a birthday celebration for one of our students at morning tea so MVP has been shifted to 3:00PM Frenetic activity in the lab.

3:00 - MVPs shown to the rest of the group. Lots of masking tape and velcro! 

4:00 - Everyone completed their feedback survey for the whole summer school and then heads to the engineering lecture theatre for the annual "What's uni like, what's research like, what does and ATAR mean in reality and should I do more Maths?" talk from James Curran and then an overview of natural language processing (which reminds me that I still haven't sorted out the stupid Prolog parsing problem -- tonight during the quiet time)

6:00 - Dinner time and a couple of teachers went to the pub to toast the fact that we'd made it to the end intact and chat about school and politics and forming support networks and exchange funny anecdotes.


7:30 - Everyone back to SIT for the headlong dash to the finish line. Embedded teams were madly finishing off for the "NCSS Olympics" at 10PM, web stream teams are trying to add as many features as possible before their required to take a break to compete in the said "NCSS Olympics" for which they will have to be dragged from their keyboards. Once they get started though, it's super fun.

9:00 - Set up for the Olympics and final team tweaking for the competition (one of our teams had issues debugging right up to the deadline). 

10:00 - NCSS Olympics! My favourite projects were:

  • Laser tag - use a laser gun and there are 3 randomly placed
  • Physical Torture - where the micro:bit tracks your number of pushups, situps and squats until you really feel the burn
  • Running between radio connected micro:bits to read a sequence of letters and then enter it into the other one.
  • Dab Dab revolution - where you need to Dab in the correct orientation as tracked and dictated by the microbits 
12:00 - Pizza!

1:00 - Back in the labs working on my parsing project for another hour

2:00 - Embedded Lecture. All the groups who had finished their projects with the Olympics were invited to an embedded "Show and Tell" in the lecture theatre. Seriously cool

3:00 - Watch the NCSS2017 movies made by the tutors and the returners. Seriously good!

3:40 - Hogan out! zzzzzzzzzz

4:10 - Back at my room for a couple of hours

7:10 - Coffee Run

This program really smashes your sleep patterns but I love it and we all made it out the other side!



Tuesday, January 10, 2017

NCSS 2017 - Day 8

Tonight will be the last night of sleep for a number of our intrepid campers.

Today was the kick-off for the projects for the embedded stream! We had lecture (with optional extension) this morning and then Labs where the students brain stormed ideas for the project and then the remainder of the day is working out proof of concept and testing and researching to head toward the MVP (Minimum Viable Product). The students are making somethign that takes environmental inputs to target the health of the users and each project will be showcased in a Robot Olympics at about 10PM on the "All Nighter". 

Morning Lecture
This morning's lecture covered signal conditioning, calibration and a high level view of what the CPU does. There was then some extra lecture that was recommended for those who were handling the pace and were interested in how gates are represented in the circuitry and how a CPU works in detail. I have notes for the first, mandatory part. 




Morning Labs
The students spent this time brain storming and then reported back to the larger group as to what they'd decided. It was a little confused because we had some students but most stayed for the second part of the morning lecture so we weren't able to progress all that far. It sorted itself out pretty quickly though. The teams within out lab group were very different in their choice of project which is really good to hear. I think the micro:bit makes them feel more confident so they felt able to think outside the box.

Lunch - Teacher Talks
We met again as teachers to talk about next steps and what we'd do with our students. Bruce and I had a bit of a talk about how we've succeeded and struggled to bring parts of the NCSS program back to our classrooms. Hopefully it was helpful for others to hear how things could be scaled back. It's great to hear that most teachers in the embedded stream agree that there is so much they can do with the micro:bits because the depth of the electronics we cover at NCSS in unnecessary for jumping in and getting started. As a dabbler in Arduino myself I concur that this is very true. No doodle notes on this session because I was talking quite a bit of the time. 

Project work
Challenges to solve: 
How do we split up the resources among the sub-teams?
How do we map accelerometer readings to discover when a particular movement has been achieved?
How do we display the success or failure of a challenge to the user... these discussions are really interesting - screens are for wimps!

The simulation
The simulation is a short game (remember the all nighter is tomorrow) where students are expected to come up with a 1 minute skit to represent NCSS in a given genre. In order to maximise their planning time they also have to show that they can run two sort algorithms using humans in their group to the satisfaction of their tutor. (If you do a good job of the sorts quickly you can have more time to plan than your fellow teams - unfortunately, this is not always a benefit to the quality of the skit). The fun comes when you then have to re-perform (or continue it) your skit with much less time -- 20 seconds and then 5 seconds (HINT: If all your characters die in the first skit, the sequel is not going to be very interesting.) It was fun and funny.

My family came to hang out for a bit and we took my boy up to get teeth achingly sweet cookie and icecream sandwich at a place called "Cloud 9" - parental guilt can be profitable.

Early night in prep for the "All Nighter"
zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz

NCSS 2017 Day 7

Nearly Project time...

Today is Monday, we had normal lectures and labs and then Programming comp as the evening activity.

Morning Lecture
The first lecture was about Analogue to Digital Conversion and Digital to Analogue simulation. Followed by a fun session on using software and lots of time to create your own PCB maps for creation. Not sure if this is something in my future but it was fun finding out the practicalities of this stuff.


Morning Lab
The students I'm working with are still trying to get their robot moving consistently. It's moving forwards and backwards and I talked them through the algorithm we're going to use for following a line. They then focused on reading from the light sensors and working out what those numbers mean. The DAC lab will have to wait.


Afternoon Lecture
The second lecture was about different ways to communicate with devices using the micro:bit and some of the pros and cons. We then had a high-level overview of the project ready to be put into teams.


Afternoon Lab
The students I'm working with have been hacking away at their line-following code all afternoon and they're getting frustrated. I've discovered that the sensor and input management is working just fine. It's something with the motors but we ran out of time. At least they seem happy with their team for the project and I'll have another crack at debugging tomorrow morning while the lecture is on.


Programming Comp
I love programming comp. The teachers didn't place this year but considering our overall experience level with Python we did really well and the "experienced" team didn't even get tutor help so I'm proud of our performance. Go team! My favourite question was a secret message hidden in pi where you had to convert each char in pi to and int and then it's bin representation and then jam the binary strings together - the message was hidden in the resulting data string with starting addresses given for each letter and then the following 8 binary digits making up the ASCII code for the letter. - Beautiful! Well done organising team.

100011111011111101111110010010000010011101101001110011111010001110100100001