Maandelijks archief: mei 2009

Working IPv6 regular expression

Multiple times I’ve been searching (too long) for a working IPv6 regular expression. There’s a lot of crap out of there which doesn’t take into account certain cases. Of course you only get to know which one works best if you test them all. I’ve tried A LOT and finally found the right one

Verder lezen

Getagged , ,

Installing Numpy on Mac OS X 10.5.x Leopard

Installing Numpy according to the Scipy wiki page can be a real pain. As Python and GCC are already part of Mac OS X, some prerequisites are already fulfilled, but an official install didn’t do the trick in my case. Verder lezen

Getagged , , ,

Syntax highlighting for Vim

Today I was looking for syntax highlighting for Vim on Mac OSX (10.5.6). A lot of sources only tell which rules there are to enable this, but a lot less tell where to add / edit these rules. I found this source to be very useful to do this. The first comment on the post is also very useful. By adding just two lines to my configuration file I had a nice highlighting with bold characters.

In short:

Verder lezen

Getagged ,

Python ParserFactory

Yesterday I had an idea about how to manage parsers in dynamic way. My idea was like this

  • A managing class can access the parsers folder and check which parsers (files) are available
  • A parser describes which file formats (and which versions of it) it can parse
The result should be that parser classes are implementing a parser interface and a ParserFactory can get info from the available parsers. As I have been working with Java, PHP, Haskell and some other languages, but rather new at Python this is an interesting problem to get to know Python a little better.
Getagged , ,