
I know how to make and sell software online, and I can share my tips
with you.
Email
|
Twitter
|
LinkedIn
|
Comics
|
All articles
Comment spam defeated at last
Posted 14 years ago
For years when running this blog, I would have to log in each day and delete a dozen comments due to spam. This was a chore, and
I tried many ways to stem the tide.
Finally, a few months ago, I found a way that worked 100% of the time. This raw text file shows what I'm up against, containing all server variables and full text of every comment I've gotten in the last couple of months.
Here's the code for the comment form below. Can you spot my solution? (No, it's not the "http:" part, which almost worked)
<div class="roundedcornr_top_473174"><div></div></div>
<div class="roundedcornr_content_473174">
<div id=commentBox class=commentBox>
<div class=pad>
<h2>Post comment</h2>
<form action="/blog/index.php" method=POST onsubmit="return validateCommentForm(this);">
Real Name: <input type=text name=displayname /><br>
<span style="visibility:hidden"> Your Email (Not displayed): <input type=text name="email"/></span><br>
Text only. No HTML. If you write "http:" your message will be ignored.
<br>
<textarea cols=60 name=comment rows=10 wrap=soft ></textarea><br>
<input type=submit value="Post" />
<input type=hidden name=id value="75">
</form>
</div>
<div class=comment>
</div>
</div>
</div>
Test Driven Development without Tears
Every company that I worked for has its own method of testing, and I've gained a lot of experience in what works and what doesn't. At last, that stack of conflicting confidentiality agreements that I got as a coop student have now all expired, so I can talk about it. (I never signed them anyway.)
Zwibbler: A simple drawing program using Javascript and Canvas

Now it's a commercial product, but
Zwibbler was once a fun side-project, and here's some details on its implementation.
Succinct Data Structures: Cramming 80,000 words into a Javascript file.

jQuery creator John Resig needs a little help storing lists of words in his side project. Let's go overkill and explore a little known branch of computer science called Succinct Data Structures.
Detecting C++ memory leaks
It's fairly simple to redefine malloc() and free() to your own functions, to track the file and line number of memory leaks.
cairo blur image surface

This really should have been included in cairo. Instead, everyone that wants to have shadows has to roll their own blur function. Here's my take on it. I'll even release this into the public domain.
Exploiting perceptual colour difference for edge detection

Think colour isn't important in image processing algorithms? Let's try it both ways, and see for yourself.
Zero load time file formats
When your app needs to be fast, you can't afford to load things fro disk. In this toy example, an on-disk data structure helps you instantly look up lists of related words.
Spoke.com scam
Rant: Why do companies think they can make money by posting false information about you on the Internet?