<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[This is MyC]]></title><description><![CDATA[一个对技术丧失了热情的人不可能成为真正的高手]]></description><link>https://blog.csdn.net/horseinch</link><language>zh-cn</language><generator>https://blog.csdn.net/</generator><copyright><![CDATA[Copyright &copy; horseinch]]></copyright><item><title><![CDATA[C++给定范围进行按位与运算]]></title><link>https://blog.csdn.net/horseinch/article/details/52081083</link><guid>https://blog.csdn.net/horseinch/article/details/52081083</guid><author>horseinch</author><pubDate>Sun, 31 Jul 2016 21:47:25 +0800</pubDate><description><![CDATA[LeetCode上的题目： 
Given a range [m, n] where 0 <= m <= n <= 2147483647, return the bitwise AND of all numbers in this range, inclusive.For example, given the range [5, 7], you should return 4.给定一个范围，将范围内的]]></description><category></category></item><item><title><![CDATA[二分查找算法的C++和Python实现]]></title><link>https://blog.csdn.net/horseinch/article/details/52006803</link><guid>https://blog.csdn.net/horseinch/article/details/52006803</guid><author>horseinch</author><pubDate>Sat, 23 Jul 2016 21:49:16 +0800</pubDate><description><![CDATA[二分查找算法是在有序数组中用到的较为频繁的一种算法，在未接触二分查找算法时，最通用的一种做法是，对数组进行遍历，跟每个元素进行比较，其时间为O(n).但二分查找算法则更优，因为其查找时间为O(lgn)，譬如数组{1， 2， 3， 4， 5， 6， 7， 8， 9}，查找元素6，用二分查找的算法执行的话，其顺序为：1. 第一步查找中间元素，即5，由于5<6，则6必然在5之后的数组元素中，那么就在{6，]]></description><category></category></item><item><title><![CDATA[Python十进制转二、八、十六进制]]></title><link>https://blog.csdn.net/horseinch/article/details/51982932</link><guid>https://blog.csdn.net/horseinch/article/details/51982932</guid><author>horseinch</author><pubDate>Thu, 21 Jul 2016 14:59:49 +0800</pubDate><description><![CDATA[从十进制转其他进制是非常简单的，无非是分为两步：
将这个数对要转换的进制数相除，取余数，如num%8，继续拿着除之后的整数部分对进制数取余数，直到整数部分为0为止
将余数倒序输出，即可得到结果
num = input('input an int number: ')
t = input('input type(2,8,16): ')def trans(num):
    m = 0
    lst]]></description><category></category></item><item><title><![CDATA[桶排序，冒泡排序，快速排序算法Python实现]]></title><link>https://blog.csdn.net/horseinch/article/details/51974162</link><guid>https://blog.csdn.net/horseinch/article/details/51974162</guid><author>horseinch</author><pubDate>Wed, 20 Jul 2016 23:11:10 +0800</pubDate><description><![CDATA[桶排序案例：学生分数为0~10，要按照从小到大排序： 
1. 首先我们需要申请一个大小为10的数组（python为列表），然后遍历学生成绩，每遍历一个成绩就在序号=成绩的位置+1. 
2. 生成完列表之后，按照序号从小到大遍历，打印出每个序号，每个序号打印次数是序号下的数值def bucket_sort(lst):
    pre_lst = [0]*10#预先设定的列表，全部置零
    resu]]></description><category></category></item><item><title><![CDATA[图像通道的拆分/合并处理]]></title><link>https://blog.csdn.net/horseinch/article/details/51926989</link><guid>https://blog.csdn.net/horseinch/article/details/51926989</guid><author>horseinch</author><pubDate>Sat, 16 Jul 2016 23:16:51 +0800</pubDate><description><![CDATA[OpenCV里边彩色顺序是BGR，想要变成RGB顺序，有两种方法：
