锘??xml version="1.0" encoding="utf-8" standalone="yes"?>在线成人黄色,国产午夜精品一区二区三区视频,欧美午夜剧场http://m.shnenglu.com/unixfy/just do itzh-cnSun, 16 Nov 2025 19:27:44 GMTSun, 16 Nov 2025 19:27:44 GMT60鍗氬閲嶅畾鍚戣嚦 http://www.cnblogs.com/unixfyhttp://m.shnenglu.com/unixfy/archive/2013/09/14/203237.htmlunixfyunixfySat, 14 Sep 2013 15:49:00 GMThttp://m.shnenglu.com/unixfy/archive/2013/09/14/203237.htmlhttp://m.shnenglu.com/unixfy/comments/203237.htmlhttp://m.shnenglu.com/unixfy/archive/2013/09/14/203237.html#Feedback0http://m.shnenglu.com/unixfy/comments/commentRss/203237.htmlhttp://m.shnenglu.com/unixfy/services/trackbacks/203237.html


鍗氬閲嶅畾鍚戣嚦


http://www.cnblogs.com/unixfy






unixfy 2013-09-14 23:49 鍙戣〃璇勮
]]>
lower_bound and upper_boundhttp://m.shnenglu.com/unixfy/archive/2013/05/30/200701.htmlunixfyunixfyThu, 30 May 2013 12:55:00 GMThttp://m.shnenglu.com/unixfy/archive/2013/05/30/200701.htmlhttp://m.shnenglu.com/unixfy/comments/200701.htmlhttp://m.shnenglu.com/unixfy/archive/2013/05/30/200701.html#Feedback0http://m.shnenglu.com/unixfy/comments/commentRss/200701.htmlhttp://m.shnenglu.com/unixfy/services/trackbacks/200701.htmlSTL algorithm 涓殑 lower_bound and upper_bound

lower_bound 榪斿洖鐨勭粨鏋?>= 鍙傛暟 value
upper_bound 榪斿洖鐨勭粨鏋?> 鍙傛暟 value

鍏蜂綋鏄庣粏鍙弬瑙佺櫨縐?br />lower_bound錛?a >http://baike.baidu.cn/view/4720650.htm
upper_bound錛?a >http://baike.baidu.cn/view/4163451.htm

