数学函数绝对值 abs()圆周率 PI()平方根 sqrt()模除取余
mod(被除数,除数)随机数 rand()四舍五入 round(数字)次方 pow(5,2)e为底的指数函数 exp(数字)字符串函数字符长度
length(字符)字符连接 concat(字符1,字...
分类:
数据库 时间:
2014-05-18 20:05:37
阅读次数:
469
1.根据要求创建列表threes_and_fives(列表值包括1到15中能够被3或者5正常的数)threes_and_fives=[x
for x in range(1,16) if x%3==0 or x%5==0]2.lambda表达式实例(剔除掉列表中的”X“)garbled =
"IXXX...
分类:
编程语言 时间:
2014-05-18 19:48:23
阅读次数:
397
Given a stringS, find the longest palindromic
substring inS. You may assume that the maximum length ofSis 1000, and there
exists one unique longest pa...
分类:
其他好文 时间:
2014-05-18 19:39:55
阅读次数:
355
【题目】
Given an array and a value, remove all instances of that value in place and return the new length.
The order of elements can be changed. It doesn't matter what you leave beyond the new length.
【题意】
删除数组中指定的值。不关心在新数组的后面即数组尾部留下了什么值。
【思路】
思路同Remo...
分类:
其他好文 时间:
2014-05-18 14:53:56
阅读次数:
208
【题目】
You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without any intervening characters.
For example, given:
S:...
分类:
其他好文 时间:
2014-05-18 08:31:48
阅读次数:
228
[ sed简介: ]
sed是一个很好的文件处理工具, 它本身是一个管道命令, 以行为单位进行处理, 可以用于对数据行进行新增、选取、替换、删除等操作。
sed命令行格式:sed [-nefri] 'range command' file
[ sed工作流程: ]
使用vim这种屏幕编辑器编辑一个文件的时候, 我们需要把这个文件打开, 这里存在两个问题:
1. 打开一个比较大的文件会消耗很多内存。
2. 我们无法写脚本调用vim来编辑文件, 但是sed可以通过写脚本编辑文件。...
分类:
系统相关 时间:
2014-05-18 06:53:12
阅读次数:
551
创建 Array 对象的语法:var array = []; var array new
Array();var array new Array(size); // length = sizevar array new Array(element0,
element1, ..., elementn)...
分类:
编程语言 时间:
2014-05-18 02:22:39
阅读次数:
314
Given an unsorted array of integers, find the
length of the longest consecutive elements sequence.For example,Given[100, 4,
200, 1, 3, 2],The longest ...
分类:
其他好文 时间:
2014-05-18 01:52:45
阅读次数:
317
//扩展方法$.GM.Format = function (source, params) { if
(arguments.length == 1) return function () { var args = $.makeArra...
分类:
Web程序 时间:
2014-05-17 21:49:16
阅读次数:
333
Vim替换----------------------------------------------------------substitute命令:
:[range]s/from/to/[flags]from替换成to指定的字符串(from可为正则表达式,to可为空)range:范围,可以通过....
分类:
其他好文 时间:
2014-05-17 20:45:07
阅读次数:
510