Hello, World! Nice HAT.

Hello World!
Hello World!
Hello World!

For those of you trying to get to grips with the Raspberry Pi’s Astro-Pi Sense HAT… wait, what?

The Raspberry Pi is the amazing, powerful and compact computer-on-a-board that has got children of all ages around the world coding and investigating computational thinking. For less than fifty bucks, this machine includes a fast processor, a decent amount of RAM and USB, Ethernet and HDMI interfaces that let you connect it up to a TV and keyboard and do almost anything you can do on machines twenty times the price (like write this post, for example). If, like me, you like things tidy, you can add a box to put it in and if, like me, you’re a physics teacher, you can add on a sense HAT (Hardware Attached on Top) that is exactly the same as the kit to be used by Astronaut Tim Peake on the International Space Station to conduct experiments in space using the many sensors on board the HAT.

The whole kit cost me £75 including power supply and SD card with operating system (Raspbian – a version of Debian Linux) software pre-installed.

The setting up is simple and step-by-step, I got it working as a stand-alone machine before installing the Sense HAT. I had to take a knife to the official Raspberry Pi box once the HAT was added to the Pi board – it almost fits but just needs a little adjustment near the corner of the lid to make it snap into place. There are plenty of resources on the web to help you get started but development has taken place at such a pace that some of the guides don’t quite match the installed software. The Getting Started with the Sense Hat page at raspberrypi.org is no exception. There is a simple “Hello World!” program:

from sense_hat import SenseHat
sense.show_message("Hello, World!")

On my Pi 3B, I got an error at this point:

Traceback (most recent call last):
 File "/home/pi/hw.py", line 1, in <module>
 from sense_hat import SenseHat
 File "/usr/lib/python3/dist-packages/sense_hat/__init__.py", line 2, in <module>
 from .sense_hat import SenseHat, SenseHat as AstroPi
 File "/usr/lib/python3/dist-packages/sense_hat/sense_hat.py", line 14, in <module>
 from PIL import Image # pillow
ImportError: No module named PIL

This was because there was a step missing from the sense-HAT installation instructions which should have read:

sudo apt-get install sense-hat
sudo pip-3.2 install pillow

The second line was omitted, leading to the above error. Once the pillow module was installed OK, running the test python script above produced the results I was looking for (see picture). There is a lot of decent documentation at pythonhosted.org that I hope to take a look at in order to get some ideas for physics teaching using the sensors in my new HAT. I’m loving the sense of really playing (and learning) with computers: those of you old enough will remember the same joy of getting a BASIC program to run properly on your BBC or ZX Spectrum. Suddenly, computers are fun again.

A rocky road to run

Out running in the pleasant countryside of Fife this afternoon, a friend passed some young gentlemen who seemed to be entertained by the lone female getting fit in the fresh air. A sudden sharp pain in her hip as she ran by brought her to the shocking realisation that these were not the well-bred, well-educated youth of her everyday experience: one had thrown a rock at her which struck its target. The lone female took a fright and ran back to her car to examine the damage and consider next steps.

The next step, on establishing that there was no bleeding, was to drive to the next cut in the path where she met them cycling on the wrong side of the road towards her. She stopped in a passing place and took a photograph of them and asked them to explain their actions. No satisfactory rationale was forthcoming but in the attempt at a justification, an admission was obtained. Initially indignant at the breach of their right not to be photographed in a public place, they became fearful as the lone female got into her car and drove away with evidence that linked them to the crime.

The really awful thing about this episode, aside from the fact that a lone female is not safe to run in the lovely Fife countryside for fear of assault, is that this lone female is a teacher and, if she were to publish the faces of these assailants or pursue redress or apology through the good offices of Police Scotland, it is possible that questions and accusations may be raised that challenge her professionalism. That’s a road not worth running down.

The Magic Physics Pixies

On Thursday last week, I gave a short talk on the background and operation of one of my other sites, sptr.net, and the components that make up what I called “a professional community resource”. The event was the Association of Learning Technology Scottish SIG meeting at Glasgow Caledonian University.

