- 博客(7)
- 收藏
- 关注
转载 Hibernate防止SQL注入攻击的方法
如果在查询字段中输入单引号"'",则会报错,这是因为输入的单引号和其他的sql组合在一起编程了一个新的sql,实际上这就是SQL注入漏洞,后来我在前台和后台都对输入的字符进行了判断。 永远也不要写这样的代码: String queryString = "from Item i where i.description like '" + searchString + "'";
2016-02-28 09:43:05 2693
原创 LeetCode_OJ【63】Unique Paths II
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.
2016-02-22 17:11:43 289
原创 LeetCode_OJ【60】Permutation Sequence
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""
2016-02-20 11:06:38 324
原创 LeetCode_OJ【56】Merge Intervals
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上的这个顺序正好反过来了。一开始直接上手这个题目的思路
2016-02-19 19:53:22 260
原创 LeetCode_OJ【57】Insert Interval
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
2016-02-19 15:03:45 282
原创 LeetCode_OJ【54】Spiral Matrix
Given a matrix of m x n elements (m rows, n columns), return all elements of the matrix in spiral order.For example,Given the following matrix:[ [ 1, 2, 3 ], [ 4, 5, 6 ], [ 7, 8, 9 ]]You
2016-02-18 09:35:44 266
原创 LeetCode_OJ【53】Maximum Subarray
Find the contiguous subarray within an array (containing at least one number) which has the largest sum.For example, given the array [−2,1,−3,4,−1,2,1,−5,4],the contiguous subarray [4,−1,2,1] has
2016-02-17 15:22:30 259
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人