Friday, January 21, 2011

Expectations and Frustrations

We have to understand the link between our expectations and our frustration levels. Whenever we expect something to be a certain way and it isn’t we’re upset and we suffer.

On the other had, when we let go of our expectations, when you accept life as it is, we’re free. To hold on is to be serious and uptight. To let go is to lighten up.

A good exercise is to try to approach a single day without expectations. Don’t expect people to be friendly. When they’re not, you won’t be surprised or bothered. If they are, you’ll be delighted.

Don’t expect your day to be problem free. Instead, as problems come up, say to yourself, “Ah, another hurdle to overcome.” As you approach your day in this manner you’ll notice how graceful life can be.

Rather than fighting against life, pretty soon, with practice, you’ll lighten up your entire life.

Sunday, January 16, 2011

The Broken Painting

Once upon a time, a wellknown painter was finishing his painting. It's an incredibly beautiful painting to be shown during Princess Diana's marriage.

The painter was consumed by and excited with his own painting that he unconsciously took a few step backward while admiring the 2 x 8 m painting. He didn't look back when he walked backward. He kept on walking backward until it was a step away from the edge of the tall building. Just one more step backward and he could get himself killed.

A man saw what the painter was doing and was about to shout at him to warn him when he realized that his shout might have surprised the painter and thus made him incidentally took one step backward and fell down. The man then took a brush and paint and began to paint on the beautiful painting until it was completely damaged.

Upon realizing what's happened to his painting the painter got very angry and moved forward to hit the man. However, some other people who were also present at the vicinity held him and showed him his last position which almost made him fall.

Sometimes we have painted our future with such beauty and dreamed of beautiful days we will spend with our loved one. But then God seemed to destroy our beautiful painting when He sees what danger lies ahead of us.

Sometimes we are angry and annoyed by what God has done to us, or we get angry to our superior in our workplace. But one thing we have to keep in our mind: God provides only the best for us, His children.

Monday, January 10, 2011

Are you still following ur new year Resolutions???

Most of us have defined some new year resolutions. Its just 10 days now & I think very few of us are still able to follow them religiously !!!
Some gave up due to lack of motivation & others because of scarcity of vision.

Ever given a thought, why its happening??? & how can we keep it intact???

Often we set our Goals, but forget to formulate a strict  guidelines to it. (Kind of routine (steps that we need to carry out daily to accomplish the final result).
On the other hand sometime we define some routine to follow, with out any time bound Goal attached to it.

How many of us have written the resolutions in a paper & periodically review them???

You must visualize the end result daily, as if you have achieved it. That vision will give you a lot of motivation to keep moving :-).

In both the case, the chances of successful continuation of process & achievement of substantial result is very less. Upon failure, we tend to say some vague  words like, "Rules or Resolutions are meant to broken or its really difficult to follow / stick to any routine till the Goal is achieved".

Its never late to start. Lets re-frame our resolution with proper procedure &  periodically examine whether we are heading towards the right direction or not...

Success is guaranteed for the disciplined persons,  who formulates it SMARTLY !!!

All the best to me & to all, who want to regularize the process yet again. 
Self satisfaction will follow, when we see things moving in the right direction & we are achieving something on daily basis (regardless of the size of achievement ) :-).

Any further ideas are welcome..........................
JSK.

Wednesday, January 5, 2011

SMS help for finding routes in Bangalore city : [9008890088]

9008890088
This is useful/Authentic information for people who travel by Auto and we will be able to know the rate, route and the distance too. (Free Service)

9008890088 is an SMS-based location search and direction finding service that provides directions to people with or without Smart phones to any location in Bangalore.
The SMS service is available free of charge and all you pay is the standard SMS rate according to your plan. It needs no subscription.
The service is reliable and involves very little waiting time.
The reply back time varies from 3 seconds to 1 minute depending on the mobile operator’s message traffic congestion and availability of signals.
Only you need to do is SMS to 9008890088.
The example usages are:

Example 1: FROM Mekri circle TO ESI Hospital
Example 2: INOX
Example 3: SBI atm NEAR M G Road

You will get a reply SMS with the exact location and shortest directions to reach place from a prominent landmark.
And also with total distance in Kilometers and approximate Auto fare.
Note: This really works and there are no message charges if you have free sms service (like 100 sms/day)

For other formats refer : http://www.mybangalore.com/article/0609/local-search-with-latlong.html

Tuesday, January 4, 2011

[C#] Correct way of throwing exception from a catch block


There are two ways to catch and re-throw an exception, below the two code snippets:
Snippet #1:
   1:  try
   2:  {
   3:   
   4:  }
   5:  catch(Exception ex)
   6:  {
   7:    throw ex;
   8:  }
Snippet #2:
   1:  try
   2:  {
   3:   
   4:  }
   5:  catch(Exception ex)
   6:  {
   7:    throw;
   8:  }
When you use snippet #1, you will re-throw the same exception object and as result of this the original stack trace will be lost. Snippet #2 will maintain the original stack trace, this is very useful for debugging.
One of the try/catch general exception handling guidelines says:
“Do not rethrow by throwing the same exception object. This causes the stack trace for the original exception to be lost--use a lone "throw;" statement (without an object following it) to "rethrow" a catch exception.”
The best way to see the difference is with a code example:
   1:  class Program
   2:  {
   3:    static void Main(string[] args)
   4:    {
   5:      try
   6:      {
   7:        Method1();
   8:      }
   9:      catch (Exception ex)
  10:      {
  11:        throw;
  12:      }
  13:    }
  14:   
  15:    public static void Method1()
  16:    {
  17:      Method2();
  18:    }
  19:   
  20:    public static void Method2()
  21:    {
  22:      throw new Exception();
  23:    }   
  24:  }
The following stack trace will be produced by the code example above:
   at ConsoleApplication2.Program.Method2()
   at ConsoleApplication2.Program.Method1()
   at ConsoleApplication2.Program.Main(String[] args)
   at System.AppDomain.ExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
When you use throw ex; instead of throw; you will get:
   at ConsoleApplication2.Program.Main(String[] args)
   at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
As you see the stack trace don’t have the calls to Method1 and Method2, so when you use throw ex; you will lose essential debug information.