The presentation slides can be downloaded as a pdf by clicking on the image on the right. You can watch a recording of the event below. This post is also available on sptr.net.

SQA briefing event for ITE

Together with colleagues from teacher education institutions across the country, I attended a full day of workshops and briefings hosted by the SQA at the Glasgow Hilton. The event was opened by Teresa Moran, convenor of the Scottish Teacher Education Committee (STEC) whose short introduction showed the endemic blindness of many of our educational leaders to the significant independent sector and the important role they play in developing our teachers. In sketching the partnership of teacher education she, like others would throughout the day, mentioned only “Local Authority schools”. SQA and GTCS representatives use the same language consistently when talking about teacher development: it may be that their model only includes those who follow the teacher induction scheme (TIS, or one-year probation operated by LA schools) but this is only one way to achieve qualified teacher status in the Scottish system.

HMIE’s Elizabeth Morrison painted a picture of the support system that continues to be rolled out in support of curricular reform in Scotland. Key elements of this include:

  • The senior phase benchmarking tool, Insight. This is a tool for all teachers to use to inform their own practice and measure impact and performance. In responding to questions later in the day, Colin Sutherland, the government advisor on Insight, made it clear that giving ITEs access is not a priority and that when it is given, there would be a data anonymisation exercise to be done first.
  • The self-evaluation and inspection framework How Good Is Our School (HGIOS) version 4 is online in draft at the moment (although I can’t find it), to replace HGIOS 3 that was published in 2007.
  • The GLOW refresh of October 2014
  • Inspection Advice Notes are updated annually (2014-15 version here)

Similar questions were asked throughout the day by delegates about the access that ITEs have to key features of the support systems in place for teachers, such as GLOW, SQA Secure and Insight. Answers given were non-committal, going no further than “talk to somebody”. Personally, as an ITE tutor, I do have access to some of these through arrangements made by colleagues within Moray House.

Ronnie Summers of the SQA gave us a presentation that some delegates thought patronising, perhaps because it seemed to be targeted at people who have no idea what CfE is. One expects this, perhaps, if the intention is to provide a briefing on CfE, but there were a number of indications that the SQA assume that teachers – science teachers, specifically – don’t keep themselves up to date with developments in education. If this was gratuitous, then the suggestion that he made that “PGDEs don’t have pedagogical knowledge” deserved the hostile reaction it got from the delegates, forcing him to attempt a back-pedal, claiming “it isn’t a criticism.”

By the time we got to the coffee break it was clear that some delegates had decided to bail from the event and go and do something more productive. I took the opportunity to enjoy a professional conversation with some primary colleagues from schools in Fife who were there to share good practice case studies: I attended the secondary equivalent of this session which was frankly uplifting.

Two secondary head teachers shared how they are implementing CfE through highly appropriate curricular models that were well-crafted to meet the needs of their young people. This session was introduced by Fiona Robertson of Education Scotland who drew our attention to the emphasis being given to the importance of measuring the impact of curricular change. This is, to a casual observer of education, a no-brainer but lack of evaluation has characterised some initiatives in schools. Not so the two schools in the case study workshop: Karen Jarvis of Linlithgow Academy described her principled approach to curricular reform, founded on SHANARRI, the four capacities of CfE, the seven principles of curriculum design, the scope of the curriculum from BTC and the entitlements of the broad general education. Karen described her model in some detail including how learners progress within it, stressing strengths and some of the issues the school faces in the changes that have been made, and that will follow from the impact evaluations.


