锘??xml version="1.0" encoding="utf-8" standalone="yes"?>欧美喷潮久久久XXXXx,日本精品久久久久中文字幕,亚洲国产高清精品线久久 http://www.shnenglu.com/sh19871122/zh-cnTue, 06 May 2025 20:59:41 GMTTue, 06 May 2025 20:59:41 GMT60鏈夋晥鍒╃敤鏍囧噯搴撴彁渚涚殑type_traits錛岃紼嬪簭鍦ㄧ紪璇戞椂浣滃嚭鍒嗘敮閫夋嫨http://www.shnenglu.com/sh19871122/archive/2016/04/28/213383.htmlHallelujahHallelujahThu, 28 Apr 2016 09:50:00 GMThttp://www.shnenglu.com/sh19871122/archive/2016/04/28/213383.htmlhttp://www.shnenglu.com/sh19871122/comments/213383.htmlhttp://www.shnenglu.com/sh19871122/archive/2016/04/28/213383.html#Feedback0http://www.shnenglu.com/sh19871122/comments/commentRss/213383.htmlhttp://www.shnenglu.com/sh19871122/services/trackbacks/213383.html璁╃▼搴忎腑鐨勭畝鍗昳f-else鍦ㄧ紪璇戞湡闂村喅瀹?br />
ex. 1 /*
 2  * =====================================================================================
 3  *
 4  *       Filename:  3.cpp
 5  *
 6  *    Description:  
 7  *
 8  *        Version:  1.0
 9  *        Created:  03/01/2016 11:38:53 AM
10  *       Revision:  none
11  *       Compiler:  gcc
12  *
13  *         Author:  shih (Hallelujah), sh19871122@gmail.com
14  *   Organization:  
15  *
16  * =====================================================================================
17  */
18 
19 #include <stdio.h>
20 #include <stdint.h>
21 #include <iostream>
22 #include <type_traits>
23 
24 template<typename T>
25 struct is_swapable
26 {
27     static const bool value = std::is_integral<T>::value && sizeof(T) >= 2;
28 };
29 
30 template<typename T>
31 T byte_swap(T value, std::true_type)
32 {
33    uint8_t *bytes = reinterpret_cast<uint8_t *>(&value);
34    for (std::size_t i = 0; i < sizeof(T)/2; ++i)
35    {   
36        uint8_t v = bytes[i];
37        bytes[i] = bytes[sizeof(T) - 1 - i]; 
38        bytes[sizeof(T) -1 -i] = v;
39    }   
40    return value;
41 }
42 
43 template<typename T>
44 T byte_swap(T value, std::false_type)
45 {
46     return value;
47 }
48 
49 template<typename T>
50 T byte_swap(T value)
51 {
52     return byte_swap(value, std::integral_constant<bool, is_swapable<T>::value>());
53 }
54 
55 int main(int argc, const char *argv[])
56 {
57     int a = 0x11223344;
58     long b = 0x4455221112345678;
59     std::cout << std::hex << a << " " << b << std::endl;
60     std::cout << std::hex << byte_swap(a) << " " << byte_swap(b) << std::endl;
61     uint8_t c = 0x11;
62     char *d = "hello world";
63     std::cout << std::hex << byte_swap(c) << " " << byte_swap(d) << std::endl;
64     return 0;
65 }
66 


]]>
CentOS 7瀹夎EPEL Repohttp://www.shnenglu.com/sh19871122/archive/2014/10/22/208647.htmlHallelujahHallelujahTue, 21 Oct 2014 23:56:00 GMThttp://www.shnenglu.com/sh19871122/archive/2014/10/22/208647.htmlhttp://www.shnenglu.com/sh19871122/comments/208647.htmlhttp://www.shnenglu.com/sh19871122/archive/2014/10/22/208647.html#Feedback0http://www.shnenglu.com/sh19871122/comments/commentRss/208647.htmlhttp://www.shnenglu.com/sh19871122/services/trackbacks/208647.html
wget https://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-2.noarch.rpm
yum install epel-release-7-2.noarch.rpm
瀹夎鍚庡氨鍙互瀹夎R絳変簡(jiǎn)




]]>
浣跨敤Python閫氳繃Hive鐨凷treaming鏉ュ啓UDF鐨勪竴浜涜褰?/title><link>http://www.shnenglu.com/sh19871122/archive/2014/09/12/208279.html</link><dc:creator>Hallelujah</dc:creator><author>Hallelujah</author><pubDate>Fri, 12 Sep 2014 03:41:00 GMT</pubDate><guid>http://www.shnenglu.com/sh19871122/archive/2014/09/12/208279.html</guid><wfw:comment>http://www.shnenglu.com/sh19871122/comments/208279.html</wfw:comment><comments>http://www.shnenglu.com/sh19871122/archive/2014/09/12/208279.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/sh19871122/comments/commentRss/208279.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sh19871122/services/trackbacks/208279.html</trackback:ping><description><![CDATA[      鏈榪戜嬌鐢℉ive鏉ョ粺璁℃暟鎹紝鐢ㄤ簡(jiǎn)pyhs2鏉ュ疄鐜版煡璇紝浣嗘槸鏈変簺澶嶆潅鐨勫鐞嗘瘮濡傦紝鑷畾涔夊鍩熷悕鐨勫鐞嗙瓑錛屼笉鑳介氳繃hql鏉ュ疄鐜幫紝鍙戠幇鑳藉浣跨敤udf銆?br /> <br />       Java鏉ュ疄鐜癏ive鐨勫啓娉?span style="font-size: 13px; color: #008080;"> </span><span style="font-size: 13px; background-color: #eeeeee;"><br /></span><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 />--><br /><span style="color: #0000FF; ">package</span> jsl.hive.udf;<br /><br /><span style="color: #0000FF; ">import</span> org.apache.hadoop.hive.ql.exec.UDF;<br /><span style="color: #0000FF; ">import</span> org.apache.hadoop.io.Text;<br /><br /><span style="color: #0000FF; ">public</span> <span style="color: #0000FF; ">final</span> <span style="color: #0000FF; ">class</span> DomainRoot <span style="color: #0000FF; ">extends</span> UDF {<br />    <span style="color: #0000FF; ">public</span> Text evaluate(Text s) {<br />        <span style="color: #0000FF; ">if</span> (s == <span style="color: #0000FF; ">null</span>) {<span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">null</span>;}<br />        String tmp = s.toString();<br />        tmp = <span style="color: #0000FF; ">this</span>.getDomainRoot(tmp);<br />        <span style="color: #0000FF; ">return</span> <span style="color: #0000FF; ">new</span> Text(tmp);<br />    }   <br /><br />    <span style="color: #0000FF; ">private</span> String getDomainRoot(String domain) {<br />        <span style="color: #0000FF; ">throw</span> NoneImplementException("xxxx");<br />    }   <br />}</div><br />濡傛灉Java鐨刄DF闇瑕佸綋鎴愬父鐢ㄧ殑錛屼笉鐢ㄦ瘡嬈dd鍙互娉ㄥ唽鍒癏ive涓紝<br /><div>ql/src/java/org/apache/hadoop/hive/ql/exec/FunctionRegistry.java涓姞鍏?br /><div>registerUDF("domain_root", UDFParseUrl.class, false);騫墮噸鏂扮紪璇慼ive鍗沖彲<br /><br /><br />   涓嬮潰鏉ヨ璇撮噸鐐癸紝閫氳繃Streaming鐢≒ython鏉ュ啓澶勭悊銆?br />   鍏充簬Streaming鐨勫熀紜鍐呭錛?br /><div style="font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all; background-color: #eeeeee;"><img id="Code_Closed_Image_103933" onclick="this.style.display='none'; Code_Closed_Text_103933.style.display='none'; Code_Open_Image_103933.style.display='inline'; Code_Open_Text_103933.style.display='inline';" height="16" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top" style="display: none;"><img id="Code_Open_Image_103933" style="display: none" onclick="this.style.display='none'; Code_Open_Text_103933.style.display='none'; Code_Closed_Image_103933.style.display='inline'; Code_Closed_Text_103933.style.display='inline';" height="16" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top"><span id="Code_Closed_Text_103933" style="border: 1px solid #808080; display: none; background-color: #ffffff;"></span><span id="Code_Open_Text_103933" style="display: none"><br /><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />-->浣跨敤Transform鏉ユ寚瀹氬垪錛屼互鍙?qiáng)鋴社敤AS鏉ユ寚瀹氱敓鎴愮殑鍒椾互鍙?qiáng)鍙互鎸囧畾铦{鎹㈢敓鎴愬垪鐨勭被鍨?br />hive> select transform(col1, clo2) <br />    > <span style="color: #0000FF; ">using</span> '/bin/cat' <span style="color: #0000FF; ">as</span> (new_clo1 <span style="color: #0000FF; ">int</span>, new_clo2 <span style="color: #0000FF; ">double</span>) from table;<br /></span></div><br />   綰︽潫錛氶鍏堝繀欏籥dd file鍒癶ive涓紙褰損ython涓紩鐢ㄤ簡(jiǎn)鍏朵粬濡傝嚜宸卞啓鐨勬ā鍧楁椂錛屼篃闇瑕佷竴騫禷dd榪涘幓錛?br />            鍏舵闈炲父涓嶅垢,鍦ㄥ崟鐙殑涓涓煡璇腑錛屼笉鑳藉浣跨敤UDAF鐨勫嚱鏁板sum()<br />            鍐嶆涓嶅緱涓轟腑闂寸粨鏋滄暟鎹嬌鐢╟luster by鎴杁istribute by<br /><br />娉ㄦ剰錛氬浜庝紭鍖栨煡璇紝浣跨敤cluster by鎴杁istribute by 鍜宻ort by涓璧烽潪甯擱噸瑕?br /><br /></div></div><div style="font-size: 13px; border: 1px solid #cccccc; padding: 4px 5px 4px 4px; width: 98%; word-break: break-all; background-color: #eeeeee;"></div><img src ="http://www.shnenglu.com/sh19871122/aggbug/208279.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sh19871122/" target="_blank">Hallelujah</a> 2014-09-12 11:41 <a href="http://www.shnenglu.com/sh19871122/archive/2014/09/12/208279.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>C++緙栬瘧鏈熷綰︿箣must_have_basehttp://www.shnenglu.com/sh19871122/archive/2014/07/29/207853.htmlHallelujahHallelujahTue, 29 Jul 2014 04:25:00 GMThttp://www.shnenglu.com/sh19871122/archive/2014/07/29/207853.htmlhttp://www.shnenglu.com/sh19871122/comments/207853.htmlhttp://www.shnenglu.com/sh19871122/archive/2014/07/29/207853.html#Feedback0http://www.shnenglu.com/sh19871122/comments/commentRss/207853.htmlhttp://www.shnenglu.com/sh19871122/services/trackbacks/207853.html鍦ㄤ笉瀹岀編C++涓殑must_have_base濡備笅錛?br />

