October 2011
1 post
1 tag
Rounding decimal value to 0.0 or 0.5
Today morning I was need to convert values ranging 0.0 to 1.0 where rounding will be necessary 0.0 or 0.5. For instance, if your original value 7.3 it should be floored to 7.0 and on the other hand if your value is 7.8 it should be floored to 7.5.
The original code was written by Indian developers where they thousands if-else conditions like
if (value >= 0.0 && value < 0.5) ...
August 2010
1 post
3 tags
HOW TO: Setup XDebug on XAMPP and Eclipse
Before proceeding with the setup, it’s recommended to note down few things which may save couple of hours.
Your PHP version [Write a PHP file with <?php phpinfo(); ?> to get the version]
Your Windows version (32-bit or 64-bit) [See System Properties]
Now go to XDebug Download page and you will see Windows binaries with having some version information. Download the XDebug DLL...
July 2010
2 posts
1 tag
GMail adds rich text signatures
You can now use rich text as well as images in your GMail signatures.
Currently GMail supports hotlinks to images for using images in your signatures. You can use Photobucket or Imageshack to use inline images in your GMail signatures.
Goto Settings, scroll down on the General tab for Signature section to modify your signature. Also use Insert Image on the Signature textbox toolbar to link...
1 tag
Javascript: Difference between "return false" and...
Most of the times we just write
return false;
or we write
e.preventDefault()
to stop from executing href element in an anchor tag.
return false; just stops the propagation and e.preventDefault() makes the default behavior execution of a tag.
In simple words:
equivalent to return false; is
e.preventDefault();
e.stopPropagation();
March 2010
2 posts
3 tags
3 tags
Thinking ASP.NET in MVC
My web hosting doesn’t support ASAPI_Rewrite and thus cannot use ASP.NET MVC, and I am in love with MVC and of course ASP.NET.
I am currently working on mobile site for my local users and trying to implement MVC architecture.
September 2009
1 post