Friday, March 16, 2012

Precision Vs Accuracy

In Quality Management, there is a "pair" of terms, Precision & Accuracy. It may feel similar, that is what I have always been thinking. But, they are different. Following are what they mean as per PMBOK

Precision: Measurements falling close to each other
Accuracy: Degree of conformity of measurements to the true value

Now, this may seem confusing. But, it is pretty easy. I'll explain with an example. In our college first year, we used to a physics experiment... three hours of physics lab in a sleepy afternoon :(

The experiment is conducted to find out the value of "g", earth's gravity, which everyone knows as 9.81m/s2 (Whatever that means). We used to find that out all over again by rotating some wheel kind of appratus tied to a rope and some weight (ball?). I do not remember it exactly now, but it was something like replacing weights and rotating the wheel and take some measurements followed by some calculations... And there I got the "g" value .... 7.3. May be my experiment was conducted somewhere in the space in between the earth and moon. Okay, now I realized the rotation of the wheel was too slow and did it all over again to get the value.. 15.2 Oops..!!!

There were four people doing the same experiment in the lab at that time: Kesara, Nabil, Shamim and Hari (All names fictitious until the name owenrs see this article). Following were their measurements in five attempts.

Nabil : 8.2, 8.1, 7.9, 8.4, 8.1  - This is Precise but not Accurate
Shamim : 10.7, 9.4, 10.6, 10.2, 9.6 - This is Less Precise than Nabil's measurements, but More Accurate
Kesara : 9.7, 9.8, 9.9, 9.8, 9.6 - This is More Precise then previous two and More Accurate as well. Kesara is always like that :)

And Finally we have...

Hari: 7.3, 15.2, 6.4, 13.5, 4.8 - Nether Precise Nor Accurate. Hari is always like that :)

Hope the example is easy to understand and remember. If you find anything incorrect or appropriate in this, please feel free to leave a comment.

Wednesday, September 28, 2011

NPV Calculator using AJAX and ASP

NPV - Net Present Value is a useful concept in Finance & Budgeting. It will be easy if you have a tool to understand it better. So, here is your tool.



Here is your HTML code. Copy and Paste this in a notepad and save it as "NPV_AJAX.htm".
-------------------------
<html>
<head>
<title>NPV Calculation</title>
<script type="text/javascript">
<!--
 function ajaxadd(pagy) {
 var xmlhttp1;
 var randy=Math.floor(Math.random()*10001)
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp1=new XMLHttpRequest();
  }
else
  {// code for IE6, IE5
  xmlhttp1=new ActiveXObject("Microsoft.XMLHTTP");
  }
 // Receive Data
 xmlhttp1.onreadystatechange = function(){
   if(xmlhttp1.readyState == 4){
      var ajaxDisplay = document.getElementById('NPVDisplay');
      ajaxDisplay.innerHTML = xmlhttp1.responseText;
   }
 }
 // Pass it to Server
 var bme = document.getElementById('bme').value;
 var amount = document.getElementById('amount').value;
 var profit = document.getElementById('profit').value;
 var rate = document.getElementById('rate').value;
 var yearsy = document.getElementById('yearsy').value;
 var params = "bme=" + bme + "&amount=" + amount + "&profit=" + profit + "&rate=" + rate + "&yearsy=" + yearsy + "&rand=" + randy

// alert(pagy);
 xmlhttp1.open("POST", pagy, true);

  //Send the proper header information along with the request
xmlhttp1.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
xmlhttp1.setRequestHeader("Content-length", params.length);
xmlhttp1.setRequestHeader("Connection", "close");

 xmlhttp1.send(params);
}

//-->
</script>
</head>
<body>
<p align="center"><b><font color="#000000" face="verdana" size="3">Hari's NPV Calculator</font></b><br><br>
<font color="#000000" face="verdana" size="2">
<b>NPV - Net Present Value.</b> Value of future money is lesser than it is today. <br>
Therefore, we need to apply a depreciation to any future returns when assessing the worthy of an investment or project. NPV helps do it.<br><br>
To find <b>IRR (Internal rate of Return: the rate at which NPV is zero)</b>, just play with the discount rate to get NPV = 0
</font>
</p>
<form>

  <table width="60%" bgcolor="#A4D9D5"style="border-style: outset" border="1" bordercolor="#808080" align="center">
