Saturday, December 29, 2012

I recently installed RhodeCode onto Simpson's server. Awesome program, but setup isn't quite as easy as I'd like. So here are my notes, in case anyone else is interested.
I relied heavily on the following sites for information:
Installation was done on a Debian Wheezy system.
First, become superuser.
sudo bash
Install pre-requisites.
apt-get install python-all-dev python-pip python-mysqldb rabbitmq-server python-virtualenv libmysqlclient-dev
easy_install -U distribute
pip install mysql-python
pip install virtualenv
Set up the message queue system.
rabbitmqctl add_user rhodeuser mypassword
rabbitmqctl add_vhost rhodevhost
rabbitmqctl set_permissions -p rhodevhost rhodeuser ".*" ".*" ".*"
I prefer mysql for the database. Set this up.
mysql -u root -p

create database rhodecode character set utf8; 
create user 'rhodecode'@'localhost' identified by 'mypassword';
grant all privileges on rhodecode.* to 'rhodecode'@'localhost';
flush privileges; 
exit
Create a directory for installation
cd /var
mkdir rhode
chown www-data rhode
cd rhode

virtualenv --no-site-packages /var/rhode/venv
cd /var/rhode/venv/bin
source activate

cd /
pip install pastescript
pip install rhodecode

cd /var/rhode/venv/bin/
wget http://ncu.dl.sourceforge.net/project/mysql-python/mysql-python/1.2.3/MySQL-python-1.2.3.tar.gz
tar -zxf MySQL-python-1.2.3.tar.gz
cd MySQL-python-1.2.3
python setup.py build
cd ..

paster make-config RhodeCode production.ini
Edit production.ini so it looks like this:
vim production.ini
# -----
use_celery = true
# broker.host = localhost
broker.vhost = rhodevhost
broker.port = 5672
broker.user = rhodeuser
broker.password = mypassword

# Find this line and change to:
sqlalchemy.db1.url = mysql://rhodecode:mypassword@localhost/rhodecode
paster setup-rhodecode production.ini --user=rhodeuser --password=mypassword --email=paul@cravenfamily.com --repos=/mnt/hg_repos
/etc/init.d/rabbitmq-server start
See if celery works and hooks up to the message queue. If it does, hit ctrl-c and go to the next step. If it doesn't, debug before continuing.
paster celeryd production.ini
Start running. Then see if it works.
paster celeryd production.ini &
paster serve production.ini
I really wanted to use wsgi to serve stuff up. But I couldn't get authentication working. I am sad.
vim apache.conf
----
    WSGIScriptAlias /repo /var/rhode/venv/dispatch.wsgi
    WSGIPassAuthorization On
    WSGIDaemonProcess rhodecode user=www-data group=www-data threads=1 processes=10
    WSGIDaemonProcess pylons \
        threads=4 \
        python-path=/var/rhode/venv/lib/python2.6/site-packages

More wsgi stuff I didn't get working.
vim /var/rhode/venv/dispatch.wsgi
------
import os
os.environ["HGENCODING"] = "UTF-8"
os.environ['PYTHON_EGG_CACHE'] = '/var/rhode/venv/.egg-cache'

os.chdir('/var/rhode/venv')

import site
site.addsitedir("/var/rhode/pyenv/lib/python2.6/site-packages")

from paste.deploy import loadapp
from paste.script.util.logging_config import fileConfig

fileConfig('/var/rhode/venv/bin/production.ini')
application = loadapp('config:/var/rhode/venv/bin/production.ini')

To get the pass-through proxy working, this is what I did. First, enable the proxy mods:
a2enmod proxy_http
a2enmod proxy
a2enmod mod_headers
And some other stuff. I'll finish my notes later.













Thursday, October 4, 2012

Computer Science – Simpson College

Rather pleased with the customization we've done four our website: Computer Science – Simpson College

Friday, September 21, 2012

Flipped Classroom

A "flipped classroom" is one where students watch lectures at home and do their homework in class. The Kahn Academy has done wonders in helping instructors with flipped classes.

I decided to try it with my class that introduces computer programming. My hypothesis: I could get more students to post excellent grades with this method than the traditional method.

Over the summer I worked on this website.

I put the lectures on-line. A total of 55 videos, over 6 hours of run time. Most videos are short. I used a graphics tablet to mark up the screen during the video. I got a good microphone and edited the videos to remove annoying sounds, mistakes, or other distractions.

The full text of the book is on-line. There are code examples and JavaScript animations that animate the code to visualize what is happening.

I created a multiple-choice quiz engine to test the students on-line. That helps make sure they actually went through the material.

The website got a lot of positive feedback from the community-at-large, I was helping more students learn programming on-line than I was in the classroom.

It seemed like everything ready for a full test of a "flipped" class this semester. The first real results would be from Test 1.

