Friday, January 08, 2010

Insane People

While watching TV, I came across this news (http://www.dailychilli.com/news/1721-two-ministers-watch-as-cop-bleeds-to-death) where two ministers watch while cop dies.
I am not pressing at ministers but the whole group of people standing there and watching his death. Crows cry when other fellow crow is hurt. How can we being human beings watch other person dying?. The ugliest reasons they give are "We were waiting for Ambulance", "We thought the minister's convoy is attacked. So, we were thinking whether the attacked people still there and might attack if we reach near to the person". All I can say, they are insane. I don't treat them as human beings. Would you do the same thing if your family member is in that position?

Poor police office, who got double promotions for doing bravery tasks. He was part of "Operation Veerappan". Even, if he is not, he deserves help from the people around. And the way people were pouring drinking water over him, it looked like he is untouchable and they can't touch him. I felt sad and I couldn't do anything. :-(

Thursday, December 31, 2009

Issues while starting mysql server

I have installed mysql server again in my local machine and I was trying to start the same using /etc/init.d/mysqld start and I was getting error saying "Timeout" and when I looked into /var/log/mysqld.log, it is giving error as the db is corrupted or not shutdown properly previously. And after doing some other fixes, I was getting "Can't open and lock privilege tables: Table 'mysql.host' doesn't exist" So to resolve this, I have removed the datadir altogether and have executed below commands:

/usr/bin/mysql_install_db --user=mysql --ldata=/new-data-location
and once that is succeeded, I tried to start with
mysqld_safe --datadir=/new-data-location --user=mysql &
and I got below error saying it couldn't create .pid file in /new-data-location/mysqld. So, I had to manually create mysqld directory in new-data-location and change ownership to mysql and re executed above command and everything went fine.

Now, I changed the root password using the secure installation script(mysql_secure_installation) available in bin folder and everything is fine now.

Refreshing all IMAP folders in Thunderbird

Continuing my work towards configuring my desktop for checking mails, I was irritated with thunderbird configuration as it wasn't refreshing all folders and I had to manually click on each folder for new mail. So, I was wondering what to do and then I remembered what my husband said which I effectively use in my day-to-day work. He said below quote.

"Remember, when you are facing a problem, don't think you are the only one and there are many who might have faced this earlier. So, before rushing to solve the problem, try to search over the net if there is a solution already. No need to reinvent the wheel"

There I go again, I searched and got below solution for refreshing all folders in Thunderbird.

Go to Edit ->Preferences -> Advanced -> Config Editor and toggle the following parameter available in the list.
"mail.check_all_imap_folders_for_new" which toggles value from false to true and you are done. Now, I don't need to refresh each folder separately.

Reference for above solution:
http://alexlurthu.wordpress.com/2007/07/22/thunderbird-config-to-refresh-all-imap-folders/

Thursday, December 24, 2009

The only Active President of India so far

None other than great Dr. APJ Abdul Kalam ji. Though, President don't have much power to do, he was not wasting government money for useless travels and was inspiring young generation where ever he went to give a talk/chat with people. I remember the discussions that were happening while electing the next President when Dr APJ Abdul Kalam and other lady (don't remember her name) were contending for it. Now, I feel what would have happened if the lady was selected, we would have missed such a great president.

Just now heard that our current President of India,Prathibha Patil, brought her 3 dozen relatives along with her while travelling to some other place. We, the poor tax payers continue to pay taxes to let the politicians enjoy with our money. :-)

Monday, December 21, 2009

To start mplayer in shuffle and repeat mode

mplayer -shuffle -loop 0

Plugin for reading telugu news paper in mozilla firefox in linux

With changes in my cab routes and so change in my daily scheduled walk to catch cab, I was getting backpain (I rush in the last minute to catch the cab, so you can imagine how fast I need to walk) due to the heavy weight on my back on the name of "Laptop". So, I decided to configure my desktop for everything that I would need laptop for. Only thing that left was to read telugu news paper (yeah. I am addicted to "Eenadu" since my childhood when I was in 2nd or 3rd Std). So, I came across this plug in which would install the dynamic fonts needed for these news papers. Reference: http://www.adminbytes.com/2008/08/reading-malayalam-newspapers-using.html

