08 2013 档案

ubuntu 设置root启动
摘要:http://www.linuxidc.com/Linux/2012-05/60806.htmsudo -s输入普通用户的password回车即可进入root权限vi /etc/lightdm/lightdm.conf.[SeatDefaults]greeter-session=unity-gree... 阅读全文

posted @ 2013-08-28 19:18 雨渐渐 阅读(268) 评论(0) 推荐(0) 编辑

定向爬虫小例子
摘要:demo下载 java 和 python# --*-- coding:utf-8 --*--import urllib2from lxml import etreeimport Queueimport timeimport osdef getHtml(url): request = urlli... 阅读全文

posted @ 2013-08-26 10:32 雨渐渐 阅读(782) 评论(0) 推荐(0) 编辑

Mysql 授权访问
摘要:GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY '123456' WITH GRANT OPTION;FLUSH PRIVILEGES; 这就是设置一个urser:rootpwd:123456账号,该账号可以在任何机器,同时访问服务器 阅读全文

posted @ 2013-08-19 11:32 雨渐渐 阅读(148) 评论(0) 推荐(0) 编辑

crf 分词(待)
摘要:http://blog.csdn.net/marising/article/details/5769653 阅读全文

posted @ 2013-08-16 14:10 雨渐渐 阅读(200) 评论(0) 推荐(0) 编辑

java版 正文抽取 基于文字连接比
摘要:package cn.tdt.crawl.jdbc;import java.util.regex.Matcher;import java.util.regex.Pattern;import org.jsoup.Jsoup;import org.jsoup.nodes.Document;import ... 阅读全文

posted @ 2013-08-16 13:46 雨渐渐 阅读(1651) 评论(0) 推荐(0) 编辑

