Saturday, April 9, 2011

IE9 fonts rendered badly and it waste its title bar screen real estate

IE9 fonts rendered badly. And oh.. it wasted screen real estate, the tabs fits perfectly on IE9's title bar, look through IE9's title bar, behind it are Google Chrome's tabs :-)


We love Google Chrome

Wednesday, December 15, 2010

XKCD 541 Emoticon Conundrum

Answer to emoticon conundrum http://xkcd.com/541/

When on Mac, press option+command+t and select the happy face character. Unfortunately that don't solve the problem entirely, there's no wink character ;-)

Enable Aero Glass on Yahoo Messenger

To enable aero glass on Yahoo Messenger. right click YahooMessenger.exe, choose Properties, Compatibility and check Disable Visual Themes

Tuesday, December 14, 2010

Open Finder from Terminal

Use: open .

Michael-Buens-MacBook:~ Michael$ cd /etc/apache2
Michael-Buens-MacBook:apache2 Michael$
Michael-Buens-MacBook:apache2 Michael$ open .

That will launch Finder from /etc/apache2 folder

Decimal and Float Gotchas

I advised my brother(they use Postgres in their work too) to use decimal(aka numeric) instead of float. I told him decimal follows paper and pencil approach for computation, and float is a binary system for approximating decimal number and as such is more prone to irregular representation of number.


Today my brother ask me why this doesn't show 1:

select 1::numeric / 12 * 12

Outputs: 0.99999999999999999996

What I answer is, numeric is honest; if it shows you it's not 1, it's not 1. While float might look like 1, but it's not exactly 1. Example:


select n, z, z = 1 as is_equal
from
(
select n, 1::float / n * n as z from generate_series(41,50) as x(n) 
) as x 

Outputs:
 n  | z | is_equal 
----+---+----------
 41 | 1 | t
 42 | 1 | t
 43 | 1 | t
 44 | 1 | t
 45 | 1 | t
 46 | 1 | t
 47 | 1 | t
 48 | 1 | t
 49 | 1 | f
 50 | 1 | t
(10 rows)