Friday, December 11, 2009

Installing Maven in fc9 and maven plugin for eclipse

for maven plugin - install the below plugin
http://www.eclipse.org/iam/
and the respective installation instructions are available at http://code.google.com/p/q4e/wiki/Installation
and once it is installed successfully, select maven by right clicking the project and then build is done using maven rather ant.


And, for installing maven in fc9, yum is showing maven2.0.4 which is old and doesn't work with latest maven pom.xml. So, in order to install latest version of maven, get the latest version from apache site http://maven.apache.org/download.html and download it. Once downloaded, specify the bin path in your PATH variable. Reference: http://beans.seartipy.com/page/2/

Tuesday, December 08, 2009

Ilayaraja rocks

We watched "Paa" in Solapur. It was nice as it was unexpected. We reached Solapur early and there was nothing to do as there was a gap of 5 hours for the train which we have to take. So, we planned to go for some movie and we found this theater where there were three options

1. De dana dan
2. Radio
3. Paa

And, we had this impression that Paa would be senti but we thought, that's ok. I don't want to go for Radio for sure.

But, Paa is not senti. And, Amitabh rocks as a child actor and Ilayaraja music rocks like anything. Vidya Balan looked much better than in Parineeta. Overall, I loved this movie and recommend to watch. :)

Thursday, November 26, 2009

Junit testing

After a long break, recently I came across junit testing. This was when I was helping my team member in writing junit tests and suggested where to start from. Then, there was an issue in running a TestSuite.

The code that I used before is something like below:

import junit.framework.Test;
import junit.framework.TestSuite;

public class AllTests {

public static Test suite() {
TestSuite suite = new TestSuite("Test for something");
suite.addTestSuite(SomeClass.class);
return suite;
}
}


But, when i tried to run, I got below error:
java.lang.Exception: No runnable methods

By the way, this is with junit-4. So, here is what we figured out -
In junit-4, they use annotations for TestSuite. So, the old syntax is not working. Here is working syntax

import org.junit.runner.RunWith;
import org.junit.runners.Suite;
@RunWith(Suite.class)
@Suite.SuiteClasses( { SomeClass.class})

public class AllTests {
}

So simple. Isn't it?
Also, download junit coverage plugin for eclipse using this update site http://update.eclemma.org/ . More details are here regarding eclemma

Wednesday, November 18, 2009

Handling "Ctrl+C" in Java

It is very simple. One just need to use addShutdownHook method and pass a thread where you can add code to do what ever you wanted to.
Sample code is here -

public class ShutdownHookDemo {

public static void main(String[] args)
{
Runtime.getRuntime().addShutdownHook(new Thread() {
public void run()
{
System.out.println("Ctrl+C was pressed by some one and I am exiting now");
}
});

int i = 0;
while(true)
{
System.out.println("I value:" + i++);
System.out.println("Going to sleep now for 2 secs");
try{
Thread.currentThread().sleep(2000);
}
catch(InterruptedException ie)
{
System.out.println("Someone woke me up:("+ ie);
ie.printStackTrace();
}
}
}
}

So simple it is.. isn't it? and I just realized that hadoop used it to close files opened when some one press "ctrl+C". Just one sentence to describe it "Simple yet powerful."

Tuesday, November 10, 2009

Lesson-1

While replying to a mail,

taking a pause is MUST and re-read a mail thinking as the person inTO/CC is MUST and ensuring the purpose of the mail meets is MUST.

Monday, November 09, 2009

One year completion of our engagement

Last year, this day Rupesh and I got engaged. Rupesh gave a surprise by preparing a cake in the night (and I was happily sleeping) and we distributed it in our offices. Everyone in my office liked it a lot and were asking for recipe. Seriously, I should confess that it was yummy.

Also, we liked this sharing of our joy by distributing cake in office. :) And, we enjoyed/loved it a lot.

Friday, October 30, 2009

Regex for replacing all non-ascii characters in java

line.replaceAll("[^\\p{ASCII}]", "")

