Tuesday, December 24, 2013

Merry Christmas 2013


xmas
Merry Christmas


Friday, September 13, 2013

Friday The 13th



Today is Friday the 13th. Here are some 13 facts about Friday the 13th which some people believe as a bad day.

  1. More than 60 million people worldwide claim to be affected by a fear of Friday 13th. Some of them won’t go to work, drive cars or get out of bed on this day.
  2. The fear of Friday the 13th is called paraskavedekatriaphobia.
  3. According to the British Medical Journal there is a significant increase in traffic-related accidents when the date is Friday 13th.
  4. Every year has at least one and at most three Friday the 13th.
  5. Famous people born on Friday the 13th include Samuel Beckett (13 April 1906), Margaret Thatcher (13 October 1923), Fidel Castro (13 August 1926) and Steve Buscemi (13 December 1957).
  6. Tupac Shakur died on Friday, September 13, 1996.
  7. The Uruguayan rugby team’s plane crashed in the Andes mountain range on Friday, 13 October, 1972.
  8. Many hospitals have no room 13, while airports don't have a Gate 13.
  9. Triskaidekaphobia is the fear of the number 13. Napoleon and President Herbert Hoover were said to be sufferers.
  10. The Athens Olympic Games opened on Friday 13th of August, 2004.
  11. President Franklin D. Roosevelt would not travel on the 13th day of any month and would never host 13 guests at a meal. Napoleon and President Herbert Hoover were also triskaidekaphobic, with an abnormal fear of the number 13.
  12. Mark Twain once was the 13th guest at a dinner party. A friend warned him not to go. "It was bad luck," Twain later told the friend. "They only had food for 12." Superstitious diners in Paris can hire a quatorzieme, or professional 14th guest.
  13. The number 13 suffers from its position after 12, according to numerologists who consider the latter to be a complete number — 12 months in a year, 12 signs of the zodiac, 12 gods of Olympus, 12 labors of Hercules, 12 tribes of Israel, 12 apostles of Jesus, 12 days of Christmas and 12 eggs in a dozen.

Monday, June 24, 2013

ICC Champions Trophy ( part 2 )

The ICC Champions Trophy is finished and after a very competitive tournament India has once again crowned as winners. The success of the tournament has prompted ICC to review it's decision of discontinuing the tournament in the future. This is the second part of a review on the performance of  teams in the ICC champions trophy. ( visit part 1 )


  • South Africa 
South Africa reminded the world that they are still the "Chokers" at the big stage. However they performed without four of their main players. Steyn and Morkel are the one of the best opening bowlers pairs in the world. But SA had to play most of the matches without the service of these bowlers. Also they were without Kallis and Smith for the whole tournament. Probably the loss of Kallis who is a very good all-rounder ha affected the SA's team balance. Considering those facts the SA's performance can be categorized as satisfactory. However the way they lost their semi finals match was very humiliating.
  • Sri Lanka
This time Sri Lanka were able to lose at the semi final stage without getting qualified for finals and losing the final. Most of the time I think Sri Lankan team lacked the balance in the team. They played with just 3 specialist bowlers and 2 or 3 batting all-rounders. Also Kusal Perera was a great failure. He was unable to get into double figures in any of the matches. It is interesting to see whether he will get more opportunities at the top. The senior trio of Mahela, Sangakkara and Dilshan took the responsibility of building the innings but failed in the semis. Malinga proved that he is still dangerous in the ODI format as well.




  • England
With the home advantage England were favorites to win the tournament from the beginning. Yet their plans were hit by ball tampering accusations and the loss to Sri Lanka in the group stage. Yet they recovered well to reach the final. But as South Africa they choked under pressure at the final. Probably they now need to wait for some more time before adding a ICC ODI silverware to their cabinet. The way they lost the game in the last 3 overs was very surprising. Bopara has done a great work both with the bat and the ball.  Not so often we see the most performing player becoming the most criticized player. But with Trott it has been the case. He has performed extremely well in the tournament but been severely criticized for his slow batting.

  • India
