1. 向列表的尾部添加一个新的元素 append(...) L.append(object) -- append object to end 1 2 3 4 >>> a = ['sam',24,'shaw'] >>> a.append('35') >>> a ['sam', 24, 'shaw', ...
分类:
编程语言 时间:
2016-05-16 14:23:11
阅读次数:
239
Given a nested list of integers, implement an iterator to flatten it.Each element is either an integer, or a list – whose elements may also be integers or other lists.Example 1:
Given the list [[1,1],...
分类:
其他好文 时间:
2016-05-16 13:02:27
阅读次数:
159
1.列表 list[起始:结尾:增量] 值传递与地址传递 2.排序sort() 3.匿名函数lambda 4....for ... in ... if ... 5.filter map reduce filter(function, sequence):对sequence中的item依次执行func ...
分类:
编程语言 时间:
2016-05-16 10:55:05
阅读次数:
220
在对待Redis时候,键和其他的事物之间有个相当重要的区别。键是在数据库中一段数据的唯一标识(可能String,List,Hash或者其他的Redis数据类型)。键是没有任何实质意义,就是一个简单的名字。进一步说:当处理集群或者分片系统时,它就是定义在包含数据的节点上的Key,所以对于命令传送来说k ...
分类:
其他好文 时间:
2016-05-16 10:40:26
阅读次数:
188
STL是英文是Standard Template Library的缩写即标准模板库。STL广义上分为容器(container)、迭代器(iterator)、算法(algorithm). 1.容器 (1)向量(vector) 连续存储的元素<vector> (2)列表(list) 由节点组成的双向链表 ...
分类:
其他好文 时间:
2016-05-16 01:45:34
阅读次数:
222
Hashtable表 数组、数组集合、List集合都是通过索引来访问里面成员。哈希表则是通过键来访问成员值。键不可为空,值可为空。 比如: Hashtable hash=new Hashtable(); hash.Add("one","chen"); hash.Add("two","li"); Co ...
报了一堆错误: 错误显示了源有问题,好像是被墙了。 查找解决办法,修改/etc/apt/source.list文件。将源改成163的或者阿里的: 但是source.list文件是只读的,修改不了。 要使用sudo gedit /etc/apt/source.list修改,但是gedit 指令没有装, ...
分类:
系统相关 时间:
2016-05-15 21:21:34
阅读次数:
1154
varlist=[];for(varoneofthis.state.themeDataList){varb=(<Listp_w_picpathUrl={Util.serverAddr+‘/p_w_picpath?id=‘+one[‘_id‘]}themeData={p_w_picpathList}key={one[‘_id‘]}></List>);list.push(b);}等同于list=[...this.state.themeDataList].map(a=><L..
分类:
其他好文 时间:
2016-05-15 19:52:39
阅读次数:
127