一、ThreadLocal基本使用 1.1使用场景 不同的线程对全局变量进行修改,使用ThreadLocal后会为每个线程创建一个副本,而不会影响其他线程的副本,确保了线程的安全 private static ThreadLocal<Integer> localvariable=ThreadLoca ...
分类:
其他好文 时间:
2020-12-22 12:50:12
阅读次数:
0
4Sum II (M) 题目 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 ze ...
分类:
其他好文 时间:
2020-12-22 12:32:53
阅读次数:
0
要注意:对于=<>要在[[]]或者(())双层里面用,-ne-eq-lt用在[]和()单个里面且-ne-eq-lt等等只能比较两个整数。expr也只能计算整数,当expr报错expr:non-integerargument,就需要看看他计算的数值是都全部为整数。
分类:
系统相关 时间:
2020-12-22 12:11:15
阅读次数:
0
处理数据常用的语言,使用基本的api处理一个wordcount 读取文件,找出单词(转大写)出现次数,并排序,获取TopK数据。 scala语言 def main(args: Array[String]): Unit = { //读取文件 val source: BufferedSource = S ...
分类:
编程语言 时间:
2020-12-21 11:45:54
阅读次数:
0
`import java.util.HashMap; public class Demo9{ public static void main(String[] args){ HashMap<Integer,String> m1 = new HashMap<>(); HashMap<Integer,S ...
分类:
其他好文 时间:
2020-12-19 12:20:54
阅读次数:
1
计算属性 为什么需要计算属性 把复杂的计算逻辑用简洁的模板内容体现出来。 计算属性的用法 computed: { reverseString: function(){ return this.msg.split('').reverse().join(''); } } 弄好了直接在页面中引用计算属性的 ...
分类:
其他好文 时间:
2020-12-18 13:08:47
阅读次数:
3
1、引言 在Java中,我们可以对List集合进行如下几种方式的遍历: List<Integer> list = new ArrayList<>(); // 法一:普通for循环 for (int i = 0; i < list.size(); i++) { System.out.print(lis ...
分类:
其他好文 时间:
2020-12-18 12:37:18
阅读次数:
2
什么是Map集合? Map用于保存具有映射关系的数据,Map集合里保存着两组值,一组用于保存Map的ley,另一组保存着Map的value。 图解 map集合的作用和查字典类似,通过key找到对应的value,通过页数找到对应的信息。用学生类来说,key相当于学号,value对应name,age,s ...
分类:
编程语言 时间:
2020-12-18 12:34:52
阅读次数:
1
Entity: package com.example.ec.domain; import javax.persistence.*; @Entity public class Tour { @Id @GeneratedValue private Integer id; @Column private ...
分类:
编程语言 时间:
2020-12-18 12:13:36
阅读次数:
2
代码已测试 public static long Reverse(long value) { return (((long)Reverse((int)value) & 0xFFFFFFFF) << 32) | ((long)Reverse((int)(value >> 32)) & 0xFFFFFF ...
分类:
Web程序 时间:
2020-12-17 12:57:32
阅读次数:
3