自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(49)
  • 收藏
  • 关注

原创 oozie sharelib问题

启动Oozie之后oozie-error.log会显示ERROR ShareLibService:517 - SERVER[master] org.apache.oozie.service.ServiceException: E0104:Could not fully initialize service [org.apache.oozie.service.ShareLibService], Not

2016-06-22 09:50:45 2586

原创 Azkaban Getting Started

solo server mode1. set up Solo ServerGrab the azkaban-exec-server package from the downloads page.Azkaban Solo Server: http://azkaban.github.io/downloads.html//start the solo serversudo bin/azkaban-so

2016-06-13 21:55:37 452

原创 STL-priority_queue

参考http://www.cplusplus.com/reference/queue/priority_queue/priority_queue/347. Top K Frequent Elementsmost votes:class Solution {public: vector<int> topKFrequent(vector<int>& nums, int k) {

2016-05-30 16:25:25 394

原创 Algorithm_DP

1. 矩阵DP(坐标)triangle unique path sum 二维DPjump game 一维 climbing stairs 一维DP2. 分割DP如果限制了切割的字符串的个数(为k),那么就是二维; f[i][j] = 前i个字符,切成j个单词,是否可行如果没有限制 f[i] 表示前i个字符,能否完美切割3. 区间DP4. 两个序列的DP

2016-05-27 09:25:40 496

原创 Algorithm_Linked List

Sort List Problem For God’s sake, don’t try sorting a linked list during the interview So it might be better to actually copy the values into an array and sort them there.Tip: Since a node may

2016-05-25 19:16:09 334

原创 Apache Oozie - the workflow scheduler for hadoop

One of Oozie’s strengths is that it was custom built from the ground up for Hadoop. This not only means that Oozie works well on Hadoop, but that the authors of Oozie had an opportunity to build a new

2016-05-19 19:59:05 1345

原创 php面试总结

1. php中include和require的区别都是包括并运行指定文件include()【运行时解析】在实行文件每次都要进行读取和评估,include()出错时可以继续运行。require()【运行前解析】文件只处理一次,文件内容替换require语句部分,require()部分出错主程序会停止。增加_once()之后表示已经加载的文件将不会被再次加载。2. curl与file_get_conte

2016-05-17 12:25:43 440

原创 websites-pages-jekyll - github blog

安装jekyll 参考https://jekyllrb.com/docs/installation/ 需要:nodejs,ruby(2.0以上),rubygems,python等//环境$sudo apt-get install nodejs//安装ruby 2.0$sudo apt-add-repository ppa:brightbox/ruby-ng-experimental &&$

2016-05-15 16:36:51 293

原创 hive

参考文章http://www.tuicool.com/articles/bmUjAjj 1. 安装环境:jdk,hadoop,mysql 在mysql中创建hive数据库>use mysql;>insert into user(Host,User,Password) values("localhost","hive",password("hive"));>FLUSH PRIVILEGES;

2016-05-10 10:04:55 308

原创 Hue-安装-配置-添加Oozie

安装步骤参考 http://gethue.com/how-to-build-hue-on-ubuntu-14-04-trusty/ 配置步骤参考 http://shiyanjun.cn/archives/1002.html修改配置文件$vi hue/desktop/conf/pseudo-distributed.ini 启动hue服务#build/env/bin/supervisor &e

2016-05-09 21:43:36 5004

原创 编写PHP扩展

参考博客:一步步入门编写PHP扩展扩展包括两个文件: 1. Configulator(告诉编译器依赖库 2. 实际执行的文件生成框架 进入PHP源码目录下的ext目录$cd /usr/local/src/php-7.0.1/ext//生成名为array_square_sum的扩展$ ./ext_skel --extname = array_square_sum

2016-04-29 13:40:57 338

原创 让你不再害怕指针【个人总结】

让你不再害怕指针 1. 指针的类型【指针本身所具有的类型】 把指针声明语句里的指针名字去掉,剩下的部分是这个指针的类型 2. 指针所指向的类型【通过指针来访问指针所指向的内存区时,指针所指向的类型决定了编译器将把那片内存区里的内容当做什么来看待】 把指针声明语句中的指针名字和名字左边的 * 去掉,剩下的就是指针所指向的内容 3. 指针的值(指针所指向的内存区或地址) 指针所指向的内存区就

2016-04-29 11:41:21 446

原创 Linux线程同步的三种方法

Linux 线程同步的三种方法线程的最大特点是资源的共享性,但资源共享中的同步问题是多线程编程的难点。linux下提供了多种方式来处理线程同步,最常用的是互斥锁、条件变量和信号量。 一、互斥锁(mutex) 通过锁机制实现线程间的同步。 1. 初始化锁。在Linux下,线程的互斥量数据类型是pthread_mutex_t。在使用前,要对它进行初始化。 静态分配:pthread_mutex_t

2016-04-29 11:40:25 7336

原创 STL之迭代器失效

STLSTL所有container都是sequence或associative container的model三种序列【sequence】: vector:快速随机访问【iterator易失效】 deque:高效率两段安插移除元素【iterator易失效】 list:双向链接链表【iterator不会失效】vector:实现方式是把元素安排在连续的存储块中,iterators可以是一般指针。v

2016-04-29 11:35:40 559

原创 YII框架

安装:step1. 安装composer$curl -sS https://getcomposer.org/installer | phpAll settings correct for using ComposerDownloading 1.0.1...Composer successfully installed to: /home/hanying/nginx/composer.pharU

2016-04-29 11:33:45 936

原创 vim插件

1. pathogen https://github.com/tpope/vim-pathogen 安装pathogen之后把插件安装到~/.vim/bundle/目录下2. nerdtree git clone http://github.com/scrooloose/nerdtree.git.vimrcnmap <silent> <c-n> :NERDTreeToggle<CR>3.

2016-04-11 15:14:35 416

原创 Oozie编译-安装-配置

Oozie是一种Java Web应用程序,它运行在Java servlet容器——即Tomcat——中,并使用数据库来存储以下内容: 1. 工作流定义 2. 当前运行的工作流实例,包括实例的状态和变量Oozie工作流是放置在控制依赖DAG(有向无环图 Direct Acyclic Graph)中的一组动作(例如,Hadoop的Map/Reduce作业、Pig作业等),其中指定了动作执行的顺序。我

2016-03-31 12:25:43 3812

原创 31. Next Permutation

题意: Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible

2016-01-31 16:46:00 339

原创 27. Remove Element

题意:Given an array and a value, remove all instances of that value in place and return the new length.The order of elements can be changed. It doesn’t matter what you leave beyond the new length. AC代码:c

2016-01-29 16:50:49 293

原创 26. Remove Duplicates from Sorted Array

题意: Given a sorted array, remove the duplicates in place such that each element appear only once and return the new length.Do not allocate extra space for another array, you must do this in place with

2016-01-29 16:12:45 276

原创 25. Reverse Nodes in k-Group

题意: Given a linked list, reverse the nodes of a linked list k at a time and return its modified list. If the number of nodes is not a multiple of k then left-out nodes in the end should remain as it i

2016-01-29 15:29:18 336

原创 24. Swap Nodes in Pairs

题意:Given a linked list, swap every two adjacent nodes and return its head. For example, Given 1->2->3->4, you should return the list as 2->1->4->3. Your algorithm should use only constant space. You

2016-01-28 16:01:30 256

原创 23. Merge k Sorted Lists

题意:Merge k sorted linked lists and return it as one sorted list. Analyze and describe its complexity. 分析:堆排序

2016-01-25 10:10:31 353

原创 Hadoop伪分布式

Hadoop伪分布式配置 参考:http://www.powerxing.com/install-hadoop/ step1. 下载Hadoop2.6.0版本,解压到/usr/local/hadoop step2. 修改配置文件(配置文件地址:/usr/local/hadoop/etc/hadoop) 1).core-site.xml<configuration> <property

2016-01-22 17:14:28 326

原创 22. Generate Parentheses

题意: Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses. For example, given n = 3, a solution set is: “((()))”, “(()())”, “(())()”, “()(())”, “()()(

2016-01-22 15:53:00 203

原创 21. Merge Two Sorted Lists

题意:Merge two sorted linked lists and return it as a new list. The new list should be made by splicing together the nodes of the first two lists.class Solution {public: ListNode* mergeTwoLists(List

2016-01-22 10:43:39 193

原创 20. Valid Parentheses

题意描述:Given a string containing just the characters ‘(‘, ‘)’, ‘{‘, ‘}’, ‘[’ and ‘]’, determine if the input string is valid. The brackets must close in the correct order, “()” and “()[]{}” are all vali

2016-01-21 13:51:35 209

原创 19. Remove Nth Node From End of List

题意:Given a linked list, remove the nth node from the end of list and return its head.Given linked list: 1->2->3->4->5, and n = 2. After removing the second node from the end, the linked list becomes

2016-01-21 13:27:51 187

原创 18. 4Sum

题意:Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.分析:同3Sum一样的思路,多加了一层循环。

2016-01-21 12:52:04 261

原创 17. Letter Combinations of a Phone Number

题意:Given a digit string, return all possible letter combinations that the number could represent. Input:Digit string “23” Output: [“ad”, “ae”, “af”, “bd”, “be”, “bf”, “cd”, “ce”, “cf”]. 思路:类似n进制数

2016-01-19 19:07:44 291

原创 16. 3Sum Closest

题意:Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exact

2016-01-19 15:51:22 232

原创 15. 3Sum

题意:Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. 思路: 先排序,两层循环,外层表示求和的第一个数,内层循环设两个游标,指向剩余数

2016-01-19 15:49:23 221

原创 10. Regular Expression Matching

题意描述:Implement regular expression matching with support for ‘.’ and ‘*’. ‘.’ Matches any single character. ‘*’ Matches zero or more of the preceding element.The matching should cover the entire input

2016-01-15 10:55:47 365

原创 14. Longest Common Prefix

题意:Write a function to find the longest common prefix string amongst an array of strings. 分析:找最长前缀AC代码:string longestCommonPrefix(vector<string>& strs){ string prefix; int prefix_length = 0;

2016-01-13 15:57:00 214

原创 13. Roman to Integer

题意:Given a roman numeral, convert it to an integer. Input is guaranteed to be within the range from 1 to 3999.AC代码:int romanToInt(string s){ int ret = 0; for(int i = 0; i < s.size(); ++i){

2016-01-13 15:23:11 244

原创 12. Integer to Roman

题意:Given an integer, convert it to a roman numeral. Input is guaranteed to be within the range from 1 to 3999.分析: 数字对应罗马字符: I placed before V or X indicates one less, so four is IV (one less than fiv

2016-01-13 12:03:37 276

原创 11. Container With Most Water

题意描述:Given n non-negative integers a1, a2, …, an, where each represents a point at coordinate (i, ai). n vertical lines are drawn such that the two endpoints of line i is at (i, ai) and (i, 0). Find tw

2016-01-13 09:20:26 243

原创 学习shell script

为了给我的LNMP写启动脚本,现在来跟鸟哥学习shell scriptscript执行方式直接执行(使用路径直接执行或使用bash/sh执行),会使用新的bash环境来执行脚本内的命令,其实实在子进程的bash内执行的,当子进程完成后,子进程的各项变量或操作将会结束不会传回到父进程中。source执行,会在父进程中执行。声明#!/bin/bashPATH=/bin:/sbin:~/bin

2016-01-07 20:43:05 304

转载 vim快捷键

NERDTreectrl+w+h #光标切换到左侧树形目录ctrl+w+l #光标切换到右侧文件显示窗口ctrl + w + w #光标自动在左右侧窗口切换ctrl + w + r #移动当前窗口的布局位置o #在已有窗口中打开文件、目录或书签,并跳到该窗口go #在已有窗口 中打开文件、目录或书签,但不跳到该窗口t #在新 Tab 中打开选

2016-01-07 17:34:53 243

原创 9. Palindrome Number

题意描述:Determine whether an integer is a palindrome(回文结构). Do this without extra space.AC代码:class Solution {public: bool isPalindrome(int x) { if(x < 0) return false; int

2016-01-07 14:54:10 229

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除