锘??xml version="1.0" encoding="utf-8" standalone="yes"?>C++鍗氬-wangkang2009http://www.9087120.com/wangkang2009/zh-cnMon, 25 Mar 2019 10:32:19 GMTMon, 25 Mar 2019 10:32:19 GMT60gyp妯澘http://www.9087120.com/wangkang2009/archive/2018/12/12/216120.htmlwangkangwangkangWed, 12 Dec 2018 07:48:00 GMThttp://www.9087120.com/wangkang2009/archive/2018/12/12/216120.htmlhttp://www.9087120.com/wangkang2009/comments/216120.htmlhttp://www.9087120.com/wangkang2009/archive/2018/12/12/216120.html#Feedback0http://www.9087120.com/wangkang2009/comments/commentRss/216120.htmlhttp://www.9087120.com/wangkang2009/services/trackbacks/216120.html/Files/wangkang2009/gyp-master.rar

璇笅杞芥枃浠堕噷鍖呭惈涓涓猤yp鐨刅C妯澘锛?gyp_template.gyp
鍖呭惈涓浜涘父鐢?#37928;?#32514;?#29831;?#37731;弬鏁?#38171;?鍚屾椂淇敼浜唃yp鐨勬簮鐮佷娇vc2015鏀寔xp v140_xp

wangkang 2018-12-12 15:48 鍙戣璇勮
]]>
git bash鎻?#27996;githubhttp://www.9087120.com/wangkang2009/archive/2017/02/05/214652.htmlwangkangwangkangSun, 05 Feb 2017 08:51:00 GMThttp://www.9087120.com/wangkang2009/archive/2017/02/05/214652.htmlhttp://www.9087120.com/wangkang2009/comments/214652.htmlhttp://www.9087120.com/wangkang2009/archive/2017/02/05/214652.html#Feedback0http://www.9087120.com/wangkang2009/comments/commentRss/214652.htmlhttp://www.9087120.com/wangkang2009/services/trackbacks/214652.html
git bash鎻?#27996;github
璺熺潃缃?#28051;?#37928;?#37825;?#32459;嬭繘琛?#27996;?#28051;娆github鐨勬彁浜?#38171;?鍙戠幇涓棿杩樻槸纰板埌浜?#28051;浜涢棶棰?#38171;?鍥犳鍐嶈?#26495;綍涓娆?/div>
鐜?#28583;?#37721;拡瀵箇indows
1. 瀹夎?#21613;?#32094;it鍚?#28051;嶈?#30028;洿鎺娇鐢git锛?鑰屾槸瑕佷娇鐢git bash
2. 娉?#37712;?#28610;絞ithub骞跺?#28056;缓涓涓柊鐨?#28000;?#25652;?/div>
3. 杩?#29723;gitbash.bat, 浜?#37922;?#28051;涓被浼糲md鐨勭獥鍙? 浠笅鍛?#28000;?#29723;屽叏閮湪gitbash涓墽琛?/div>
4. 浜?#37922;ssh?#23047;鐢?#37928;勫叕閽?/div>
ssh-keygen.bat -t rsa -C "youemail"
榛樿浜?#37922;熷湪C:\Users\Administrator\.ssh
鎵撳紑id_rsa.pub鎷疯礉?#22135;?#28528;鐨?#37712;呭?#29808;埌github?#22135;鐨ssh key?#22135;
ssh -T git@github.com
楠?#29831;?#28725;?#38333;槸鍚?#37922;?#37825;?/div>
閰?#32515;git
git config --global user.name "youname"
git config --global user.email "youemail"
5. 鐢?#29863;勬簮绠?#37918;?#37731;?#37714;涘缓涓涓?#32460;?#37929;?#35120;曚綔涓?#28000;?#37934;?#37929;?#35120;? 渚嬪c:\test
6. ?#31493;杞?#28000;?#37934;?/div>
cd c:/test
git init
git remote add origin git@github.com:youname/yourep.git
?#31493;杞?#28000;?#25652;?/div>
git pull origin master
7. ?#28266;windows鐜?#28583;?#28051;妸闇瑕?#37819;?#27996;?#37928;?#28000;?#37934;?#37815;疯礉鑷硉est
8. 娣诲姞浠?#37934;?#38171;屾彁浜?#28000;?#37934;?/div>
git add .
娣诲姞浠?#37934;佹鎻?#27996;?#28000;?#37934;佹椂浼?#29882;?#37713;?#28051;涓獀im鐣岄潰锛?鐢?q閫鍑?/div>
git commit -m "first commit"
杩欓噷蹇呴瑕?#37712;?#23049;?#38322;?#38171;?涓?#37712;?#37819;愮 aborting commit due to empty commit message
git push -u origin master
杩欓噷?#32017;濮嬪嚭?#24135;涓?#28028;?#37928;勭鍒?#23011;?#38171;?100%鍚?#28000;?#37934;?#37819;?#27996;?#37812;?#37716;?/div>
9. github椤甸潰鍒锋柊锛?鍙?#28000;?#37930;嬭鎻?#27996;?#23480;茬粡鐢?#37825;?/div>