方法一：比较常用的解决办法是拆分了三通道，再逆序合并回去：
import cv2
img = cv2.imread('img/image.png')
b,g,r = cv2.split(img)
img = cv2.merge([r,g,b])方法二：不必拆分合并，直接利用Numpy操作，img2
 = img[:,:,::]]></description><category></category></item><item><title><![CDATA[Python给定一个句子倒序输出单词以及字母]]></title><link>https://blog.csdn.net/horseinch/article/details/51850434</link><guid>https://blog.csdn.net/horseinch/article/details/51850434</guid><author>horseinch</author><pubDate>Thu, 07 Jul 2016 13:08:10 +0800</pubDate><description><![CDATA[#!/usr/bin/python
# -*- coding: utf-8 -*-
def rever(sentence):
    newwords = []
    words = sentence.split()
    words.reverse()
    space = ' '#单词之间一个间隔
    for word in words:
        newword = []]]></description><category></category></item><item><title><![CDATA[Python和opencv打开摄像头]]></title><link>https://blog.csdn.net/horseinch/article/details/51840479</link><guid>https://blog.csdn.net/horseinch/article/details/51840479</guid><author>horseinch</author><pubDate>Wed, 06 Jul 2016 16:44:03 +0800</pubDate><description><![CDATA[import cv2
import numpy as npcap = cv2.VideoCapture(0)
while True:
    ret,frame = cap.read()
    cv2.imshow('frame',frame)    if cv2.waitKey(1) &0xFF == ord('q'):#如果按下的这颗健为q则结束
        breakcap.releas]]></description><category></category></item><item><title><![CDATA[红外图像特点及识别方法]]></title><link>https://blog.csdn.net/horseinch/article/details/51819448</link><guid>https://blog.csdn.net/horseinch/article/details/51819448</guid><author>horseinch</author><pubDate>Mon, 04 Jul 2016 11:03:54 +0800</pubDate><description><![CDATA[红外图像成像特点：由于红外图像是通过“测量”物体向外辐射的热量而获得的，故与可将光图像相比：
分辨率差
对比度低
信噪比低
视觉效果模糊
灰度分布与目标反射特征无线性关系
局部不变特征目前绝大多数景物匹配算法提取的都是全局不变特征，它能很好解决同一目标的一致性判决问题，但很难消除图像的成像畸变。当图像之间的成像畸变很复杂时，利用全局信息进行匹配非常困难，特别是存在局部遮挡时，全图特征会随之变化。基于]]></description><category></category></item><item><title><![CDATA[Python爬虫实践（十一）：selenium+phantomjs+正则表达式爬取文章并保存]]></title><link>https://blog.csdn.net/horseinch/article/details/51764934</link><guid>https://blog.csdn.net/horseinch/article/details/51764934</guid><author>horseinch</author><pubDate>Sun, 26 Jun 2016 22:27:34 +0800</pubDate><description><![CDATA[爬取的是三联生活周刊的这篇文章：

英国"脱欧"：蝴蝶的翅膀动了（url：点击打开链接）

一、环境准备：
系统：Ubuntu
IDE：wingide
安装以及破解wingide可参考这篇文章：点击打开链接，需要注意的是，经过验证，这个破解的py脚本对最新的wingide 5.1破解失败，在官网下载wingide的时候，点击older version，安装5.0.X的版本，我安装的是]]></description><category></category></item><item><title><![CDATA[Python爬虫实践（10）：实例2教务系统登录]]></title><link>https://blog.csdn.net/horseinch/article/details/51740945</link><guid>https://blog.csdn.net/horseinch/article/details/51740945</guid><author>horseinch</author><pubDate>Thu, 23 Jun 2016 10:22:29 +0800</pubDate><description><![CDATA[打开登录首页，表面上，我们的url应该是：http://grdms.bit.edu.cn/yjs/login.jsp


按F12，查看页面元素如下图：