I started getting worried when there were students doing worksheets in class that had clearly not watched the lectures or gone over the material first. Plus my "draw a picture" lab had fewer images that really showed off the creativity of what students were able to do.

The results of Test 1 confirmed my worries. It showed a noticeable down-tick in grades compared to prior years. Was it terrible? No, there were still a lot of "A" grades. However there were more students on the C-F range than what I normally get. It seemed like a "flipped" class was allowing more students to slip through the cracks than before.

My conclusion, the data did not support my hypothesis.

Here are more hypotheses I have:

  • Students who don't want to do work outside of class still don't. They gain more from having the traditional lecture in-class and not doing the homework. In a flipped class they skip watching the lecture and just copy worksheets resulting in even less comprehension.
  • Fewer students will become inspired by the material and want to explore a career in that area. Students that aren't willing to ask questions about worksheets have little interaction with the instructor. Those students are less likely to be inspired by the instructor because they don't get to regularly see how excited he/she is about the material.
  • A flipped class will work well in an evening class. Evening classes with working adults have a high drop-out rate for an introductory computer science course. I think that teaching in a 'flipped' manner will result in higher scores for these students even if they result in lower scores for day students. Meeting four times a day, is better than a flipped class, which itself is better than meeting one time a week. 
  • The 'flipped' class scales well. It will still perform 'well' with an average instructor and will involve little work on the instructor's part if the material is already created. e.g., a teacher that doesn't understand calculus well can still do a good job teaching calculus with help from the Kahn academy. Or a teacher can have more students in a class and still teach them. But neither can match a great teacher in a small class.
At some point I'll do a survey and see if I can't get more information from the class. I'm going back to my traditional methods for now.

I am still reaching a lot of students who have never set foot at Simpson. So I don't think the effort spend on the website is a waste. But I'm not improving the scores of my class doing this.

Wednesday, September 12, 2012

Prototyping an Arduino and Nixie Tube clock

I finally got an Arduino I could dedicate towards my steampunk clock project. I have an LCD display and Nixie Tubes to pair up. Here's a video of what I have working as of tonight:

You can see that on the lower left are my four Nixie Tubes showing minutes and seconds. Eventually it will just be minutes and hours, but that doesn't make for a good demo video. On the right is the Arduino and LCD shield hooked up to a Chronodot. The Chronodot also has a thermometer.

In the background is the power supply. The project is pulling 0.38 amps at 12.1 volts.

I like the LCD shield from Adafruit. I had to solder the LCD shield together, which I wasn't big on, but I like the ability to change colors and the integrated buttons:


The circuit layout is pretty simple, courtesy of Fritzing:

The software uses this Nixie Tube library, and also this Chronodot library.


Thursday, September 6, 2012

Arduino Nixie Tube

Update: See the finished project here.

The Nixie Tube [link] from DFRobot.com was ordered Monday night. It was shipped Tuesday from Shanghai, China and arrived here in Iowa two days later on Thursday!!!

Opening the package revealed a DFRobot package.

Looks nicely packed with foam. Also included a pre-drilled plexiglass board for the four tubes I ordered. Cool, didn't ask or expect that.

Foam removed.


I downloaded the sample code and looked at the Wiki. Managed to hook up one module to power and do hit the test button with no issues. I hit the test button with a stick since it cautions the on-board voltage can be up to 170 volts.

Hooked it up to the Arduino and ran the breathSample from the code examples and got:
My plan is to create a steam-punk style alarm clock with these as a personal art project.

Thursday, August 23, 2012

Getting the CMPS03 compass to work with the Arduino

Code for testing a digital compass using Arduino UNO

/*
CMPS03 with arduino I2C example

This will display a value of 0 - 359 for a full rotation of the compass.

The SDA line is on analog pin 4 of the arduino and is connected to pin 3 of the CMPS03.
The SCL line is on analog pin 5 of the arduino and is conected to pin 2 of the CMPS03.
Both SDA and SCL are also connected to the +5v via a couple of 1k8 resistors.
A switch to callibrate the CMPS03 can be connected between pin 6 of the CMPS03 and the ground.


*/
#include 

#define address 0x60 //defines address of compass

void setup(){
  Wire.begin(); //conects I2C
  Serial.begin(9600);
}

void loop(){
  byte highByte;
  byte lowByte;
  
   Wire.beginTransmission(address);      //starts communication with cmps03
   Wire.write(2);                         //Sends the register we wish to read
   Wire.endTransmission();

   Wire.requestFrom(address, 2);        //requests high byte
   while(Wire.available() < 2);         //while there is a byte to receive
   highByte = Wire.read();           //reads the byte as an integer
   lowByte = Wire.read();
   int bearing = ((highByte<<8)+lowByte)/10; 
   
   Serial.println(bearing);
   delay(100);
}

