Tuesday 17 July 2012

Stephen R. Covey

Stephen R. Covey, author of the best-selling book, 'The 7 Habits of Highly Effective People', died on July 16, 2012, due to complications from a bicycle accident he suffered the previous April. His self-help book has sold more than 25 million copies worldwide since its first publication in 1989.
Here are the key principles, or 'habits' he propagated in his book:

Habit 1: Be Proactive

Habit 2: Begin with the End in Mind

Habit 3: Put First Things First

Habit 4: Think Win/Win

Habit 5: Seek First to Understand, Then to Be Understood

Habit 6: Synergize

Habit 7: Sharpen the Saw

An inspiring writer, Covey has left behind a treasure of quotes that many management students, budding entrepreneurs, or even professionals could seek inspiration from. Click on NEXT to start your day with renewed enthusiasm:
less
“We are not human beings on a spiritual journey. We are spiritual beings on a human journey.”

“Most of us spend too much time on what is urgent and not enough time on what is important.

“I am not a product of my circumstances. I am a product of my decisions.”

“We see the world, not as it is, but as we are──or, as we are conditioned to see it.”
“Motivation is a fire from within. If someone else tries to light that fire under you, chances are it will burn very briefly.”

“To know and not to do is really not to know.”
The key is not to prioritize what's on your schedule, but to schedule your priorities.

“Without involvement, there is no commitment. Mark it down, asterisk it, circle it, underline it. No involvement, no commitment.”

“Effective leadership is putting first things first. Effective management is discipline, carrying it out.”
“As long as you think the problem is out there, that very thought is the problem”

“Words are like eggs dropped from great heights. You could no more call them back then ignore the mess they left when they fell.”
“It's not what happens to us, but our response to what happens to us that hurts us.”

“If I really want to improve my situation, I can work on the one thing over which I have control - myself.”

“To change ourselves effectively, we first had to change our perceptions.”
“Every human has four endowments- self awareness, conscience, independent will and creative imagination. These give us the ultimate human freedom... The power to choose, to respond, to change.”

“It is one thing to make a mistake, and quite another thing not to admit it. People will forgive mistakes, because mistakes are usually of the mind, mistakes of judgment. But people will not easily forgive the mistakes of the heart, the ill intention, the bad motives, the prideful justifying cover-up of the first mistake.”

“There are three constants in life... Change, Choice and Principles.”
less
“The main thing is to keep the main thing the main thing.”

“Habit is the intersection of knowledge (what to do), skill (how to do), and desire (want to do).”



“[W]isdom is the child of integrity—being integrated around principles. And integrity is the child of humility and courage. In fact, you could say that humility is the mother of all virtues because humility acknowledges that there are natural laws or principles that govern the universe. They are in charge. Pride teaches us that we are in charge. Humility teaches us to understand and live by principles, because they ultimately govern the consequences of our actions. If humility is the mother, courage is the father of wisdom. Because to truly live by these principles when they are contrary to social mores, norms and values takes enormous courage.”

Monday 16 July 2012

Dhirubai Ambani Quotes


From beginning Dhirubhai was seen in high-regard. His success in the petro-chemical business and his story of rags to riches made him a cult figure in the minds of Indian people. As a quality of business leader he was also a motivator. He gave few public speeches but the words he spoke are still remembered for their value. *"I am deaf to the word "no"."
 
  • "Growth has no limit at Reliance. I keep revising my vision. Only when you dream it you can do it."
  • "Think big, think fast, think ahead. Ideas are no one's monopoly"
  • "Our dreams have to be bigger. Our ambitions higher. Our commitment deeper. And our efforts greater. This is my dream for Reliance and for India."
  • "You do not require an invitation to make profits."
  • "If you work with determination and with perfection, success will follow."
  • "Pursue your goals even in the face of difficulties, and convert adversities into opportunities."
  • "Give the youth a proper environment. Motivate them. Extend them the support they need. Each one of them has infinite source of energy. They will deliver."
  • "Between my past, the present and the future, there is one common factor: Relationship and Trust. This is the foundation of our growth"
  • "We bet on people."
  • "Meeting the deadlines is not good enough, beating the deadlines is my expectation."
  • "Don't give up, courage is my conviction."
  • "We cannot change our Rulers, but we can change the way they Rule Us."
  • "Dhirubhai will go one day. But Reliance's employees and shareholders will keep it afloat. Reliance is now a concept in which the Ambanis have become irrelevant."''
Dhirubhai Ambani was a great entrepreneur who transformed his vision into achievements with his strong belief and self confidence.
 
He believed in his dreams and he lived his dream.Hats off to Dhirubhai.

Number to English Words