看到提交方式为post，action后边接的应该是我们提交用户名密码的网站，猜测是：http://grdms.bit.edu.cn/yjs/login.do
为了验证猜想，登录之后F12查看network：

]]></description><category></category></item><item><title><![CDATA[Python爬虫实践（九）：第一个爬虫实例（简书首页）]]></title><link>https://blog.csdn.net/horseinch/article/details/51733439</link><guid>https://blog.csdn.net/horseinch/article/details/51733439</guid><author>horseinch</author><pubDate>Wed, 22 Jun 2016 12:40:52 +0800</pubDate><description><![CDATA[做一个简单的爬虫，简单的不能再简单
这里选取简书首页，爬取各个文章标题，由于不需要登录，所以无需Cookie，简书的网页源代码下载也无需设置headers




在简书的首页按 F12，查看页面元素Element，可以看到我们所需要爬取的内容夹在了 ..XXXXX  之间
所以，pattern我们可以这么写：
pattern= re.compile('(.*?)', re.S)]]></description><category></category></item><item><title><![CDATA[Python爬虫实践(八)：正则表达式re模块（2）]]></title><link>https://blog.csdn.net/horseinch/article/details/51727243</link><guid>https://blog.csdn.net/horseinch/article/details/51727243</guid><author>horseinch</author><pubDate>Tue, 21 Jun 2016 14:44:41 +0800</pubDate><description><![CDATA[前面的例子我们打印出了result.group(),其实每个匹配方法还有其他的属性/方法re.match(pattern, string[, flags])
re.search(pattern, string[, flags])
re.split(pattern, string[, maxsplit])
re.findall(pattern, string[, flags])
re.finditer]]></description><category></category></item><item><title><![CDATA[Python爬虫实践(七)：正则表达式(2) re模块的使用]]></title><link>https://blog.csdn.net/horseinch/article/details/51726535</link><guid>https://blog.csdn.net/horseinch/article/details/51726535</guid><author>horseinch</author><pubDate>Tue, 21 Jun 2016 13:06:51 +0800</pubDate><description><![CDATA[前面说到re模块，可用于正则表达式，匹配字符主要用到的函数有以下几种：#以下为匹配所用函数
re.match(pattern, string[, flags])
re.search(pattern, string[, flags])
re.split(pattern, string[, maxsplit])
re.findall(pattern, string[, flags])
re.findit]]></description><category></category></item><item><title><![CDATA[Python爬虫实践(六)：正则表达式(1)]]></title><link>https://blog.csdn.net/horseinch/article/details/51724169</link><guid>https://blog.csdn.net/horseinch/article/details/51724169</guid><author>horseinch</author><pubDate>Mon, 20 Jun 2016 23:55:22 +0800</pubDate><description><![CDATA[正则表达式，就是将杂乱无章的下载网页解析成我们想要的信息的一种逻辑方法正则表达式是对字符串操作的一种==逻辑公式==，就是用事先定义好的一些特定字符、及这些特定字符的组合，组成一个“规则字符串”，这个“规则字符串”用来表达对字符串的一种过滤逻辑。正则表达式的大致匹配过程是：
依次拿出表达式和文本中的字符比较，
如果每一个字符都能匹配，则匹配成功；一旦有匹配不成功的字符则匹配失败。
3. 如果表达式中]]></description><category></category></item><item><title><![CDATA[Python爬虫实践（五）：Cookie]]></title><link>https://blog.csdn.net/horseinch/article/details/51722844</link><guid>https://blog.csdn.net/horseinch/article/details/51722844</guid><author>horseinch</author><pubDate>Mon, 20 Jun 2016 19:21:32 +0800</pubDate><description><![CDATA[Cookie，指某些网站为了辨别用户身份、进行session跟踪而储存在用户本地终端上的数据（通常经过加密）比如说有些网站需要登录后才能访问某个页面，在登录之前，你想抓取某个页面内容是不允许的。那么我们可以利用Urllib2库保存我们登录的Cookie，然后再抓取其他页面就达到目的了。1. 什么是Opener当你获取一个URL,你使用一个opener (  urllib2.OpenerDirecto]]></description><category></category></item><item><title><![CDATA[Python爬虫实践(四)：一些不常用设置]]></title><link>https://blog.csdn.net/horseinch/article/details/51721090</link><guid>https://blog.csdn.net/horseinch/article/details/51721090</guid><author>horseinch</author><pubDate>Mon, 20 Jun 2016 15:31:52 +0800</pubDate><description><![CDATA[代理设置urllib2默认会使用环境变量 http_proxy 来设置 ==HTTP Proxy==。假如一个网站它会检测某一段时间某个IP 的访问次数，如果访问次数过多，它会禁止你的访问。所以你可以设置一些代理服务器来帮助你做工作，每隔一段时间换一个代理，以防被禁止。设置方法：import urllib2
enable_proxy = True
proxy_handler = urllib2.Pr]]></description><category></category></item><item><title><![CDATA[Python爬虫实践(三)设置Headers]]></title><link>https://blog.csdn.net/horseinch/article/details/51720630</link><guid>https://blog.csdn.net/horseinch/article/details/51720630</guid><author>horseinch</author><pubDate>Mon, 20 Jun 2016 14:44:43 +0800</pubDate><description><![CDATA[例子：以登录知乎为例import urllib2
import urllibvalues={"username":"XXXX@qq.com","password":"XXXX"}
data=urllib.urlencode(values)
url= "https://www.zhihu.com/#signin"
request=urllib2.Request(url,data)
response=u]]></description><category></category></item><item><title><![CDATA[Python爬虫实践(二)：Urllib库的简单使用]]></title><link>https://blog.csdn.net/horseinch/article/details/51714681</link><guid>https://blog.csdn.net/horseinch/article/details/51714681</guid><author>horseinch</author><pubDate>Sun, 19 Jun 2016 23:05:17 +0800</pubDate><description><![CDATA[扒网页，其实就是根据URL来获取它的网页信息。例子：import urllib2response = urllib2.urlopen("http://www.baidu.com")
print response.read()保存为.py之后运行，即可得到百度首页的源码 
首先我们调用的是urllib2库里面的urlopen方法，urlopen一般接受三个参数，参数如下：urlopen(url, da]]></description><category></category></item><item><title><![CDATA[python爬虫实践(一)：准备工作]]></title><link>https://blog.csdn.net/horseinch/article/details/51714445</link><guid>https://blog.csdn.net/horseinch/article/details/51714445</guid><author>horseinch</author><pubDate>Sun, 19 Jun 2016 22:19:07 +0800</pubDate><description><![CDATA[urllib和urllib2 库 urllib 和 urllib2 库是学习Python爬虫最基本的库，利用这个库我们可以得到网页的内容，并对内容用正则表达式提取分析，得到我们想要的结果。
urllib和urllib2模块都做与请求URL相关的操作，但他们提供不同的功能。 
urllib2.urlopen可以接受一个Request对象或者url，（在接受Request对象时候，并以此可以来设置一个U]]></description><category></category></item><item><title><![CDATA[python类class学习笔记]]></title><link>https://blog.csdn.net/horseinch/article/details/51708016</link><guid>https://blog.csdn.net/horseinch/article/details/51708016</guid><author>horseinch</author><pubDate>Sun, 19 Jun 2016 00:19:32 +0800</pubDate><description><![CDATA[class Class_name(object) | 类名通常大写开头（约定俗成，不强制），object表示该类继承的类名，如果没有继承类，就写object,因为object类是所有类最终都会继承的类。def __init__(self,x,y,z...) | 通过定义一个特殊的__init__方法，在创建实例的时候，就把类属性初始化。 
第一个参数永远是self，表示创建的实例本身
因为__ini]]></description><category></category></item></channel></rss>