上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页
摘要: 一,工程pom文件中新增依赖,参考http://mvnrepository.com/artifact/org.json/json/20160212 二、用到的部分代码,用Json 字符串生成json对象,再从中获取需要的字段 三、lib源码 https://github.com/stleary/JS 阅读全文
posted @ 2016-07-05 17:25 kane_zch 阅读(1410) 评论(0) 推荐(0) 编辑
摘要: http://pykafka.readthedocs.io/en/latest/index.html 阅读全文
posted @ 2016-07-05 16:54 kane_zch 阅读(1599) 评论(0) 推荐(0) 编辑
摘要: 一,需要加载json lib import json 二、把list转为json格式的字符串 转完后打印: 三、相关官方API请参考 https://docs.python.org/2/library/json.html 阅读全文
posted @ 2016-07-05 16:53 kane_zch 阅读(241) 评论(0) 推荐(0) 编辑
摘要: 昨日想在python的一个函数中做一下发送次数的统计,需要用到全局变量,如下 结果报该错误,解决办法是在函数中加一行,global COUNT 即可解决 阅读全文
posted @ 2016-07-05 16:44 kane_zch 阅读(7645) 评论(0) 推荐(0) 编辑
摘要: 一、问题背景 Python 写的脚本,不断从txt文件中读取一行数据封装成消息,作为producer发给kafka, storm的spout从kafka中读取这些消息后做一些处理发送给bolt,bolt最后将数据按既定的格式写入到HBASE 二、问题描述 一共14000条左右的数据,加调试信息观察到 阅读全文
posted @ 2016-07-05 16:33 kane_zch 阅读(788) 评论(0) 推荐(0) 编辑
摘要: 1.环境介绍 如图所示,NODEJS做为数据源的的产生者产生消息,发到Kafka队列,然后参见红线,表示本地开发的环境下数据的流向(本地开发时,storm topology运行在本地模式) 2.搭建环境,我采用的是eclipse+maven 1.建立一个maven工程, 然后将pom文件修改如下: 阅读全文
posted @ 2016-06-30 15:15 kane_zch 阅读(1603) 评论(1) 推荐(0) 编辑
摘要: #coding=utf-8import randomimport time def createRandomMac(): Maclist = [] for i in range(1,7): RANDSTR = "".join(random.sample("0123456789abcdef",2)) 阅读全文
posted @ 2016-06-30 11:34 kane_zch 阅读(421) 评论(0) 推荐(0) 编辑
摘要: Slow down. The more you understand, the less you have to memorize. Don'tjust 'read. Stop and think. When the book asks you a question, don'tjust skip 阅读全文
posted @ 2016-06-30 11:32 kane_zch 阅读(372) 评论(0) 推荐(0) 编辑
摘要: 1.训练误差:学习器在训练集上的误差,也称“经验误差” 2.泛化误差:学习器在新样本上的误差 显然,我们的目标是得到在新样本上表现更好的学习器,即泛化误差要小 3.过拟合:学习器把训练样本学的太好了,导致泛化性能下降(学过头了。。。让我联想到有些人死读书,读死书,僵化,不懂得变通和举一反三) 原因: 阅读全文
posted @ 2016-06-30 11:30 kane_zch 阅读(151) 评论(0) 推荐(0) 编辑
摘要: <!DOCTYPE html> <html> <head> <meta name="viewport" content="initial-scale=1.0, user-scalable=no" /> <meta http-equiv="Content-Type" content="text/htm 阅读全文
posted @ 2016-06-30 11:27 kane_zch 阅读(318) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 12 下一页