Goodspeed

导航

08 2012 档案

自己写的线程池
摘要:#!/usr/bin/python#coding=utf-8#http://docs.python.org/library/threading.htmlimport threading, time, randomfrom collections import dequeclass threadPool(object): def __init__(self, maxNum = 10): self.maxNum = maxNum self.deque = deque() def push(self, target, args = None): ... 阅读全文

posted @ 2012-08-20 17:30 Goodspeed 阅读(281) 评论(0) 推荐(0) 编辑

SQL Server 2012 TSQL增强
摘要:--字符串连接SELECT CONCAT('Hello','world',null,'2012')--字符串格式化--参考http://msdn.microsoft.com/en-US/library/c3s1ez6e.aspxSELECT FORMAT(GETDATE(),'g') --2012/8/10 14:12UNION ALLSELECT FORMAT(GETDATE(),'t') --14:13UNION ALLSELECT FORMAT(GETDATE(),'d') --2012/8/ 阅读全文

posted @ 2012-08-10 15:26 Goodspeed 阅读(307) 评论(0) 推荐(0) 编辑

Python容器数据类型——collections
摘要:#!/usr/bin/python#coding=utf-8#http://docs.python.org/library/collections.html#count对象 Only 2.7from collections import Counter#统计字母出现的次数Counter('hello world') Counter(['red', 'blue', 'red', 'green', 'blue', 'blue']) #小于等于0的会被忽略c = Counter(a=4, 阅读全文

posted @ 2012-08-06 13:58 Goodspeed 阅读(3764) 评论(0) 推荐(0) 编辑

Python文本常量和模板——string
摘要:#!/usr/bin/python#coding=utf-8#http://docs.python.org/library/string.htmlimport string#全部字母 abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZprint string.ascii_letters print string.letters #根据地域来的#全部小写字母 abcdefghijklmnopqrstuvwxyzprint string.ascii_lowercaseprint string.lowercase#全部大写字母 ABCDEFGHI 阅读全文

posted @ 2012-08-03 18:02 Goodspeed 阅读(1276) 评论(0) 推荐(0) 编辑