Thursday, May 23, 2013

My Stikky (23 May)

get the max of two integers without using if/else or < , > operators

int z = x ^ y;
int b = getB(z); // the highest diff-bit index between x and y
int sX = (x & z) >> b;
int sY = (y & z) >> b;
int max = 
(x * sX + y * sY + x * (sX ^ sY ^ 1)) & ~((x >> 31) ^ (y >> 31))
+
(((x >> 31) ^ (y >> 31))&1) * (((x >> 31)&1)*y + ((y >> 31)&1)*x);

Sunday, February 24, 2013

Sunday, January 20, 2013

My Stikky (20 Jan)

" Any fool can write code that a computer can understand
Good programmer write code that human can understand "
Martin Fowler

Sunday, January 13, 2013

My Stikky (Jan 13)



I will choose a lazy person to do a difficult job;

because, he will find an easy way to do it!

© Bill gates quote


so I will keep waiting for their call :D

Wednesday, January 2, 2013

My Stikky (Jan 02)

Whether you think you can, or you think you can't--you're right” 

Tuesday, January 1, 2013

My Stikky (Jan 01) [2]

There are 10 types of people:
those who understand binary,
and those who don't !!


©CSED 2010  (Alexandria University, Faculty of Engineering, Computer and System Engineering dept)

My Stikky (Jan 1) [2013]

1/1/13

Just to be the first to post on the first day of

the year 2013.