Steve Ross of Craigroyston CHS in Edinburgh followed with a description of a different model for a different context: one in which destinations of young people has been a concern for the local community. This model makes use of the extensive SQA vocational catalogue, local partnerships and the flexibility and commitment of teachers to cross discipline boundaries in order to deliver a rich and relevant curriculum that the children of this school can and do enjoy. Evidence of impact is clear: S4s making the transition to S5 have gone from about half the cohort to 86% in a year. Steve says that behaviour issues in the senior phase are almost non-existent – the young people clearly value the opportunities they are being given through this model. A key message for student teachers entering the workforce now is that you have to be prepared to be flexible: you can’t box yourself into your subject area and think that is acceptable. Personally, I find this encouraging: I brought a lot of experience in programming and project management to teaching and have often felt that it is not only of no interest to schools, it is about as welcome as a slideshow of “pictures of our grandchildren” at a dinner party. Finally, teachers who bring “something else” are being valued and asked to put it to good use.

There was a great question raised at the end of Steve’s presentation, which had focused, rightly in his context, on employment and destinations. The question was about the purposes of education: there had been evidence from a number of speakers that a belief is held that the purpose of education is to prepare children for employment destinations – and nothing else. Clearly, this goes against some very deeply held principles.

After a very nice lunch, those of us that remained were given presentations on Glow, Insight, and DSYW which told us about the national professional learning community, nothing new, and nothing, respectively.

The afternoon workshop was billed as, “New qualifications, assessment and quality assurance to support the senior phase of CfE”. It was given by John Allan and John Lewis of the SQA and was not really as advertised. There were group activities, the purpose of which was not at all evident. There was for me, absolutely none of the detail on assessment principles, frameworks, procedures or methods that I attended the conference to hear. Presenters and delegates seemed to lose patience with each other and neither really had much to share of value to the other.

The final talk was given to the handful of remaining delegates by Tom Hamilton of the GTCS who, like some of the other speakers today, seemed to have been given the wrong brief and spoke to a target audience that wasn’t us. Either that, or he, like others who spoke today, seems to hold the belief that ITEs had not yet started updating themselves and their courses in preparation for the launch of CfE.

The event was closed by Teresa Moran who, according to one delegate, encapsulated the tone of much of the day when she read, “have a safe journey home” from a piece of paper.

Was it a wasted day? Certainly not. I had the opportunity to speak with colleagues in the other ITEs, teachers and head teachers about the reality of how the new curriculum is being implemented in primary and secondary schools and how prospective teachers are being prepared for our Brave New World. I was significantly impressed and encouraged to have it re-affirmed that there are very many people who are dissident and principled enough that our young people are in good hands. I would have liked to have heard more of these people speak today.

Why I am not renewing my TESS subscription

This week’s TES Scotland was accompanied by a separate mailing containing a flyer that in bold, red print announced ATTENTION! Action Required. The flyer went on:


I wasn’t aware, actually. Following the link to the website, there are a lot of new terms and conditions that seem to be binding me into a new contract in which I:

… agree that we at our sole discretion, without notice to you, may: (i) terminate or amend the General Terms or these Additional Terms

Er, no. Not acceptable. I will not write a blank cheque. All I want is a magazine, through my door every Friday, that I can read and throw away. I don’t want anything else, thank you, least of all an open-ended commitment to your corporate insensitivity to your customers’ needs.

Frankly, I’ve not enjoyed the changes to the TESS that have taken it from a well-staffed, relevant and useful newspaper (remember those?) to something that’s over-commercialised, London centric and off the pulse that I now merely skim and recycle. The great writers are all but gone: Douglas Blane, Liz Buie, Gregor Steele: what’s left is the best efforts of the last man standing, padded out with material from another jurisdiction. If I want to keep up with the news of what’s happening in education in Scotland, there are plenty of alternatives in the mainstream, social media and networks.

There is a real gap in the market for a regular news journal for education in Scotland. Here, there are plenty of engaged and articulate teachers, lecturers and leaders who could contribute relevant, critical commentary and shared experience for the rest to enjoy and benefit from. Anybody out there fancy taking that forward?

Teachers as researchers

Fran Dainty has responded to Dylan William’s recent challenge to the notion that teachers can be researchers. Her post adds another patronising twist to the demands that some under-informed policy makers make when they try to insist that “teachers must also be researchers”.