wangkang 2017-02-05 16:51 鍙戣璇勮
]]>鍩?#27996;巔andas鐨勮偂绁?#37715;嶅?#23942;潈璁畻http://www.9087120.com/wangkang2009/archive/2015/04/25/210437.htmlwangkangwangkangSat, 25 Apr 2015 01:28:00 GMThttp://www.9087120.com/wangkang2009/archive/2015/04/25/210437.htmlhttp://www.9087120.com/wangkang2009/comments/210437.htmlhttp://www.9087120.com/wangkang2009/archive/2015/04/25/210437.html#Feedback0http://www.9087120.com/wangkang2009/comments/commentRss/210437.htmlhttp://www.9087120.com/wangkang2009/services/trackbacks/210437.html1. 闇瑕?#37824;堕?#21975;垎绾?#38315;佽偂鐨?#37825;?#37817;?#38171;?濮?#28051;?#32457;颁箣涓?#37714;?#32510;?#29723;?#38171;岀粰涓涓?#28186;嬪
600617鐨勫垎绾?#29723;? ?#20546;鏁?#38171;岀幇閲?#38171;岄櫎?#28488;鏃?/div>
   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. 褰撶?#22549;渶瑕佹湁鏃k绾?#37825;?#37817;?#38171;?杞?#37817;?#28051;簆d.DataFrame鏍?#23534;?#38171;?鏈楂?#28000;锋渶浣?#28000;?#32475;?#28725;?#25652;?#37928;col鍚嶇涓簅hlcv
3. 鏍?#37817;?#38340;潈鏁?#37817;?#38171;?鎸夊?#25652;?#37833;?#28598;嶆潈锛?灏辨槸鍏?#28598;嶆潈鏃?#37832;熸棭鐨?br />
def calc_fuquan_use_fenhong(df, df_fenhong):
    """鑾?#37721;?#28598;嶆潈鍚?#37928;勫鍙?#37825;?#37817;? 鐢?#37714;?#32510;?#29723;?#37833;?#29825;畻澶嶆潈 , 鍓嶅?#23942;潈
    df: 鏃k绾?br />    df_fenhong: 鍒?#32510;?#29723;?br />    return: df
"""
    #鏃?#37832;熸棭鐨勫湪?#22688;?#28528;
    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. ?#31912;?#28745;
                    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
?#31905;杩?#23092;?#29831;?#38171;?鍓嶅?#23942;潈?#31912;?#28745;涓?#37722;岃姳椤?#38171;岄氳揪淇?#37928;勮?#30075;鐩?#37722;?/div>


wangkang 2015-04-25 09:28 鍙戣璇勮
]]>鐢python?#22968;鍥?#35120;?#26462;?#37817;?#28051;烘枃鏈?#26440;撳嚭http://www.9087120.com/wangkang2009/archive/2014/03/20/206239.htmlwangkangwangkangThu, 20 Mar 2014 01:36:00 GMThttp://www.9087120.com/wangkang2009/archive/2014/03/20/206239.htmlhttp://www.9087120.com/wangkang2009/comments/206239.htmlhttp://www.9087120.com/wangkang2009/archive/2014/03/20/206239.html#Feedback2http://www.9087120.com/wangkang2009/comments/commentRss/206239.htmlhttp://www.9087120.com/wangkang2009/services/trackbacks/206239.html
?#31493;?#28528;鐨?#28000;?#37934;?#37721;?#28000;妸鍥惧儚杞?#37817;?#37812;愭枃鏈?#38171;??#27128;浠?#32515;?#28051;?#37928;?#28051;娈?#32459;?#25652;忔敼鐨?#38171;?鏈?#37833;槸?#20802;?#28266;鎺?#37714;?#37721;颁娇鐢?#37928;?#38171;?浣?#26440;撳嚭鐨勬枃鏈?#26473;?#28598;?#38171;?缂?#37824;?#26473;?#28751;?#37721;?#28028;?#38315;犳垚?#20762;?#30988;涓?#28598;?#37928;勬?#21613;?#28857;?br />鍏堣创鍑?#37833;? 杩?#28051;?#37911;?#37832;?#38315;?#37922;?#27996;庢枃浠?#26440;撳嚭锛?鍙?#28000;?#28103;濇寔?#27967;濂?#37928;勬樉绀?#37825;堟灉
from PIL import Image
import os
def PngToTxt(f):
    Palette={'000':'#'#姒涳拷
    ,'010':'@'#閺嗘璞?/span>
    ,'020':'/'#缂侊拷
    ,'001':'$'#濞?#26440;?#37821;?/span>
    ,'011':'<'#闂堬拷
    ,'021':'"'#娴滐拷璞懝?#25335;
    ,'002':'='#閽冿拷
    ,'012':'\\'#闂?#38175;芥?#25126;懝?#25335;
    ,'022':'_'#濞?#37723;?#29854;?/span>
    ,'100':'>'#閺嗘瀛?/span>
    ,'110':'*'#閺嗘绮?/span>
    ,'120':'~'#姒涘嫮璞懝?#25335;
    ,'101':'%'#閺嗘浼?/span>
    ,'111':'+'#閻忥拷
    ,'121':'^'#濞?#37723;?#29854;懝?#25335;
    ,'102':'|'#缁?#38175;界?#24539;?#24549;拷
    ,'112':'!'
    ,'122':'-'
    ,'200':'&'#缁撅拷
    ,'210':';'#濮?#23046;掑
    ,'220':"'"#姒涳拷
    ,'201':')'#濞?#26440;?#37933;囬懝?#25335;
    ,'211':'.'#缁?#28598;屽?#25053;?#25335;
    ,'221':'`'
    ,'202':']'#缁憋拷
    ,'212':','
    ,'222':' '#?#24770;?#25335;
    }    
    img = Image.open(f)
    if 0: img = Image.Image
    #缂?#28751;? ?#31912;?#28745;姣?#26440;?#22959;硦, 杩樻槸鐢?#37720;熸瘮渚嬭緝濂?/span>
    #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)    



