Can The Spam

Yesterday morning my blog was flooded with a huge amount of spam (about 40+ in about an hour). I think that the use of any popular blog software (be it WordPress, Movable Type, Blogger) will make you an easy prey for spammers. I know of a couple of people that rolled their own software and haven’t had any spam issues. I have only had one incident of spam since my blog was first made public, but it’s definitely something that I don’t like.

Here’s my list anti-spam initiatives that I intend to take, depending on how bad I feel my spam threshold is being violated:

  1. WordPress Comment Moderation – The latest version (at least available from CVS) includes a comment moderation facility (like MT’s blacklist plugin). This can help you block known aggressors but still requires you to approve/delete each of comment.
  2. Change the name of the page being spammed – As of yesterday, I have renamed the standard wordpress comments page to something else. If this keeps spammers at bay for a while, I’ll be quite happy with that. If they seem to keep up with the changes (am I really worth the effort guys?), I might write a cron script or something to change the name daily.
  3. Change the name of the fields that are posted – Requiring a little more tweaking of the actual code (yay opensource!), I next intend to change the name of the parameters that are submitted, hopefully rendering spammer’s scripts somewhat useless.
  4. Port the security code (SCODE plugin) from MT to WordPress – If it comes down to it, I’m willing to plunge my head straight into PHP just to prevent spam.
  5. Adopt a Bayesian Filter – Brett mentioned this seemed to work quite well on some blogs but requires a bit of training. I hope not to have to get to this point.

I haven’t thought about how I can prevent spams from TrackBack URIs just yet, but I’ll cross that bridge when I come to it. If anyone has any other ideas, I’d love to hear about them, just to add to my arsenal (or should that be my canning factory?).

Update 23 Nov:
After reaching the second threshold in my anti-spam checklist, a simple check of the logs informs me that 176 spam comments have been blocked!

Consequences Of Living On The Edge

We’ve been lucky enough on my current project to move to the latest and greatest Java Software Development Kit (J2SE 1.5). It’s one of those small things that we seem to have a fair (though not total) amount of control over. I think (though I am keen to hear otherwise) that it is the only project in our company who has moved onto this platform in production. I shudder of thinking back to my previous project where we were constrained to Java 1.1.8!

Our team has been developing and testing on the new platform for the last few weeks to ensure that our code remains operational and stable. Here are a few things that we had to do in order to upgrade and you might like to consider if you plan on working with the latest version:

  • Upgrade your IDE – We use the best java IDE as our main development front end. I was previously running an old 3.5 version, and had to upgrade to the newer 4.2 version for support of new language features like Generics. I was glad that we were forced to move only after 4.2 was available because other developers had found many bugs in 4.0.
  • Ensure integration test coverage is high – This project relies on a smaller number of libraries in comparison to my previous project, but our high level of integration tests ensured all of the functions our code exercised worked, or at least we found out what did not. For example, our version of the BeanUtils library didn’t handle some of the things we used it for very well.
  • Test your toolkit – As I mentioned earlier in a previous post, coding style on our project is enforced by a tool called Checkstyle. The latest release does not cope well with the new lexical changes to a Java file so we had to build one based the latest source in their repository (thanks to opensource software!).
  • Exercise new features naturally – Our IDE allows us to configure at what level SDK (1.3, 1.4, 5.0) we would like our syntax to be validated against, and although we were supposed to keep it at 1.4 because the latest version of Checkstyle could still not parse all the new constructs, I accidentally left mine at 5.0. A fellow developer later discovered I had committed some code that exercised Autoboxing without even realising it. Such a nice language improvement (now if only Checkstyle wouldn’t die over the new for-each construct)!

Update Nov 8:

We use YDoc to generate UML diagrams in our javadoc (and to make our Business Analysts happy). YDoc is built with a heavy dependency on JDK1.4.2’s Standard Doclet (that was refactored in the latest JDK). This means that although we can generate standard javadoc, our nice UML diagrams no longer appear. I’ve sent an email to the company (as I have no idea where to find technical support on their site) and now we wait…

Optimising Java Regular Expressions

Yesterday I had a bit of interesting work performancing tuning some code for our project’s current iteration. The code that required optimisation basically filtered some results in memory based on a set of user-specified criteria. The criteria contained a variety of different datatypes (boolean, numeric and string) and my suspicions were confirmed after a bit of simplistic profiling that the biggest consumer of computation time was the string pattern matching that was being performed.

So here are a few tips for optimising Regular Expression usage in the Java langauge: Read more “Optimising Java Regular Expressions”

The Value in Checking Your Style

Increasing code quality is something that is currently being driven hard in our project. I am a big fan of weeding out code to make way for better smelling things like patterns and easily unit testable code. Many people have attempted to quantify code quality using metrics and a variety of tools to enforce these metrics. Checkstyle is one of these tools that we employ to encourage code quality (I qualify this because using these tools do not automatically equate to high quality code).

Read more “The Value in Checking Your Style”

Melbourne Global Tech Conference

Some people may hate the idea of flying, after a long week at work to another city in order to participate in a technical conference, only to fly back at the start of the next one. Luckily for me (and everyone else I work with) those people don’t work for the same company as we do. This company internal conference, aptly named the Global Tech Conference creates an environment for all of the Australian employees and a number of international employees from all the various offices to get to know more about the faces behind the names and is guaranteed to be full of heated discussions, open debates and the latest technologies.

There is no way that I could do justice to the entire weekend by capturing the experience in words so I will leave it there. A big shout out to anyone who might have been there and is currently reading this – it was great meeting everyone and I hope that we’ll all get to work on something together soon!

Get Firefox

The Mozilla Foundation has been getting a lot of press all over the world about one of their products, FireFox. Firefox is another Internet Browsing Application that is the first to be taking marketshare away from Microsoft’s Internet Explorer for the first time ever. I’ve been using it as my default browser since the start of this year and I can highly recommend it. Here’s my list of reasons why your average user should switch (there’s too many reasons for all other techies not to switch):

  • It’s smaller and faster – Lightweight and efficient, what more do you want?
  • Better downloading options – If you hate being asked where to save things all the time, you have the option of selecting a particular directory for all downloads you choose to follow.
  • So many useful (and some not-so-useful but fun) extensions – A good catalogue of extensions makes the browser even more useful and productive. The web developer console is especially useful for everyone despite its name. If you’ve ever been unable to right-click on a link to open it in a new window or save something, simply select Disable -> Disable Javascript from one of the menus and right-click to your hearts content. There’s no need to restart the browser.
  • Tabbed Browsing – Better management of windows without having so many items in your taskbar.
  • Intuitive Interface – A slick default interface makes it easy to find everything you need.
  • Improved Security – Although everyone package has some vulnerabilities, the latest version of Firefox is the most secure browser you can get for your Windows box.
FireFox

Ridiculous Ways To Refactor

In any agile environment (and just damn good software engineering in general), refactoring forms (or should form) part of your normal everyday coding. Correcting issues like ‘this-could-be-called-a-better-thing’, or ‘this-is-not-quite-in-the-right-spot’ is usually performed at the quick flick of a button (at least with a nice IDE, and more importantly with a lot of thought). See Fowler’s Bliki for more about Refactoring.

Read more “Ridiculous Ways To Refactor”