昨天同事在review代码的时候,给我show了另一个同事写的神一样的python代码,基本上是list comprehension加巨复杂的filter,外加正则表达式,以及一个generator函数,并且在那个generator函数上还加了一个decorator,同事其实也写了几年python了...
分类:
其他好文 时间:
2014-07-06 16:08:45
阅读次数:
149
泛型也可以应用于接口,例如生成器(Generator),这是一种专门负责创建对象的类。实际上,这是工厂设计模式的一种应用。不过,当使用生成器创建新的对象时,它不需要任何参数,而工厂方法一般需要参数。也就是说,生成器无需额外的信息就知道如何创建新对象。 一般而言,一个生成器只定义一个方法,该方法...
分类:
编程语言 时间:
2014-07-03 19:23:20
阅读次数:
305
制作字体过程首先得下载一个位图制作工具Bitmap font generator,可以点击这里下载1、新建txt文件,输入字体里面包含的文字2、保存为utf-8格式:点击文件另存为,选择编码格式为UTF-83、打开下载的bitmap font软件,选择options->font settings,设...
分类:
其他好文 时间:
2014-07-03 19:06:08
阅读次数:
355
--mysql阅读收录-----------------2014/07/02# 复制相关:1. 解释基于语句的复制中怎样处理functions,triggers,events和auto_increment键Statement based replication with Stored Functio...
分类:
数据库 时间:
2014-07-02 15:11:08
阅读次数:
187
DAL:IUserDALnamespace Dal{ /// /// This interface is defined for user functions. /// public interface IUserDal { #region Retur...
分类:
其他好文 时间:
2014-07-01 00:43:02
阅读次数:
308
Swift’s API includes many functions and instance methods that reflect its functional programming heritage. A prime example is calledreduce.You can red...
分类:
移动开发 时间:
2014-07-01 00:27:22
阅读次数:
329
通过MyBatis Generator可逆向生成持久层的代码,与Spring实现无缝融合,本文是基于Intellij+Maven实现。...
分类:
数据库 时间:
2014-06-30 17:50:55
阅读次数:
906
本人自己录制的swift菜鸟入门,欢迎大家拍砖,有什么问题可以在这里留言。 主要内容: 函数定义与调用(Defining and Calling Functions) 函数参数与返回值(Function Parameters and Return Values) 函数参数名称(Function Parameter Names) 函数类型(Function Types) 函数嵌套(Nested Fu...
分类:
其他好文 时间:
2014-06-30 16:35:58
阅读次数:
235
Blocks are a way to define a block of code that you will use at a later time.Sometimes people refer to blocks as anonymous functions because they are ...
分类:
其他好文 时间:
2014-06-30 15:21:04
阅读次数:
220
Functions and Closures 函数和封闭性(闭包)Functions 函数的使用Swift中的函数定义和OC中有明显的差别了,使用func定义函数,在括号里定义參数和类型,用 -> 定义返回值类型func greet(name: String, day: String) -> Str...
分类:
其他好文 时间:
2014-06-29 19:26:28
阅读次数:
209