All posts by rwhite

Project: Raspberry Pi Kiosk Display

If you’ve got a Raspberry Pi lying around and you were wondering about what you might do with it, consider using it to drive a presentation kiosk.

This post doesn’t describe how to set up a Raspberry Pi from scratch. Getting a new Raspberry Pi up and running requires a collection of materials and a bit of time, which is the price one pays for being able to buy a $35 computer. There are a wide variety of tutorials on the web describing how to make that happen, including this YouTube presentation by yours truly.

Assuming you’ve already got your Pi running, though, here’s how you can set up a presentation kiosk that will cycle through a slideshow.

1. Create and test your presentation using LibreOffice Impress software. You can do this on a separate machine running LibreOffice or on the Raspberry Pi itself. You’ll want to set up the slide transitions and the presentation repeat. (Also, if you’re using images in your presentation, be careful of using high-resolution images. I’ve had presentations choke to a halt when given too many high-res images to present.)

2. Using the terminal, download and install xscreensaver.
$ sudo apt install xscreensaver
This is the only way most people have found to reliably keep the screen from sleeping while you’re using your Raspberry Pi in a kiosk mode. Once the software is installed, you can disable the screensaver in the Accessories settings.

3. The system is now effectively running as a kiosk, although you have the Raspberry Pi, the mouse, the keyboard, and a tangle of wires all over the place. To clean things up a little, get some 3M Dual Lock reclosable fastener tape and put one strip on the Pi housing and one on the back of the monitor. You can attach the Pi to the back of the monitor now, and get it up and out of the way.

4. Once you’ve got the display set up and running in a desired location, go ahead and unplug the keyboard and the mouse from the Pi. That way it will be harder for the presentation to be accidentally interrupted.

What can you use this project for?

  1. Showcasing student work
  2. A vehicle for student investigation of the Raspberry Pi or Open Source software
  3. Presenting program information to visitors at Open House or Back-to-School night

Materials

Open Sourcing

Fun story.

For my own use and as a programming activity, I wrote a little Python script that I could use as a countdown timer. (Bonus feature: I can run multiple timers at the same time. Apple iOS, I’m looking at you!)

I wanted to have a little bell that would ring at the end, and look at that, GarageBand has a little alarm bell sound! Here it is:

I was going to throw my little project up on GitHub as an example for my students; also, because I’m A Developer. I was pretty sure I wouldn’t have a problem packaging Apple’s alarm bell sound with that project. I mean, I’d already had to go to the mat with Google/YouTube about a song I’d made using some of Apple’s sound loops, and I’d done my research. At just under 30-thousand words (at that’s only for the English version) you can polish off GarageBand’s User License Agreement in an easy afternoon, and here’s the good news about GarageBand projects:

H. GarageBand Features and Support.
Except as otherwise provided, you may use the Apple and third party audio loop content (“Audio Content”), contained in or otherwise included with the Apple Software, on a royalty-free basis, to create your own original soundtracks for your video and audio projects. You may broadcast and/or distribute your own soundtracks that were created using the Audio Content…

Cool! Oh… but wait….

…however, individual samples, sound sets or audio loops may not be commercially or otherwise distributed on a standalone basis, nor may they be repackaged in whole or in part as audio samples, sound libraries, sound effects or music beds.

Dammit, Jim. I can’t use that file in my project. Oh, and maybe I just violated the license by embedding that file here.

What should I do for my project? Quick fix: borrow a desk bell from the Theater Department at school, record a single “ding!” and process it using open source Audacity (“Screw you, GarageBand.”), et voila:

My project–including that alarm bell!–has been posted on GitHub: https://github.com/rwhite5279/timer . Mischief managed.

For the record, I totally get why the GarageBand license agreement would restrict redistribution of files. It’s just another in a long list of Apple-related frustrations for me and I needed to vent a little.

Plus, I wanted to play you my bell recording. I’m quite proud of it! ;)

Quitting Facebook

I quit Facebook last month.

It wasn’t a rage-quit, or a “I’ve had it!” kind of thing. For me, the thing has just run its course. FB has little value to me at this point in my own life, and although I used to maintain the account to keep in touch with alumni, a lot of them aren’t using it anymore either.

