- 博客(25)
- 资源 (1)
- 收藏
- 关注
原创 两数相加
Example:Given nums = [2, 7, 11, 15], target = 9,Because nums[0] + nums[1] = 2 + 7 = 9,return [0, 1].我的方法( O(n2) ):public class Solution { public int[] twoSum(int[] nums, int target)
2016-10-14 15:35:41 316
原创 完全分布式安装,注意事项
1.ssh完全安装的时候需要将每台机器的id_rsa.pub都写入到一个login.txt里,然后 cat login.txt >> authorized_keys每台机器都要有修改 authorized_keys的权限为600chmod 600 authorized_keys2.hbase再启动hbase的时候要先启动zookeeper在hbase的配置中zo
2016-01-18 10:33:57 416
原创 hive----MetaException(message:Could not connect to meta store using any of the URIs provided. Most r
16/01/08 18:52:54 [main]: WARN hive.metastore: Failed to connect to the MetaStore Server...org.apache.thrift.transport.TTransportException: java.net.ConnectException: Connection refused at
2016-01-08 18:54:40 2469
原创 datanode----nitialization failed for Block pool <registering> (Datanode Uuid unassigned) service to
2016-01-08 11:34:57,575 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode: Initialization failed for Block pool (Datanode Uuid unassigned) service to node167/172.24.2.167:9000. Exiting.java.io.
2016-01-08 11:41:08 4882
翻译 Bulb Switcher灯泡开关问题----Medium
There are n bulbs that are initially off. You first turn on all the bulbs. Then, you turn off every second bulb. On the third round, you toggle every third bulb (turning on if it's off or turning of
2015-12-22 14:11:39 355
原创 Delete Duplicate Emails---easy
删除Person表中重复的Email,只留下id最小的EmailPerson表,主键是Id+----+------------------+| Id | Email |+----+------------------+| 1 | john@example.com || 2 | bob@example.com || 3 | john@example
2015-11-02 21:26:34 250
原创 Rising Temperature--easy
一张Weather表,写出一个SQL语句实现昨天比今天气温高的Id+---------+------------+------------------+| Id(INT) | Date(DATE) | Temperature(INT) |+---------+------------+------------------+| 1 | 2015-01-01 |
2015-11-01 21:32:20 279
原创 Trips and Users --Hard
Trips表 status是枚举类型+----+-----------+-----------+---------+--------------------+----------+| Id | Client_Id | Driver_Id | City_Id | Status |Request_at|+----+-----------+-----------+
2015-10-30 19:12:47 317
原创 ubuntu14.+ 下 Flume+kafka+storm的配置
一、配置flume(apache-flume-1.6.0-src.tar.gz) 1.解压 tar -xvf apache-flume-1.6.0-src.tar.gz 2.配置环境变量 vi ~/.bash_profile export FLUME_HOME=/home/shaka/flume/flume-1.6.0 export
2015-10-24 17:21:17 696
原创 Two sum no map by C
#include #include int comp(const void *a,const void *b){ return *(int *)a-*(int *)b;}int* twoSum(int* nums, int numsSize, int target){ int k; int cpnums[numsSize]; for(k=0; k<num
2015-10-22 16:07:36 297
原创 文件分类算法-----KNN、决策树、支持向量机、K-mean(非文件分类算法)
分类:1.积极学习:在给定的训练元组之后、接受到测试元组之前就构造好分类模型。 算法:贝叶斯、基于规则的分类(决策树)、向后传播分类、SVM(支持向量机)、基于关联规则挖掘的分类2.消极学习:推迟建模,当给定训练元组时,简单的存储训练数据或简单处理,一直等到给定一个测试元组,再建立分类模型。 算法:邻近算法KNN(K-
2015-09-26 12:18:49 1707
原创 二维数组查找
题目:在一个二维数组中,每一行都按照从左到右递增的顺序排序,每一列都按照从上到下递增的顺序排序。请完成一个函数,输入这样的一个二维数组和一个整数,判断数组中是否含有该整数。时间限制:1秒 空间限制:32768Kclass Solution {public: bool Find(vector > array,int target) { int
2015-09-25 17:25:15 291
原创 C#里virtual和override
MSDN官方解释:The implementation of a virtual member can be changed by an overriding member in a derived class.意思就是虚类可以被重写覆盖Version with the Override and New Keywords地址连接:https://msdn.microsoft.c
2015-09-25 10:51:07 981
原创 字符串问题--转义字符串
1.转义字符串\\=\\123=S\t=Tab键(制表符)%d int类型的 %c 字符形式/指针 %s 字符串形式%1d int类型长度为1 例如:输入1,2,3 输出 1%5d 输入 1 输出 XXXX1 (X代表空格)%o 八进制数%x 十六进制数%i 八/十六进制数%u 无符号整型(存储像素)%hd,%ho,%hx,%
2015-09-24 16:36:35 399
原创 字符串问题--C里面的strcpy函数
源代码: char s1[]="12345",*s2="123467"; printf("s1 is:%s\n",s1) ; printf("s2 is:%s\n",s2) ; printf("s1's strlen:%d\n" ,strlen(s1)); printf("s1's sizeof:%d\n" ,sizeof(s1)); printf("s2's str
2015-09-24 16:34:36 495
原创 青蛙跳台问题
问题说明:一只青蛙一次可以跳上1级台阶,也可以跳上2级。求该青蛙跳上一个n级的台阶总共有多少种跳法。时间限制:1秒 空间限制:32768K看到这道题时我先想的是写下来规律f(1)=1,f(2)=2,f(3)=3,f(4)=5,f(5)=8,然后找不到规律,我就去百度了,知道了这是斐波那契递归,然后就用f(n)=f(n-1)+f(n-2) (n>2)来写,发现行不通,因为时间过长。于
2015-09-23 20:02:40 562
原创 Exception in thread "main" java.lang.NoClassDefFoundError: goetl/etl/Ip2Plac
问题:Exception in thread "main"java.lang.NoClassDefFoundError: goetl/etl/Ip2Plac解决方案:把包复制到lib文件夹下lib可能只能是root权限
2015-09-18 11:22:46 274
原创 NameNode---Exception in namenode join
问题:2015-09-12 13:04:56,954 FATALorg.apache.hadoop.hdfs.server.namenode.NameNode: Exception innamenode joinorg.apache.hadoop.hdfs.server.common.InconsistentFSStateException:Directory /home/hado
2015-09-18 11:21:33 1461
原创 MetaException(message:Got exception: org.apache.hadoop.ipc.RemoteException Cannot create directory /
问题:FAILED: Execution Error,return code 1 from org.apache.hadoop.hive.ql.exec.DDLTask.MetaException(message:Got exception:org.apache.hadoop.ipc.RemoteException Cannot create directory/user/hive/w
2015-09-18 11:19:23 3469
原创 SecondaryNameNode--Failed to start secondary namenode
问题FATALorg.apache.hadoop.hdfs.server.namenode.SecondaryNameNode: Failed tostart secondary namenodeorg.apache.hadoop.hdfs.server.common.InconsistentFSStateException:Directory /home/hadoop/dfs/t
2015-09-18 11:18:11 2041
原创 java.net.BindException: Port in use: 0.0.0.0:50070
问题java.net.BindException: Portin use: 0.0.0.0:50070解决方案ps aux | grep hadoopkill proessnum
2015-09-18 11:13:39 7931
原创 DataNode-- Initialization failed for block pool Block pool BP-1088120134-127.0.1.1-1441936318521
问题:2015-09-1110:06:00,571 FATAL org.apache.hadoop.hdfs.server.datanode.DataNode:Initialization failed for block pool Block poolBP-1088120134-127.0.1.1-1441936318521 (storage idDS-763621962-127.0.1
2015-09-18 11:10:14 2530
原创 在ubuntu14.04环境下搭建hive-0.12.0 64位系统
1.安装mysqlsudo apt-get install mysql-serversudo apt-get install mysql-client注意:设置用户密码进入mysqlmysql -u root -p更改用户密码:mysql admin -u root -p password2.配置hive1)配置cd /hive-0.12-0/c
2015-09-18 10:51:30 271
原创 在ubuntu14.04环境下搭建伪分布式hadoop-2.2.0 64位系统
1.创建新用户1)创建用户名是hadoopsudo useradd -m hadoop -s /bin/bash2)修改密码,输入两次sudo passwd hadoop3)添加管理员权限方法1--sudo adduser hadoop sudo方法2--sudo vi /etc/sudoers# User privilege specification
2015-09-18 09:22:02 491
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人