Yearly Archives: 2008

MySQL with Python on Mac

This entry will be more technical than most, keying of the “open” and “research” more than “education”.

In an analysis I’m working on, I’m going to be munging the data all sorts of ways and the graphical statistics environment I’ve been using (JMP) is going to be painful for me to use. Particularly because it updates state and it’s hard to remember how I got there. I’ve had great success on a project recently using GNU Make to process the data from raw to beautiful and I want to try that here.

In my other project, the raw data is in XML so I got handy with Python and an XML processor. In this project, my raw data is in a MySQL database. I thought that would be as straightforward, but it hasn’t been. That may be due more to using a Mac this time around though (as opposed to Windows and Linux previously).

In any event, here is what I had to do to get the MySQL-python on my MacBook Pro. I hope this saves someone else the trouble. In the end, I made an .egg, so if you want to skip the rest you can just download that: MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg

First I had to get setuptools working. I noticed had two versions of Python installed, Leopard’s and MacPorts’, and decided to remove the MacPorts one to keep things clean. (Incidentally, I regret ever making use of MacPorts. I’ve much rather have built binaries ala Fink.) Once I had setuptools working I thought I could install the MySQL driver with simply,

easy_install MySQL-python

Unfortunately, that fails with a compile error,

In file included from /usr/local/mysql/include/mysql.h:47,                 from _mysql.c:40:
/usr/include/sys/types.h:92: error: duplicate ‘unsigned’
/usr/include/sys/types.h:92: error: two or more data types in declaration specifiers
error: Setup script exited with error: command 'gcc' failed with exit status 1

Fortunately I found a blog that provided a workaround,
Install MySQL server from
Download and unpack the MySQLdb package (download URL here)
Fix the path to mysql_config, either by editing (editing mysql_config.path value) or adding /usr/local/mysql/bin/ to your PATH. (i.e. export PATH=$PATH:/usr/local/mysql/bin/)
In the folder run python clean and python build

At this point you’ll probably get this error,

/usr/include/sys/types.h:92: error: duplicate ‘unsigned’/usr/include/sys/types.h:92: error: two or more data types in declaration specifiers

To get around this, edit _mysql.c to change

#define uint unsigned int

#define /* uint unsigned int */
Then build again. You’ll probably see this warning,

ld: warning in build/temp.macosx-10.5-i386-2.5/_mysql.o, file is not of required architecture
ld: warning in /usr/local/mysql/lib/libmysqlclient_r.dylib, file is not of required architecture
ld: warning in /usr/local/mysql/lib/libmygcc.a, file is not of required architecture

I ignored them and haven’t encountered any problems. I’m on a 32-bit Intel Mac though. If you’re on 64-bit, this blog post may be able to help.

Run sudo python install to install.

Then I ran this code to test. Once I knew it was working, I tried to find a way to share the binary. I was able to build a binary .egg with python bdist_egg, which made MySQL_python-1.2.2-py2.5-macosx-10.5-i386.egg

I’d like to upload it to the PyPi record, having registered and set up my .pypirc file, but I don’t have permission. After writing this, I will contact to package index owner, Andy Dustman, and see if he can include it. If he does, then the simple command I was expecting at first should work for 32-bit Mac users now on.

easy_install MySQL-python

And until then, this negligibly longer command should work,


Improvement study wrapping up (last chance!)

The current study on improving educational materials for math is wrapping up.  Soon we will be distributing the $400 in Amazon gift certificates.  As of yet, participation has been low and there are very few participants in the lottery, so your odds are good!  Remember that higher quality improvements and more accurate ratings earn more entries in the lottery.  Visit the experiment at the following link,

If you tried the link earlier and you had any trouble with it, please try again as there have been many revisions to the system.

Please invite other people you think would be interested in participating. Just can click this link to compose a prefilled mail message. Just address it, edit as you wish, and hit send. You can also subscribe to this blog if you’re interested in learning more about this and related research.

Choosing a wiki for collaborative curriculum design

Pittsburgh Science and Technology Academy is a groundbreaking new sci-tech magnet school opening in 2009. Among other innovative methods, they are keen on working with education and technology researchers to the latest research into their design and practice. They are designing a new school and integrated 4-year curriculum from the ground up, and as part of the CMU‘s PIER program I have had the opportunity to see the challenges and opportunities this affords. As an HCI researcher in collaboration technologies to support education, I have been particularly interested in how they can best support collaboration among teachers and administrators as they carefully design their curriculum to kick off in classrooms next Fall.

This morning I spoke with Stephen Pellathy, the Curriculum Coordinator for science, who has made some visits to my curriculum design course this semester to discuss their process. When he started, the curriculum was a Word document that got e-mailed around. Aware that wikis were much more supportive of collaboration, he set up a Google Sites wiki to hold the curriculum so that he and the teachers could easily write and revise it together.

He picked Google Sites initially because it was convenient and he knew it already, but he had been hearing of other options and wanted to decide on a long term platform soon before the content grew to a size that would be formidable to transfer. Through the conversation we hit upon these concerns:

  • Will the storage be enough after years of growth? Can it host video?
  • How time consuming is accounts management?
  • How hard is moving the content to another wiki if another becomes more appropriate?
  • How hard is it to integrate other documents like budget spreadsheets?
  • Can it differentiate between teacher and student access? On a per-page level?