The reality is that we live in the Donaldson era and that means that teachers, like all would-be professionals [1], need clarity of purpose and a defensible position that is responsive to any situation. For me, this means the confidence of evidence. For that, you need to be able to do some kind of research.

I get a bit fed up with the arrogance of some academics towards people that aren’t them. Of course teachers can research: because we don’t publish it in some self-promoted peer-reviewed journal, it doesn’t make it any less valid or useful. I’ve done a lot of reading in these journals recently and frankly much of what I’ve read is as relevant and useful as phlogiston.

If people are doing good work by researching as part of their teaching job – and a minority of teachers are – then the benefits of this ought to be available to the majority to inform their own practice. I’m delighted to see the beginnings of this in the Pedagoo EnquiryMeet coming in November. It’s interesting to note that they shied away from the originally proposed “ResearchMeet” title for this event.

Robert Winston and other academics have taken a patronising view of teachers and their capabilities. Researchers may drop in to a classroom scenario and publish detailed conclusions based upon what can be only described as a passing acquaintance with the nuanced environment in which our children learn. On this basis, they really ought to allow the professional classroom practitioner, who has insight and experience they do not possess, the courtesy of accepting them as capable of research that is every bit as valid as theirs.

Behind it all is one of the fundamental defects with our Scottish education system – the lack of proper time and opportunity for the already fully committed teacher to step back, assess, enquire and develop our education system from within.
[1] We’re not, never have been, but aspire to be regarded as professionals in the same way that engineers and soldiers are.

Last.fm scrobbler v2 doesn’t work

lastfmThis morning, I finally gave up trying to sort out the scrobbling problem I’ve been having since December. The current Last.fm scrobbler, version 2, is just not functioning, so I’ve reverted to version 1.5, losing 4 months’ scrobbles in the process. Not impressed. Why can’t anybody write software that works any more?

The problem has been that although the Last.fm app on my OSX device seems to work, reporting scrobbles normally, these seem to get stuck in cache. In the app, these tracks show as “cached” and do not appear on my last.fm profile.

Long story short, if you’re a Mac user having trouble with last.fm not scrobbling your tracks, delete the last.fm scrobbler, empty the trash and download the older version 1.5 here (dmg).

And(roid) another one bites the dust

I don’t have good experience with Android devices, not that I’ve ever actually bought one. My first device was a Google Nexus I won in a prize draw which was just a flaky piece of junk, even when they eventually sent me a new one after returning the original, with its faulty display, four times.

Luckily enough, I won an Amazon Kindle Fire in the University’s Digital Footprint launch competition, which was handy – my reading list consists mostly of papers and articles that I manage with Mendeley. I can send pdfs automatically using the brilliant Kinsync service, straight to my Kindle.

This morning, alas, my Kindle Fire woke up dead. No response, even to the 40-second reset. I eventually found myself talking to Amazon support, who, because the device is still in warranty, have next-day shipped me a new replacement on the promise (and credit card collateral) that I send them back the dud. They’re even paying the return postage. More than this I can’t ask: it’s certainly better than the “all our customers are morons” experience I had with Google.

So far, my experience with Android equipment has been worth every penny I’ve spent.

PHP Mail and stripping of lines in Microsoft Outlook

A client recently contacted me about problems with the formatting of messages he was getting from a php contact form on his site. He asked if I could insert a couple of CRLFs to make it easier to read and to stop it breaking the email links in the message.

The client’s site is one of those creaking anachronistic beasts, from the days of hand-hacked HTML, which is full of things that work just well enough to enable him to concentrate on his business. I’ve been trying to get him to move to a CMS like WordPress for several years now, but he’s not quite able to let go.

The contact form had not been a problem, as far as I knew, but all this while he has been putting up with messages from the site that look a bit like this:

Name: FredEmail: fred@bloggs.comTel: 09999899988Hi I was
wondering blah blah blah blah?RegardsFred

On my machines, they look like this:

Name: Fred
Email: fred@bloggs.com
Tel: 09999899988
Hi I was wondering blah blah blah blah?

