自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(21)
  • 问答 (1)
  • 收藏
  • 关注

原创 单例模式

单例模式:一个类只能创建一个对象的设计模式单例模式代码实现懒汉模式/* * 要想让一个类只能构建一个对象,则不能让他随便进行new,因此构造方法是私有的 * 懒汉模式(如果单例初始值为null,则构建单例对象) */public class Singleton { //私有构造函数 private Singleton() { } //单例对象 pr

2017-12-20 22:48:40 206

原创 159. Longest Substring with At Most Two Distinct Characters

题目描述Given a string, find the length of the longest substring T that contains at most 2 distinct characters. For example, Given s = “eceba”, T is “ece” which its length is 3.思路分析这题依旧是滑动窗口的思想 要求找到最长的只

2017-12-19 22:42:38 292

原创 76. Minimum Window Substring

题目描述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”.No

2017-12-19 19:15:00 203

原创 RabbitMQ

RabbitMQ,是一个使用erlang编写的AMQP(高级消息队列协议)的服务实现。消息队列有两种协议,一种是JMS,一种是AMQP,Spring提供了对这两种协议支持的Template,分别为JmsTemplate和AmqpTemplate,JmsTemplate的具体实现则是ActiveMqTemplate,而AmqpTemplate的具体实现是RabbitTemplate。消息队列服务有三

2017-12-18 20:18:32 305

原创 Authentication failed (rejected by the remote node), please check the Erlang cookie

安装RabbitMQ出现的问题记录: 命令行D:\soft\Rabbitmq\rabbitmq_server-3.7.0\sbin>rabbitmqctl status提示:Status of node rabbit@LAPTOP-SDG10LIN ...Error: unable to perform an operation on node 'rabbit@LAPTOP-SDG10LIN

2017-12-18 15:19:32 11414 1

原创 Spring Cloud Ribbon

Spring Cloud Ribbon是一个基于Http和TCP的客户端负载均衡工具,基于Netflix Ribbon实现。通过Spring Cloud的封装,可以让我们轻松的将面向服务的REST模板请求自动转换成客户端负载均衡的服务调用。新工具的产生往往是因为要解决旧工具存在的某些痛点,方便开发人员的开发。个人理解:Ribbon = RestTemplate+负载均衡 这里先介绍一下RestT

2017-12-17 12:47:42 364

原创 209. Minimum Size Subarray Sum

题目Given an array of n positive integers and a positive integer s, find the minimal length of a contiguous subarray of which the sum ≥ s. If there isn’t one, return 0 instead.For example, given the arra

2017-12-16 13:41:35 247 2

原创 Spring Cloud Eureka 服务注册与发现

Spring Cloud Eureka是基于Netflix Eureka的二次封装,主要负责完成微服务架构中的服务治理功能。 服务治理是微服务架构中最为核心和基础的模块,主要用来实现各个微服务实例的自动化注册和发现。Spring Cloud Eureka就是围绕这服务注册和服务发现机制来完成对微服务应用实例的自动化管理。Eureka基础架构服务端和客户端 服务端:服务注册中心 客户端:各

2017-12-16 11:17:17 329

原创 微服务构建:Spring Boot

Spring Boot——用于构建微服务的基础框架使用Spring框架时,会发现其配置文件比较复杂,许多内容经常都只是复制粘贴,比如通过Maven构建项目时,我们可以通过配置文件来自动导入依赖的jar包,但要使应用支持Spring,我们就要写不少代码,而且还要排查是否有遗漏的jar包,这不利于项目的快速构建和开发。spring boot的出现有效改善这种问题,它设计了大量的自动化配置来简化Spri

2017-12-16 09:52:27 899

原创 Spring Cloud

https://spring.io/官方对于Spring Cloud的描述: Built directly on Spring Boot’s innovative approach to enterprise Java, Spring Cloud simplifies distributed, microservice-style architecture by implementing pr

2017-12-15 22:16:05 371

原创 229. Majority Element II

题目描述Given an integer array of size n, find all elements that appear more than ⌊ n/3 ⌋ times. The algorithm should run in linear time and in O(1) space.思路分析对于上一题,数组中个数超过n/2的数值如果存在,则仅有一个。 数组中个数超过n/3的数值可

2017-12-15 13:10:31 211

原创 169. Majority Element

题目描述Given an array of size n, find the majority element. The majority element is the element that appears more than ⌊ n/2 ⌋ times.You may assume that the array is non-empty and the majority element alw

2017-12-15 10:29:30 181

原创 java中的线程池

Java中的线程池是运用场景最多的并发框架,几乎所有需要异步或者并发执行任务的程序都可以使用线程池。 具体的使用场景: 举例分析使用线程池的好处降低资源消耗 创建和销毁线程需要消耗资源,线程池可以重复利用已创建的线程,减少资源消耗。提高响应速度 创建线程需要时间,当任务到达时,立即执行,无需等待线程创建,这样可以节省时间,提高响应速度。提高线程的可管理性 线程的创建、销毁、控制管理、调优等

2017-12-15 09:55:37 179

原创 454. 4Sum Ⅱ

题目描述Given four lists A, B, C, D of integer values, compute how many tuples (i, j, k, l) there are such that A[i] + B[j] + C[k] + D[l] is zero.To make problem a bit easier, all A, B, C, D have same leng

2017-12-12 10:51:43 320

原创 18. 4Sum

题目描述Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target. Note: The solution

2017-12-12 10:28:39 185

原创 16.3Sum Closest

题目描述Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exac

2017-12-11 12:09:49 189

原创 15.3Sum

题目描述Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero. Note: The solution set must not contain

2017-12-11 11:47:38 263

原创 1.Two Sum

题目描述Given an array of integers, return indices of the two numbers such that they add up to a specific target. You may assume that each input would have exactly one solution, and you may not use the sa

2017-12-11 11:21:54 156

原创 3.Longest Substring Without Repeating Characters

题目描述:Given a string, find the length of the longest substring without repeating characters. Examples: Given “abcabcbb”, the answer is “abc”, which the length is 3. Given “bbbbb”, the answer is “b”,

2017-12-08 22:03:28 192

原创 Java 继承

简述 在设计类的时候,应该将通用的方法放在父类中,而将具有特殊用途的方法放在子类中。java面向对象编程,则我们在创建类时,有些类会具有公共的属性和方法,为了使代码能够复用,我们把这些几个类共有的属性和方法放在父类中,其他类继承这个父类,则便具有了父类公有的属性和方法,同时子类还可以添加一些新的属性和方法,以满足新的需求。关键字extendsclass Manager extends Empl

2017-12-08 20:27:55 181

原创 Java 多态

引言java的三大特性:封装,继承和多态、 封装和继承也是为多态服务的。 多态即为事物在运行的过程中呈现不同的状态。举个简单的例子,对于键盘上的按键组成的快捷键,同一个快捷键在不同的应用中对应着不同的操作。 实现多态的技术称为:动态绑定(dynamic binding),是指在执行期间判断所引用对象的实际类型,根据其实际的类型调用其相应的方法。 多态的作用:消除类型之间的耦合关系。多态的三个

2017-12-08 19:51:47 262

空空如也

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

TA关注的人

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