Friday, May 29, 2009

Karmic fluxbuntu

I had a great conversation with Joe Jackson, project leader of the fluxbuntu project, on the #fluxbuntu irc channel. His plan is to focus on the 9.10 release, so the timing will work out perfectly for us to contribute during the Summer.

I've already installed karmic alpha-1 on a laptop in school, and am awaiting further instructions.

Jamie Boisture is with me for 30 hours each of the next 3 weeks as part of his high school, "Senior Experience", a program that let's Yorktown High School seniors spend their last 3 weeks of high school exploring the world of work. Jamie will essentially be kicking off Sugar Labs, DC with the work he is doing. He had a great week this week, successfully porting the Graphical Logic Circuits program from pygame to pycairo. This bodes well for the work Jamie has agreed to take on this Summer porting gasp to pycairo.

Thursday, May 21, 2009

Manos a la obra con...

It has been a while since my last post. Not because there haven't been things to report, since there have been many, but because so many things have been happening I haven't had time to report them!

To summarize:
  • We have created a launchpad team, Proyecto Juan Chacón, to support translation of our educational resources into Spanish.
  • We have created a project, Serie "Manos a la obra con...", to hold the translation of the "Getting Down with..." series.
  • I've been talking to folks on #sugar to get a handle on which tools to use in developing our Sugar Activities. It appears that pyGTK and pycairo are the tools on which we should focus.
  • Jerry from the OLPC Learning Club has been coming here to work on getting our remaining 20 XOs ready for the lending library. He has 10 and I have 10 now to finish.

Friday, May 15, 2009

reSTing in Style

Who says you can't teach an old dog a new trick. I'm starting to use reST for all my web markup needs. I want to style it, of course, so I'm reading Docutils Front-End-Tools to find out how to do that.

On Ubuntu systems with the python-docutils package installed, commands like rst2html.py are available from a shell prompt using just rst2html. I've be marking up all the assignments I post on the GCTAA ICT website. This is both much faster than marking them up with straight html, and it provides me with an on-going opportunity to practice my reST skills.

The default style produces pages like this. It looks OK, but I want to be able to customize it. Here is what I did:
  • cp /usr/share/pyshared/docutils/writers/html4css1/html4css1.css . (copied the default style sheet from where the python-docutils debain package for Ubuntu 8.04.02 (hardy) put it to my current working directory).
  • mv html4css1.css rest_style.css
It took me a bit of fiddling to get the format for rst2html to use the new style sheet, but here it is:
  • rst2html --link-stylesheet --stylesheet-path rest_style.css index.rst index.html
This generates index.html from index.rst using rest_style.css in the same directory as the external style sheet.

Monday, May 11, 2009

No reST for the wicked...

As I dive headlong into the task of converting the Open Book Project materials from lore to reST, I'm getting a feel for what works and what doesn't with reST. I spent the better part of an hour trying to figure out how to put non-breaking spaces into a line block.

I still don't know if there is any sensible way to do that, but I gave up and decided it was better to change my markup to match what is natural to do with reST, rather than to keep trying to bend
reST to my will. I'm finding that after the thrill of learning basic reST with so much ease, the learning curve for non-trivial things is much steeper. I wanted to markup a sample program run, with the user input appearing in italics:
What’s 6 times 7? 49
No, I’m afraid the answer is 42.
What’s 3 times 2? 6
That’s right – well done.
... And so on, with several more questions...
What’s 5 times 9? 45
That’s right – well done.

I asked you 10 questions. You got 7 of them right.
Well done!
In the original LaTeX version, and in the lore version we made from it, the line "And so on, with several more quesitons...", was indented 25 spaces or so, and did not have the leading ellipses. Since character-level inline markup does not work with white space, there is no easy solution to this problem apparent to me. I'll ask Douglas when I see him on irc later today.

Sunday, May 10, 2009

XOs in El Salvador Update

Good things are coming out of all the difficulties we have had getting the XOs out of customs in El Salvador:
  • The community at Buena Vista has become actively involved in helping, including meeting with a former National Assembly delegate with whom they have contact. This may be the most important development of all, since the project will only succeed to the degree that the community takes direct ownership of it.
  • We are greatly expanding our contacts with members of the government and the FMLN, the soon to be ruling party of President elect Mauricio Funes. The FMLN is likely to have a much greater interest in Free Software and its implications for national soveriegnty, so these new contacts may come in handy in the future.
  • Finally, Douglas now has a process in place to get the XOs. It will take 20 more days, but the cost had been cut by more than two thirds.
I'm now waiting for Paco to setup a meeting on #ubuntu-sv with the community at Buena Vista. We need to begin planning the educational part of the program, which is the real reason we are going through all this effort in the first place.

Sugar on a Stick


