Blog-o! Notes from

Sun, 06 Jan 2008

On Friday and Saturday afternoon this week, I took some time out of my day to go down to the University of Toronto and participate in the DrProject Code Sprint. It was a lot of fun, and I managed to fix a couple of bugs, and get a better understanding of one of the hairier parts of DrProject. At least I hope it’s one of the hairier parts of DrProject, since if the whole codebase is as ugly as the wiki parts, we’re in some serious trouble. To be fair, it’s a not-entirely-deterministic parser for a not-entirely-deterministic language, so when something goes wrong, it’s kind of, uh, tricky to figure out what’s just happened. For example, after parsing a link surrounded in square brackets, the following character seems to be treated as text. Why? Who knows. As someone new to the wiki parser, I’ld love to have the code be simpler to understand, but I’m starting to suspect that the complexity is inherent in what it’s trying to do.

The two bugfixes/feature additions I did, although they seem sort of unrelated, both work together to let people create a bibliography/set of footnotes to pages, which is something Greg said that he’s been wanting for a while, so that was kind of cool. It’s nice to be able to go somewhere, be surrounded by smart people, and concentrate on making something better without interruptions.

Speaking of the bugfixes, they were:

  • adding support for dl/dt/dd in the wiki syntax, which turned out to be surprisingly hard, since it seemed to be the first bit of syntax that wanted to either return more than one tag or insert a tag into the already-generated stream, so I had to figure out which option to go with, and how to get it working, and
  • coming up with and implementing a wiki syntax for creating and referring to anchors in a page, which I think I did a pretty decent job on. The syntax uses [wiki:#foo] as an anchor, and [wiki:MyPage#foo] as a link to that anchor

[Posted at 21:14 by Blake Winton] link
Wed, 09 May 2007

Just because that would be too easy by itself, I'm going to follow the instructions for Cygwin, and we'll see what happens.

Okay, it's going fairly well so far...
And then I get to step 3:

Download, compile, and install sqlite from sources. Use version 3.3.5.
To compile it, I use "./configure", "make", "make install", but that gives me the following error:
$ make install
tclsh ./tclinstaller.tcl 3.3
can't read "env(DESTDIR)": no such variable
    while executing
"set LIBDIR $env(DESTDIR)[lindex $auto_path 0]"
    (file "./tclinstaller.tcl" line 10)
make: *** [tcl_install] Error 1

This page tells me to remove each occurance of "$(DESTDIR)" from Makefile, so I did, and it still didn't work, so I tried commenting out "HAVE_TCL = 1" and then it all seemed to work just fine.

Until I got to the line:

chmod +x /lib/python2.4/site-packages/pysqlite-2.2.2-py2.4-cygwin-1.5.19-i686.egg/pysqlite2/_pysqlite.dll
which failed, but it was easy enough to change it to:
chmod +x /lib/python2.4/site-packages/pysqlite-2.2.2-py2.4-cygwin-1.5.19-i686.egg/pysqlite2/_sqlite.dll
which worked.


drproject-server --debug --port 8080 --auto-reload --create=/tmp/drproject
gave me the error:
drproject-server: error: --create option does not take a value
So I tried
drproject-server --debug --port 8080 --auto-reload --create
which said:
drproject-server: error: incorrect number of arguments
So I finally tried
drproject-server --debug --port 8080 --auto-reload --create /tmp/drproject
and it seemed good.

Finally, I ran

drproject-server --debug --port 8080 --auto-reload /tmp/drproject
And it was good...

So I created a script called "drproject-server-profile", to profile it, containing the following lines

# EASY-INSTALL-ENTRY-SCRIPT: 'DrProject==1.0dev-r2084','console_scripts','drproject-server'
__requires__ = 'DrProject==1.0dev-r2084'
import sys
from pkg_resources import load_entry_point

import profile"sys.exit(load_entry_point('DrProject==1.0dev-r2084', 'console_scripts', 'drproject-server')())", 'profile.tmp')
and here is the data!

[Posted at 17:28 by Blake Winton] link