<?xml version="1.0" encoding="utf-8" ?><rss version="2.0"><channel><title><![CDATA[hb_peng的专栏]]></title><description><![CDATA[]]></description><link>https://blog.youkuaiyun.com/hb_peng</link><language>zh-cn</language><generator>https://blog.youkuaiyun.com/</generator><copyright><![CDATA[Copyright &copy; hb_peng]]></copyright><item><title><![CDATA[springboot maven多模块构建最简化配置]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/79416939</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/79416939</guid><author>hb_peng</author><pubDate>Thu, 01 Mar 2018 20:30:48 +0800</pubDate><description><![CDATA[一直在本地运行的多模块项目需要放到服务器上，于是开始打包；以前没有接触过多模块的项目，碰到了一些坑，下面给正确的配置发出来：整个项目分为三个模块：common，core，web；core依赖common，web依赖common和core；在common和core（被依赖的module）的pom.xml中添加如下配置：&amp;lt;build&amp;gt;
    &amp;lt;plugins&amp;gt;
       ...]]></description><category></category></item><item><title><![CDATA[二分查找总结]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/52463567</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/52463567</guid><author>hb_peng</author><pubDate>Wed, 07 Sep 2016 21:51:34 +0800</pubDate><description><![CDATA[今天搜狐笔试，有一道算法题：给定排好序的成绩数组和及格分数线，要求找出及格的人数。
看到这个题就知道有坑，及格分数线的分数不一定出现在数组之中，而且分数还有可能有重复的，最普通的二分查找法根本没办法处理这种情况，最后这题打得不怎么样。
镇定思痛，看到一个还不错的总结：http://www.cnblogs.com/ider/archive/2012/04/01/binary_search.htm]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【337】 House Robber III]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/52411466</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/52411466</guid><author>hb_peng</author><pubDate>Fri, 02 Sep 2016 10:25:35 +0800</pubDate><description><![CDATA[The thief has found himself a new place for his thievery again. There is only one entrance to this area, called the "root." Besides the root, each house has one and only one parent house. After a tour]]></description><category></category></item><item><title><![CDATA[Java反射用法详解]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/52331540</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/52331540</guid><author>hb_peng</author><pubDate>Fri, 26 Aug 2016 21:27:37 +0800</pubDate><description><![CDATA[在过去的几次面试中，都被问到了反射这块的知识，并没有系统了解过Java的反射机制（现实是几乎怎么接触过），所以这方面的问题基本都回答不上来T_T
镇定思痛，我们来一起好好看看Java中反射的用法。]]></description><category></category></item><item><title><![CDATA[ThreadLocal与WeakReference 源码分析]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/52189494</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/52189494</guid><author>hb_peng</author><pubDate>Fri, 12 Aug 2016 10:53:26 +0800</pubDate><description><![CDATA[上篇了解通过源码，使用场景等等了解下ThreadLocal（地址：http://blog.youkuaiyun.com/hb_peng/article/details/52188960）
其中讲到ThreadLocalMap继承了软应用类，但是为什么这么做，原理是什么却并没有讲。 

首先了解下WeakReference，在 http://www.jianshu.com/p/c0ca0db80299 里]]></description><category></category></item><item><title><![CDATA[Java并发编程：深入剖析ThreadLocal]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/52188960</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/52188960</guid><author>hb_peng</author><pubDate>Fri, 12 Aug 2016 10:17:58 +0800</pubDate><description><![CDATA[想必很多朋友对ThreadLocal并不陌生，今天我们就来一起探讨下ThreadLocal的使用方法和实现原理。首先，本文先谈一下对ThreadLocal的理解，然后根据ThreadLocal类的源码分析了其实现原理和使用需要注意的地方，最后给出了两个应用场景。
　　以下是本文目录大纲：
　　一.对ThreadLocal的理解
　　二.深入解析ThreadLocal类
　　三.Thread]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【85】 Maximal Rectangle]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/52174361</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/52174361</guid><author>hb_peng</author><pubDate>Wed, 10 Aug 2016 17:25:03 +0800</pubDate><description><![CDATA[Given a 2D binary matrix filled with 0's and 1's, find the largest rectangle containing only 1's and return its area.
For example, given the following matrix:
1 0 1 0 0
1 0 1 1 1
1 1 1 1 1
1 0 0 1 0]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【78】Subsets]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/51261972</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/51261972</guid><author>hb_peng</author><pubDate>Wed, 27 Apr 2016 16:21:17 +0800</pubDate><description><![CDATA[Given a set of distinct integers, nums, return all possible subsets.
Note:


Elements in a subset must be in non-descending order.The solution set must not contain duplicate subsets.
For example,]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【76】Minimum Window Substring]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/51249279</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/51249279</guid><author>hb_peng</author><pubDate>Tue, 26 Apr 2016 12:00:50 +0800</pubDate><description><![CDATA[Given a string S and a string T, find the minimum window in S which will contain all the characters in T in complexity O(n).
For example,
S = "ADOBECODEBANC"
T = "ABC"

Minimum window is "BANC".]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【73】Set Matrix Zeroes]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/51220583</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/51220583</guid><author>hb_peng</author><pubDate>Fri, 22 Apr 2016 15:39:29 +0800</pubDate><description><![CDATA[Given a m x n matrix, if an element is 0, set its entire row and column to 0. Do it in place.
click to show follow up.
Follow up:
Did you use extra space?
A straight forward solution using O(mn) s]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【72】Edit Distance]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/51212740</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/51212740</guid><author>hb_peng</author><pubDate>Thu, 21 Apr 2016 20:51:56 +0800</pubDate><description><![CDATA[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.)
You have the following 3 operations permitted on a word:]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【71】Simplify Path]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/51201203</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/51201203</guid><author>hb_peng</author><pubDate>Wed, 20 Apr 2016 15:36:26 +0800</pubDate><description><![CDATA[Given an absolute path for a file (Unix-style), simplify it.
For example,
path = "/home/", => "/home"
path = "/a/./b/../../c/", => "/c"
这道题一开始没想好，直接进行处理，结果写出的代码又臭又长，而且是用了提交大法，错了N多次才成功的。
以下为第一次AC时]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【69】Sqrt(x)]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/51191597</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/51191597</guid><author>hb_peng</author><pubDate>Tue, 19 Apr 2016 16:22:33 +0800</pubDate><description><![CDATA[Implement int sqrt(int x).
Compute and return the square root of x.
这道题目没看到二分查找的提示的时候感觉还是比较难的，虽然用自己的方法能做出来，但是性能太差了。
在不管使用什么方法时都要注意不要出现比x大的int型变量，否则极易溢出。n^2 > x 这种表达式最好都改写为 n > x /2.
java实现如下：
pub]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【68】Text Justification]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/51189109</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/51189109</guid><author>hb_peng</author><pubDate>Tue, 19 Apr 2016 11:59:01 +0800</pubDate><description><![CDATA[Given an array of words and a length L, format the text such that each line has exactly
L characters and is fully (left and right) justified.
You should pack your words in a greedy approach; that is]]></description><category></category></item><item><title><![CDATA[Java Web中乱码问题的总结]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/51122861</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/51122861</guid><author>hb_peng</author><pubDate>Mon, 11 Apr 2016 16:57:38 +0800</pubDate><description><![CDATA[最近一直在迁移实验室的网站，这些网站都是以前师兄编写的，年代有点久远，运行于jdk4 + tomcat4，由于一些原因现在必须要迁移到jdk7+tomcat7的环境中，迁移过程中最让我头疼的就是各种花式乱码。
        乱码大都是前台传到后台时出现乱码，师兄的程序中也对这个部分做了一些处理：后台取到的值先按照ISO-8599-1格式转换，然后转为GBK格式(前台传入的格式就是GBK)；]]></description><category></category></item><item><title><![CDATA[Hibernate防止SQL注入攻击的方法]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/50758864</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/50758864</guid><author>hb_peng</author><pubDate>Sun, 28 Feb 2016 09:43:05 +0800</pubDate><description><![CDATA[如果在查询字段中输入单引号"'"，则会报错，这是因为输入的单引号和其他的sql组合在一起编程了一个新的sql，实际上这就是SQL注入漏洞，后来我在前台和后台都对输入的字符进行了判断。
 
永远也不要写这样的代码：
     String queryString = "from Item i where i.description like '" + searchString + "'";
]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【63】Unique Paths II]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/50717985</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/50717985</guid><author>hb_peng</author><pubDate>Mon, 22 Feb 2016 17:11:43 +0800</pubDate><description><![CDATA[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 empty space is marked as 1 and 0 respectively in the grid.]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【60】Permutation Sequence]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/50703972</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/50703972</guid><author>hb_peng</author><pubDate>Sat, 20 Feb 2016 11:06:38 +0800</pubDate><description><![CDATA[The set [1,2,3,…,n] contains a total of n! unique permutations.
By listing and labeling all of the permutations in order,
We get the following sequence (ie, for n = 3):

"123""132""213""231""312""]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【56】Merge Intervals]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/50698235</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/50698235</guid><author>hb_peng</author><pubDate>Fri, 19 Feb 2016 19:53:22 +0800</pubDate><description><![CDATA[Given a collection of intervals, merge all overlapping intervals.
For example,
Given [1,3],[2,6],[8,10],[15,18],
return [1,6],[8,10],[15,18].
这道题最好在57题做完了之后再做，leetcode上的这个顺序正好反过来了。
一开始直接上手这个题目的思路]]></description><category></category></item><item><title><![CDATA[LeetCode_OJ【57】Insert Interval]]></title><link>https://blog.youkuaiyun.com/hb_peng/article/details/50696836</link><guid>https://blog.youkuaiyun.com/hb_peng/article/details/50696836</guid><author>hb_peng</author><pubDate>Fri, 19 Feb 2016 15:03:45 +0800</pubDate><description><![CDATA[Given a set of non-overlapping intervals, insert a new interval into the intervals (merge if necessary).
You may assume that the intervals were initially sorted according to their start times.
Examp]]></description><category></category></item></channel></rss>