码迷,mamicode.com
首页 >  
搜索关键字:python function    ( 188437个结果)
一入python深似海--split
下面说说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
JQuery日记6.5 Javascript异步模型(二)
异步模型看起来很美,但其实它也是有天生缺陷的.看下面代码 try { setTimeout( function(){ throw new Error( '你抓不到我的!' ); }, 100); } catch (e) { console.error(e); } 如果你已经理解了上一篇博客,那你一定了解了这样的写法是捕...
分类:编程语言   时间:2014-06-08 14:54:17    阅读次数:328
Python的二维数组
Python一维数组初始化:>>> list=[]>>> type(list)>>> list[]Python二维数组初始化:>>> lists = [[]] * 3>>> lists[[], [], []]>>> lists[0].append(3)>>> lists[[3], [3], [3]]...
分类:编程语言   时间:2014-06-07 23:49:56    阅读次数:563
highchart添加事件
获取标题,当点击时弹窗 $(document).ready(function(){ var options = { chart: { plotBackgroundColor: null, plotBorderWidth: null, plotShadow: fal...
分类:其他好文   时间:2014-06-07 23:49:15    阅读次数:395
python socket
# -*- 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计算均值方差
用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
cocos2d-html5 Layer 和 Scene 创建模式
var myLayer = cc.Layer.extend({ init:function() {//2 界面 var bRet = false; if (this._super()) { bRet = true; } ...
分类:Web程序   时间:2014-06-07 22:13:30    阅读次数:324
How to use the functions of apply and call
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
How to use the function of bind
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
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!