<tr><td>
  <table border="0" width="90%" align="center" cellspacing="0" cellpadding="0">
    <tr>
      <td width="60%" valign="top">
        <p style="margin-left: 5; margin-top: 10"><b><font face="Verdana" size="2" color="#000000">Which part of year the investment is made</font></b></td>
      <td width="40%">
        <p style="margin-left: 10; margin-top: 10"><select size="1" name="bme">

   <option value="B">Begining of the Year</option>
   <option value="M">Middle of the Year</option>
   <option value="E">End of the Year</option>

        </select></td>
    </tr>
 <tr>
      <td width="60%" valign="top">
        <p style="margin-left: 5; margin-top: 10"><b><font face="Verdana" size="2" color="#000000">One time investment (Rs.)</font></b></td>
      <td width="40%">
        <p style="margin-left: 10; margin-top: 10"><input type="text" name="amount" size=20></td>
    </tr>
  <tr>
      <td width="60%" valign="top">
        <p style="margin-left: 5; margin-top: 10"><b><font face="Verdana" size="2" color="#000000">Profit Per Year (Rs.)</font></b></td>
      <td width="40%">
        <p style="margin-left: 10; margin-top: 10"><input type="text" name="profit" size=20></td>
    </tr>
    <tr>
      <td width="60%" valign="top">
        <p style="margin-left: 5; margin-top: 10"><font face="Verdana" size="2" color="#000000"><b>Discount Value (rate %)</b></font></td>
      <td width="40%">
        <p style="margin-left: 10; margin-top: 10"><input type="text" name="rate" size=20></td>
    </tr>
 <tr>
      <td width="60%" valign="top">
        <p style="margin-left: 5; margin-top: 10"><font face="Verdana" size="2" color="#000000"><b>Number of Years (whole numbers)</b></font></td>
      <td width="40%">
        <p style="margin-left: 10; margin-top: 10"><input type="text" name="yearsy" size=20></td>
    </tr>
</td>
    </tr>
    <tr>
      <td width="100%" colspan="2" align="center">
        <p style="margin-left: 10; margin-top: 10"><input type="button" value="Calculate" onClick="ajaxadd('NPV_Calc.htm')" style="background-color: #008000; color: #00FF00; font-family: Verdana; font-weight: bold">&nbsp;
        <input type="reset" value="Reset" name="B2" style="background-color: #008000; color: #00FF00; font-family: Verdana; font-weight: bold"><br><br>
      </td>
    </tr>
  </table>
  </td>
</tr>
</table>
</form>
<center>
<div id="NPVDisplay" width="50" height="20"><font color="#000000" face="verdana" size="1">Results will be displayed here</font></div>
</center>
<BR>
&nbsp;
</body>
</html>

-------------------------

Given below is your ASP code. Copy this code and paste in a notepad. Name the file "NPV_Calc.asp". You will need IIS to run the ASP code. These days IIS comes in most machines even in desktops with Windows 7.

-------------------------

 <%
Dim npv, bme, amount, profit, rate, years, ratty, rattyby, resulty
bme = Request.Form("bme")
amount = CDbl(Request.Form("amount"))
profit = CDbl(Request.Form("profit"))
rate = CDbl(Request.Form("rate"))/100
yearsy = CInt(Request.Form("yearsy"))
'Response.write "BME: " & bme & "<br>"
'Response.write "Amount: " & amount & "<br>"
'Response.write "Rate: " & rate & "<br>"
'Response.write "Years: " & yearsy & "<br><br>"
if bme = "B" then
ratty = 1
elseif bme = "M" then
ratty = Sqr(1+rate)
else
ratty = (1+rate)
end if
npv = (-1)*(amount/ratty)
Response.write "<font face='verdana' size='2'><b>Year 0: </b>" & FormatNumber(npv,2) & "</font><br>"
iCount = 0
rattyby = (1+rate)
Do While iCount < yearsy
ratty = ratty * rattyby
'Response.write ratty & "&nbsp;&nbsp;"
npv = npv + (profit/ratty)
iCount = iCount + 1
Response.write "<font face='verdana' size='2'><b>Year " & iCount & ": </b>" & FormatNumber(npv,2) & "</font><br>"
Loop
if npv >=0 then
resulty = "<font color='green'><b>Viable</b></font>"
else
resulty = "<font color='red'><b>Unviable</b></font>"
end if
Response.write "<br><br><font face='verdana' size='3'><b>The NPV of your project is : </b>" & FormatNumber(npv,2) & ". Your Project is " & resulty & "</font><br>"
Response.write "<br><font face='verdana' size='2'>Note: If discount value is zero your NPV will be " & FormatNumber((profit*yearsy)-amount,2) & "</font><br>"
%>
-------------------------


Thanks to the following in helping me get this properly in blogger
http://thoughtsomething.blogspot.com/2008/11/display-html-javascript-code-in-blogger.html
http://www.dan.co.jp/cases/javascript/encode_entities.html

