对大多数程序员而言,弯腰驼背一连几小时趴在办公桌上对着电脑霹雳巴拉敲着键盘,很有可能是一种常态,日复一日,年复一年。我之所以知道的这么清楚,是因为我也是其中的一员。 随着时间的流逝,头开始向前倾(1),肩膀开始无意识地耷拉下来(2),背渐渐地向前...
分类:
其他好文 时间:
2014-08-20 15:48:32
阅读次数:
191
网店日常维护过程中,难免要跟各种批量操作打交道,虽然大多数操作可以通过批量上传 (easy populate) 和 快速更新 模块来完成,但在应用便捷性和一些功能性的调整上, 总有一定的局限性;网站的全部数据均存放在数据库中, 有什么变更 直接操作数据库无疑是最便捷的方式,既然要动数据库, SQL语...
分类:
数据库 时间:
2014-08-20 15:47:12
阅读次数:
337
# -*- coding: utf-8 -*-import urllib2import urllibimport timeimport md5secret='xxxxx'app_key='yyyy'session ='zzzzzz'arg={ 'format': 'json', 'tim...
There is a building of 100 floors. If an egg drops from the Nth floor or above, it will break. If it's dropped from any floor below, it will not break...
分类:
其他好文 时间:
2014-08-20 12:06:52
阅读次数:
189
There is an 8*8 chess board in which two diagnolly opposite corners have been cut off. You are given 31 dominos, and a single domino can cover exactly...
分类:
其他好文 时间:
2014-08-20 12:01:32
阅读次数:
236
(1)创建scrapy项目 scrapy?startproject?getblog ????(2)编辑 items.py #?-*-?coding:?utf-8?-*-
#?Define?here?the?models?for?your?scraped?items
#
#?See?documentation?i...
分类:
编程语言 时间:
2014-08-20 07:06:56
阅读次数:
262
python爬虫,web spider。爬取网站获取网页数据,并进行分析提取。 ????基本模块使用的是 urllib,urllib2,re,等模块 (一)基本用法,例子 ????(1)进行基本GET请求,获取网页html #!coding...
分类:
编程语言 时间:
2014-08-20 00:10:25
阅读次数:
376
注释:两类 # 或 """ """ 或 ''' ''' #coding=utf-8 (中文)--------------------------------------------------变量:无需先声明,赋值时声明和定义比如:data_i = 1str = 'hello' #字符串可用''.....
分类:
编程语言 时间:
2014-08-19 22:06:35
阅读次数:
270
Given a(decimal -e.g. 3.72)number that is passed in as a string, print the binary representation. If the number can not be represented accurately in b...
分类:
其他好文 时间:
2014-08-19 22:04:15
阅读次数:
233
2014年8月19日 18:48:39所有控制器都要继承main类,main类是一个入口类,他里边根据请求初始化了一些变量,也初始化了一些系统变量等等,这些变量和函数可以被控制器类直接使用控制器类的命名必须是以下划线开始的:因为PHP的语法问题,当子类有构造函数的时候父类的构造函数不会被调用,zen...
分类:
其他好文 时间:
2014-08-19 20:24:45
阅读次数:
181