Thursday, October 21, 2010

Honesty

There was a farmer who sold a pound of butter to the baker. One day the baker decided to weigh the butter to see if he was getting a pound and he found that he was not. This angered him and he took the farmer to court.

The judge asked the farmer if he was using any measure. The farmer replied, "Your Honor, I am primitive. I don't have a proper measure, but I do have a scale."

The judge asked, "Then how do you weigh the butter" The farmer replied "Your Honor, long before the baker started buying butter from me, I have been buying a pound loaf of bread from him. Every day when the baker brings the bread, I put it on the scale and give him the same weight in butter. If anyone is to be blamed, it is the baker."

What is the moral of the story? We get back in life what we give to others.

Honesty and dishonesty become a habit. Some people practice dishonesty and can lie with a straight face. Others lie so much that they don't even know what the truth is anymore. But who are they deceiving? Themselves – more than anyone else.

Thursday, June 17, 2010

LEADERSHIP & CRITICS

One of the challenges for anyone dedicated to expressing their leadership best is dealing with the chattering voices of naysaying critics. As a matter of fact, the more brightly you shine in your work and the more quickly you innovate and the more excellent you become, the more foulmouthed critics you will attract. It's just part of the game. Emerson said it brilliantly: "Great people are always misunderstood."

Here some key insights to help you fly in your career (and within your life), in the face of criticism:

#1: To lead is to often be unpopular.
Leadership isn't a popularity contest. Leadership is about having the bravery to do what's right versus what's easy. That attracts criticism. Why? Because people don't like change. And they don't want to change. To truly lead is to disrupt the way things were-and are (in an effort to make things better). And rather than having the openness and courage to embrace the change, most people would rather shoot the messenger, in an effort to preserve the status quo.

#2: Critics Can Serve You. Sometimes, there is some truth to what your critics are saying. Smart leaders have the intelligence to discern the difference between the misguided ramblings of those seeking to knock them down and negative feedback that has truth beneath it. Each of us can get to a whole new level of excellence by improving our weaknesses.

#3: You Can Create More Value Amid Your Critics than With Your Fans.
Yes, moving your closely cherished vision/mission/ideals/goals forward in the face of people throwing stones (or even simply laughing) at you is hard work. But, ultimately, doing what you believe to be right/good/important surrounded by critics is more valuable than doing all that alongside your supporters. Why? Because the critics are resisting what you are trying to change. And if you can positively influence them (even a few of them), then you've advanced your mission much more significantly that preaching to the converted.


By : Robin Sharma (http://www.robinsharma.com/)

Tuesday, May 11, 2010

Sending a POST Request Using a URL

Very useful source code to make any http post call. Some of you will find it trivial..
See also Sending a POST Request Using a Socket.

try {
// Construct data
String data = URLEncoder.encode(
"key1", "UTF-8") + "=" + URLEncoder.encode("value1", "UTF-8");
data += "&" + URLEncoder.encode(
"key2", "UTF-8") + "=" + URLEncoder.encode("value2", "UTF-8");

// Send data

URL url = new URL(
"http://hostname:80/cgi");
URLConnection conn = url.openConnection();

conn.setDoOutput(true);

OutputStreamWriter wr = new OutputStreamWriter(conn.getOutputStream()
);
wr.write(data);

wr.flush();

// Get the response

BufferedReader rd = new BufferedReader(new InputStreamReader(conn.getInputStream()));
String line;

while ((line = rd.readLine()) != null)

{

// Process line...

}

wr.close();

rd.close();

} catch (Exception e) { }


Source: http://www.exampledepot.com/egs/java.net/Post.html