There were a couple of precipitating events, perhaps, that did nudge me closer to the precipice. There was a tone-deaf Mark Zuckerberg being interviewed by Kara Swisher a few months ago. There was a phone call from an old friend a few weeks ago who let me know that she isn’t on Facebook, reminding me that such a thing was possible.

Knowing a little bit about how these things work, I’ve been bothered for years by the algorithmic manipulation of your News Feed. Facebook doesn’t display items in your feed in chronological order—it displays them in an algorithmically-generated “Top Items” order which (until very recently) you had no control over. If you’ve every wondered why you haven’t seen some friends’ posts on Facebook, it may well be that their comments were buried so far down in the algorithm that Facebook effectively never showed them to you, in favor of sponsored ads for socks from Sweden.

Last month I read this interview with Yuval Noah Harari, and it really resonated with me. Although the focus of the article wasn’t social networking, there was some discussion of technology and how we respond to it emotionally.

An excerpt:

I try to be very careful about how I use technology and really make sure that I’m using it for the purposes that I define instead of allowing it to kind of shape my purposes for me. That sometimes happens when you open the computer: you have a couple of minutes to spare, so you start just randomly browsing through YouTube, and two hours later, you’re still there watching all types of funny cat videos, car accidents, and whatever. You did not say to yourself, “Okay, I want to spend the next two hours watching these videos.” The technology kind of dictated to you that this is what you’re going to do by grabbing your attention in such a forceful way that it can kind of manipulate you.

How has removing those attention-grabbing technologies changed your quality of life?

I have much more time. I think it makes a much more peaceful… I mean, it’s not such a big secret. The way to grab people’s attention is by exciting their emotions, either through things like fear and hatred and anger, or through things like greed and craving. If somebody [is] very afraid of immigrants and hates immigration, the algorithm will show him one story after the other about terrible things that immigrants are doing. Then somebody else maybe really, really doesn’t like President Trump, so they spend hours watching all kinds of things that make them very, very angry. And it doesn’t matter if it’s true or not—they see this headline of “President Trump Said the World is Flat,” they feel this irresistible urge to click on it.

It grabs your attention because you already have this weakness. But if you kind of sit there and just read infuriating stories for an entire hour you are basically feeding your mind with things that make you more angry and hateful. And this is especially bad if many of these stories are just not true. Sometimes they are true, quite often they’re not. But the net result is that you now just spent an hour feeding your hate and your fury.

It’s the same way with the other side of the coin, with greed. Because if you really want something—the perfect body, the perfect car—and you watch all these videos, you want it more and more. And if you don’t have it, then you feel worse and worse that you don’t have this kind of body, or you don’t have this kind of car. So you just spent one hour feeding your cravings and your greed, and it’s really not good for you.

The better you know yourself, the more protected you are from all these algorithms trying to manipulate you. If we go back to the example of the YouTube videos. If you know “I have this weakness, I tend to hate this group of people,” or “I have a bit obsession to the way my hair looks,” then you can be a little more protected from these kinds of manipulations. Like with alcoholics or smokers, the first step is to just recognize, “Yes, I have this bad habit and I need to be more careful about it.”

So how do you get your news?

I rarely follow the kind of day-to-day news cycle. I tend to read long books about subjects that interest me. So instead of reading 100 short stories about the Chinese economy, I prefer to take one long book about the Chinese economy and read it from cover-to-cover. So I miss a lot of things, but I’m not a politician and I’m not a journalist, so I guess it’s okay I don’t follow every latest story.

So, ummm… yeah. I’m out.

It doesn’t feel as if I’ve really made a big decision or anything because I haven’t spent any significant time on FB in the last year anyway.

Also, to be clear, I haven’t deleted my account or anything. The few things I’ve uploaded in the past are all still there, and I’m sure my timeline is going to tick by just as it has in the past. I just won’t be paying any attention to it.

If you need me, you know where to find me. And it won’t be on FB. :)

Parsons Problem Lesson: quad_functions

Learning Programming is Hard