using System;

 public class NumberToEnglish
  {
   public String changeNumericToWords(double numb)
   {
    String num = numb.ToString();
    return changeToWords(num, false);
   }
   public String changeCurrencyToWords(String numb)
   {
    return changeToWords(numb, true);
   }
   public String changeNumericToWords(String numb)
   {
    return changeToWords(numb, false);
   }
   public String changeCurrencyToWords(double numb)
   {
    return changeToWords(numb.ToString(), true);
   }
   private String changeToWords(String numb, bool isCurrency)
   {
   String val = "", wholeNo = numb, points = "", andStr = "", pointStr="";
   String endStr = (isCurrency) ? ("Only") : ("");
   try
   {
    int decimalPlace = numb.IndexOf(".");
    if (decimalPlace > 0)
    {
     wholeNo = numb.Substring(0, decimalPlace);
     points = numb.Substring(decimalPlace+1);
     if (Convert.ToInt32(points) > 0)
     {
      andStr = (isCurrency)?("and"):("point");// just to separate whole numbers from points/cents
      endStr = (isCurrency) ? ("Cents "+endStr) : ("");
      pointStr = translateCents(points);
     }
    }
    val = String.Format("{0} {1}{2} {3}",translateWholeNumber(wholeNo).Trim(),andStr,pointStr,endStr);
   }
   catch { ;}
   return val;
  }
   private String translateWholeNumber(String number)
   {
    string word = "";
    try
    {
     bool beginsZero = false;//tests for 0XX
     bool isDone = false;//test if already translated
     double dblAmt = (Convert.ToDouble(number));
     //if ((dblAmt > 0) && number.StartsWith("0"))
     if (dblAmt > 0)
     {//test for zero or digit zero in a nuemric
      beginsZero = number.StartsWith("0");

      int numDigits = number.Length;
      int pos = 0;//store digit grouping
      String place = "";//digit grouping name:hundres,thousand,etc...
      switch (numDigits)
      {
       case 1://ones' range
        word = ones(number);
        isDone = true;
        break;
       case 2://tens' range
        word = tens(number);
        isDone = true;
        break;
       case 3://hundreds' range
        pos = (numDigits % 3) + 1;
        place = " Hundred ";
        break;
       case 4://thousands' range
       case 5:
       case 6:
        pos = (numDigits % 4) + 1;
        place = " Thousand ";
        break;
       case 7://millions' range
       case 8:
       case 9:
        pos = (numDigits % 7) + 1;
        place = " Million ";
        break;
       case 10://Billions's range
        pos = (numDigits % 10) + 1;
        place = " Billion ";
        break;
       //add extra case options for anything above Billion...
       default:
        isDone = true;
        break;
      }
      if (!isDone)
      {//if transalation is not done, continue...(Recursion comes in now!!)
       word = translateWholeNumber(number.Substring(0, pos)) + place + translateWholeNumber(number.Substring(pos));
       //check for trailing zeros
       if (beginsZero) word = " and " + word.Trim();
      }
      //ignore digit grouping names
      if (word.Trim().Equals(place.Trim())) word = "";
     }
    }
    catch { ;}
    return word.Trim();
   }
   private String tens(String digit)
   {
    int digt = Convert.ToInt32(digit);
    String name = null;
    switch (digt)
    {
     case 10:
      name = "Ten";
      break;
     case 11:
      name = "Eleven";
      break;
     case 12:
      name = "Twelve";
      break;
     case 13:
      name = "Thirteen";
      break;
     case 14:
      name = "Fourteen";
      break;
     case 15:
      name = "Fifteen";
      break;
     case 16:
      name = "Sixteen";
      break;
     case 17:
      name = "Seventeen";
      break;
     case 18:
      name = "Eighteen";
      break;
     case 19:
      name = "Nineteen";
      break;
     case 20:
      name = "Twenty";
      break;
     case 30:
      name = "Thirty";
      break;
     case 40:
      name = "Fourty";
      break;
     case 50:
      name = "Fifty";
      break;
     case 60:
      name = "Sixty";
      break;
     case 70:
      name = "Seventy";
      break;
     case 80:
      name = "Eighty";
      break;
     case 90:
      name = "Ninety";
      break;
     default:
      if (digt > 0)
      {
       name = tens(digit.Substring(0, 1) + "0") + " " + ones(digit.Substring(1));
      }
      break;
    }
    return name;
   }
   private String ones(String digit)
   {
    int digt = Convert.ToInt32(digit);
    String name = "";
    switch (digt)
    {
     case 1:
      name = "One";
      break;
     case 2:
      name = "Two";
      break;
     case 3:
      name = "Three";
      break;
     case 4:
      name = "Four";
      break;
     case 5:
      name = "Five";
      break;
     case 6:
      name = "Six";
      break;
     case 7:
      name = "Seven";
      break;
     case 8:
      name = "Eight";
      break;
     case 9:
      name = "Nine";
      break;
    }
    return name;
   }
   private String translateCents(String cents)
   {
    String cts = "", digit = "", engOne = "";
     for (int i = 0; i < cents.Length; i++)
     {
      digit = cents[i].ToString();
      if (digit.Equals("0"))
      {
       engOne = "Zero";
      }
      else
      {
       engOne = ones(digit);
      }
      cts += " " + engOne;
     }
    return cts;
   }
  }




Call Funtion :
 NumberToEnglish objNum2Eng = new NumberToEnglish();
string strNum= objNum2Eng.changeNumericToWords(15000);
Output :
Fifteen Thousand 