It seems that there is a “feature” that has existed in Microsoft Outlook since 2002, at least. What it does, often without letting the user know, is strip out any formatting of lines in the original message and replaces it with what it thinks you’d prefer. In text-only messages, this results in what you see in the first example above.

There’s a lot written about this, much of it along the lines of altering the user’s practice to include workarounds that are only necessary because Microsoft can’t write good code. See here, for example, or here for one of the empirical solutions that suggests changing code to accommodate Outlook’s perverse behaviour. Many others remain baffled. However, thanks to a bit of forensic inquiry by Matthew Truesdell, there are some rules that can be interpreted in such a way that allows the php script to work for all users. Matthew posted the rules he found in Outlook 2007, over on Stack Overflow: I’ve adapted from those here, slightly, using the term “mode” to mean the behaviour of Outlook that strips out line breaks from plain text messages. Lines are assessed one at a time:

  • Every message starts with the mode OFF.
  • Lines 40 characters or longer switch the mode ON.
  • Lines that end with a full stop (.), question mark (?), exclamation (!) or colon (:) switch the mode OFF.
  • Lines that turn the mode off will start with a line break, but will turn it back on if they are longer than 40 characters.
  • Lines that start or end with a tab turn the mode off.
  • Lines that start with 2 or more spaces turn the mode off.
  • Lines that end with 3 or more spaces turn the mode off.

So it seems that one way to trick Outlook is to add 3 spaces at the end of each line, which in the code is just before the CRLF. I tried this, but be careful if you rely on it: different versions of Outlook do different things. Outlook 2013 is still stripping out the line breaks on the client machine, so we have this:

Name: Fred   Email: fred@bloggs.com   Tel: 09999899988
Hi I was wondering blah blah blah blah?   Regards   Fred

Which is still not satisfactory but at least allows him to click on the email address for a quicker response.

On my own machine (OSX Yosemite), Outlook 10 seems to be working as you’d expect, without interfering with the line breaks. Gmail works fine also. I think that’s as far as I’m going to take it.

Paloma at the Hydro

FullSizeRenderWhat better way to start the weekend than with a Friday night on Pacific Quay in a nice hotel, some quality food and tickets to see Paloma Faith and her amazing band at the Hydro?

I’m a serial Paloma fanboy since I first saw her perform at the Corn Exchange a few years ago. Every gig is different and yet her performances are as fresh and fun as the first. We bolted from work Friday afternoon and had time to check in and freshen up at the Premier Inn before going for a pre-booked (seriously, you have to pre-book) bite to eat at the Yen oriental in the Rotunda.

We arrived fashionably late, just as the support, Vintage Trouble, were getting into their pumped-up and lively set designed to get even the most reserved of English audiences twitching in their seats: as Paloma said later, Scottish audiences need no such warm-up as they are already “smokin’ hot”. We were on our feet, whooping and hollering as the lead singer Ty Taylor and his LA band gave it all. You remember Ty from his incredible duet at the BBC Proms with Paloma of Etta James’ “I’d rather go blind”. If you missed that, your life isn’t complete. Youtube it now.

The main event started with a dramatic drop of the white curtain that had covered the main stage set-up which was not dissimilar to the arrangement we saw at the Clyde Auditorium last year: white, white and more white, with blue contrast in the band’s clothes and the singers’ incredibly funky outfits. I thought the sound was a little lost for sharpness in the massive Hydro auditorium but lost myself in the music, along with the 80 million other people in the venue (may be an exaggeration). We danced, and sang and let the happiness that the performers had for their work wash through us as the set progressed to an outstanding orgy of well-kent numbers and the hide-and-seek of the encore game.

A brilliant night out in Glasgow, with the cherry on the perfectly iced cake for me being another chance to see my favourite, favourite bass player Andrea Goldsworthy do her stuff. I may have got a little over-excited in the cheer for her, as one of our new friends in our row patted me on the arm and said, “steady on there, boy”. I don’t care. I had been having the best fun in ages: the hallmark of a Paloma Faith gig.