- 博客(14)
- 收藏
- 关注
原创 374. Guess Number Higher or Lower
this is a binary search problem. code show as below: public class Solution extends GuessGame { public int guessNumber(int n) { int left = 1, right = n; while (left < right) { ...
2019-07-11 10:58:24
179
原创 367. Valid Perfect Square
method1 simple but not allow public boolean isPerfectSquare(int num) { int sqrt = (int) Math.sqrt(num); return sqrt * sqrt == num; } method2 newto method public boolean isP...
2019-07-11 10:32:28
179
原创 redis cluster keyspace expired subscribe use spring boot redis data
redis cluster过期key订阅 开启redis过期key订阅 订阅redis过期key时间 开启redis过期key订阅 首先通过这篇文章了解下相关的配置和单机版的该如何使用,然后如果你配置redis集群时没有开启EKx,那么也可以通过redis-cli -c -p port CONFIG set notify-keyspace-events EKx的方式开启,需要每个节点都设置一下...
2019-06-13 15:07:53
705
原创 nginx正向代理https
nginx正向代理https 需求 当出现下述情形时,我们需要使用正向代理: 我们的client不能直接访问到服务器,倒是其他的client可以访问,且我们的client到OtherClient 的网络是通的。 如何搭建正向代理 使用nginx 使用squid 。。。其他的方式 注 本人搭建的方式为nginx 使用nginx搭建正向...
2018-12-07 16:48:01
11422
5
原创 使用PowerMock冒烟创建新的对象
1.导入包 <!-- https://mvnrepository.com/artifact/org.powermock/powermock-api-mockito --> <dependency> <groupId>org.powermock</groupId> <artifactId>powermock-api-mo...
2018-10-19 22:33:49
560
原创 PowerMock with Jacoco使用PreparedForTest坑
NO WAY TO USER!!!!! The simplest way to use JaCoCo it is — on-the-fly instrumentation with using JaCoCo Java Agent. In this case a class in modified when it is being loaded. You can just run you a...
2018-10-19 22:05:27
2696
原创 logback的简单使用
1. logback简介 Logback is intended as a successor to the popular log4j project, picking up where log4j leaves off. Logback's architecture is sufficiently generic so as to apply under different circums...
2018-09-19 17:53:02
202
原创 mac idea 2018.2下载
下载地址:http://future.nos-eastchina1.126.net/idea201802 ---存储至网易对象存储。
2018-07-28 11:39:52
1070
原创 java jdk10下载
点击链接即可下载:http://future.nos-eastchina1.126.net/mac_jdk10.0.2 -----使用网易对象存储。
2018-07-28 11:38:18
1615
原创 idea提示bug
properties in parent definition are prohibited 这个是新版的IDEA(2018.01)的bug,不用理会。使用mvn编译是完全不影响的
2018-07-27 15:26:20
2589
原创 spring boot jar启动
1. spring boot打成jar包 在pom中加入下面的配置: <plugin> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-maven-plugin</artifactId> <configuration...
2018-07-19 23:18:22
1259
原创 二叉树中和为某一值的路径
import java.util.ArrayList;import java.util.Stack;import java.util.Collections;/**public class TreeNode { int val = 0; TreeNode left = null; TreeNode right = null; public TreeNode(int val)...
2018-04-20 22:18:14
129
原创 树的最小的深度
链接:https://www.nowcoder.com/questionTerminal/e08819cfdeb34985a8de9c4e6562e724来源:牛客网Given a binary tree, find its minimum depth.The minimum depth is thenumber of nodes along the shortest path from the ...
2018-04-11 20:52:20
200
原创 ShardedJedis中使用byte[]的方式删除Key
由于ShardedJedis中没有提供通过byte[]直接删除Key的方式,只存在String的方式,所以如果想通过byte[]的方式删除,那么需要使用下面的代码: Jedis jedis = shardedJedis.getShard(key); if(jedis != null){ jedis.del(key);//如果删除成功,返回1,失败返回0 }
2018-01-12 17:10:53
1306
4
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人
RSS订阅