Thursday, February 10, 2011

Aptana Studio 2.0.5 on Ubuntu 10.04

Aptana Studio 2.0.5 used to work well in my Ubuntu 9.04. It started to split out error message related to xulrunner after I updated Ubuntu to 10.04. When I removed the Apatana and its workspace, it even stopped to show the messages and silently crashed. After digging and trying for almost an afternoon, I fixed the problem by adding this line to the AptanaStudio.ini file:
-Dorg.eclipse.swt.browser.XULRunnerPath=/usr/lib/xulrunner-1.9.2.13
You might change the path to whatever on your system. Note that there is a /usr/lib/xulrunner directory on my system, but that does not contain or link to the real literary files. I did not try if export the $MOZILLA_FIVE_HOME to the real xulrunner lib path will also work.

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.

Wednesday, December 30, 2009

What is the web service language/framework Barbara Liskov mentioned

In her talk titled "The Power Of Abstraction" given in OOPSLA2009, Barbara Liskov mentioned that she started to learn web services programming, and the language or framework she used has many global variables. I really wonder what she was using.

The talk is good and especially reveals the history of development of abstract data type by the list of influential papers.

Friday, December 11, 2009

Zero copy for Java HTTP file server

This makes it impossible for normal Java-based HTTP service to take the advantage of zero copy.

in reference to:

"It is not possible to create a channel for an arbitrary, pre-existing socket, nor is it possible to specify the SocketImpl object to be used by a socket associated with a socket channel."
- SocketChannel (Java 2 Platform SE 5.0) (view on Google Sidewiki)