Many challenges face the new Computer Science learner. One of the most interesting times for students learning to program is that period after they’ve learned a new feature or programming strategy, but before they’ve had a chance to really master it. The syntax may still be unfamiliar, or the strategy is “the same, but different” as something that they’ve seen before.

A Parsons Puzzle

I first stumbled upon the “Parsons Problem” type of question in a paper by researchers Denny, Luxton-Reilly, and Simon, Evaluating a New Exam Question: Parsons Problems, published in 2008, which led me to Parsons and Haden’s original paper Parsons’ programming puzzles: a fun and effective learning tool for first programming courses.

A “Parson’s Puzzle” is a programming problem delivered via computer, in which code fragments, manipulated via a drag-and-drop interface, may be assembled to form a correct, working program. Clicking a “Check” button would provide some sort of feedback. Parsons and Haden proposed that the nature of the puzzle would improve engagement with the topic, provide better structure for students still struggling to understand fundamental logic, strategies, or algorithms, and even intentionally allow for common errors so that a student could get immediate feedback on fundamental misunderstandings.

Parsons and Haden’s original idea of helping to teach students with an automated system was adapted to a paper-based means of assessing students by Denny, Luxton-Reilly, and Simon. Along the same lines, it’s certainly possible to use a paper-based strategy of helping students develop and clarify their thinking on any given computer programming topic.

A Paper-Based Parsons Problem in the Classroom

In an introductory computer science course taught using Python, students had recently learned about functions, and had had the chance to learn how to use functions in several different contexts. Students were paired randomly and given a paper copy of the activity here [PDF], and asked to a) arrange the lines of code into strips of paper that they would assemble into a working version of the program, and then b) enter their code into the computer to verify that it works as intended.

"""
quad_functions.py
This program solves quadratic equations using three functions:
* one function to get the coefficients a, b, and c
* one function to calculate the two roots, and
* one function to print out the results
@author You
@version 1.0
"""

def get_coeffs():

def get_coeffs(a, b, c):

def calculate_roots(a,b,c):

def main():

def calculate_roots():

def display_solutions(root1, root2):

def display_solutions():

main()

a, b, c = get_coeffs()

root1 = (-b + (b * b - 4 * a * c) ** (1/2)) / (2 * a)

root2 = (-b - (b * b - 4 * a * c) ** (1/2)) / (2 * a)

x, y, z = get_coeffs(a, b, c)

display_solutions(r1, r2)

return root1, root2

display_solutions()

display_solutions(a, b, c)

print(root1, root2)

return a, b, c

print("The solutions are: ")

a = eval(input("Enter coefficient a: "))

b = eval(input("Enter coefficient b: "))

c = eval(input("Enter coefficient c: "))

r1, r2 = calculate_roots()

a, b, c = get_coeffs()

r1, r2 = calculate_roots(a, b, c)

if __name__ == "__main__":

#!/usr/bin/env python3

Observations

Students took the assignment seriously, and seemed to appreciate the nature of the puzzle, and the fact that all of the information was available to them—they just had to (literally) put the pieces together. There were some lively discussions—”Do we need a function header with parameters or not? Do we need the function to return a value or not?”—as well as a desire to get done with the puzzle-solving as quickly as possible in order to move onto entering the code into the computer to test their program.

For a larger assignment or project with many variations, the Parsons approach is not well-suited: there are too many variations that need to be considered. For students just learning to master a new topic, however—functions, conditionals, while-loops, for-loops, etc—the Parsons Problem strategy is a great way to build students’ skills and confidence in programming.

References

Paul Denny, Andrew Luxton-Reilly, and Beth Simon. 2008. Evaluating a new exam question: Parsons problems. In Proceedings of the Fourth international Workshop on Computing Education Research (ICER ’08). ACM, New York, NY, USA, 113-124.

Dale Parsons and Patricia Haden. 2006. Parson’s programming puzzles: a fun and effective learning tool for first programming courses. In Proceedings of the 8th Australasian Conference on Computing Education – Volume 52 (ACE ’06), Denise Tolhurst and Samuel Mann (Eds.), Vol. 52. Australian Computer Society, Inc., Darlinghurst, Australia, Australia, 157-163.

Demo: Encapsulation

