Monday, January 12, 2015

Cambell's Law

I've had a gut feeling that the data driven decision making that has become the mantra guiding our educational practice in US schools these days is actually harmful to students and education.  I can sense that the problem is related in some way to the erroneous assumption that you can separate the observer from the observed - that the educational system can both gather data on itself and use this data to effectively improve its own practice.

In the case of a political, bureaucratic system like a public school system, relying on data points to determine the effectiveness of our efforts, and then doling out rewards and punishments based on these data points guarantees that it is the data points that will soon take on primary value, regardless of what they actually mean regarding student growth and development.

It is with great delight that I came across this entry on Wikipedia on Cambell's law.  I take comfort in finding a statement by a well known and respected personage of what I was trying to say stated much better than I could say it:
The more any quantitative social indicator is used for social decision-making, the more subject it will be to corruption pressures and the more apt it will be to distort and corrupt the social processes it is intended to monitor.
Donald T. Cambell

Wednesday, January 7, 2015

Apache Cordova Development Environment Setup on Ubuntu 14.04

This is my "Happy New Year" post.  I had a goal over Winter break to find a process my students could use to setup an Apache Cordova development environment on their Ubuntu 14.04 laptops (I'm actually using Peppermint OS 5, which is a great light weight version of Ubuntu 14.04).

After several days of false starts and dead ends, I finally came up with something that works. I never succeeded in getting an Ubuntu environment working, and decided to give up on that for now until things settle down and the Ubuntu development team makes the process easier for beginners.  Firefox OS was wonderfully simple, and will definitely be my preferred choice of target system when introducing this to my students.  Android was only a bit more troublesome, since it involved the dreaded Oracle Java, but thankfully Cordova will shield us from having to deal with that directly once we have it setup.

Setup for Building Firefox OS Apps


Install Apache Cordova CLI And Create Hello App

$ sudo apt-add-repository -y ppa:cordova-ubuntu/ppa
$ sudo apt-get update
$ sudo apt-get install cordova-cli
Everything else we need to develop for Firefox OS is now built into the browser (how cool is that!? ;-) To make and run the Hello App, choose a good location for the project code, and:
$ cordova create hello
$ cd hello
$ cordova platform add firefoxos
$ cordova build
That's all there is to building the app for Firefox OS.  We now have a ./platforms/firefoxos/www directory that contains our app.  What we need now is an emulator to run it on.  The latest Firefox makes this a snap:
  • Open WebIDE in Firefox by pressing Shift+F8.
  •  Click Select Runtime and select Install Simulator, then choose a simulator (I choose the latest one marked "stable", 2.0 at the time I'm writing this) and click install.
  • Click Select Runtime again and click on your simulator. An emulator is launched running Firefox OS (if only life could always be this easy! ;-)
  • Back in the WebIDE window, click on Open App, then select Open Packaged App ... and navigate to the./platforms/firefoxos/www directory inside the hello directory and click Open.
  • The previous step will load the source directory into WebIDE.  Click the run button in the top center of the WebIDE window (it is a triangle next to a square), and we are rewarded with a running app.

Granted, it doesn't do much yet, but this was by far the most pain free process I experienced in my several days of trying to get cordova apps running on emulators.

Setup for Building Android Apps

To build for Android will require dealing with the evil Oracle Java environment and setting up the Android SDK, but the fine folks at the webupd8team and ubuntu-desktop teams have made this easy to do, and cordova will then permit us to develop with HTML, CSS and JavaScript and take care of the rest for us:

Install the Oracle Java 7 JDK 

$ sudo add-apt-repository -y ppa:webupd8team/java 
$ sudo apt-get update 
$ sudo apt-get install oracle-java7-installer oracle-java7-set-default

Install Ubuntu Make 

$ sudo add-apt-repository -y ppa:ubuntu-desktop/ubuntu-make 
$ sudo apt-get update 
$ sudo apt-get install ubuntu-make ant

Install Android Studio and SDK

  • $ umake android
  • Choose the installation path (I choose /home/<username>/.local/tools/android/android-studio to keep things from cluttering my home directory).
  • [I Accept (a)/I don't accept (N)] a
  • Wait while Android Studio downloads and installs… Installation done
  • Start Android Studio from menu (Programming -> Android Studio on Peppermint or use the Dash on regular Ubuntu).
  • [I do not have previous version…] OK [Setup Wizard - Welcome] Next [Custom] Next
  • Android SDK Location: /home/<username>/.local/android/sdk (again, I put things in .local to avoid clutter).
  • Next [Accept] Finish … Long wait while everything installs … Finish
  • Create a .bashrc file (or add to the one you already have) with the following: 

  • Start the Android SDK Manager with $ android
  • Select Android 4.4.2 (API 19) and click Install 16 packages… [Accept License] Install
We now have the Android development environment setup.  Cordova CLI integrates nicely with this.  All we need to do to add Android as a target platform for our Hello App is to run the following from inside our hello directory:
$ cordova platform add android
$ cordova build
$ cordova run android

Developing for mobile platforms is becoming a compelling thing for me to do as an IT/CS teacher to maintain student interest in learning.  Cordova makes it possible to use the tools we have already been learning, HTML, CSS and JavaScript, to start working on mobile platforms.

Next: Find good tutorials for learning cordova.

Sunday, October 5, 2014

Server Side Includes

I have a fantastic group of students in my afternoon Advanced Topics in Information Technology class this year.  Its been a long time since I've had a group with this level of skill, self-motivation, and interest.  It is going to be a fun year!

Two students are studying web page design.  They have already completed both the GDW HTML and GDW CSS tutorials, and now they are working on projects to apply what they have learned to their own website.  One of the two students, Jack, has been working on a menu bar that highlights the current page using CSS.  This led us to a discussion of the need to be able to dynamically include standard parts your website (headers, footers, etc.) across multiple pages, so that changes to these cross page components can be made in only one place. This was a great time to introduce the DRY principal in software development.

Another student in the class, Sam, who is studying The C Programming Language this semester, is also interested in system administration, and on overhearing Jack and me discussing the problem, pointed out Server Side Includes to us. I'm surprised that I've never heard of this technology before, since it provides just the kind of solution I'm looking for in terms of motivating a deeper understanding of web technologies step-by-step.  I don't want to jump into a Python web framework (even a micro framework like bottle) at this point.  I'm not a fan of PHP, though I realize that it is not a bad fit for what I'm looking for. SSI looks to be better.

Sam volunteered to explore setting up and documenting SSI.  I told him to setup an Ubuntu server with VirtualBox.  He will be delayed in doing that because he only has 32 bit Ubuntu on his laptop, so while we wait for Sam to reinstall with 64 bit Ubuntu this weekend, I decided to go ahead and document as much of this process as I could.

Setting Up Ubuntu Server in VirtualBox

Here is a screen shot showing the first stage of the Ubuntu server setup using VirtualBox:

I used 1 Gig of RAM and a 20 Gig virtual hard drive (the first option in the menu of virtual hard drive choices, VDI). I then changed the network setting to use a "Bridged Adapter", which gives the virtual machine its own network address on the host network, instead of putting it behind NAT on a 10.x.x.x. network. This makes it easy for me to ssh into the virtual server from my desktop, and for others (students, say, in a classroom setting), to ssh into it from their machines.

During the installation of Ubuntu Server, the only software package option I picked was "Open SSH Server".  I plan to install everything else I want piece by piece.

The next task is to install apache on the server:
$ sudo aptitude install apache2
As soon as that completes, I can point the browser from my desktop at the IP address of the server running inside a virtual machine that it is hosting (I don't care how many times I've done this, I always think it is cool! ;-)

My host machine (desktop) in this case has IP address, and the server running inside the virtualbox has IP address, so my the browser running on my desktop is connecting to the web server running on the virtual machine.

Enabling SSI

Now to get server side includes working, I followed Sam's instructions:
# a2enmod userdir
# a2enmod include
# vi /etc/apache2/mods-availiable/userdir.conf
   change "IncludesNoExec" to "Includes"
# vi /etc/apache2/mods-available/dir.conf
   add "index.shtml" (immediately after "DirectoryIndex"
     and before "index.html")
# service apache2 restart
We now have user local directories and SSI enabled (we hope ;-).  Let's try it out. I created a public_html subdirectory in my home directory, and put two files in it, index.shtml:
<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<title>SSI Test Page</title>
<h1>SSI Test Page</h1>

<!--#include file="" -->

If you are reading this message, SSI is working... Yeah!
Now I point my web browser at: and:

One last thing to note is that the SSI_PSPserver.vdi virtual hard drive file can easily be copied from machine to machine, bringing all the setup with it.

I talked to Sam about what my educational motivation was for wanting to use SSI.  He quoted Nietzsche on his blog post for that day to let me know he totally understood what I was getting at:
"He who would learn to fly one day must first learn to stand and walk and run and climb and dance; one cannot fly into flying."
-Friedrich Nietzsche
I'll say it again, this is going to be a fun year!

Tuesday, May 6, 2014

Python 3 Django 1.7 on Ubuntu 14.04 - Day 1

It's time to dive into learning Django.  I've been waiting until I could use Django with Python 3, and that time has now come. I'll be working on Ubuntu 14.04.  There is no python3-django package yet, so I'll give pip a try.  I also want to start with Django 1.7, so that I can learn the new built-in migrations instead of using South to update the data model.

Here is what I did to get started:
  • $ sudo aptitude install python3-pip
  • $ pip3 install --user
This created .local/lib/python3.4/site-packages and .local/bin directories in my $HOME and installed the Django egg in the .local site-packages directory and django-admin and in the .local/bin directory (see PEP 370).

Next I did:
  • $ python3
  • >>> import django
  • >>> print(django.get_version())
When the last statement returned 1.7b3 I knew I was in business. Trying to run django-admin, I realized that .local/bin was not in my PATH, so I added the following to the bottom of my .bashrc file:


export PATH

I also added the following to my .bash_aliases:

alias python='python3'

since Python 3 is what I use all the time now.

Starting a Django Project 

  • $ django-admin startproject checkitout
  • $ cd checkitout 
  • $ python3 runserver
Running this last step created a db.sqlite3 file in the checkitout directory - something new in Django 1.7 I believe.

At this point I created a bzr repository of this so that each step in the process from here on out can be easily rewound.  Each of these commands were run inside the top level checkitout directory:
  • bzr init
  • bzr add *
  • bzr ci -m "initial commit"
Next I setup a project on launchpad:, and pushed up the initial commit:
  • bzr push lp:~jelkner/checkitout/trunk

Next Steps

  • $ django-admin startapp cioapp
  • edit cioapp/
  • bzr add *
  • bzr ci -m "added app and first models"
  • bzr push lp:checkitout
  • edit checkitout/ and added cioapp to INSTALLED_APPS
  • edit cioapp/ and import and register models
  •  python3 migrate
This created the database tables and setup a superuser. I started the server again with:
  •  $ python3 runserver
pointed my browser at localhost:8080/admin and was able to login and see the tables. This brought me back to the point where my Django tutor, Chris Hedrick, left me off this afternoon, only now I've got Django 1.7 instead of the 1.6 we used earlier and I ran migrate instead of the syncdb from South. I'll finish by checking these last changes in, but I wonder what needs to get ignored by bzr to keep the database superuser info from being part of the repo? I'll have to start by asking Chris that tomorrow. A fine and productive day!

Wednesday, April 30, 2014

End of Course Reflection

Throughout my Higher Education in the Digital Age course I have maintained that a useful evaluation of the role technology plays in higher education can not be removed from the broader social and political context in which the technology is used. Without critical evaluation of the goals behind introducing any new technology into what we call "Higher Ed", no meaningful conclusions can be drawn as to the new technology's effectiveness and social impact.  At its root, this is a discussion about what role higher education plays in our society.  Who is it for and what are its aims? I see two contrasting goals for higher education with very different uses for new technologies associated with each.  In one view, associated with quest for a more egalitarian society with a broader and deeper role for democratic participation of its members, the World Wide Web offers a promise of greatly expanded access to information, communication, and participation.  In an opposing view, the new technologies will be used as a weapon by the Corporatocracy for increased social control and enforcement of labor discipline in the service of maximizing corporate profits. The outcome of the struggle between these two positions is no small matter, since only the former offers humanity a way out of the self-destructive morass in which it finds itself in the 21st century.

A dear friend of mine from Porto Alegre, who is involved in progressive politics with me, related recently what brought her "into the struggle".  In Brazil the national public universities are free.  Students who attend them don't pay tuition, but entrance into the universities requires scoring high on a competitive entrance exam.  In practice, this means the available seats in the public universities are mostly taken up by the well-to-do, who have the resources to out compete their lower income compatriots in preparing for the exam.  This leads to the ironic situation where the free, public, and highest quality opportunities for higher education go to the rich, while the poor are limited to paying for private, lower quality education.  When my friend was in high school, Porto Alegre was engaged in pioneering a wonderful new "technology" - a participatory budgeting process through which the members of her community worked to create a new, public university that was specifically targetted at and open to local community folks with limited access to financial resources.  My friend attended this new unversity and became active in the struggle to defend it from continual right wing attack.  The new technology in this story, the participatory budgeting process, has since been taken away from the citizens of Porto Alegre, but the educational institution that it birthed is still in existance and still serving those who would not otherwise be served.

So, what about the many new technologies we studied this semester -- the moocs, games, social networking apps, etc.?  Which of the two futures for higher education do they serve? While I optimistically like to imagine that the massive peer-to-peer communication enabled by the Internet points toward participation and democracy, nothing inherent in any of the new tech tools leads inevitably that way.  Instead, it will depend on the outcomes of the struggles for social control of our collective future, and whether the decisions about that future are going to be made by the many or the few.

Tuesday, April 22, 2014

Khan Academy Promotes Women in Computer Programming

I have been using Khan Academy with my math students with limited success for the past three years.  The videos on Khan Academy are not useful with my English language learner (ELL) students, and the frequent inclusion of word problems in the practice exercises is likewise inappropriate for my students. So while I saw promise in Khan Academy and was delighted that the materials on it were free to use and modify in an educational setting, I did not think it appropriate to use extensively in my classroom.

All that changed on March 18, 2014, when I received an email from Khan Academy that began with the following:
Dear jeff.elkner,

Did you know that just 18% of computer science college graduates are women? That's crazy when you consider that by 2020, the demand for graduates in computer science will be double the available workforce.

But together we can introduce all our students to coding and ensure that female students don't get left behind.

Thanks to Google, U.S. public high school teachers can now earn over $1,000 in funding when their female students complete our Khan Academy coding lesson.
For every female U.S. public high school student that completes the tutorial, will send you a $100 giftcode for your classroom. As an extra bonus, they’ll also send you a $500 gift code when four of them are done!
Excited by the generous offer, I logged into Khan Academy to explore the new curriculum (Intro to JS, 2014). I found a new introductory programming course that is interactive, visual, and multilingual, available in English, Spanish, and Portuguese. The videos that accompany the tutorial are narrated by young, hip sounding female voices, a plesant change from the old white men that have almost exclusively been the faces of programming education in the past.

I had one student in my afternoon web application development class who was the obvious choice to begin exploring the curriculum, since she was already studying the JavaScript that was the focus of the Khan course.  I wanted to go for the $500 bonus, so I still needed to find three other female students willing to do the course.  Asking around, I found the three students - one independent study student, one student aid, and one geometry student willing to come in during lunch to work on the curriculum.

This afternoon, Mayra, the web development student, will complete the curriculum. Yanina and Daniela, the independent study student and student aid, are working together each day as they make their way forward. They are each about half way finished. Carmen, my geometry student, will take longer, since she doesn't have regular class time to work on it.

I've been watching the conversations, and laughs (like when Daniela used JavaScript to put a cat on her plate for breakfast) that Yanina and Daniela have each day as the work through the material.  It is apparent they are enjoying it, and from the quality of the questions they ask me I can tell they are learning. Daniela and Carmen are doing the course in Spanish.  Without this language support, they would not be able to complete it.

Well aware of the disparity between male and female students in computer programming, I've made conscious effort to take affirmative action to get more women into our web development program.  This has resulted in some success, with a dual-enrolled college program the Summer before last with half female students. Last Summer, with less sustained effort, the percentage of women in the Summer program dropped. The difficulties women have in getting into this field are well documented (Margolis, J., & Fisher, A., 2002), and I am committed to doing whatever I can to help make my computer programming classes available and welcoming to underrepresented students.

It is great to see Khan Academy developing what appears to me to be a very successful strategy to begin addressing the issue head on. Our school will now have a group of four female students who have been made to feel special because they introduced themselves to computer programming.  The are quick becoming a "team", sharing stories and supporting each other in learning. I am truly grateful to Khan Academy for making this happen!


Intro to JS: Drawing & Animation. (2014). Khan Academy. Retrieved April 22, 2014, from

Margolis, J., & Fisher, A. (2002). Unlocking the Clubhouse: Women in Computing. Cambridge: MIT Press.

Sunday, April 20, 2014

How to Think Like a Computer Scientist

In this blog post I want to explore the value of sharing educational resources by looking at the continuing benefits each of the contributors to "How to Think Like a Computer Scientist" have received from their efforts.

Fifteen years ago I began work on an open textbook called "How to Think Like a Computer Scientist".  Having worked on Summer curriculum projects in 1993 and 1994 organized by the visionary supervisor of Mathematics in Prince George's County Public Schools, Dr. Martha A. Brown, I had already seen both the power of collaborative educational materials creation as well as the show stopping limitations caused by the inability to effectively reproduce and distribute the end products of such effort. The World Wide Web was just beginning to appear at that time, and I began dreaming of the day when educators would be able to use it to create and share educational resources. The non-hierarchical nature of such collaboration would be liberating, I imagined, freeing the creative spirit within teachers who participated and providing direct educational benefits to the whole world. About 6 years later I had the opportunity to test this idea in practice, and now about 15 years after that I can look back and describe how it worked. 

I've just returned from Pycon 2014, the 12th annual community sponsored conference of the international Python community.  I attended the the 2nd annual education summit this year, and inspired by both the summit and the graduate class I'm taking this semester, I spent some time online researching the availability of open textbooks and other open educational resources, which appear to be proliferating at a sizable rate of late (Open educational resources, n.d.). 

While poking around these materials I came across a new interactive version of How to Think Like a Computer Scientist (Miller, B., Ranum, D., Elkner, J., Wentworth, P., Downey, A., & Meyers, C. 2013). I was aware this existed since Brad Miller emailed me when he started working on it back in May of 2011.  Unfortunately, I haven't been teaching Python during the regular school day for the last 5 years, so I didn't have time to get involved with this project, and it slipped from my mind. Rediscovering it now, I was amazed. As the overview page for the tools that Brad and David are developing illustrates, they are extending the document publishing tool we use in the Python community to include sophisticated assessment item types as well as visualization tools (Miller, B., & Ranum, D., 2013). They have packaged their work into a project called The Runestone Interactive Library (2014), and have a collection of books already using their tools. With the prospect of the STEM program for which I changed jobs 5 years ago finally emerging, it is time for me to get back into working on Python resources, and I am delighted to see how much progress has been made developing and enhancing the free tools to do this while I was away.

Looking back, I am struck by how much I have benefited from contributing to How to Think Like a Computer Scientist. I suspect that most of the other contributors would echo this sentiment. Here are some of the different versions of the book together with the people who worked on them:

1998: Original Java version by Allen Downey

1999 - 2002: First edition of the Python version translated from Java to Python by Jeff Elkner.  Professional Python programmer Chris Meyers joined shortly thereafter. Allen published this version of the book through Green Tea Press  (Downey, A., Elkner, J., & Meyer, C., 2002).

2002 - 2012: 2nd edition of the Python version, rewritten to be more "Pythonic" by Jeff and Chris (Elkner, J., Downey, A., & Meyers, C., 2012, April 12).

2012: Prof. Peter Wentworth creates the third edition of the Python book using Python 3.   (Wentworth, P., Elkner, J., Downey, A., & Meyers, C., 2012, October 1). He has since created a version of the text using C#  (Wentworth, P., 2014, March 7).

2013 - Present: Brad Miller and David Ranum create tools to make an interactive version of the book (Miller, B., Ranum, D., Elkner, J., Wentworth, P., Downey, A., & Meyers, C., 2013).

Without Allen Downey's original version of the book using Java, I would not have been able to make the switch to Python in my classroom back in 1999.  Because I did, Allen was introduced to Python (by "reading his own book" as he said in a preface to a later work).  Allen is now a regular author of books published by O'Reilly but still available as free textbooks, including his "Think" series.  Several of the books in this series, including Think Python, Think Complexity, and Think Bayes, use Python. When Peter Wentworth wanted to try Python in 2012, he benefitted by having a free book to start with together with the right to modify it to suit his purposes and the tools to make it easy for him to do this.  When he wanted a C# book a few years later, he could use these same tools and his own early book as a foundation to start from. When Brad Miller and David Ranum wanted to experiment with building new tools to make textbooks more interactive, they were aided by having a free textbook to which they could apply their work.

As I prepare to return to teaching computer programming and start working on a new textbook aimed at aspiring web developers (2014) , I will borrow from and build on the work and ideas of each of the other contributors to this project.  This blog post has actually only scratched the surface of documenting how and where this book has been used. It has been translated into many other languages, both natural and programming.  It has been read by people all over the world. I've received emails from people as far away as Korea telling me how much they appreciate this book being available to them online.  I'm glad for this opportunity to write some of this history down, and wish I had the time to dig further, but it is more important now to get back to work on the book.


Downey, A., Elkner, J., & Meyer, C. (2002). How to think like a computer scientist: learning with Python. Wellsley, Mass.: Green Tea Press.

Elkner, J., Downey, A., & Meyers, C. (2012, April 12). How to Think Like a Computer Scientist: Learning with Python 2nd Edition. Retrieved April 18, 2014, from

Elkner, J. (2014). Beginning Python Programming for Aspiring Web Developers. Retrieved April 18, 2014, from

Miller, B., & Ranum, D. (2013). An Overview of Runestone Interactive. Retrieved April 18, 2014, from

Miller, B., Ranum, D., Elkner, J., Wentworth, P., Downey, A., & Meyers, C. (2013). How to Think like a Computer Scientist: Interactive Edition. Retrieved April 18, 2014, from

Open educational resources. (n.d.). Wikipedia. Retrieved April 18, 2014, from

The Runestone Interactive Library. (2014). Runestone Interactive. Retrieved April 18, 2014, from

Wentworth, P., Elkner, J., Downey, A., & Meyers, C. (2012, October 1). How to Think Like a Computer Scientist: Learning with Python 3. Retrieved April 18, 2014, from

Wentworth, P. (2014, March 7). Think Sharply with C#: How to Think like a Computer Scientist. Retrieved April 18, 2014, from