There are comparisons of wikis for education on the web. (e.g. 1). Most take a focus on wikis for student learning. Here the concerns are on the teaching side. A big site for wiki-based curriculum is Curriki, but that is for open content, and hopes to facilitate collaboration on a large scale. That challenge is great and some believe it won’t work. I should write more on that at a future date, but right now I’ll restrict the focus to teachers and administrators collaborating within a school to develop a new curriculum. Basically, a recounting of key points from our conversation.

Google Sites
Currently they’re using Google Sites off a Gmail account. I think this gives 100MB storage. If they want to stick with Google Sites, they could set up a domain with Google Apps and get 10GB for shared storage. A private Google Video service is included, but will soon cost $10/user/year. Account management isn’t too difficult since there is a batch account manager. With the Premier level they offer single-sign-on.
Google Sites integrates pretty nicely with Google Docs, allowing you to embed spreadsheets.
One drawback is on portability. There’s no way to transfer your Google Site to another service or even download it as an archive. Another key drawback is it has only role-based and no page-level access controls. That means that to let someone edit any page on a site lets them edit every page on that site.

Another option he had heard of was MediaWiki, the software that runs Wikipedia. For most educational contexts this isn’t an option since it requires a server to host it, but in this case the person who suggested it also offered to host it. A key feature of MediaWiki is that it is open source, but that doesn’t matter much here in practice because no one has the skillset to be editing the code. It does mean that it has more community investment and there are many more tools to support it, such as plugins. But again, these require a level of technical skill that may be available.
One pretty advanced feature within the wiki software is its template system. This is used extensively in Wikipedia, such as for the info boxes on the right hand column of a page. These could be useful in curriculum design to maintain uniformity across documents. On the other hand, they could force constraints that may be stifling. Maybe it’s better to achieve uniformity through cultural norms and let people break out of them when they see fit.
While hosting MediaWiki yourself is a cost, it’s also a benefit to portability since you hold all the data. You can easily move it to another MediaWiki server and perhaps even other wikis if you find a conversion tool.

I suggested he consider a third option, PBwiki. I made a PBwiki when their service was just starting up and I’ve seen it grow into a really powerful and easy to use platform. The release of Google Sites gave them some hard competition, but their new 2.0 release seems to have made them stronger for it.
The key advantage of PBwiki for this school is page-level access controls. For example, teachers or administrators can draft a document with a smaller group before releasing it to view by students. MediaWiki has this but Google Sites doesn’t. This requires the Academic Silver package ($100/year).
Another key advantage is single-sign-on. They already have an authentication system for their current web site. This way a user only has to log in once and can go between the current web site and the new wiki. I don’t know whether MediaWiki offers this. Google Apps does but in my cursory research it looks a little wonky. This requires this Academic Platinum package ($1k/year). That’s pricy, but it’s within the budget and could pay for itself in time saved. The Platinum level also includes 5GB storage. Less than Google’s 10GB, but more than enough for curriculum documents. Hosting video would eat into that quickly, but that can easily be uploaded elsewhere and embedded on PBwiki pages. Same for spreadsheets, etc.
My favorite advantage of PBwiki is the ability to download your whole wiki as a ZIP archive. This mixes the hosting advantage of Google Sites with the “it’s your data” advantage of MediaWiki.

This is not by any means an exhaustive comparison of these three wiki platforms. I just wanted to write down and share the concerns and light research that came out of this phone call. They will probably decide on a platform within the next week. Please comment if you are interested in hearing more about their ultimate decision and the factors in it.

5th-grader keynote speaker for the Dallas Independent School District

Dalton Sherman, the 5th-grader keynote speaker for the Dallas Independent School District’s 2008 Back to School pep rally, gave this speech in front of 20,000 teachers. Watch their reactions, excitement and standing ovation over his powerful message: "Do YOU believe in me?"

Dallas ISD hosts the WMV file here but someone uploaded it to YouTube, which is what I’ve embedded here to reduce the load on Dallas ISD’s servers.  The summary above is from another upload of the video to a less popular service.

Results from study on open authoring

In September of last year I ran a web-based experiment in open authoring of educational materials. The goal was to learn about the quality of the materials that volunteers can produce and how that differs across their expertise. I’ve since published the results at the International Conference on Intelligent Tutoring Systems, but I’m also blogging about it as part of my goal to do my research in a more “open” way.

Here’s a short summary (abstract) of the paper:
Open collaborative authoring systems such as Wikipedia are growing in use and impact. How well does this model work for the development of educational resources? In particular, can volunteers contribute materials of sufficient quality? Could they create resources that meet students’ specific learning needs and engage their personal characteristics? Our experiment explored these questions using a novel web-based tool for authoring worked examples. Participants were professional teachers (math and non-math) and amateurs. Participants were randomly assigned to the basic tool, or to an enhanced version that prompted authors to create materials for a specific (fictitious) student. We find that while there are differences by teaching status, all three groups make contributions of worth and that targeting a specific student leads contributors to author materials with greater potential to engage students. The experiment suggests that community authoring of educational resources is a feasible model of development and can enable new levels of personalization.

For the full details, there is a version of the paper is available on my own web site and the official version is available from Springer.

Also, I am conducting a follow-up experiment now on how people are able to improve the materials from the first study.

Questions or comments are wholly welcome.

Welcome to ITS 2008 people

I just gave my talk today on Putting the World to Work for ITS and I included a link to this blog, which I intend to write in regularly about research in building scalable systems for intelligent tutoring and education technology in general. (You might also be interested in the paper on which the talk is based.)

You can subscribe through e-mail by entering your address in the box to the left or through RSS/Atom by clicking the orange box in the URL bar of your browser.