自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 在群晖NAS(DSM 7)使用 Nginx 安装 HTTP Git 服务器

【代码】群晖NAS(DSM 7)下配置nginx开发git http访问。

2023-06-28 09:58:43 1858

原创 回溯实现八皇后问题

同学吹牛说5分钟能写出八皇后问题实现,要打赌100块钱。我说200块钱半个小时,不算在纸上思考的时间。我也挺感兴趣,就一起写。他二十分钟就写出了(思路正确且简洁,就是后来发现答案不对),我大体思路对,但有点绕晕了。后来回家又重新写了一遍,花了半小时。天赋有限啊!import java.util.Arrays;/** * 回溯实现八皇后问题 * Created by

2017-03-25 10:28:05 425

原创 MySQL字符集问题

遇到了这么个问题,数据库表的字符集是utf8,但客户端程序在建立连接时设置了:set names latin1。 查询数据库中的中文字符“尊”的列,返回的是”尚“。 “尊”和“尚”被错误的认为是相等的。要解释上边的怪现象需要先明确以下几个概念:MySQL Charset(字符集)MySQL Collate(校对集)character_set_clientcharacter_set_co

2015-09-06 18:23:27 651

原创 HttpClient性能对比

httpclient性能对比

2015-06-07 19:39:44 9802 2

原创 [读书笔记]Maven主要概念:依赖

Maven的重要概念:依赖

2015-05-17 23:01:24 684

原创 Storm Starter例子RollingTopWords代码学习

Storm Starter例子RollingTopWords代码学习

2015-04-26 20:51:56 3012

原创 Java实现生产者,消费者问题

高手给布置的任务。多线程最开始学Java的时候学的,今天写得很顺,自己都觉得挺吃惊。还得查查资料,看这么写是不是最优的。package com.weishubin.thread;//生产者public class Producer implements Runnable { private ProductionStore store; public Producer

2015-03-01 22:29:20 541

原创 SpringMVC中的参数组装:HandlerMethodArgumentResolver

SpringMVC中参数组装:HandlerMethodArgumentResolverSpringMVC3.1引入了HandlerMethodArgumentResolver接口,Spring调用该接口实现Controller的参数装配。HandlerMethodArgumentResolver实现中会调用DataBinder,Converter等。常用的该接口实现类有:Servle

2015-02-23 22:14:50 14946 3

原创 [读书笔记] Spring MVC中的参数绑定

Spring通过ConversionService接口将请求参数转换为Controller方法中的参数。对具体的类型转换,Spring定义了三个接口:Converter,GenericConverter,ConverterFactory。Spring还定义了ConverterRegistry接口用于在ConversionService的实现类中添加和移除Converter。接口Conf

2015-02-20 11:45:57 1487

原创 [读书笔记]CSS绝对定位

设置CSS的绝对定位:{ position : absolute; top : 7px; right : 0 }此时元素会相对于body元素。可将其父元素定位设置为relative使该元素相对于父元素绝对定位。{ position : relative; }

2015-01-02 23:17:34 519

原创 [读书笔记]清除Float的方法

因为设置了float,元素的高度被忽略了,其下方元素会紧贴上来,可以使用如下两个方法避免。为元素样式设置:overflow:hidden为元素添加clearfix样式:.clearfix:before, .clearfix:after { content: ""; display: table; }.clearfix:after { clear: both; }.c

2015-01-02 13:07:17 603

原创 LeetCode:Intersection of Two Linked Lists

我的方案时间复杂度O(N+M),空间复杂度O(1):第一遍遍历两个列表,得到列表headA和headB的元素个数N,M,假设N>M。然后headA从第N-M个元素开始遍历,headB从第一个元素开始遍历,遇到相等的元素返回。如果遍历到末尾都不相等,返回NULL。与标准答案的复杂度是一样的,我的方法更好理解些。public class Solution { pu

2014-11-28 23:09:59 1239

原创 LeetCode:Simplify Path

这题不难,我用20分钟搞定了,一次提交通过,bi

2014-11-06 09:20:59 596

原创 LeetCode:Generate Parentheses

回溯。这题写得buj

2014-11-05 17:40:13 499

原创 LeetCode:First Missing Positive

这是一道非常有意思的题目。思路很难想到,我就没想到,是看

2014-10-31 17:46:26 567

原创 LeetCode:Reverse Words in a String

题目比较简单,需要注意两个连续的空格的时候输出为一个k

2014-10-24 11:21:06 619

原创 LeetCode:Max Points on a Line

意识到下边这点是关键:确定一条直线的方式:斜率

2014-10-23 21:52:54 511

原创 LeetCode:Evaluate Reverse Polish Notation

这题比较简单,堆栈的应用,记得大学的时候学过。

2014-10-23 10:36:55 461

原创 LeetCode:Maximum Product Subarray

这题用动态规划会超时()

2014-10-22 22:38:53 420

原创 LeetCode:Find Minimum in Rotated Sorted Array

二分查找

2014-10-22 14:00:46 555

原创 八皇后问题

最近在学C语言,就用C重写了yi bian

2014-09-09 23:06:47 652

原创 maven下配置程序自动部署到tomcat7

具体步骤网上有不少教程,可参考。我的问题是调用mvn tomcat7

2014-05-02 07:41:38 653

原创 LeetCode:Subsets

Given a collection of integers that might contain duplicates, S, return all possible subsets.Note:Elements in a subset must be in non-descending order.The solution set must not contain dupli

2013-10-16 17:49:43 1039

原创 LeetCode:Subsets

Given a set of distinct integers, S, 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,

2013-10-16 17:25:13 1272

原创 LeetCode:Search Insert Position

Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were inserted in order.You may assume no duplicates in the array.

2013-10-16 14:53:55 613

原创 LeetCode:Permutations

Given a collection of numbers, return all possible permutations.For example,[1,2,3] have the following permutations:[1,2,3], [1,3,2], [2,1,3], [2,3,1], [3,1,2], and [3,2,1].是道搜索题,这种类

2013-10-15 19:24:15 1429

原创 LeetCode:Rotate Image

You are given an n x n 2D matrix representing an image.Rotate the image by 90 degrees (clockwise).Follow up:Could you do this in-place?坐标转换public void rotate(int[][] matrix) { if

2013-10-15 16:17:48 716

原创 LeetCode:Combinations

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:[ [2,4], [3,4], [2,3], [1,2], [1,3], [1,4],]

2013-10-11 16:37:40 621

原创 LeetCode:Construct Binary Tree from Preorder and Inorder Traversal

Given preorder and inorder traversal of a tree, construct the binary tree.Note:You may assume that duplicates do not exist in the tree.以前在某ACM网站做过这个题,没用递归,差点死了。这题用递归实现很简单。pub

2013-10-10 14:02:59 1059

原创 LeetCode:Word Break II

Given a string s and a dictionary of words dict, add spaces in s to construct a sentence where each word is a valid dictionary word.Return all such possible sentences.For example, givens = "

2013-10-10 11:32:55 3245

原创 LeetCode:Word Break

Given a string s and a dictionary of words dict, determine if s can be segmented into a space-separated sequence of one or more dictionary words.For example, givens = "leetcode",dict = ["leet"

2013-10-08 13:38:40 2250

原创 LeetCode:Copy List with Random Pointer

A linked list is given such that each node contains an additional random pointer which could point to any node in the list or null.Return a deep copy of the list.我没想出来合适的算法,看了微信公众账号待字闺中的

2013-10-08 11:22:26 2444

原创 LeetCode:Substring with Concatenation of All Words

You are given a string, S, and a list of words, L, that are all of the same length. Find all starting indices of substring(s) in S that is a concatenation of each word in L exactly once and without an

2013-10-04 11:01:25 864

原创 LeetCode:Candy

There are N children standing in a line. Each child is assigned a rating value.You are giving candies to these children subjected to the following requirements:Each child must have at least on

2013-10-02 16:59:27 2361 1

原创 LeetCode:Clone Graph

Clone an undirected graph. Each node in the graph contains a label and a list of its neighbors.OJ's undirected graph serialization:Nodes are labeled from 0 to N - 1, where N is the total nodes

2013-09-30 12:25:42 2727 2

原创 LeetCode:Gas Station

There are N gas stations along a circular route, where the amount of gas at station i is gas[i].You have a car with an unlimited gas tank and it costs cost[i] of gas to travel from station i to

2013-09-30 12:19:21 7462 2

原创 LeetCode:Remove Duplicates from Sorted List II

Given a sorted linked list, delete all nodes that have duplicate numbers, leaving only distinct numbers from the original list.For example,Given 1->2->3->3->4->4->5, return 1->2->5.Given 1->1-

2013-09-16 11:01:41 805

原创 LeetCode:Partition List

Given a linked list and a value x, partition it such that all nodes less than x come before nodes greater than or equal to x.You should preserve the original relative order of the nodes in each

2013-09-15 22:32:42 2113

原创 LeetCode:Gray Code

The gray code is a binary numeral system where two successive values differ in only one bit.Given a non-negative integer n representing the total number of bits in the code, print the sequence of

2013-09-15 21:52:55 1133

原创 LeetCode:Word Search

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, where "adjacent" cells are those horizontally or vertically

2013-09-03 16:35:15 880

空空如也

空空如也

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

TA关注的人

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