At the beginning there were many problems associated with India. Many people questioned the ability of the Indian batsmen to survive the bouncy pitches and the ability of Indian fast bowling resources. But this young Indian team has performed extremely well and able to win the final. Dhoni continues to be a successful captain winning all the available formats of ICC trophies. Ravindra Jadeja has become a real superhero in Indian cricket. A young Indian team once again proved the depth of the resources available in India.
  • UDRS and Umpires
Apart from the teams another thing which caught the attention was the use of UDRS and umpiring. There
were several instances where the third umpire gave controversial decisions. The no ball call against Broad in the match against New Zealand was one such incident. Also the use of reviews in a match was very crucial. As an example in the SL vs NZ match both teams had use their reviews in the second innings. And if there were more reviews available the result may have been different. So in the latter parts of the tournament teams were very conservative about using their review early in the innings.

However with all these things the tournament was a grand success. ICC should consider themselves lucky to be able to play at-least a 20 over game in the final. With no reserve day for the final if there were some more rain the whole tournament would have been a waste of time. Yet we witnessed and enjoyed a competitive finale for a competitive tournament.



Wednesday, June 19, 2013

ICC Champions Trophy ( part 1)

The first round of the Champions Trophy is finished and now We are heading to the knock out stage. England have already qualified for the final and one of India or Sri Lanka will qualify from the next semi final. This is a review on the performance of some of the teams so far.

  • Pakistan
With zero points from 3 matches Pakistan was the most disappointing team in the tournament. In the beginning very few believed that they were able to qualify for the semi finals and they lived according to majority's expectation. The only match they really gave a fight was the match with the WI and if their batsmen have scored some more runs they may had a chance to win. Altogether they need to find good batsmen who can score fluently in ODIs. Otherwise their future in cricketing world looks bleak despite the continuous supply of quality fast bowlers.
  • Australia
Watching this Australian team play would be the most saddest thing in the world for a neutral cricket fan who have followed cricket for the past 15 years. The Australian team have lost their golden form which was with them for the past decade. For the first time they were unable to get in to the semi finals of an ICC event since 1990s. The batiing looks listless and bowling ordinary. They should find proper batsmen instead of filling their side with T20 superstars. One may argue that the T20 format has affected the Australians more than WI and India. With the performance shown by the current Australian team there is a serious doubt whether they can match England in the upcoming ashes tournament.
  • West Indies
West Indies is the most unlucky team in the tournament. They would have easily register a win unless rain
interrupted just as Pollard got out. Even if there were no rain Sammy would be able to guide the chase easily. Yet rain god had other plans for WIs. They seems to be carrying their good form from T20s to the ODIs. Sunil Narine kept his reputation as a mystery spinner even in the International level. They need to find a stable batsmen in the middle order. Chanderpaul would have been ideal for such a role and Sarwan's did not get the 
  • New Zealand
New Zealand is also one of the unlucky sides. Not only they came close to be selected for knock outs but also they had a chance to win the game against England if Steve Davies gave the benefit of the doubt of the no ball to the Kane Williamson in the latter parts of the chase. As always they performed better than most of the people's prediction. They have a very good bowling unit. But their batting carries few non performers. They should seriously think about the role of James Franklin in the team. He is not bowling much and not performing with the bat. 



Monday, May 27, 2013

IPL, Cricket, Politics and Money

IPL is rocked with controversies. There were many fears at the start of the initial IPL that the spirit of the game will be damaged due to the extensive amount of money being involved. In this season all those fears have been realized to be true. It was found out that not only players but also officials and owners of teams were involved in spot fixing and betting.

This will be a great black mark on the game of cricket. The most serious problem is the response of the BCCI towards these allegations. Although BCCI criticized RR players who were accused of spot fixing, they kept silent about the arrest of Gurunath Meiyappan who is the son in law of current BCCI president. Also BCCI tried to cover up the Gurunath's connection with CSK stating that he is only a enthusiastic fan. It's president should really answer these questions regarding the allegations.

