Category Archives: Software

Some nice code: libarchive

Yesterday, while looking for information on the format of tar files, I discovered libarchive, which is part of FreeBSD. libarchive and read about 5 different tar formats, 4 different cpio formats, zip, and ISO images, and supports gzip and bzip2. It can also write 2 different tar formats plus cpio and shar. Very nice.

Oh, and its tar.5 is the best reference on the tar format I’ve seen.

I’ve packaged up libarchive and bsdtar (the default tar on FreeBSD, which is built using libarchive) for Debian.

Perl, Powered By Haskell

Autrijus Tang is well-known for developing the first working Perl 6 interpreter, Pugs. Pugs is written in Haskell, my new favorite language. Perl.com has an interview with Autrijus, and page 2 of that interview gets particularly interesting. Here are some quotes from Autrijus:

Haskell . . . is faster than C++, more concise than Perl, more regular than Python, more flexible than Ruby, more typeful than C#, more robust than Java, and has absolutely nothing in common with PHP.

(If it has nothing in common with PHP, it must be great, right?)

Haskell is a pure functional language optimised for conciseness and clarity. It handles infinite data structures natively, and offers rich types and function abstractions that give Haskell programs a strong declarative flavor–the entire Pugs compiler and runtime is under 3000 lines of code.

Most languages require you to pay a “language tax”: code that does nothing with the main algorithm, placed there only to make the computer happy. [Java, anyone? — jgoerzen]

On the other end of spectrum, we often shy away from abstracting huge legacy code because we are afraid of breaking the complex interplay of flow control and global and mutable variables. Besides, the paths leading to common targets of refactoring–those Design Patterns–are often non-obvious.

Because Haskell makes all side effects explicit, code can be refactored in a safe and automatic way. Indeed, you can ask a bot on to turn programs to its most abstracted form for you.

Go check out the interview (page 2) for more, including a demo program that Autrijus wrote to show off Haskell.

Thanks to metaperl for the link.

Digikam

Back when I first got my digital camera (a Canon Digial Rebel), I knew I had to find some sort of program to keep track of my photos. I looked at many different programs on Linux, but none of them really did what I wanted. I’ve used some iView software on the Mac some times. While it can do what I want, its database is proprietary, which annoys me. It means, among other things, I can’t write my own programs to pull data from that database.

Lately I’ve been checking out the Linux photo management scene again, and I’ve got to say that digiKam is quite the impressive piece of work.

It has a versatile database, nice interface, and loads of features. Its database uses sqlite, so writing my own programs to work with it will be a snap. I’ve been using version 0.7.x, and it looks like the 0.8.x beta will address all of my few remaining complaints.

I’m moving everything over to digiKam.

Kudos to the digiKam deveopers.

Recent Coding

I’ve been busy coding lately. Here’s what I’m up to:

  • A Haskell binding to OpenLDAP. I’ve got the groundwork laid (I can connect and bind to a LDAP server by now). Next up: searching. After that, the rest should be fairly easy. ETA about 1 week. Development sources: fetch with darcs get http://darcs.complete.org/ldap-haskell. See also the related haskell-cafe thread.
  • Packaged up and uploaded hsffig to Debian. hsffig will parse C .h files and automatically generate Haskell bindings and prototypes for them. It requires zero human assistance. Very, very, very cool. A little rough yet, but this is exciting stuff. Check out the source package with darcs get http://darcs.complete.org/debian/hsffig.
  • Packaged up and uploaded libcdk5, the latest version of the Curses Development Kit (CDK). CDK is a much more high-level tool than ncurses, and lets you say things like “show a dialog box” instead of “draw a border from 3,20 to 3,70 and make it gray”. Check out Debian source package with darcs get http://darcs.complete.org/debian/libcdk5.
  • Updated my MissingH Haskell library so it now builds and runs properly on Windows platforms. I now remember how much I detest them. (Urgh, drive letters complicate path manipulation in millions of annoying ways.)

Looking For Text-Mode Widget Library

I’m looking for a text-mode widget library. Something that has dialog-boxes, etc. for text-mode (curses/console/xterm) programs.

I’ve looked at these so far:

  • tvision/tv/turbovision: Questionable license situation, unsuitable for Debian
  • CDK: Fine on *nix, but unusable on Windows
  • CTK: Not maintained for several years, looks dead, not as good as CDK anyway

I want something with a C library, that supports *nix and Windows, and has support for things like menus, dialog boxes, etc. Any suggestions?

Drupal Doesn’t Stop Spam

I run Drupal for this site, as well as some others hosted here. My complaint about it is that the spam solutions in Drupal are ineffective and poorly-designed. The situation seems to have actually gotten a bit worse in the most recent versions of Drupal. Here are my complaints:

  • No working support for captchas. (I had lots of problems with captcha.module)
  • Spam filter is not very effective, despite being properly trained on huge volumes of spam. I get dozens, if not hundreds, of uncaught spam comments per day.
  • The “mark as spam” button has no effect on some very large spams.
  • There is no feedback to users whose comments have been marked as spam, indicating to them that the comment will be manually approved.
  • There is no auto-expiry of spam comments; they sit in the database forever unless manual action is taken.
  • Deleting spam comments — which seems to be the way that people are encouraged to use the spam module — requires: checking one checkbox per message, then selecting “delete”, and repeating this for each page of the spam comment listings (it only puts a few dozen per page; I get about 15 pages worth in a slow day.) Even with some Mozilla toolbar help, this is a slow and cumbersome process.
  • No “auto-delete” feature for spams referencing certain URLs.
  • Poor recognition of &-sequences in HTML
  • Nobody really maintains the spam filter
  • Does nothing at all to stop trackback spam

So, my question is: what blogging software has good anti-spam capabilities?

Back when I used WordPress, I used the Captcha module for it, which worked well. (Its normal anti-spam capabilities didn’t.) Drupal doesn’t have a working Captcha module, and everything else is hugely labor-intensive.

Is there something better out there for Drupal anywhere?

I often get the impression that the authors of the spam module in Drupal get less than a dozen spams per day on their blogs. It simply doesn’t scale to places that get hundreds of spams per day.

(Update: Drupal also isn’t very responsive at addressing bugs…)

Linux, Bluetooth and Mobile Phones

I got my first Bluetooth-enabled mobile phone this week, a Motorola v551. I’ve been playing with the Linux utilities for working with mobile phones and have assembled some links. Most of the pages out there seem focused on SMS features of a mobile, or using a mobile phone for Internet access for a Linux box. I’m interested in neither, and care more about phone book syncing and transferring files back and forth between the phone itself and a PC.

There seems to be quite a community built around hacking Motorola phones as well. The Hofo Guide is the authoritative resource.

HowardForums.Com is also a great site.