Showing posts from May, 2013

yii Fatal error: Class 'PDO' not found in ...

add php.ini with the below line and put it to the root of my website on my share hosting where the operating system used is linux.

Four Men in Hats

Shown above are four men buried up to their necks in the ground. They cannot move, so they can only look forward. Between A and B is a brick wall which cannot be seen through.
They all know that between them they are wearing four hats--two black and two white--but they do not know what color they are wearing. Each of them know where the other three men are buried.
In order to avoid being shot, one of them must call out to the executioner the color of their hat. If they get it wrong, everyone will be shot. They are not allowed to talk to each other and have 10 minutes to fathom it out.
After one minute, one of them calls out.
Question: Which one of them calls out? Why is he 100% certain of the color of his hat?

This is not a trick question. There are no outside influences nor other ways of communicating. They cannot move and are buried in a straight line; A & B can only see their respective sides of the wall, C can see B, and D can see B & C.

gets current working directory

echo getcwd();

A Farmer's Good Fortune

A farmer from a small community is out of money. After a mysterious desease spread among and killed his lifestock, he now needs to quickly make up for the lost animals. He needs a whole grand.
Knowing that the bank won't lend him any money, he pays a visit to the local loan shark. The outlaw, who's known to have a bit of an obsession with puzzles, proposes a deal.
With the $1,000 he gets, the farmer has to be able to buy a combination of cows, pigs, and sheep, to total exactly 100 heads of lifestock. The combination has to include at least one cow ($100 each), one pig ($30 each), and one sheep ($5 each). The total amount of money spent for the 100 animals has to equal exactly $1,000.
If the farmer manages to accomplish the task, he'll have to return the money with a "friendly" interest rate. Otherwise, he'll get the normal rate, and the threat of a broken pinkie...
How many of each kind of livestock did the farmer buy?

The Snail And The Well

There was a small snail at the bottom of a thirty foot well. In desperation to get out, the snail was only able to climb up three feet during the daytime, and reluctantly slide back down two feet at night.
At this pace, how many days and nights will it take the snail to reach the top of the well?