The greatest threat to the cricket is not money but the BCCI. The arrogant manner the current president controls the board is apparent to the whole world. BCCI does not care about the ICC and other cricketing nations. This was evident in the BCCI stand against the UDRS. Only BCCI opposes UDRS and as a result it is not compulsory in cricket matches world wide. Also BCCI intervened to the removal of Tim May form the ICC panel and somehow managed to get that position to one of their own employee. Also the BCCI is beyond the control of Indian government. It have all the money and power to influence the ICC.

I would not be surprised if at the end of the day all the big betters, fixers and bookie owners were some how released due to intelligent cover up stories and due to political influences and some small scale fixers are sentenced for wrong doing. This was evident form the attempts to hide the facts about the connection between Gurunath and CSK. 

Anyway I think it's the right time to other cricketing nations to come forward and reduce the power of BCCI in the ICC. And also Indian government should try to regulate the actions of BCCI. Cricketing fans should use their voice against corruption in cricket and try to save the wonderful game of cricket from all evil. 

Sunday, May 26, 2013

Queen Band - Probably the Kings of Rock

Queen are a British rock band formed in London in 1970, originally consisting of Freddie Mercury (lead vocals, piano), Brian May (guitar, vocals), John Deacon (bass guitar), and Roger Taylor (drums, vocals). Queen's earliest works were influenced by progressive rock, hard rock and heavy metal, but the band gradually ventured into more conventional and radio-friendly works, incorporating more diverse and innovative styles in their music.

Queen formed in 1971 and in 1973 signed their first recording contract for EMI. That year they released their first album, QUEEN. The same year saw their first major UK tour, and in 1974 they released QUEEN II as well as making their first UK headlining tour. They made their first US tour, and in November released SHEER HEART ATTACK which was a hit on both sides of the Atlantic.

Bohemian Rhapsody is considered as the best rock song in the history. "We are the champions" and "We will rock you"some of their other hits which have been very popular. More information about the band can be found at http://en.wikipedia.org/wiki/Queen_(band)

Bohemian Rhapsody




We are the Champions



We will Rock You



Love of my life




Tuesday, April 16, 2013

Snickometer



Invented in the mid-1990s by English computer scientist Alan Paskett, the Snickometer is used in a slow motion display to determine whether the ball did touch the bat , even slightly to determine if it was out. Although this was used earlier in UDRS, but unlike Hawk Eye and Hot Spot currently not used in UDRS. This is also known as the Snicko.

A Snickometer works on a simple principle. Filter the ambient noise, and amplify the relevant signal. The ball hitting the bat produces a sound of a particular frequency. The stump microphone will pick up the sound of the ball hitting the bat. It first filters this sound which is of a particular frequency from all the ambient noise. This can be achieved with the help of a resonance filter. At the receiver this sound is amplified and plotted to note the variation in the sound. A sharp variation denotes the bat hitting the ball and a flat peak means the bat has hit the pad or part of the body. This plot is viewed along with the replay of the shot to synchronize the movement of the ball and the spike in plot.  So in the situation where the batsman was ruled out, a review on TV with the Snicko will accurately determine the outcome.


Advantages and Disadvantages

The technology used for Snickometer is relatively simple. It only requires a slow motion camera and good microphone which are available in any international cricket match. Thus the cost of the Snickometer is very low making it affordable to any country. Sometimes Snickometer takes a considerable amount of time to give the output. This is due to the synchronization issues of the video and the audio. But with the development of the technology the synchronization will be done automatically and the results will be available as soon as the incident occurs. 

Also the Snickometer only indicates that a contact happened. This contact may be between bat and ball, pad and ball or the bat and pad. It is up to the umpire to take the final decision. Thus this leads to inconclusive replays in some cases. But in Hot Spot it clearly shows the area the contact occurred.

Being a very simple and cheap technology it is surprising that, it is no longer used in UDRS. It can be combined with Hot Spot technology to make better judgments about LBW and Catch decisions. Out of the three technologies used in UDRS, Snickometer is the least controversial technology yet it is not even used in UDRS. And the most controversial technology is Hawk Eye which is made mandatory. The Hot Spot technology lies in between and it is made optional in UDRS. Just like humans no technology is hundred percent accurate. So always we have to use the technology wisely and improve the accuracy of decision making process to make the game of cricket more fair to both teams. 

