锘??xml version="1.0" encoding="utf-8" standalone="yes"?>在线看片欧美,久久亚洲综合色,小黄鸭视频精品导航http://m.shnenglu.com/unixfy/just do itzh-cnTue, 16 Sep 2025 09:49:41 GMTTue, 16 Sep 2025 09:49:41 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>
            国产精品一区久久久| 亚洲欧洲一区二区三区| 一本一本大道香蕉久在线精品| 欧美精品久久一区二区| 午夜精品在线看| 久久免费精品日本久久中文字幕| 日韩视频―中文字幕| 亚洲欧美在线免费| 亚洲欧洲日韩女同| 亚洲自啪免费| 亚洲精品在线免费观看视频| 亚洲欧美影音先锋| 亚洲高清久久| 午夜久久影院| 一区二区日韩免费看| 久久精品视频免费| 性欧美暴力猛交另类hd| 欧美精品在线免费| 欧美91福利在线观看| 国产精品视频| 亚洲日本aⅴ片在线观看香蕉| 国产亚洲午夜| 亚洲天堂av在线免费观看| 亚洲国产精品成人综合色在线婷婷| 国产精品99久久久久久有的能看 | 欧美国产亚洲精品久久久8v| 国产精品网站视频| 99视频精品在线| 亚洲片在线资源| 久久久精彩视频| 欧美在线观看视频在线| 欧美视频在线观看免费| 亚洲人成在线播放网站岛国| 亚洲高清不卡一区| 午夜精品久久一牛影视| 亚洲欧美日韩国产| 欧美日韩一区三区四区| 亚洲精品国产日韩| 99成人免费视频| 免费在线观看精品| 国产一区二区0| 亚洲免费在线视频一区 二区| 一区二区冒白浆视频| 欧美xx69| 亚洲成人在线视频网站| 亚洲大片在线观看| 噜噜噜躁狠狠躁狠狠精品视频 | 国产精品爽黄69| 一区二区免费在线播放| 中文亚洲视频在线| 欧美视频一区在线| 亚洲性夜色噜噜噜7777| 欧美在线高清| 日韩视频一区二区三区| 久久在线观看视频| 欧美日韩爆操| 日韩视频二区| 亚洲永久免费精品| 国产精品久久久久免费a∨| 亚洲私人影院| 久久激情五月激情| 狠狠狠色丁香婷婷综合久久五月| 欧美专区中文字幕| 麻豆亚洲精品| 亚洲六月丁香色婷婷综合久久| 欧美激情精品久久久久久大尺度| 亚洲激情偷拍| 亚洲欧美日韩网| 国内精品久久久久影院色| 久久精品欧洲| 91久久久久久久久| 亚洲欧美一区二区三区极速播放| 国产精品亚洲欧美| 久久久久国产精品www| 亚洲缚视频在线观看| 一区二区三区四区五区在线| 国产欧美精品在线| 美日韩精品视频| 亚洲手机成人高清视频| 欧美成人免费全部观看天天性色| 日韩一区二区福利| 国产欧美视频一区二区| 嫩草成人www欧美| 亚洲香蕉成视频在线观看| 久久夜色精品亚洲噜噜国产mv| 亚洲黄色影院| 国产精品国产精品| 久久网站热最新地址| 日韩视频免费| 久久伊人一区二区| 亚洲一区在线观看视频 | 宅男精品导航| 免费欧美网站| 午夜在线a亚洲v天堂网2018| 揄拍成人国产精品视频| 欧美日韩一区二区免费在线观看 | 亚洲欧美一区二区视频| 136国产福利精品导航| 国产精品xxxav免费视频| 久久久999| 亚洲免费视频一区二区| 亚洲黄色免费| 久久阴道视频| 欧美在线播放高清精品| 国产精品美女xx| 久热精品视频| 午夜影视日本亚洲欧洲精品| 亚洲欧洲精品一区| 久久综合狠狠综合久久激情| 亚洲视屏在线播放| 亚洲精品久久久一区二区三区| 国产一区二区三区久久久| 欧美日本高清| 免费在线看成人av| 久久精品91| 欧美亚洲视频在线看网址| 日韩视频一区二区| 亚洲国产专区| 亚洲成人资源网| 麻豆精品传媒视频| 久久精选视频| 久久精品一区二区三区四区| 亚洲欧美日韩另类精品一区二区三区| 亚洲片区在线| 亚洲精选在线观看| 亚洲老司机av| 最新热久久免费视频| 在线日韩av永久免费观看| 国产亚洲永久域名| 国产午夜精品一区二区三区欧美| 国产精品久久久久久久9999| 欧美久久久久久| 欧美精品福利在线| 欧美激情aⅴ一区二区三区| 欧美jizz19性欧美| 欧美成人视屏| 欧美二区乱c少妇| 欧美大学生性色视频| 欧美成人综合| 欧美老女人xx| 欧美日韩一区综合| 国产精品国产三级国产普通话99 | 欧美福利专区| 欧美激情久久久久久| 欧美国产成人精品| 欧美激情区在线播放| 亚洲国产成人tv| 亚洲激情成人| 日韩视频三区| 亚洲综合三区| 久久精品一区蜜桃臀影院| 久久婷婷丁香| 欧美国产日韩一区二区| 欧美日韩另类字幕中文| 国产精品久久综合| 国产一区二区你懂的| 狠狠网亚洲精品| 亚洲激情偷拍| 中文高清一区| 欧美有码视频| 欧美高清视频一二三区| 亚洲精品乱码视频| 亚洲亚洲精品在线观看| 久久久久成人精品| 欧美日韩视频在线一区二区| 国产精品网站在线| 亚洲国产老妈| 国产精品99久久久久久www| 欧美中文在线视频| 欧美激情bt| 一区二区三区日韩在线观看| 欧美在线一二三| 欧美激情第8页| 国产精品日韩久久久久| 在线成人中文字幕| 亚洲天堂网站在线观看视频| 久久精品久久99精品久久| 欧美h视频在线| 日韩视频中文| 久久精品人人爽| 欧美三区在线观看| 一区精品在线| 亚洲一区在线播放| 一区二区三区精密机械公司| 欧美一区视频在线| 欧美国产欧美亚州国产日韩mv天天看完整| 亚洲精品一区二区三区99| 亚洲欧美日韩综合| 欧美—级在线免费片| 国产精品一区二区在线| 亚洲日本中文字幕免费在线不卡| 亚洲欧美国产精品专区久久| 欧美激情bt| 欧美伊人久久| 欧美视频在线观看 亚洲欧| 在线观看中文字幕不卡| 欧美一区二区三区四区视频| 91久久精品国产91久久性色| 性刺激综合网| 国产精品久久久久天堂|