Sunday, November 7, 2010

Stieg Larsson: Millenium # 1

The Girl with the Dragon Tattoo (Millennium, #1)The Girl with the Dragon Tattoo by Stieg Larsson


Great piece of work.. Lisbeth and Blomkvist won't let you keep the book down.


View all my reviews


Friday, March 19, 2010

How to check the status of server/host using PHP ?

Recently I came across this trivial problem of checking whether a server is ONLINE or OFFLINE. I tried "Ping" command but the following approach was more elegant.



$host = "127.0.0.1"; // could be any host address 
$port = "80"; //  port you wanna check 

$fp = @fsockopen($host, $port, $errno, $errstr, 2);

if (!$fp) {
echo "DEAD";


else { 
echo "ALIVE";
}


?>

Have fun !

Saturday, January 16, 2010

C/C++ on Windows 7 using Eclipse

If you got a "Launch Failed. Binary Not Found" error while running C/C++ project in Eclipse on a Windows 7 machine then you are not the only one. I came across similar problem and I have tried my best to give a terse solution. The reason for this issue might be because  Eclipse doesn't understand the 64 bit binaries generated by our Windows 7 Though,  I'm not sure. Okay, back to our problem. 


The quick steps that are to be followed to run a C/C++ program on Windows 7 are: 

1. We need compiler for Windows for this we are going to install  the following:


Open exe->Choose download and install-> install Current package->Check MinGW tools, g++ compiler, MinGW make-->install path C:\MinGW->Finish. 


(b) Minsys 


Open downloaded exe-> folder C:\msys\1.0-->For MinGW path give C:\MinGW-> Finish.


2. We set the Path (Environment variables) for these compilers: 
Append following to your Path variables (*can be located in the Advanced tab of System in the control panel under the Environment Variables option - Google it if you still can't locate it)


;C:\msys\1.0\bin;C:\mingw\bin


3. Installing CDT plugin to your existing Eclipse: 


Software Update link is: http://download.eclipse.org/tools/cdt/releases/galileo


4. Create a new  project and run the Helloworld file. 


Done ! 


Post any queries you might have. 
Enjoy!!!