André Roberge has created three screencasts on the use of Crunchy. Crunchy is an interactive Python interpretor that runs inside the Firefox browser and can be used to create interactive Python tutorials, library documentation, demos and tests. The principle is similar to “docucentric design” which was explored by one of my PhD students. The key benefit of the Crunchy approach is that documents are just web pages with embedded tasks. It is worth investigating whether Crunchy can be combined with a wiki to add some value to my current research project.
Java is extremely monolithic: in order to understand how to run a simple Hello World program, you’ll be exposed to:
- Java packages
- Static vs. instance methods
- Source files vs. compiled classes
- Editing vs. Execution
- Using a compiler or an IDE
- Method return types and method parameter types
- The magic (for newbies) that is “System.out.println()”
For a while I was content to go along with the BlueJ “objects first” approach which seeks to hide some of these details behind a graphical user interface. But having observed the experiences of students who find it difficult when they need to graduate from the “training wheels” of interactive objects on the screen to raw unadorned, textual, Java code, I’ve been having doubts. Howard himself advocates ruby, and interestingly the inform language (that seems to be designed for creating virtual worlds). This year, I am supervising a student project evaluating python so expect more on this topic.
Powered by ScribeFire.
This Python recipe “ASPN : Python Cookbook : Replace occurrence of string in files under directory tree” has a comment that reminded me of the power of Perl.
I am updating my slides for a lecture course that uses rst2s5 (a utility that uses Docutils/reStructuredText to generate S5 slides). When I wrote the original slides for last year’s course, rst2s5 was still in the Docutils Sandbox. It has now been promoted into the official Docutils distribution but some changes have been made. One of these was that
has been changed to
.. class:: handout
so I had a need for to make a search/replace in every file in a collection.
I know that there is a recipe for this in my copy of the Perl Cookbook (but I didn’t have a copy of that to hand), so I looked it up on the Python Cookbook. And there (in the comments to the above link) I found the Perl recipe:
find . -name '*.txt' -print | xargs perl -pi \
-e 's/\.\. handout::/\.\. class:: handout/'
Now that’s simple … and it worked!