template<typename D, typename B>
struct must_have_base
{
    ~must_have_base()
    {
        void (*p)(D*, B*) = constraints;
    }

private:
    static void constraints(D *pd, B *pb)
    {
        pb = pd;
    }
};
鍘熺悊鏄氳繃涓嶆墽琛岀殑鎴愬憳鍑芥暟鎶婂嚱鏁版寚閽堝湪鏋愭瀯鍑芥暟涓祴鍊鹼紝寮鴻揩緙栬瘧鍣ㄥ湪緙栬瘧鏈熼棿媯(gè)鏌ユ垚鍛樺嚱鏁板唴鐨勭害鏉熴? 

鑷繁鍐欎簡(jiǎn)涓皬鐨勫疄渚嬶紝铏界劧榪欏効鏈夌偣鐐圭壍寮猴紝浣嗘槸錛屽緢澶氭儏鍐典篃闇瑕佹鏌ユ槸鍚︽槸鏌愮綾誨瀷鐨勫瓙綾誨瀷鐨勬椂鍊欒繕鏄彲浠ョ殑錛?br />瀹屾暣浠g爜濡備笅錛?br />
 1 
 2 template<typename D, typename B>
 3 struct must_have_base
 4 {
 5     ~must_have_base()
 6     {
 7         void (*p)(D*, B*) = constraints;
 8     }
 9 
10 private:
11     static void constraints(D *pd, B *pb)
12     {
13         pb = pd;
14     }
15 };
16 
17 class base
18 {
19 public:
20     virtual ~base() {}
21 
22     virtual void run() = 0;
23 };
24 
25 class inherit_base: public base
26 {
27 public:
28     virtual void run()
29     {
30 
31     }
32 };
33 
34 class inherit_not_base 
35 {
36 public:
37     virtual void run()
38     {
39 
40     }
41 };
42 
43 class test
44 {
45 public:
46     template<typename T>
47     void testfunc(T &t)
48     {
49         must_have_base<T, base>();
50 
51         t.run();
52     }
53 };
54 
55 int main()
56 {
57     test t_ok, t_nok;
58     inherit_base hb;
59     inherit_not_base hnb;
60     t_ok.testfunc(hb);
61     t_nok.testfunc(hnb);
62 
63     return 0;
64 }
鎶涚爾寮曠帀錛屽笇鏈涜繖浜涗笢瑗塊兘鑳界敤鍦ㄥ疄闄呯殑宸ョ▼浠g爜涓?img src ="http://www.shnenglu.com/sh19871122/aggbug/207853.html" width = "1" height = "1" />

]]>
Vagrant鍚姩鑷繁CentOS鐨勬椂鍊欏嚭鐜版枃浠跺す涓嶈兘姝e父鎸傝澆http://www.shnenglu.com/sh19871122/archive/2014/06/05/207194.htmlHallelujahHallelujahThu, 05 Jun 2014 03:16:00 GMThttp://www.shnenglu.com/sh19871122/archive/2014/06/05/207194.htmlhttp://www.shnenglu.com/sh19871122/comments/207194.htmlhttp://www.shnenglu.com/sh19871122/archive/2014/06/05/207194.html#Feedback0http://www.shnenglu.com/sh19871122/comments/commentRss/207194.htmlhttp://www.shnenglu.com/sh19871122/services/trackbacks/207194.html$ vagrant plugin install vagrant-vbguest
$ vagrang reload


