Google
 

Sunday, April 23, 2006

cURL

The cURL libraries provide a nice interface for file transfers to and from a webserver. They have support for a wide variety of protocols (like HTTPS) giving them an edge over built-in PHP functions like fsockopen(). The libraries are thread-safe, IPv6 compatible, and will work with any technology that is built on top of HTTP. Whether you are building simple script to fetch a web page, or a secure payment gateway, leveraging the functions built into cURL can save a lot of time.
Definition:
cURL stands for "Client URLs", and was developed by Daniel Stenberg in 1998 as a command line tool. libcurl is a portable library that provides an easy interface to the cURL functionality.
Both cURL and libcurl can transfer files using a wide variety of protocols, including HTTP, HTTPS, FTP, FTPS, GOPHER, LDAP, DICT, TELNET and FILE.
The cURL libraries are truly open source, with an MIT/X derivative license.
Installation:
From PHP version 4.2.3 on, you need a cURL version of at least 7.9.0. From PHP version 4.3.0 on, you need a cURL version of at least 7.9.8.
Linux-After installing cURL (./configure, make, make install), PHP must be recompiled to include cURL support (--with-curl).
If cURL support is enabled, the phpinfo() function will display it in its output.
Windows – A good article can be found here
On windows check for path of php.ini path, for windows default path is C://windows so make sure that you are making changes to correct php.ini file.

Wednesday, April 12, 2006

Try to solve this

Three people enter the room, each with a hat on their head. There are two colors of hats: red and blue; they are assigned randomly. Each person can see the hats of the two other people, but they can't see their own hats. Each person can either try to guess the color of their own hat or pass. All three do it simultaneously, so there is no way to base their guesses on the guesses of others. If nobody guesses incorrectly and at least one person guesses correctly, they all share a big prize. Otherwise they all lose.

One more thing: before the contest, the three people have a meeting during which they decide their strategy. What is the best strategy?

Total time to solve this puzzle is 15 days. After fifteen days you can check this blog to get the correct answer.