Archive for January, 2009

Literate Programming — a real solution?

Friday, January 30th, 2009

Sphinx is a really popular documentation generator for python, probably due to ease of use and the absolutely gorgeous output it gives.

PyLit is a way to convert python code directly into ReST (the format Sphinx uses) and back.

Sphinx provides indexing, cross reference and other goodies.

Based on these two facts, I think that PyLit and Sphinx are a legitimate literate programming tool for python.

Literate programming allows the author to tell a narrative to explain how a system works, browsing API docs or source code is difficult unless you have a narrative or examples to follow.

The other alternative I looked into was epydoc. Although epydoc does generate excellent API documentation, it doesn’t really provide a narrative, the closest thing to a narrative I see is package or module level documentation.

PyCon 2009

Tuesday, January 27th, 2009

Huzzah! I just registered for PyCon 2009 in Chicago! :)

Endorphins and Groovy

Friday, January 16th, 2009

I just got done pushing myself on the treadmill and going through my max check list of stretching. My flexibility has just improved in three sessions, very impressive! Even though I pushed myself on the treadmill, I definitely feel that it was worth it. It feels so nice to have hot blood coursing through my muscles. Definitely a nice workout after a productive day at work.

I definitely feel like things are changing, and for the better. I feel like my feet are on rock solid ground so I can push off and fly, before I was definitely on solid ground, but there was the occasional pebble or piece of grit tripping me up. And I have to thank an old friend for contacting me out of the blue after about 7 years for giving me this new emotional foundation :)

Today I was finally able to get maven to behave with eclipse and groovy, so I’ve started wor on a groovy project at work, sadly I’ve run into some issues:

  • The groovy eclipse plugin (at least the latest stable release) has some bugs with auto completion of annotations and static imports. It also puts imports at the top of a file *before* the package line if the top lines are taken up by a comment.
  • Both groovy code execution and the groovy console are slow to startup, even compared to maven. I’m probably going to try the development version to see if some of these things are fixed.

All and all, groovy seems to be a very nice language, especially with regards to java integration. Some of the features seem a bit dangerous (akin to ruby or perl) rather than the more constrained python philosophy. If you don’t already know, I’m an avid pythonista.

Ironically, or sadly, the issues I deal with from my tools are minor compared to some other issues. For instance looking through some of the code at work I notice strange mistakes, like variables that are arguments to methods that aren’t used anywhere, or methods that don’t do anything through-out a class hierarchy. Never mind the abysmal block comments or lack of test coverage ;-)

I fixed maven by running it from the command line.

I also installed a coverage plugin for eclipse based on EMMA. I haven’t gotten it to work with groovy or groovy tests yet, but that should be relatively easy, since groovy files get compiled to bytecode and are executed as java applications in eclipse. One thing about the code coverage tool I dislike is that it wont tell me *which* unit tests cover specific pieces. I guess I expect that functionality after using figleaf.

Django Comments Flagging

Tuesday, January 13th, 2009

Well, after spending a while trying to debug it, I could not get Django’s comment flagging in django.contrib.comments to work properly. REAALLLLY IRRIITATTTTTTING.

The worst part is that I can get the freakin’ runserver command of Django to work in pdb.

I’ll setup a test project and do some more work on it later.

django-spambayes pains

Monday, January 12th, 2009

So, I ran into a few difficulties with Django’s ORM freaking out depending on the applicaition order I installed django-spambayes in.

This is either a bug or I have to look at the documentation in more detail.

The plan

Tuesday, January 6th, 2009

So, this idea has been germinating in my mind for a while. A Intelligent Tutoring System to teach programming using python that’s implemented as a Jython applet with graphical illustrations of programming concepts.

I think this would be awesome if I’m able to do it effectively, but requires a few skills in place

  • Jython
  • Java Applets implemented in Jython
  • Swing programming in Jython

Now, Crunchy already can turn webpages of documentation into interactive tutorials using the python prompt. This would be different, introducing programming concepts (using spaced repetition and other strategies) and python would be an implementation language and introduced later on in the lessons.

One issue is whether I should focus on something else, like a algebra ITS first. I’m not really sure, and will have to do some more investigation into the background really necessary for algebra…Perhaps a ITS to teach linear algebra would be better?

I’ve already done some investigation of LaTeX equation rendering in Java and javascript, so it does have potential.