摘要:#!/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): ...
阅读全文
摘要:--字符串连接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/
阅读全文
摘要:#!/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,
阅读全文
摘要:#!/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
阅读全文