glob 是python 提供的一个支持正则表达式的查找文件的模块。实现上采用了os.listdir() 和 fnmatch.fnmatch(). 但是没有真的invoking a subshell.glob.glob(pathname) Return a possibly-empty lis...
分类:
编程语言 时间:
2015-01-13 19:25:25
阅读次数:
201
// 判断 0 与 ''、null、empty、false 之间的关系 $a = 0; echo "0 与 ''、 empty、null、false 之间的关系:"; if($a == ''){ echo "0 == '';"; }else{ echo "0 != '';"; }...
分类:
Web程序 时间:
2015-01-13 12:31:06
阅读次数:
104
分页是网站中比较常见的应用,django提供了一些类帮助管理分页的数据,这些类都位于django.core.paginator.py文件里面分页类构造函数classPaginator(object_list,per_page,orphans=0,allow_empty_first_page=True...
分类:
其他好文 时间:
2015-01-12 22:27:16
阅读次数:
140
Can’t use function return value in write context 意思是不能使用函数返回值作为输入参数,遇到这种问题一般有两种情况.1.两个函数嵌套,其中外层的函数不能使用内嵌的函数的返回值 如:1 <?php2 if (!empty(trim($name))) {....
分类:
其他好文 时间:
2015-01-12 19:04:18
阅读次数:
205
Implement wildcard pattern matching with support for '?' and '*'.
'?' Matches any single character.
'*' Matches any sequence of characters (including the empty sequence).
The matching should cover t...
分类:
其他好文 时间:
2015-01-12 16:39:22
阅读次数:
168
@1.empty() 删除匹配元素集合中所有的后代字节点元素; helloworld $("p").empty(); @2.remove([expr]) 接收参数表示删除指定的元素$("p").remove() 删除所有段落$("p").remove(".hel") 删除带有.hel类名的段落这个方...
分类:
Web程序 时间:
2015-01-12 15:57:06
阅读次数:
193
Given a string s consists of upper/lower-case alphabets and empty space characters '
', return the length of last word in the string.
If the last word does not exist, return 0.
Note: A word is...
分类:
其他好文 时间:
2015-01-12 13:03:03
阅读次数:
136
Compare two version numbers version1 and version1.
If version1 > version2 return 1, if version1 version2 return -1, otherwise return 0.
You may assume that the version strings are non-empty and co...
分类:
其他好文 时间:
2015-01-12 09:22:09
阅读次数:
126
本函数库共有 17 个函数gettype: 取得变量的类型。intval: 变量转成整数类型。doubleval: 变量转成倍浮点数类型。empty: 判断变量是否已配置。is_array: 判断变量类型是否为数组类型。is_double: 判断变量类型是否为倍浮点数类型。is_float: 判断....
分类:
其他好文 时间:
2015-01-11 17:23:41
阅读次数:
109
/* * 地图上半径内的经纬度 * @param lat 纬度 lon 经度 raidus 单位米 */ function getAround($lat,$lon,$raidus){ $raidus = empty($raidus)?3000:$r...
分类:
其他好文 时间:
2015-01-10 18:03:23
阅读次数:
218