0%

SourceTreeSourceTree集成了Git Flow功能,能简单方便的操作和实现常规的工作流程。支持OSX和Windows平台。操作文档
gitHub 创建一个仓库 javaBook
克隆到本地

阅读全文 »

Spring Cloud 提供了一个接口 DiscoveryClient , 为 Eureka 或者 consul 等注册中心去实现, getInstances 方法获取注册的实例,一个实例对应一个工程

List<ServiceInstance> getInstances(String serviceId);
阅读全文 »

搭建一个 springboot 的项目,引入 spring-boot-starter-parent父组件, spring-boot-starter-web组件, lombok组件,jedis客户端组件 ,谷歌的guava 组件

阅读全文 »

Here's something encrypted, password is required to continue reading.
阅读全文 »

Windows服务

-- 启动MySQL
net start mysql
-- 创建Windows服务
sc create mysql binPath= mysqld_bin_path(注意:等号与值之间有空格)
阅读全文 »

org.springframework.util 包下的 MultiValueMap 接口

void add(K key, @Nullable V value);

看下 LinkedMultiValueMap 实现

阅读全文 »

Lua 是一种轻量小巧的脚本语言,定义注解

@Target(ElementType.METHOD)
@Retention(RetentionPolicy.RUNTIME)
public @interface Limit {

// 方法名为key
String key() default "";

// 时间,单位秒
int period();

// 限制访问次数
int count();
}
阅读全文 »

pom 文件引入

<!-- https://mvnrepository.com/artifact/com.github.houbb/junitperf -->
<dependency>
<groupId>com.github.houbb</groupId>
<artifactId>junitperf</artifactId>
<version>2.0.7</version>
</dependency>
阅读全文 »

下面举个例子 Java8 新语法实现思路的多种解法

/**
*
* 1. 计数
* Collectors.counting
* count
* 2. 最值
* Collectors.maxBy
* 3. 求和
* Collectors.summingInt
* 4. 求平均值
* Collectors.averagingInt
* 5. 连接字符串
* Collectors.joining
* 6. 一般归约
* Collectors.reducing
* 7. 转换
* Collectors.toCollection / Collectors.collectingAndThen
* 8. 数值流
* IntStream、DoubleStream、LongStream
* 9. 映射
* Collectors.toMap
* Function.identity()
* 10. 数据分区
* Collectors.partitioningBy
* 11. 分组
* Collectors.groupingBy
阅读全文 »