Forked from http://sourceforge.net/apps/trac/allpairs/