I asked Matt to document the process of creating Sugar on a Stick. Alas, he didn't. The wiki page that describes the process is:
Here is what I did from a root prompt on my eeepc running Jaunty to set it up as a "Sugar on a Stick Factory":
  • # apt-get install isomd5sum cryptsetup syslinux
  • # mkdir /opt/SoaS
  • # cd /opt/SoaS
  • # wget http://people.sugarlabs.org/sdz/livecd-iso-to-disk.sh
  • # chmod +x livecd-iso-to-disk.sh
  • # wget http://download.sugarlabs.org/soas/releases/soas-beta.iso
  • plugged-in a 4G USB flash drive
  • # mount (which revealed the drive was device /dev/sdc1 mount on /media/USB DISK)
  • # fdisk -l (which revealed the the boot flag on my USB stick was not set)
  • menu: System -> Administration -> Partition Editor (GParted)
  • select my device
  • menu: Partition -> Unmount
  • menu: Partition -> format to -> ext2
  • menu: Partition -> Manage Flags
  • check the boot flag and close
  • # umount /dev/sdc1
  • # dd if=/dev/zero of=/dev/sdc bs=446 count=1
  • # ./livecd-iso-to-disk.sh --overlay-size-mb 600 --home-size-mb 1024 --delete-home --unencrypted-home soas-beta.iso /dev/sdc1
The script produced the following interaction:

Verifying image...
/opt/SoaS/soas-beta.iso: 53509e4773805e4657cb20f0e784a50d
Fragment sums: 3815452cc8252b238fa24ca651d8a9c7d67dd33ba13986227ed3aac4cba4
Fragment count: 20
Checking: 100.0%

The media check is complete, the result is: PASS.

It is OK to use this media.
MBR appears to be blank.
Do you want to replace the MBR on this device?
Press Enter to continue or ctrl-c to abort

Copying live image to USB stick
Updating boot config file
Initializing persistent overlay file
0+0 records in
0+0 records out
0 bytes (0 B) copied, 6.3625e-05 s, 0.0 kB/s
Initializing persistent /home
0+0 records in
0+0 records out
0 bytes (0 B) copied, 6.3904e-05 s, 0.0 kB/s
Formatting unencrypted /home
mke2fs 1.41.4 (27-Jan-2009)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
65536 inodes, 262144 blocks
13107 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=268435456
8 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks:
32768, 98304, 163840, 229376

Writing inode tables: done done

This filesystem will be automatically checked every 31 mounts or
180 days, whichever comes first. Use tune2fs -c or -i to override.
tune2fs 1.41.4 (27-Jan-2009)
Setting maximal mount count to -1
Setting interval between checks to 0 seconds
Installing boot loader
/media/usbdev.yOpIUg/syslinux is device /dev/sdc1
USB stick set up as live image!

Back at the # prompt, I typed "reboot", hit the key, selected the USB stick... I watched the fedora splash screen and waited until I got to the Sugar first time boot screen. Cool!

A Good Link


I found this blog post evaluating Python eggs from the point of view of someone used to using the debian packaging system: Why I don't use easy_install.

Monday, May 4, 2009

Logic Circuits

I love when stuff like this happens... A thread started on the IAEP (It's An Education Project) mailing list about software simulators for learning about logic circuits. My friend and co-author, Chris Meyers, developed two activities as part of his Python for Fun series on this very topic:
Several years ago, former student Peter Bui wrote a "Getting Down with..." meant to compliment Chris's lessons:
Last year student David Cooper created a logic circuit simulator in pygame, called Graphical Logic Circuits. I sent Matt and Jamie an email this morning, and they are already at work looking over David's code from last year to see if it would make a good Sugar Activity.

Getting more reST


Chatting with Douglas on irc this afternoon, he pointed me to some good resources for my study of reST:
Brendan pushed his latest changes to the gasp-lessons site on launchpad. I have my check out of gasp-lessons inside a directory named Sphinx, that also has a virtual environment. I can now use the following process to build the course materials from within the Sphinx directory:
  • source bin/activate
  • cd gasp-lessons/gasp_course
  • sphinx-build source/ build/
I updated my alias list in my .bashrc file to include the following:
  • alias gle='rsync -avz -e ssh --delete /home/jelkner/Projects/Sphinx/gasp-lessons/gasp_course/build/ login.ibiblio.org:obp/pybiblio/gasp/course/'
After running gle from the command line, the Open Book Project site now has the new version of the Gasp Lessons:
The coolest thing is the way SVG images just work now, as you can see in Sheet 3 of the course.

Friday, May 1, 2009

Combating reSTlessness

My goal is to come up with as many bad puns as possible to use as post titles during my study of reStructuredText and Sphinx.

Advanced Topics student, Brendan Buso, successfully created several svg illustrations for Sheet 3 in the Gasp Python Course. Unfortunately, he didn't push his changes to the launchpad site, so I'll need to wait until Monday to get them from him. The really cool thing is how easy it was to markup the illustrations in reST, and have them included in the html that it generated. Everything just works! I've waited so many years to arrive at this point, and am once again thankful to the Python community for coming up with an elegant, easy to use solution!

I now need to imerse myself in learning reST. I'm a slow learner, so the approach I will use is to use reST for as many of my documentation needs as possible. Instead of writing in html, I'll write in reST, and then use rst2html to generate the html pages. On an Ubuntu Jaunty system installing rst2html is a simple manner of running:
  • sudo apt-get install python-docutils
This package installs rst2latex, rst2s5, rst2xml, and several others in addition to rst2html. I created a file named hello.rst that contained the following:
Hello World
===========
Then I ran:
  • rst2html hello.rst
which produced this output. rst2html sends its output to standard out, so I actually need to run:
  • rst2html hello.rst > hello.html
to capture it in a file. The html is fairly straight forward, though the CSS is extensive. My next task is going to be wrapping my head around the style generated to see how that can be used to advantage.