reload浼?xì)閲嶆柊缂栬瘧vbox鐨刟dditions錛岀劧鍚巑ount灝辮兘鎴愬姛浜?br />鎴戠殑鐜鏄疌entOS 6.5錛屽湪yum涓紑鍚簡(jiǎn)kernel鏇存柊鐨勶紝榛樿鏄痚xclude=kernel*

榪欐槸鍒漢緇欑殑瑙e喅鏂規(guī)錛?br />
vagrant up; vagrant ssh -c 'sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions'; vagrant reload


]]>
kivy鐨勭涓姝?-----瀹夎錛屼笌IDEA鍏卞悓寮鍙?/title><link>http://www.shnenglu.com/sh19871122/archive/2014/05/18/207008.html</link><dc:creator>Hallelujah</dc:creator><author>Hallelujah</author><pubDate>Sun, 18 May 2014 12:35:00 GMT</pubDate><guid>http://www.shnenglu.com/sh19871122/archive/2014/05/18/207008.html</guid><wfw:comment>http://www.shnenglu.com/sh19871122/comments/207008.html</wfw:comment><comments>http://www.shnenglu.com/sh19871122/archive/2014/05/18/207008.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/sh19871122/comments/commentRss/207008.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sh19871122/services/trackbacks/207008.html</trackback:ping><description><![CDATA[鐜錛歐indows 7 64bits錛孖DE:IntelliJ IDEA 13.1.2<br />瀹夎kivy錛?. 涓嬭澆瀹夎鍖卙ttp://kivy.org/#download錛屾垜浣跨敤鐨勬槸Python 2.7.6錛岄夋嫨鐨?.7鐗堟湰錛堟敞鎰忔鐗堟湰鏄?2浣峆ython錛?br />              2. 瑙e帇鍒頒竴涓洰褰曪紝鎴戝湪鎴戠殑緋葷粺鐜鍙橀噺涓皢鏍圭洰褰曞懡鍚嶄負(fù)浜?jiǎn)KIVY_ROOT<br />              3. 铏界劧kivy涓嚜甯︿簡(jiǎn)Python鐨勶紝鍙互鐩存帴浣跨敤錛屼篃鍙互鑷繁瀹夎錛屾垜鏄嚜宸變笅杞界殑Python 2.7.6錛堣寰椾竴瀹氭槸32浣嶏紝涓嶇劧鍚庨潰鍐欑▼搴忎細(xì)鍑洪棶棰橈級(jí)<br />              4. 濡傛灉鏈哄櫒浠ュ墠娌″畨瑁単it鐨勶紝鍙互鐩存帴浣跨敤KIVY涓甫鐨刴ingw錛屾垜鑷繁鏈哄櫒瀹夎浜?jiǎn)git錛屾墍浠ョ幆澧冨彉閲忓氨娌¤緗甿ingw鐨?br />              5. 璁劇疆鐜鍙橀噺錛孏ST_REGISTRY=%KIVY_ROOT%gstreamer\registry.bin<br />                                     GST_PLUGIN_PATH=%KIVY_ROOT%gstreamer\lib\gstreamer-1.0<br />                  PATH鍙橀噺涓姞鍏ヤ簡(jiǎn)%KIVY_ROOT%;%KIVY_ROOT%tools;%KIVY_ROOT%gstreamer\bin;錛堣繕鏈塒ython鐨刴ingw鐨勶級(jí)<br />                  鏈鍚庯紝闇瑕佸湪PYTHONPATH涓姞鍏?KIVY_ROOT%kivy<br />鏈鍚庡啓鍏ョ涓涓▼搴忔潵嫻嬭瘯錛?br />浠g爜濡備笅<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> <br /><span style="color: #008080; "> 2</span> <span style="color: #008000; ">#</span><span style="color: #008000; "> -*- coding:utf-8 -*-</span><span style="color: #008000; "><br /></span><span style="color: #008080; "> 3</span> <span style="color: #008000; ">#</span><span style="color: #008000; ">/user/bin/env python</span><span style="color: #008000; "><br /></span><span style="color: #008080; "> 4</span> <span style="color: #008000; "></span><br /><span style="color: #008080; "> 5</span> <span style="color: #800080; ">__author__</span> = <span style="color: #800000; ">'</span><span style="color: #800000; ">shih</span><span style="color: #800000; ">'</span><br /><span style="color: #008080; "> 6</span> <br /><span style="color: #008080; "> 7</span> <span style="color: #0000FF; ">from</span> kivy.app <span style="color: #0000FF; ">import</span> App<br /><span style="color: #008080; "> 8</span> <br /><span style="color: #008080; "> 9</span> <span style="color: #0000FF; ">class</span> Hello(App):<br /><span style="color: #008080; ">10</span>     <span style="color: #0000FF; ">pass</span><br /><span style="color: #008080; ">11</span> <br /><span style="color: #008080; ">12</span> <span style="color: #0000FF; ">if</span> <span style="color: #800080; ">__name__</span> == <span style="color: #800000; ">"</span><span style="color: #800000; ">__main__</span><span style="color: #800000; ">"</span>:<br /><span style="color: #008080; ">13</span>     Hello().run()</div>鎵ц緇撴灉濡備笅錛?br /><img src="http://www.shnenglu.com/images/cppblog_com/sh19871122/kivy_hello.png" width="1306" height="672" alt="" /><br /><br /><img src ="http://www.shnenglu.com/sh19871122/aggbug/207008.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sh19871122/" target="_blank">Hallelujah</a> 2014-05-18 20:35 <a href="http://www.shnenglu.com/sh19871122/archive/2014/05/18/207008.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Python鐗規(guī)畩鏂規(guī)硶鐨勬搷浣滅閲嶈澆琛?/title><link>http://www.shnenglu.com/sh19871122/archive/2014/04/14/206575.html</link><dc:creator>Hallelujah</dc:creator><author>Hallelujah</author><pubDate>Mon, 14 Apr 2014 03:38:00 GMT</pubDate><guid>http://www.shnenglu.com/sh19871122/archive/2014/04/14/206575.html</guid><wfw:comment>http://www.shnenglu.com/sh19871122/comments/206575.html</wfw:comment><comments>http://www.shnenglu.com/sh19871122/archive/2014/04/14/206575.html#Feedback</comments><slash:comments>1</slash:comments><wfw:commentRss>http://www.shnenglu.com/sh19871122/comments/commentRss/206575.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sh19871122/services/trackbacks/206575.html</trackback:ping><description><![CDATA[<div>涓嶇煡閬撻噷闈㈡庝箞寮勮〃鏍鹼紝灝變笂浼犲浘鐗囦簡(jiǎn)<br /><img src="http://www.shnenglu.com/images/cppblog_com/sh19871122/Python璇█鏉傞」.png" width="936" height="993" alt="" /><br />濡傛灉鐢ㄦ埛鑷畾涔夌殑綾伙紝鎯蟲(chóng)湁add鍔熻兘錛屽鏋滅被娌℃彁渚沖_add__鎴朹_radd__鏂規(guī)硶鐨勮瘽錛屼細(xì)鎶涘嚭寮傚父<br />鍐嶅錛宨f xxxobj:榛樿鏄鏋渪xxobj涓嶆槸None鍒欎負(fù)True錛屽惁鍒欎負(fù)False錛屽鏋滀笉鏄繖涓昏緫鍒欏彲浠ラ氳繃瀹炵幇__bool__鏂規(guī)硶(鑷繁鐨勬祴璇曚腑2.7闇瑕佸啀鍔犱笂__nonzero__()鏂規(guī)硶錛?.2涓洿鎺ュ氨琛?<br /><br /></div><img src ="http://www.shnenglu.com/sh19871122/aggbug/206575.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sh19871122/" target="_blank">Hallelujah</a> 2014-04-14 11:38 <a href="http://www.shnenglu.com/sh19871122/archive/2014/04/14/206575.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>zeromq瀛︿範(fàn)錛岀涓绔?/title><link>http://www.shnenglu.com/sh19871122/archive/2014/03/16/206194.html</link><dc:creator>Hallelujah</dc:creator><author>Hallelujah</author><pubDate>Sun, 16 Mar 2014 15:41:00 GMT</pubDate><guid>http://www.shnenglu.com/sh19871122/archive/2014/03/16/206194.html</guid><wfw:comment>http://www.shnenglu.com/sh19871122/comments/206194.html</wfw:comment><comments>http://www.shnenglu.com/sh19871122/archive/2014/03/16/206194.html#Feedback</comments><slash:comments>2</slash:comments><wfw:commentRss>http://www.shnenglu.com/sh19871122/comments/commentRss/206194.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sh19871122/services/trackbacks/206194.html</trackback:ping><description><![CDATA[Asynchronous Input/Output錛圓IO錛夛細(xì)AIO鍙互鍦╥nput/output鐨勮姹傚埌鏉ヤ箣鍓嶇戶緇墽琛屻侫IO鍦ㄥ疄鏃跺簲鐢ㄧ▼搴忎腑鏄繀欏葷殑銆備嬌鐢ˋIO鍙互鏄犲皠澶氫釜浠誨姟鍒頒竴涓嚎紼嬩笂鍘匯?br />棣栧厛zeromq鐨勮璁℃槸寮變腑闂翠漢鐨勶紙brokerless錛岀浉瀵逛簬ActiveMQ銆丷abbitMQ絳?浣跨敤0zq鐨勭▼搴忓氨鍙互鐩存帴鍜屽叾浠栫殑鑺傜偣閫氫俊鑰屼笉閫氳繃broker鐨勪唬鐞嗐傦級(jí)錛寊eromq涓嶄細(xì)瀛樺偍淇℃伅鍒扮鐩樹(shù)笂錛岀劧鑰屽彲鑳戒嬌鐢ㄦ湰鍦扮殑浜ゆ崲鏂囦歡鏉ュ瓨鍌ㄦ秷鎭紙褰撹緗簡(jiǎn)zmq.SWAP鏃訛級(jí)銆?br /><br />紺轟緥錛欻elloWorld錛坰erver錛?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"><img id="Code_Closed_Image_230816" onclick="this.style.display='none'; Code_Closed_Text_230816.style.display='none'; Code_Open_Image_230816.style.display='inline'; Code_Open_Text_230816.style.display='inline';" height="16" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top"><img id="Code_Open_Image_230816" style="display: none" onclick="this.style.display='none'; Code_Open_Text_230816.style.display='none'; Code_Closed_Image_230816.style.display='inline'; Code_Closed_Text_230816.style.display='inline';" height="16" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top"><span id="Code_Closed_Text_230816" style="border-right: #808080 1px solid; border-top: #808080 1px solid; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">server</span><span id="Code_Open_Text_230816" style="display: none"><br /><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><br />#include <<span style="color: #0000FF; ">string</span>.h><br />#include <stdio.h><br />#include <unistd.h><br />#include <zmq.h><br /><br /><span style="color: #0000FF; ">int</span> main(<span style="color: #0000FF; ">int</span> argc, <span style="color: #0000FF; ">char</span> *argv[])<br />{<br />    <span style="color: #0000FF; ">void</span> *context = zmq_ctx_new();<br />    <span style="color: #0000FF; ">void</span> *respond = zmq_socket(context, ZMQ_REQ);<br />    zmq_bind(respond, "tcp://*:4040");<br /><br />    printf("starting<img src="http://www.shnenglu.com/Images/dot.gif" alt="" />\n");<br /><br />    <span style="color: #0000FF; ">for</span> (;;)<br />    {<br />        zmq_msg_t request;<br />        zmq_msg_init(&request);<br />        zmq_msg_recv(&request, respond, 0);<br />        printf("received: %s\n", zmq_msg_data(&request));<br />        zmq_msg_close(&request);<br />        sleep(1);<br /><br />        zmq_msg_t reply;<br />        zmq_msg_init_size(&reply, strlen("world"));<br />        memcpy(zmq_msg_data(&reply), "world", 5);<br />        zmq_msg_send(&reply, respond, 0);<br />        zmq_msg_close(&reply);<br />    }<br /><br />    zmq_close(respond);<br />    zmq_ctx_destroy(context);<br /><br />    <span style="color: #0000FF; ">return</span> 0;<br /></span></div><br />紺轟緥錛欻elloworld錛坈lient錛?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"><img id="Code_Closed_Image_230951" onclick="this.style.display='none'; Code_Closed_Text_230951.style.display='none'; Code_Open_Image_230951.style.display='inline'; Code_Open_Text_230951.style.display='inline';" height="16" src="http://www.shnenglu.com/images/OutliningIndicators/ContractedBlock.gif" width="11" align="top"><img id="Code_Open_Image_230951" style="display: none" onclick="this.style.display='none'; Code_Open_Text_230951.style.display='none'; Code_Closed_Image_230951.style.display='inline'; Code_Closed_Text_230951.style.display='inline';" height="16" src="http://www.shnenglu.com/images/OutliningIndicators/ExpandedBlockStart.gif" width="11" align="top"><span id="Code_Closed_Text_230951" style="border-right: #808080 1px solid; border-top: #808080 1px solid; border-left: #808080 1px solid; border-bottom: #808080 1px solid; background-color: #ffffff">client</span><span id="Code_Open_Text_230951" style="display: none"><br /><!--<br /><br />Code highlighting produced by Actipro CodeHighlighter (freeware)<br />http://www.CodeHighlighter.com/<br /><br />--><span style="color: #008080; "> 1</span> <br /><span style="color: #008080; "> 2</span> #include <stdio.h><br /><span style="color: #008080; "> 3</span> #include <unistd.h><br /><span style="color: #008080; "> 4</span> #include <<span style="color: #0000FF; ">string</span>.h><br /><span style="color: #008080; "> 5</span> #include <zmq.h><br /><span style="color: #008080; "> 6</span> <br /><span style="color: #008080; "> 7</span> <span style="color: #0000FF; ">int</span> main(<span style="color: #0000FF; ">int</span> argc, <span style="color: #0000FF; ">char</span> *argv[])<br /><span style="color: #008080; "> 8</span> {<br /><span style="color: #008080; "> 9</span>     <span style="color: #0000FF; ">void</span> *context = zmq_ctx_new();<br /><span style="color: #008080; ">10</span>     printf("client starting<img src="http://www.shnenglu.com/Images/dot.gif" alt="" />\n");<br /><span style="color: #008080; ">11</span> <br /><span style="color: #008080; ">12</span>     <span style="color: #0000FF; ">void</span> *request = zmq_socket(context, ZMQ_REQ);<br /><span style="color: #008080; ">13</span>     zmq_connect(request, "tcp://localhost:4040");<br /><span style="color: #008080; ">14</span> <br /><span style="color: #008080; ">15</span>     <span style="color: #0000FF; ">int</span> count = 0;<br /><span style="color: #008080; ">16</span> <br /><span style="color: #008080; ">17</span>     <span style="color: #0000FF; ">for</span> (;;)<br /><span style="color: #008080; ">18</span>     {<br /><span style="color: #008080; ">19</span>         zmq_msg_t req;<br /><span style="color: #008080; ">20</span>         zmq_msg_init_size(&req, strlen("hello"));<br /><span style="color: #008080; ">21</span>         memcpy(zmq_msg_data(&req), "hello", 5);<br /><span style="color: #008080; ">22</span>         printf("send msg hello, count = %d\n", count);<br /><span style="color: #008080; ">23</span>         zmq_msg_send(&req, request, 0);<br /><span style="color: #008080; ">24</span>         zmq_msg_close(&req);<br /><span style="color: #008080; ">25</span> <br /><span style="color: #008080; ">26</span>         zmq_msg_t reply;<br /><span style="color: #008080; ">27</span>         zmq_msg_init(&reply);<br /><span style="color: #008080; ">28</span>         zmq_msg_recv(&reply, request, 0);<br /><span style="color: #008080; ">29</span>         printf("recv msg %s, count = %d\n", zmq_msg_data(&reply), count);<br /><span style="color: #008080; ">30</span>         zmq_msg_close(&reply);<br /><span style="color: #008080; ">31</span>         count++;<br /><span style="color: #008080; ">32</span>     }<br /><span style="color: #008080; ">33</span> <br /><span style="color: #008080; ">34</span>     zmq_close(request);<br /><span style="color: #008080; ">35</span>     zmq_ctx_destroy(context);<br /><span style="color: #008080; ">36</span> <br /><span style="color: #008080; ">37</span>     <span style="color: #0000FF; ">return</span> 0;<br /><span style="color: #008080; ">38</span> }<br /><span style="color: #008080; ">39</span> <br /><span style="color: #008080; ">40</span> </span></div><br />榪欓噷浣跨敤浜?jiǎn)鏈鍩烘湰鐨勮姹傚簲絳旀灦鏋勩傝緇嗚В鏋愪唬鐮侊細(xì)<br />絎竴姝ワ細(xì)鍒涘緩浜?jiǎn)context鍜宻ocket錛寊mq_ctx_new鏂規(guī)硶鍒涘緩浜?jiǎn)涓涓柊鐨?span style="color: red;">context錛岃繖鏄嚎紼嬪畨鍏?/span>鐨勶紝鍗充竴涓猚ontext鍙敤浜庡涓嚎紼嬫搷浣溿?zmq_socket鏂規(guī)硶鍒涘緩浜?jiǎn)涓涓湪context涓畾涔夌殑socket錛?span style="color: red;">ZeroMQ鐨剆ocket涓嶆槸綰跨▼瀹夊叏</span>銆備紶緇熺殑socket鏄悓姝ョ殑錛岀劧鑰孼MQ鐨剆ocket鍦ㄥ鎴風(fēng)鍜屾湇鍔$閮界淮鎶や簡(jiǎn)涓涓槦鍒楁潵綆$悊request-reply鐨勫紓姝ユā寮忋俍MQ鑷姩鐨勫鐞嗚繛鎺ャ侀噸榪炪佹柇寮榪炴帴鍜屽唴瀹逛氦浠樸?br />鏈嶅姟绔垱寤轟簡(jiǎn)Reply錛圸MQ_REP錛夌敤鏉ュ鐞嗘帴鏀舵秷鎭茍搴旂瓟娑堟伅銆傚鏋滃鎴風(fēng)鍜屾湇鍔$閬楀け錛坙ost錛夛紝搴旂瓟鐨勬秷鎭皢鍦ㄦ病鏈変換浣曢氱煡鐨勬儏鍐典笅涓㈡帀銆?br />瀹㈡埛绔垱寤轟簡(jiǎn)涓涓猂equest(ZMQ_REQ)鏉ュ彂閫佹秷鎭茍鎺ユ敹鏉ヨ嚜鏈嶅姟鐨勫簲絳斻俍MQ_REQ涓嬩笉浼?xì)涓㈠純鋼Q浣曚俊鎭紝涓嶇鏄病鏈夋病鏈夊彲鐢ㄤ笌鍙戦佹秷鎭殑鏈嶅姟鎴栨槸鏈嶅姟澶勪簬蹇欑姸鎬侊紝鎵鏈夌殑鍙戦佹搷浣渮mq_send鍑芥暟浼?xì)闃诲锛岀洿鍒颁竴涓湇鍔″彉?shù)负鍙敤浜庡彂閫佹秷鎭俍MQ_REQ鍜孼MQ_REP銆乑MQ_ROUTER綾誨瀷鍏煎銆?br />娑堟伅鐨勫彂閫亃mq_send鍑芥暟鐨勭涓変釜鍙傛暟鏄痜lags錛屾槸ZMQ_DONTWAIT鎴朲MQ_SNDMORE銆俍MQ_DONTWAIT琛ㄦ槑娑堟伅鏄紓姝ョ殑鍙戦併俍MQ_SNDMORE琛ㄦ槑娑堟伅鏈夊閮ㄥ垎錛屽叾浣欑殑閮ㄥ垎宸茬粡“鍦ㄨ礬涓婁簡(jiǎn)”銆傛秷鎭帴鏀跺嚱鏁皕mq_msg_recv鍑芥暟錛屽鏈嶅姟绔紝鍦ㄥ厛鍓嶆帴鏀剁殑娑堟伅鏄棤鏁堢殑銆傜涓変釜鍙傛暟flugs鍙兘鏄痁MQ_DONTWAIT銆?br /><br />鍏堢潯瑙変簡(jiǎn)<img src ="http://www.shnenglu.com/sh19871122/aggbug/206194.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sh19871122/" target="_blank">Hallelujah</a> 2014-03-16 23:41 <a href="http://www.shnenglu.com/sh19871122/archive/2014/03/16/206194.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Python鐨勫弬鏁拌В鍖呭皬鎶宸э紙浣跨敤瀹瑰櫒浣滀負(fù)鍙傛暟鏃訛級(jí)http://www.shnenglu.com/sh19871122/archive/2013/12/31/205078.htmlHallelujahHallelujahTue, 31 Dec 2013 03:07:00 GMThttp://www.shnenglu.com/sh19871122/archive/2013/12/31/205078.htmlhttp://www.shnenglu.com/sh19871122/comments/205078.htmlhttp://www.shnenglu.com/sh19871122/archive/2013/12/31/205078.html#Feedback0http://www.shnenglu.com/sh19871122/comments/commentRss/205078.htmlhttp://www.shnenglu.com/sh19871122/services/trackbacks/205078.html 1 def args_unpacking_test(x, y):
 2     print 'x = ', x, ' y = ', y
 3 
 4 A = namedtuple('A''y x')
 5 
 6 list_foo = [3, 4]
 7 tuple_foo = (3, 4)
 8 ntuple_foo = A(4, 3)
 9 dict_foo = {'y':4, 'x':3}
