People seldom do what they believe in. They do what is convenient, then repent. 人们很少真正实践他们的理想.他们只做比较容易的事,然后用一生来后悔.…
代码: # 列出http://www.cnblogs.com/xiandedanteng中所有博文的标题 from bs4 import BeautifulSoup import requests user_agent='Mozilla/4.0 (compatible;MEIE 5.5;windows NT)' headers={'User-Agent':user_agent} for i in range(1,61): html=requests.get('http://www.cnblogs…
任务还是读取博文标题. 读取app2.js // 内置http模块,提供了http服务器和客户端功能 var http=require("http"); // cheerio模块,提供了类似jQuery的功能 var cheerio = require("cheerio"); // 内置文件处理模块 var fs=require('fs'); // 创建一个将流数据写入文件的WriteStream对象 var outstream=fs.createWriteStre…
这回爬虫走得好点了,每次正常读取文章数目总是一样的,但是有程序僵住了情况,不知什么原因. 代码如下: // 内置http模块,提供了http服务器和客户端功能 var http=require("http"); // 内置文件处理模块 var fs=require('fs'); // 创建一个将流数据写入文件的WriteStream对象 var outstream=fs.createWriteStream('./1.log'); // 请求参数JSON var options; //…
延续上一篇,想把自己博客的文档标题利用Node.js的request全提取出来,于是有了下面的初哥爬虫,水平有限,这只爬虫目前还有点瘸腿,请看官你指正了. // 内置http模块,提供了http服务器和客户端功能 var http=require("http"); // 内置文件处理模块 var fs=require('fs'); // 创建一个将流数据写入文件的WriteStream对象 var outstream=fs.createWriteStream('./1.txt'); /…
在多核(SMP)多线程的情况下,如果不知道CPU乱序执行的话,将会是一场噩梦,因为无论怎么进行代码Review也不可能发现跟内存屏障(MB)相关的Bug.内存屏障分为两类: 跟编译有关的内存屏障: 告诉编译器,不要优化我,俺不需要 跟CPU有关的内存屏障: 告诉CPU, 不要乱序执行,谢谢 1. NVMeDirect中的内存屏障 /* nvmedirect/include/lib_nvmed.h */ 38 #define COMPILER_BARRIER() asm volatile("&qu…
seldom之数据驱动 如果自动化某个功能,测试数据不一样而操作步骤是一样的,那么就可以使用参数化来节省测试代码. seldom是我在维护一个Web UI自动化测试框,这里跟大家分享seldom参数化的实现. GitHub:https://github.com/SeldomQA/seldom 参数化测试用例 import seldom from seldom import data class BaiduTest(seldom.TestCase): @data([ ("case1",…
前言 HTTP接口测试很简单,不管工具.框架.还是平台,只要很的好的几个点就是好工具. 测试数据问题:比如删除接口,重复执行还能保持结果一致,必定要做数据初始化. 接口依赖问题:B接口依赖A的返回值,C接口依赖B接口的返回值. 加密问题:不同的接口加密规则不一样.有些用到时间戳.md5.base64.AES,如何提供种能力. 断言问题:有些接口返回的结构体很复杂,如何灵活的做到断言. 对于以上问题,工具和平台要么不支持,要么很麻烦,然而框架是最灵活的. unittest/pytest + req…
seldom 是我几个月前重启的Web UI 自动化开源项目,源项目名 pyse, 基于 unittest 和 selenium 的自动化测试框架. seldom 1.0 做为第一个正式版做了以下改进. 1.创建独立的组织 为了项目更好的发展,github创建了独立的组织 seldomQA, 从我个人的项目移到了 seldomQA 组织. 项目地址: https://github.com/SeldomQA 2.项目介绍 seldomQA下有三个项目: seldom : Web UI 自动化测试框…
1.负载均衡算法 2)最快响应速度(Fastest) •优先查看7层请求的连接数,然后查看4层连接数 •需要在virtual server上关联7层的profile,否则与最小连接数相同 •后台服务器性能相差不多时推荐使用 3)观察算法(Observed) •在4层连接的基础上计算每秒pool member连接的比重 •不推荐在后台服务器过多的pool中使用 4)Predictive 预测法 •在之前的连接数及当前的连接数的基础上计算比率数 •不建议应用于大量的pool 5)Weighted L…
[目录] 1.os.system(cmd) 2.os.popen(cmd) 3.利用subprocess模块 4.subprocessor模块进阶 [概述] 考虑这样一个问题,有hello.py脚本,输出”hello, world!”:有testinput.py脚本,等待用户输入,然后打印用户输入的数据.那么,怎么样把hello.py输出内容发送给testinput.py,最后testinput.py打印接收到的”hello, world!”.下面我来逐步讲解一下shell的交互方式. hell…
1. I am Charles Humble and I am here at QCon London with Eva Andreasson from Cloudera. Eva, can you introduce yourself to the InfoQ community? Who am I? I am Eva Andreasson and I am a product manager working for Cloudera at the moment. I also have a…
Background C++ is one of the main development languages used by many of Google's open-source projects. As every C++ programmer knows, the language has many powerful features, but this power brings with it complexity, which in turn can make code more…
And ever has it been that love knows not its own depth until the hour of separation.  除非临到了别离的时候,爱永远不会知道自己的深浅. 这是个倒装句,因为ever位于句首,句子要倒装,it是形式主语,has been是谓语,that从句是真正的主语从句,until后为状语   倒装句 在英语中,主语和谓语的语序通常是主语在前,谓语在后.这类语序被称为“自然语序”.但有时为了强调句子的某一部分,或由于其它诸如语法…
[英语魔法俱乐部——读书笔记] 3 高级句型-简化从句&倒装句(Reduced Clauses.Inverted Sentences):(3.1)从属从句简化的通则.(3.2)形容词从句简化.(3.3)名词从句简化.(3.4)副词从句简化.(3.5)简化从句练习.(3.6)倒装句 3.1 从属从句简化的通则(Generally Reduction Rules of Dependent Clause) 3.1.1 简化从句:英语语法以句子为研究对象,而其句型也分为简单句.复句和合句之分,其中简单句…
第一部分 1 初级句型-简单句(Simple Sentences):(1.1)基本句型&补语.(1.2)名词短语&冠词.(1.3)动词时态.(1.4)不定式短语.(1.5)动名词.(1.6)分词.(1.7)形容词.(1.8)副词.(1.9)语气词.(1.10)介词.(1.11)主谓一致性   1.1 五种基本句型&补语 1.1.1 五中基本句型 主谓(sv) 主谓宾(svo) 主谓宾宾(svoo) 主谓补(svc) 主谓宾补(svoc) 一个句子需要“主语”+“动词(谓语)”才能表…
Passion is momentary; love is enduring. 激情短暂,真爱长久. What is love? And what is real love? We are always moved by those stories of real love. That just shows that there is seldom real love in the world. And faults are thick when love is thin. Success is…
Friends are lost by calling too often and calling seldom. 交往过密过疏,都会失去朋友. Please mind your own business, don't be always interfering.   Life is about making an impact, not making an income. 生命在于影响他人,而非赚钱糊口. However, in nowadays, the premise that we ca…
Boosting performance with Cython     Even with my old pc (AMD Athlon II, 3GB ram), I seldom run into performance issues when running vectorized code. But unfortunately there are plenty of cases where that can not be easily vectorized, for example the…
第四部分     推理题 1.世界上每个角落的每个人都有立场,都有背景,都有推理性,能推理出一个人语言的真意,才成就了真正的推理能力: 2.换言之,如果你能通过一个人的说话推理出其身份职业,你的推理能力更上一层楼. 一 . 临门一脚 1. “I believe in human ingenuity – that when we decide on a task to be done, no matter how daunting it may seem at the beginning, we…
abide by(=be faithful to ; obey vt)忠于:遵守. a) Plese feel assured we will abide by our promise. 2. be absent from…缺席 a) He is seldom absent from school. 3. absence of mind(=being absent-minded) 心不在焉 a) Absence of mind in chemical experiments may cause…
Time past cannot be called back again.  时间不能倒流. Time tries all.  路遥知马力,日久见人心.  Tit for tat is fair play. 人不犯我,我不犯人:人若犯我,我必犯人.  To err is human.  人非圣贤,孰能无过.  To know everything is to know nothing.  什么都知道,一如什么都不知道.  To know oneself is true progress. 人贵…
Class Organization Following the standard Java convention, a class should begin with a list of variables.Public static constants, if any, should come first.Then private static variables, followed by private instance variables.There is seldom a good r…
2013年暑期买到这本书,距离其第一版已经有14年之久,而最早发布在互联网上的文章更是早在1997年.在我阅读的时候,很多事迹已经沉积为历史,很多预言已经成为现实.而这本书的意义却丝毫没有因此淡化,反而更加支持了书里的立论. <大教堂与集市>作者 Eric Raymond, 第一次知道此人还是在天津大学的操作系统原理课程上.大教堂与集市,分别代表两种软件开发模式,大教堂代表着封闭的决策权集中的方式,集市代表开放的,平等透明,共享互动的开源软件开发方式. 本篇博文,主要就一些点展开一些讨论,评价…
http://firstround.com/article/lessons-from-pixar-why-software-developers-should-be-story-tellers When most people think of Pixar they think of movies like Finding Nemo and Toy Story. But the studio has also been producing world-class film-making soft…
点击打开链接 Children of the Candy Corn Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 8288   Accepted: 3635 Description The cornfield maze is a popular Halloween treat. Visitors are shown the entrance and must wander through the maze facing…
---恢复内容开始--- Meaningful Names: use Intention-Revealing Names //nice,Everyone who reads your code (including you) will be happier if you do. The name of a variable, function, or class, should answer all the big questions. It should tell you why it exi…
http://www.onjava.com/pub/a/onjava/2001/05/30/optimization.htmlComparing the performance of LinkedLists and ArrayLists (and Vectors) (Page last updated May 2001, Added 2001-06-18, Author Jack Shirazi, Publisher OnJava). Tips: ArrayList is faster than…
参考:http://eduunix.ccut.edu.cn/index2/html/linux/OReilly.SUSE.Linux.Jul.2006/059610183X/suselinux-CHP-7-SECT-3.html 上面的链接基于suse,说的不错 Function The RPC system is intended as functions to be integrated into network programs rather than as a command-line…
Recently I have read a news which said "Firfox 23 nixes support for outdated blink HTML tag". Google'Chrome, Apple's Safari, and Opera have all abandoned the tag. I reached to the internet since 2000s so seldom could I see it in the web. It make…