?#31905;杩?#28051;浜涙敼?#32344;锛??#31493;?#28528;鐨?#28000;?#37934;?#37721;?#28000;?#38315;?#37922;?#27996;?#37818;?#37714;?#37721;?#26440;撳嚭

def PngToTxt(f):
    Palette={'000':'#'#姒涳拷
    ,'010':'@'#閺嗘璞?/span>
    ,'020':'/'#缂侊拷
    ,'001':'$'#濞?#26440;?#37821;?/span>
    ,'011':'<'#闂堬拷
    ,'021':'"'#娴滐拷璞懝?#25335;
    ,'002':'='#閽冿拷
    ,'012':'\\'#闂?#38175;芥?#25126;懝?#25335;
    ,'022':'_'#濞?#37723;?#29854;?/span>
    ,'100':'>'#閺嗘瀛?/span>
    ,'110':'*'#閺嗘绮?/span>
    ,'120':'~'#姒涘嫮璞懝?#25335;
    ,'101':'%'#閺嗘浼?/span>
    ,'111':'+'#閻忥拷
    ,'121':'^'#濞?#37723;?#29854;懝?#25335;
    ,'102':'|'#缁?#38175;界?#24539;?#24549;拷
    ,'112':'!'
    ,'122':'-'
    ,'200':'&'#缁撅拷
    ,'210':';'#濮?#23046;掑
    ,'220':"'"#姒涳拷
    ,'201':')'#濞?#26440;?#37933;囬懝?#25335;
    ,'211':'.'#缁?#28598;屽?#25053;?#25335;
    ,'221':'`'
    ,'202':']'#缁憋拷
    ,'212':','
    ,'222':' '#?#24770;?#25335;
    }    
    img = Image.open(f)
    if 0: img = Image.Image
    #缂?#28751;? ?#31912;?#28745;姣?#26440;?#22959;硦, 杩樻槸鐢?#37720;熸瘮渚嬭緝濂?/span>
    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])
        #鍘?#38340;?#32460;?#29723;?/span>
        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)

鍥?#28186;?#38171;?br />



