C++博客-wangkang2009 http://www.598club.com/wangkang2009/zh-cnMon, 20 Jan 2020 19:18:19 GMTMon, 20 Jan 2020 19:18:19 GMT60C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2019/11/10/216973.htmlwangkangwangkangSun, 10 Nov 2019 07:39:00 GMThttp://www.598club.com/wangkang2009/archive/2019/11/10/216973.htmlhttp://www.598club.com/wangkang2009/comments/216973.htmlhttp://www.598club.com/wangkang2009/archive/2019/11/10/216973.html#Feedback0http://www.598club.com/wangkang2009/comments/commentRss/216973.htmlhttp://www.598club.com/wangkang2009/services/trackbacks/216973.html
?????owingide?????????????
1. ???????????????-?????o?????
c:\Users\${username}\AppData\Roaming\Wing Pro 7
~/.wingpro7
wing6
/Applications/WingIDE.app/Contents/Resources/scripts
2. ?????????
Edit->Command By Name (ctrl+/)
????????????o???????aEdit?????? ?????scripts???????????py??????????????????????? ?3????????????o?a????????????o
3. ??scripts?????????-?????a??????????
?????a????-?, ??????????????? ??????????????????????????
import wingapi
import time
def insert_date():
    editor = wingapi.gApplication.GetActiveEditor()
    
    txt = time.strftime('%Y-%m-%d')
    fields = [(0,1)]
    editor.PasteSnippet(txt, fields)
4. ?????????????, ??????????????????a????1????????, insert-date


wangkang 2019-11-10 15:39 ???????o
]]>
C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2018/12/12/216120.htmlwangkangwangkangWed, 12 Dec 2018 07:48:00 GMThttp://www.598club.com/wangkang2009/archive/2018/12/12/216120.htmlhttp://www.598club.com/wangkang2009/comments/216120.htmlhttp://www.598club.com/wangkang2009/archive/2018/12/12/216120.html#Feedback0http://www.598club.com/wangkang2009/comments/commentRss/216120.htmlhttp://www.598club.com/wangkang2009/services/trackbacks/216120.html/Files/wangkang2009/gyp-master.rar

??????????????????????????agyp???VC???????? gyp_template.gyp
??????????o???????????????????????? ???????????1?o?gyp????o???????vc2015??????xp v140_xp

wangkang 2018-12-12 15:48 ???????o
]]>
C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2017/02/05/214652.htmlwangkangwangkangSun, 05 Feb 2017 08:51:00 GMThttp://www.598club.com/wangkang2009/archive/2017/02/05/214652.htmlhttp://www.598club.com/wangkang2009/comments/214652.htmlhttp://www.598club.com/wangkang2009/archive/2017/02/05/214652.html#Feedback0http://www.598club.com/wangkang2009/comments/commentRss/214652.htmlhttp://www.598club.com/wangkang2009/services/trackbacks/214652.html
git bash????ogithub
???????????????????????o???????github???????o??? ???????-?'??????????o?????o???????? ????-?????????????
????????a????1windows
1. ????????git??????????'????????git??? ?????|??????git bash
2. ?3??????github?1??????o?????a?????????o?
3. ????gitbash.bat, ?o????????a?????cmd????a????, ??????????????????gitbash??-????
4. ?o???ssh?????????????
ssh-keygen.bat -t rsa -C "youemail"
????o?????C:\Users\Administrator\.ssh
??????id_rsa.pub??'?????????????1??github?????ssh key??
ssh -T git@github.com
a?????????????|??????
?????git
git config --global user.name "youname"
git config --global user.email "youemail"
5. ?????o??????????????o?????a??o???????????o????????????, ????|?c:\test
6. ???????????
cd c:/test
git init
git remote add origin git@github.com:youname/yourep.git
?????????o?
git pull origin master
7. ??windows????????-?????|?????o???????????'??3test
8. ??????????????????o??????
git add .
??????????????????o???????????????o?????avim???????? ??:q????o
git commit -m "first commit"
?????????|?????3????? ??????????o aborting commit due to empty commit message
git push -u origin master
???????????o??????????????????????? 100%?????????????o??????
9. github??????????? ??????????????o?2?????????


