Tuesday, July 07, 2009

Useful reference management tools for academic paper writing

Doing research often involves paper reading and writing. Referring to other papers is almost inevitable when writing papers. However, sometimes, the processing of writing a paper is frustrating just because you forget which exact papers to cite when it comes to the section of related works.

So reference paper management is quite important for the academic life. There are of course various tools that help to make the job easier. Here is a few tools i've used or encountered.

Endnote

Endnote is not a bad choice if you write papers using Microsoft word, as it has plugins for MS word. Most online research databases offer the export format that can be imported into Endnote, and you can also enter your owns manually. Notes or comments of the reference paper can also added to keep track of your thinking. It provides a lot of formatting styles to choose when it comes to the last bibliography section, which saves a lot of time for tedious formatting. However, you probably need a few time to play around with it before you master it.

Endnote is not free. The good thing is that students at some higher eduction institutes and universities can use it for free as the universities often have a volume license.

JabRef

When I started to use Latex to write the papers, Endnote seemed helpless. Hopefully, JabRef came into my sight after a few search.

"JabRef is an open source bibliography reference manager. The native file format used by JabRef is BibTeX, the standard LaTeX bibliography format. JabRef runs on the Java VM (version 1.5 or newer), and should work equally well on Windows, Linux and Mac OS X."

As most online research databases support BibTex exportation, so populating a JabRef database quite easy and straight forward. It also allows you to add links to the papers, so a single click can open the paper and allows you to have a second read. It offers integration to several tools. When I used WinEdt for the latex paper editing, the integration works quite good.

Zotero

When i came across Zotero, i've already been out of university for a while. So i haven't got a chance to play around it with real research tasks. But from what it says, it seems quite promising. So i've recommended it to my friends who are still doing fun researches in the universities.

Zotero is a free, easy-to-use Firefox extension to help you collect, manage, and cite your research sources. It lives right where you do your work—in the web browser itself.


Other tools

Of course, there are plenty other similar tools for this reference management tasks. You can find the more complete list and the comparison at
http://en.wikipedia.org/wiki/Comparison_of_reference_management_software

Thursday, April 02, 2009

Personal Finance Software and online services for Money Management

Use a piece of software or a online service to consolidate all your financial information may help you better understand your money.

Here is a list of personal finance software and online services that could help you find a suitable choice to manage your money.

A more detailed article on the personal finance 2.0 web applications could also be helpful.

Wednesday, June 11, 2008

Using __autoload function in PHP 5

The magic function "__autoload" is a new feature of PHP version 5. When this function is defined, it will be triggered when php can not find the class it is calling from the explicit "require", "include" statements. The benefit of using this magic function can be as follows:
  • Improve performance: This lazy loading mechanism avoids loading unnecessary class files.
  • Central control of including class files: You don't have to write "include xxx", "include_once xxx", "require xxx", and "require_once xxx" in every file.
  • Encouraging naming convention for class name/files: the better way you name your classes and files, the easier for you to make the __autoload function.
  • Flexibility to relocate php class files: since file including is controlled centrally, it is very easy to change the path of the included class files. no need to change every files.
Here's one article that tells you how to write the __autoload function to improve the performance. And also some one argues that this __autoload function might be evil.

Tuesday, February 26, 2008

Configuring Tomcat Virtual Hosts and Making it Work with Apache

This job contains two parts, which are the following:

Tomcat virtual hosts

Normally, deployment of web application under tomcat is quite easy. Just copy the 'war'ed application (for example app.war) to the webapps directory (e.g., /var/lib/tomcat5/webapps).

However, if there are multiple virtual hosts that are hosted by tomcat, this may not work. The following actions need to be taken:

1. Modify the server.xml (e.g., "/etc/tomcat5/server.xml" if you have tomcat installed via yum on Fedra Core 8, aka FC8) file to add virtual host in. The following is an example:
<host name="www.mydomain.com" appbase="/var/www/hosts/mydomain/public_html"
unpackWARs="true" autoDeploy="true"
xmlValidation="false" xmlNamespaceAware="false">

<Valve className="org.apache.catalina.valves.AccessLogValve"
directory="/var/www/hosts/mydomain/logs" prefix="mydoamin_access_log." suffix=".txt"
pattern="combined" resolveHosts="false"/>
</host>
NOTE: this section of configuration needs to be put in the RIGHT place in the file hiearachy (check the comments in the file). Otherwise, it will cause problem.

2. Put your web app (i.e., app.war) in the the directory indicated by "appBase" (here it is '/var/www/hosts/mydomain/public_html').

3. Restart tomcat (e.g., "/etc/init.d/tomcat5 restart") and access the web to test it (i.e., http://www.mydomain.com:8080/app)

Working with Apache

To allow users to access the web application without accessing 8080 port, Apache needs to be configured to work with tomcat. This actually requires a connector. By default in FC 8, proxy_ajp is used. It's quite easy to setup this connector. The following is an configuration example for a virtual host. All we need is to add a line.

<VirtualHost *:80>
ServerName www.mydomain.com
DocumentRoot /var/www/hosts/mydomain/public_html
ErrorLog /var/www/hosts/mydomain/logs/error_log
CustomLog /var/www/hosts/mydomain/logs/access_log combined
DirectoryIndex index.html index.htm index.php index.php4 index.php5
ProxyPass /app/ ajp://www.mydomain.com:8009/app/
...
</VirtualHost>

Wednesday, December 19, 2007

Java Regular Expression (regex): A Very Simple Example

Here's a very simple example of using java builtin packages (java.util.regex) that deals with regular expression. I made this to remind me that using java regex is quite simple and easy.

Sun web site has more details of this java.util.regex package and regex patterns.

import java.util.regex.Matcher;

import java.util.regex.Pattern;

public class TestRegex {

/**

* @param args

*/

public static void main(String[] args) {

// a test input string

String input = "This is a test string.nThis is a second line.";

// first compile a pattern with multiple-line enabled

Pattern pn = Pattern.compile("(\w+)", Pattern.MULTILINE);

// then get a matcher from the input string

Matcher mr = pn.matcher(input);

// show group count (should be 1)

System.out.println("Group Count: " + mr.groupCount());

// print out all the words

while (mr.find()) {

System.out.println(mr.group(1));

}

}

}

Monday, December 03, 2007

Using Java Desktop API to Launch System Browser

In Python, we have a module called "webbrowser" that allows us to open given URLs in most mainstream browsers (IE, Firefox, and etc).

Recently, I found Java SE 6 has added new APIs that support the similar function. The new added Desktop APIs are reflected through a class called "java.awt.Desktop". For example, the following code opens a url in the system default browser (without considering exceptions).
...
import java.awt.Desktop;

...
Desktop desktop = Desktop.getDesktop();

desktop.browse(new URI(''a_url"));

...

In addition to open urls in browsers, it also provides API that can also open files with their default associated applications. More detailed information and examples on this Desktop API can be found here:Using the Desktop API in Java SE 6