Wednesday, July 20, 2011
4 criminals are caught and are to be punished. The Judge allows them to be freed if they can solve a puzzle. If they do not, they will be hung. They agreed.
The 4 criminals are lined up on some steps (shown in picture). They are all facing in the same direction. A wall separates the fourth man from the other three.
So to summarize:
Man 1 can see men 2 and 3.
Man 2 can see man 3.
Man 3 can see none of the others.
Man 4 can see none of the others.
The criminals are wearing hats. They are told that there are two white hats and two black hats. The men initially don't know what color hat they are wearing. They are told to shout out the color of the hat that they are wearing as soon as they know for certain what color it is.
They are not allowed to turn round or move.
They are not allowed to talk to each other.
They are not allowed to take their hats off.
Who is the first person to shout out and why?
Answer:
If both Man 2, Man 3 have same hat color. Man 1 shouts opposite color to that of Man 2 and Man 3.
If Man 2, Man 3 have different hat color. Man 1 is quiet. So Man 2, shouts opposite color to that of Man 3!
The 4 criminals are lined up on some steps (shown in picture). They are all facing in the same direction. A wall separates the fourth man from the other three.
So to summarize:
Man 1 can see men 2 and 3.
Man 2 can see man 3.
Man 3 can see none of the others.
Man 4 can see none of the others.
The criminals are wearing hats. They are told that there are two white hats and two black hats. The men initially don't know what color hat they are wearing. They are told to shout out the color of the hat that they are wearing as soon as they know for certain what color it is.
They are not allowed to turn round or move.
They are not allowed to talk to each other.
They are not allowed to take their hats off.
Who is the first person to shout out and why?
Answer:
If both Man 2, Man 3 have same hat color. Man 1 shouts opposite color to that of Man 2 and Man 3.
If Man 2, Man 3 have different hat color. Man 1 is quiet. So Man 2, shouts opposite color to that of Man 3!
Labels: Puzzles
Sunday, July 17, 2011
Labels: Puzzles
Labels: Photography
Labels: Photography
Saturday, July 16, 2011
The usual expression is "put something on the back burner". Most gas stoves in our country have two burners. In the U.S., most stoves have four burners — two in the front, and two in the back. I understand dishes are normally put on the back burner when they don't require the cook's immediate attention. So, when you say that you are putting something on the back burner, what you mean is that you are postponing doing it. You are putting the work aside because it doesn't require your immediate attention. Here are a few examples.
*Right now I am busy getting the plans for the house ready. I am afraid I'll have to put my tennis lessons on the back burner.
*Rohini has decided to put everything on the back burner till the end of the semester.
*Bush's plans for invading Syria have been put on the back burner.
*Right now I am busy getting the plans for the house ready. I am afraid I'll have to put my tennis lessons on the back burner.
*Rohini has decided to put everything on the back burner till the end of the semester.
*Bush's plans for invading Syria have been put on the back burner.
Labels: Fun with english
Wednesday, July 13, 2011
Labels: Deepak's Scribble
You must not be led aside by fits of disinclination or annoyance; if you give way to these you will never succeed. Patience and perseverance win the day. "Softly, softly, catchee monkey."
Managers, Teachers, Parents, Users, Stakeholders and other Authority Figures seem to want it done right, done immediately, and never done again (DoItRightTheFirstTime). Of course you can't deliver on such expectations, and in fact most of these Authorities are just your own boojums - the real people behind them know that good work takes time. They're putting pressure on you because they want your best, not because they expect a miracle.
Now sometimes what these folk want is really not difficult to do. You know how to get from A to B, you get into that Mental-State Called Flow, and you do it. But sometimes you haven't got the faintest, or you're damn certain what they're asking for isn't a realistic expectation, or it isn't the right thing at the right time.
Therefore,
Don't meet the insurmountable problem head on, but move slowly, deliberately, compassionately, to surround it. You don't catch your monkey by running into the jungle and trying to flush it out. Monkeys move faster in a jungle than you, and they can always climb and hide.
Step back. Get lazy. Ignore deadlines. Think. Research. Wander. Let the back-burners do some work. Panicking and rushing isn't going to solve a hard problem. Perhaps you're not doing the right thing at the right time. Perhaps there's some other way to balance the forces, or some forces you're neglecting. You won't find the solution by looking for it; it has to find you. Let it.
If you enter the jungle with due pace and caution, but with no idea in your head about catching a monkey, they won't see you as a predator coming. You just mind your business until you see a monkey. They'll be paying you no attention. Then calmly and deliberately notch your arrow and catch your dinner.
Labels: Fun with english
Following is a list of all the available HTTP 1.1 status codes, along with their associated message and interpretation. You should be cautious in using the status codes that are available only in HTTP 1.1, since many browsers still only support HTTP 1.0. If you do use status codes specific to HTTP 1.1, in most cases you want to either explicitly check the HTTP version of the request (via the getProtocol method of the HttpServletRequest) or reserve it for situations when no HTTP 1.0 status code would be particularly meaningful to the client anyhow.
Status Code | Associated Message | Meaning |
---|---|---|
100 | Continue | Continue with partial request. (New in HTTP 1.1) |
101 | Switching Protocols | Server will comply with Upgrade header andchange to different protocol. (New in HTTP 1.1) |
200 | OK | Everything's fine; document follows for GET andPOST requests. This is the default for servlets; if youdon't use setStatus , you'll get this. |
201 | Created | Server created a document; the Location headerindicates its URL. |
202 | Accepted | Request is being acted upon, but processing is not completed. |
203 | Non-Authoritative Information | Document is being returned normally, but some of the response headers might be incorrect since a document copy is being used. (New in HTTP 1.1) |
204 | No Content | No new document; browser should continue to display previous document. This is a useful if the user periodically reloads a page and you can determine that the previous page is already up to date. However, this does not work for pages that are automatically reloaded via the Refresh response header or the equivalent <META header, since returning this statuscode stops future reloading. JavaScript-based automatic reloading could still work in such a case, though. |
205 | Reset Content | No new document, but browser should reset document view. Used to force browser to clear CGI form fields. (New in HTTP 1.1) |
206 | Partial Content | Client sent a partial request with a Range header, and server has fulfilled it. (New in HTTP 1.1) |
300 | Multiple Choices | Document requested can be found several places; they'll be listed in the returned document. If server has a preferred choice, it should be listed in the Location response header. |
301 | Moved Permanently | Requested document is elsewhere, and the URL for it is given in the Location response header. Browsers shouldautomatically follow the link to the new URL. |
302 | Found | Similar to 301, except that the new URL should be interpreted as a temporary replacement, not a permanent one. Note: the message was "Moved Temporarily" in HTTP 1.0, and the constant in HttpServletResponse is SC_MOVED_TEMPORARILY ,not SC_FOUND .Very useful header, since browsersautomatically follow the link to the new URL. This status code is so useful that there is a special method for it, sendRedirect .Using response. sendRedirect(url) has a couple ofadvantages over doing response. setStatus and response. . First, it is easier. Second, with sendRedirect ,the servlet automatically builds a page containing the link (to show to older browsers that don't automatically follow redirects). Finally, can handle relative URLs, automatically translating them toabsolute ones.
Technically, browsers are only supposed to automatically follow the redirection if the original request was See the 307 header for details. |
303 | See Other | Like 301/302, except that if the original request was POST ,the redirected document (given in the Location header)should be retrieved via GET . (New in HTTP 1.1) |
304 | Not Modified | Client has a cached document and performed a conditional request (usually by supplying an If-Modified-Since header indicating that it only wants documents newer than a specified date). Server wants to tell client that the old, cached document should still be used. |
305 | Use Proxy | Requested document should be retrieved via proxy listed in Location header. (New in HTTP 1.1) |
307 | Temporary Redirect | This is identical to 302 ("Found" or "Temporarily Moved"). It was added to HTTP 1.1 since many browsers erroneously followed the redirection on a 302 response even if the original message was a POST , even though it really ought to have followed theredirection of a POST request only on a 303 response.This response is intended to be unambigously clear: follow redirected GET and POST requests inthe case of 303 responses, only follow the redirection for GET requests in the case of 307 responses. Note: for some reason there is no constant in HttpServletResponse corresponding tothis status code. (New in HTTP 1.1) |
400 | Bad Request | Bad syntax in the request. |
401 | Unauthorized | Client tried to access password-protected page without proper authorization. Response should include a WWW-Authenticate header that the browser would use to pop up a username/password dialog box, which then comes back via the Authorization header. |
403 | Forbidden | Resource is not available, regardless of authorization. Often the result of bad file or directory permissions on the server. |
404 | Not Found | No resource could be found at that address. This is the standard "no such page" response. This is such a common and useful response that there is a special method for it in HttpServletResponse :sendError(message) . The advantage of sendError over setStatus is that, with sendErr or,the server automatically generates an error page showing the error message. |
405 | Method Not Allowed | The request method (GET , POST , HEAD ,DELETE , PUT , TRACE , etc.) wasnot allowed for this particular resource. (New in HTTP 1.1) |
406 | Not Acceptable | Resource indicated generates a MIME type incompatible with that specified by the client via its Accept header.(New in HTTP 1.1) |
407 | Proxy Authentication Required | Similar to 401, but proxy server must return a Proxy-Authenticate header. (New in HTTP 1.1) |
408 | Request Timeout | The client took too long to send the request. (New in HTTP 1.1) |
409 | Conflict | Usually associated with PUT requests; used forsituations such as trying to upload an incorrect version of a file. (New in HTTP 1.1) |
410 | Gone | Document is gone; no forwarding address known. Differs from 404 in that the document is is known to be permanently gone in this case, not just unavailable for unknown reasons as with 404. (New in HTTP 1.1) |
411 | Length Required | Server cannot process request unless client sends a Content-Length header. (New in HTTP 1.1) |
412 | Precondition Failed | Some precondition specified in the request headers was false. (New in HTTP 1.1) |
413 | Request Entity Too Large | The requested document is bigger than the server wants to handle now. If the server thinks it can handle it later, it should include a Retry-After header. (New in HTTP 1.1) |
414 | Request URI Too Long | The URI is too long. (New in HTTP 1.1) |
415 | Unsupported Media Type | Request is in an unknown format. (New in HTTP 1.1) |
416 | Requested Range Not Satisfiable | Client included an unsatisfiable Range headerin request. (New in HTTP 1.1) |
417 | Expectation Failed | Value in the Expect request header could not bemet. (New in HTTP 1.1) |
500 | Internal Server Error | Generic "server is confused" message. It is often the result of CGI programs or (heaven forbid!) servlets that crash or return improperly formatted headers. |
501 | Not Implemented | Server doesn't support functionality to fulfill request. Used, for example, when client issues command like PUT that server doesn't support. |
502 | Bad Gateway | Used by servers that act as proxies or gateways; indicates that initial server got a bad response from the remote server. |
503 | Service Unavailable | Server cannot respond due to maintenance or overloading. For example, a servlet might return this header if some thread or database connection pool is currently full. Server can supply a Retry-After header. |
504 | Gateway Timeout | Used by servers that act as proxies or gateways; indicates that initial server didn't get a response from the remote server in time. (New in HTTP 1.1) |
505 | HTTP Version Not Supported | Server doesn't support version of HTTP indicated in request line. (New in HTTP 1.1) |
Labels: Internet
Tuesday, July 12, 2011
Subscribe to:
Posts (Atom)