码迷,mamicode.com
首页 >  
搜索关键字:item    ( 12480个结果
python中有趣的函数
filter(function, sequence):对sequence中的item依次执行function(item),将执行结果为True的item组成一个List/String/Tuple(取决于sequence的类型)返回:>>> def f(x): return x % 2 != 0 an...
分类:编程语言   时间:2014-07-15 08:41:24    阅读次数:292
Android ListView的item点击无响应的解决方法
Android listview里的item布局文件中的焦点错乱问题。...
分类:移动开发   时间:2014-07-14 20:47:41    阅读次数:266
memcached几个容易被忽略但非常有用的命令
Memcached从1.2.4版本新增CAS(Check and Set)协议,用于处理同一个ITEM(key-value)被多个session更新修改时的数据一致性问题。 你曾经是否也有想知道memcached里面都存了哪些数据的需求,你是否也曾经在寻找一个方法能像redis一样可以遍历memcached所有的key...
分类:其他好文   时间:2014-07-14 17:12:19    阅读次数:226
Effective C++ Item 46 需要类型转换时请为模板定义非成员函数
经验:当我们编写一个 class template, 而它所提供之"与此 template 相关的"函数支持"所有参数之隐式类型转换"时,请将那些函数定义为 "class template内部的 friend 函数"。 示例: template class Rational{ public: Rational(const T &numerator = 0, const T &denominator = 1) // Item 20 对于自定义类型以passed by referenc...
分类:编程语言   时间:2014-07-14 13:52:39    阅读次数:173
Effective C++ Item 40 明智而审慎地使用多重继承
经验:多重继承比单一继承复杂。它可能导致新的歧义性,以及对 virtual 继承的需要 示例: class BorrowableItem{ public: void checkOut(); }; class ElectronicGadget{ private: bool checkOut() const; }; class MP3Player: public BorrowableItem public ElectronicGadget {...}; MP3Player mp; mp.checkOut...
分类:编程语言   时间:2014-07-14 13:38:11    阅读次数:240
Effective C++ Item 43 学习处理模板化基类内的名称
经验:可在derived class templates 内通过 "this->" 指涉 base class templates 内的成员名称,或藉由一个明白写出的 "base class 资格修饰符"完成。 示例: class CompanyA{ public: //... void sendCleartext(const std::string &msg); void sendEncrypted(const std::string &msg); //... }; class Company...
分类:编程语言   时间:2014-07-14 13:20:25    阅读次数:263
Effective C++ Item 41 了解隐式接口和编译期多态
经验:class 和 templates 都支持接口和多态。 对 classes 而言接口是显式的,以函数签名为中心。多态则是通过 virtual 函数发生于运行期 对 templates 参数而言,接口是隐式的,奠基于有效表达式。多态则是通过 templates 具体化和函数重载解析(function overloading resolution)发生于编译期。 示例1:显式接口和运行期多态 class Widget{ public: Widget(); virtual ~Widget(); vir...
分类:编程语言   时间:2014-07-14 12:54:57    阅读次数:195
Effective C++ Item 42 了解 typename 的双重意义
经验:声明 template 参数时,前缀关键字 class 和 typename 可互换。请使用关键字 typename 标识嵌套从属类型名称; 示例1: template void print2nd(const C &container){ C::const_iterator *x;//歧义。如果const_iterator是个static成员变量,x是个global 变量,这里的 *就是乘 //... } 示例2: template void pr...
分类:编程语言   时间:2014-07-14 11:06:02    阅读次数:206
【scrapy】Item Pipeline
After an item has been scraped by a spider,it is sent to the Item Pipeline which process it through several components that are executed sequentially....
分类:其他好文   时间:2014-07-14 00:20:06    阅读次数:323
堆排序及其相关操作
这里记录下堆的相关操作。 op 1: ''' @ data: the heap array @ p : index of parent item @ n : number of data @@ Swap p and it's son items, make p the largest of them ''' def swapForMaxHeap(data, n, p): l...
分类:其他好文   时间:2014-07-13 17:07:15    阅读次数:223
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!