The idea of encapsulation is fundamental to computers in a number of ways. Generally speaking, “encapsulation” refers to the idea of building a container around something, as if that thing were contained in a capsule. When it comes to computers, there are a couple of slightly different ways the term might be used.

Hiding code in a class, function, or library

Commonly in computer programming, encapsulation refers to the idea of hiding away the details of code. For example, you may write a bit of Python code that takes three coefficients for a quadratic equation a, b, and c, and calculates the real roots (solutions) of that equation:

a = 2
b = 4
c = -5
root1 = (-b + ((b * b) - (4 * a * c)) ** (1 / 2)) / (2 * a)
root2 = (-b - ((b * b) - (4 * a * c)) ** (1 / 2)) / (2 * a)

If you were having to write lots of programs to calculate quadratic roots, or if you wanted to be able to use those lines of code other places, you might very well write them into a small function or method called something like quadratic_solver that you could use in lots of different places. You might call that function like this:

roots = quadratic_solver(2, 4, -5)

In this single line of code, the messy details of multiplying, dividing, and square-rooting have all been hidden away from the main program. The details of that calculation have been “encapsulated” in the function.

Any time you import a library into your program–import java.util.Scanner; in Java, for example, or import random in Python–you are bringing in complicated bits of code that will be available for you to use without having to worry about some of the arcane, or mundane, or complex details that are contained in that code. The concept of encapsulation is extraordinarily powerful.

Programming languages: Machine code, Assembly, High-level

A second way of considering encapsulation is less obvious, but one that we use all the time.

High-level languages

You have almost certainly seen computer programs written in some “high-level” language like Python or Java. These languages are called high-level because they, for the most part, consists of syntax that might be recognized and understood.

Here’s a program that’s written in C, which adds up the numbers from 0 to 255 and prints out the result:

# include 

int main(void)
{
    int x, sum;
    sum = 0;
    x = 1;
    while (x < 256)
    {
        printf("%d ",x);
        sum = sum + x;
        x = x + 1;
    }
    printf("\nSum = %d\n", sum);
}

You may not understand everything in this program, but it certainly has a few English words in it, and even a programmer who doesn’t know C might be able to work their way through this program to identify how it works.

We have a serious problem, however. You may have heard that computers don’t understand English: they only work in binary digits, or “bits,” the zeroes and ones that are represented by a billion switches being turned “off” or “on.”

So how does the computer run this program?

It doesn’t. But there is another program on the computer–a compiler–that is able to take this program and convert it to something called Assembly Language.

Assembly Language

In Apple’s macOS, if you have the Developer Tools installed, you can use the gcc compiler in the Terminal to output a compiled version of the program.

$ gcc -o sum sum.c

What does this new version of the program look like? We can see the Assembly Language version by using the otool program:

$ otool -tv sum
sum:
(__TEXT,__text) section
_main:
0000000100000f10 pushq %rbp
0000000100000f11 movq %rsp, %rbp
0000000100000f14 subq $0x20, %rsp
0000000100000f18 movl $0x0, -0x4(%rbp)
0000000100000f1f movl $0x0, -0xc(%rbp)
0000000100000f26 movl $0x1, -0x8(%rbp)
0000000100000f2d cmpl $0x100, -0x8(%rbp)
0000000100000f34 jge 0x100000f65
0000000100000f3a leaq 0x65(%rip), %rdi
0000000100000f41 movl -0x8(%rbp), %esi
0000000100000f44 movb $0x0, %al
0000000100000f46 callq 0x100000f84
0000000100000f4b movl -0xc(%rbp), %esi
0000000100000f4e addl -0x8(%rbp), %esi
0000000100000f51 movl %esi, -0xc(%rbp)
0000000100000f54 movl -0x8(%rbp), %esi
0000000100000f57 addl $0x1, %esi
0000000100000f5a movl %esi, -0x8(%rbp)
0000000100000f5d movl %eax, -0x10(%rbp)
0000000100000f60 jmp 0x100000f2d
0000000100000f65 leaq 0x3e(%rip), %rdi
0000000100000f6c movl -0xc(%rbp), %esi
0000000100000f6f movb $0x0, %al
0000000100000f71 callq 0x100000f84
0000000100000f76 movl -0x4(%rbp), %esi
0000000100000f79 movl %eax, -0x14(%rbp)
0000000100000f7c movl %esi, %eax
0000000100000f7e addq $0x20, %rsp
0000000100000f82 popq %rbp
0000000100000f83 retq