10 
11 
12 args_unpacking_test(*list_foo)
13 args_unpacking_test(*tuple_foo)
14 args_unpacking_test(*ntuple_foo)
15 args_unpacking_test(**dict_foo)
16 
17 浠栦滑鐨勭粨鏋滆緭鍑洪兘鏄竴鏍風(fēng)殑

榪欎釜鏂瑰紡澶勭悊闈炲父鏈夌敤錛屽鏋滃弬鏁頒釜鏁頒笉涓鑷寸殑璇濅細(xì)鎶ラ敊

]]>
Oracle鐨勭紪紼嬪噯澶囧伐浣滐細(xì)鎼緩鏈湴鐨勫熀鏈幆澧?/title><link>http://www.shnenglu.com/sh19871122/archive/2013/12/17/204860.html</link><dc:creator>Hallelujah</dc:creator><author>Hallelujah</author><pubDate>Tue, 17 Dec 2013 12:16:00 GMT</pubDate><guid>http://www.shnenglu.com/sh19871122/archive/2013/12/17/204860.html</guid><wfw:comment>http://www.shnenglu.com/sh19871122/comments/204860.html</wfw:comment><comments>http://www.shnenglu.com/sh19871122/archive/2013/12/17/204860.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/sh19871122/comments/commentRss/204860.html</wfw:commentRss><trackback:ping>http://www.shnenglu.com/sh19871122/services/trackbacks/204860.html</trackback:ping><description><![CDATA[棣栧厛涓嬭澆Instant Client錛屾垜涓嬭澆鐨?1.2<br /><br /><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;">涓嬭澆鐨勬枃浠跺寘鎷涓嬪垪琛細(xì)<br />1. instantclient-basic-nt-11.2.0.3.0.zip<br />2. instantclient-odbc-nt-11.2.0.3.0.zip<br />3. instantclient-sdk-nt-11.2.0.3.0.zip<br />4. instantclient-sqlplus-nt-11.2.0.3.0.zip<br />5. instantclient-tools-nt-11.2.0.3.0.zip</blockquote><blockquote style="border: none; margin: 0px 0px 0px 40px; padding: 0px;">鏈鍚庝袱涓殢渚夸簡(jiǎn)錛岃В鍘嬫枃浠跺埌instantclient_11_2鐩綍涓?br /><br /></blockquote>鍛戒護(hù)琛屼笅鍒拌В鍘嬬殑鐩綍instantclient_11_2涓墽琛?gt;odbc_install<br /><br />鍦ㄧ幆澧冨彉閲忎腑鐨勭郴緇熷彉閲廝ATH涓姞鍏nstantclient_11_2鐩綍鐨勫叏璺緞<br /><br />鍒涘緩涓涓敤鎴峰彉閲廜RACLE_HOME錛屾寚鍚慽c鐨勫畨瑁呯洰褰曪紝榪欑偣寰堝叧閿紝鐗瑰埆鏄敤cmake緙栬瘧soci錛屽茍闇瑕佹敮鎸丱racle鐨勮瘽銆?br /><br />鍦╥c鐩綍涓垱寤簄etwork/admin鐩綍錛屽茍鍔犲叆OCI鐨?ora鏂囦歡錛屽湪鐜鍙橀噺涓姞鍏NS_ADMIN鏉ユ寚瀹氬垰鎵嶅垱寤虹殑鐩綍<br /><br />鍒涘緩涓涓敤鎴峰彉閲廚LS_LANG鏉ヨ緗璦錛屾垜鐨勮緗槸SIMPLIFIED CHINESE_CHINA.ZHS16GBK錛岃繖涓鍜屾暟鎹簱閭h竟涓鑷達(dá)紵<br /><br />鍒涘緩涓涓敤鎴峰彉閲廠QLPATH鏉ユ寚瀹歴qlpath宸ュ叿鐨勬枃浠惰礬寰勶紝涓嬭澆鐨勭鍥涗釜鏂囦歡<br /><br />OK錛屾墍鏈夊畨瑁呭氨姝ゃ?br /><br />鍐嶅畨瑁匫racle鐨勮闂伐鍏鳳紝鎴戜嬌鐢ㄧ殑鏄疦avicat for Oracle宸ュ叿<br />1. 鏅氬畨瑁?br />2. 鐮磋В銆佹敞瑙?br />3. 闈炲父閲嶈錛氬湪杞歡鐨刼ption涓璒CI閫夐」涓皢OCI library錛坥ci.dll錛夌殑璺緞鎸囧悜瀹夎鐨刬nstant clent鐨刼ci.dll涓?br />4. SQL*PLUS浠ョ浉鍚屾柟寮忓鐞嗭紝涓嶈繃涓嶇敤榪欎釜鐨勮瘽鍒濇澶勭悊鏃犳墍璋撲簡(jiǎn)銆?br /><br />濂戒簡(jiǎn)錛屽彲浠ュ皾璇曚綘鐨勭涓嬈racle榪炴帴涔嬫梾浜?jiǎn)锛堟槸鎴戠?#8230;…錛?img src ="http://www.shnenglu.com/sh19871122/aggbug/204860.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/sh19871122/" target="_blank">Hallelujah</a> 2013-12-17 20:16 <a href="http://www.shnenglu.com/sh19871122/archive/2013/12/17/204860.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item></channel></rss> <footer> <div class="friendship-link"> <p>感谢您访问我们的网站,您可能还对以下资源感兴趣:</p> <a href="http://www.shnenglu.com/" title="精品视频久久久久">精品视频久久久久</a> <div class="friend-links"> </div> </div> </footer> <a href="http://www.help0.cn" target="_blank">久久丝袜精品中文字幕</a>| <a href="http://www.shangzhew.cn" target="_blank">99精品国产免费久久久久久下载</a>| <a href="http://www.njw2008.cn" target="_blank">亚洲国产精品久久久久久</a>| <a href="http://www.up2me.cn" target="_blank">久久精品无码免费不卡</a>| <a href="http://www.changchun8.cn" target="_blank">久久久久久精品免费免费自慰</a>| <a href="http://www.yyyart.cn" target="_blank">97久久香蕉国产线看观看</a>| <a href="http://www.lglmhdf.cn" target="_blank">久久强奷乱码老熟女</a>| <a href="http://www.zgktjj.cn" target="_blank">91精品国产综合久久精品</a>| <a href="http://www.rz2.com.cn" target="_blank">伊人久久大香线蕉综合网站</a>| <a href="http://www.lkzcchj1.cn" target="_blank">国产精品久久网</a>| <a href="http://www.jrlxcc.cn" target="_blank">亚洲国产精品无码成人片久久</a>| <a href="http://www.taozhenyuan.cn" target="_blank">亚洲国产精品久久久久婷婷软件</a>| <a href="http://www.uj60.cn" target="_blank">精品熟女少妇AV免费久久</a>| <a href="http://www.fwrld.cn" target="_blank">国产成人精品久久</a>| <a href="http://www.zghzmj.com.cn" target="_blank">国内精品久久久久伊人av</a>| <a href="http://www.meisj88.cn" target="_blank">中文精品99久久国产 </a>| <a href="http://www.010law.cn" target="_blank">伊人久久免费视频</a>| <a href="http://www.pzjqfa.cn" target="_blank">国产亚洲美女精品久久久2020</a>| <a href="http://www.csmfy.cn" target="_blank">精品无码人妻久久久久久</a>| <a href="http://www.njcsggs.cn" target="_blank">国产精品久久久久无码av</a>| <a href="http://www.lutengjiaju.cn" target="_blank">国产成人精品综合久久久</a>| <a href="http://www.jiletu.cn" target="_blank">亚洲七七久久精品中文国产</a>| <a href="http://www.geigi.cn" target="_blank">狠狠色伊人久久精品综合网 </a>| <a href="http://www.expo2006sy.com.cn" target="_blank">欧美一区二区三区久久综合</a>| <a href="http://www.83601.com.cn" target="_blank">久久精品中文字幕第23页</a>| <a href="http://www.zzjinhua.cn" target="_blank">www.久久精品</a>| <a href="http://www.h5982.cn" target="_blank">精品久久久久久亚洲</a>| <a href="http://www.1860host.cn" target="_blank">久久久久亚洲AV成人片 </a>| <a href="http://www.renshushu.cn" target="_blank">久久久精品波多野结衣</a>| <a href="http://www.u18718.cn" target="_blank">色偷偷888欧美精品久久久</a>| <a href="http://www.qkmp4.cn" target="_blank">97久久综合精品久久久综合</a>| <a href="http://www.ailazi.com.cn" target="_blank">久久天天躁狠狠躁夜夜网站 </a>| <a href="http://www.ningxue520.cn" target="_blank">久久久青草青青国产亚洲免观</a>| <a href="http://www.donglianggc.cn" target="_blank">久久国产乱子伦免费精品</a>| <a href="http://www.rezhei.cn" target="_blank">久久亚洲日韩精品一区二区三区</a>| <a href="http://www.r10211.cn" target="_blank">亚洲欧美日韩中文久久</a>| <a href="http://www.jtlyr.cn" target="_blank">国产成人精品三上悠亚久久 </a>| <a href="http://www.40theft.cn" target="_blank">欧美精品国产综合久久</a>| <a href="http://www.jnxlt.cn" target="_blank">99精品国产综合久久久久五月天</a>| <a href="http://www.sh-bz.com.cn" target="_blank">97久久国产综合精品女不卡</a>| <a href="http://www.sowudi.com.cn" target="_blank">中文字幕乱码人妻无码久久</a>| <script> (function(){ var bp = document.createElement('script'); var curProtocol = window.location.protocol.split(':')[0]; if (curProtocol === 'https') { bp.src = 'https://zz.bdstatic.com/linksubmit/push.js'; } else { bp.src = 'http://push.zhanzhang.baidu.com/push.js'; } var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(bp, s); })(); </script> </body>