Multi-Search3

Of Bible Quiz, Number Crunching, Javascript Tips and Indian Budget.

Bible Quiz

It will be close to 3 months tomorrow since I wrote the last blog post[Sig3-Simple Image Gallery For Linux]. While it has always been my top priority to keep this blog and my sqlhtm.com website updated as frequently as possible, it has been a hard thing to do because of where I am in life now - away from home, waiting anxiously to get back to work, family and life. Luckily, what has been a loss of productivity on the blog end, has been a gain for the website since I have added a few more stuff to the website.[Bible Quiz, Aesop Tweets Browser and Aesop Tweets Slide show]. In this post, I just wanted to write about a bunch of interesting things that came my way during the last few weeks.

1. BIBLE QUIZ


Do you know there is an interesting little Bible Quiz at sqlhtm.com? This is the latest Html/Javascript online applications there. It is a tiny little starter quiz with just 20 questions from the first few chapters of the first two books of the Bible[Genesis and Exodus]. While you can easily score 100% with single answer questions, you may not do so with a multiple-choice type quiz, at least not easily! Don't complain, things have been smoothed out here. For one thing, you can click on any answer choice of any question any number of times without time or number of attempt restrictions. For another, you just need to press the "Check Answer" button for a hidden answer box with the answer text to slide out for you! I am sure you will find this quiz exciting and informative. Go ahead, take a look and make sure you are a real Bible expert!

2. NUMBER CRUNCHING


You know what, I also tripped on the words "1 crore crores" somewhere somehow and didn't know how much it really stood for. So I started to dig a little, crunch some 1's and 0' and ended up with the table I think you will find useful, specially if you are an Indian NRI, since it has a side-by-side comparison of the numbers of the Indian and Western number formats. This table has been heavily inspired by a website I found on my mobile phone, which I could not find again to make a mention of! While I want to thank them I also want to remind you that the numbers are valid for their own currencies and not as conversion of, for example, the US dollar to the Indian rupee or the Indian rupee to the US dollar. In other words, we're doing number analysis here, not currency conversion.


No of ZeroesAmt in Numbers[India]Amount in Words[Indian]Amt in Numbers[West]Amt in Words[West]
5 Zeroes1,00,0001 Lakh100,000100,000
6 Zeroes10,00,00010 Lakhs1,000,0001 Millions
7 Zeroes1,00,00,0001 Crore=100 Lakhs10,000,00010 Millions
8 Zeroes10,00,00,00010 Crores=1000 Lakhs100,000,000100 Millions
9 Zeroes1,00,00,00,000100 Crores=10,000 Lakhs1,000,000,0001 Billions=1,000 Millions
10 Zeroes10,00,00,00,0001,000 Crores=1,00,000 Lakhs=1 Lakh Lakhs10,000,000,00010 Billions=10,000 Millions
11 Zeroes1,00,00,00,00,00010,000 Crores=10,00,000 Lakhs=10 Lakh Lakhs100,000,000,000100 Billions=100,000 Millions
12 Zeroes10,00,00,00,00,0001 Lakh Crores=1,00,000 Crores=1,00,00,000 Lakhs=100 Lakh Lakhs1,000,000,000,0001 Trillion=1000 Billions=1 Million Millions=1,000,000 Millions
13 Zeroes1,00,00,00,00,00,00010 Lakh Crores=10,00,000 Crores=10,00,00,000 Lakhs=1000 Lakh Lakhs10,000,000,000,00010 Trillion=10,000 Billions=10 Million Millions=10,000,000 Millions
14 Zeroes10,00,00,00,00,00,0001 Crore Crores=100,00,000 Crores=100 Lakh Crores=100,00,00,000 Lakhs=10,000 Lakh Lakhs100,000,000,000,000100 Trillion=100,000 Billions=100 Million Millions=100,000,000 Millions

All the numbers crunched and tabled, I finally found the answer to my nagging question: How much really is "1 crore crores"?

Answer:
1 crore crores is 100000000000000[14 zeroes after 1], [10,00,00,00,00,00,000 in Indian number format][100,000,000,000,000 in Western number format].
1 crore crores happens to be Western 100 Trillion[=100,000 Billions][=100 Million Millons][=100,000,000 Millions].
1 crore crores happens to be Indian 100 Lakh Crores[=10,000 Lakh Lakhs].

My problem solved, I still have a bigger question: Why should some people in the world have soooooo much more money than all the others???

I think, in all fairness, income distribution should be more equitable where ever you are, most everyone hovering around the median, give or take, for example, a 10-time disparity between the highest and the lowest.

To illustrate this, consider a hypothetical situation where the lowest income someone makes is $10/hr [$1600/month][$20,000/yr] and the highest income that anyone can make is capped at $100/hr [$16,000/month][$200,000/yr]. While you may say this kind of thing is hard to implement in the current scheme of things, how can you justify a handful of individuals making  more money than even some small countries? How can you turn a blind eye to how this in turn deprives thousands of unemployed people's opportunity to get employed and support their loved ones? THERE'S GOT TO BE A WAY TO SPREAD THE WEALTH OF THE NATIONS MORE EVENLY AMONG THE PEOPLE. What would be the downside to this kind of approach? What do you think?

3. JAVASCRIPT TIPS


Talking of numbers, I also wanted to share 2 functions I used in my Bible quiz, that use numbers in interesting ways.

