码迷,mamicode.com
首页 >  
搜索关键字:def    ( 28626个结果
从lambda到函数式编程
1 Object.send(:remove_const,'TRUE') 2 Object.send(:remove_const,'FALSE') 3 4 def to_integer(pro) 5 pro[-> n { n + 1 }][0] 6 end 7 8 def t...
分类:其他好文   时间:2015-02-01 23:16:58    阅读次数:272
Python学习之(二) Python多线程学习
多线程的一个实例#coding=utf-8#!/usr/bin/pythonimport time import thread def timer(no, interval): cnt = 0 while cnt<10: time.sleep(interval...
分类:编程语言   时间:2015-02-01 20:23:16    阅读次数:185
Scala初探(三)
11. curry化 def inject(arr:Array[Int],initial:Int)(operation: (Int,Int) => Int): Int ={ var carryOver = initial arr.foreach(element => carryOver = operation(carryOver,element)) carryOver } val ar...
分类:其他好文   时间:2015-02-01 16:14:36    阅读次数:235
Scala初探(二)
5. 单例模式 class Marker(val color: String){ //类中的任何代码段作为构造函数的一部分 println("Creating " + this) override def toString(): String = "marker color " + color } object MarkerFactory{ private val markers ...
分类:其他好文   时间:2015-02-01 16:13:46    阅读次数:202
pythonweb自动化测试
from selenium import webdriverimport time def capture(url, save_fn="capture.png"): browser = webdriver.Firefox() # Get local session of firefox bro...
分类:编程语言   时间:2015-02-01 14:44:47    阅读次数:211
python学习笔记(五) - 模块
一. 使用模块 引入sys模块,使用import #!/usr/bin/env python # -*- coding: utf-8 -*- ' a test module ' __author__ = 'Michael Liao' import sys def test(): args = sys.argv if len(args)==1: print...
分类:编程语言   时间:2015-02-01 10:53:18    阅读次数:231
Myeclipse重装后的必要配置
一、JDK位置每台机器同意多个jdk版本号存在,编译时选择须要使用的jdk就可以。MyEclipse—>Properties—>Java—>Installed JRES选择jdk位置二、文件编码①window—>preference—>general—>content type,展开每一项并在Def...
分类:系统相关   时间:2015-01-31 19:14:55    阅读次数:197
Pyqt 以OOP方式动画的效果改变自身窗体大小
代码: 1 # -*- coding:utf8 -*- 2 from PyQt4.QtGui import * 3 from PyQt4.QtCore import * 4 import sys 5 6 class ani(QWidget): 7 def __init__(self): 8...
分类:Windows程序   时间:2015-01-31 16:11:22    阅读次数:325
python property属性
能够检查參数,一直没注意这个语言特性,忽略了非常多细节,感谢 vitroxclass Person( object ): def __init__( self, name ): if not isinstance( name, str ): rais...
分类:编程语言   时间:2015-01-31 10:39:26    阅读次数:224
一天一段scala代码(四)
一天一段scala代码(四)        为了更好的驾驭spark,最近在学习scala语言特性,主要看《快学scala》,顺便把一些自己认为有用的代码记下来。 package examples object Example4 { def main(args: Array[String]) { //不可变Map val...
分类:其他好文   时间:2015-01-30 22:45:37    阅读次数:226
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!