dmo.ca/ tag/ perl

I'm hacking on some tools that use the Search::Xapian module to build up search indexes. It's an excellent Perl interface to Xapian, but unfortunately it seemed to be too slow for our purposes. Tracing our code showed that much of the slowness was in passing data back and forth between Perl and the C++ library for every call.

I decided to write my own XS module to speed things up. Instead of using Search::Xapian, I'd bundle everything up into a Perl datastructure, and pass it down to libxapian through my own module, once, and do all the indexing work in C++. This worked great -- until I started trying to do some exception handling.

more

Posted Thu 09 Dec 2010 04:29:43 PM UTC Tags: perl

I'd much rather use Git over Subversion, but I still have one project (leaguerunner) using Subversion on Google Code. Migrating the code itself to git is fairly simple, but being unable to migrate the issues still needs some tool development.

more

Posted Sat 22 May 2010 11:57:42 AM UTC Tags: perl

You may have heard that WIND Mobile is going to be offering service in Ottawa shortly. I got curious as to what their coverage might be and started looking for coverage maps. I didn't find any, but I ended up graphing their wireless backbone instead.

more

Posted Thu 11 Mar 2010 05:34:18 AM UTC Tags: perl

A while back, I posted about detecting virtualization on Linux from a shell, using various tricks. Around that time, I also implemented those tricks as a perl script for internal use at work with the intent of eventually cleaning it up for public consumption. I finally got around to doing it, and the result is Sys::Detect::Virtualization availabe from CPAN, or from GitHub.

Currently, it can only handle Linux, and is only tested on a small number of virtualization hosts. Patches are welcome.

Posted Thu 25 Feb 2010 06:38:00 PM UTC Tags: perl

Until today, this blog ran on vimblog, a hand-rolled minimal script for displaying blog entries. In the last year or so, though, I've become a convert to git, and so what I really want to do is edit my posts on any system, commit them to a git repository, push to a remote and have them end up as blog entries on my server. Fixing vimblog to do this would have been more work than I want to deal with, but thankfully ikiwiki exists, and can do most of what I need.

So, as of now, this blog is in ikiwiki. To get there, I followed (more or less, since I'm documenting after-the-fact) these steps:

more

Posted Sun 17 May 2009 02:57:45 PM UTC Tags: perl

At my job we have need of a high-performance hash lookup database in our antispam product. It's used to store Bayes tokens for quick lookups on individual scanning systems, and is read-only in the fast path (mail scanning) with updates taking place in another process. For the last few years, we've been using a plain old BerkeleyDB hash database via Perl's DB_File, but with all the hype about Tokyo Cabinet and its benchmark results I figured it was time to take a look.

more

Posted Sat 16 May 2009 01:45:14 AM UTC Tags: perl

In order to keep things as seamless as possible for the next MIMEDefang upgrade, I've decided that the new modules I'm factoring out will need to live within the MIMEDefang git tree, at least for now. But... I had been working on some of the refactored code in a separate git tree, so now I need to merge it back in. Here's how I did it:

more

Posted Sat 16 May 2009 01:45:14 AM UTC Tags: perl

This year's Yet Another Perl Conference has come and gone, and I didn't bother to write anything during the conference. So, to make up for that, here's what I meant to post but didn't get around to.

more

Posted Sat 16 May 2009 01:45:14 AM UTC Tags: perl

ack is a great "programmer's grep" tool. If you don't already use it, check it out. Now, ack is packaged as part of Debian Testing (Lenny), but unfortunately there's a name conflict. Debian already ships a Kanji code converter named ack, so the ack that I want gets renamed to ack-grep.

I want to run 'ack' on all my systems, not 'ack' on some and 'ack-grep' on others, so I abused Debian's 'alternatives' system to let me do this with:

    update-alternatives --install ack ack /usr/bin/ack-grep 100

And voila, it creates me a /usr/bin/ack that Just Works, and is known to Debian so future packages won't (I hope) break that symlink.

Posted Sat 16 May 2009 01:45:14 AM UTC Tags: perl

Here's my Day Two summary for YAPC::NA 2008. Day two consisted of talks all day, followed by the main YAPC Banquet.

If you haven't read the [day one]{yapc-na-2008-day-one} summary, start there first

more

Posted Sat 16 May 2009 01:45:14 AM UTC Tags: perl