02 2012 档案
摘要:Makefile一:Makefile的规则:target...:prerequisites...command......target也就是一个目标文件,可以是ObjectFile,也可以是执行文件。还可以是一个标签(Label)prerequisites就是要生成那个target所需要的文件或是目标。command也就是make需要执行的命令。(任意的Shell命令)这是一个文件的依赖关系,也就是说target这一个或多个的目标文件依赖于prerequisites中的文件,其生成规则定义在command中。说白一点就是说,prerequisites中如果有一个以上的文件比target文件要新
阅读全文
摘要:bind()方法的其它用法发表于2011-08-19由adminbind()方法不仅能为元素绑定浏览器支持的具有相同名称的事件,也可以绑定自定义事件。不仅如此,bind()方法还能做很多的事情。1.绑定多个事件类型例如可以为元素一次性绑定多个事件类型。jQuery代码如下:$(function () { $("div").bind("mouseover mouseout", function () { $(this).toggleClass("over"); });})当光标插入div元素时,该元素的class切换为“over”;当光
阅读全文
摘要:编辑器加载中... 1 <html> 2 <head> 3 <!--get() 方法获得由选择器指定的 DOM 元素。--> 4 <script type = "text/javascript" src = "jquery.js"></script> 5 <script type = "text/javascript"> 6 $(document).ready(function(){ 7 $("button").click(function()
阅读全文
摘要:View Code 1 #-*- coding:utf8-*- 2 import time 3 start = time.time() 4 5 from urllib2 import Request,urlopen 6 from urllib import quote_plus 7 info='the flowers are on their way' 8 url='http://www.pythonchallenge.com/pc/stuff/violin.php' 9 req = Request(url, headers={'Cookie':
阅读全文
摘要:View Code 1 #-*- coding:utf8-*- 2 import time 3 start = time.time() 4 ''' 5 import xmlrpclib 6 7 server = xmlrpclib.ServerProxy("http://localhost:80") 8 9 words = server.sayHello()10 11 print "result:" + words12 '''13 import xmlrpclib14 server = xmlrpclib.
阅读全文
摘要:View Code 1 #-*- coding:utf8-*- 2 import time 3 start = time.time() 4 ''' 5 import xmlrpclib 6 7 server = xmlrpclib.ServerProxy("http://localhost:80") 8 9 words = server.sayHello()10 11 print "result:" + words12 '''13 import xmlrpclib14 server = xmlrpclib.
阅读全文
摘要:View Code 1 #-*- coding:utf8-*- 2 import time 3 start = time.time() 4 ''' 5 import xmlrpclib 6 7 server = xmlrpclib.ServerProxy("http://localhost:80") 8 9 words = server.sayHello()10 11 print "result:" + words12 '''13 import xmlrpclib14 server = xmlrpclib.
阅读全文
摘要:View Code 1 #-*- coding:utf8-*- 2 import time 3 start = time.time() 4 5 # Get the data from: http://www.pythonchallenge.com/pc/return/evil2.gfx 6 7 h = open("evil2.gfx", "rb") 8 data = h.read() 9 h.close()10 11 new_data = [[], [], [], [], []]12 n = 013 14 for byte in range(len(da
阅读全文
摘要:View Code 1 #-*- coding:utf8-*- 2 import time 3 start = time.time() 4 5 import Image 6 7 # download the image from: http://www.pythonchallenge.com/pc/return/cave.jpg 8 9 image = Image.open("cave.jpg")10 nsize = tuple([x / 2 for x in image.size])11 odd = even = Image.new(image.mode, nsize)1
阅读全文
摘要:1 #-*- coding:utf8-*- 2 import time 3 import re 4 start = time.time() 5 ''' 6 a = [1, 11, 21, 1211, 111221, 7 len(a[30]) = ? 8 ''' 9 10 def find_L(st):11 nums = re.findall(r'1+|2+|3+|',st)12 strs = ''13 for i in nums:14 if len(i):15 strs += str(len(i)) + i[0]1
阅读全文
摘要:#-*- coding:utf8-*-import timestart = time.time()#un: 'BZh91AY&SYA\xaf\x82\r\x00\x00\x01\x01\x80\x02\xc0\x02\x00 \x00!\x9ah3M\x07<]\xc9\x14\xe1BA\x06\xbe\x084'#pw: 'BZh91AY&SY\x94$|\x0e\x00\x00\x00\x81\x00\x03$ \x00!\x9ah3M\x13<]\xc9\x14\xe1BBP\x91\xf08''''b
阅读全文
摘要:1 #-*- coding:utf8-*- 2 import time 3 import Image 4 start = time.time() 5 #先将图片 oxygen.png 下载 6 import re, Image 7 8 i = Image.open("oxygen.png") # http://www.pythonchallenge.com/pc/def/oxygen.png 9 row = [i.getpixel((x, 45)) for x in range(0, i.size[0], 7)]10 print row11 ords = [r for r,
阅读全文
摘要:1 #-*- coding:utf8-*- 2 import time 3 import zipfile 4 import re 5 start = time.time() 6 ''' 7 学习 zipfile http://blog.csdn.net/jgood/article/details/4351911 8 ''' 9 '''10 welcome to my zipped list.11 12 hint1: start from 9005213 hint2: answer is inside the zip14 &
阅读全文
摘要:1 ''' 2 将banner.p下载 放在与程序同一文件夹下 3 ''' 4 fo = open("banner.p","r+") 5 #strs = pickle.dumps(fo.read()) 6 st = pickle.load(fo) 7 #print strs 8 for line in st: 9 print "".join([k*v for k,v in line])10 # channel
阅读全文
摘要:import restart = time.time()pattern = "and the next nothing is (\d+)"re_url = "http://www.pythonchallenge.com/pc/def/linkedlist.php?nothing="nothing = "6711"url = urlopen(re_url + nothing)strs = url.read()obj = re.search(pattern,strs)while obj: nothing = obj.group(1) ur
阅读全文
摘要:1 import re2 fo = open("4","r+")3 strs = fo.read()4 #print strs5 s = ''6 for res in re.findall(r'[a-z][A-Z]{3}([a-z])[A-Z]{3}[a-z]',strs):7 s += res8 print s 9 #xXXXxXXXx
阅读全文
摘要:fo = open("3","r+")print fo.name,fo.modestrs = fo.read()res = ''for x in strs: obj = re.match(r'[a-z]',x) if obj: res += obj.group()print res
阅读全文
摘要:strs = '''g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj.'''def change(strs): res = [] for x in strs: if x != '
阅读全文
摘要:print 2**38仅此而已 十分简单!
阅读全文
摘要:这是来到这里的第一篇文章 为了纪念 也为了开始!纪念我的红尘 开始我的一叶一花!
阅读全文

浙公网安备 33010602011771号