Thursday, August 16, 2012

Getting started with Arduino robots

The Arduino microcontroller has finally made robotics work fun. I've worked with other microcontrollers such as RoBoard, Freescale, Parallax, and found them to be more frustrating than fun. The Arduino has changed all that in my case. This shows what I've been able to do with just a few evenings.

In the first evening, I was able to get an Arduino board to drive some LEDs within just a few minutes.


A little more work, an I have motors and servos working. By the third evening, I had my first autonomous robot using one ultrasonic sensor for obstacle avoidance:


I made version 2.0 of my robot, so that I could have more breadboard space, giving me an LCD display and two ultrasonic sensors:


The ultrasonic sensors had to be polled separately so they did not confuse each other. A bigger issue was the the robot no longer turned well. The front wheel does not turn, and the robot was now heavy enough that the front wheel no longer easily skidded sideways, like it did in version 1.0 of my robot.

Yesterday in the mail I got a different wheel I ordered that solves this problem, by having small rollers on the wheel allowing it to slide sideways. So here is version 2.1 of my robot:


I'll be adding a magnetic compass soon, and eventually starting version 3.0 of my robot.

Friday, June 29, 2012

I get in class new student teachers who need an endorsement that they have taken a programming class. Sometimes these students aren't that interested in programming, they don't see how it will apply to them.

My lesson: "If you learn to program, and put your lessons out on the web you will reach more students than you ever would in the classroom." And I practice what I preach. I've been working with my on-line book ProgramArcadeGames.com a lot this summer. Traffic has increased, thanks mostly to reddit.com. Here is a graph of unique visitors per day:

Even more important, according to Google Analytics, about half of the visits are returning visitors. During the month of June I've had over 1,300 visits where more than ten minutes was spent browsing the site. About 500 of those spent more than twenty minutes on the site.

I am reaching more students on-line than I am in the classroom.

Wednesday, June 27, 2012

Learning to Program Arcade Games

I recently purchased http://ProgramArcadeGames.com for my on-line book on how to program. A couple posts to reddit.com have brought in a lot of traffic. I'm hopeful that the new website address will help bring in search traffic.

Tuesday, January 31, 2012

Educational Assessment

College tuition is soaring five times faster faster than inflation, while 45 percent of students did not demonstrate any improvement in learning. For-profit schools are sucking up federal dollars, some of them getting over ninety percent of their revenue from federal money, while graduating only 22 percent of the students that start. The current solution to this problem that is being pushed to this problem: educational standards and assessment. It is, however, a dangerous path to follow.

Where does this come from? I'll blame Iowa's own Edwards Deming. Edwards Deming helped manufacturing industry by attempting to apply a bit of science to manufacturing. Measure the quality of what you create. Try something new. See if it helps.

The U.S. didn't like him, so he went to Japan. Guess what? Engineering your manufacturing process using evidenced-based changes did help! So now it seems like everything is made in Japan and other Asian countries. The key was to create a continuous cycle of evidence-based improvement.

Now, society wants to apply this to teaching as well.

Good teachers will naturally go through this process of assessment. They will continue to work on their class and find ways to improve it. They find out what other teachers are doing. Good teachers learn how to judge the personality of the students they work with, and learn techniques for working those students.

This process of continuing improvement is why good teachers often write their own books, and keep editing them to make them better. They create their own lesson plans and improve them year after year. But the process isn't perfect.

The problem in applying this to teaching? The impossibility of creating a common benchmark that can be used to evaluate the effectiveness of each teacher. Education is about humans. Since we are working with so many different humans, there are too many variables. Variables such as:
  • Different teachers have different styles. (The variety between teachers works well to keep students interested.)
  • Students aren't all the same, and they respond to different techniques.
  • Some students are capable of excelling in certain subject areas. Other students just move slower.
A continuous process of improvement assumes a controllable set of variables. Unfortunately this is not a situation that exists inside of academia. Particularly once the scope starts extending beyond the range of a single school, or even a single teacher.

At an individual or small-group level this continuous improvement may still be possible. Once the process expands to a larger group, it is too easy to get caught up in the paperwork and 'process.' People pay attention to the paperwork being required, and ignore the real goal of providing evidence-based improvements. A process that worked for one group may not work for more people.

This article does a wonderful job of explaining why this is bad:
Big Macs vs. The Naked Chef

(Seriously, go back and read that article. It is 10 times better than this one and you are wasting your time if you continue reading without having read that other article. Plus it has the word "naked" in the title, so it has to be good.)

Yes, that article was about software development. But the theory is the same in education.

What I hate about educational 'standards' is that it works to bring up poor performing people to the average, while bringing down high-performing teachers. We are left with an uninteresting homogeneous soup at the end.

Do we want our schools to be McDonalds? Do we want our students to be Big Macs?