wangkang 2017-02-05 16:51 ???????o
]]>
C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2015/04/25/210437.htmlwangkangwangkangSat, 25 Apr 2015 01:28:00 GMThttp://www.598club.com/wangkang2009/archive/2015/04/25/210437.htmlhttp://www.598club.com/wangkang2009/comments/210437.htmlhttp://www.598club.com/wangkang2009/archive/2015/04/25/210437.html#Feedback0http://www.598club.com/wangkang2009/comments/commentRss/210437.htmlhttp://www.598club.com/wangkang2009/services/trackbacks/210437.html1. ??|??????????o???????????????? ???????1???o????o?????????????a????-?
600617???????o??, ?????????????????????
   0     1           2
0  7     0  2015-04-20
0  0  0.26  2001-07-19
0  0   0.2  2000-08-24
0  0   0.4  1998-07-29
0  0  0.38  1996-06-25
0  2   1.5  1995-05-31
0  0     3  1994-06-06
2. ????????|???????k?o????????? ???????opd.DataFrame????????? ????????????????-???1?o????col??????oohlcv
3. ??1??????????????? ???????o???????????? ????????????????????????
def calc_fuquan_use_fenhong(df, df_fenhong):
    """????????????????????2?????, ??????o??????????????? , ????????
    df: ???k?o?
    df_fenhong: ????o??
    return: df
"""
    #???????????????????
    df_fenhong = df_fenhong.sort_index(by=2)
    for i in range(len(df_fenhong)):
    gu, money, date = df_fenhong.irow(i)
    if len(df.ix[:date]) < 2:
        continue
    date = agl.df_get_pre_date(df, date)
    if money > 0:
        money = money * 0.1
        df['o'].ix[:date] -= money
        df['h'].ix[:date] -= money
        df['c'].ix[:date] -= money
        df['l'].ix[:date] -= money
    if gu > 0:
        # x = cur / (1+y/10)
        gu = 1+gu/10
        df['o'].ix[:date] /= gu
        df['h'].ix[:date] /= gu
        df['c'].ix[:date] /= gu
        df['l'].ix[:date] /= gu
    return df        
4. ??????
                    o          h          l          c         v
2010-06-01   6.158824   6.458824   6.158824   6.158824   1922980
2010-06-02   5.941176   6.294118   5.941176   6.235294    837740
????????????? ??????????????????????o????????????????????????