I am also trying to do it with only JavaScript so that even people who do not have IIS can run the tool. But, time should permit :) - Thanks.

BTW, This is probably my first tech post ever in blogger.

KING Folder

When I switched on the comp today, I saw a folder called "KING" in the desktop. Curious to know what it is, I opened it up. It had several wordpad documents. The contents of some of them are as follows :)

boys are very bad but girl are very good why
because they are talking about little boys and little girls ok
the time is 8'o clock go to the school.
 
rosy rosy saw-6
rosy rosy little rosy i am a doll rosy it is a big rosy i am a i am a i am a little rosy it is a good rosy and it is a man rosy
thank you
 
Hamrita like's flowers but she will get this for to a friend
12345678910
kitty ma
and
rosy
10987654321
enter

chapter-7
air is here
q and a
answer the following

1 can we see air
ans ; no we cannot see air but we can feel it.
2 does air have weight
ans ; yes air have weight
3 why do we need air
ans ; we need air to breathe


4 why should we breathe fresh air
ans ; we should breathe fresh air for good health.
5 what is moving air called
ans ; moving air is called wind

mmm... :)

Thursday, April 15, 2010

Gift to Appa

(You can click on the pictures to see them bigger)

This is a gift Hamrita prepared for me. She gave me this when I reached home (from office) almost in the midnight. When I opened the gift????



The back side looked like this

AND

The front side: a picture of me, hearts & stars and some loving words from that little hand



Thanks Hamrita Darling.

Thursday, March 25, 2010

More Painter & Gift to Appa

Hamrita has more work of art to exhibit this time
(You can click on the pictures to see them bigger).

