November 2007


short circuit operators (&& , ||) differs from non-short circuit operators (& , |) in the way they deal with the right hand side expression.

the short circuit && evaluate the expression on the left hand side first, if it is false so there is no reason to evaluate the right hand side expression, because in all cases the final result will be false.

also the short circuit || evaluate the expression in the left hand side first, if it is true so there is no need to evaluate the right hand side because in all case the final result will be true.

so when using short circuit operators (&& , ||) you should expect that the right hand side expression may not be evaluated at all.

the non-short circuit operators (& , |) are less efficient than short circuit operators because they evaluate the right hand side even they knows that the evaluation of it will make no difference to the final result.

here is an example:

int x =3, y=8;

if(x < y || y++ < 9)

{

System.out.println(” the int y will never be incremented”);

}

the part y++ < 9 will not be evaluated so the int y will never be incremented because the left hand side of the && operator will be true so && operator will escape evaluating the right hand side.

Advertisements

i didn’t know how will be my feeling when i see a plantĀ  that iĀ  put its seed growing up every day.

i had know that the feel of building something is the greatest feeling i could have, but few days ago i discovered that i was wrong, see something, someone or any life object growing and u are helping in that growth is much much greater.

here i put some photos for my micro garden i had start with my wife few weeks ago. we wish this to be our start to have larger one.

CeleryRayhan

the wc command use to count number of characters, words and lines in the input file.

it has the following options

-l prints lines count.

-c print characters count.

-w prints words count.

-L prints the length of the longest line in the file.

example:

wc -l fileName

finally after 4 deployment trials, the new enhancement deployed. i really can’t understand how PHP 4 could behave like an OOP language or how it manage creating objects and keep track of them.

but what i’m really sure about is, after many years working in java it is not easy to work with PHP specially the 4th edition.

many times i was in need to a command or program reading log file and continue read any new updates to that file.
finally i found the command tail, this command by default reads a files and outputs the last 10 lines to the screen, but if u passed the option -f the command will not terminate after display the file content but will stay prints any updates happens to that file.
by this way i open a terminal window and tail the file and all logs will stays prints to my screen.
thanks for tail and for linux.

$ tail -f filename

Salam, i had bad experience about using Red Hat linux from my beginning knowledge about linux. but and there will be always a “But” -does not mean duke – few weeks ago i decided to use Fedora 7 which called moon shine.
i like the GUI so i decided to try.
it is really different and light on my machine. the most interesting thing is the yum command -it is old one but i was not using it -.
i had troubles in opening multimedia file like mpeg files and xvid files.
so i added a new repository to my system repositories by the following command

#rpm -ivh http://rpm.livna.org/livna-release-7.rpm

then i installed all the gstreamer plugins they are all about 25 MB.

# yum install *gstream*

now i can play most of the video files i had.

i’m really now enjoying fedora 7 and waiting for Fedora 8 sooooon.

Salam for all. I’m back again and with a good news, the Cairo Office is ready @ last. i sow many people had spent time and effort to get this place finished -almost finished- but at last we have a real office.
the last thing i was expecting to do anything by my hand in this office because this is not how things should be from my point of view, but i really enjoyed doing that.
Really working @ office is very different , i almost forgot how working @ office looks like, but soon i resume working hardly.
at last 2 of the worst issue i face in my carrier also finished, they was that bad not because they were hard to be solved, but to do anything i had to request thousands of things from other people and the bad connectivity between the 2 offices.
i’m just keeping in my mind that – it is a new office setup. i think it is worth.