1 #首先我们可以先获取要下载图片的整个页面信息 2 #coding=utf-8 3 #Urllib 模块提供了读取web页面数据的接口,我们可以像读取本地文件一样读取www和ftp上的数据 4 import urllib 5 import re 6 #首先,我们定义了一个getHtml()函数:....
分类:
编程语言 时间:
2015-01-26 22:25:10
阅读次数:
336
题目:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, given the ...
分类:
编程语言 时间:
2015-01-26 20:42:03
阅读次数:
180
题目:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and empty spac...
分类:
编程语言 时间:
2015-01-26 16:57:37
阅读次数:
161
题目:A robot is located at the top-left corner of amxngrid (marked 'Start' in the diagram below).The robot can only move either down or right at any poi...
分类:
编程语言 时间:
2015-01-26 16:32:36
阅读次数:
173
def hnoi(n,a,b,c):
if n == 1:
print a,c
else:
hnoi(n-1,a,c,b)
print a,c
hnoi(n-1,b,a,c)
hnoi(3,'a','b','c')...
分类:
编程语言 时间:
2015-01-25 16:41:56
阅读次数:
274
题目:Given amxnmatrix, if an element is 0, set its entire row and column to 0. Do it in place.click to show follow up.Follow up:Did you use extra space?...
分类:
编程语言 时间:
2015-01-24 21:12:54
阅读次数:
192
题目:Given an array withnobjects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the order red,...
分类:
编程语言 时间:
2015-01-24 19:58:37
阅读次数:
213
题目:Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in...
分类:
编程语言 时间:
2015-01-24 12:58:48
阅读次数:
285
凸包算法是计算几何中的最经典问题之一了。给定一个点集,计算其凸包。凸包是什么就不罗嗦了本文给出了《计算几何——算法与应用》中一书所列凸包算法的Python实现和Matlab实现,并给出了一个Matlab动画演示程序。啊,实现谁都会实现啦╮(╯▽╰)╭,但是演示就不一定那么好做了。算法CONVEXHU...
分类:
编程语言 时间:
2015-01-23 22:54:33
阅读次数:
502
摘自以前CI实现的商城系统,做APP时需要实现数据接口,便用python实现了。
假设有表tp_article
id
title
type
1
哈哈
1
2
图样涂森坡
1
使用thinphp实现取出type为1的数据如下
M()->from(''tp_article'')->where('type=1')->se...
分类:
数据库 时间:
2015-01-23 14:43:15
阅读次数:
528