This version of the program contains a series of commands–push, move, jump, add, call, pop, return–that manage the data in the program, addresses in memory (listed along the left side), and registers (like %esi). Some people program in assembly language, but you can see that it’s a much more complicated affair. The process of storing the value 1 in the variable x is, in assembly language

movl $0x1, -0x8(%rbp)

We can say that the assembly language instructions are “encapsulated,” or hidden away, so that we don’t have to worry about those implementation details. We can write our high-level code, and rest assured that the compilation process will take care of the dirty work for us.

Of course, we still haven’t gotten down to the 0s and 1s that the computer needs to run a program. Let’s go one step farther down.

Machine Language

In the process of compiling, we actually created a binary version of the program, with nothing but 0s and 1s. We can use the xxd program in the terminal to view that code:

$ xxd -b sum | cut -c 11-64
11001111 11111010 11101101 11111110 00000111 00000000
00000000 00000001 00000011 00000000 00000000 10000000
00000010 00000000 00000000 00000000 00001111 00000000
00000000 00000000 10110000 00000100 00000000 00000000
10000101 00000000 00100000 00000000 00000000 00000000
00000000 00000000 00011001 00000000 00000000 00000000
01001000 00000000 00000000 00000000 01011111 01011111
01010000 01000001 01000111 01000101 01011010 01000101
01010010 01001111 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000001 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00011001 00000000 00000000 00000000
11011000 00000001 00000000 00000000 01011111 01011111
01010100 01000101 01011000 01010100 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000001 00000000 00000000 00000000 00000000 00010000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00000000 00000000 00000000
00000000 00000000 00000000 00010000 00000000 00000000
00000000 00000000 00000000 00000000 00000111 00000000
00000000 00000000 00000101 00000000 00000000 00000000
00000101 00000000 00000000 00000000 00000000 00000000
00000000 00000000 01011111 01011111 01110100 01100101
01111000 01110100 00000000 00000000 00000000 00000000
.
.
.

It is this code–these 1s and 0s–encapsulated several layers below our original version, that the computer uses to run the program.

These 0s and 1s are used to operate the digital hardware, the memory locations and the logic gates, that produce a given output. In fact, before we had keyboards, mice, and monitors, the personal computer was simply a set of switches with lights above them. Computer code was entered using the individual switches–a long, painful, error-prone process–and output was read from the computer as a series of flashing lights.

Here’s a programmer entering a program by hand onto such a machine. The resulting program displays (in binary, of course!) the prime numbers between 2 and 255.

Fortunately, we don’t have to enter binary logic instructions by hand. Those codes are encapsulated well beneath our high-level languages.

Demo: Binary Numbers

If you teach Computer Science, chances are that learning about the binary numbering system is part of the curriculum at some point.

Why teach binary?

Some people question whether or not binary numbers should be part of a high-level curriculum, given the multiple layers of abstraction between, say, a webpage and the binary code that brings that page to life. I’d suggest that:

  1. Those multiple layers of abstraction / encapsulation are very much a part of computer science, and a perfect jumping off point for a conversation about binary numbers.
  2. Students should understand that binary numbers are at the heart of every computer. A great video for demonstrating how people used to have to program computers is this one, demonstrating the programming of an old 8080 microcomputer. Follow that up with a demo of high-level / assembly / binary version of a program, described here.
  3. Learning how to decipher a binary number is not that difficult, and provides students with a manageable gateway activity to the field of computer science.

Demonstration strategies

Binary numbers can certainly be displayed on a computer monitor or projected in front of the class. An interactive Python session works just fine:

>>> bin(13)
'0b1101'
>>> print(bin(13))
0b1101

A more visible and physical demonstration of binary numbers can easily be constructed using an outlet power strip, socket adapters, and low-wattage aquarium light bulbs (see parts list below).

