首页
文章
分类
标签
更多
时光机
友情链接
Search
1
史上超全共享单车车锁的开锁方式(含具体方案)转
5,198 阅读
2
渗透测试工具实战技巧合集
3,490 阅读
3
URP综合教务系统通杀getshell
3,019 阅读
4
pentestbox 下安装whatweb后,报IPADDR模块没有配置的解决办法。
2,861 阅读
5
Pentest BOX安装和使用
2,307 阅读
学习资料
工具
视频
笔记
登录
Search
标签搜索
python
javascript
pentestbox
NSA
cms
linux
前端知识
jquery
安全
mysql
php
seafile
seahub
wdcp
Richar
累计撰写
130
篇文章
累计收到
4
条评论
首页
栏目
学习资料
工具
视频
笔记
页面
文章
分类
标签
时光机
友情链接
搜索到
40
篇与
Richar
的结果
2017-06-28
Python爬取全书网后,对python几个模块的了解
新人,仅接触Python两天,未深入学习,代码较渣,勿喷.直接发代码:#!/usr/bin/python # -*- coding: utf-8 -*- #爬取速度较慢,主要是卡在urllib.openurl().read()上 import urllib, re, MySQLdb,time class Sql(object): #创建SQL类来处理数据操作 # conn=MySQLdb.connect(host="localhost", user="root",passwd= "root", db="quanshuwang",charset="utf8") conn = MySQLdb.connect(host="mysql.xxx.com", port=7150, user="noveltest", passwd="123456", db="noveltest", charset="utf8") def addBooks(self,sort,name,imgurl,des,status,author): cur = self.conn.cursor() sql="INSERT INTO novel(sort,name,imgurl,description,status,author) values(%s,'%s','%s','%s','%s','%s')"%(sort,name,imgurl,des,status,author) cur.execute(sql) lastrowid = cur.lastrowid self.conn.commit() return lastrowid def addChapters(self,novelid,title,content): pass cur=self.conn.cursor() sql="insert into chapter(novelid,title,content) values(%s,'%s','%s')"%(novelid,title,content) cur.execute(sql) lastrowid=cur.lastrowid self.conn.commit() return lastrowid def getBookList(): #取出所有书的名称和地址 print 'getbooklist:',time.strftime('%H:%M:%S') url='http://www.quanshuwang.com/map/1.html' html=urllib.urlopen(url).read() #获取HTML源码 html=html.decode('gbk').encode('utf-8') #先用decode()将源码的GBK转换为通用的UNICODE编码,再解压成UTF-8 reg=r'<a href="(/book/.*?)" target="_blank">(.*?)</a>' #正则,锁定(.*?) .为任意字符,*可匹配多个,?非贪婪模式,取最短那个 return re.findall(reg,html) #用RE.FINDALL取出正则匹配的文本 def getAuthor(bookurl): print 'StartgetAuthorAndbookurl:',bookurl,time.strftime('%H:%M:%S') bookurl=bookurl.split('/')[-2] url = 'http://www.quanshuwang.com/book_%s.html' %bookurl print 'startReadHtml:',time.strftime('%H:%M:%S') html = urllib.urlopen(url).read() print 'EndReadHtmlandStartDecode:',time.strftime('%H:%M:%S') html=html.decode('gbk').encode('utf-8') print 'StartgetAuthormsgbookandEndDecode:',time.strftime('%H:%M:%S') sort=re.findall(r'<a href="/list/(\d+)_.*?" class="c009900">.*?</a> >', html)[0] author=re.findall(r'<dt>作 者:</dt><dd> <a href=".*?">(.*?)</a></dd>',html)[0] status=re.findall(r'dl><dt>小说状态:</dt><dd>(.*?)</dd></dl>',html)[0] imgurl=re.findall(r'<img onerror="this.src=.*?" src="(.*?)" width="160" height="200" border="0" alt=".*?" title=".*?" />',html)[0] des=re.findall(r'div class="infoDetail"><div id="waa" style="height:72px;width:690px;overflow:hidden;">(.*?)<br />',html)[0] print 'EndgetAuthormsgbook:',time.strftime('%H:%M:%S') bookmsg={'sort':sort,'author':author,'status':status,'imgurl':imgurl,'des':des} return bookmsg def getChapterList(bookurl):#得到每篇文章的章节 url='http://www.quanshuwang.com%s'%bookurl html=urllib.urlopen(url).read().decode('gb2312').encode('utf-8') reg=r'<li><a href="(.*?)" title=".*?">(.*?)</a></li>' return re.findall(reg,html) def getContent(bookurl,chapterurl): #取得每篇文章的内容 url='http://www.quanshuwang.com%s'%bookurl.replace(bookurl.split('/')[-1],chapterurl) #用章节地址替换书目地址里的链接 html=urllib.urlopen(url).read().decode('gbk').encode('utf-8') reg=r'style5\(\);</script>(.*?)<script type="text/javascript">style6' return re.findall(reg,html)[0] mysql=Sql() #打开数据库链接 for bookname in getBookList(): #循环爬取小说内容 print 'for:',time.strftime('%H:%M:%S') msgbook={} bookurl=bookname[0] #书的URL name=bookname[1] #书名 print 'Startmsgbooklen',len(msgbook) msgbook=getAuthor(bookurl) print 'EndgetauthorandEndmsgbook:',len(msgbook),time.strftime('%H:%M:%S') sort=msgbook['sort'] author = msgbook['author'] imgurl = msgbook['imgurl'] des = msgbook['des'] status=msgbook['status'] urllib.urlretrieve(imgurl, "images/%s.jpg" %name.decode('utf-8'))#因为当前环境为utf-8,故要把书名转成unicode #print type(sort),type(author),type(name),type(imgurl),type(des),type(status) # novelid=mysql.addBooks(int(sort),name,imgurl,des,status,author) print '正在存储小说%s'%name # for chapter in getChapterList(bookurl): # chapterurl=chapter[0] #章节URL # chaptername=chapter[1] #章节名称 # content=getContent(bookurl,chapterurl) #小说内容 # print '正在存储章节%s'%chaptername # mysql.addChapters(novelid,chaptername,content) mysql.conn.close()
2017年06月28日
1,890 阅读
0 评论
0 点赞
2017-06-28
一步一步学网络爬虫(从python到scrapy)
本文转自sunnyxiaohu的博客,仅为个人学习资料保存,如有侵权,请告知.大概花了一个星期的时间,学习了一下网络爬虫的知识,现在使用scrapy能爬一些基本的网页,图片,解决网页编码兼容问题,基础的模拟登陆。对于有些模拟登陆,由于其提交的表单要经过js进行处理后提交;更难的其网页也是经js渲染的,要学会一步步去分析,没有太多的去深入,但我会提到基本的分析方法。参考文章:1、http://www.runoob.com/ 一个很好的语言语法入门学习的网站,我主要用其学习了Python的语法。2、http://blog.csdn.net/column/details/why-bug.html 此博客讲了一些网络爬虫的基础知识,包括http,url等,而且一步步讲解了实现爬虫的整个过程。3、http://doc.scrapy.org/en/latest/intro/tutorial.html scrapy框架的学习教程,从安装讲到应用到常见问题,是个不可多得的参考手册,至少过一遍,对于想深入研究的同学,一定要多看几遍。4、http://blog.csdn.net/u012150179/article/details/34486677 对于中文输出与保存,实现多网页的爬取,做了实现。5、http://www.jianshu.com/p/b7f41df6202dhttp://www.jianshu.com/p/36a39ea71bfd对于怎么实现模拟登陆做了较好的解释和实现,当然由于技术的不断更新和动态变化,网站的反爬虫的技术也在不断更新,具体情况,应具体分析。下面正式进入学习:环境:ubuntu14.04一、python1、python的下载和安装:https://www.python.org/downloads/ 在链接中找到自己需要的版本,记得在研究中基本不用version>3.0的版本,然而有为了支持一些新的功能,基本上version>2.70 and version<3.0是一个比较合适的选择。由于ubuntu14.04的底层有些使用python实现的,所以都带了python,(python2.74的版本或者其它)如果需要不同的版本可在不删除原有版本的基础上下载新版本,并修改软链接即可。ln -s python pythonx.xx中间若有问题,请自行百度解决。2、python的基础知识学习。熟悉一下基本的语法,重点关注列表,元组,字典,函数和类。其它的若有问题,再返回去学习吧,学习链接在参考中已给出,练习一下,一两天就差不多能搞定了。二、网络爬虫的基础知识1、网络爬虫的定义、浏览网页的过程、URI和URL的概念和举例、URL的理解和举例。2、正则表达式自己练习一下,如果记不住了看看下面的表。三、scrapy1、scrapy的安装http://doc.scrapy.org/en/latest/intro/install.html 根据你自己应用的平台进行选择。比较简单,不做过多的解释。2、一个scrapy例子http://doc.scrapy.org/en/latest/intro/tutorial.html 有几点要注意一下:一是知道如何去调试,二是xpath()和css(),还有要学会使用firebox和firebug分析网页源码和表单提交情况,看到前面,我们基本能实现单网页的爬取。3、讲讲scrapy框架对scrapy的框架和运行有一个具体的思路之后我们才能更好的了解爬虫的整个情况,尤其是出了问题之后的调试http://blog.csdn.net/u012150179/article/details/34441655http://scrapy-chs.readthedocs.org/zh_CN/latest/_images/scrapy_architecture.png4、scrapy自动多网页爬取总结起来实现有三种方式:第一种,先prase眼前的url,得到各个item后,在获得新的url,调用prase_item进行解析,在prase_item中又callback parse function 。第二种,也就是例子(scrapy的一个例子)中后部分提到的:<span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">parse</span><span class="hljs-params">(self, response)</span>:</span> <span class="hljs-keyword">for</span> href <span class="hljs-keyword">in</span> response.css(<span class="hljs-string">"ul.directory.dir-col > li > a::attr('href')"</span>): url = response.urljoin(href.extract()) <span class="hljs-keyword">yield</span> scrapy.Request(url, callback=self.parse_dir_contents) 1 2 3 4 1 2 3 4 prase只做url的获取,具体的解析工作交给prase_dir_contents去做。第三种、就是根据具体的爬虫去实现了,Generic Spiders(例子中我们用的是Simple Spiders)中用的比较多的有CrawlSpider,这里我们介绍这个的实现<span class="hljs-keyword">import</span> scrapy <span class="hljs-keyword">from</span> scrapy.spiders <span class="hljs-keyword">import</span> CrawlSpider, Rule <span class="hljs-keyword">from</span> scrapy.linkextractors <span class="hljs-keyword">import</span> LinkExtractor <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MySpider</span><span class="hljs-params">(CrawlSpider)</span>:</span> name = <span class="hljs-string">'example.com'</span> allowed_domains = [<span class="hljs-string">'example.com'</span>] start_urls = [<span class="hljs-string">'http://www.example.com'</span>] rules = ( <span class="hljs-comment"># Extract links matching 'category.php' (but not matching 'subsection.php')</span> <span class="hljs-comment"># and follow links from them (since no callback means follow=True by default). follow</span> Rule(LinkExtractor(allow=(<span class="hljs-string">'category.php'</span>, ), deny=(<span class="hljs-string">'subsection.php'</span>, ))), <span class="hljs-comment"># Extract links matching 'item.php' and parse them with the spider's method parse_item. process</span> Rule(LinkExtractor(allow=(<span class="hljs-string">'item.php'</span>, )), callback=<span class="hljs-string">'parse_item'</span>), ) <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">parse_item</span><span class="hljs-params">(self, response)</span>:</span> ....... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 这便是其的Link Extractors机制。5、中文输出与存储编码http://blog.csdn.net/u012150179/article/details/34450547存储:在 item.py中编码:item[‘title’] = [t.encode(‘utf-8’) for t in title] ,在pipe.py中解码: <span class="hljs-keyword">import</span> json <span class="hljs-keyword">import</span> codecs <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">W3SchoolPipeline</span><span class="hljs-params">(object)</span>:</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">__init__</span><span class="hljs-params">(self)</span>:</span> self.file = codecs.open(<span class="hljs-string">'w3school_data_utf8.json'</span>, <span class="hljs-string">'wb'</span>, encoding=<span class="hljs-string">'utf-8'</span>) <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">process_item</span><span class="hljs-params">(self, item, spider)</span>:</span> line = json.dumps(dict(item)) + <span class="hljs-string">'n'</span> <span class="hljs-comment"># print line </span> self.file.write(line.decode(<span class="hljs-string">"unicode_escape"</span>)) <span class="hljs-keyword">return</span> item 1 2 3 4 5 6 7 8 9 10 11 12 13 1 2 3 4 5 6 7 8 9 10 11 12 13 输出:<span class="hljs-keyword">for</span> t <span class="hljs-keyword">in</span> title: <span class="hljs-built_in">print</span> t.encode(<span class="hljs-string">'utf-8'</span>) 1 2 1 2 6、图片或者文件的下载http://doc.scrapy.org/en/latest/topics/media-pipeline.html这里,主要提供一个抓取妹子图片的例子。注意怎么实现文件名的替换与改写。<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">ImagedownPipeline</span><span class="hljs-params">(object)</span>:</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">process_item</span><span class="hljs-params">(self, item, spider)</span>:</span> <span class="hljs-keyword">if</span> <span class="hljs-string">'image_url'</span> <span class="hljs-keyword">in</span> item: <span class="hljs-comment">#images = []</span> dir_path = <span class="hljs-string">'%s/%s'</span> % (settings.IMAGES_STORE, spider.name) <span class="hljs-comment"># if not os.path.exists(dir_path):</span> <span class="hljs-comment"># os.makedirs(dir_path)</span> <span class="hljs-keyword">for</span> image_url <span class="hljs-keyword">in</span> item[<span class="hljs-string">'image_url'</span>]: image_page = item[<span class="hljs-string">'image_page'</span>] dir_path = <span class="hljs-string">'%s/%s'</span> %(dir_path, image_page) <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> os.path.exists(dir_path): os.makedirs(dir_path) us = image_url.split(<span class="hljs-string">'/'</span>)[<span class="hljs-number">3</span>:] image_file_name = <span class="hljs-string">'_'</span>.join(us) file_path = <span class="hljs-string">'%s/%s'</span> % (dir_path, image_file_name) <span class="hljs-comment">#images.append(file_path)</span> <span class="hljs-keyword">if</span> os.path.exists(file_path): <span class="hljs-keyword">continue</span> <span class="hljs-keyword">with</span> open(file_path, <span class="hljs-string">'wb'</span>) <span class="hljs-keyword">as</span> handle: response = requests.get(image_url, stream=<span class="hljs-keyword">True</span>) <span class="hljs-keyword">for</span> block <span class="hljs-keyword">in</span> response.iter_content(): <span class="hljs-comment">#if not block:</span> <span class="hljs-comment"># break</span> handle.write(block) <span class="hljs-comment">#item['images'] = images</span> <span class="hljs-keyword">return</span> item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 this kind of process would make more efficiency<span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">MyImagesPipeline</span><span class="hljs-params">(ImagesPipeline)</span>:</span> <span class="hljs-function"><span class="hljs-keyword">def</span> <span class="hljs-title">item_completed</span><span class="hljs-params">(self, results, item, info)</span>:</span> image_paths = [x[<span class="hljs-string">'path'</span>] <span class="hljs-keyword">for</span> ok, x <span class="hljs-keyword">in</span> results <span class="hljs-keyword">if</span> ok] <span class="hljs-comment"># print settings.IMAGES_STORE + image_paths[0]</span> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> image_paths: <span class="hljs-keyword">raise</span> DropItem(<span class="hljs-string">"Item contains no images"</span>) <span class="hljs-keyword">for</span> img_url <span class="hljs-keyword">in</span> item[<span class="hljs-string">'image_urls'</span>]: us = img_url.split(<span class="hljs-string">'/'</span>)[<span class="hljs-number">3</span>:] newname = <span class="hljs-string">'_'</span>.join(us) dir_path = settings.IMAGES_STORE+<span class="hljs-string">"full/"</span>+item[<span class="hljs-string">'image_page'</span>]+<span class="hljs-string">"/"</span> <span class="hljs-comment"># print dir_path</span> <span class="hljs-keyword">if</span> <span class="hljs-keyword">not</span> os.path.exists(dir_path): os.makedirs(dir_path) os.rename(settings.IMAGES_STORE + image_paths[<span class="hljs-number">0</span>], dir_path + newname) <span class="hljs-keyword">return</span> item 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 7、scrapy模拟登陆此处不做过多的解释,给出两个例子。里面分析的很详细http://www.jianshu.com/p/b7f41df6202dhttp://www.jianshu.com/p/36a39ea71bfd还有,有时需要模拟Request的headers,这在http://doc.scrapy.org/en/latest/topics/request-response.html 中有很好的说明,至于怎么找到对应的headers,可通过firebug或者其它。8、处理js渲染过的网页……9、验证码的识别…….10、分布式爬虫的实现…….
2017年06月28日
1,477 阅读
0 评论
0 点赞
2017-06-27
15款顶级开源人工智能工具推荐
人工智能是技术研究领域最炙手可热的领域之一。IBM、谷歌、微软、Facebook和亚马逊等公司正投入巨资进行研发,并纷纷收购在机器学习、神经网络、神经语言和图像处理等领域取得进展的初创公司。考虑到人工智能如此受关注,斯坦福大学的专家最近撰写的一份智能研究报告得出结论:“现在到2030年人工智能可能会出现越来越有用的应用,有可能给我们的社会和经济带来深远的积极影响,”也就不足为奇了。我们在本文中专注于开源人工智能工具,着重介绍15个知名度最大的开源人工智能项目。1. CaffeCaffe是加州大学伯克利分校攻读博士学位者的杰作,这是一种深度学习框架,基于表达式架构和可扩展代码。速度快是它赖以成名的特点,因而在研究人员和企业用户当中都备受欢迎。据官方网站声称,仅仅使用一个英伟达K40 GPU,它在短短一天内就能够处理6000多万个图像。它由伯克利视觉和学习中心(BVLC)管理,英伟达和亚马逊等公司提供了拨款,支持它的发展。更多详情:https://www.oschina.net/p/caffe2. CNTKCNTK的全称是计算网络工具包,它是微软的开源人工智能工具之一。它声称拥有出众的性能,无论在只有CPU的系统上运行,在只有一个CPU的系统上运行,在拥有多个GPU的系统上运行,还是在拥有多个GPU的多台机器上运行,都是如此。微软主要用它来研究语音识别,但是它同样适用于其他应用领域,比如机器翻译、图像识别、图像字幕、文本处理、语言理解和语言建模。相关链接:https://www.cntk.ai3. Deeplearning4jDeeplearning4j是一种面向Java虚拟机(JVM)的开源深度学习库。它在分布式环境中运行,可与Hadoop和Apache Spark整合起来。它让用户可以配置深度神经网络,与Java、Scala及其他JVM语言兼容。该项目由一家名为Skymind的商业公司管理,该公司提供收费的支持、培训和Deeplearning4j的企业发行版。相关链接:http://deeplearning4j.org4. DMTK与CNTK一样,分布式机器学习工具包(DMTK)是微软的开源人工智能工具之一。它是为大数据应用领域设计,旨在更快地训练人工智能系统。它包括三大部分:DMTK框架、LightLDA主题模型算法以及分布式(Multisense)单词嵌入算法。微软声称,在8个集群机器上,它能够“针对拥有1000多亿个权标的文档集合,训练拥有100万个主题和1000万个单词词汇表(共有10万亿个参数)的主题模型,”这个成绩是其他工具无法比拟的,这也证明了DMTK的速度有多快。相关链接:http://www.dmtk.io5. H2OH2O更加专注于人工智能在企业领域的应用,而不是在研究领域的应用,它的用户包括诸多大公司:第一资本、思科、尼尔森Catalina、贝宝及Transamerica。它声称让任何人都可以使用机器学习和预测分析的强大功能,解决业务问题。它可用于预测建模、风险及欺诈分析、保险分析、广告技术、医疗保健和客户情报。它有两种开源版本:标准的H2O和Sparkling Water,后者与Apache Spark集成起来。它还提供收费的企业支持。相关链接:http://www.h2o.ai6. MahoutMahout是Apache基金会下面的一个项目,是一种开源机器学习框架。据官方网站声称,它提供三种主要的特性:用于构建可扩展算法的编程环境、面向Spark和H2O等工具的预制算法,以及名为Samsara的向量数学试验环境。使用Mahout的公司包括:Adobe、埃森哲、Foursquare、英特尔、领英、推特、雅虎及其他许多公司。可通过官方网站上所列的第三方获得专业支持。相关链接:http://mahout.apache.org7. MLlibApache Spark以速度快著称,它已成为最流行的大数据处理工具之一。MLlib是Spark的可扩展机器学习库。它与Hadoop整合起来,可与NumPy和R协同操作。它包括一大批机器学习算法,可用于分类、回归、决策树、推荐、聚类、主题建模、特性转换、模型评估、机器学习管道构建、机器学习持久性、生存分析、频繁项集、顺序模式挖掘、分布式线性代数和统计。相关链接:https://spark.apache.org/mllib8. NuPICNuPIC由一家名为Numenta的公司管理,这是一种开源人工智能项目,基于一种名为分层式即时记忆(即HTM)的理论。实际上,HTM试图建立一种模仿人类大脑新皮层而建的计算机系统。目的在于制造“处理许多认知任务时接近或胜过人类表现”的机器。除了开源许可证外,Numenta还提供采用商业许可证的NuPic,它还提供作为它技术底层的专利方面的许可证。相关链接:http://numenta.org9. OpenNNOpenNN为深入了解人工智能的研究人员和开发人员而设计,这是一种用于实现神经网络的C++编程库。主要特性包括:深度架构和卓越性能。官方网站上有全面的说明文档,包括解释神经网络基础知识的入门教程。可通过Artelnics获得OpenNN的收费支持,总部位于西班牙的这家公司主攻预测分析。相关链接:http://www.opennn.net10. OpenCycOpenCyc由一家名为Cycorp的公司开发,它让用户可以访问Cyc知识库和常识推理引擎。它包括239000多个术语、约2093000个三元组以及大约69000个owl:sameAs链接(指向外部语义数据命名空间)。它用于丰富域名建模、语义数据整合、文本理解、特定领域专家系统和游戏人工智能。这家公司还提供Cyc的另外两个版本:一个是非开源免费版本,面向研究人员;另一个面向企业用户,需要收费。相关链接:http://www.cyc.com/platform/opencyc11. Oryx 2Oryx 2建立在Apache Spark和Kafka上,这是一种专门的应用开发框架,面向大规模的机器学习。它使用了一种独特的lambda架构,有三个层次。开发人员可使用Oryx 2来构建新的应用程序,它还包括一些预制应用程序,处理常见的大数据任务,比如协作过滤、分类、回归和聚类。大数据工具厂商Cloudera建立了最初的Oryx 1项目,一直大力参与持续开发工作。相关链接:http://oryx.io12. PredictionIO今年2月份,Salesforce收购了PredictionIO,后来在7月份,它把该平台连同商标一起捐献给了Apache基金会,该基金会将它列为孵化器项目。所以,虽然Salesforce使用PredictionIO技术来完善自己的机器学习功能,但是开源版本方面的工作也会继续下去。它可帮助用户构建拥有机器学习功能的预测引擎,这些功能可用来部署实时响应动态查询的Web服务。相关链接:https://prediction.io13. SystemMLSystemML最初由IBM开发,现在它是Apache旗下的一个大数据项目。它提供了一种高度可扩展的平台,可以实施用R或类似Python的语法编写的高级运算和算法。企业已经在用它来跟踪汽车维修方面的客户服务,引导机场客流量,或者将社交媒体数据与银行客户联系起来。它可以在Spark或Hadoop上运行。相关链接:http://systemml.apache.org14. TensorFlowTensorFlow是谷歌的开源人工智能工具之一。它提供了用于数字计算的库,使用数据流图。它可以在众多不同的搭载单一或多个CPU和GPU的系统上运行,甚至可以在移动设备上运行。它拥有深度灵活性、真正的可移植性、自动差分功能,并支持Python和C++。官方网站上列有非常丰富的教程和实用文章,可供有兴趣使用或扩展其功能的开发人员或研究人员使用。相关链接:https://www.tensorflow.org15. TorchTorch自称是“一种科学计算框架,广泛支持把GPU放在首位的机器学习算法。”这里的重点在于灵活性和速度。此外,很容易与众多方面的软件包结合使用:机器学习、计算机视觉、信号处理、并行处理、图像、视频、音频和网络。它依赖一种名为LuaJIT的脚本语言,这种语言基于Lua。相关链接:http://torch.ch原文标题:15 Top Open Source Artificial Intelligence Tools,作者:Cynthia Harvey编译:51CTO
2017年06月27日
1,339 阅读
0 评论
0 点赞
2017-05-26
sublime 使用介绍:
需要HTML4.01 的版本,输入html:xt 然后按ctrl+E ● 按ctrl+鼠标滚轮,调整字号 ● 输入div*5,按ctrl+E,就能生成5 个div 标签 ● 按鼠标中键可以多行编辑 ● ctrl+shift+k:删除当前行 ● ctrl+shift+D:复制当前行 ● ctrl+shift+上下键:调整当前行的位置 ● ctrl+alt+[ : 可以让CSS 格式进行转换(单行、多行)
2017年05月26日
1,420 阅读
0 评论
0 点赞
2017-05-25
使用WDCP的小内存VPS内存占用优化的一点经验
也是使用 wdcp ,也遇到过内存优化方便的问题,收集一个经验供以后操作下。使用wdcp好久了,刚开始的VPS是512MB内存,安装wdcp后并开通网站后发现内存占用会逐步升高,最后直至耗尽。设置mysql优化的参数为“小内存VPS(256-512mb)”后并没有出现改观。中间又换了其他几个免费控制面板,也不太好用。不过,经过一段时间折腾后,终于找到了解决方法。这个解决方法在安装wdcp面板的VPS上通过,方法分享出来,供参考:调试方法:修改apache配置文件httpd.conf(不同的主机控制面板可能该配置文件所处的目录不同)对于安装wdcp的VPS,修改的文件是/www/wdlinux/httpd-2.2.22/conf/httpd-wdl.conf在httpd-wdl.conf中找到 ,这里就是apache在prefork模式下的参数段。将该段各值修改为以下数值:<IfModule mpm_prefork_module> ServerLimit 256 StartServers 2 MinSpareServers 2 MaxSpareServers 5 MaxClients 256 MaxRequestsPerChild 50 </IfModule>最重要的占用内存的参数是标红的几个。 经过上述设置之后,httpd子进程数保持在最小2个,多余的进程在处理请求超过50个后自动销毁释放内存(这个数值不要设为0,否则http进程会一直不销毁),从而保证在正常流量下内存得以及时释放。这些数值可以根据需要适当调整,以适应内存大小。修改后重启apache服务生效。各字段含义:ServerLimit 最大客户数 StartServers 服务器启动时建立的子进程数量 MinSpareServers 最小空闲子进程数 MaxSpareServers 最大空闲子进程数 MaxClients 同一时间客户端最大接入请求的数量 MaxRequestsPerChild 每个子进程在其生存期内允许伺服的最大请求数量
2017年05月25日
1,353 阅读
0 评论
0 点赞
1
...
7
8