wangkang 2014-03-20 09:36 鍙戣璇勮
]]>
鐢python鍙戝?#20905;鍛?/title><link>http://www.9087120.com/wangkang2009/archive/2014/03/07/206097.html</link><dc:creator>wangkang</dc:creator><author>wangkang</author><pubDate>Fri, 07 Mar 2014 11:32:00 GMT</pubDate><guid>http://www.9087120.com/wangkang2009/archive/2014/03/07/206097.html</guid><wfw:comment>http://www.9087120.com/wangkang2009/comments/206097.html</wfw:comment><comments>http://www.9087120.com/wangkang2009/archive/2014/03/07/206097.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.9087120.com/wangkang2009/comments/commentRss/206097.html</wfw:commentRss><trackback:ping>http://www.9087120.com/wangkang2009/services/trackbacks/206097.html</trackback:ping><description><![CDATA[鍏抽敭璇?#38171;?鐢python浠?#38315;爉atlab鍙戝?#20905;鍛?#38171;?html<br /><br />?#31905;?#29238;鐢matlab鐨?#27996;烘湁?#26882;鍊?#28028;?#37922;埌publish鍙戝?#20905;鍛?#37928;勫姛鑳?#38171;?涔?#28751;辨槸鐢熸垚涓涓猦tml鐨勬?#24538;椤?#38171;?鑰宲ython涓?#23676;?#29006;?#36776;病?#28225;杩?#32457;嶅姛鑳?#37510;傜幇?#28266;鏈?#27996;哄仛浜?#28051;涓?#32480;鍗?#37928;勭被浼?#37716;?#38003;?#38171;屽姒?#37928;勬牱寮忓?#20633;笅:<br /><br /><img src="http://www.9087120.com/images/cppblog_com/wangkang2009/python_publish.png" width="1145" height="791" alt="" /><br /><br /><br /><br />铏界劧姣?#26440;?#32480;闄?#38171;屼鑷?#28751;?#37721;?#28000;湪娴忚鍣?#28051;?#37930;?#27996;?#37510;?br /><br />澶?#22994;?#37928;勫?#29114;?#21976;槸鐢?#37721;戝?#20906;被鏇?#37817;pl锛?鍥犳濡傛灉鎮?#37928;刾l?#23047;鐢?#27996;?#26440;?#28598;?#37928;勫?#33445;暟锛?閭?#28052;?#38343;瑕?#37929;?#25652;?#37928;勫湪Publish涓姞鍏被浼?#37928;?#28000;?#37934;?#37510;?br /><br /><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span>     <span style="color: #0000FF; ">def</span> figure(self, id=1):<br /><span style="color: #008080; "> 2</span>         pl.figure(id)<br /><span style="color: #008080; "> 3</span>     <br /><span style="color: #008080; "> 4</span>     <span style="color: #0000FF; ">def</span> plot(self, *args, **kwargs):<br /><span style="color: #008080; "> 5</span>         pl.plot(*args, **kwargs)<br /><span style="color: #008080; "> 6</span>     <br /><span style="color: #008080; "> 7</span>     <span style="color: #0000FF; ">def</span> subplot(self, *args, **kwargs):<br /><span style="color: #008080; "> 8</span>         pl.subplot(*args, **kwargs)<br /><span style="color: #008080; "> 9</span>     <br /><span style="color: #008080; ">10</span>     <span style="color: #0000FF; ">def</span> title(self, s, *args, **kwargs):<br /><span style="color: #008080; ">11</span>         pl.title(s, *args, **kwargs)</div>瀵?#27996;?#29781;?#37721;戝竷鐨?#28000;?#37934;?#38171;?鍙?#38343;瑕佸湪?#22688;?#28528;?#23006;涓Publish?#34987;灏?#37721;?#28000;?#27996;?br /><div style="background-color: #eeeeee; font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">1</span> <span style="color: #0000FF; ">from</span> pypublish.publish <span style="color: #0000FF; ">import</span> *<br /><div><div style="border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all;"><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; ">1</span>     <span style="color: #008000; ">#</span><span style="color: #008000; ">涓?#37721;戝?#20905;妸璇?#29723;屾敞?#25890;</span><span style="color: #008000; "><br /></span><span style="color: #008080; ">2</span> <span style="color: #008000; "></span>    pl = Publish()<br /><span style="color: #008080; ">3</span>     <span style="color: #0000FF; ">print</span> <span style="color: #800000; ">'</span><span style="color: #800000; ">test python html publish.</span><span style="color: #800000; ">'</span><br /><span style="color: #008080; ">4</span>     <span style="color: #0000FF; ">for</span> i <span style="color: #0000FF; ">in</span> range(2):<br /><span style="color: #008080; ">5</span>         pl.figure(i)<br /><span style="color: #008080; ">6</span>         pl.plot(np.arange(0,10*(i+1)))<br /><span style="color: #008080; ">7</span>     pl.show()</div></div></div><div style="background-color:#eeeeee;font-size:13px;border:1px solid #CCCCCC;padding-right: 5px;padding-bottom: 4px;padding-left: 4px;padding-top: 4px;width: 98%;word-break:break-all"><span style="font-size: 14px;">褰撶劧浠?#28051;婂璁?#37806;?#37922;?#37928;?#38318;芥槸import pylab as pl</span></div>濡傛灉涓嶆槸杩?#32457;嶆?#21613;喌璇?#37826;瑰紡灏?#28051;?#38315;?#37922;?#27996;?#37510;?br /><a href="/Files/wangkang2009/pypublish.rar">/Files/wangkang2009/pypublish.rar</a><br /><img src ="http://www.9087120.com/wangkang2009/aggbug/206097.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.9087120.com/wangkang2009/" target="_blank">wangkang</a> 2014-03-07 19:32 <a href="http://www.9087120.com/wangkang2009/archive/2014/03/07/206097.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣璇勮</a></div>]]></description></item><item><title>python璋?#37922;C dll apihttp://www.9087120.com/wangkang2009/archive/2013/08/27/202798.htmlwangkangwangkangTue, 27 Aug 2013 03:34:00 GMThttp://www.9087120.com/wangkang2009/archive/2013/08/27/202798.htmlhttp://www.9087120.com/wangkang2009/comments/202798.htmlhttp://www.9087120.com/wangkang2009/archive/2013/08/27/202798.html#Feedback0http://www.9087120.com/wangkang2009/comments/commentRss/202798.htmlhttp://www.9087120.com/wangkang2009/services/trackbacks/202798.htmlpython璋?#37922;c dll api


鍏抽敭瀛?#38171;?python dll璋?#37922;?np?#34987;?#28727;杞?#37817;?double