This device can be easily manipulated at the front of the room, with individual bulbs easily turned on or off simply by screwing them in tightly (on), or unscrewing them slightly (off). Students can be asked to identify the decimal equivalent of a binary number, or asked to manipulate the bulbs themselves to produce the binary equivalent of a decimal number.

Conclusion

This inexpensive and physical, practical demonstration device can be used in the classroom, with parents, during open house events, etc. It has become a mainstay of every CS course I teach.

Parts List

Update your Creative Process

In early 2001, in press releases and ads, Apple encouraged its customers to Rip. Mix. Burn. their music on an iMac.

It was an audacious advertising campaign given that the recording industry was in the midst of grappling with the rampaging growth of digitally copied media via Napster, LimeWire, and others. The Mac would soon leverage its position as a media hub with the release of the iPod later that same year. The process of assembling a “mix tape” of songs for a friend would never be the same again… although that process has since disappeared completely. Because everybody just streams now.

This post isn’t about that, though.

If taking prerecorded media and putting it together into a custom mix was the “old creativity,” it didn’t take much in the way of actual… you know, creativity. Assembling and ordering someone else’s music is fine, but… it’s a stretch to call it creative.

Welcome to the new creative. “Rip. Mix. Burn.” has evolved.

Fork. Commit. Push.

That’s right, I’m talking about using GitHub to fork a project, make changes that you commit to your fork, and then push those changes back to the master. If you know about GitHub, this all makes perfect sense, and is absolutely reflective of a creative process happening.

And if you don’t know about GitHub? Well… you need to get on it!

More to come…

Pair Programming

As a Science teacher I am well-acquainted with the idea of students working as partners in a lab setting. It’s a time-honored practice based on a variety of rationales, depending on the setting. Lab partners, or indeed partners in any academic setting, might be placed together for logistical reasons: there may be multiple responsibilities that need to be shared, there may be limited equipment, limited lab supplies, limited computers, or limited space. There may be pedagogical reasons as well: students can assist each other in learning material, or learning to work together may even be the goal of the lesson.

In computer programming classes, “pair programming” may be used, with one student typically “driving” (entering code on the computer), and another “navigating” (dictating code, catching typos, etc.) There are variations on the specific responsibilities of each role, but the general idea is that two heads are better than one, and that an ongoing conversation as the code is developed will produce a stronger product. Pair Programming isn’t just for classes–it’s actually used in the software industry by some organizations.

Regardless of the context, there are bound to be challenges when two people are asked to work together in a demanding situation. One common challenge is when two students have varying abilities or levels of success. Sometimes teachers will even pair students with this in mind, either placing students of similar level with each other, or pairing a successful student with a challenged student with the hope of fostering some impromptu peer tutoring. (I’d suggest that there are issues with both of these strategies, but we’ll leave that for another time.)

In my courses I’ve developed a Pairing Strategy that seems to be working well for my students based on the success I’ve seen in their assignments and their behaviors in the classroom. It works like this:

1. Introduce the idea of Paired Work.
Discuss the benefits and talk about the challenges. Mention the fact that there may be different roles to be played, and that those roles will likely change over the course of the experience.

2. Discuss behavior.
Point out that people need to be on their best behavior when working as a pair. Respect is an important part of this process, and that includes during that first moment when you learn who you’re going to be working with. A loud cry of “Oh, man, I got stuck with Christine??!” doesn’t get you off to a great start, and celebrating that you got paired with the person with the highest test average isn’t appropriate either.

Code.org’s video on Pair Programming, while a bit cheesy and clearly intended for a more Middle School audience, pretty much nails it.

3. Explain the Pairing process.
Very often I’ll use this computer program to pair students randomly. They’ve come to appreciate the excitement of finding out who they’re going to be working with.

In the case of Pair Programming, I’ll be very specific. Just before running the program so that students can see the results on the overhead projector, I’ll say that the partner listed on the left side of list will be the first “driver,” and that students will be using that person’s computer for the project. The person listed on the right side of the list will be the navigator, and will get up and move over to where the driver is sitting to get started.

#!/usr/bin/env python3

"""
random_partners.py
This program takes a list of students in the class and assigns them randomly
to a series of groups of a specified size.
@author Richard White
@version 2018-10-10
"""