wangkang 2015-04-25 09:28 ???????o
]]>
C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2014/03/20/206239.htmlwangkangwangkangThu, 20 Mar 2014 01:36:00 GMThttp://www.598club.com/wangkang2009/archive/2014/03/20/206239.htmlhttp://www.598club.com/wangkang2009/comments/206239.htmlhttp://www.598club.com/wangkang2009/archive/2014/03/20/206239.html#Feedback2http://www.598club.com/wangkang2009/comments/commentRss/206239.htmlhttp://www.598club.com/wangkang2009/services/trackbacks/206239.html
?????????????????????????????????????????????? ????????????????????????o???1?????? ???????????3???????????????????? ???????o??????????????? ?????????????????????????'?????????????????
???''??o???. ????a???????????o???????????o??? ??????????????'??????????o??????
from PIL import Image
import os
def PngToTxt(f):
    Palette={'000':'#'#?|????
    ,'010':'@'#??????
    ,'020':'/'#??????
    ,'001':'$'#???????
    ,'011':'<'#?????
    ,'021':'"'#????????1???
    ,'002':'='#?????
    ,'012':'\\'#?????????1???
    ,'022':'_'#?'????
    ,'100':'>'#??????-?
    ,'110':'*'#??????2?
    ,'120':'~'#?|???-??1???
    ,'101':'%'#????????
    ,'111':'+'#?????
    ,'121':'^'#?'?????1???
    ,'102':'|'#?????????????
    ,'112':'!'
    ,'122':'-'
    ,'200':'&'#??????
    ,'210':';'#????????
    ,'220':"'"#?|????
    ,'201':')'#????????1???
    ,'211':'.'#??????-??1???
    ,'221':'`'
    ,'202':']'#?????
    ,'212':','
    ,'222':' '#????
    }    
    img = Image.open(f)
    if 0: img = Image.Image
    #?????, ??????????????3?, ?????????????????????
    #img = img.resize((80,60))
    w,h = img.size[:2]
    print w,h
    result = []
    for i in range(h):
        result1 = []
        for j in range(w):
            pixel = img.getpixel((j,i))[:3]
            result1.append(Palette[''.join([str(int(x//85.3)) for x in pixel])])
        result.append(result1)
    r="\n".join(["".join(x) for x in result])
    print r
    object_file=os.path.splitext(f)[0]+".txt"
    open(object_file,'w').write(r)    



?????????o???1????? ?????????????????????????o????????????o

def PngToTxt(f):
    Palette={'000':'#'#?|????
    ,'010':'@'#??????
    ,'020':'/'#??????
    ,'001':'$'#???????
    ,'011':'<'#?????
    ,'021':'"'#????????1???
    ,'002':'='#?????
    ,'012':'\\'#?????????1???
    ,'022':'_'#?'????
    ,'100':'>'#??????-?
    ,'110':'*'#??????2?
    ,'120':'~'#?|???-??1???
    ,'101':'%'#????????
    ,'111':'+'#?????
    ,'121':'^'#?'?????1???
    ,'102':'|'#?????????????
    ,'112':'!'
    ,'122':'-'
    ,'200':'&'#??????
    ,'210':';'#????????
    ,'220':"'"#?|????
    ,'201':')'#????????1???
    ,'211':'.'#??????-??1???
    ,'221':'`'
    ,'202':']'#?????
    ,'212':','
    ,'222':' '#????
    }    
    img = Image.open(f)
    if 0: img = Image.Image
    #?????, ??????????????3?, ?????????????????????
    img = img.resize((60,20))
    w,h = img.size[:2]
    #print w,h
    result = []
    for i in range(h):
        result1 = []
        is_empty_line = True
        for j in range(w):
            pixel = img.getpixel((j,i))[:3]
            #result1.append(Palette[''.join([str(int(x//85.3)) for x in pixel])])
            if pixel==(255,255,255):
                s = '222'
            else:
                s = '110'
                is_empty_line = False
            result1.append(Palette[s])
        #??????o??
        if is_empty_line == False:
            result.append(result1)
    r="\n".join(["".join(x) for x in result])
    print r
    object_file=os.path.splitext(f)[0]+".txt"
    open(object_file,'w').write(r)

?????????




wangkang 2014-03-20 09:36 ???????o
]]>
C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2014/03/07/206097.htmlwangkangwangkangFri, 07 Mar 2014 11:32:00 GMThttp://www.598club.com/wangkang2009/archive/2014/03/07/206097.htmlhttp://www.598club.com/wangkang2009/comments/206097.htmlhttp://www.598club.com/wangkang2009/archive/2014/03/07/206097.html#Feedback0http://www.598club.com/wangkang2009/comments/commentRss/206097.htmlhttp://www.598club.com/wangkang2009/services/trackbacks/206097.html
????????matlab????oo????????????????publish??????????????????????? ?1????????????????ahtml???????????? ??python??-2??????2????????????????????????oo????o??????a????????????????????????|??????????|????:





??????????????????????3??????????????????-????o????

??|?????????????????????????????pl??? ????-?|?????????pl??????o???????????????? ???1???|?????o??????Publish??-???????????????????????

 1     def figure(self, id=1):
 2         pl.figure(id)
 3     
 4     def plot(self, *args, **kwargs):
 5         pl.plot(*args, **kwargs)
 6     
 7     def subplot(self, *args, **kwargs):
 8         pl.subplot(*args, **kwargs)
 9     
10     def title(self, s, *args, **kwargs):
11         pl.title(s, *args, **kwargs)
??1?o?|??????????????????? ??a??|??????????????Publish??????????o?
1 from pypublish.publish import *
1     #?????????????????3??
2     pl = Publish()
3     print 'test python html publish.'
4     for i in range(2):
5         pl.figure(i)
6         pl.plot(np.arange(0,10*(i+1)))
7     pl.show()
?????????????????????????????import pylab as pl
?|????????????????????????1????????????o????
/Files/wangkang2009/pypublish.rar


wangkang 2014-03-07 19:32 ???????o
]]>
C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2013/08/27/202798.htmlwangkangwangkangTue, 27 Aug 2013 03:34:00 GMThttp://www.598club.com/wangkang2009/archive/2013/08/27/202798.htmlhttp://www.598club.com/wangkang2009/comments/202798.htmlhttp://www.598club.com/wangkang2009/archive/2013/08/27/202798.html#Feedback0http://www.598club.com/wangkang2009/comments/commentRss/202798.htmlhttp://www.598club.com/wangkang2009/services/trackbacks/202798.html江苏快三开奖结果python???c dll api


江苏快三开奖结果??3???-???? python dll??? np?????????? double


??3?o?python???dll???????????????????? ?????????|???????1double?????????????????????? ????oo???2?????????????????????????? ????-?1|???????????????????'??????

??????????????|???????????python???????-|????????????1|??? ????-??1?????????|?????? ????????|??????python(x,y)??? ????????????????????????????numpy?o????
??|?????sf???????????numpy??????????'?????python???????2???????o????????????? ?1?????import numpy?'?

江苏快三开奖结果????????????2????????????

1. ??????dll??? ?????dll??-????|????????????o???????? dll?????osmooth
// @param: n   ????????o|
// @param: x   [input/output] ?????'?????
// @param: y   [input/output]
// @param: weights   [input]  ?????o0
// @param: s   [input/output] ???????????????????x???y???o|
int smooth(int n, double* x, double* y, double* weights, double* s);


2. ?????dll
import numpy as np
from ctypes import *

江苏快三开奖结果dll = np.ctypeslib.load_library('smooth', '.')


3. ?????????
c?????double???64????????? ????-?????????????????????32????????? ????|??????????????????????????????????
smooth = dll.smooth
#[Warning:?????????????a???????????o]
#??????????????
smooth.argtypes = [c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double), POINTER(c_double)]
#?????????????
smooth.restype = c_int
x = [3.2, 3.9, 5.4, 5.9]
x = np.array(x)
y = np.array(x)
w = np.array(0)
s = np.array(10)
smooth(len(x), x.ctypes.data_as(POINTER(c_double)), y.ctypes.data_as(POINTER(c_double)), w.ctypes.data_as(POINTER(c_double)), s.ctypes.data_as(POINTER(c_double)) )

??????python?2???????????? ??????????????-???????????????? ?????vc?????python??????? ????????'????????-??1??? ???????????????-???? ????????o?????????int*??1????????????
|???python???????-????64???double*???????????????????????????
#?-??????????
smooth.argtypes = [
    c_int,
    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1, flags="C_CONTIGUOUS"), #?????'???????????????-?????-???
    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1, flags="C_CONTIGUOUS"),
    np.ctypeslib.ndpointer(dtype=np.float64),
    np.ctypeslib.ndpointer(dtype=np.float64)
]
smooth.restype = c_int
m = [3.2, 3.9, 5.4, 5.9]
x = np.arange(4, dtype=np.float64)
y = np.arange(4, dtype=np.float64)
w = np.cast["float64"](0)
s = np.cast["float64"](10)
for i in range(0, len(m)):
 x[i] = m[i]
 y[i] = m[i]
