锘??xml version="1.0" encoding="utf-8" standalone="yes"?>在线看片欧美,久久亚洲综合色,小黄鸭视频精品导航http://www.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://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>
            亚洲一区二区三区精品视频| 亚洲欧洲日本一区二区三区| 亚洲欧美国产视频| 99ri日韩精品视频| 国产精品美女www爽爽爽| 午夜一级久久| 欧美在线黄色| 91久久久国产精品| 日韩视频免费在线观看| 国产精品亚洲美女av网站| 欧美在线免费播放| 麻豆精品传媒视频| 亚洲小视频在线观看| 欧美一区二区三区四区在线观看地址| 国产综合一区二区| 亚洲激情国产精品| 国产精品捆绑调教| 欧美激情精品久久久久久黑人| 亚洲一区二区三区777| 欧美一级大片在线观看| 亚洲精品视频在线观看免费| 亚洲一二三区精品| 亚洲电影在线免费观看| 一片黄亚洲嫩模| 激情综合网址| 中文亚洲视频在线| 精品不卡在线| 一区二区三区国产| 亚洲日本va午夜在线电影| 中文一区在线| 亚洲日本欧美天堂| 欧美一站二站| 亚洲综合色丁香婷婷六月图片| 久久精品国产亚洲一区二区| 一区二区三区成人| 久久夜色精品国产| 欧美资源在线观看| 欧美巨乳波霸| 欧美激情一二三区| 国产嫩草一区二区三区在线观看 | 国产精品每日更新| 欧美成人一区二区三区| 国产欧亚日韩视频| 在线看日韩欧美| 亚洲免费在线看| 一区二区三区欧美成人| 欧美jizz19性欧美| 久久影视三级福利片| 国产精品香蕉在线观看| 夜夜嗨av一区二区三区免费区| 亚洲国产二区| 久久一综合视频| 久久综合九色综合欧美就去吻| 国产欧美日韩激情| 亚洲视频一区二区在线观看| 99国产精品视频免费观看| 久久五月天婷婷| 美女精品自拍一二三四| 国内精品一区二区三区| 亚洲欧美区自拍先锋| 亚洲欧美日韩天堂| 国产精品极品美女粉嫩高清在线| 亚洲人成小说网站色在线| 亚洲品质自拍| 欧美日本不卡| 这里是久久伊人| 亚洲免费在线视频| 国产精品露脸自拍| 午夜天堂精品久久久久| 久久精品一区| 曰韩精品一区二区| 欧美69wwwcom| 亚洲久久在线| 亚洲欧美色一区| 国产伦精品一区二区三区免费迷| 亚洲欧美在线一区二区| 久久精品国产久精国产一老狼| 国产亚洲欧美日韩一区二区| 久久精品国产第一区二区三区| 浪潮色综合久久天堂| 亚洲成在人线av| 欧美男人的天堂| 亚洲在线一区二区三区| 久久久久久亚洲综合影院红桃| 影音先锋日韩资源| 欧美精彩视频一区二区三区| 99精品免费| 久久亚洲一区二区三区四区| 亚洲国产精品一区制服丝袜| 欧美区在线播放| 午夜在线一区二区| 欧美激情视频在线播放| 亚洲少妇在线| 好吊色欧美一区二区三区四区| 蜜月aⅴ免费一区二区三区| av成人老司机| 久久中文精品| 亚洲一级黄色av| 在线观看国产精品淫| 欧美三区美女| 久久天天综合| 亚洲特级毛片| 亚洲黄色影院| 久久精品一区蜜桃臀影院| 亚洲另类在线视频| 国产一区二区三区在线观看网站 | 很黄很黄激情成人| 欧美日韩免费网站| 欧美亚洲视频一区二区| 亚洲欧洲免费视频| 久久亚洲私人国产精品va| 亚洲一区在线直播| 亚洲精品久久久久久久久| 国产精品视频精品视频| 欧美激情一区二区三区在线视频观看 | 老牛国产精品一区的观看方式| 亚洲精品乱码久久久久久按摩观| 欧美在线观看日本一区| 亚洲免费观看在线视频| 激情视频一区二区| 国产女人18毛片水18精品| 欧美日韩精品欧美日韩精品 | 亚洲午夜精品国产| 亚洲欧洲另类国产综合| 蘑菇福利视频一区播放| 欧美中文在线观看国产| 亚洲一区国产精品| 夜夜嗨网站十八久久| 亚洲风情亚aⅴ在线发布| 国产网站欧美日韩免费精品在线观看 | 性色一区二区三区| 亚洲视频综合在线| 一本到12不卡视频在线dvd| 亚洲电影av| 亚洲国产高清在线| 欧美国产欧美亚洲国产日韩mv天天看完整 | 久久精品国产精品| 久久国产99| 久久成人精品视频| 欧美一级淫片播放口| 亚洲欧美中文另类| 亚洲欧美高清| 欧美在线日韩在线| 久久精品国产亚洲一区二区| 久久se精品一区精品二区| 亚洲一区二区三区中文字幕| 亚洲视频一区| 午夜精品影院| 久久精品青青大伊人av| 久久久久青草大香线综合精品| 久久精品一本| 欧美成人自拍视频| 欧美韩国日本综合| 亚洲级视频在线观看免费1级| 亚洲国产高清一区二区三区| 亚洲精品乱码久久久久久| 一区二区毛片| 香蕉久久夜色精品国产使用方法 | 在线观看中文字幕亚洲| 在线成人h网| 亚洲日本中文字幕| 一区二区福利| 欧美在线看片a免费观看| 久久综合中文| 91久久精品国产| 亚洲私人影院| 久久久久国产精品一区| 欧美电影免费观看高清| 国产精品一区在线观看你懂的| 国产亚洲欧美一区二区| 亚洲第一伊人| 亚洲视频在线一区| 另类专区欧美制服同性| 最新日韩中文字幕| 午夜精品视频在线| 欧美肥婆在线| 国产人妖伪娘一区91| 亚洲国产高清aⅴ视频| 亚洲午夜久久久久久久久电影院| 午夜精品亚洲| 欧美国产成人精品| 亚洲无毛电影| 免费日韩精品中文字幕视频在线| 国产精品高潮呻吟久久av无限 | 欧美成ee人免费视频| 国产精品国产| 日韩午夜电影av| 久久精品伊人| 亚洲天堂男人| 欧美成人精品三级在线观看| 国产精品一区二区久久国产| 亚洲精品久久久久中文字幕欢迎你| 亚洲欧美日韩另类| 亚洲人成77777在线观看网| 欧美一区二区视频在线观看| 欧美日韩另类在线| 亚洲激情视频在线| 美女图片一区二区| 亚洲欧美一区二区三区极速播放| 欧美精品一级|