鍏?#27996;巔ython璋?#37922;dll鐨勬枃绔犳湁寰?#28598;?#38171;?鏈瘒涓?#29781;?#37819;?#26473;板?#31594;ouble鏁?#32513;勪?#29362;弬鐨?#28729;炵幇锛?鏈?#27996;?#26473;樻病?#28225;鍙戠幇?#34987;浼?#37928;勬枃绔?#38171;?鍥犳涔?#37712;?#37832;枃妗姞浠?#29831;?#37828;?#37510;?/p>

鏈枃瀹炵幇涓?#29781;佸弬鑰?#37510;?#37922;python?#32344;琛岀瀛?#29825;畻銆?#28051;涔?#38171;?鍥犳瀵?#37916;?#28583;?#37832;夎?#20345;眰锛?鐜?#28583;?#38343;瑕?#28729;夎?#21362;ython(x,y)锛?璇?#26462;?#28000;?#37721;?#28000;?#23536;?#28610;?#37928;勬?#23508;numpy搴?#38171;?br />鍚?#37714;?#37922;sf涓婁笅杞?#37928;numpy瀹夎鍖呯洿鎺湪python?#22135;瀹夎?#21616;?#23676;技瑁?#27996;?#28051;?#37922;?#37825;?#38171;?涔?#28751;辨槸import numpy澶辫触

?#31493;?#28528;绠鍗?#29825;蹭笅瀹炵幇杩?#32459;?/p>

1. 鍒?#28003;dll锛?鍋?#29825;dll涓湁濡備笅鐨?#28725;?#37713;?#37713;芥暟锛?dll鍚?#28051;smooth
// @param: n   鏁?#32513;勯搴?br />// @param: x   [input/output] 涓缁?#37825;?#32513;?br />// @param: y   [input/output]
// @param: weights   [input]  鍙?#28051;?
// @param: s   [input/output] 鍗?#37706;?#38171;?#26473;?#37733;炴柊鐨x锛寉闀?#25652;?br />int smooth(int n, double* x, double* y, double* weights, double* s);


2. ?#23006;杞dll
import numpy as np
from ctypes import *

dll = np.ctypeslib.load_library('smooth', '.')


3. ?#22717;琛屽?#33445;暟
c?#22135;鐨double?#27128;64浣?#37928;?#38171;?鍥犳绠鍗?#37928;勪?#29362;弬浼氭槸32浣?#37928;?#38171;?姣?#28641;?#37922;笅?#28528;鐨?#28729;炵幇灏?#28028;氭湁杩?#37837;?#37928;勯棶棰?br />smooth = dll.smooth
#[Warning:?#31493;?#28528;?#27128;涓涓敊璇?#37928;勬?#26050;]
#鎻?#26473;板弬鏁扮被?#28727;
smooth.argtypes = [c_int, POINTER(c_double), POINTER(c_double), POINTER(c_double), POINTER(c_double)]
#杩?#37733;?#37706;肩被?#28727;
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)) )

璋?#37922;?#37722;巔ython娌湁鎶敊锛?浣?#28051;嶈兘寰楀埌姝?#32429;?#37928;勭粨?#28745;锛?杩涘叆vc闄勫姞python?#32344;绋?#38171;??#28266;鍑芥?#26495;?#26449;姞涓?#37826;偣锛?鏌?#37930;嬪弬鏁板?#21613;瓨锛?鍙?#37930;嬪嚭鍏槸浠int*鏂瑰紡浼?#37711;?#37928;?br />瑕?#29825;python浠?#37930;熸鐨?4浣峝ouble*浼?#37711;?#37721;娇鐢笅?#28528;鐨?#28729;炵幇
#姝?#32429;?#37928;勮皟鐢?br />smooth.argtypes = [
    c_int,
    np.ctypeslib.ndpointer(dtype=np.float64, ndim=1, flags="C_CONTIGUOUS"), #涓缁?#37825;?#32513;?#38171;?#28051;?#37712;呭瓨杩?#32513;?#37928;?
    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)

棰?#28598;?#29831;? python鐨勫弬鏁板熀鏈?#37721;?#28000;?#37930;?#28051;?#37816;囬拡锛??#34987;浼?#23534;?#37922;?#32475;夋搷浣?#38318;?#37721;?#28000;?#26462;?#37833;?#28729;屾垚

鏈?#27996;?#28725;筺umpy涓嶆槸寰堢啛锛?鍙?#38003;?#28725;?#27996;np鐨勫弬鏁板垵濮?#37718;栨湁?#27967;濂?#37928;勬?#29808;紡锛?姝?#28598;勫氨?#30075;鎶?#37934;?#23534;?#37916;?#37722;?#38171;?

 

 


 



