Python 中内置了filter()函数用于过滤序列。
用法:
filter()接收一个函数和一个序列。filter()把传入的函数依次作用于每个元素,然后根据返回值是True还是False决定保留还是丢弃该元素。demo:
1、在一个list中,删掉偶数,只保留奇数:#filter odd number in the list
def is_odd(n):
return n % 2...
分类:
编程语言 时间:
2015-06-30 22:00:09
阅读次数:
132
Description
Farmer John has gone to town to buy some farm supplies. Being a very efficient man, he always pays for his goods in such a way that the smallest number of coins changes hands, i.e., the...
分类:
其他好文 时间:
2015-06-30 18:32:13
阅读次数:
141
刚刚us的tech leader突然上线call我说,tidal job中有一个job挂掉了,让我帮忙看一下什么原因然后rerun 起来,一时间我晕晕乎乎的,就问tidal job number及error message,然后找到job 中调用的sp,及里面的参数,后来修改后,tidal job 是active状态了,但是不确定sp是否真的再跑,所以想找一个类似informatica或者nete...
分类:
其他好文 时间:
2015-06-30 16:31:26
阅读次数:
210
Lua中的数据类型:
Boolean
Number
String
Function
Print(type(“Hello world”)) àstring
Print(type(10*4.2)) ànumber
Print(type(print)) àfunction
Print(type(type)...
分类:
其他好文 时间:
2015-06-30 15:02:45
阅读次数:
99
dll:DynamicLinkLibrary.so:sharedobject认证:Authentication授权:Authorization审计:Audition(日志)prompt,命令提示符:命令:magicnumber:魔数shebang#!/bin/bash目录目录::文件,路径映射路径:从指定起始点到目的地所经过的位置路径是实现层次化文件管理的机制..
分类:
系统相关 时间:
2015-06-30 13:14:49
阅读次数:
206
Description
Farmer John goes to Dollar Days at The Cow Store and discovers an unlimited number of tools on sale. During his first visit, the tools are selling variously for $1, $2, and $3. Farmer J...
分类:
其他好文 时间:
2015-06-30 13:05:37
阅读次数:
119
The .Net framework has a number of technologies that allow you to create HTTP services such as Web Service, WCF and now Web API. There are a lot of ar...
problem:Write an algorithm to determine if a number is "happy".A happy number is a number defined by the following process: Starting with any positive...
分类:
移动开发 时间:
2015-06-30 12:24:56
阅读次数:
135
1.javascript的typeof返回哪些数据类型Object number function boolean underfind2.例举3种强制类型转换和2种隐式类型转换?强制(parseInt,parseFloat,number)隐式(== - ===)5.事件绑定和普通事件有什么区别时间绑...
分类:
其他好文 时间:
2015-06-30 12:15:54
阅读次数:
108
如果出现这种情况:? 1.查看 svn 的版本问题 在window-->Preferences-->Team-->SVN? SVN接口 选择一下? 具体可以查看图片? 2.安装了最新的subversion-1.8.1,eclipse里面使用svn会提示:svn: E210004: Number i...
分类:
其他好文 时间:
2015-06-30 11:00:04
阅读次数:
224