Wednesday, February 27, 2008

Content Assist / Code Completion problem with Eclipse and Netbeans

I've had the weirdest problem the other day. It was the first time I went back to using our DELL E1405 after being very comfortable with my company issued D620 (which I now had to surrender to my former employer). Everything was working well until I noticed a simple but very annoying problem:

CTRL+SPACE for Eclipse was not working!

I tried playing with the configuration, resetting everything to defaults, removing the plugins one by one. Nothing seemed to work. I tried a fresh copy and even got to the point of installing Netbeans. And guess what, CTRL+SPACE did not work for Netbeans either!

Which lead me to the conclusion that there must be something else causing the problem. I tried killing all the unnecessary processes one by one and got to the bottom of the problem.

It was the Logitech Quickcam v10 application. Unfortunately, I didn't have internet connection at home which explains why I had to figure out the problem all by myself.

I tried searching the net when I got to the office and saw some posts that v11 of the application already fixes the problem.

What a relief!

Friday, February 15, 2008

Post Valentine's Quote

Love is the Greatest

1 If I could speak all the languages of earth and of angels, but didn’t love others, I would only be a noisy gong or a clanging cymbal.

2 If I had the gift of prophecy, and if I understood all of God’s secret plans and possessed all knowledge, and if I had such faith that I could move mountains, but didn’t love others, I would be nothing.

3 If I gave everything I have to the poor and even sacrificed my body, I could boast about it; but if I didn’t love others, I would have gained nothing.

4 Love is patient and kind. Love is not jealous or boastful or proud

5 or rude. It does not demand its own way. It is not irritable, and it keeps no record of being wronged.

6 It does not rejoice about injustice but rejoices whenever the truth wins out.

7 Love never gives up, never loses faith, is always hopeful, and endures through every circumstance.

8 Prophecy and speaking in unknown languages and special knowledge will become useless. But love will last forever!

9 Now our knowledge is partial and incomplete, and even the gift of prophecy reveals only part of the whole picture!

10 But when full understanding comes, these partial things will become useless.

11 When I was a child, I spoke and thought and reasoned as a child. But when I grew up, I put away childish things.

12 Now we see things imperfectly as in a cloudy mirror, but then we will see everything with perfect clarity. All that I know now is partial and incomplete, but then I will know everything completely, just as God now knows me completely.

13 Three things will last forever—faith, hope, and love—and the greatest of these is love.

Hope you all had a nice Valentine's day celebration!

Passage taken from: 1 Corinthians 13 (NLT).

Friday, February 8, 2008

SVN+SSH

For the past few hours, I've been trying to figure out how to get rid of the "multiple password prompts" from TortoiseSVN when trying to view a remote repository using svn+ssh.

I've tried to follow a couple of well documented resources, but I can't seem to make it work. I'm currently getting a "Server refused our key" message.

I'll just probably try again later.

Wednesday, February 6, 2008

IBM developerWorks Firefox Plugin

If you're a Firefox user and a constant visitor of IBM developerWorks, then you might be interested in a Firefox search plugin for devWorks discussed here.

Taken directly from the link above:
Want to have easy access to developerWorks? You can now add our new search plugin to your Firefox browser (thanks to our own Peter Yim). Simply go to a developerWorks search results page such as this, and you'll see the following at the top of the page:

dW search plugin icon Add dW search plug-in to Firefox

Just click on the link while using Firefox, then confirm by clicking OK, and instantly the developerWorks search engine will be added to your browser's search bar. Then you can easily search all of developerWorks for helpful technical content and resources -- without having to first go to the dW Web site.

If you try it and it works well for you, you might also consider visiting the mozdev.org site (which also lets you find and install this search plugin, as well as others), where you can "Judge it!"

Happy searching!

Tuesday, February 5, 2008

Fibonacci

If you were given a task to compute the nth Fibonacci number, how would you do it?

You would go straight away and write a recursive function right?

[sourcecode language='java']
public static int getNumberRecurse(int n) {
if (n == 0 | n == 1) {
return 1;
} else {
return getNumberRecurse(n - 1) + getNumberRecurse(n - 2);
}
}
[/sourcecode]

elapsed for n=30: 31 ms

elapsed for n=40: 3016 ms

Well think again. Because there might be a better way of doing it.

[sourcecode language='java']
public static int getNumberLoop(int n) {
if (n == 0 | n == 1) {
return 1;
} else {
int[] fib = new int[n + 1];
fib[0] = 1;
fib[1] = 1;
for (int i = 2; i <= n; i++) {
fib[i] = fib[i - 1] + fib[i - 2];
}
return fib[n];
}
}
[/sourcecode]

elapsed for n=100000: 31 ms

If we compare the elapsed time (in ms) between the two functions, we can clearly see which one is better.

Anyway, I've found an invaluable book called Algorithms from where I got the example above.

I know a lot of programmers (myself included) who are easily satisfied with a workable solution rather than an efficient one.

I hope someday (with enough time and practice) I can be an expert on this topic too.

Friday, February 1, 2008

Checking out the Competition

Straight from the Apple Design Awards 2007 page, the Delicious Library is one tough act to follow. I think it should be a very good benchmark for the Library application that we are planning to develop.

Now all I need is a MacBook or MacBook Pro so I can start experimenting with the application...