自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

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

原创 mysql 统计不同成绩阶段的人数

case when   用sum而不是count select sum(case when score<60 then 1 else null end) bujige, sum(case when score>=60 and score<80 then 1 else null end) jige, sum(case when score>=80 then 1 el...

2018-07-23 22:09:20 5504

原创 UUID

UUID UUID含义是通用唯一识别码 (Universally Unique Identifier),这是一个软件建构的标准,也是被开源软件基金会 (Open Software Foundation, OSF) 的组织在分布式计算环境 (Distributed Computing Environment, DCE) 领域的一部份。   UUID 的目的,是让分布式系统中的所有元素,都能有唯一...

2018-07-23 22:07:52 324

原创 Java API限流

令牌桶算法 http://blog.didispace.com/spring-boot-request-limit/ 对于令牌桶的代码实现,可以直接使用Guava包中的RateLimiter。 public class TestRateLimiter { static RateLimiter limiter = RateLimiter.create(2.0) ; public static...

2018-07-23 22:06:15 362

原创 springBoot 2.0.3 actuator

management.endpoints.web.exposure.include 配置actuator 暴露的接入点,默认值为health和info,此时调用/refresh会返回404错误   现在的方法如下: management.endpoints.web.exposure.include=refresh,health,info   文档: https://docs.sprin...

2018-07-23 22:05:25 406

原创 rabbitmq安装 centos6.8

1:前期准备(erlang安装环境) yum -y install make gcc gcc-c++ kernel-devel m4 ncurses-devel openssl-devel unixODBC unixODBC-devel httpd python-simplejson   2:查看安装mq版本依赖的erlang版本 http://www.rabbitmq.com/which...

2018-07-23 17:52:38 311

原创 ConcurrentHashMap和HashMap和HashTable

ConcurrentHashMap 它包含了一个Segment数组,每个Segment包含一个HashEntity数组,加锁时候是加在Segment对象上 构造函数: public ConcurrentHashMap() { this(DEFAULT_INITIAL_CAPACITY, DEFAULT_LOAD_FACTOR, DEFAULT_CONCURRENCY_LEV

2017-06-15 17:57:15 144

原创 HashMap

HashMap源码分析:

2017-06-15 17:22:06 222

转载 ConcurrentLinkedQueue

ConcurrentLinkedQueue : 基于非阻塞算法和链表结构的线程安全队列 非阻塞算法 (nonblocking algorithms) 一个线程的失败或者挂起不应该影响其他线程的失败或挂起的算法。 实现无锁(lock-free)的非阻塞算法有多种实现方法,其中 CAS(比较与交换,Compare and swap) 是一种有名的无锁算法。

2017-06-14 16:01:19 226

原创 Collections.synchronizedCollection

对与集合的同步,方法之一是使用 Collections : 如以下方法: Collections.synchronizedCollection(Collection c) 返回的是一个 Collection 对象的装饰者对象 ,这个装饰者对象的所有方法都是同步的 public static Collection synchronizedCollection(Collection c)

2017-06-14 09:20:23 2409

原创 ThreadLocal

线程安全大概分为两类 :   一类是多个线程共享一个变量 访问时候加锁,属于以时间换空间  一类是每个线程有自己的变量(不需要共享),不需要加锁  速度更快 但是  耗费内存 (为每个线程new了一个变量)  而ThreadLocal就属于后者 主要方法: set(T t)    public void set(T value) { Thread t = Thread

2017-06-13 17:11:16 199

原创 SimpleDateFormat的套路

由于SimpleDateFormat是一个非线程安全类(由于它的protected Calendar calendar;属性是非线程安全的),本来想测试下ThreadLocal下的线程安全SimpleDateFormat,结果输出的 simpleDateFormat 都是一样的 public class TestLocal { ThreadLocal threadLocal = new

2017-06-13 16:24:23 267

原创 ThreadPoolExecutor

ThreadPoolExecutor(基于jdk1.6  主要看线程执行流程,不关注线程池状态等): 主要属性: BlockingQueue workQueue:同步任务队列 ReentrantLock mainLock:同步锁 用于addIfUnderCorePoolSize等方法中  HashSet workers:执行任务的worker队列 volatile int  

2017-06-13 11:09:19 171

转载 Git

原文地址:http://www.jb51.net/article/55438.htm Git介绍 分布式 : Git版本控制系统是一个分布式的系统, 是用来保存工程源代码历史状态的命令行工具; 保存点 : Git的保存点可以追踪源码中的文件, 并能得到某一个时间点上的整个工程项目额状态; 可以在该保存点将多人提交的源码合并, 也可以会退到某一个保存点上; Git离线操作性 :Git

2015-01-04 14:12:08 339

原创 java int转换

只有比int长度大的可以自动转换为int package primary_data_type; public class SwitchTest { public static void main(String[] args){   byte b=9; //8 bit short a=1;//16 bit int sitcInt=19;//32 bit long

2015-01-01 10:56:25 396

原创 Mysql

关键字:procedure drop procedure if exists pp;/*如果存在存储过程pp则删除pp*/ delimiter //  /**设置以//为sql语句结尾*/ 1:不带参数的存储过程 create procedure pp() begin select count(*) from t_com_dim_date; end//

2014-12-24 16:28:24 288

空空如也

空空如也

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

TA关注的人

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