Skip to main content

Posts

Showing posts from September, 2006

A Test::Class gotcha

I'm working on a project that involves building a prototype application in Perl. I've made extensive use of Perl's OO features and have a collection of classes that implement the mathematical calculations necessary to drive the web site running the application. Naturally, as I've been building the classes I've been building a unit test suite. Since Test::Class is the closest thing Perl has to junit or cppunit I'm using it to test all the class methods in my Perl classes. Everything was looking good until I told the guy writing the server to integrate with my code. His code died with an error like this: Can't locate object method "new" via package "Class::A" (perhaps you forgot to load "Class::A" at Class/B.pm line 147. Taking a quick look inside Class::B revealed that it did try to create a new Class::A object and that, sure enough, there was no use Class::A; anywhere in Class::B . Easy enough bug to fix, but w

Image spam filtering BOF at Virus Bulletin 2006 Montreal

I'm leading a BOF meeting at Virus Bulletin 2006 in Montreal next month. The idea is to get together in one room for a practical, tactical meeting to share experiences on how people are currently filtering image spam and what might be done in future (and what we expect spammers to do). I've already got commitments from major anti-spam vendors to be there and talk (as much as they are permitted) about their approach and I'll try to cover what the Bayesian guys are doing. If you are interested please email me, or post a comment here. If you represent a vendor and want to be involved I'm especially interested to hear from you as I want to get all experiences out on the table (as much as is practical). Date and Time Confirmed: Thursday, October 12. 17:40 to 18:40 in the Press Room. Downloadable PDF flyer .

A C implementation of my simple GPS code

Reader Chris Kuethe wrote in with a version of my simple code for entering latitude and longitude to GPS devices written in C (my demonstration code was in Perl). Seems Chris is a bit of a GPS fanatic and maintains a page on GPS hackery. He ported my Perl code to C and is releasing the code freely. He gave me the choice of releasing under two clause BSD license or making it public domain. I think the most generous is public domain (especially since the Perl code was public domain). Here's the code to compute a SOC: #include <sys/types.h> #include <stdio.> int main(int argc, char **argv){ int i, j; unsigned long long lat, lon, c, p, soc_num; char soc[11], *alpha = "ABCDEFGHJKLMNPQRTUVWXY0123456789"; int primes[] = { 2, 3, 5, 7, 11, 13, 17, 23, 29, 31, 37 }; float f; if (argc != 3){ printf("Usage: %s <lat> <lon>\n", argv[0]); exit(1); } sscanf(argv[1], "%f", &f); lat = (int)((f + 90.0) * 10000.0); ss

Optimal SMS keyboard layouts

One of the things I find very frustrating about typing SMS messages on my phone is that I often find that the next letter I want to type is actually on the same key that I just pressed. And that slows me down because either I wait for the timeout, or I click the right arrow key to move on. For example, here's a standard keyboard on cell phones: abc def 1 2 3 ghi jkl mno 4 5 6 pqrs tuv wxyz 7 8 9 Very common English letter pairs such as 'ed' and 'on' appear on the same key meaning that if you need to type one of these you are going to incur the cost of dealing with the 'next letter is on same key' problem. In addition, the most common English letters are more than one click away; the most common English letter 'e' is two clicks, 'o' is three, 'n' is two, etc. What you really want is a keyboard layout that means that most common letters are as few clicks away as possible, and that the common letter pairs

Subliminal advertising in spam?

Nick FitzGerald sent me a great example of subliminal advertising in a spam message. At least that's what he thinks the spammer might have been up to. The spam contains an animated GIF with four frames. One of the frames (which contains the actual spam message) remains visible for 17 seconds. The other three frames are displayed for 10ms or 40ms, and each of those contains a little random noise and the word BUY in random positions. Was the spammer really hoping to make us fall for his pump and dump scam with a quick flash of BUY on screen? Here's the actual GIF with the animation in place (watch out you might be forced to BUY :-) And there are the four separate frames: 10ms 17s 40ms 40ms