import random,os

def main():
    all_students = ["Kareem","Lucas","Marcela","Dylan","Gwen","Ella","Adam","Carrie","Patty","Annie","Audrey","Aidin","Sinjin","Henry","Robby","Sean","Ms. Dunham"]
    students_present = ["Kareem","Lucas","Marcela","Dylan","Gwen","Ella","Adam","Carrie","Patty","Annie","Audrey","Aidin","Sinjin","Henry","Robby","Sean","Ms. Dunham"]
    os.system("clear")
    groupsize = eval(input("Enter # of people in a group: "))
    os.system("clear")
    i = 0
    print("PARTNERS:")
    while len(students_present) > 0:
        if i > 0 and i % groupsize != 0:        # Print commas after first one in group, 
            print(", ", end='')                 # but not if done with group
        random_student = random.choice(students_present)    # Pick random student
        print(random_student,end='')
        students_present.remove(random_student)             # Remove name from list
        i += 1
        if i % groupsize == 0:
            print()             # Space down at end of members
    print()

if __name__ == "__main__":
    main()

4. Run the program
Here’s a sample run from running this program in my Introductory Computer Science course:

PARTNERS:
Robby, Adam
Kareem, Aidin
Ella, Annie
Henry, Patty
Gwen, Ms. Dunham
Lucas, Carrie
Dylan, Audrey
Sean, Sinjin
Marcela

5. At an opportune time, have students exchange roles.
During every assignment, assuming I’ve done a good job of building in an unexpected challenge or new idea, I’ll ask for attention: “Hands off the keyboard!” or something similar. I’ll pose a question regarding the work that they’ve done, or share some observations I’ve made, or ask if anyone has come across the difficulty that I’ll expect they’re going to have. After this brief interruption, I’ll ask them to change roles and continue their work.

Sometimes the process doesn’t work quite right the first time, or there may be mid-course corrections required if students get a little sloppy in their treatment of each other. That can happen in any classroom environment. The fact that students are truly randomly assigned, however, seems to keep them on their best behavior. They know that I don’t have any intentions in assigning them to a given partner–this is just who they’re going to be working with today.

Here’s a video clip of my students working on a programming assignment in a Paired environment.

Overall, I’ve been very pleased with how this process has worked with my students over time. Give it a try in your classroom and see what you think!

Expectation and Perfection

“It’s getting better all the time…”
– The Beatles

As the new school year begins my classes are filled again with students, all of them wanting to learn, to improve their understanding of the world, and to develop their skills in a wide variety of areas, from writing essays to shooting free throws to writing computer programs to understanding human history.

Some of them, as part of their desire to improve, also wish to be “the best”in one or more of these areas.

Just to be clear, that’s not something that you get to be, and it’s not healthy to have such a notion even on your radar.

Of course it is *technically* possible to be “the best” at some arbitrarily-defined objective, in some subset of the population. I might be the best physics person in my household, for example, or my friend might be the best miniature golf player.

Running

There is a student I have worked with who is the fastest cross-country runner our school has ever had, and he has certainly developed some of his skills in healthy competition with other students. He continues to develop as a runner in college now, but he doesn’t have any expectation that he’s going to someday be the fastest cross-country runner *in the world*. The pursuit of such a goal would be, for him, distracting from the other opportunities he has in his life, and ultimately fruitless.

Climbing

In an interesting subculture of rock-climbing called “bouldering,” short climbs of subjective difficulty on a natural crag of rock or in a climbing gym are attempted by climbers wishing to improve their skills. A rating system grades these climbs–these “problems”–by difficulty from VB (a very easy climb, equivalent to scaling a ladder almost) to V0, V1, V2, and so on, up to (currently) V15, a problem so challenging that only a very few are able to pull them off after repeated attempts.

One of the wonderful things about bouldering is that there is naturally a focus on improving one’s skill level–“I just succeeded on a V3, I wonder if I can do a V4?”–in a supportive environment, with other climbers offering words of encouragement and, in some cases, spotting the climber to offer safety in the event of a fall. If there’s any competition, it’s a friendly one, perhaps to be the first to accomplish a given problem. There’s not much room for the idea of being “the best” when there’s a problem one crag over that’s twice as hard as what you’ve just completed.