网络爬虫速成指南(二)网页解析(基于模板)
摘要:网页解析技术:1 xpath教程2 正则表达式教程xpath是将html加载为DOM树解析,简单,易维护。通常我用正则作为辅助抽取,用xpath定位后,再从定位的数据中用正则抽取。xpath的类库:.net 方向主要用到HtmlAgilityPackjava 方向主要用到HtmlCleaner(得翻... 阅读全文

posted @ 2013-08-15 10:58 雨渐渐 阅读(733) 评论(0) 推荐(0) 编辑

网络爬虫速成指南(一)网页下载
摘要:注解:此处仅仅是介绍一些类库及常规使用,如果要详细了解Http协议推荐看下《Http权威指南》。net 方向 主要是用到HttpWebRequest下载内容:JAVA方向:主要是用到HttpClient下载内容示例代码:相关类库(httpclient-4.1.2 httpcore-4.1.4)示例代... 阅读全文

posted @ 2013-08-15 10:25 雨渐渐 阅读(643) 评论(0) 推荐(0) 编辑

Python 操作Mysql
摘要:python 插入 汉字:# -*- coding: utf8 -*-import MySQLdbfrom datetime import datetry: con = MySQLdb.Connect(host='localhost', user='root', passwd='wm87661... 阅读全文

posted @ 2013-08-14 16:42 雨渐渐 阅读(191) 评论(0) 推荐(0) 编辑

网络爬虫速成指南 (三) 编码识别
摘要:问题的提出:采用上节的方法偶尔会下载到的HTML乱码,原因是上节的代码中进行了简易的编码识别,比如根据头信息,根据meta中的charset:。即使这样也会遇到下载到乱码的情况,原因是这两者提供的charset都可能不准确。解决方案:1 手动指定编码2 自动识别编码如果只采一个网站,自己指定下编码就... 阅读全文

posted @ 2013-08-13 14:35 雨渐渐 阅读(717) 评论(0) 推荐(0) 编辑

nutch-1.7-二次开发-Content中增加编码
摘要:1 识别nutch-1.7的编码,完成以前1.2是在 org.apache.nutch.parse.html.HtmlParser EncodingDetector detector = new EncodingDetector(conf); detector.autoDetectClues(content, true); detector.addClue(sniffCharacterEncoding(contentInOctets), "sniffed"); String enco... 阅读全文

posted @ 2013-08-12 15:39 雨渐渐 阅读(785) 评论(0) 推荐(0) 编辑

matplotlib.pyplot 绘图详解 matplotlib 安装
摘要:apt-get install python-matplotlib转载自:http://www.cnblogs.com/qianlifeng/archive/2012/02/13/2350086.htmlBasic:import matplotlib.pyplot as pyplotpyplot.b... 阅读全文

posted @ 2013-08-09 14:10 雨渐渐 阅读(1816) 评论(0) 推荐(0) 编辑

Git 学习
摘要:http://jiangli.easymorse.com/?cat=36 阅读全文

posted @ 2013-08-08 11:21 雨渐渐 阅读(146) 评论(0) 推荐(0) 编辑

pycharm console 控制台乱码的解决
摘要: 阅读全文

posted @ 2013-08-07 11:27 雨渐渐 阅读(5480) 评论(0) 推荐(1) 编辑

概率质量函数:怀孕周期的PMF
摘要:__author__ = 'dell'import surveyimport Pmfimport matplotlib.pyplot as pyplottable = survey.Pregnancies()table.ReadRecords()print "Number of pregnancie... 阅读全文

posted @ 2013-08-06 17:36 雨渐渐 阅读(465) 评论(0) 推荐(0) 编辑

Python 正则表达式
摘要:http://www.cnblogs.com/huxi/archive/2010/07/04/1771073.html 阅读全文

posted @ 2013-08-06 15:36 雨渐渐 阅读(127) 评论(0) 推荐(0) 编辑

TF-IDF
摘要:参考源:http://www.ruanyifeng.com/blog/2013/03/tf-idf.html 写的很明了package com.data.text.tfidf;import java.io.BufferedReader;import java.io.File;import java.... 阅读全文

posted @ 2013-08-06 15:15 雨渐渐 阅读(371) 评论(0) 推荐(0) 编辑

均值,方差: 概率质量函数PMF
摘要:__author__ = 'dell'import Pmfimport matplotlib.pyplot as pyplotpmf = Pmf.MakePmfFromList([1, 2, 2, 3, 5])print 'Mean by Pmf ', pmf.Mean()print 'Var by... 阅读全文

posted @ 2013-08-05 19:24 雨渐渐 阅读(1060) 评论(0) 推荐(0) 编辑

Python 字典 Print 格式化
摘要:__author__ = 'dell'ab = {'Swaroop': 'swaroopch@byteofpython.info', 'Larry': 'larry@wall.org', 'Matsumoto': 'matz@ruby-lang.org', 'Spammer': 'spammer@hotmail.com'}print "Swaroop's address is %s" % ab['Swaroop 阅读全文

posted @ 2013-08-05 16:49 雨渐渐 阅读(635) 评论(0) 推荐(0) 编辑

直方图:分布的最常用表示方法
摘要:表示分布最常用的方法就是直方图histogram,这种图用于展示各个值出现的频率和概率import Pmfimport operatorimport matplotlib.pyplot as pyplothist = Pmf.MakeHistFromList([1, 2, 2, 3, 5])vals... 阅读全文

posted @ 2013-08-03 17:49 雨渐渐 阅读(827) 评论(0) 推荐(0) 编辑

nutch-1.7 编译
摘要:转载自:http://peigang.iteye.com/blog/1563288从nutch-1.3开始 本地抓取(单击) 和 分布式抓取(集群)所使用的配置文件和命令单独分开。资源:下载地址:http://archive.apache.org/dist/nutch/1.7/apache-nutc... 阅读全文

posted @ 2013-08-01 11:16 雨渐渐 阅读(1030) 评论(0) 推荐(0) 编辑

众数
摘要:一个分布的众数就是它的最频繁值。编写一个球众数的函数mode编写一个AllMode函数,返回按频率降序排列的值-频对。__author__ = 'dell'import Pmfimport operatorhist = Pmf.MakeHistFromList([1, 2, 2, 3, 5])pri... 阅读全文

posted @ 2013-08-01 06:12 雨渐渐 阅读(367) 评论(0) 推荐(0) 编辑

Python 排序
摘要:转载自:http://wiki.python.org/moin/HowTo/SortingOriginal version by Andrew Dalke with a major update by Raymond Hettinger原始版本是Andrew Dalke,然后更新的是Raymond HettingerThere are many ways to use them to sort data and there doesn't appear to be a single, central place in the various manuals describing the 阅读全文

posted @ 2013-08-01 06:07 雨渐渐 阅读(332) 评论(0) 推荐(0) 编辑

导航