Posts about Gotcha

ActiveRecord Gotcha

I came across this interesting gotcha while debugging through someone else's rails code. When you set a model's one-to-many attribute(an perhaps other association types as well), let's... more
Posted by Toby on May 01, 09
About programming, ruby, rails and gotcha

Ruby Gotcha of the Day

Okay, so in ruby:>> nil or 'value'=> "value"because nil acts as false when used with boolean operators and any other object acts as true. Now let's assign the result to a temp variable a:>> a =... more
Posted by Toby on Dec 26, 08
About programming, ruby and gotcha

Python Optional Arguments Gotcha

When you use Python optional arguments you should know that the default value you set is static, it is set at the time the function is defined, and does not change after that. If you a mutable type... more
Posted by Toby on Oct 15, 08
About programming, python and gotcha

Javascript Gotcha

offsetTopelement.offsetTop does different things in gecko than IE, best bet is to use the function listed here: http://www.quirksmode.org/js/findpos.html, the code: function findPos(obj)... more
Posted by Toby on Sep 03, 07
About programming, javascript and gotcha