Wednesday, April 3, 2013

"So Close No Matter How Far" - Six Degrees of Separation

What if you have to send a message to some person you don't know directly and communication mediums such as email, mail or telephone were unavailable? Then the only method of communication will be via personal contacts. We can search for a friend of us who directly know the intended the recipient. But what if, none of our friends know the recipient directly? Then probably we have to depend on some other intermediate person who can connect one of our friends to the intended recipient. What if there is no such person. Then another intermediate person is required. 

This gives the rise to an interesting question , "What is the maximum number of such intermediate people needed to make sure that we can send a message to anyone in the world ? " or in other words "What is the minimum number of people between any two people in the world ?".

In six degrees of separation concept it says that this value is 6. This concept was introduced by the
The Film
Hungarian Author Frigyes Karinthy in one of his short stories in the year 1929 named "Chains". This was later popularized by a play named "Six Degrees of Separation" written by John Guare. There is also a film titled "Six Degrees of Separation" based on the same story (Will Smith is the main actor.Yet this film is boring) .

So there are at most only five intermediate persons between any two people in the world. I can personally send a mail to Barrack Obama via five intermediate persons. I can contact Chuck Norris via five people. I can connect with Mr.ABC from country XYZ through just five persons. It sounds so amazing and fascinating. So the real question is "is it true ?" Though this was initially introduced as a concept many people have tried to prove it mathematically and practically and amazingly most of those attempts have been somewhat successful. 

In 1967, American sociologist Stanley Milgram devised a way to test the theory, which he called "the small-world problem." He randomly selected people in the mid-West to send packages to a stranger located in Massachusetts. The senders knew the recipient's name, occupation, and general location. They were instructed to send the package to a person they knew on a first-name basis who they thought was most likely, out of all their friends, to know the target personally. That person would do the same, and so on, until the package was personally delivered to its target recipient.Although the participants expected the chain to include at least a hundred intermediaries, it only took (on average) between five and seven intermediaries to get each package delivered. Milgram's findings were published in Psychology Today. This has confirmed the number of links is actually close to six.

Apart from that experiment there were many other experiments and theories. Some of them used mathematical derivations and assumptions as well. With the advancement of technology there are several internet experiments which have tried to check the validity of this concept. One of the interesting experiments is the game "Six Degrees of Kevin Bacon" which was invented as a play on the concept. The goal is to link any actor to Kevin Bacon through no more than six connections, where two actors are connected if they have appeared in a movie or commercial together. It was created by four students at Albright College in Pennsylvania, who came up with the concept while watching Footloose. On the 13th of September, 2012, Google made it possible to search for any given actor's 'Bacon Number' through their search engine. The "Oracle of Bacon" gives a version of this game based on the IMDB database. Using this we can search for the connection between any two actors. Even the Sri Lankan Actors are connected with Kevin Bacon or any other International actors with a very small degree of connection. As an example "Kamal Addaraarchchi" is connected with "Kevin Bacon" via just three intermediate actors. 



There may be tribal groups in the world who have never encountered other civilizations. Thus finding a connection with them will be an impossible thing. In that case this concept will not be true. Apart from that fact all other improvements in technology has resulted in a well connected world. Thus the six degrees of freedom will most probably be true for most of the people in the world. And it is expected that this value of six will be further reduced with the development of the communication technology, transportation facilities and multimedia . Thus the connectivity in the world is so tight and as humans we are "So Close No Matter How far" .



Sunday, March 31, 2013

Wind of Change


I follow the Moskva
Down to Gorky Park
Listening to the wind of change
An August summer night
Soldiers passing by
Listening to the wind of change

The world is closing in
Did you ever think
That we could be so close, like brothers
The future's in the air
I can feel it everywhere
Blowing with the wind of change

