1 把函数赋值给变量 >>> f = abs >>> f(-10) 102 高阶函数 def add(x, y, f): return f(x) + f(y)3 map 函数接收两个参数,一个是函数,一个是序列,传入的函数依次作用到序列的每个元素,并把结果作为新的list返回。 4 reduce。r ...
分类:
编程语言 时间:
2016-07-22 13:02:28
阅读次数:
179
深入for,while,foreach遍历 +Iterator publicclass Test3 { publicstaticvoid main(String[] args) { List l = new ArrayList(); l.add("世界你好!"); l.add("上海"); for ...
分类:
编程语言 时间:
2016-07-22 12:46:36
阅读次数:
154
import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import java.util.Set; import junit.framework.TestCas ...
分类:
编程语言 时间:
2016-07-22 11:30:46
阅读次数:
177
Linked List Cycle、 Linked List Cycle II、 Remove Nth Node from End of List、 Intersection of Two Linked Lists ...
分类:
其他好文 时间:
2016-07-22 08:48:10
阅读次数:
1332
Collection
├List
│├LinkedList
│├ArrayList
│└Vector
│ └Stack
└Set
Map
├Hashtable
├HashMap
└WeakHashMap
Collection接口
Collection是最基本的集合接口,一个Collection代表一组Object,即Collection的元素(E...
分类:
编程语言 时间:
2016-07-22 06:36:08
阅读次数:
210
Let's say we have a list of contacts, click each contact, we can render a new route to get the detail. Define the routers: path: '', --> here empty pa ...
分类:
其他好文 时间:
2016-07-22 06:30:36
阅读次数:
498
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 integ ...
分类:
其他好文 时间:
2016-07-22 01:09:03
阅读次数:
168
本篇博文是继续上篇博文MUI(2)。上面这幅图是博文MUI(1)中实现的效果,在博文MUI(1)中提到了2个页面,一个页面是index.html,另一个页面是index_list.html页面。上面这幅图中红色框子是index.html页面,蓝色框子是index_list.html页面。两个页面本来 ...
分类:
其他好文 时间:
2016-07-21 23:52:34
阅读次数:
564
例子(一个人可以有多个手机) 总结 1、SELECT是把操作源的指定元素放到一个新的集合中 2、SELECTMANY的操作可以看做是两步,第一步与SELECT差不多(生成多个List<Phone>),第二步IEnumerable的元素合并成一个(将List<List<Phone>>合并成新的、大的L ...
分类:
编程语言 时间:
2016-07-21 21:37:04
阅读次数:
148
使用Collections类的sort(),reverse(),shuffle()方法对集合中的元素进行顺序、倒序、随机排序操作 ...
分类:
编程语言 时间:
2016-07-21 21:34:24
阅读次数:
309