锘??xml version="1.0" encoding="utf-8" standalone="yes"?>在线成人黄色,国产午夜精品一区二区三区视频,欧美午夜剧场http://www.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://www.shnenglu.com/unixfy/archive/2013/09/14/203237.htmlunixfyunixfySat, 14 Sep 2013 15:49:00 GMThttp://www.shnenglu.com/unixfy/archive/2013/09/14/203237.htmlhttp://www.shnenglu.com/unixfy/comments/203237.htmlhttp://www.shnenglu.com/unixfy/archive/2013/09/14/203237.html#Feedback0http://www.shnenglu.com/unixfy/comments/commentRss/203237.htmlhttp://www.shnenglu.com/unixfy/services/trackbacks/203237.html


鍗氬閲嶅畾鍚戣嚦


http://www.cnblogs.com/unixfy






unixfy 2013-09-14 23:49 鍙戣〃璇勮
]]>
lower_bound and upper_boundhttp://www.shnenglu.com/unixfy/archive/2013/05/30/200701.htmlunixfyunixfyThu, 30 May 2013 12:55:00 GMThttp://www.shnenglu.com/unixfy/archive/2013/05/30/200701.htmlhttp://www.shnenglu.com/unixfy/comments/200701.htmlhttp://www.shnenglu.com/unixfy/archive/2013/05/30/200701.html#Feedback0http://www.shnenglu.com/unixfy/comments/commentRss/200701.htmlhttp://www.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://www.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://www.shnenglu.com/unixfy/archive/2013/05/21/200459.html</guid><wfw:comment>http://www.shnenglu.com/unixfy/comments/200459.html</wfw:comment><comments>http://www.shnenglu.com/unixfy/archive/2013/05/21/200459.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/unixfy/comments/commentRss/200459.html</wfw:commentRss><trackback:ping>http://www.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://www.shnenglu.com/unixfy/aggbug/200459.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/unixfy/" target="_blank">unixfy</a> 2013-05-21 22:14 <a href="http://www.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://www.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://www.shnenglu.com/unixfy/archive/2013/05/21/200457.html</guid><wfw:comment>http://www.shnenglu.com/unixfy/comments/200457.html</wfw:comment><comments>http://www.shnenglu.com/unixfy/archive/2013/05/21/200457.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/unixfy/comments/commentRss/200457.html</wfw:commentRss><trackback:ping>http://www.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://www.shnenglu.com/unixfy/aggbug/200457.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/unixfy/" target="_blank">unixfy</a> 2013-05-21 22:03 <a href="http://www.shnenglu.com/unixfy/archive/2013/05/21/200457.html#Feedback" target="_blank" style="text-decoration:none;">鍙戣〃璇勮</a></div>]]></description></item><item><title>Python 緇ф壙-瀹炵幇涓涓繃婊ゅ櫒http://www.shnenglu.com/unixfy/archive/2013/05/19/200391.htmlunixfyunixfySun, 19 May 2013 03:39:00 GMThttp://www.shnenglu.com/unixfy/archive/2013/05/19/200391.htmlhttp://www.shnenglu.com/unixfy/comments/200391.htmlhttp://www.shnenglu.com/unixfy/archive/2013/05/19/200391.html#Feedback0http://www.shnenglu.com/unixfy/comments/commentRss/200391.htmlhttp://www.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://www.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://www.shnenglu.com/unixfy/archive/2013/05/18/200381.html</guid><wfw:comment>http://www.shnenglu.com/unixfy/comments/200381.html</wfw:comment><comments>http://www.shnenglu.com/unixfy/archive/2013/05/18/200381.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/unixfy/comments/commentRss/200381.html</wfw:commentRss><trackback:ping>http://www.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://www.shnenglu.com/unixfy/aggbug/200381.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/unixfy/" target="_blank">unixfy</a> 2013-05-18 16:43 <a href="http://www.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://www.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://www.shnenglu.com/unixfy/archive/2013/05/18/200380.html</guid><wfw:comment>http://www.shnenglu.com/unixfy/comments/200380.html</wfw:comment><comments>http://www.shnenglu.com/unixfy/archive/2013/05/18/200380.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.shnenglu.com/unixfy/comments/commentRss/200380.html</wfw:commentRss><trackback:ping>http://www.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://www.shnenglu.com/unixfy/aggbug/200380.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.shnenglu.com/unixfy/" target="_blank">unixfy</a> 2013-05-18 16:31 <a href="http://www.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://www.shnenglu.com/unixfy/archive/2013/05/18/200375.htmlunixfyunixfySat, 18 May 2013 06:32:00 GMThttp://www.shnenglu.com/unixfy/archive/2013/05/18/200375.htmlhttp://www.shnenglu.com/unixfy/comments/200375.htmlhttp://www.shnenglu.com/unixfy/archive/2013/05/18/200375.html#Feedback0http://www.shnenglu.com/unixfy/comments/commentRss/200375.htmlhttp://www.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://www.shnenglu.com/unixfy/archive/2013/05/16/200337.htmlunixfyunixfyThu, 16 May 2013 14:24:00 GMThttp://www.shnenglu.com/unixfy/archive/2013/05/16/200337.htmlhttp://www.shnenglu.com/unixfy/comments/200337.htmlhttp://www.shnenglu.com/unixfy/archive/2013/05/16/200337.html#Feedback0http://www.shnenglu.com/unixfy/comments/commentRss/200337.htmlhttp://www.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://www.shnenglu.com/unixfy/archive/2013/05/16/200336.htmlunixfyunixfyThu, 16 May 2013 13:18:00 GMThttp://www.shnenglu.com/unixfy/archive/2013/05/16/200336.htmlhttp://www.shnenglu.com/unixfy/comments/200336.htmlhttp://www.shnenglu.com/unixfy/archive/2013/05/16/200336.html#Feedback0http://www.shnenglu.com/unixfy/comments/commentRss/200336.htmlhttp://www.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>
            毛片精品免费在线观看| 国产一区高清视频| 中文成人激情娱乐网| 亚洲精品国产精品乱码不99按摩 | 欧美日韩在线高清| 欧美高潮视频| 欧美日韩高清在线播放| 欧美日韩91| 国产精品久久久久av| 国产色婷婷国产综合在线理论片a| 国产酒店精品激情| 国内外成人免费视频 | 欧美高清视频在线播放| 欧美韩日高清| 亚洲高清影视| 一本色道久久综合亚洲精品按摩| 亚洲一区二区免费| 久久亚洲春色中文字幕久久久| 欧美成人免费大片| 国产精品男人爽免费视频1| 一区二区三区在线免费视频| 最新69国产成人精品视频免费| 亚洲色无码播放| 久久久亚洲一区| 亚洲经典三级| 亚洲欧美日韩直播| 亚洲私人黄色宅男| 夜夜嗨一区二区| 亚洲一区欧美一区| 免费人成精品欧美精品| 欧美色视频在线| 在线日韩av片| 香蕉久久夜色精品国产使用方法| 久久亚洲私人国产精品va| 裸体丰满少妇做受久久99精品| 久久久久久黄| 在线亚洲自拍| 欧美99在线视频观看| 国产欧美日韩在线视频| 一本色道久久综合亚洲精品婷婷| 久久久久久综合| 一本色道久久综合亚洲精品高清| 久久这里有精品视频| 欧美小视频在线观看| 亚洲精品无人区| 蜜桃av一区二区| 欧美一级大片在线观看| 国产精品劲爆视频| 亚洲私拍自拍| 亚洲精品日韩激情在线电影| 久久久中精品2020中文| 国产一区二区精品久久99| 亚洲一区二区在线免费观看| 亚洲国产成人porn| 久久嫩草精品久久久精品| 国产日韩欧美91| 欧美伊人久久久久久久久影院| 在线一区观看| 欧美午夜电影在线| 亚洲在线电影| 亚洲一区二区三区精品视频| 国产精品第一页第二页第三页| aa级大片欧美| 欧美成人激情视频| 久久美女性网| 亚洲国产精品一区二区久| 免费成人你懂的| 老司机午夜精品视频在线观看| 1000部精品久久久久久久久| 久久人人爽国产| 久久久精品日韩| 伊人精品成人久久综合软件| 久久综合九色综合久99| 久久免费国产精品| 亚洲美女毛片| 一本色道久久综合亚洲精品按摩| 国产精品女主播| 久久国产直播| 久热国产精品| 在线一区二区三区四区五区| 亚洲无线视频| 国产专区一区| 亚洲福利视频三区| 欧美日韩免费高清| 久久国产福利国产秒拍| 久久狠狠久久综合桃花| av不卡在线观看| 一区二区三区 在线观看视| 国产精品扒开腿做爽爽爽软件| 欧美在线观看视频在线| 麻豆精品视频在线| 亚洲校园激情| 久久久精品日韩| 一区二区三区欧美激情| 欧美一二三区精品| 一区二区高清视频在线观看| 亚洲欧美色婷婷| 亚洲国产美女| 亚洲欧美视频| 亚洲视频在线观看三级| 久久国产精品久久久久久电车| 亚洲精选国产| 欧美在线一级va免费观看| 亚洲免费电影在线观看| 久久国产婷婷国产香蕉| 亚洲午夜精品在线| 老司机一区二区三区| 欧美综合国产| 欧美日韩在线电影| 亚洲国产精品久久久久秋霞影院 | 亚洲国内自拍| 亚洲欧美日韩高清| 99国产精品99久久久久久粉嫩| 欧美亚洲综合另类| 亚洲夜间福利| 欧美成人高清| 久久精品视频在线播放| 国产精品白丝jk黑袜喷水| 欧美va天堂在线| 国产一区二区0| 亚洲午夜一区| 亚洲一级黄色av| 欧美精品精品一区| 欧美韩日一区二区三区| 狠狠久久亚洲欧美专区| 亚洲欧美日韩在线高清直播| 午夜精品福利在线观看| 欧美先锋影音| 日韩午夜av电影| 一本大道久久a久久综合婷婷| 麻豆精品一区二区av白丝在线| 久久精品一区二区三区不卡牛牛| 国产精品久久久久久av福利软件| 亚洲日本激情| 日韩午夜在线| 欧美精品黄色| 夜夜爽99久久国产综合精品女不卡| 亚洲三级色网| 欧美va天堂在线| 亚洲激情在线激情| 99国产麻豆精品| 欧美精品在线一区| 亚洲日本欧美天堂| 中日韩午夜理伦电影免费| 欧美精品一区二区三区很污很色的| 亚洲第一福利视频| 最新国产成人在线观看| 欧美激情亚洲另类| 日韩视频永久免费| 久久精品动漫| 亚洲综合色激情五月| 国产精品久久久久永久免费观看 | 巨胸喷奶水www久久久免费动漫| 久久国产精品网站| 好看的av在线不卡观看| 久久婷婷丁香| 亚洲电影中文字幕| 亚洲午夜久久久久久久久电影院| 国产精品久久久久久久9999| 亚洲欧美日韩另类精品一区二区三区| 校园激情久久| 国产亚洲精品久久久久动| 久久久www成人免费精品| 亚洲国产精品一区二区www在线 | 欧美h视频在线| 99这里只有久久精品视频| 亚洲午夜久久久| 激情五月***国产精品| 欧美第一黄色网| 亚洲欧美日韩专区| 欧美激情在线观看| 亚洲欧美日本精品| 亚洲风情在线资源站| 国产精品草莓在线免费观看| 欧美一区二区免费| 91久久国产精品91久久性色| 亚洲伊人伊色伊影伊综合网| 激情五月婷婷综合| 国产精品免费网站| 欧美激情一级片一区二区| 亚洲一级二级在线| 亚洲高清久久网| 久久久夜色精品亚洲| 亚洲伊人网站| 亚洲精品少妇30p| 国内精品一区二区三区| 欧美性jizz18性欧美| 免费欧美视频| 久久婷婷国产麻豆91天堂| 午夜在线精品| 宅男噜噜噜66国产日韩在线观看| 欧美ed2k| 久热精品在线视频| 欧美在线短视频| 亚洲综合色视频| 夜夜嗨一区二区三区| 亚洲激情专区| 国语自产精品视频在线看抢先版结局 | 久久久国产精品一区二区中文| 99国产精品视频免费观看|