Tuesday, April 26, 2011

Comments after reading Test First development blog

Today, I read this very interesting blog regarding Test first development, link is below.
http://xebee.xebia.in/2011/04/26/take-aways-from-dr-venkats-session-on-test-first-development/

There are something really draw my attentions:

1. the importance of creating an environment to make people do the right thing than to force them to do it. The right environment can be created through leading by example and assertive communication
2. Hiring by attitude, and train for skill.
3. he gave a magnificent example by citing a movie "A Few Good Men". He told that during an argument inside the court in the movie, someone quoted a rule. And then, Tom Cruise came with the rule book in his hand asking the other person to show him rules for each and everything that he did ( "You eat 3 times a day, can you show it in the rule book. Oh God, How can you eat 3 times a day when its not written in the rule book").
4. in the end, he said, sometimes its almost impossible to correct things and then you can say to yourself that its just a job. In my home, I can do and will do things exactly the way I like, however, in a job, this might not be the case.

Wednesday, April 20, 2011

How to get file from filename

Recently I had a issue regarding how to read a file, as in eclipse environment and actually server environment, the relative directory is different, it caused a lot of problem, below it is a example which works for both environment.

File file ;
URL url = this.getClass().getClassLoader().getResource(fileName);

try {
file = new File(url.toURI());
} catch(URISyntaxException e) {
file = new File(url.getPath());
}

or to a string

URL loadedResource = this.getClass().getClassLoader().getResource(fileName);


InputStream inputStream = loadedResource.openStream();

BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
StringBuilder sb = new StringBuilder();
String line = null;
while ((line = reader.readLine()) != null) {
sb.append(line + "\n");
}
inputStream.close();
return sb.toString();

Tuesday, April 12, 2011

How to get salary increase by Eric spiegel

5) A developer’s best chance at achieving a maximum salary increase is to negotiate during the hiring process. Once you are on board, you are at the company’s mercy unless you bail

Very interesting idea I have to agree

Monday, April 11, 2011

Failure and innovative

Woody Allen :

If you are not failing every now and again, it is a sign you are not doing anything very innovative.

The only real failure in life is one not learned from