Posts

Efficient Captchas

There is a whole lot of buzz in the internet about alternatives to captchas (i mean alternatives to image captchas). Its not mainly because captchas are not secure against bots, but because they aren't convenient!!! People are getting bugged because of highly illegible captcha strings (http://tinyurl.com/5bvk7c). But i really feel, captchas, if done properly are the best form of human recognition technique. Its simple, fast, and sufficiently secure. People are used to image captchas, and it just works! I get more bugged when I'm asked silly questions, or to solve a mathematical equation or when i have to select kittens out of 9 pictures of animals!!! I put up some points here on how to create usable and convenient captchas: 1. Use a light background. I'll prefer a plain white background. Backgrounds do provide some security but having a regular background for all captchas does not helps as an average captcha solving algo will adapt itself to it. So, its always better to pre...

Shortest* Javascript Code that prints its own Code!

This is one of the challenging tasks for any programming language: Write a code that prints itself on the terminal! To make it more interesting… code it short! I took a shot at javascript and came up with the following code. If you can come up with shorter code, DO POST AS COMMENT! Lets see who’s short&smart! The Code (177 chars, tested on FF3): var dq='"';var q="'";var s='document.write("var dq="+q+dq+q+";var q="+dq+q+dq+";var s="+q+s+q+";"+s);';document.write("var dq="+q+dq+q+";var q="+dq+q+dq+";var s="+q+s+q+";"+s); Your turn now… I’m waiting!

Coolest Programming Convention Ever!!!

Really don’t know how many of you actually heard of this... This coding convention is really cool: It goes like this: For equivalence statements, keep the constant on the left side. Eg. a == 3; //Not Good 3 == a; //Gr8! How it helps???? It will help you in situations where you "mistakingly" used a "=" inplace of"==". a = 3 compiles to true While, 3 = a generates a compile time error!!! Wow!! Isn’t it!