Tuesday, August 10, 2010

Eclipse Java test case cannot be found in a project?

Eclipse said "No tests found with test runner 'JUnit 4'". The answer in JUnit FAQ does not fix my case. And the answers on stackoverflow did not help as well. Later I figured out that the reason of the problem was that I did not properly organize the test cases in my project.

The Junit FAQ has a good suggestion. I have a default src directory for the source and a test directory for the test cases. In order to let the runner find the test case, the test directory has to be a Source Folder, not just a directory created in the project directory.

Thursday, April 22, 2010

Enable java in Firefox 3.0 on Ubuntu 9.04

I assume you have install the JVM or SDK already. If not, see this document for reference. Maybe you also need to use the update-alternatives tool to choose the latest version as the default. Then what you need to do is to ln the libjavaplugin_oji.so plugin in the mozilla plugins directory. Creating a link in the firefox plugins directory in your system won't work. You might use the following commands to locate the plugin and create the link.
locate libjavaplugin_oji.so
sudo ln -s {the latest java}/jre/plugin/i386/ns7/libjavaplugin_oji.so /usr/lib/mozilla/plugins/libjavaplugin_oji.so
Restart your firefox and you should be able to see java in the Add-ons list.

Thursday, February 11, 2010

dygraphs plot x-axis labels align with grids

Recently, I learned to use the dygraphs JS library for 2d chart. Dygraphs is designed to
display dense data sets and enable users to explore and interpret them.

I like it more than Flot, another JS ploting library.

One problem I found was that the x-axis labels do not align with the grids in FireFox, while it is fine in Chrome. The fix is quite simple, just never use align = center in the
where the plot is embedded. A note from the author of dygraphs.
dygraphs are not happy when placed inside a tag. This applies to the CSS text-align property as well. If you want to center a Dygraph, put it inside a table with align = center set.

Sunday, January 17, 2010

HP LaserJet 1020 on Ubunut 9.04

After an update, the printer does not work any more.
Linux hpws 2.6.28-17-generic #58-Ubuntu SMP Tue Dec 1 18:57:07 UTC 2009 i686 GNU/Linux
Delete the printer and reinstall HPLIP
sudo apt-get install hplip
The printer is found, but still does not print.
Only after clicking Download Firmfare in HP Device Manager, it starts to respond to the printing request.