Musicians

The same goes for musicians learning a piece of music. Most of the musicians I know, especially the very good ones, are very humble. They work hard to improve their improvisation, or their performance of a piece of classical music… but “mastery” of performance isn’t possible. No one says “I’ve mastered Beethoven’s ‘Moonlight Sonata’.”

Physics

In my teaching I have the pleasure of teaching physics to very bright students, it’s my role to offer them a sequence of problems which present them with increasingly difficult challenges of their understanding of physics principles. Students who recognize that they have started along a path towards a greater comprehension are able to approach their learning with a more relaxed attitude, and seem to be more receptive to the inevitable setbacks that are a normal part of that process.

One of my students, after getting what she felt was a disappointing score on a physics test, went home to tell her father about it, hoping to get a little sympathy from him. His support, however, wasn’t what she expected. Upon hearing the news he just smiled, put an arm around her, and said, “Now you know you’re studying *real* physics!” He was an engineer, and all too familiar with the struggle that comes with making progress in any challenging endeavor.

Some students don’t yet understand

The whole idea of “life-long learning”—which every teacher I know has whole-heartedly acknowledged and embraced—is not something that some students have internalized yet. But it’s true, and it’s something that high-school students seem to sometimes struggle with, and the brighter the student, the greater the struggle. Accustomed to lapping up the easier challenges of the Lower and Middle School year, an Upper School student may be faced with something that is truly beyond their quick-and-easy mastery for the very first time. It’s a great opportunity for students to come face-to-face with the academic (and personal?) challenges that they will encounter throughout the rest of their lives.

Helping to manage their expectations at these moments is an important part of our teaching job.

“The Pressure”

I was experiencing some academic challenges of my own at one point in my education, and I’d decided to take a little time off from college. My parents, understanding and taking this as a teaching moment, gathered me and my three younger brothers around to make sure that we understood the situation. “We want you all to know,” my father said, “that we don’t necessarily expect that you’re all going to become doctors, or lawyers, or anything else. We just want you to do the best that you can do.”

The three oldest brothers all visible relaxed at this good news. The youngest, Stephen, however, looked grim. “‘The best that I can do?’,” he said to my father. “Boy, you guys really know how to put on the pressure!”

Just do the best that you can do.

No pressure.

Sherlocked!

Well, I suppose it had to happen sooner or later…

I’ve been Sherlocked.

If you’re not familiar with the term “sherlocked,” it comes to us courtesy of Apple, which back in the day offered a file search capability on its OS called “Sherlock.” The original feature set of that capability was expanded upon by a third-party developer who crated a software tool “Watson” that served as a companion to Sherlock, with the ability to search the Internet, perform calculations, look up references, etc. It was such a useful tool that Apple, in a subsequent release of the OS, incorporated almost all of those same features into their software. The developer was no longer able to make any money off the software he had developed–he had been “Sherlocked.”

This wan’t the first time that such a thing had happened. The first case of this happening that I’m aware of is back in the early Macintosh days (System 7), when Steve Christensen’s SuperClock! utility was written to allow the computer to display the time in the upper corner of the screen. This eminently useful feature was incorporated into System 7.5, along with a number of other features adapted / adopted/ stolen from other software developers. A lot of people view this as simply the cost of doing business with a large, powerful organization, but it seems like a bitter pill for a hard-working developer to have to swallow.

You can learn more about the process of being Sherlocked by Apple at:

What does this have to do with me?

A couple of days ago, I received an email from the College Board announcing some new features that were being added to the College Board website.

That “Question Bank” that supports students with 15,000 on-demand questions? That’s my idea! That’s exactly what the learnapphysics.com website has been doing for the last ten years.

Okay, to be fair, people have been publishing banks of test questions for years, and the SAT “Question of the Day” was a thing that I took as inspiration for my website, so… I can’t complain too loudly here. In fact, I’m not complaining at all. I’m glad that the College Board has caught on to the idea that there are lots of ways that they can support students taking their courses.

But if anybody asks, I’m going to come right out and say it: “Yeah. I got Sherlocked by the College Board.”