linux下面有时候 字符需要进行编码转换(爬虫将gbk转为utf-8编码...),一般可以选择iconv函数。
终端下面 输入
man 3 iconv
得到 iconv函数的使用方法。
个人看习惯了,msdn文档之后感觉linux下面的文档的看的不是那么爽了。
使用iconv函数进行转码,一般使用三个函数:iconv_open 、 iconv 、iconv_close三...
分类:
其他好文 时间:
2015-07-18 22:47:45
阅读次数:
196
clc;clear all;close all;% %% 画极坐标系% x = 0:.01 * pi:0.5 * pi;% y = cos(x) + sqrt(-1) * sin(x);% plot(y*2,'r','linewidth',5);% hold on% warning('off')% ...
分类:
其他好文 时间:
2015-07-18 22:31:09
阅读次数:
228
直方图均衡化
clear;close all;
A=imread('lena_gray_512.tif');
B=imadjust(A);
subplot(2,2,1); imshow(A); title('原始图像')
subplot(2,2,2); imhist(A); title('原始图像直方图')
subplot(2,2,3); imshow(B); title('均衡化图像...
分类:
其他好文 时间:
2015-07-17 21:09:05
阅读次数:
334
笔记本类:package cn.fanse;
public class Notebook {
public void run() {
System.out.println("book run");
}
public void useUSB(USB usb) {
usb.open();
usb.close();
}
}
USB接口:
packag...
分类:
其他好文 时间:
2015-07-17 18:50:17
阅读次数:
139
正常情况tcp四层握手关闭连接,rst基本都是异常情况,整理如下:1.GFW2. 对方端口未打开,发生在连接建立 如果对方sync_backlog满了的话,sync简单被丢弃,表现为超时,而不会rst3. close Socket 时recv buffer 不为空 例如,客户端发了两个请求,服务.....
分类:
其他好文 时间:
2015-07-17 18:12:26
阅读次数:
107
答:Disconnecting will close all underlying sockets in the connection pool. If this instance is used again it will be automatically re-opened.转自:http://...
分类:
数据库 时间:
2015-07-17 15:30:37
阅读次数:
220
一、设备的分类及特点1、字符设备字符设备是面向数据流的设备,没有请求缓冲区,对设备的存取只能按顺序按字节的存取而不能随机访问。Linux下的大多设备都是字符设备。应用程序是通过字符设备节点来访问字符设备的。通常至少需要实现open,close,read,和write等系统调用。设备节..
分类:
系统相关 时间:
2015-07-16 22:38:38
阅读次数:
258
import repage=20f=open('test','r')html=f.read()f.close()#取得标题title=re.search('(.*?)',html,re.S).group(1)print title#取得链接地址like=re.findall("href='(.*?)...
分类:
编程语言 时间:
2015-07-16 18:41:08
阅读次数:
186
1:readline()file = open("sample.txt") while 1: line = file.readline() if not line: break pass # do somethingfile.close()一行一行得从文件读数据,显然...
分类:
编程语言 时间:
2015-07-16 15:50:49
阅读次数:
167
1:ps aux|grep Spider4Test.jar查看端口2: lsof -p [端口号]在爬虫运行期间如果看到 大量的TIME_WAIT WAIT_CLOSE 说明请求关闭阻塞【采用httpclient默认方法 ,其实没有关闭掉,需要跑等3分钟 才会关闭】 大量并发时 会有阻塞3: 解决....
分类:
Web程序 时间:
2015-07-16 13:59:19
阅读次数:
287