using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading;using System.Data;using System.Reflection;usi...
分类:
其他好文 时间:
2014-08-20 17:55:42
阅读次数:
206
#-*-coding:utf-8-*-#python:2.x__author__='Administrator'#生成器表达式和itertools模块#yield中可以使用圆括号代替中括号iter0=(x**2forxinrange(10)ifx%2==0)foriter1initer0:print...
分类:
编程语言 时间:
2014-08-20 17:54:52
阅读次数:
221
采集时,有时候需要采集图片,但某些网站的图片提供的相对地址,最好转换成绝对地址在scrapy中有如下的解决策略http://stackoverflow.com/questions/6499603/python-scrapy-convert-relative-paths-to-absolute-pathshttp://stackoverflow.com/questions/19970015/scrapy-item-..
分类:
编程语言 时间:
2014-08-20 16:38:23
阅读次数:
239
作为个人学习笔记分享,有任何问题欢迎交流!
在openstack中创建虚拟机的底层实现是nova使用了libvirt,代码在nova/virt/libvirt/driver.py。
#image_meta:镜像的相关内容,#injected_files:要注入到VM的文件
#network_info:网络相关信息,block_device_info:磁盘相关信息
def spawn(sel...
分类:
其他好文 时间:
2014-08-20 16:28:42
阅读次数:
292
基本原理
冒泡排序(Bubble Sort,台湾另外一种译名为:泡沫排序)是一种简单的排序算法。它重复地走访过要排序的数列,一次比较两个元素,如果他们的顺序错误就把他们交换过来。走访数列的工作是重复地进行直到没有再需要交换,也就是说该数列已经排序完成。这个算法的名字由来是因为越小的元素会经由交换慢慢“浮”到数列的顶端。
这样说还不是很明白,先看张图:
算法步骤:
1)比较相邻的...
分类:
编程语言 时间:
2014-08-20 16:27:12
阅读次数:
261
A unit fraction contains 1 in the numerator. The decimal representation of the unit fractions with denominators 2 to 10 are given:
1/2
=
0.5
1/3
=
0.(3)
1/4
=
0.25
1/5...
分类:
其他好文 时间:
2014-08-20 16:25:32
阅读次数:
157
Euler discovered the remarkable quadratic formula:
n² + n + 41
It turns out that the formula will produce 40 primes for the consecutive values n = 0 to 39. However, when n = 40, 402 + 40 + 41 = 40...
分类:
其他好文 时间:
2014-08-20 16:21:12
阅读次数:
244
python一天速成都是骗纸~怎么可能一天~只是快速了解一些基本的
首先我是个python新手,只在网上搜例子然后用python写过一些分析文件的脚本,现在工作需要,要短时间进一步了解python。这篇文章也不是给完全新手看的,还是给对python有一点接触且需要大致掌握或者对其他语言有一定研究的人看的。...
分类:
编程语言 时间:
2014-08-20 16:19:32
阅读次数:
362
安装mongodb1.下载,解压mongodb(下载解压目录为/opt)在/opt目录下执行命令wget fastdl.mongodb.org/linux/mongodb-linux-x86_64-2.6.4.tgztar xzvf mongodb-linux-x86_64-2.6.4.tgz2.创...
分类:
数据库 时间:
2014-08-20 16:09:02
阅读次数:
288