import java.util.HashMap;import java.util.Map;import java.util.Random;public class GoatAndCarProblem{ public static void main(String[] args) { int numberOfTimesCarChosenIfSwitched = 0; int numberOfTimesGamePlayed = 10000; for (int j = 0; j < numberOfTimesGamePlayed; j++) { Map doors = new HashMap(); doors.put(1, "Goat"); doors.put(2, "Goat"); doors.put(3, "Car"); //you select a door number randomly final int doorNoOfYourOriginalChoice = new Random().nextInt(doors.size()); eliminateDoorWithGoat(doors, doo
"Lee Kuan Yew made Singapore a paragon of development; but authoritarians draw the wrong lessons from his success." -- Economist.One can't explain his legacy any better than that. That's his bless and curse. He was a visionary and he would have made himself one of the greatest CEOs had he been in the industry.Instead he ran a country, like a ...
It has been four years since I graduated from using Apache TCPMon or wireshark (ethereal) to trace and test the SOAP/REST request responses. Some ten years ago, TCPMon was the only savior to test SOAP request/response easily. You could even replay the request.The last four years are full of SOAP UI, a comprehensive open source testing application for SOAP and ...
"To Kill a Mocking Bird" by Harper Lee, is one of the fine prints of English literature and arguably one of the top five novels of the 20th century in any language. As I was reading this book last year, it was palpable that most of the contemporary writers of this era couldn't get away from Harper's legacy, let it ...
The steps to create branches and working with number of branches in parallel.How to create a branch in the local repository?git branch branch-jkListing down the branches in the local repositorygit branch branch-jk* masterTo switch to branch git checkout branch-jk If you have dirty files in your local environment when your try to switch to branch, it will fail. So ...
I am a part of the proud generation who grew up watching legendary players in the names of Vivian, Lara, Ambrose, Gowri, Kandee, Warne, Ponting, Saurav, Dravid, Imran, Wasim, Miandand and Kallis. Then of-course there is this man who been the synonym of cricket for last twenty years or so. I still remember his first ever series in Pakistan during ...
I was rushing, really rushing. I had to buy a birthday card and go to the party which I was already late to. I was walking past all the shops and leading to the cards store. Then all of a sudden something stroked. I stopped, backtracked and hopped into the shop. There was this "New Releases" section and I found ...
"If your house was on fire and you had 60 seconds, what would you take? "This question was in the movie Leap Year, a movie about a soon to be engaged, confused Boston girl meeting a country bartender come chef, an Irish boy in a little town called Dingle. The girl is well educated, intellect but totally confused with what ...
There are days one feels, everything is blacked out. There wouldn’t be any reasons for it, but it just happens. Its like an opposite to big bang. Everything you do go nothing. That includes, time, space, mass and energy. You would have counted on them in your entire life right? Now imagine everything without time, space, mass and energy? ...
The odometer almost touching 140 mark. But he didn’t notice. He didn’t realise how fast he was going. There was nobody in the road. It was a deserted out creek drive with full of livestock farms around. Its the first day of the autumn season. One could see the bush fire affected remnants all over the places. It wasn't hot, ...
Yesterday found this amazing video of a desperate kid trying to reach to moon. Taken aback by the freshness and the innocence in this kid, I watched this video again and again. Interestingly a NASA employee must have seen this video, now invited the girl to have a visit to their lab to see how close she can reach ...
When I was going through Google’s aggregation on 2012 resolutions, I was kinda thinking what could be mine this year. Checking into a gym? Learning Guitar, honestly? Not to appear on stages anymore, not to commit with any of the rubbish debates, poetry sort of things which I recently pushed into. I am gonna let all these go and ...
When Google released its YouTube application for iPad, I was one of those who got damn excited. Soon switched to it and started using it. But then it was like a fiscal cliff! Its pathetic I couldn’t multitask it. The moment I start using the chrome or safari, YouTube would stop playing the video. If you go to volume ...
Recently I had a chance to play around with JMockit. We need to introduce a mocking framework which could support legacy code seamlessly and JMockit pretty much does as it claims. It wasn’t a straightforward experience though. Since the code I was testing against has a tightly coupled servlet and backend legacy APIs as well as Java’s own system/lang ...
Yarl Geek Challenge finally happened. It was in October, we ran the show for four days, four consecutive days in a fashion we wouldn’t have imagined even in our wildest dream two years back. There were about ten teams from Jaffna, Vavuniya, Moratuwa, Colombo, Trinco and Pera. The students from different institutions. The judges had diversity too. Some of ...
Renovators, a reality show which was happening in Australia. A flop show, never had its second season apparently. But I kind of fell for the show and hardly missed any episodes. You get five teams assigned homes/buildings in crappy conditions. The teams need to renovate the them in a given budget and this show would go for six to seven ...
So it happened. The first ever YIT call, and if I recall it correctly, it was attended by Sayanthan, Sarves and Vimal. We were just brainstorming on the plans. None of us were too sure about what we gonna do at the ground level. The idea was not to try too hard. We should enjoy what we do, and whatever ...
It was the 9th of October 2011, a Sunday morning, as usual I woke up early in the morning, made my coffee and settling in my couch with iPad, going through the heaps of emails, and to my surprise... there was this email.Hi JK, Hope you are doing great! Since I visited iHub in Nairobi, I had been toying with ...
It was early 90s. 1994 I think. My brother was an English teacher by then, undergoing the teachers' English literature training program. I still remember his long study table with full of scattered literature books. Shakespeare, R.K Narayan, Charles Dickens, you name it. Never a natural reader by himself, he often finds it hard to study those books, and he ...