中文分词 下载一中文长篇小说,并转换成UTF-8编码。 使用jieba库,进行中文词频统计,输出TOP20的词及出现次数。 排除一些无意义词、合并同一词。 对词频统计结果做简单的解读。 import jieba news=open('jane.txt','r',encoding='utf-8').r ...
分类:
其他好文 时间:
2017-09-29 14:00:34
阅读次数:
116
正则和三木 window.location.href = /Android|webOS|iPhone|iPod|BlackBerry/i.test(navigator.userAgent) ? "https://www.baidu.com/" : "http://news.baidu.com/"; ...
分类:
移动开发 时间:
2017-09-29 12:44:33
阅读次数:
318
1.默认的响应的解析 1.1 AFN默认不支持接受text/html数据类型,只需要增加即可 manager.responseSerializer.acceptableContentTypes = [NSSet setWithObjects:@"application/json", @"text/j ...
分类:
其他好文 时间:
2017-09-29 10:04:09
阅读次数:
225
画图显示: 用requests库和BeautifulSoup4库,爬取校园新闻列表的时间、标题、链接、来源、详细内容 爬虫,网页信息 将取得详细内容的代码包装成函数。 ...
分类:
其他好文 时间:
2017-09-28 22:32:30
阅读次数:
432
import requests from bs4 import BeautifulSoup gzccurl = 'http://news.gzcc.cn/html/xiaoyuanxinwen/' res = requests.get(gzccurl) res.encoding='utf-8' so... ...
分类:
其他好文 时间:
2017-09-28 16:53:43
阅读次数:
190
import requests from bs4 import BeautifulSoup url='http://news.gzcc.cn/html/xiaoyuanxinwen/' res=requests.get(url) res.encoding='utf-8' soup=Beautiful... ...
分类:
其他好文 时间:
2017-09-28 16:50:46
阅读次数:
158
import requests #HTTP库 从html或xml中提取数据 from bs4 import BeautifulSoup #爬虫库BeautifulSoup4 url = requests.get("http://news.gzcc.cn/html/xiaoyuanxinwen/") ...
分类:
其他好文 时间:
2017-09-28 16:42:17
阅读次数:
254
用requests库和BeautifulSoup4库,爬取校园新闻列表的时间、标题、链接、来源。 import urllib.request as urllib2 from bs4 import BeautifulSoup url='http://news.gzcc.cn/html/xiaoyuan ...
分类:
其他好文 时间:
2017-09-28 15:10:19
阅读次数:
165
Java通过Executors提供四种线程池,分别为:newCachedThreadPool创建一个可缓存线程池,如果线程池长度超过处理需要,可灵活回收空闲线程,若无可回收,则新建线程。newFixedThreadPool 创建一个定长线程池,可控制线程最大并发数,超出的线程会在队列中等待。newS ...
分类:
编程语言 时间:
2017-09-28 13:04:54
阅读次数:
290
http://geek.csdn.net/news/detail/238243 原文:4 More Techniques for Writing Better Java 作者:Justin Albano 翻译:Vincent 译者注:如果现在要求对你写的Java代码进行优化,那你会怎么做呢?作者在本 ...
分类:
编程语言 时间:
2017-09-28 09:52:03
阅读次数:
164