Fix Background Image




<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Fixed Background Demo</title>
    <style type="text/css">
 <!-- Add the following to the HEAD of your Web page. Change the URL to your background image
 .clsFix {
 background-image: url(Images/student.gif);
 background-repeat: no-repeat;
 background-attachment: fixed;
 }
 //-->
 </style>
</head>
<body>
    
    <table width="100%" style="height:1500px" class="clsFix  "> 
        <tr>
            <td>
            </td>
        </tr>
       
    </table>
</body>
</html>

Friday 13 July 2012

Are you also doing these jQuery mistakes


There is no doubt that jQuery is awesome. But there are some good things and bad things. Believe me, jQuery can make you crazy if it is not used properly and efficiently. It can hit performance of your page and you don't even realize it. And as a developer, do you really think about performance at the time of writingjQuery code or else you have to care about when your client shouts.

I have listed down common mistakes and their fixes that you might be doing while writing jQuery code.


Not using latest version of jQuery


jQuery team is keep on updating the jQuery library and the newer version comes with lots of bug fixes and performance enhancement. I understand that it is not always possible for you to use the latest version for your old projects but I suggest for your new projects, you can use latest version of jQuery.

Read "How to always reference latest version of jQuery"

Not using minified version of jQuery library


The jQuery library (when you download) comes in two versions.

1. Production (Compressed Version)
2. Development (Uncompressed Version)

For development purpose, you can choose the development version of .js file as if you want to make some changes then that can be easily done. But ensure that when your software or product goes on production, always use the production version of .js file as its size is 5 times lesser than the development version. This can save some amount of bandwidth.

Not loading jQuery from Google CDN


Google is sea of free services. Do you know that Google is also hosting jQuery libraries on its CDN(Content delivery network) and allows any website to use it for free.

Why to use Google CDN?
  • Caching: The most important benefit is caching. If any previously visited site by user is using jQuery from Google CDN then the cached version will be used. It will not be downloaded again.
  • Reduce Load: It reduces the load on your web server as it downloads from Google server's.
  • Serves fast : You will be also benefitted from speed point of view. As Google has dozen's of different servers around the web and it will download the jQuery from whichever server is closer to the user. Google's CDN has a very low latency, it can serve a resource faster than your webserver can.
  • Parellel Downloading: As the js file is on a separate domain, modern browsers will download the script in parallel with scripts on your domain.

Read "Why to use Google hosted jQuery CDN"

Not loading jQuery locally when CDN fails


It is a good approach to always use CDN but sometimes what if the CDN is down (rare possibility though) but you never know in this world as anything can happen. So if you have loaded your jQuery from any CDN and it went down then your jQuery code will stop working and your client will start shouting.

I always recommend that write the code, if jQuery library is not loaded properly then it should use your local copy of jQuery.
1//Code Starts
2<script type="text/javascript"src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
3<script type="text/javascript">
4if (typeof jQuery == 'undefined')
5{
6  document.write(unescape("%3Cscript src='Scripts/jquery.1.7.2.min.js' type='text/javascript'%3E%3C/script%3E"));
7}
8</script>
9//Code Ends
It first loads the jQuery from Google CDN and then check the jQuery object. If jQuery is not loaded successfully then it will references the jQuery.js file from hard drive location. In this example, the jQuery.js is loaded from Scripts folder.

Not using selectors efficiently


Be smart while using selectors. As there are many ways to select element using selectors but that doesn't mean that all are equal. Always try to use ID and Element as selector as they are very fast. Even the class selectors are slower than ID selector.

When IDs are used as selector then jQuery internally makes a call to getElementById() method of Java script which directly maps to the element.

When Classes are used as selector then jQuery has to do DOM traversal.So when DOM traversal is performed via jQuery takes more time to select elements. In terms of speed and performance, it is best practice to use IDs as selector.

Using jQuery selectors repeatedly


Take a look at below jQuery code. The selectors are used thrice for 3 different operation.
1$("#myID").css("color""red");
2$("#myID").css("font""Arial");
3$("#myID").text("Error occurred!");
The problem with above code is, jQuery has to traverse 3 times as there are 3 different statements.But this can be combined into a single statement.
1$("#myID").css({ "color""red""font""Arial"}).text("Error occurred!"); 
This will ensure that jQuery traverse only once through DOM while selecting the element.

Not knowing how your selectors are executed


Do you know how the selectors are executed? Your last selectors is always executed first. For example, in below jQuery code, jQuery will first find all the elements with class ".myCssClass" and after that it will reject all the other elements which are not in "p#elmID".
1$("p#elmID .myCssClass");

Not checking while using various plugins


One of the great feature of jQuery is various plugins available created using jQuery are available for free. You like a jQuery plugin and start using it in your project. But while using plugins do you really consider,

  • File size
  • Performance of plugin
  • Browser Compatibility

Before using any plugin, always ensure that it must not hit performance of your page and it should not conflict with other plugins that you are using already.

What should you required to learn machine learning

  To learn machine learning, you will need to acquire a combination of technical skills and domain knowledge. Here are some of the things yo...