Take me to the magic of the moment
On a glory night
Where the children of tomorrow dream away
In the wind of change

Walking down the street
Distant memories
Are buried in the past forever
I follow the Moskva
Down to Gorky Park
Listening to the wind of change

Take me to the magic of the moment
On a glory night
Where the children of tomorrow share their dreams
With you and me
Take me to the magic of the moment
On a glory night
Where the children of tomorrow dream away
In the wind of change

The wind of change
Blows straight into the face of time
Like a stormwind that will ring the freedom bell
For peace of mind
Let your balalaika sing
What my guitar wants to say

Take me to the magic of the moment
On a glory night
Where the children of tomorrow share their dreams
With you and me
Take me to the magic of the moment
On a glory night
Where the children of tomorrow dream away
In the wind of change


Thursday, March 14, 2013

Pi Day

Today is the "Pi DAY". We have dedicated special dates to celebrate various reasons. And March 14 (or in numbers 3-14) is the day dedicated to celebrate the mathematical constant "Pi". The representation of this date consists the first three digits of the mathematical constant "Pi". Thus it is selected as the "Pi" day. It is a day celebrated by mathematics lovers and probably a day hated by maths haters.
Pi Day Google Doodle 

There are sites specially designed to celebrate this day such as http://www.piday.org/. And it contains useful information about the constant "Pi". Alternatively another day is celebrated as the "Pi" approximation day which fall on July 22nd (22/7) which represents the widely used approximation value of "Pi".

Thursday, February 21, 2013

The Cake Cutting Problem - Fair Division Problem (Part 1)


As humans we tend to own everything. When dividing something among people we need to own a fair portion, if not a bigger portion. Thus problems regarding dividing has become the source of many conflicts, wars and sometimes crimes. Cake Cutting problem is an interesting thing in mathematics which deals with dividing a cake between several people such that each person is fully satisfied with the piece he gets.The generalized dividing problem is also known as the fair division problem and there are several algorithms to solve this. This problem is very much associated with real life problems.


Basics


Before solving the problem of fair division the word "Fair" should be defined properly. Fair can mean two things. The first condition is everyone should be satisfied, that the piece they got is at least an equal portion of the total resources. That is, if the resource is divided between n people each person should feel that they have received at least 1/n portion. The other condition is that every person should feel that no one has received more than himself. In other words everyone should feel that they received the largest part. Satisfying the first condition is less problematic than the second. Thus sometimes the dividing problem is limited to satisfy only the first condition. Yet the human behavior demands not only the first condition but also the second condition should be satisfied so that everyone is happy about the division of the resource. The problems which mandate the second condition is also known as Envy Free division. 

Also the criteria to decide the value of each portion is important. In the simplest case the value of each piece is based on its size. But in complex (and practical) cases the value of each piece will be different     to each participant. One participant may value a piece of cake with more icing on it while one prefer a  piece with cherries. Even under these conditions the definition of fair will help us to tackle the fair division problem easily.


Simplest Case



The simplest case is the division of a cake between two people. This can be easily solved using the divide and choose method. In this scenario one person divide the cake into two pieces which he thinks that is fair. The other person gets the chance to select a piece he like. The other piece is left to the first person. As the first person initially divided the cake in to two fair parts he gets a fair portion. Although second person do not agree with the division of the cake in to two as fair he gets the chance to select any piece. Thus he will also be satisfied with the piece he gets.


The Case of Three


The next case is the division of a cake between three people. There are several methods to solve this fair division problem for three people. Almost all these methods can be generalized to solve problems containing more than three people.The divide and select approach which was used for two person case can not be extended to solve this.  And there are solutions which seems plausible but proved wrong when thoroughly analyzed.

Let's now analyze one such incorrect approach. Let the three people be named as A,B and C. This solution includes following steps.


  • A cuts the cake in to two pieces where he thinks one is 1/3 and the other is 2/3 of the cake.
  • B cuts the 2/3 part of the cake in to two fair pieces.
  • C chooses any piece he likes.- So C is satisfied
  • Then A chooses.
  • Finally B chooses.
