Skip to main content


Showing posts from May, 2013

The Oilman and his Parrot.

The Oilman and his Parrot.
 An oilman possessed a parrot which used to amuse him with its agreeable prattle, and to watch his shop when he went out. One day, when the parrot was alone in the shop, a cat upset one of the oil-jars. When the oilman returned home he thought that the parrot had done this mischief, and in his anger he smote the parrot such a blow on the head as made all its feathers drop off, and so stunned it that it lost the power of speech for several days. But one day the parrot saw a bald-headed man passing the shop, and recovering its speech, it cried out, "Pray, whose oil-jar did you upset?" The passers-by smiled at the parrot's mistake in confounding baldness caused by age with the loss of its own feathers due to a blow.
Rumi, Maulana Jalalu-'d-din Muhammad (2011-05-16). The Masnavi I Manavi of Rumi Complete 6 Books (Kindle Locations 107-112). OrangeSky Project. Kindle Edition.

Junit 4.11 cheatsheet

Assertion - org.junit.AssertEquals, NotEquals, True, False, Null, NotNull - Arrays, Object & Strings
Test Aggregation importorg.junit.runner.RunWith;importorg.junit.runners.Suite;@RunWith(Suite.class)@Suite.SuiteClasses({TestFeatureLogin.class,TestFeatureLogout.class,TestFeatureNavigate.class,TestFeatureUpdate.class})publicclassFeatureTestSuite{// the class remains empty,// used only as a holder for the above annotations}
Exception Testing @Test(expected=IndexOutOfBoundsException.class)publicvoidempty(){newArrayList<Object>().get(0);} @Rule public ExpectedException thrown = ExpectedException.none(); @Test public void shouldTestExceptionMessage() throws IndexOutOfBoundsException { List
Matchers and assertthat assertThat(x, is(3)); assertThat(x, is(not(4))); assertThat(responseString, either(containsString("color")).or(containsString("colour"))); assertThat(myList, hasItem("3")); Ignoring tests
@Ignore("Test is ignored …

Cricbay DRR calculation technique made easy

Seaon is coming to an end and everyone is closely watching team DRR and here is an simple method of predicting match DRR. 10 is the magic number to get 0.50 DRR.
Bat firstwin by 10 runs and your DRR will be 0.50. likewise 20 runs diff will give 1.00 DRR etc

Bat secondYou need the below formula to calcuate balls required to get 0.50 DRR. (runs/runs+10) * 120) i.e. chasing 60 runs you will need ==> 60/70 * 120 ==> 103 balls to get 0.50 DRR chasing 80 you will do ==> 80/90 * 120 ==> 108 balls to get 0.50 DRR
Note: if you are still wondering how to calculate loosing DRR just remember DRR lost by one team is gain by others i.e. just put a minus infront of winners DRR. Note: All the calculations are rounded to nearest decimal.

--- Wondering how I got to the nos --- Bat first DRR formula ==> (Runs scored/Ball faced - Runs gave/Balls bolwed) * 6 If you bat first and win that way you and your oppoent will end up playing 120 balls either by playing all balls or loosing all wickets. Let b…

Takeaway from The Leadership of Muhammad (SAW) by John Adair

Key Points

l A leader should exemplify or personify the qualities
expected, required and admired in their working
groups. A leader of soldiers, for example, needs to

demonstrate courage, ‘the soldier’s virtue’, as 
Shakespeare called it.
l Courage is a quality shown by Muhammad at
Hunayn: it is that which enables people to meet 
danger without giving way to fear, to act bravely 
under stress or to endure in times of adversity.
l All members of working groups, organizations or
communities – at all times in known history – share
one thing in common: they are all persons with a 
common and constant humannature.
l A universal leader, then, will be a person who
exemplifes such distinctively human qualities as
goodness, kindness, humaneness and compassion. Did 
you see any of these qualities in Muhammad?
l Another generic quality of universal leaders is

l All members of working groups, organizations or
communities – at all times in known history – share
one thing in common: they are all per…