wangkang 2013-08-27 11:34 鍙戣璇勮
]]>
鐢vc2010鎵睍绋?#25652;忔敼鍙?#32514;栬?#25120;獥鍙?#37928;勮?#23678;櫙?#22730;http://www.9087120.com/wangkang2009/archive/2013/04/17/199509.htmlwangkangwangkangWed, 17 Apr 2013 06:55:00 GMThttp://www.9087120.com/wangkang2009/archive/2013/04/17/199509.htmlhttp://www.9087120.com/wangkang2009/comments/199509.htmlhttp://www.9087120.com/wangkang2009/archive/2013/04/17/199509.html#Feedback0http://www.9087120.com/wangkang2009/comments/commentRss/199509.htmlhttp://www.9087120.com/wangkang2009/services/trackbacks/199509.html娉剰锛宖or vc2010

1. 鐢vc2010寤?#28051;涓?#37813;睍椤?#37929;?br />

2. 鍒涘缓璇?#26916;?#37929;?#38171;屾?#22796;収?#31493;?#28528;鍥?#32448;鸿?#26495;畬鍚?#28725;?#37510;?br />





3. 瀹屾垚鍚?#26916;?#37929;?#23524;虹, 渚?#23046;?#28103;敼
STDMETHODIMP CConnect::OnStartupComplete (SAFEARRAY ** /*鑷?#28729;?#28052;?/ )   // 椤?#37929;姞杞?#37722;?#29785;?#37721;?/div>
鍜?br />
STDMETHODIMP CConnect::Exec(BSTR bstrCmdName, vsCommandExecOption ExecuteOption, VARIANT * /*pvarVariantIn*/, VARIANT * /*pvarVariantOut*/, VARIANT_BOOL *pvbHandled) // 閫?#37815;?#37723;?#28000;?#37722;?#29785;?#37721;?br />
 1 // 椤?#37929;?#37722;?#37716;?#37722;?#29785;?#37721;?/span>
 2 STDMETHODIMP CConnect::OnStartupComplete (SAFEARRAY ** /*鑷?#28729;?#28052;?/span>*/ )
 3 {
 4     //RunBackGroundChange();
 5     CAddMyComment ac(m_pDTE);
 6     COLORREF clrBlack = 0x00c2c2c2;    // 閾惰壊
 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 // ?#25980;鍙?#32514;栬緫鍣?#38003;屾櫙棰滆壊
 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     // 鏄?#32448;?#26864;滆壊鍛?#37722;?/span>
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;    // 閾惰壊
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. ?#22717;琛?#37723;?#28000;?#38171;?杩涘叆椤?#37929;?#37722;?#38171;??#28266;?#24397;鍗?#23480;?#37711;蜂笅浼氬?#28056;缓涓涓彍鍗?#26916;?br />

?#20579;閫?#37722;?#38171;?浼氬湪鐧借壊鑳屾櫙鍜岄?#24816;壊?#26879;鍒?#37817;?#38171;?鍒?#28654;?#28028;?#26473;涘叆閾惰壊鑳屾櫙銆?br />

5. 鍙洿鎺娇鐢msi瀹夎鍖呭?#22798;璇?#37819;?#28000;? 鍚屾椂璇?#38340;?#28000;?#37718;呭惈?#31790;浠?#37934;?br />/Files/wangkang2009/backgroundchange.rar













wangkang 2013-04-17 14:55 鍙戣璇勮
]]>lib 绗?#37721;锋枃浠?#28051;庢簮鐮?#28051;?#37718;?#38320;?#37928;勯棶棰?/title><link>http://www.9087120.com/wangkang2009/archive/2012/12/07/196076.html</link><dc:creator>wangkang</dc:creator><author>wangkang</author><pubDate>Fri, 07 Dec 2012 05:34:00 GMT</pubDate><guid>http://www.9087120.com/wangkang2009/archive/2012/12/07/196076.html</guid><description><![CDATA[   浠?#28598;?#37721;堢姱浜?#28051;涓?#28003;?#32510;敊璇?#38171;?鎯呭喌?#27128;杩?#37837;?#37928;?#38171;?缂?#29831;?#28610;?#37928;?#28000;?#37934;佷笅鏂偣鍚庢绘槸涓庢簮浠?#37934;?#28051;?#37718;?#38320;?#38171;?寮?#27996;?#37719;?#28598;?#37813;嶆兂璧锋潵涓?#26916;?#37929;?#23052;湁缂?#29831;?#37510;?br /><br />   瀵?#27996;?#26473;?#37837;?#37928;勯棶棰?#25652;?#29831;?#23049;剰闇瑕?#32514;?#29831;?#28051;?#26916;?#37929;?#38171;?鏈濂?#37928;勫娉槸璁?#28051;?#28186;?#29863;?#26916;?#37510;?<img src ="http://www.9087120.com/wangkang2009/aggbug/196076.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.9087120.com/wangkang2009/" target="_blank">wangkang</a> 2012-12-07 13:34 <a href="http://www.9087120.com/wangkang2009/archive/2012/12/07/196076.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣璇勮</a></div>]]></description></item><item><title>windows ?#31493;VC6鍒?#28003;php鎵睍dllhttp://www.9087120.com/wangkang2009/archive/2012/08/15/187263.htmlwangkangwangkangWed, 15 Aug 2012 03:00:00 GMThttp://www.9087120.com/wangkang2009/archive/2012/08/15/187263.htmlhttp://www.9087120.com/wangkang2009/comments/187263.htmlhttp://www.9087120.com/wangkang2009/archive/2012/08/15/187263.html#Feedback0http://www.9087120.com/wangkang2009/comments/commentRss/187263.htmlhttp://www.9087120.com/wangkang2009/services/trackbacks/187263.htmlwindows ?#31493;VC6鍒?#28003;php鎵睍dll

