自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

  • 博客(265)
  • 资源 (10)
  • 收藏
  • 关注

原创 nginx配置

event配置worker_processes 4;events { use epoll; worker_connections 65535; accept_mutex off; multi_accept off;}服务器的连接配置keepalive_timeout 60;tcp_nodelay o...

2018-06-02 21:35:56 226

原创 Netty学习小记

Netty提供了方便快速的API用于搭建网络, 一下是我学习Netty后的一些小笔记Netty的线程模型 Netty使用React线程模型 具体Netty服务端的初始化如下public final class SecureChatServer { static final int PORT = Integer.parseInt(System.getProperty("p

2017-12-10 16:35:17 371

原创 Spring MVC annotation

Spring MVC 配置多个基于annotation的Controller时候 多个DispatcherServlet配置转发的的servlet-urlmap时候 DispatcherServlet 1, servletName = a, dispatcherServlet servlet-urlmap /a/*, 那么请求/a/user/get, 对应的Controller 的Requ

2017-08-10 20:39:50 332

翻译 MySQL在linux上的安装

下载MySQL二进制分发版本tar包 需要安装libaio的库shell> yum search libaio # search for infoshell> yum install libaio # install libraryshell> apt-cache search libaio # search for infoshell> apt-get install libaio1 #

2017-07-16 22:24:11 578

翻译 ActiveMQ学习笔记-消息特性

ActiveMQ消息属性消息属性 属性名 类型 默认值 描述 JMSDestination javax.jms.Destination 生产者set进去 发送消息目的地 JMSReplyTo javax.jms.Destination null 用户定义 JMSType String “” 用户定义

2017-05-20 23:01:05 2042

翻译 ActiveMQ学习笔记-分发策略

异步发送ActiveMQ默认的发送模式是异步发送,如果我们使用场景是非事务类型或者需要持久化消息,允许少量的消息丢失的话,推荐使用异步发送。同步发送需要增加ack的确认,这样子会增大时延和系统消耗。cf = new ActiveMQConnectionFactory("tcp://locahost:61616?jms.useAsyncSend=true");((ActiveMQConnectionF

2017-05-16 22:45:51 3381 1

翻译 ActiveMQ学习笔记目的地特性

组合目的地使用单一的虚拟目的地往目的地集合发送消息,用一个虚拟的队列网多个物理队列发送消息,这里使用到,这个特殊的分割符。// send to 3 queues as one logical operationQueue queue = new ActiveMQQueue("FOO.A,FOO.B,FOO.C");producer.send(queue, someMessage);

2017-05-15 21:46:37 1350

原创 51nod-加农炮

一个长度为M的正整数数组A,表示从左向右的地形高度。测试一种加农炮,炮弹平行于地面从左向右飞行,高度为H,如果某处地形的高度大于等于炮弹飞行的高度H(A[i] >= H),炮弹会被挡住并落在i - 1处,则A[i - 1] + 1。如果H <= A[0],则这个炮弹无效,如果H > 所有的A[i],这个炮弹也无效。现在给定N个整数的数组B代表炮弹高度,计算出最后地形的样子。 例如:地形高度A =

2017-05-09 21:53:09 389

原创 activemq-集群和主从模式 学习笔记

activemq主从模式与集群三种masterslave模式三种主从模式networkConnector模式activemq持久化comsumer特性destination特性消息分发策略消息特性message-features

2017-04-19 19:38:17 5888

原创 HTTP提交几种提交模式

get请求的时候,我们的参数直接反映在url里面,形式为key1=value1&key2=value2形式,比如:如果是post请求,那么表单参数是在请求体中,也是以key1=value1&key2=value2的形式在请求体中。通过chrome的开发者工具可以看到如下: 使用ajax提交的时候,要修改Content-Type 为json格式 同时使用JSON.stringify(jsonObj

2017-03-20 21:52:06 366

原创 leetcode:Assign Cookies

Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index.According to the definition of h-index on Wikipedia: “A scien

2017-02-26 00:10:52 241

原创 leetcode:H-Index II

Follow up for H-Index: What if the citations array is sorted in ascending order? Could you optimize your algorithm?Show Hint public class Solution { public int hIndex(int[] citations) { if(

2017-02-25 23:32:55 241

原创 leetcode: H-Index

Given an array of citations (each citation is a non-negative integer) of a researcher, write a function to compute the researcher’s h-index.According to the definition of h-index on Wikipedia: “A scien

2017-02-25 23:20:54 199

原创 leetcode:235. Lowest Common Ancestor of a Binary Search Tree

Given a binary search tree (BST), find the lowest common ancestor (LCA) of two given nodes in the BST.According to the definition of LCA on Wikipedia: “The lowest common ancestor is defined between two

2017-02-22 23:40:24 210

原创 leetcode:39. Combination Sum

Given a set of candidate numbers (C) (without duplicates) and a target number (T), find all unique combinations in C where the candidate numbers sums to T.The same repeated number may be chosen from C

2017-02-22 22:59:34 191

转载 Java虚拟机启动参数详解

转载之博客园java启动参数共分为三类; 其一是标准参数(-),所有的JVM实现都必须实现这些参数的功能,而且向后兼容; 其二是非标准参数(-X),默认jvm实现这些参数的功能,但是并不保证所有jvm实现都满足,且不保证向后兼容; 其三是非Stable参数(-XX),此类参数各个jvm实现会有所不同,将来可能会随时取消,需要慎重使用;一 标准参数中比较有效的verbose -verbose

2016-12-30 14:45:54 809

原创 leetcode:85. Maximal Rectangle

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 0im

2016-09-23 22:34:31 273

原创 leetcode:399. Evaluate Division

Equations are given in the format A / B = k, where A and B are variables represented as strings, and k is a real number (floating point number). Given some queries, return the answers. If the answer do

2016-09-16 03:23:56 616

原创 leetcode: Ransom Note

Given
 an 
arbitrary
 ransom
 note
 string 
and 
another 
string 
containing 
letters from
 all 
the 
magazines,
 write 
a 
function 
that 
will 
return 
true 
if 
the 
ransom 
 note 
can 
be 
construc

2016-08-28 14:49:11 384

原创 leetcode:Lexicographical Numbers

Given an integer n, return 1 - n in lexicographical order.For example, given 13, return: [1,10,11,12,13,2,3,4,5,6,7,8,9].Please optimize your algorithm to use less time and space. The input size may be

2016-08-28 14:36:07 478

原创 leetcode:First Unique Character in a String

Given a string, find the first non-repeating character in it and return it’s index. If it doesn’t exist, return -1.Examples:s = “leetcode” return 0.s = “loveleetcode”, return 2. 找出一个串里面第一个不重复的字母的下标

2016-08-28 14:11:45 373

原创 leetcode:Longest Absolute File Path

Suppose we abstract our file system by a string in the following manner:The string “dir\n\tsubdir1\n\tsubdir2\n\t\tfile.ext” represents:dir subdir1 subdir2 file.ext The directory di

2016-08-28 13:43:44 558

原创 leetcode:295. Find Median from Data Stream

Median is the middle value in an ordered integer list. If the size of the list is even, there is no middle value. So the median is the mean of the two middle value.Examples: [2,3,4] , the median is 3

2016-08-14 23:02:52 333

原创 tomcat

配置综述对tomcat服务器的配置,主要是指tomcat主目录下面conf文件夹下对各个配置文件的配置,包括用户权限访问控制,安全配置,集群配置,与HTTP服务器进行集成(Apache服务器,Nginx服务器等),JNDI资源的设置与访问等。以下是我个人学习tomcat.apache.org官网的一些笔记,或者是翻译。 配置文件可以描述为以下几种主要的目录: 1. Server:顶层元素

2016-08-02 23:13:48 533

转载 Linux防火墙的基本知识

本文转载之这里写链接内容一、防火墙的分类(一)、包过滤防火墙。 数据包过滤(packet Filtering)技术是在网络层对数据包进行选择,选择的依据是系统内设置的过滤逻辑,称为访问控制表(access control lable,ACL)。通过检查数据流中每个数据包的源地址和目的地址,所用的端口号和协议状态等因素,或他们的组合来确定是否允许该数据包通过。 包过滤防火墙的优点是它对用户来说是透

2016-08-02 22:50:08 508

原创 maven配置文件

maven工程下pom.xml一些常见配置常用插件配置 <build> <pluginManagement> <plugins> <!-- compiler插件, 设定JDK版本 --> <plugin> <groupId>org.apache.mav

2016-07-31 14:38:54 419

原创 Java泛型的类型擦除

JAVA的泛型是一种语法糖,当我们在新建一个容器类的时候,代码是这么编写的ArrayList<String> list = new ArrayList<String>();编译后的JAVA代码是等价于ArrayList list = new ArrayList();当中String的信息是不会带入到list中的, list的存放的东西都是Object类型,相当于容器类的个体在编译后类型被擦除了。

2016-07-18 20:39:27 343

原创 Redis3自带的ruby脚本和cluster命令的使用

Resharding the cluster所谓的对集群数据进行分片,就是把实例节点的一些hash桶转移到其他实例节点。我们使用ruby脚本进行分片: ./redis-trib.rb reshard 127.0.0.1:7000我们需要提供一个节点的ip跟端口用于定位redis集群,redis-trib.rb将会自动寻找集群中的其他节点,键入命令后,会提示我们要转移多少数据 How man

2016-07-17 15:17:56 1277

翻译 Redis3Cluster的学习笔记

redis3集群模式下的一些好处这是官方给出的:RedisCluster提供了数据在多个redis实例中分片的方式,automatically sharded across multiple Redis nodes。Redis在数据分片上提供了一定的可用性,在某些节点宕机或者无法连接时候提供了支持。(除非大多数的主redis服务都不可用): 数据自动分片在多实例中 当少数实例宕机时候仍

2016-07-07 23:20:07 1475

原创 hihocoder: 题外话·堆

时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述小Ho有一个糖果盒子,每过一段时间小Ho都会将新买来的糖果放进去,同时他也会不断的从其中挑选出最大的糖果出来吃掉,但是寻找最大的糖果不是一件非常简单的事情,所以小Ho希望能够用计算机来他帮忙计算这个问题!提示:吃糖果吃多了会变胖的!输入每个测试点(输入文件)有且仅有一组测试数据。在一组测试数据中:第1行为1个整数N,表

2016-06-19 00:51:08 293

原创 hihocoder:Lost in the City

时间限制:10000ms 单点时限:1000ms 内存限制:256MB 描述 Little Hi gets lost in the city. He does not know where he is. He does not know which direction is north.Fortunately, Little Hi has a map of the city. The map

2016-06-19 00:50:01 340

原创 leetcode:Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1’s in their binary representation and return them as an array.Example: For num = 5 you sh

2016-04-21 23:28:34 272

原创 leetcode: Longest Increasing Path in a Matrix

找出一个矩阵中最长的递增序列,求出最长长度是多少 Given an integer matrix, find the length of the longest increasing path.From each cell, you can either move to four directions: left, right, up or down. You may NOT move diago

2016-01-31 12:22:57 370

原创 leetcode:Additive Number

给出一串数字字符串,比如”112358”,它可以这样子构造 1 + 1 = 2, 1 + 2 = 3, 2 + 3 = 5, 3 + 5 = 8;“199100199” 1 + 99 = 100, 99 + 100 = 199 存在如下的限制 比如字符串1023 不能构成 1 + 02 = 3的形式,前面不能有前导0直接暴力搜索。深度优先import java.math.BigDecimal

2016-01-22 22:22:35 323

原创 leetcode:House Robber

给出一个数组,求出给数组的不连续相连数字的最大和 基础的dp题目使用dp[][i]表示数组下标为i的最大不连续和 其中dp[0][i]表示不取下标i的值 dp[1][i]表示取下标i的值 可以得到状态转移方程 dp[0][i] = max(dp[0][i-1], dp[1][i-1]) dp[1][i] =dp[0][i-1] + nums[i]public class Solution

2015-11-08 23:58:23 312

原创 leetcode:Missing Number

一个无序排序的数字在1-n的范围内,但是其中却少了一个数字,求出其中的一个直接用异或运算a^b=c可以知道b = c ^ a 或者 b = a ^ c满足交换律public class Solution { public int missingNumber(int[] nums) { int total = 0, k = 0; for(i

2015-11-08 22:58:15 308

转载 在Mac OS X编译安装Apache

本文转载于http://www.bicky.me/blog/archive/building-apache-and-php-on-os-x/Apache 2.2.27和PHP 5.5.12在Mac OS X 10.8.5编译安装过程: 在开始之前首先升级Xcode的组件: preferences => Downloads => 下载Command Line Tools包然后进入Apache的源码包

2015-11-01 22:37:26 1823

原创 linux svn服务器搭建笔记

自己申请了了一台DigitalOcean的服务器,用于平时个人玩着来用,搭了一个svn服务器,linux的发行版本是ubuntu使用一下svn这个命令,没有的话使用下面命令进行下载apt-get install subversion建立一个svn的存储目录svn create /home/svn这样子,会在/home/svn目录下面新建一些文件,这是svn的一些配置文件关注

2015-10-18 20:50:30 373

翻译 commons-pool的学习

在一些缓存,数据库的操作中总能看到commons-pool包的身影,从理论上,对一些实例化的成本的对象进行缓存,需要的时候从缓存池中拿出,可以降低应用的运行成本,提高效率,但是具体到实际中代码怎么实现,也是一知半解,简单阅读了apache官网的commons-pool的referrence,结合别人的理解,做一下笔记。从对象的角度看,commons-pool提供了两个基本的接口,PooledOb

2015-09-12 16:12:38 1437

原创 redis conf文件解释

redis里面的 的内存参数 1k = 1000bytes 1kb = 1024byte 1m = 1000000byte 1mb = 1024 * 1024 byte 其中MB,mB,mb,Mb代表的意思都是一样的 1 daemonize no 是否以守护线程的形式运行redis,默认为false 2 pidfile /var/run/redis.pid 运行后的redis的pi

2015-09-10 00:20:24 400

haproxy配置

haproxy配置。代理服务器

2017-08-15

redis二进制包及配置文件说明

redis的二进制版本配置文件demo

2016-12-20

maven仓库缺少lib

用于上传maven(1)缺少lib,csdn限制了每次上传的文件大小

2016-11-10

maven仓库(1)缺少lib

用于搭建maven私有仓库,用于本地备份

2016-11-10

redis3集群搭建

用于描述redis3集群的搭建

2016-07-31

weblogic使用手册

weblogic使用手册,十分详细,包括各个部分

2015-06-10

axis2与spring集成

axis2与spring的集成,在application中配置要发布的Java类,然后配置aar文件,在aar打包文件中的services.xml要嵌入 <parameter name="ServiceObjectSupplier">org.apache.axis2.extensions.spring.receivers.SpringServletContextObjectSupplier</parameter> <parameter name="SpringBeanName">springAwareService</parameter>

2015-05-14

zookeeper示例代码

zookeeper示例代码

2015-04-29

分布式服务框架 Zookeeper -- 管理分布式环境中的数据

存储描述zookeeper的简介,用于自身日后学习

2015-04-29

Web 服务编程技巧和窍门: 手工创建的 SOAP 消息中命名空间的处理

使用java进行webservice的开发Demo

2015-04-03

空空如也

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

TA关注的人

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