下面说说split函数的用法
def break_words(stuff):
"""This function will break up words for us."""
words = stuff.split(' ')#split('.',1) use '.' split one time
return words
def sort_words(wo...
分类:
编程语言 时间:
2014-06-08 18:19:21
阅读次数:
336
异步模型看起来很美,但其实它也是有天生缺陷的.看下面代码
try {
setTimeout( function(){
throw new Error( '你抓不到我的!' );
}, 100);
} catch (e) {
console.error(e);
}
如果你已经理解了上一篇博客,那你一定了解了这样的写法是捕...
分类:
编程语言 时间:
2014-06-08 14:54:17
阅读次数:
328
Python一维数组初始化:>>> list=[]>>>
type(list)>>> list[]Python二维数组初始化:>>> lists = [[]] *
3>>> lists[[], [], []]>>> lists[0].append(3)>>>
lists[[3], [3], [3]]...
分类:
编程语言 时间:
2014-06-07 23:49:56
阅读次数:
563
获取标题,当点击时弹窗 $(document).ready(function(){ var
options = { chart: { plotBackgroundColor: null, plotBorderWidth: null,
plotShadow: fal...
分类:
其他好文 时间:
2014-06-07 23:49:15
阅读次数:
395
# -*- coding: utf-8 -*- import socket import
sys port = 80 host = sys.argv[1] filename = sys.argv[2] soc =
socket.socket(socket.AF_INET, socket....
分类:
编程语言 时间:
2014-06-07 23:43:22
阅读次数:
320
之前美丽湾项目是用赢家写的替换方法,替换数据时,无法深度遍历,这里修改一下方法: 1
function tempExt(h, data) { 2 return h.replace(/\{(.*?)\}/g, function (str, m) {
3 ...
分类:
其他好文 时间:
2014-06-07 23:05:37
阅读次数:
231
用Python求均值与方差,可以自己写,也可以借助于numpy,不过到底哪个快一点呢?我做了个实验,首先生成9百万个样本:```pythonnlist=range(0,9000000)nlist=[float(i)/1000000
for i in nlist]N=len(nlist)```第二行是...
分类:
编程语言 时间:
2014-06-07 22:48:05
阅读次数:
1623
var myLayer = cc.Layer.extend({ init:function()
{//2 界面 var bRet = false; if (this._super()) { bRet = true; } ...
分类:
Web程序 时间:
2014-06-07 22:13:30
阅读次数:
324
Although apply and call can implement same
function. However, there is a litter different between them.Please pay attention
to look at the examples be...
分类:
移动开发 时间:
2014-06-07 21:53:15
阅读次数:
331
The usage of bind is to define a specified
scope for called function. Because the key this is easy to refer another objet,
experically window, instead...
分类:
其他好文 时间:
2014-06-07 21:28:07
阅读次数:
307