缃?#28051;湁寰?#28598;?#29831;棶棰?#37928;勬枃绔?#38171;??#31651;鎵浠?#37712;?#37712;?#28051;閬?#38171;??#27128;鍥?#28051;?#37812;?#37837;?#37817;?#28000;?#28000;?#37928;勬枃绔犳病?#28225;璺?#38315;?#38171;?缁?#37722;?#27996;嗗浜?#37928;勬枃绔犲姞涓?#28051;浜?#38007;?#23480;?#37928;勭?#21978;
鏈缁堣鍐?#27996;?#26473;?#28051;棶棰?#37510;?/p>

1. ?#31493;杞?#29999;source鐨刾hp(v5.2)鍖呭強鍚岀増鏈?#32514;?#29831;?#28610;?#37928;?#37718;?php鏈濂戒娇鐢?#37722;岀増鏈?#37928;?, 杩欐槸vc6缂?#29831;?#37928;? ?#28266;php.net鍙笅杞?/p>

2. 瑙?#37720;source鍖呭悗鎵惧埌ext\skeleton, 澶?#37714;跺嚭涓浠芥柊鐨?#38171;?鐩?#35120;敼鍚?#28051;篽ello

3. 鎵撳紑鐩?#35120;曢噷?#28528;鐨?dsp, .c, .h, ?#22968;?#22135;?#28528;extname?#21455;閮?#37831;?#37817;?#28051;篽ello

4. ?#22968;php5ts.lib鎷疯礉鑷冲紑鍙戠洰褰?#38171;?淇敼lib?#22135;鐨勪緷璧php5ts_debug.lib 鑷硃hp5ts.lib, 淇敼dll杈撳嚭?#22476;php鐨別xt鐩?#35120;?/p>

5. f7缂?#29831;?#38171;?涓?#37713;烘剰澶?#25652;?#32514;?#29831;?#38315;?#26473;?#37510;?娉剰锛?涓瀹?#29781;佷娇鐢release缂?#29831;?#38171;?鐢debug?#23006;杞芥椂涓嶈锛?鎴?#28751;?#37733;?#28051;?#26473;?#28051;棶棰?#37719;?#28003;?#27996;嗗?#22556;銆?/p>

6. php.ini?#22135;?#23006;鍏extension=php_hello.dll, 娌?#29825;?#32515;?#37813;睍鐩?#35120;?#37928;?#29831;濆姞涓奺xtension_dir = "d:/Progra~1/Apache/PHP/ext/",
閲?#37722;apache

7. 涓?#37713;烘剰澶?#38171;??#28266;phpinfo()涓?#37721;?#28000;?#37930;嬭?#20077;ello妯潡浜?#37510;?/p>

8. 鍐?#28051;涓猵hp锛?鍐呭?#29808;?#20633;笅
<?
echo confirm_hello_compiled("kdskf");
?>
椤甸潰?#22717;琛?#37722;?#37721;?#37930;嬭string杈撳嚭銆?/p>


?#24364;鑰?br />http://blog.csdn.net/cyberhero/article/details/5966920

http://blog.csdn.net/php_boy/article/details/6456603



wangkang 2012-08-15 11:00 鍙戣璇勮
]]>
VC?#22476;Object-Chttp://www.9087120.com/wangkang2009/archive/2012/02/11/165345.htmlwangkangwangkangSat, 11 Feb 2012 07:34:00 GMThttp://www.9087120.com/wangkang2009/archive/2012/02/11/165345.htmlhttp://www.9087120.com/wangkang2009/comments/165345.htmlhttp://www.9087120.com/wangkang2009/archive/2012/02/11/165345.html#Feedback0http://www.9087120.com/wangkang2009/comments/commentRss/165345.htmlhttp://www.9087120.com/wangkang2009/services/trackbacks/165345.htmlVC to Object-C

鏈?#37719;氬鎵?#28225;?#26499;绔犲潎涓哄師?#22449;锛?璋?#32513;?#26462;?#26462;?br />

1. Class
// ?#34987;澹?#37828;?br />@interface MyTest : NSObject
{
// @private 绉佹湁锛?@package 
 int num1;
 int num2;
}

// 灞?#37804;?br />@porperty int num1, num2;

// ?#34987;鏂?#23049;?br />-(void) print;
-(int) Test2;

