Stupid code: Acronym solver

Solver is invalid actually, guesser is more correct. It just randomly puts words in place of the letters.

For example, it "solved" laser into:

lack anniversary slave enormous regard

And /dev/iron became:

/ distribution experiment vehicle / insist racism overnight nation

I wrote this code for fun but it has turned out to be maybe the most efficient piece of code I have ever written, which is kind of annoying since it doesn't have any real purpose. The magic link:

http://iron.randombase.com/acronym

Why I think AJAX is awesome

Yes, it's awesome, but only in the hands of a qualified coder.

AJAX (asynchronous Javascript and XML) is a technology that allows the client (browser) to fetch a webpage or file without having to reload the page. That's it, it's that simple (my IT teacher will kill me though for that explanation). The major advantage of AJAX is clear: way more advanced applications from your browser, good example is Gmail: it barely loads and new page but still manages to show all your mails, smoothly. The fun thing about Gmail is it actually lets 90% of the parsing of data to you, all they have to send is some raw data (XML) and some Javascript, and once put together you get a neat interface to webmail.

That's one advantage, but the second advantage is bandwith. This is and will always be an issue for enormous websites (ever noticed how Google isn't even xhtml valid?), and AJAX can save you some bandwith. Instead of sending a complete interface every time with the content, why not make the content dynamically added and just send the interface first? You can save some kilobytes by just having to send the content each time a hyperlink is clicked. Now even "static" HTML pages can act like a PHP page that uses include().

There is also a disadvantage (what'd you expect?): search engines just can't read the content that is dynamically triggered. This can be solved by coding two versions of your page, but this takes longer and no one likes to spend hours on duplicating their own code, eh?

The ultimate captcha

Finally the antispam industry came up with something working, instead of creating an unreadable image with words that go all over the place, create something that only humans can recognize. The most famous example are "The Rapidshare cats". A poll on our homepage showed about 80% hated them, but they have no idea what poor RapidShare is going through with the captcha crackers.

A common question is "why not just add two pictures, cat and dog, and make the human user select which one?". Well, the answer is simple: if spammers have a success rate over 5%, they consider it to being profitable. So, that's why they combined it with the old textbased captcha.

Personally, I believe the idea is awesome, but the realisation could have been done better and as usual: less annoying for the end user. Maybe they should try to implement some sort of rotating system showing different types of captcha's all the time?

Wordpress Widget: Time spent on blog

A free thing, isn't it awesome? This little widget shows the total time spent by your users on your blog, with a precision of about two seconds. Your users also get to see how much time they have spent themselves. A demo + download can be found here.

Tested on Internet Explorer 6 and Firefox 3 (RC1).

(before anyone asks: yes, it is based on my previous posts' code)

Notepad++ is just better

Having professionnaly wrecked my Linux box, I'm on Windows again, too lazy to fix it. Luckily, there are programmers who understand the need for a good editor, without all the extra shit you'll use once to play with it. Syntax highlighting in Notepad++ is the best I've ever seen in an editor, whatever language you program in. The colors also don't burn your eyes out (exit: Microsoft Script Editor), which is a nice little extra of course.

So, when you're on Windows, you better use Notepad++. When on Linux, well, ... I'm not gonna say anything since this has always been some hot topic and I don't want my house burned down by a bunch of angry protesters.

but we all know gedit is the best

What has kept me busy for the last few days

I have had quite a busy weekend, on programming side that is. I'm currently working on a brand-new project in a niche that I am extremely unfamiliar in, being everything that children to adolescents should like. When the project is finished it will probally appear in my portfolio. The work I'm doing for it will be mainly coding as usual, at the moment I'm working on an upload menu with a Wordpress admin frontend to approve/disapprove images. A blurred screenshot of it can be found below.

Admin menu of the plugin

My first line of Perl code

When browsing through my Perl folder, I came across my first line of code in Perl, written in 2006:

for($start="a";$start ne "zzz";$start++) { print $start."\n"}

I'm wondering now if I just copied that from some tutorial or actually wrote it myself :) .