As per Hamrita, this is a queen and she is crying. When asked, why the queen is crying, the reply was, "she does not like the dress she is wearing and she is crying" :(

This is mirror image of same queen in different colors. Still the queen cries :(

This is various.. whatever comes to mind

This is people travelling home (I guess)

And.. This is a gift Hamrita prepared for me. She gave me this when I reached home (from office) almost in the midnight. When I opened the gift???? That will be my next post!

Tuesday, January 19, 2010

Painter

These are some of Hamrita's works in this month. Looks like she has a flair for colors. She is full of crayons, sketches and drawing books at home. Always sitting on floor and rubbing color on papers. The "kirukkals" programme in Chutti TV is her favorite.. so is the coloring program in Baby TV.

The pictures accompany the explanations given by Hamrita !!!!!

House, Garden, Girl, Sun. Behind the house a pond and a duck (That brown color thing)

She could not explain this.. May be a modern art !!! :). It looks like a face to me

This is some random drawing once again

This is colorful butterfly...

(This is the ultimate). This is an aeroplane leaving the airport. The airport has garden and flowers in it. There are also seats (chairs) for people waiting for the plane... (All these are exactly her words)


Latest Updates: She enjoyed the visit to Mahbs and Dakshina Chithra and posed for numerous photos with the shore temple backdrop. Celebrated Birthday with a round cherry filled black forest cake with Kanna Mama.

Today she is busy packing her bag for a school trip on Friday. It is just a half day trip, but she is all excited.. Hopefully she'll have a good time.

She has learnt to use all the words from Vadivelu comedy.. and the other day she called me a "comedy piece" :(.. Misses Dora dearly, but "Heidi" and "Anna's Tales" make up somehow.

Last week when we asked what she wants to become in life.. we expected a doctor or engineer or teacher.. she replied, "I want to become a makeup girl".. and she got small makeup kit from Kanna Mama.

Hyperdash toy and coloring books with lots of pages from Dina Mama are also useful in freetimes.

Tuesday, November 03, 2009

Aiyoooo Rama

குருவி பறந்து வந்ததாம்
பாப்பா அருருருகில் நின்றதாம்
பா....வம் அதற்கு பசித்ததாம்
பாப்பா நெல்லை கொடுத்ததாம்
குருவி அந்த நெல்லையே
கொத்தி கொத்தி தின்றதாம்
பசியும் நீங்கி பறந்ததாம்
பாப்பா இன்பம் கொண்டதா....ம்ம்ம்ம்ம்ம்

Thenali Rama
Went to the Drama
Without his Pyjama
Aiyoooo Rama

Racing Car Number 9
Missing Petrol All the time
What Color do you choose?

குள்ள குள்ள வாத்து
குவா குவா வாத்து
மெல்ல்ல்ல உடெலை ச்சாத்து
மேலும் கீளும் பாத்து
ச்செல்லமாக நடக்கும்
ச்சின்னமணி வா..த்து

Friday, July 31, 2009

One night @ the call center


Impressed with Chetan Bagat’s initial venture “5 . Someone”, I was looking forward to read “One night”. Finally I got the opportunity this week thanks to the visit to Landmark over the weekend.

Chetan had made a smart move of choosing a small (WASG) team within the big Call Center. He enjoys focusing the 6 people team and leaves out the thousands of others in the big center. He teaches you how a call center functions, he explains American pronunciations, he describes how dumb the Americans are and he manages to make the first few chapters enticing.

The novel starts well, moves well with the characters’ introduction, interaction, sufferings etc.. However, at one point it starts getting repetitive & monotonous. I remember reading “five point” with no mind to keep the book away. In the call center, I had to offer myself several breaks, especially in the latter parts of the book.

The story happens in a single night and mostly in a “confined space!!!” and therefore it gets dragging and boring after certain time. To get readers out of boredom, the author tries to take them through the past dates of Shyam, (the “Team” lead character) and Priyanka. He figured out that it is not enough and takes readers to the “Bed” – a nightclub with all the characters in the story.

In the “prologue” Chetan talks of a call from God to the call center. Only much later it is revealed that God does not call the “center”, but he calls when the team is outside towards the end of the novel. This disappointed me (slightly) because I expected the God’s call to happen first and the events to follow to make a compelling read. But, this comes as just another story of some rich kids (who complain that they are poor) suffering due to their own attitudes. However, It doesn’t fail to sound as interesting as gossips on people whom we interact on everyday life.

The characterization of Bakshi, the Boss, is silly. I can only compare the villains in Rajinikanth’s movie to Bakshi. The bad guys in super star movie are shown as all-powerful guys initially, only to be dumped as complete pathetic, brainless morons towards climax. For that, Bakshi is not an ordinary person; he is managing a call center that employs a thousand people. I personally feel a person with Bakshi’s cunningness will ever do the following:

  • Leave his computer unlocked when he is away from his desk. Come on, just a Ctrl+Alt+Del is known to anybody and especially people in senior management are very cautious. Chetan looks silly with his idea of sending mail using Bakshi’s ID.
  • When his subordinates try to threaten him with some crap, a person of Bakshi’s caliber will only react even smarter. I feel such a person will say, “guys, you do whatever you want.. I know how to handle and now get out of my office”

The events that follow are even too childish.

  • The gang takes control of the office with a stupid e-mail
  • Scare the Americans with rand feature. (I need to uncontrollably laugh at this point!)
  • Have a meeting with the “Top Management” in the US and convince within a few minutes to change decisions.

I am not sure why Chetan has to get to this level. Probably he had a writer's block for a better climax. I now feel Five Point’s jumping-from-9th floor-and-surviving was a better thinking, which I hated when I read the book years ago.

Mocking Americans is fun. But, Chetan grossly underestimates them and overdoing the mock to the level it becomes lackluster. Also, Ganesh’s baldness idea seems another silly thought. It looks like Chetan has written the final few chapters in a mighty hurry. No time for lucid thinking.

Most incidents in the novel are very predictable

  • What Bakshi will do with the Web Site Manual (which took 6 months to make ???!!!)
  • How Anuj is going to react when the RJ calls him
  • What is going to happen on the way when the team returns from the “Bed”
Of course, the novel has its brighter parts too. In the humor aspects, it is bit lower compared to Five Point, but good enough to make the reading fun. The language is simple so that even a person like me can read and write nasty about it. The conversation with God was well managed without making it “plain preach”. The initial few chapters are enjoyable to read and they make you sail through the rest of the novel just to find out what would happen in the end.

And in the end, the movie.. sorry, the novel ends like a real Indian Masala movie.

---------------------------------

When I was reading the final chapters, Anusha called me for some house chore. She saw the book in my hand and delivered the following, “Please keep that “Abatham” and come help me a bit” …. She had completed the book before I did.

Friday, May 15, 2009

Minesweeper Prodigy

Hamrita's latest interest are Minesweeper and Solitaire. When I am home with the laptop, she clings onto it and completes a few games.

She has been successful in the intermediate level several times and now trying for the expert level. It is really surprising to me since she is only 4 years and 5 months old now…mmm.. Can we try Guinness?

Following is a screenshot I took when she completed yet another while we watched.. of course without any help.


Tuesday, January 13, 2009

Progress

Last Term:
She can do better. But, she is not concentrating in the class when I teach. Excellent in Reading and Writing.

This Term:
She is a very good girl. Very quiet in class too. She has got a lot of friends to play with. Se enjoys herself very much.

That is really "Progress"