smooth(len(x), x, y, w, s)

??????: python??????????o??????????????o???????? ???????????-??????????????????????????

????oo??1numpy??????????????? ???????1?o?np?????????????????????'????????1?????? ?-???????????????????????

 

 


 



wangkang 2013-08-27 11:34 ???????o
]]>
C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2013/04/17/199509.htmlwangkangwangkangWed, 17 Apr 2013 06:55:00 GMThttp://www.598club.com/wangkang2009/archive/2013/04/17/199509.htmlhttp://www.598club.com/wangkang2009/comments/199509.htmlhttp://www.598club.com/wangkang2009/archive/2013/04/17/199509.html#Feedback0http://www.598club.com/wangkang2009/comments/commentRss/199509.htmlhttp://www.598club.com/wangkang2009/services/trackbacks/199509.html?3??????for vc2010

1. ??vc2010??o?????a??????1???


2. ?????o???1????????????????????o?????????????






3. ??????????1?????o???, ???????????1
STDMETHODIMP CConnect::OnStartupComplete (SAFEARRAY ** /*?a????1?*/ )   // ?1???????????|???
???
STDMETHODIMP CConnect::Exec(BSTR bstrCmdName, vsCommandExecOption ExecuteOption, VARIANT * /*pvarVariantIn*/, VARIANT * /*pvarVariantOut*/, VARIANT_BOOL *pvbHandled) // ?????????????|???
 1 // ?1???????????|???
 2 STDMETHODIMP CConnect::OnStartupComplete (SAFEARRAY ** /*?a????1?*/ )
 3 {
 4     //RunBackGroundChange();
 5     CAddMyComment ac(m_pDTE);
 6     COLORREF clrBlack = 0x00c2c2c2;    // ???2
 7     ac.SetColor(clrBlack);
 8     ac.SetColor(clrBlack);
 9 
10     return S_OK;
11 }
STDMETHODIMP CConnect::Exec(BSTR bstrCmdName, vsCommandExecOption ExecuteOption, VARIANT * /*pvarVariantIn*/, VARIANT * /*pvarVariantOut*/, VARIANT_BOOL *pvbHandled)
{
    *pvbHandled = VARIANT_FALSE;
    if(ExecuteOption == vsCommandExecOptionDoDefault)
    {
        if(!_wcsicmp(bstrCmdName, L"backgroundchange.Connect.backgroundchange"))
        {
            RunBackGroundChange();

            *pvbHandled = VARIANT_TRUE;
            return S_OK;
        }
    }
    return S_OK;
}

 1 
 2 // ??1??????????????????2
 3 void CAddMyComment::ChangeFont(void)
 4 {
 5     CComPtr<EnvDTE::Properties> spProperties;
 6 
 7     // Modify font size
 8     m_spDTE->get_Properties(CComBSTR("FontsAndColors"), CComBSTR("TextEditor"), &spProperties);
 9     CComPtr<EnvDTE::Property> spProperty;
10     spProperties->Item(CComVariant(L"FontSize"), &spProperty);    // FontSize
11     ATLASSERT(spProperty);
12     spProperty->put_Value(CComVariant(11));
13 
14     CComPtr<EnvDTE::Property> spProperty1;
15     spProperties->Item(CComVariant(CComBSTR(L"FontsAndColorsItems")), &spProperty1);    // FontsAndColorsItems
16     ATLASSERT(spProperty1);
17     CComPtr<IDispatch> spDispatch;
18     spProperty1->get_Object(&spDispatch);
19     CComPtr<EnvDTE::FontsAndColorsItems> spFontsAndColorsItems;
20     spFontsAndColorsItems = spDispatch;
21     ATLASSERT(spFontsAndColorsItems);
22 #if 0
23     // ????o???2??????
24     long count ;
25     spFontsAndColorsItems->get_Count(&count);
26     for(long i=0; i<count; ++i) {
27         CComPtr<EnvDTE::ColorableItems> spColor;
28         spFontsAndColorsItems->Item(CComVariant(i), &spColor);
29         if(spColor) {
30             CComBSTR bstrName;
31             spColor->get_Name(&bstrName);
32             ATLTRACE(L"[%d]%s\n",i, bstrName);
33         }
34     }
35 #endif
36 
37 #if 1
38     // Modify Plain Text Background
39     CComPtr<EnvDTE::ColorableItems> spColorableItems_PlainText;
40     spFontsAndColorsItems->Item(CComVariant(1), &spColorableItems_PlainText);
41     CComPtr<EnvDTE::ColorableItems> spColorableItems_LineNumber;
42     spFontsAndColorsItems->Item(CComVariant(5), &spColorableItems_LineNumber);
43     //CComPtr<EnvDTE::ColorableItems> spColorableItems_Identifier;
44     //spFontsAndColorsItems->Item(CComVariant(L"Identifier"), &spColorableItems_Identifier);
45 
46     COLORREF clrWhite = #ffffff;
47     COLORREF clrBlack = #000000;
48     clrBlack = 0x00c2c2c2;    // ???2
49     COLORREF clrWhite2 = 12632256;
50     clrWhite2 =  clrWhite;
51     OLE_COLOR color;
52     spColorableItems_PlainText->get_Background(&color);
53     if(color == clrBlack) {
54         spColorableItems_PlainText->put_Background(clrWhite);
55         spColorableItems_LineNumber->put_Background(clrWhite);
56         //spColorableItems_PlainText->put_Foreground(clrBlack);
57     }else {
58         spColorableItems_PlainText->put_Background(clrBlack);
59         spColorableItems_LineNumber->put_Background(clrBlack);
60         //spColorableItems_PlainText->put_Foreground(clrWhite2);
61     }
62 #endif
63 }
64 

4. ???????????? ??????1????????? ??????????????????????o?????a??????1


??1???????? ?????????2???????????2?'????????? ????????????????2????????


5. ?????'????????msi?????????????????????, ????????????????????o???????
/Files/wangkang2009/backgroundchange.rar













wangkang 2013-04-17 14:55 ???????o
]]>
C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2012/12/07/196076.htmlwangkangwangkangFri, 07 Dec 2012 05:34:00 GMThttp://www.598club.com/wangkang2009/archive/2012/12/07/196076.html
   ??1?o?????????????o????3?????|??????????1?????? ?????????????3???????????????1???

wangkang 2012-12-07 13:34 ???????o
]]>
C++博客-wangkang2009 http://www.598club.com/wangkang2009/archive/2012/08/15/187263.htmlwangkang



wangkang 2012-08-15 11:00 ???????o
]]>