Friday, November 20, 2015

Use Excel to create the indexed performance graph

Use Excel to create the indexed performance graph
1. Generate the original data like the below:
Date Amount Index
20150107 100559.08 3373.95
20150108 102548.36 3293.46
20150109 102860.37 3285.41
20150112 103072.33 3229.32
2. Use format to convert the data to indexed data
The formula should be like =C2/$C$2*100 wrap with $ to make it fix
Date Amount Index
1/7/2015 100 1/0/1900
1/8/2015 101.9782202 97.61436891
1/9/2015 102.2884955 97.37577617
1/12/2015 102.499277 95.71333304
3. Use Data -> Text to Columns to convert the text yyyymmdd to date YMD
4. Select all transformed data (include the header), and insert line (first one is good if there are a lot of data, all may select grapth with markders)

References:
http://academics.smcvt.edu/cbauer-ramazani/AEP/BU113/finance/create_index_graph.htm
http://www.extendoffice.com/documents/excel/2777-excel-convert-yyyymmdd-to-date.html

Thursday, November 19, 2015

VC++ scheduler/timer and other sources

http://download.csdn.net/detail/Jeffrey_Ming/1195343
http://blog.csdn.net/clever101/article/details/47756047
http://download.csdn.net/detail/hero20025627hxh/1663637
http://download.csdn.net/detail/zhouzhenyang1990/3075088
http://download.csdn.net/detail/s672038161/3206737
http://download.csdn.net/detail/houhuijuan/3446698
http://download.csdn.net/detail/notsunny/8740609
http://download.csdn.net/detail/sunanguo/880743

http://download.csdn.net/detail/fish_1001/8604645

#include <ctime>
#include <iostream>
#include <windows.h>
using namespace std;

int main() {
    while(true){
        time_t t = time(0);   // get time now
        struct tm * now = localtime( & t );
        if(now->tm_min>39){//begin
        cout << "current min " << now->tm_min << ", sec = " << now->tm_sec << endl;
        }
        if(now->tm_min>40){//end
        cout << "will break, current min " << now->tm_min << ", sec = " << now->tm_sec << endl;
        break;
        }
        Sleep(3000);
    }
}

Sunday, November 1, 2015

be right or be kind

When given the choice between being right or being kind, choose kind. - Dr Wayne W. Dyer