SP500 Constituents

Posted in Uncategorized | Leave a comment

[Unix] Installing Emacs without root privileges

As a non-pro programmer, it is painful to work with a Unix system without root privileges, which means I have to manually install everything to my local directory.

This article introduces how to install Emacs, a powerful text editor I have been using for years, to my home folder $HOME. Since Emacs is a standard GNU package, the process also applies to other standard packages.

  1. Downloading ncurses and emacs from a Unix mirror.
  2. Install ncurses, a standard package that emacs is based upon.
  3. Install emacs

Done! happy?!

Some people choose to set an environmental variable before compiling:


Posted in Uncategorized | Leave a comment

[R] Reading List

Kindly borrowed this book list from http://xccds1977.blogspot.com/2013/02/r.html

  1. R Basics
    • R in Action
    • The Art of R Programming
  2. Intermediate Statistics
    • A Handbook of Statistical Analyses Using R
    • Modern Applied Statistics with S
  3. Scientific Computing
    • Introduction to Scientific Programming and Simulation Using R
  4. Data Mining
    • Data Mining with R - Learning with Case Studies
    • Machine Learning for Hackers
  5. R Graphics **
    • ggplot2 - Elegant Graphics for Data Analysis (a little out-dated, but the package shines)
  6. References
    • R Cookbook
    • R in a Nutshell
  7. Advanced Programming
    • R Programming for Bioinformatics
    • Software for Data Analysis Programming with R
Posted in Using R | Leave a comment

[R] ggplot2: mapping worlds biggest airlines


James Cheshire posted a tutorial on how to generate this nice chart. here is the link.

Posted in Using R | Leave a comment

[Econ] Macroeconomics Study Material

Well, the first thing you should consider is the CFA curriculum. You must keep in mind that CFA is not only a certificate.

There are other good (online) resources if you want to dig deeper:

  1. Quantitative Macroeconomics: An Introduction - by Dirk Krueger


Posted in Economics | Leave a comment

[Excel] Parsing strings in Excel 2007+

Excel uses objects XLOPER/XLOPER12 to communicate with C++. XLOPER is aged. Hence we only focus on XLOPER12.

Excel 2007+ uses XCHAR (which is identical to wchart_t) as the default character type. If you are more comfortable working with std::string, you will find the following code useful.

The other direction is more difficult, because of the memory-leak issue. I will post more code once I found a solution. Click here if you happen to know how to do it.

Posted in Uncategorized | Leave a comment

[Excel] Writing Excell Add-Ins (XLL) using C/C++ - Getting Started

I have no intention to make this article clear. I have suffered a hell pain coding and debugging and reading Microsoft's shitty online documentation. This page only contains information I found valuable to myself.

Excel 2007 / Visual Studio 2010

Source files you need from Microsoft are:

Library file you need from Microsoft:

Library files you need to provide to the linker (via Linker inputs):

Minimum code to write a duplicate function.

Now you can proceed to compile a dll file. Once this is done, change the extension to xll, and double click. Done !! Happy ?!




Posted in Uncategorized | Leave a comment

[Economy] 2010 Euro Crisis Explained

The article below did an excellent job in explaining the rise of the Euro Crisis.

Posted in Uncategorized | Leave a comment

[VC++] dynamic-link library (dll) for dummy

I will eventually change the title to "a complete guide to dynamic-link library (dll)" or even "A Complete Guide to C++ Shared Libraries". For now let's keep things simple.

Here is a good article about two methods to link dll in your program.

Loading the Library with LoadLibrary and GetProcAddress()

to be continued ...

Posted in Uncategorized | Leave a comment

[C++] Try/Catch Block Overhead

One lesson I learned from writing Excel/C++ API for others is that one should always put their own code in a try/catch block. It irritates people when their spreadsheet crash on a run-time error and all data/formula/pretty charts & tables are lost. This, however, raised another concern to me:

how much overhead to expect with try/catch blocks?

There are huge amount of information on the internet regarding this issue. The more I dig into it, the stronger I feel how essential it is to understand the implementation of try/catch blocks in C++.

to be continued ...

Posted in Uncategorized | Leave a comment