Tip 1 [Deep and complex nested If statement]

I have used the Javascript "IF" statement(short form) before but wasn't sure how nested or complex it could be. The Bible quiz gave me a chance to test out and use a complex nested short form of the "IF" statement.

Problem

Every one of the 20 questions in the Bible quiz has multiple-choice answers [a,b,c,d,e,f and g]. I need to convert these into numbers [1,2,3,4,5,6 and 7] so I can use it to retrieve the correct answer from the answers array.

Solution

Look at the code below. Receiving one of the letters "a" through "g" as input, this function assigns a corresponding number "1" through "7" as the value of the variable "anscnv" and returns it.

function ansConv(let) {
var anscnv = "";
anscnv = ((let == 'a') ? 1 : ((let == 'b') ? 2 : ((let == 'c') ? 3 : ((let == 'd') ? 4 : ((let == 'e') ? 5 : ((let == 'f') ? 6 : 7))))))
return anscnv;
}        

In psuedo code, this nested if means,
If "let" is equal to "a" then return 1;
Else if "let" is equal to "b" then return 2;
Else if "let" is equal to "c" then return 3;
Else if "let" is equal to "d" then return 4;
Else if "let" is equal to "e" then return 5;
Else if "let" is equal to "f" then return 6;
Else return 7;

Tip 2 [Ceil is the champ here!]

Problem

I have a little show/hide accordion blue answer box on the top of every row [5 questions per row] that opens up when you press the "Check Answer" button and closes when you click on the "Close" button on the top right. That means a total of 4 boxes for 20 questions. The problem is to store
"1" as the box number in the variable ansboxnum when we click any of the five "Check Answer" buttons on the 1st row, 
"2" as the box number in the variable ansboxnum when we click any of the five "Check Answer" buttons on the 2nd row, 
"3" as the box number in the variable ansboxnum when we click any of the five "Check Answer" buttons on the 3rd row and
"4" as the box number in the variable ansboxnum when we click any of the five "Check Answer" buttons on the 4th row.

Solution

There could be many ways to solve this but here is one. Look at the line of code below.


var ansboxnum = (Math.ceil(q / 5) <= 1 ? 1 : Math.ceil(q / 5)); 

Assuming q to be the question number[1 through 20], this is what the code above does. If q divided by 5 rounded up(ceil) is less than or equal to 1 then it stores 1 as the value of the variable "ansboxnum", else it stores q/5 rounded up(ceil) as ansboxnum. This means,
for q in questions [1,2,3,4,5] it stores 1,
for q in questions [6,7,8,9,10] it stores 2,
for q in questions [11,12,13,14,15] it stores 3 and
for q in questions [16,17,18,19,20] it stores 4, exactly what we need.

    1/5=.2; ceil(.2)<=1 so return 1[questions-1st row/answer box #1]
    2/5=.4; ceil(.4)<=1 so return 1[questions-1st row/answer box #1]
    3/5=.6; ceil(.6)<=1 so return 1[questions-1st row/answer box #1]
    4/5=.8; ceil(.8)<=1 so return 1[questions-1st row/answer box #1]
    5/5=1.0; ceil(1.0)<=1 so return 1[questions-1st row/answer box #1]

    6/5=1.2; ceil(1.2)=2 so return 2[questions-2nd row/answer box #2]
    7/5=1.4; ceil(1.4)=2 so return 2[questions-2nd row/answer box #2]
    8/5=1.6; ceil(1.6)=2 so return 2[questions-2nd row/answer box #2]
    9/5=1.8; ceil(1.8)=2 so return 2[questions-2nd row/answer box #2]
    10/5=2.0; ceil(2.0)=2 so return 2[questions-2nd row/answer box #2]

    11/5=2.2; ceil(2.2)=3 so return 3[questions-3rd row/answer box #3]
    12/5=2.4; ceil(2.4)=3 so return 3[questions-3rd row/answer box #3]
    13/5=2.6; ceil(2.6)=3 so return 3[questions-3rd row/answer box #3]
    14/5=2.8; ceil(2.8)=3 so return 3[questions-3rd row/answer box #3]
    15/5=3.0; ceil(3.0)=3 so return 3[questions-3rd row/answer box #3]

    16/5=3.2; ceil(3.2)=4 so return 4[questions-4th row/answer box #4]
    17/5=3.4; ceil(3.4)=4 so return 4[questions-4th row/answer box #4]
    18/5=3.6; ceil(3.6)=4 so return 4[questions-4th row/answer box #4]
    19/5=3.8; ceil(3.8)=4 so return 4[questions-4th row/answer box #4]
    20/5=4.0; ceil(4.0)=4 so return 4[questions-4th row/answer box #4]

Remember this can extend the same way to any number of boxes.
Nice little way to solve a tiny little problem!

4. INDIAN BUDGET[2014-15]


I recently read about the Indian budget in the papers and looked for something that would interest me as an NRI. Sure, yes, I did find some thing interesting! The tax-free baggage allowance for inbound fliers has been upped to Rs.45,000[$748 USD] from Rs.35,000[$582 USD] for the budget year 2014-15. So, travellers, remember to bring that $700 USD in, invest, donate or make good use of it anyway you can!




BlogCollage


Blog Collage - Top Random Posts In No Particular Order

Mouseover the images for title and comments