Wednesday, November 12, 2008

PHP max integer value (and min also :))

My colleague was looking for how to obtain min int value in PHP.
One of the pages I found contained an article advised PHP_INT_MAX constant.

Seems ok at first sight, right?


The first thing cames to mind is - there must be PHP_INT_MIN constant (as there is a function in PHP for each coders breath - it's natural PHP way) - but there isn't!
More of that, article author suggests to calculate min value:
Note that the PHP_INT_MAX also determines the smallest negative number – just multiply it by -1 to get the PHP integer minimum.
And its not his fault. Its "best" PHP practices - +-1 in such big numbers - who really cares of that :)

Thats why I don't like PHP, and there is much more - why I hate it :)

P.S. PHP int min is of course: (-1 * PHP_INT_MAX ) - 1

Wednesday, October 22, 2008

Linux shell commads

Occasionally I have to perform some operations in Linux shell.
MC helps a lot, but there are some commands I have to google for each time I need them.
So here I will have a storage of some shell commands.

File compression (Creating archives in linux)

Create tar archive
tar -cvf compr.tar dir

The same gzipped
tar -czvf compr.tgz dir

from red-hat site

Sunday, August 24, 2008

Yet another blogger

Hi there!

Just started my first blog.
Actually I am in need of researching blogspot backend functionality, but who knows, maybe I'm a future super-blogger here ;)