ITeye博客

liubangchuan的博客

liubangchuan · 共 10 篇文章

打造好用的mac终端

oh-my-zsh + iterm2 1. 下载 iterm2 MAC 自带的terminal功能稍微弱一点,因此我选择了iterm2,主要是看重了他的可分屏,高级功能 基本设置 启动hotkey window,这样在任何时候都可以唤出iterm2 Iterm -> Preference ->Keys ->hotkey 配色 使用了一款开源的配色方案, Solarized ,下载完之后双击,就可以导入到iterm2中。 我选择的是 solarized light 主题 Profiles -> open profiles -> colors 字体 使用得是开源的 Sauce Code Powe…

2013-11-26 23:29 · linux · 评论(0)

Centos 上升级 gcc

Centos 上面升级 gcc 转载 http://www.cnblogs.com/peterpanzsy/archive/2013/04/10/3006838.html mark 一下

2013-07-17 08:33 · linux · 评论(0)

REST简介

What is REST? REST的全称是Representational State Transfer 首先它是一种架构的风格,这种架构针对Network-based Application,这种架构风格可以给我们的webapplication起到一个指导的作用,而不是强制的。 架构的设计有两种思路,一种是空空的一张白纸,然后往里面添加组件,另外一种是一个完整架构,然后通过添加各种约束来对架构进行优化和筛减。而REST则属于后者。 REST的特点:REST本身并不是要基于HTTP,只是HTTP的许多特性和REST的表述不谋而合。 资源,在REST的世界里,所有的事物被称为资源,这里的资源…

2013-05-28 22:33 · REST · 评论(0)

LeetCode Problem:求字符串的最长回文子串

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 unique longest palindromic substring. 这个题目是一个很常见的面试题,有暴力穷举法,最长前缀法,还有一个非常巧妙的方法,manacher's algorithm, 看到这个算法的时候,发现真的是太优美了,不得不佩服设计出这个算法的人。 本文参考了这篇文章: http://blog.c…

2013-05-26 13:55 · 算法、数据结构 · 评论(0)

no attached in java.library.path

公司最近切换到Vmware虚拟机下面工作,run junit test case 的时候突然报一个很奇怪的错误 java.lang.UnsatisfiedLinkError: no attach in java.library.path 查了一下,原因是没有将java加入到PATH环境变量 将%JAVA_HOME%\bin 加入到环境变量即可

2013-05-23 16:23 · Java · 评论(0)

LeetCode Problem:求字符串的最长子串,子串的字符各不相同

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. For "bbbbb" the longest substring is "b", with the length of 1. 解法一: 遍历字符串,将每个字符放入到哈希表,利用哈希表来判断是否有重复的字符…

2013-05-18 17:28 · 算法、数据结构 · 评论(0)

LeetCode Problem:链表相加

You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and return it as a linked list. Input: (2 -> 4 -> 3) + (5 -> 6 -> 4) Output: 7 -> 0 -> 8 思路:遍历链表即可。 需要注意的两点: 1) 相加到10之后会进位…

2013-05-18 17:21 · 算法、数据结构 · 评论(0)

LeetCode Problem:两个有序数组的中位数

Median of Two Sorted Arrays 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 be O(log (m+n)). 这个题目是非常有名的面试题, 注意leetcode上面对中位数的定义是: 如果合并之后的数组元素个数是奇数,那么中位数就是中间的那位 如果合并之后的数组元素个数是奇数,那么中位数是中间两位的平均数 解题思路有三种 …

2013-05-17 00:39 · 算法、数据结构 · 评论(0)

LeetCode Problem:在一个数组中求满足和等于一定条件的两个数

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, where index1 must be less than index2. Please note that your returned answers (both index1 and index2) ar…

2013-05-14 23:44 · 算法、数据结构 · 评论(0)

LeetCode题目汇总

最近在做leetcode的题目,之后会把每个题目的程序发出来,以便做个记录,日后可以复习一下

2013-05-13 20:20 · 算法、数据结构 · 评论(0)