摘要: 使用flume收集数据,将数据传递给kafka和hdfs,kafka上的数据可以使用storm构建实时计算,而hdfs上的数据,经过MR处理之后可以导入hive中进行处理。 环境:hadoop1.2.1,hive 0.13.1,maven 3.2.5,flume 1.4,kafka 0.7.2,eclipse luna,jdk 1.7_75;mysql-connector-j... 阅读全文
posted @ 2015-03-14 17:08 当数据爱上科学 阅读(3781) 评论(0) 推荐(0) 编辑
摘要: 至 2015-3-11 阅读全文
posted @ 2015-03-11 19:22 当数据爱上科学 阅读(134) 评论(0) 推荐(0) 编辑
摘要: Determine whether an integer is a palindrome. Do this without extra space. click to show spoilers. Some hints: Could negative integers be palindromes? (ie, -1) If you are thinking of converting ... 阅读全文
posted @ 2015-03-06 13:46 当数据爱上科学 阅读(152) 评论(0) 推荐(0) 编辑
摘要: Implement atoi to convert a string to an integer. Hint: Carefully consider all possible input cases. If you want a challenge, please do not see below and ask yourself what are the possible input c... 阅读全文
posted @ 2015-03-05 19:13 当数据爱上科学 阅读(230) 评论(0) 推荐(0) 编辑
摘要: 学习hadoop的过程中涉及到了jni,了解了下jni的原理: jni,java native interface,它弥补了JAVA的与平台无关这一优点的不足,在JAVA实现跨平台的同时,也能与其它语言(如C、C++)的动态库进行交互,给其它语言发挥优势的机会。应用于性能要求高,有系统调用的时候。 具体步骤: 创建TestJni.java public class TestJni... 阅读全文
posted @ 2015-03-05 13:08 当数据爱上科学 阅读(118) 评论(0) 推荐(0) 编辑
摘要: Write a SQL query to rank scores. If there is a tie between two scores, both should have the same ranking. Note that after a tie, the next ranking number should be the next consecutive integer value. ... 阅读全文
posted @ 2015-03-04 22:34 当数据爱上科学 阅读(303) 评论(0) 推荐(0) 编辑
摘要: Given a string, find the length of the longest substring without repeating characters. For example, the longest substring without repeating letters for "abcabcbb" is "abc", which the length is 3. F... 阅读全文
posted @ 2015-03-02 16:14 当数据爱上科学 阅读(154) 评论(0) 推荐(0) 编辑
摘要: Given an array of integers, find two numbers such that they add up to a specific target number. The function twoSum should return indices of the two numbers such that they add up to the target, wh... 阅读全文
posted @ 2015-03-02 15:53 当数据爱上科学 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 简单的vim配置,自己用的: "传说中的去掉边框用下边这一句 set go= "设置配色,这里选择的是desert,也有其他方案,在vim中输入:color 在敲tab键可以查看 color desert "设置背景色,每种配色有两种方案,一个light、一个dark set background=light "打开语法高亮 synta... 阅读全文
posted @ 2015-03-01 16:15 当数据爱上科学 阅读(186) 评论(0) 推荐(0) 编辑
摘要: 1单例模式 定义:确保一个类只有一个实例,并提供一个全局访问点; 使用场景:有一些对象我们只需要一个,例如:线程池,缓存,对话框,注册表的对象,日志对象等,假如出现多个反而会出现问题; 与全局变量相比:首先你要明白第一点,单例模式既然能出现这么多年就说明它肯定有它的优势才对;另一方面:使用单例模式相比如全局变量,它既有全局变量的优点,提供一个全局访问点,同时没有全局变量所带来一开始就要求创建好对... 阅读全文
posted @ 2015-02-28 19:08 当数据爱上科学 阅读(147) 评论(0) 推荐(0) 编辑