2月有两场比赛,总分前八的有纪念品。第一场排第11,要拿到奖品毫无把握。。心血来潮写了个用来计算几场比赛总分排名的脚本,好让自己第一时间知道能不能得奖(囧),也稍微试下BeautifulSoup。# -*- coding: utf-8 -*-from bs4 import BeautifulSoup...
分类:
编程语言 时间:
2015-02-11 00:28:19
阅读次数:
211
思路:利用ruquest发送请求,利用多线程模拟并发下面直接上代码:#!/user/bin/env python#coding=utf-8import requestsimport datetimeimport timeimport threadingclass url_request(): ...
分类:
编程语言 时间:
2015-02-10 20:18:18
阅读次数:
273
写代码的时候,业余时间讨论最多的是Coding的这个产品将来有多少用户,这些用户用起来怎么样?因为我有一个强烈的愿望,就是在朋友间聊天的时候,不经意的告诉他某某产品的代码是我写的。 就像曾经一个朋友告诉我,他参与了美的电饭煲控制程序的编写;曾经也有一个朋友告诉我他参与了腾讯浏览器代码的编写。说...
分类:
其他好文 时间:
2015-02-10 18:17:58
阅读次数:
156
python 支持3种编码声明,一般常用能见到下面两种1.# -*- coding: utf-8 -*- 这种写法是为了兼容Emacs的编码声明2.短一点,但Emacs不能用# coding=utf-8短一点,但Emacs不能用之所以要声明未编码类型 ,主要是中文出错的问题。在python 文件开头...
分类:
编程语言 时间:
2015-02-10 18:16:43
阅读次数:
160
在09年Google IO大会Jeffrey Sharkey的演讲(Coding for Life — Battery Life, That Is)
中就探讨了这个问题,指出android应用的耗电主要在以下三个方面:
大数据量的传输。
不停的在网络间切换
。
解析大量的文本数据。
并提出了相关的优化建议:
在需要网络连接的程序中,首先检查网络连接是...
分类:
移动开发 时间:
2015-02-10 13:18:44
阅读次数:
248
#!/usr/bin/env python#coding=GBKfrom mpl_toolkits.mplot3d import Axes3D from matplotlib import cm from matplotlib.ticker import LinearLocator, Forma.....
分类:
其他好文 时间:
2015-02-10 13:18:02
阅读次数:
252
看了网上好多的资料,以前一直不理解encode,decode以前uncode,utf-8,现在理解了,uncode是转码内部中介,比如 #coding:utf-8 a='中国' print repr(a) #这个时候a是utf8的字节流 b=a.decode('utf8') print repr(b...
分类:
编程语言 时间:
2015-02-10 12:44:24
阅读次数:
218
# -*- coding: utf-8 -*-"""@author: jiangfuqiang"""import reimport urllib2import cookielibimport timedef startParser(author,page=1): reg = r'\s*\t*\...
分类:
编程语言 时间:
2015-02-10 10:28:19
阅读次数:
160
Reverse digits of an integer.
Example1: x = 123, return 321
Example2: x = -123, return -321
click to showspoilers.
Have you thoughtabout this?
Here are some good questions to ask before coding. B...
分类:
其他好文 时间:
2015-02-10 09:17:49
阅读次数:
155
# -*- coding:utf8 -*-from bs4 import BeautifulSoupimport os, sys, urllib2, urllibfrom multiprocessing.dummy import Pool as ThreadPoolurls = []def down...
分类:
编程语言 时间:
2015-02-09 20:14:15
阅读次数:
231