source:http://forums.sun.com/thread.jspa?threadID=5370865

Thursday, October 29, 2009

Fixing issues with "JavaHL not available" in eclipse

It is finally a big relief to me as I was able to fix this issue and thought I should note it down this in my blog. It can be useful for others and also for myself in future.

Here is the issue

I installed eclipse ganymede and installed subclipse using http://subclipse.tigris.org/servlets/ProjectProcess?pageID=p4wYuA .
I tried both 1.4 and 1.6. However, I could see javaHL not available in preferences ->team ->svn.
And snvkit was not working for me


Fix to the above problem:
1. I used 1.4 version from subclipse.tigirs.org
2. I installed subversion client from collabnet. which is available at
http://www.collab.net/downloads/subversion/redhat1.5.html
(Note: You can use latest versions, how ever, older version worked for me) . I took the first one specified in the list (file name:CollabNetSubversion-client-1.5.7-1.i386.rpm)
3. Once the above is installed, you need to add /opt/CollabNet_Subversion/lib/ to LD_LIBRARY_PATH and /opt/CollabNet_Subversion/bin/ to PATH
and
4. Restart eclipse

Tuesday, October 27, 2009

Books and Opensource softwares

there are lot of things to write and I always think, I should write this in blog and forget.
Few quick updates. probably I will detail later when I get time

1. For the first time in my life, I finished two novels in consecutive months (people can finish in a day), but this is the biggest achievement for me as I always used to love short stories and novels were boring to me. I have read 1. one night at call centre 2. Forrest Gump

Currently reading one Telugu book on Swami Vivekananda.

2. Started learning "R". It is very interesting. though I am still learning A,B,C,D of it. Will update more once I get. :)

Wednesday, September 23, 2009

Kids are amazing!!!!

Funny talks/things by our niece,nephews:

Scene-1: My niece(4+yrs Old) goes to my sister and suddenly says "I want a kid at home". For which, my sister replied "why do we need a kid when you are a kid already at home". For which, my niece replied "I don't know. I want a kid. that's it. if you don't bring, I will leave home by taking clothes". My sister is like "!!!!!!!!". After a while, she said "where will you go. who will take you?" . My niece quickly replies "I will go to tata's (grandpa's) place.

Scene-2: Rupesh's sister asks his nephew(3+yrs old) "Ojas, what do you say about inviting other kid at home? Will you share all your toys with him? You shouldn't quarrel with him". He said "No. No need. Rupesh mama's baby will be there na. I will share toys with him.". And then she asks "what should we name the baby then?". He promptly replies "Engine Number 9". She couldn't control her laugh and questions him "We will name the baby Tejas as your name is Ojas" . He will say "No. The name would be engine number 9".

Scene-3: Rupesh's other nephew who is 1+ yr old observes his parents dipping rusk (aka toast) in Tea and eating. After that, they left kitchen and were talking in hall and after a while, they were wondering how can he sit so calm in kitchen for this long. So, they went back and observed. He took a glass of water and a mobile phone and dipped mobile phone water and licking mobile as eating toast. :-)

Friday, September 18, 2009

Confused in Java

I had a code where I was using writeBytes() method of DataOutput for writing a string to file. And, it created some issues while reading. Then, I replaced the same with write(str.getBytes()). This went fine without causing any issue. Confused now on what is the difference between these two methods. Still exploring...

Tuesday, September 15, 2009

Parody of one Ad w.r.t. Swine Flu

Actual Ad:
A lady walks into the recruitment panel where many other people are waiting and few of her documents fell down. When she picks up everything, every one left.


Parody:
A lady walks into the recruitment panel and when she kept on sneezing. Every one leaves. :D

My future kid name by Rupesh's nephew

It is "Engine Engine 9". :) and Rupesh says "It's so unique. Isn't it?" . :))

Friday, July 03, 2009

Shreya Goshal -Superb singer

Recently, I started liking "Teri ore, Teri ore" song from Singh is King and thought of downloading it and found that this song is sung by Shreya Goshal. She is an amazing singer. Most of the songs I like are sung by her. No one have that sweetness that she has in her tone.