摘要: 这是来到这里的第一篇文章 为了纪念 也为了开始!纪念我的红尘 开始我的一叶一花! 阅读全文
posted @ 2012-02-10 18:02 lcyang 阅读(84) 评论(0) 推荐(1) 编辑
摘要: Makefile一:Makefile的规则:target...:prerequisites...command......target也就是一个目标文件,可以是ObjectFile,也可以是执行文件。还可以是一个标签(Label)prerequisites就是要生成那个target所需要的文件或是目标。command也就是make需要执行的命令。(任意的Shell命令)这是一个文件的依赖关系,也就是说target这一个或多个的目标文件依赖于prerequisites中的文件,其生成规则定义在command中。说白一点就是说,prerequisites中如果有一个以上的文件比target文件要新 阅读全文
posted @ 2012-02-29 19:52 lcyang 阅读(756) 评论(0) 推荐(1) 编辑
摘要: bind()方法的其它用法发表于2011-08-19由adminbind()方法不仅能为元素绑定浏览器支持的具有相同名称的事件,也可以绑定自定义事件。不仅如此,bind()方法还能做很多的事情。1.绑定多个事件类型例如可以为元素一次性绑定多个事件类型。jQuery代码如下:$(function () { $("div").bind("mouseover mouseout", function () { $(this).toggleClass("over"); });})当光标插入div元素时,该元素的class切换为“over”;当光 阅读全文
posted @ 2012-02-21 15:50 lcyang 阅读(476) 评论(0) 推荐(0) 编辑
摘要: 编辑器加载中... 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() 阅读全文
posted @ 2012-02-21 14:26 lcyang 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 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': 阅读全文
posted @ 2012-02-10 18:35 lcyang 阅读(322) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2012-02-10 18:34 lcyang 阅读(201) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2012-02-10 18:32 lcyang 阅读(144) 评论(0) 推荐(0) 编辑
摘要: 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. 阅读全文
posted @ 2012-02-10 18:32 lcyang 阅读(178) 评论(0) 推荐(1) 编辑
摘要: 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 阅读全文
posted @ 2012-02-10 18:31 lcyang 阅读(221) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2012-02-10 18:30 lcyang 阅读(244) 评论(0) 推荐(0) 编辑
摘要: 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 阅读全文
posted @ 2012-02-10 18:28 lcyang 阅读(233) 评论(0) 推荐(0) 编辑