Now lets analyze the above solution. Since C selects first, clearly C is satisfied. If C has chosen a piece that is cut by B then A can select the initial piece he cut. If C has selected the initial piece cut by A, then A can select one of the pieces cut by B. As A initially divided in to 1/3 and 2/3 parts, at least one piece cut by B should be 1/3. So A is satisfied in any case. The problem is with B. If B thinks the initial cut by A is not fair (ie. The smaller piece is larger than 1/3 of the cake) B is only satisfied with that piece. Thus if that piece is selected by A or C then B is left unsatisfied. Thus the solution given here is not correct.



Friday, February 15, 2013

Captcha



There are few things in the world that I hate too much. One such thing is to prove a stupid computer that I am really a human , not a bot. The way we have to prove it, is so much annoying. Most of the time we have to read some distorted letters and enter them to a text box. This text is called a "CAPTCHA". "CAPTCHA" stands for "Completely Automated Public Turing test to tell Computers and Human Apart". This is a kind of Turing test. Instead of administrated by a human and targeted at a machine "Captcha" is administrated by a machine and targeted for a human. The "Captcha"s are used for variety of purposes. The main purpose is to stop spams and automated votes in voting systems. Most of the time we encounter these while registering to a website or posting a comment on a blog post. Also sometimes we have to fill a "Captcha" if we incorrectly entered a password several times.  
But I feel this has become a very annoying thing to most people. Some of the "Captcha"s are really unreadable. It is interesting to know whether there are any data available on the time that is wasted due to these "Captchas". Thus the balance between the security and the user friendliness should be maintained by carefully selecting when to use "Captcha"s and their hardness to solve .


Saturday, January 19, 2013

Setting-up javaCV on NetBeans and Eclipse

JavaCV is a set of wrapper classes used for openCV. Using javaCV any C code used for Image Processing can be converted in to a java code. For a person who have an expertise knowledge on java and a little knowledge on C, javaCV will be very useful as he only have to worry about the logic of the code not the syntax. Following is a guide to install and configure javaCV in netbeans or eclipse environment.
  1. Install Microsoft Visual C++ Microsoft Visual C++ 2010 Redistributable Package (x86) or Microsoft Visual C++ 2010 Redistributable Package (x64) (If your system is 64 bit) 
  2. Download opencv 2.4.0 OpenCV windows SuperPack version 2.4.0 
      • Note- Opencv 2.4.1 does not work with this. It gives a linking error.
  3. Extract opencv to C: 
  4. Set up environment variables
    • 64-bit version of the JDK: C:\opencv\build\common\tbb\intel64\vc10\;C:\opencv\build\x64\vc10\bin\; 
    • 32-bit version of the JDK: C:\opencv\build\common\tbb\ia32\vc10\;C:\opencv\build\x86\vc10\bin\;                                       ”.
  5. Download and extract javacv Link. This contains 8 jar files
  6. When creating projects add those jar files to the libraries folder
    •  In netbeans right click Libraries and select ”add JAR/folder” and select above jar files.
    •  In eclipse right click the project folder and select properties. Select “java build path” and select the Libraries tab and add the required jar files.
  7. Check the following code. This captures an image from the web cam.
import com.googlecode.javacv.OpenCVFrameGrabber; 
import com.googlecode.javacv.cpp.opencv_core.IplImage;
import static com.googlecode.javacv.cpp.opencv_highgui.*; 

public class CaptureImage {

private static void captureFrame() { 
  // 0-default camera, 1 - next...so on 
  final OpenCVFrameGrabber grabber = new OpenCVFrameGrabber(0);
  try { 
    grabber.start();
    IplImage img = grabber.grab();
    if (img != null) { 
      cvSaveImage("capture.jpg", img);
    }
  } catch (Exception e) { 
    e.printStackTrace(); 
  } 
}

public static void main(String[] args) { 
  captureFrame(); 

}
  • You can find the captured picture on the project folder. To change the camera change the number that is passed to the OpenCVFrameGrabber constructor.


Sutra Directory