Thursday, December 6, 2012

Mockito: Java Unit Testing with Mock Objects

Mockito is an open source testing framework for Java. The framework allows the creation of Test Double objects called, “Mock Objects” in automated unit tests for the purpose of Test-driven Development (TDD) or Behavior Driven Development (BDD).
Mockito compared to EasyMock seems to be more easily and has more flexibility. First it’s able to mock up interfaces as well as classes. You doesn’t need additional Jar libraries. Furthermore there isn’t any replay mode. First you have to stub and afterwards you have to verificate your mocked classes or interfaces. 

Cassandra Quick Basics

Cassandra is a decentralized No-Sql database. It works on multi node cluster where every node is identical to every other node (server symmetry – all node features same). There is no master node concept, as in Hadoop, hence there is no single point of failure.
A few features/terms
  • Elastic scalability: able to scale, up or down, dynamically without restart or disruption of services.
  • Consistency level: decide when to consider transaction successful.
  • Tunable consistency (strict, casual, and weak), which is inversely proportional to availability.
  • Stores data in multidimensional hash table.
  • Schema free: model requires queries and then work on data.
  • Designed to take advantage of multiprocessor/core machines.
  • optimized for excellent throughput for write.
Data Model
  • Column, contains name value pair, is a most basic unit of data structure. Columns are Continue reading 

Friday, September 14, 2012

Inspiring Poem: The Road Not Taken

Robert Frost's poem "The Road Not Taken" was published in 1916 in the collection Mountain Interval, a 1916 poetry collection. It is the first poem in the volume and is printed in italics.

Though the poem is interpreted differently by different people and there might be many hidden meanings, I find this poem as inspiring, adventurous, and ambitious. 

The Road Not Taken

Two roads diverged in a yellow wood,
And sorry I could not travel both
And be one traveler, long I stood
And looked down one as far as I could
To where it bent in the undergrowth;

Then took the other, as just as fair,
And having perhaps the better claim
Because it was grassy and wanted wear,
Though as for that the passing there
Had worn them really about the same,

And both that morning equally lay
In leaves no step had trodden black.
Oh, I marked the first for another day!
Yet knowing how way leads on to way
I doubted if I should ever come back.

I shall be telling this with a sigh
Somewhere ages and ages hence:
Two roads diverged in a wood, and I,
I took the one less traveled by,
And that has made all the difference.
Robert Frost 

Saturday, August 11, 2012

Mumbai - My dream city

I love this picture for it's charming, lively, energitic, and inspiring. Everything in this picture is great: a bright clear blue sky, Gateway of India, sea, boats, buildings, everything. I see this picture as optimistic and mood refreshing and I got bowled over by the picture's magnifiscent beauty - A lively and a very nice scenery.

Mumbai, previously known as Bombay, is one of the most populous cities in world. Many say Mumbai's cosmopolitian and diverse lifestyle is not comparable to those of any other city in India.  It's also called as commercial and financial capital of India, where many of the India's numerous conglomerates and five of Fortune 500 companies are based. As of 2008, the Globalization and World Cities Study Group (GaWC) has ranked Mumbai as an "Alpha world city".

I love Mumbai and once in a while I'll like to be a part of it's diverse culture, and this picture has just made this desire even more strong.


Thursday, May 24, 2012

Compound effects of a audience expectations

A few days back while playing TT I experienced the compound effects of audience pressure. A few bad shots had such an effect that the whole game went from normal to bad and from bad to worse or I should say ugly. When I try to understand, it seems it is what we call "performing under pressure"; when you see that someone is watching your game, it becomes many times more difficult and it has a such a compound effect that getting back to normal becomes a challenge and the performance graph goes down in a compound way. A reason can be losing one's focus.

For now the only solution I see is trying to limit the thoughts to one's game and forget the audience and play a normal game but this certainly requires a much discipline and it comes with a lot of patience and practise.

The next game I played was a normal one, as there was no audience ;)
FOCUS is the crux.

Sunday, May 20, 2012

Sweltering Heat

It's very hot in Gurgaon today, somewhat around 46' C and since morning I already had 5-6 Lt's of water but I'm still f*** up. Right now I'm sitting in an air-cooler, thanks to Sossy who poured water into it, which is actually ineffective. I'm in dire need of AC but I have to wait till the end of this month, as I might relocate and it doesn't make any sense to install it now and then, after a few days, uninstall it. I've to wait till I change my room :-/

This summer made me remember my college's I & II year at Doon. I used to sit in the similar hot summer with no Air-cooler or AC, which is now a sort of nightmare for me. At that time I thought that it's good to get tough and face it but now I feel how silly thought was that because it eventually affected my work. Those two years were like worst for me.

Getting comfortable, if you can afford, is not a luxury but a necessity and I'm waiting to indulge myself in comfort because this summer is like killing me. I have very high regards for people who have to work outside in this sweltering heat, they are like real tough. Temperature is now better after Sossy's hard work and I'm enjoying it with another glass of Tang, cheers ;) 

Tuesday, April 10, 2012

Another discussion or I should say argument :-/

Phew, I again went into an argument: if Indigo airline provides discount, other than dealer. Here are a few points that he made but which actually were flawed

  • Airlines don't care about bookings and they will fly empty because this is how aviation industry work: Dude this is not railway which won't care about passengers or profit. There is a tough competition out there and to make profit they need to care about passengers and bookings. Considering your point I think, just knowing the term 'Aviation industry' doesn't make you understand it.
  • Airlines don't have a sales team or department  because this is how aviation industry works: I don't believe that this to be true and either I'm ignorant or you are saying junk. Any private airline have to have a sales dept besides the agents network. At one point I also gave him an example of Virgin airlines which faced the competitor's bad tactics about stealing customers but he didn't listened and when I told that dude I'm stating facts because I read virgin's biography, he said: ok virgin is different.
  • On bulk bookings, like 30 or 40, dealers can offer you discount but Indigo airlines cannot: I have one logical explanation which goes like - Dealers work on commissions and when I book tickets through them then it also includes their discount and if I work with the airlines sales team directly then they won't offer me discount; hats off dude I don't understand it why because you kept on saying this is how "Aviation industry" work.
Here are a few lessons for me as well ;)
  • L1: Don't go into an argument: When people are stubborn, even though they don't know "A" of it, get out of that argument.
  • L2: Try to convince him more logically but that too for a short time and then just GET OUT.
  • L3: Control your emotions better and don't move into it.
  • L4: When you an get an indication that people know  a lot about it, like "Aviation industry", then just leave it and change the topic or your seat.
  • L5: Remain calm even though you know that he is talking junk ;)
All in all I believe you are just another guy who has to speak just for the sake of it and it doesn't mean to you even if you are stating your opinions without understanding the "A" of it. I don't care about your opinion because in your opinion my cook can be the better PM that India had in last two terms but Dude who cares :D