Sunday, October 12, 2014

Java Style Guide

Checkstyle is a tool to facilitate the use of coding standard. It allows us to define a coding style, and it can then check if our code follows the style automatically.

Not surprisingly, there exists an Eclipse plugin for Checkstyle. The URL of Checkstyle update site is:

This is a sample checkstyle.xml of Google's Java Style Guidegoogle_checks.xml

Note that google_checks.xml is created for CheckStyle(CS) 5.8, not for CS 5.7. Since the Eclipse Plugin for CheckStyle is integrated with CS 5.7 (as of 10/12/2014), we may need to wait until the plugin is migrated to CS 5.8.

Thursday, October 2, 2014

HTTP Proxy settings for R

1) As a non-root user, I want to install my own version of R and its packages. One major problem is how to make it work with a proxy server. Here is what I did on Linux:

- Build and Install R (v3.1.1) on /my_dir/
- $export PATH=/my_dir/bin:$PATH
- $export http_proxy=
- $R
- >options(download.file.method="wget")
- >install.packages("PerformanceAnalytics")
- >install.packages("QRM")
- >install.packages("RQuantLib")
- >install.packages("quantmod")
- >require(quantmod)
- >getSymbols("SPY", src="google")
- >getQuote("GOOG")
- >getSymbols("CPIAUCNS", src="FRED") #load CPI from Fed Reserve
- >getSymbols("GS10", src="FRED")        #load 10y Treasury from Fed
- >getSymbols("SP500", src="FRED")       #load S&P500 from Fed

2) The folowing blog helps me to solve my problem ('407 Proxy Authentication Required') when I called getQuote("SPY") of quantmod.
For the details of downloading file in R, please refer to: