- 博客(49)
- 资源 (2)
- 收藏
- 关注
原创 在ubuntu12.04LTS上编译64位hadoop-2.3.0并安装测试 单节点
先看一下安装完之后的版本情况$ java -versionjava version "1.7.0_51"Java(TM) SE Runtime Environment (build 1.7.0_51-b13)Java HotSpot(TM) 64-Bit Server VM (build 24.51-b03, mixed mode)$ hadoop versionHadoop
2014-03-02 22:32:55 1317
原创 vim和系统剪贴板的交互
vim中用yy这种命令yark复制的内容到vim的寄存器中,没法和粘帖到vim以外的地方,如浏览器中什么的。同样用"+p也不能把系统剪贴板中的内容复制到vim编辑的文件中。看了这两篇博文,找了问题所在和解决方案。http://hi.baidu.com/buptwinnie/item/270a11dce9a57fec785daaf8http://www.cnblogs.com
2014-03-02 20:52:21 975
原创 智能指针——《C++ Primer》 Chapter14
最近开始学习C++,重新读读一直都没有读完的C++ Primer。随带敲敲书上的代码和习题,或者做一些扩展。在这里做一些总结和记录,权当是读书笔记吧。###############################################################概述:Chapter14主要讲了一些操作符重载的问题IO重载为什么要用友元函数?前++和后+
2013-11-08 12:35:29 815
原创 LeetCode —— Median of Two Sorted Arrays
链接:http://leetcode.com/onlinejudge#question_4原题:There are two sorted arrays A and B of size m and n respectively. Find the median of the two sorted arrays. The overall run time complexity should b
2013-09-05 19:30:00 758
原创 LeetCode -- Longest Palindromic Substring
链接:http://leetcode.com/onlinejudge#question_5原题:Given a string S, find the longest palindromic substring in S. You may assume that the maximum length of S is 1000, and there exists one uniqu
2013-09-05 15:21:23 573
原创 LeetCode —— Trapping Rain Water
链接:http://leetcode.com/onlinejudge#question_42原题:Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after r
2013-09-03 14:02:12 601
原创 LeetCode —— Regular Expression Matching
链接:http://leetcode.com/onlinejudge#question_10原题:Implement regular expression matching with support for '.' and '*'.'.' Matches any single character.'*' Matches zero or more of the preceding
2013-09-03 11:09:29 1083
原创 LeetCode —— Valid Number
链接:http://leetcode.com/onlinejudge#question_65原题:Validate if a given string is numeric.Some examples:"0" => true" 0.1 " => true"abc" => false"1 a" => false"2e10" => trueN
2013-09-03 09:31:48 927
原创 LeetCode —— Unique Binary Search Trees II
链接:http://leetcode.com/onlinejudge#question_95原题:Given n, generate all structurally unique BST's (binary search trees) that store values 1...n.For example,Given n = 3, your program shoul
2013-09-03 09:26:25 715
原创 LeetCode -- Wildcard Matching
链接:http://leetcode.com/onlinejudge#question_44原题:Implement wildcard pattern matching with support for '?' and '*'.'?' Matches any single character.'*' Matches any sequence of characters (incl
2013-09-02 20:21:31 1387
原创 LeetCode —— Set Matrix Zeroes
链接:http://leetcode.com/onlinejudge#question_73原题:Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.Follow up:Did you use extra space?A stra
2013-08-31 15:39:06 551
原创 LeetCode——Divide Two Integers
链接:http://leetcode.com/onlinejudge#question_29原题:Divide two integers without using multiplication, division and mod operator.思路:把除数向左移位,然后去减被除数;只要小心INT_MIN就可以了,因为abs(INT_MIN)如果不转为long long的话,返回的
2013-08-25 19:38:53 633
原创 LeetCode —— Best Time to Buy and Sell Stock III
链接:http://leetcode.com/onlinejudge#question_123原题:Say you have an array for which the ith element is the price of a given stock on day i.Design an algorithm to find the maximum profit. You
2013-08-06 19:43:56 706
原创 LeetCode —— Anagrams
链接:http://leetcode.com/onlinejudge#question_49原题:Given an array of strings, return all groups of strings that are anagrams.Note: All inputs will be in lower-case.思路:什么是anagram?一个字符串,把它的字母任
2013-08-06 17:25:02 815
原创 LeetCode——Unique Paths II
链接:http://leetcode.com/onlinejudge#question_63原题:Follow up for "Unique Paths":Now consider if some obstacles are added to the grids. How many unique paths would there be?An obstacle and
2013-08-03 16:50:42 562
原创 LeetCode —— Largest Rectangle in Histogram
链接:http://leetcode.com/onlinejudge#question_84原题:Given n non-negative integers representing the histogram's bar height where the width of each bar is 1, find the area of largest rectangle in
2013-07-27 16:50:00 645
原创 LeetCode —— Scramble String
链接:http://leetcode.com/onlinejudge#question_87原题:Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.Below is one possible repr
2013-07-27 15:18:11 847
原创 LeetCode——Generate Parentheses
链接:http://leetcode.com/onlinejudge#question_22题目:Given n pairs of parentheses, write a function to generate all combinations of well-formed parentheses.For example, given n = 3, a solution s
2013-06-29 14:11:41 652
原创 LeetCode —— Sort Colors
链接:http://leetcode.com/onlinejudge#question_75原题:Given an array with n objects colored red, white or blue, sort them so that objects of the same color are adjacent, with the colors in the orde
2013-05-23 20:09:10 666
原创 Cygwin + vim
以前没有用过Cygwin,今天就下了一个玩玩。1)ls高亮默认情况下,ls的输出是没有高亮的。解决方案:把~/.bashrc里的alias ls='ls -hF --color=tty'这一行去掉#,即uncomment。2)vim默认情况下是不安装vim的,所以就重新运行setup.exe,在Editor里选上vim和vim-common我的 .vimrc
2013-05-05 15:33:17 901
原创 LeetCode——Word Ladder II
链接:http://leetcode.com/onlinejudge#question_126原题:Given two words (start and end), and a dictionary, find all shortest transformation sequence(s) from start to end, such that:Only one
2013-05-04 20:47:38 8707 8
原创 LeetCode——Surrounded Regions
链接:http://leetcode.com/onlinejudge#question_130原题:Given a 2D board containing 'X' and 'O', capture all regions surrounded by 'X'.A region is captured by flipping all 'O's into 'X's i
2013-05-04 16:47:33 831
原创 ENVI/IDL——Java-IDL Export Bridge
任务:要把一堆遥感图片每一个像素点所对应的波段值和经纬度等信息统一插入到数据库中,以方便查询管理。技术试探:上一篇博文http://blog.csdn.net/niaokedaoren/article/details/8881620,只是试探性的用代码读取波段值和经纬度。但是要处理多幅图片,势必要在几个文件夹之间游走,IDL在这方面貌似比较乏力;同时IDL虽然支持数据库的链
2013-05-03 21:06:06 2684
原创 ENVI/IDL——获取AVIRIS数据波段值和经纬度
以前,这一步,我都是手动导出的,详细请看另一篇博文:http://blog.chinaunix.net/uid-28490468-id-3462577.html最近要处理较多的遥感数据,所以要把这一步通过代码自动化。看了看help文档,发现ENVI支持一种叫IDL的语言,完全没有听说过,可能是我孤陋寡闻了,呵呵,有同感的举手。有好玩的东西,那么就开始学呗。打开ENVI+IDLX.X
2013-05-03 20:09:15 6618 3
原创 LeetCode —— Search in Rotated Sorted Array
链接:http://leetcode.com/onlinejudge#question_33原题:Suppose a sorted array is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are gi
2013-04-26 21:11:20 634
原创 LeetCode —— Sudoku Solver
链接:http://leetcode.com/onlinejudge#question_37原题:Write a program to solve a Sudoku puzzle by filling the empty cells.Empty cells are indicated by the character '.'.You may assume that th
2013-04-26 16:37:32 827
原创 LeetCode —— First Missing Positive
链接:http://leetcode.com/onlinejudge#question_41原题:Given an unsorted integer array, find the first missing positive integer.For example,Given [1,2,0] return 3,and [3,4,-1,1] return 2.Y
2013-04-26 16:15:07 547
原创 LeetCode —— Pow(x, n)
链接:http://leetcode.com/onlinejudge#question_50原题:Implement pow(x, n)思路:1次、2次、4次、8次这样算上去,其实就是n的二进制表示形式。当然要小心n是负数和底数是+1 和-1的时候,要优化。代码:class Solution {public: double pow(double x, in
2013-04-23 21:03:02 570
原创 LeetCode —— Search for a Range
链接:http://leetcode.com/onlinejudge#question_34原题:Given a sorted array of integers, find the starting and ending position of a given target value.Your algorithm's runtime complexity must be i
2013-04-23 20:45:44 1089
原创 LeetCode —— Word Search
链接:http://leetcode.com/onlinejudge#question_79原题:Given a 2D board and a word, find if the word exists in the grid.The word can be constructed from letters of sequentially adjacent cell, wher
2013-04-22 19:34:22 995
原创 LeetCode —— Distinct Subsequences
链接:http://leetcode.com/onlinejudge#question_115原题:Given a string S and a string T, count the number of distinct subsequences of T in S.A subsequence of a string is a new string which is fo
2013-04-22 13:41:56 828
原创 LeetCode -- 二叉树水题II
Binary Tree Level Order Traversal链接:http://leetcode.com/onlinejudge#question_102原题:Given a binary tree, return the level order traversal of its nodes' values. (ie, from left to right, level by l
2013-04-21 22:43:01 704
原创 LeetCode -- Recover Binary Search Tree
链接:http://leetcode.com/onlinejudge#question_99原题:Two elements of a binary search tree (BST) are swapped by mistake.Recover the tree without changing its structure.Note:A solution using O(n)
2013-04-21 21:28:33 873
原创 LeetCode —— Triangle
链接:http://leetcode.com/onlinejudge#question_120原题:Given a triangle, find the minimum path sum from top to bottom. Each step you may move to adjacent numbers on the row below.For example, giv
2013-04-20 20:58:25 511
原创 LeetCode —— Edit Distance
链接:http://leetcode.com/onlinejudge#question_72原题:Given two words word1 and word2, find the minimum number of steps required to convert word1 to word2. (each operation is counted as 1 step.)
2013-04-20 19:59:46 538
原创 LeetCode —— Decode Ways
链接:http://leetcode.com/onlinejudge#question_91原题:A message containing letters from A-Z is being encoded to numbers using the following mapping:'A' -> 1'B' -> 2...'Z' -> 26Given an en
2013-04-20 19:24:39 591
原创 LeetCode ——Subsets II
链接:http://leetcode.com/onlinejudge#question_90原题:Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in n
2013-04-20 18:45:32 533
原创 LeetCode —— 3SUM
3Sum链接:http://leetcode.com/onlinejudge#question_15原题: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
2013-04-20 15:21:05 1041
原创 LeetCode —— Combinations
链接:http://leetcode.com/onlinejudge#question_77原题:Given two integers n and k, return all possible combinations of k numbers out of 1 ... n.For example,If n = 4 and k = 2, a solution is:
2013-04-19 23:17:28 523
原创 LeetCode —— Reverse Linked List II
链接:http://leetcode.com/onlinejudge#question_92原题:Reverse a linked list from position m to n. Do it in-place and in one-pass.For example:Given 1->2->3->4->5->NULL, m = 2 and n = 4,r
2013-04-19 22:57:48 560
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人