嫻嬭瘯浠g爜錛?
 1 #include <iostream>
 2 #include <set>
 3 #include <algorithm>
 4 using namespace std;
 5 
 6 int main()
 7 {
 8     set<int> si;
 9     //cout << si.insert(3) << endl;
10     cout << *(si.insert(3).first) << endl;
11     
12     for (int i = 1; i <= 10; i += 2)
13     {
14         si.insert(i);
15     }
16     for (set<int>::const_iterator cit = si.begin(); cit != si.end(); ++cit)
17     {
18         cout << *cit << ' ';
19     }
20     cout << endl;
21     
22     cout << endl;
23     cout << *lower_bound(si.begin(), si.end(), 3<< endl;
24     cout << *lower_bound(si.begin(), si.end(), 4<< endl;
25     cout << *lower_bound(si.begin(), si.end(), 5<< endl;
26     cout << *lower_bound(si.begin(), si.end(), 6<< endl;
27     
28     cout << endl;
29     cout << *upper_bound(si.begin(), si.end(), 3<< endl;
30     cout << *upper_bound(si.begin(), si.end(), 4<< endl;
31     cout << *upper_bound(si.begin(), si.end(), 5<< endl;
32     cout << *upper_bound(si.begin(), si.end(), 6<< endl;
33     
34     system("PAUSE");
35 }
36 

杈撳嚭錛?br />

3
1 3 5 7 9

3
5
5
7

5
5
7
7




unixfy 2013-05-30 20:55 鍙戣〃璇勮
]]>
瀛愮被鍖栧垪琛?/title><link>http://m.shnenglu.com/unixfy/archive/2013/05/21/200459.html</link><dc:creator>unixfy</dc:creator><author>unixfy</author><pubDate>Tue, 21 May 2013 14:14:00 GMT</pubDate><guid>http://m.shnenglu.com/unixfy/archive/2013/05/21/200459.html</guid><wfw:comment>http://m.shnenglu.com/unixfy/comments/200459.html</wfw:comment><comments>http://m.shnenglu.com/unixfy/archive/2013/05/21/200459.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/unixfy/comments/commentRss/200459.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/unixfy/services/trackbacks/200459.html</trackback:ping><description><![CDATA[<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; width: 98%; background-color: #eeeeee"><!--<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">class</span><span style="color: #000000"> CounterList(list):<br /></span><span style="color: #008080"> 2</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> </span><span style="color: #800080">__init__</span><span style="color: #000000">(self, </span><span style="color: #000000">*</span><span style="color: #000000">args):<br /></span><span style="color: #008080"> 3</span> <span style="color: #000000">        super(CounterList, self).</span><span style="color: #800080">__init__</span><span style="color: #000000">(</span><span style="color: #000000">*</span><span style="color: #000000">args)<br /></span><span style="color: #008080"> 4</span> <span style="color: #000000">        self.counter </span><span style="color: #000000">=</span><span style="color: #000000"> 0<br /></span><span style="color: #008080"> 5</span> <span style="color: #000000"><br /></span><span style="color: #008080"> 6</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> </span><span style="color: #800080">__getitem__</span><span style="color: #000000">(self, index):<br /></span><span style="color: #008080"> 7</span> <span style="color: #000000">        self.counter </span><span style="color: #000000">+=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000"><br /></span><span style="color: #008080"> 8</span> <span style="color: #000000">        </span><span style="color: #0000ff">return</span><span style="color: #000000"> super(CounterList, self).</span><span style="color: #800080">__getitem__</span><span style="color: #000000">(index)<br /></span><span style="color: #008080"> 9</span> <span style="color: #000000"><br /></span><span style="color: #008080">10</span> <span style="color: #000000"><br /></span><span style="color: #008080">11</span> <span style="color: #000000">cl </span><span style="color: #000000">=</span><span style="color: #000000"> CounterList(range(</span><span style="color: #000000">10</span><span style="color: #000000">))<br /></span><span style="color: #008080">12</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(cl)<br /></span><span style="color: #008080">13</span> <span style="color: #000000">cl.reverse()<br /></span><span style="color: #008080">14</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(cl)<br /></span><span style="color: #008080">15</span> <span style="color: #000000"></span><span style="color: #0000ff">del</span><span style="color: #000000">(cl[</span><span style="color: #000000">3</span><span style="color: #000000">:</span><span style="color: #000000">6</span><span style="color: #000000">])<br /></span><span style="color: #008080">16</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(cl)<br /></span><span style="color: #008080">17</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(cl.counter)<br /></span><span style="color: #008080">18</span> <span style="color: #000000">cl[</span><span style="color: #000000">4</span><span style="color: #000000">] </span><span style="color: #000000">+</span><span style="color: #000000"> cl[</span><span style="color: #000000">2</span><span style="color: #000000">]<br /></span><span style="color: #008080">19</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(cl.counter)</span></div><br />杈撳嚭錛?br />>>> <br />[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]<br />[9, 8, 7, 6, 5, 4, 3, 2, 1, 0]<br />[9, 8, 7, 3, 2, 1, 0]<br />0<br />2<img src ="http://m.shnenglu.com/unixfy/aggbug/200459.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/unixfy/" target="_blank">unixfy</a> 2013-05-21 22:14 <a href="http://m.shnenglu.com/unixfy/archive/2013/05/21/200459.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>瀹炵幇涓涓棤絀峰簭鍒?/title><link>http://m.shnenglu.com/unixfy/archive/2013/05/21/200457.html</link><dc:creator>unixfy</dc:creator><author>unixfy</author><pubDate>Tue, 21 May 2013 14:03:00 GMT</pubDate><guid>http://m.shnenglu.com/unixfy/archive/2013/05/21/200457.html</guid><wfw:comment>http://m.shnenglu.com/unixfy/comments/200457.html</wfw:comment><comments>http://m.shnenglu.com/unixfy/archive/2013/05/21/200457.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/unixfy/comments/commentRss/200457.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/unixfy/services/trackbacks/200457.html</trackback:ping><description><![CDATA[<div style="font-size: 13px; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; border-bottom: #cccccc 1px solid; word-break: break-all; padding-bottom: 4px; padding-top: 4px; padding-left: 4px; border-left: #cccccc 1px solid; padding-right: 5px; width: 98%; background-color: #eeeeee"><!--<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><span style="color: #000000"> checkIndex(key):<br /></span><span style="color: #008080"> 2</span> <span style="color: #000000">    </span><span style="color: #0000ff">if</span><span style="color: #000000"> </span><span style="color: #0000ff">not</span><span style="color: #000000"> isinstance(key, (int,)):<br /></span><span style="color: #008080"> 3</span> <span style="color: #000000">        </span><span style="color: #0000ff">raise</span><span style="color: #000000"> TypeError<br /></span><span style="color: #008080"> 4</span> <span style="color: #000000">    </span><span style="color: #0000ff">if</span><span style="color: #000000"> key </span><span style="color: #000000"><</span><span style="color: #000000"> 0:<br /></span><span style="color: #008080"> 5</span> <span style="color: #000000">        </span><span style="color: #0000ff">raise</span><span style="color: #000000"> IndexError<br /></span><span style="color: #008080"> 6</span> <span style="color: #000000"><br /></span><span style="color: #008080"> 7</span> <span style="color: #000000"></span><span style="color: #0000ff">class</span><span style="color: #000000"> ArithmeticSequence:<br /></span><span style="color: #008080"> 8</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> </span><span style="color: #800080">__init__</span><span style="color: #000000">(self, start </span><span style="color: #000000">=</span><span style="color: #000000"> 0, step </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000">):<br /></span><span style="color: #008080"> 9</span> <span style="color: #000000">        self.start </span><span style="color: #000000">=</span><span style="color: #000000"> start<br /></span><span style="color: #008080">10</span> <span style="color: #000000">        self.step  </span><span style="color: #000000">=</span><span style="color: #000000"> step<br /></span><span style="color: #008080">11</span> <span style="color: #000000">        self.changed </span><span style="color: #000000">=</span><span style="color: #000000"> {}<br /></span><span style="color: #008080">12</span> <span style="color: #000000"><br /></span><span style="color: #008080">13</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> </span><span style="color: #800080">__getitem__</span><span style="color: #000000">(self, key):<br /></span><span style="color: #008080">14</span> <span style="color: #000000"><br /></span><span style="color: #008080">15</span> <span style="color: #000000">        checkIndex(key)<br /></span><span style="color: #008080">16</span> <span style="color: #000000"><br /></span><span style="color: #008080">17</span> <span style="color: #000000">        </span><span style="color: #0000ff">print</span><span style="color: #000000">(</span><span style="color: #800000">'</span><span style="color: #800000">__getitem__</span><span style="color: #800000">'</span><span style="color: #000000">)<br /></span><span style="color: #008080">18</span> <span style="color: #000000"><br /></span><span style="color: #008080">19</span> <span style="color: #000000">        </span><span style="color: #0000ff">try</span><span style="color: #000000">:<br /></span><span style="color: #008080">20</span> <span style="color: #000000">            </span><span style="color: #0000ff">return</span><span style="color: #000000"> self.changed[key]<br /></span><span style="color: #008080">21</span> <span style="color: #000000">        </span><span style="color: #0000ff">except</span><span style="color: #000000"> KeyError:<br /></span><span style="color: #008080">22</span> <span style="color: #000000">            </span><span style="color: #0000ff">return</span><span style="color: #000000"> self.start </span><span style="color: #000000">+</span><span style="color: #000000"> key </span><span style="color: #000000">*</span><span style="color: #000000"> self.step<br /></span><span style="color: #008080">23</span> <span style="color: #000000"><br /></span><span style="color: #008080">24</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> </span><span style="color: #800080">__setitem__</span><span style="color: #000000">(self, key, value):<br /></span><span style="color: #008080">25</span> <span style="color: #000000"><br /></span><span style="color: #008080">26</span> <span style="color: #000000">        checkIndex(key)<br /></span><span style="color: #008080">27</span> <span style="color: #000000"><br /></span><span style="color: #008080">28</span> <span style="color: #000000">        </span><span style="color: #0000ff">print</span><span style="color: #000000">(</span><span style="color: #800000">'</span><span style="color: #800000">__setitem__</span><span style="color: #800000">'</span><span style="color: #000000">)<br /></span><span style="color: #008080">29</span> <span style="color: #000000"><br /></span><span style="color: #008080">30</span> <span style="color: #000000">        self.changed[key] </span><span style="color: #000000">=</span><span style="color: #000000"> value<br /></span><span style="color: #008080">31</span> <span style="color: #000000"><br /></span><span style="color: #008080">32</span> <span style="color: #000000"><br /></span><span style="color: #008080">33</span> <span style="color: #000000">s </span><span style="color: #000000">=</span><span style="color: #000000"> ArithmeticSequence(</span><span style="color: #000000">1</span><span style="color: #000000">, </span><span style="color: #000000">2</span><span style="color: #000000">)<br /></span><span style="color: #008080">34</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(s[</span><span style="color: #000000">4</span><span style="color: #000000">])<br /></span><span style="color: #008080">35</span> <span style="color: #000000">s[</span><span style="color: #000000">4</span><span style="color: #000000">] </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">2</span><span style="color: #000000"><br /></span><span style="color: #008080">36</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(s[</span><span style="color: #000000">4</span><span style="color: #000000">])<br /></span><span style="color: #008080">37</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(s[</span><span style="color: #000000">5</span><span style="color: #000000">])<br /></span><span style="color: #008080">38</span> <span style="color: #000000">s[</span><span style="color: #000000">3</span><span style="color: #000000">] </span><span style="color: #000000">=</span><span style="color: #000000"> </span><span style="color: #000000">100</span><span style="color: #000000"><br /></span><span style="color: #008080">39</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(s[</span><span style="color: #000000">3</span><span style="color: #000000">])<br /></span><span style="color: #008080">40</span> <span style="color: #000000">s.</span><span style="color: #800080">__setitem__</span><span style="color: #000000">(</span><span style="color: #000000">100</span><span style="color: #000000">, </span><span style="color: #000000">3</span><span style="color: #000000">)<br /></span><span style="color: #008080">41</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(s.</span><span style="color: #800080">__getitem__</span><span style="color: #000000">(</span><span style="color: #000000">100</span><span style="color: #000000">))</span></div><br />杈撳嚭錛?br />>>> <br />__getitem__<br />9<br />__setitem__<br />__getitem__<br />2<br />__getitem__<br />11<br />__setitem__<br />__getitem__<br />100<br />__setitem__<br />__getitem__<br />3<img src ="http://m.shnenglu.com/unixfy/aggbug/200457.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/unixfy/" target="_blank">unixfy</a> 2013-05-21 22:03 <a href="http://m.shnenglu.com/unixfy/archive/2013/05/21/200457.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Python 緇ф壙-瀹炵幇涓涓繃婊ゅ櫒http://m.shnenglu.com/unixfy/archive/2013/05/19/200391.htmlunixfyunixfySun, 19 May 2013 03:39:00 GMThttp://m.shnenglu.com/unixfy/archive/2013/05/19/200391.htmlhttp://m.shnenglu.com/unixfy/comments/200391.htmlhttp://m.shnenglu.com/unixfy/archive/2013/05/19/200391.html#Feedback0http://m.shnenglu.com/unixfy/comments/commentRss/200391.htmlhttp://m.shnenglu.com/unixfy/services/trackbacks/200391.html 1 class Filter:
 2     def init(self):
 3         self.blocked = []
 4     def filter(self, sequence):
 5         return [x for x in sequence if x not in self.blocked]
 6 
 7 class SPAMFilter(Filter): # SPAMFilter 鏄?nbsp;Filter 鐨勫瓙綾?/span>
 8     def init(self):
 9         self.blocked = ['SPAM']
10 
11 = Filter()
12 f.init()
13 print(f.filter([123]))
14 
15 = SPAMFilter()
16 s.init()
17 print(s.filter(['SPAM''SPAM''SPAM''SPAM''eggs''bacon''SPAM']))
杈撳嚭錛?br />>>>
[1, 2, 3]
['eggs', 'bacon']

unixfy 2013-05-19 11:39 鍙戣〃璇勮
]]>
Python 涓被鐨勯潤鎬佹垚鍛樹笌鏅氭垚鍛?/title><link>http://m.shnenglu.com/unixfy/archive/2013/05/18/200381.html</link><dc:creator>unixfy</dc:creator><author>unixfy</author><pubDate>Sat, 18 May 2013 08:43:00 GMT</pubDate><guid>http://m.shnenglu.com/unixfy/archive/2013/05/18/200381.html</guid><wfw:comment>http://m.shnenglu.com/unixfy/comments/200381.html</wfw:comment><comments>http://m.shnenglu.com/unixfy/archive/2013/05/18/200381.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/unixfy/comments/commentRss/200381.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/unixfy/services/trackbacks/200381.html</trackback:ping><description><![CDATA[<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<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">class</span><span style="color: #000000"> MemberCounter:<br /></span><span style="color: #008080"> 2</span> <span style="color: #000000">    member </span><span style="color: #000000">=</span><span style="color: #000000"> 0<br /></span><span style="color: #008080"> 3</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> init(self):<br /></span><span style="color: #008080"> 4</span> <span style="color: #000000">        self.member </span><span style="color: #000000">+=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000"><br /></span><span style="color: #008080"> 5</span> <span style="color: #000000">        MemberCounter.member </span><span style="color: #000000">+=</span><span style="color: #000000"> </span><span style="color: #000000">1</span><span style="color: #000000"><br /></span><span style="color: #008080"> 6</span> <span style="color: #000000"><br /></span><span style="color: #008080"> 7</span> <span style="color: #000000">m1 </span><span style="color: #000000">=</span><span style="color: #000000"> MemberCounter()<br /></span><span style="color: #008080"> 8</span> <span style="color: #000000">m1.init()<br /></span><span style="color: #008080"> 9</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(m1.member)<br /></span><span style="color: #008080">10</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(MemberCounter.member)<br /></span><span style="color: #008080">11</span> <span style="color: #000000"><br /></span><span style="color: #008080">12</span> <span style="color: #000000">m2 </span><span style="color: #000000">=</span><span style="color: #000000"> MemberCounter()<br /></span><span style="color: #008080">13</span> <span style="color: #000000">m2.init()<br /></span><span style="color: #008080">14</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(m2.member)<br /></span><span style="color: #008080">15</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(MemberCounter.member)<br /></span><span style="color: #008080">16</span> <span style="color: #000000"><br /></span><span style="color: #008080">17</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(m1.member </span><span style="color: #0000ff">is</span><span style="color: #000000"> m2.member)<br /></span><span style="color: #008080">18</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(m1.member </span><span style="color: #0000ff">is</span><span style="color: #000000"> MemberCounter.member)<br /></span><span style="color: #008080">19</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(m2.member </span><span style="color: #0000ff">is</span><span style="color: #000000"> MemberCounter.member)<br /></span><span style="color: #008080">20</span> <span style="color: #000000"><br /></span><span style="color: #008080">21</span> <span style="color: #000000">m3 </span><span style="color: #000000">=</span><span style="color: #000000"> MemberCounter()<br /></span><span style="color: #008080">22</span> <span style="color: #000000">m3.init()<br /></span><span style="color: #008080">23</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(m3.member)<br /></span><span style="color: #008080">24</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(MemberCounter.member)<br /></span><span style="color: #008080">25</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(m2.member </span><span style="color: #0000ff">is</span><span style="color: #000000"> MemberCounter.member)<br /></span><span style="color: #008080">26</span> <span style="color: #000000"><br /></span><span style="color: #008080">27</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(m1.member)<br /></span><span style="color: #008080">28</span> <span style="color: #000000"></span><span style="color: #0000ff">print</span><span style="color: #000000">(MemberCounter.member)</span></div> <div><br />杈撳嚭錛?br />>>> <br />1<br />1<br />2<br />2<br />False<br />False<br />True<br />3<br />3<br />False<br />1<br />3</div><img src ="http://m.shnenglu.com/unixfy/aggbug/200381.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/unixfy/" target="_blank">unixfy</a> 2013-05-18 16:43 <a href="http://m.shnenglu.com/unixfy/archive/2013/05/18/200381.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Python 縐佹湁鎴愬憳鐨勮闂?/title><link>http://m.shnenglu.com/unixfy/archive/2013/05/18/200380.html</link><dc:creator>unixfy</dc:creator><author>unixfy</author><pubDate>Sat, 18 May 2013 08:31:00 GMT</pubDate><guid>http://m.shnenglu.com/unixfy/archive/2013/05/18/200380.html</guid><wfw:comment>http://m.shnenglu.com/unixfy/comments/200380.html</wfw:comment><comments>http://m.shnenglu.com/unixfy/archive/2013/05/18/200380.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://m.shnenglu.com/unixfy/comments/commentRss/200380.html</wfw:commentRss><trackback:ping>http://m.shnenglu.com/unixfy/services/trackbacks/200380.html</trackback:ping><description><![CDATA[<div style="border-bottom: #cccccc 1px solid; border-left: #cccccc 1px solid; padding-bottom: 4px; background-color: #eeeeee; padding-left: 4px; width: 98%; padding-right: 5px; font-size: 13px; word-break: break-all; border-top: #cccccc 1px solid; border-right: #cccccc 1px solid; padding-top: 4px"><!--<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: #800080">__metaclass__</span><span style="color: #000000"> </span><span style="color: #000000">=</span><span style="color: #000000"> type </span><span style="color: #008000">#</span><span style="color: #008000"> 紜畾浣跨敤鏂板紡綾?/span><span style="color: #008000"><br /></span><span style="color: #008080"> 2</span> <span style="color: #008000"></span><span style="color: #000000"><br /></span><span style="color: #008080"> 3</span> <span style="color: #000000"></span><span style="color: #0000ff">class</span><span style="color: #000000"> Person:<br /></span><span style="color: #008080"> 4</span> <span style="color: #000000"><br /></span><span style="color: #008080"> 5</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> setName(self, name):<br /></span><span style="color: #008080"> 6</span> <span style="color: #000000">        self.name </span><span style="color: #000000">=</span><span style="color: #000000"> name<br /></span><span style="color: #008080"> 7</span> <span style="color: #000000"><br /></span><span style="color: #008080"> 8</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> getName(self):<br /></span><span style="color: #008080"> 9</span> <span style="color: #000000">        </span><span style="color: #0000ff">return</span><span style="color: #000000"> self.name<br /></span><span style="color: #008080">10</span> <span style="color: #000000"><br /></span><span style="color: #008080">11</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> greet(self):<br /></span><span style="color: #008080">12</span> <span style="color: #000000">        </span><span style="color: #0000ff">print</span><span style="color: #000000">(</span><span style="color: #800000">"</span><span style="color: #800000">Hello, world! I'm %s.</span><span style="color: #800000">"</span><span style="color: #000000"> </span><span style="color: #000000">%</span><span style="color: #000000"> self.name)<br /></span><span style="color: #008080">13</span> <span style="color: #000000"><br /></span><span style="color: #008080">14</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> </span><span style="color: #800080">__foo</span><span style="color: #000000">(self):<br /></span><span style="color: #008080">15</span> <span style="color: #000000">        </span><span style="color: #0000ff">print</span><span style="color: #000000">(</span><span style="color: #800000">"</span><span style="color: #800000">FOO</span><span style="color: #800000">"</span><span style="color: #000000">, self.name)<br /></span><span style="color: #008080">16</span> <span style="color: #000000">    </span><span style="color: #0000ff">def</span><span style="color: #000000"> _bar(self):<br /></span><span style="color: #008080">17</span> <span style="color: #000000">        </span><span style="color: #0000ff">print</span><span style="color: #000000">(</span><span style="color: #800000">"</span><span style="color: #800000">BAR</span><span style="color: #800000">"</span><span style="color: #000000">, self.name)<br /></span><span style="color: #008080">18</span> <span style="color: #000000"><br /></span><span style="color: #008080">19</span> <span style="color: #000000"><br /></span><span style="color: #008080">20</span> <span style="color: #000000">foo </span><span style="color: #000000">=</span><span style="color: #000000"> Person()<br /></span><span style="color: #008080">21</span> <span style="color: #000000">bar </span><span style="color: #000000">=</span><span style="color: #000000"> Person()<br /></span><span style="color: #008080">22</span> <span style="color: #000000">foo.setName(</span><span style="color: #800000">'</span><span style="color: #800000">Luke Skywalker</span><span style="color: #800000">'</span><span style="color: #000000">)<br /></span><span style="color: #008080">23</span> <span style="color: #000000">bar.setName(</span><span style="color: #800000">'</span><span style="color: #800000">Anakin Skywalker</span><span style="color: #800000">'</span><span style="color: #000000">)<br /></span><span style="color: #008080">24</span> <span style="color: #000000">foo.greet()<br /></span><span style="color: #008080">25</span> <span style="color: #000000">bar.greet()<br /></span><span style="color: #008080">26</span> <span style="color: #000000">Person.greet(bar)<br /></span><span style="color: #008080">27</span> <span style="color: #000000"><br /></span><span style="color: #008080">28</span> <span style="color: #000000"></span><span style="color: #008000">#</span><span style="color: #008000"> foo.__foo()</span><span style="color: #008000"><br /></span><span style="color: #008080">29</span> <span style="color: #008000"></span><span style="color: #000000">foo._Person__foo()<br /></span><span style="color: #008080">30</span> <span style="color: #000000">foo._bar()<br /></span><span style="color: #008080">31</span> <span style="color: #000000"></span><span style="color: #008000">#</span><span style="color: #008000"> foo._Person_bar()</span></div><br />杈撳嚭錛?br />>>> <br />Hello, world! I'm Luke Skywalker.<br />Hello, world! I'm Anakin Skywalker.<br />Hello, world! I'm Anakin Skywalker.<br />FOO Luke Skywalker<br />BAR Luke Skywalker<img src ="http://m.shnenglu.com/unixfy/aggbug/200380.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://m.shnenglu.com/unixfy/" target="_blank">unixfy</a> 2013-05-18 16:31 <a href="http://m.shnenglu.com/unixfy/archive/2013/05/18/200380.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>鑷畾涔?Python range 鍑芥暟 2http://m.shnenglu.com/unixfy/archive/2013/05/18/200375.htmlunixfyunixfySat, 18 May 2013 06:32:00 GMThttp://m.shnenglu.com/unixfy/archive/2013/05/18/200375.htmlhttp://m.shnenglu.com/unixfy/comments/200375.htmlhttp://m.shnenglu.com/unixfy/archive/2013/05/18/200375.html#Feedback0http://m.shnenglu.com/unixfy/comments/commentRss/200375.htmlhttp://m.shnenglu.com/unixfy/services/trackbacks/200375.html 1 def my_range_2(start, stop = None, step = 1):
 2     if stop == None:
 3         if start > 0:
 4             start, stop = 0, start
 5         else:
 6             start, stop = start, 0
 7     result = []
 8     if step > 0 and start < stop:
 9         i = start
10         while (i < stop):
11             result.append(i)
12             i += step
13     elif step < 0 and start > stop:
14         i = start
15         while i > stop:
16             result.append(i)
17             i += step
18     return result
19 
20 print(my_range_2(10))
21 print(my_range_2(5202))
22 print(my_range_2(110))
23 print(my_range_2(10, 0, -1))
24 print(my_range_2(100, 0, -9))
25 print(my_range_2(1020-5))
26 
27 print(my_range_2(100, 0, -10))
28 print(my_range_2(-10))
29 print(my_range_2(-10-51))
30 print(my_range_2(-10-201))
31 print(my_range_2(-50-45))
>>>
[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
[5, 7, 9, 11, 13, 15, 17, 19]
[1, 2, 3, 4, 5, 6, 7, 8, 9]
[10, 9, 8, 7, 6, 5, 4, 3, 2, 1]
[100, 91, 82, 73, 64, 55, 46, 37, 28, 19, 10, 1]
[]
[100, 90, 80, 70, 60, 50, 40, 30, 20, 10]
[-10, -9, -8, -7, -6, -5, -4, -3, -2, -1]
[-10, -9, -8, -7, -6]
[]
[-50, -49, -48, -47, -46]

unixfy 2013-05-18 14:32 鍙戣〃璇勮
]]>
Python 閫掑綊浜屽垎鏌ユ壘http://m.shnenglu.com/unixfy/archive/2013/05/16/200337.htmlunixfyunixfyThu, 16 May 2013 14:24:00 GMThttp://m.shnenglu.com/unixfy/archive/2013/05/16/200337.htmlhttp://m.shnenglu.com/unixfy/comments/200337.htmlhttp://m.shnenglu.com/unixfy/archive/2013/05/16/200337.html#Feedback0http://m.shnenglu.com/unixfy/comments/commentRss/200337.htmlhttp://m.shnenglu.com/unixfy/services/trackbacks/200337.html 1 def search(sequence, number, lower = 0, upper = None):
 2     if upper is None:
 3         upper = len(sequence) - 1
 4     if lower == upper:
 5         assert(number == sequence[upper])
 6         return upper
 7     else:
 8         middle = (lower + upper) // 2
 9         if number > sequence[middle]:
10             return search(sequence, number, middle + 1, upper)
11         else:
12             return search(sequence, number, lower, middle)
13 
14 seq = [34678123410095]
15 print(seq)
16 seq.sort()
17 print(seq)
18 print(search(seq, 34))
19 print(search(seq, 100))
杈撳嚭錛?br />[34, 67, 8, 123, 4, 100, 95]
[4, 8, 34, 67, 95, 100, 123]
2
5

unixfy 2013-05-16 22:24 鍙戣〃璇勮
]]>
浣曚負闂寘http://m.shnenglu.com/unixfy/archive/2013/05/16/200336.htmlunixfyunixfyThu, 16 May 2013 13:18:00 GMThttp://m.shnenglu.com/unixfy/archive/2013/05/16/200336.htmlhttp://m.shnenglu.com/unixfy/comments/200336.htmlhttp://m.shnenglu.com/unixfy/archive/2013/05/16/200336.html#Feedback0http://m.shnenglu.com/unixfy/comments/commentRss/200336.htmlhttp://m.shnenglu.com/unixfy/services/trackbacks/200336.html 1 def multiplier(factor):
 2     def multiply_by_factor(number):
 3         return number * factor
 4     return multiply_by_factor
 5 
 6 
 7 double = multiplier(2# factor = 2
 8 print(double(5))       # number = 5
 9 triple = multiplier(3# factor = 3
10 print(triple(4))       # number = 4
11 print(multiplier(5)(4))# factor = 5, number = 4
杈撳嚭錛?br />>>>
10
12
20

unixfy 2013-05-16 21:18 鍙戣〃璇勮
]]>
青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            91久久精品国产91久久性色| 亚洲黄色片网站| 国产一区二区主播在线| 欧美黄色免费网站| 久久精品三级| 欧美一区二区三区久久精品| 亚洲午夜在线观看视频在线| 99精品福利视频| 99在线|亚洲一区二区| 亚洲精品国产拍免费91在线| 亚洲国产欧美国产综合一区| 亚洲素人在线| 制服丝袜亚洲播放| 亚洲午夜久久久| 一本色道久久综合亚洲二区三区| 亚洲精品免费在线播放| 亚洲激情国产| 国产午夜亚洲精品理论片色戒| 国产精品一区二区黑丝| 国产日韩精品一区| 精品成人乱色一区二区| 亚洲六月丁香色婷婷综合久久| 欧美大片一区| 久久激情视频免费观看| 麻豆精品精华液| 欧美视频中文一区二区三区在线观看| 国产精品久久二区二区| 狠色狠色综合久久| 亚洲精品黄网在线观看| 欧美色图麻豆| 性xx色xx综合久久久xx| 久久黄色级2电影| 欧美日韩精品免费观看| 国产一区亚洲一区| 一区二区成人精品| 老司机成人网| 午夜精品美女自拍福到在线 | 性欧美1819sex性高清| 美女免费视频一区| 国产日韩视频一区二区三区| aa级大片欧美| 欧美不卡视频一区发布| 香蕉久久夜色精品国产| 国产精品久久久久毛片大屁完整版| 亚洲国产99精品国自产| 久久精品国产第一区二区三区最新章节 | 狠狠v欧美v日韩v亚洲ⅴ| 亚洲深夜av| 亚洲国产日韩欧美在线动漫| 欧美中文字幕不卡| 国产精品夜夜嗨| 亚洲欧美美女| 99国产精品久久久久久久成人热| 免费成人性网站| 在线免费观看日韩欧美| 久久久国产精彩视频美女艺术照福利| 亚洲午夜视频在线观看| 国产精品视频成人| 久久国产欧美| 久久久精品一区| 亚洲第一页自拍| 亚洲丰满在线| 欧美精品免费视频| 宅男在线国产精品| 一区二区av在线| 国产精品理论片| 欧美一区二区三区在线看| 亚洲永久字幕| 国产一区二区三区在线免费观看 | 亚洲免费精彩视频| 亚洲乱亚洲高清| 欧美日韩国产成人在线免费 | 久久精品30| 99ri日韩精品视频| 亚洲日韩欧美一区二区在线| 欧美成人情趣视频| 欧美黑人多人双交| 亚洲一区二区在线看| 亚洲欧美成人一区二区三区| 国产午夜精品在线观看| 免费亚洲电影| 欧美日韩国产一区精品一区| 亚洲一区二区在线观看视频| 欧美一级二级三级蜜桃| 亚洲高清资源| 亚洲精品美女91| 国产毛片精品国产一区二区三区| 久久久亚洲综合| 欧美激情成人在线| 亚洲一区二区黄| 欧美在线观看www| 亚洲欧洲日本mm| 亚洲桃色在线一区| 悠悠资源网亚洲青| 亚洲日韩欧美视频一区| 国产乱码精品| 91久久在线观看| 国产麻豆综合| 亚洲韩国日本中文字幕| 国产欧美一区二区白浆黑人| 亚洲承认在线| 国产午夜精品久久久| 亚洲片在线资源| 伊人成人网在线看| 亚洲在线观看视频| av成人黄色| 蜜月aⅴ免费一区二区三区 | 国产亚洲免费的视频看| 亚洲国产免费| 在线观看亚洲专区| 亚洲欧美一级二级三级| 在线亚洲欧美视频| 欧美www在线| 久久躁狠狠躁夜夜爽| 国产精品天天摸av网| 亚洲手机在线| 亚洲主播在线观看| 欧美日韩免费看| 亚洲国产婷婷| 亚洲国产清纯| 久久久久看片| 久久裸体艺术| 国内成+人亚洲| 欧美在线一区二区三区| 欧美综合国产| 国产午夜精品一区二区三区欧美 | 亚洲女同同性videoxma| 亚洲图片欧洲图片日韩av| 麻豆精品在线观看| 麻豆91精品| 极品裸体白嫩激情啪啪国产精品| 亚洲欧美日本国产有色| 亚洲欧美日韩区| 欧美在线一级va免费观看| 国产精品一区在线观看你懂的| 亚洲国产网站| 亚洲精品欧洲| 欧美国产日韩视频| 亚洲国产一区二区视频| 亚洲精品欧美一区二区三区| 欧美激情精品久久久久久蜜臀| 亚洲电影免费观看高清完整版在线 | 国产视频久久久久久久| 亚洲永久免费视频| 久久精品一区二区三区中文字幕| 国产日韩av高清| 久久精品日韩欧美| 欧美激情中文字幕一区二区| 亚洲日韩成人| 欧美性猛交xxxx乱大交蜜桃 | 99国产精品国产精品毛片| 欧美理论在线| 亚洲一级高清| 久久夜色精品亚洲噜噜国产mv| 在线成人av网站| 欧美激情在线| 一区二区三区四区蜜桃| 久久精品国产免费| 亚洲黄色三级| 国产精品国产一区二区| 久久国产毛片| 亚洲美女视频在线观看| 欧美一级精品大片| 亚洲精品老司机| 国产精品亚洲综合一区在线观看| 久久精品在线| 日韩视频永久免费| 久久久999精品| 亚洲美女福利视频网站| 国产精品夜夜夜| 免费看精品久久片| 亚洲免费中文| 亚洲国产日韩综合一区| 亚洲欧美www| 99re8这里有精品热视频免费 | 亚洲日本欧美| 国产日韩欧美a| 欧美啪啪成人vr| 欧美尤物一区| av不卡在线观看| 欧美a级在线| 欧美在线三级| 亚洲婷婷综合色高清在线 | 国产精品亚洲不卡a| 欧美电影电视剧在线观看| 午夜免费日韩视频| 亚洲麻豆av| 蜜臀91精品一区二区三区| 亚洲视频axxx| 亚洲国产色一区| 亚洲一区二区三区中文字幕| 国产尤物精品| 国产精品久线观看视频| 欧美日韩dvd在线观看| 久久午夜视频| 午夜欧美大片免费观看| 99香蕉国产精品偷在线观看| 欧美韩日高清| 男人插女人欧美| 久久性天堂网|