// 澶氬弬鏁板?#33445;暟
// 鏂?#23049;?#32457;?#28051;setTo:set2:, 鍏?#28729;?#28751;辨槸void setTo_set2(int a, int b);
// Object-C鍜孋++姣旀洿璞?#28051;绉?#37819;?#26473;?#29831;?#29815;
// 璋?#37922;[mytest setTo : 1 set2 : 3];
-(void) setTo : (int) a set2: (int) b
{
 num1 = a;
 num2 = b;
}

// ?#34987;浼?#27996;巚c?#22135;鐨static void print2();
// 璋?#37922;[MyTest print2];  鍚孋MyTest::print2();
+(void) print2;
@end

// ?#34987;瀹炵幇
@implementation MyTest

// 缂?#29831;?#37731;?#28028;?#38007;?#37716;?#37922;熸?#24878;被浼get,put鐨勬柟娉?br />// 涓?#37922;@porperty, 闇瑕?#38007;?#23480;辩幇瀹炵幇灞?#37804;?#37825;?#37817;?#37928;?#29831;?#37712;?br />@synthesize num1, num2;

-(void) print
{
 // 杈撳嚭?#22476;璋?#29831;?#37718;?#38171;??#34987;浼OutputString
 NSLog(@"%i/%i", num1, num2);
}

-(int) Test2
{
 return 10;
}
@end


// 璋?#37922;?br />MyTest* p = [[MyTest alloc] init]; // init?#27128;NSObject鐨勬柟娉?#38171;??#34987;浼C++?#22135;鐨勬閫?#38171;?涓?#26473;oc鍙?#38003;?#37922;?#37816;囬拡
[p setTo : 1 set2 : 3];
[p print];
[p release];

// 杈撳嚭
1/3


2. 甯?#37714;嗙被鐨勭被锛?鍒嗙被灏辨槸鎻愪緵涓涓?#37826;?#23049;?#32513;?#37722;?br />//1. 鍒嗙被涓嶈兘寤?#37721;?#38322;?br />//2. 鏈濂?#28051;嶈閲?#26462;?#28051;荤被鐨勬柟娉?br />//3. 鍙?#28000;?#28051;?#28729;炵幇鍒嗙被鐨勫叏閮?#37826;?#23049;?br />@interface MyTest (MyTestEx)  // 鎷?#37721;噷鐨MyTestEx浣?#28051;MyTest?#34987;鐨勫垎?#34987;
-(int) add : (int) a;
-(int) sub : (int) a;
@end


@implementation MyTest (MyTestEx)
-(int) add : (int) a
{
 num1 += a;
}
-(int) sub : (int) a
{
 num1 -= a;
}
@end

// 璋?#37922;?br />MyTest* p = [[MyTest alloc] init]; 
[p setTo : 1 set2 : 3];
[p add : 1];
[p print];
[p release];

// 杈撳嚭
2/3


3. 鍗?#29825;?br />鍗?#29825;槸澶?#28051;被鍏?#27996;?#28051;涓?#37826;?#23049;?#37714;?#29723;?#37510;?灏辨湁?#20579;璞C++?#22135;鐨勮?#27692;?#33445;暟琛?br />鍗?#29825;?#37721;?#29840;熻矗澹?#37828;?#38171;?瀹炵幇鐢?#23534;?#37922;被璐熻矗

// 杩欐槸涓涓?#37719;?#29825;?#28601;?#37828;?#38171;?鎰?#29785;夊?#36776;槸vc?#22135;鐨勬鍙?#28601;?#37828;?br />// interface NSCopying {
// void* copyWithZone(NSZone* zone) = 0;
// };
@protocol NSCopying
-(id)copyWithZone: (NSZone*)zone;
@optional // 璇?#37711;抽敭瀛?#37722;?#37928;勬柟娉?#37721;?#28000;?#28051;?#28729;炵幇
-(void) outline;
@end

// ?#23047;鐢?#37719;?#29825;? 鍗?#29825;?#37922;?#28751;?#37815;?#37721;?#37718;呭惈璧锋潵锛?鏀惧湪?#34987;鍚?#37812;?#37737;虹被鍚嶇?#39041;箣鍚?br />// VC?#22135;搴?#29831;槸杩?#37837;class CAddressBook : public CNSObject , public INSCopying {};
@interface AddressBook : NSObject <NSCopying>
@end
// 鍙?#28000;娇鐢?#28598;?#28051;?#37719;?#29825;? 灏?#29854;VC?#22135;鐨勫閲嶇鎵?br />// class CAddressBook : public CNSObject , public INSCopying , public INSCoding{};
@interface AddressBook : NSObject <NSCopying, NSCoding>
@end


 



wangkang 2012-02-11 15:34 鍙戣璇勮
]]>
տ3
<center id="iceyg"><tr id="iceyg"></tr></center>
<noscript id="iceyg"></noscript>
<center id="iceyg"></center>
<noscript id="iceyg"></noscript>
<noscript id="iceyg"></noscript>
<center id="iceyg"><tr id="iceyg"></tr></center>
<noscript id="iceyg"></noscript>
<center id="iceyg"></center>
<noscript id="iceyg"></noscript>
<noscript id="iceyg"></noscript>