随笔分类 - java
摘要:public interface ExecutorServerBase { default RuleResult getUserList(RuleParam rule) { RuleResult result = new RuleResult(); List<String> userIdList =
阅读全文
摘要:假如我有一个数组: ArrayList<Integer> mArrayList = new ArrayList<Integer>(); mArrayList.add(0); mArrayList.add(1); mArrayList.add(2); mArrayList.add(3); 我需要从中随
阅读全文
摘要:jvisualvm.exe https://fastthread.io/
阅读全文
摘要:import org.springframework.util.CollectionUtils; CollectionUtils.isEmpty(certificateHasUsers)
阅读全文
摘要:5 3 I am getting this warning on Sonar: Avoid using implementation types like 'HashMap'; use the interface instead What does it mean? The class in whi
阅读全文
摘要:import java.util.Collections; yphlLin.set(index, null); //移除List中所有null yphlLin.removeAll(Collections.singleton(null))
阅读全文
摘要:Map<String, BigDecimal> teacherContribution = resultList.stream().collect(Collectors.toMap(RankingTeacherTotal::getUserId, RankingTeacherTotal::getVal
阅读全文
摘要:工作中用到了list的取差集,发现还是挺好用的。所以记录下。 需求list的方法说明备注 交集 listA.retainAll(listB) listA内容变为listA和listB都存在的对象 listB不变 差集 listA.removeAll(listB) listA中存在的listB的内容去
阅读全文
摘要:@Inject NamedParameterJdbcTemplate namedParameterJdbcTemplate; public List<TeacherContributionLastCalculated> searchLastCalculated(Set<String> fromIdL
阅读全文
摘要:public int setIntPoint(double contribution, BigDecimal rate) { return BigDecimal.valueOf(contribution).multiply(rate).setScale(0, BigDecimal.ROUND_HAL
阅读全文
摘要:debug启动的时候需要等半个小时甚至更长时间突然有一天发现debug启动不起来了, 在debug时,项目一直会出现 Connected to the VM ,address: 其实这不是debug报错,没有启动 其实是一直处于启动中状态,日志刷的很慢 原因,之前存在断点没有取消,造成启动缓慢 解决
阅读全文
摘要:public static void main(String[] args) { System.out.println("向上取整:" + (int) Math.ceil(96.1));// 97 (去掉小数凑整:不管小数是多少,都进一) System.out.println("向下取整" + (i
阅读全文
摘要:Linux 运行jar包命令如下: 方式一 java -jar shareniu.jar 特点:当前ssh窗口被锁定,可按CTRL + C打断程序运行,或直接关闭窗口,程序退出 那如何让窗口不锁定? 方式二 java -jar shareniu.jar & &代表在后台运行。 特定:当前ssh窗口不
阅读全文
摘要:直接用java -jar xxx.jar,当退出或关闭shell时,程序就会停止掉。以下方法可让jar运行后一直在后台运行。 1. java -jar xxx.jar & 说明: 在末尾加入 & 符号 2. (1)执行java -jar xxx.jar后 (2)ctrl+z 退出到控制台,执行 bg
阅读全文
摘要:1. ps -ef |grep java ps:将某个进程显示出来-A 显示所有程序。 -e 此参数的效果和指定"A"参数相同。-f 显示UID,PPIP,C与STIME栏位。 grep命令是查找中间的|是管道命令 是指ps命令与grep同时执行 这条命令的意思是显示有关redis有关的进程 2.
阅读全文
摘要:今天公司技术支持的童鞋报告一个客户的服务不工作了,紧急求助,于是远程登陆上服务器排查问题。 查看采集数据的tomcat日志,习惯性的先翻到日志的最后去查看有没有异常的打印,果然发现了好几种异常信息,但是最多还是这个: 24-Nov-2016 09:54:21.116 SEVERE [http-nio
阅读全文
摘要:List<String> tbList = Arrays.asList(result.getTb_name().split(","));
阅读全文
摘要:private boolean tagsIsEqual(String curentFieldValue, String preFieldValue) { if (curentFieldValue == null || preFieldValue == null) return false; if (
阅读全文
摘要:问题: No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?
阅读全文
摘要:在该目录下 shift+ 右键 在此处打开powershell
阅读全文