diff --git "a/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円225円260円346円215円256円347円273円223円346円236円204円(Java).md" "b/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円225円260円346円215円256円347円273円223円346円236円204円(Java).md" index a9736ad4..34b5c39b 100644 --- "a/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円225円260円346円215円256円347円273円223円346円236円204円(Java).md" +++ "b/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円225円260円346円215円256円347円273円223円346円236円204円(Java).md" @@ -8,35 +8,35 @@ 创建 -``` +```java int c[] = {2,3,6,10,99}; int[] d = new int[10]; ``` -``` +```java /** * 数组检索 * @param args */ public static void main(String[] args) { String name[]; - + name = new String[5]; name[0] = "egg"; name[1] = "erqing"; name[2] = "baby"; - + for(int i = 0; i < name.length; i++){ System.out.println(name[i]); } } ``` -``` +```java /** * 插入 - * + * * @param old * @param value * @param index @@ -51,7 +51,7 @@ int[] d = new int[10]; /** * 遍历 - * + * * @param data */ public static void traverse(int data[]) { @@ -62,7 +62,7 @@ int[] d = new int[10]; /** * 删除 - * + * * @param old * @param index * @return @@ -119,4 +119,4 @@ Tips:数组中删除和增加元素的原理:增加元素,需要将index后 **动态规划、贪心算法、分治算法。(一般不会问到)** -**大数据处理:类似10亿条数据找出最大的1000个数.........等等** \ No newline at end of file +**大数据处理:类似10亿条数据找出最大的1000个数.........等等** diff --git "a/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円225円260円347円273円204円.md" "b/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円225円260円347円273円204円.md" index b83f81ae..298adce0 100644 --- "a/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円225円260円347円273円204円.md" +++ "b/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円225円260円347円273円204円.md" @@ -1,7 +1,7 @@ #数组 --- -``` +```java /** * 普通数组的Java代码 * @author dream @@ -12,13 +12,13 @@ public class GeneralArray { private int[] a; private int size; //数组的大小 private int nElem; //数组中有多少项 - + public GeneralArray(int max){ this.a = new int[max]; this.size = max; this.nElem = 0; } - + public boolean find(int searchNum){ //查找某个值 int j; for(j = 0; j < nElem; j++){ @@ -32,8 +32,8 @@ public class GeneralArray { return true; } } - - + + public boolean insert(int value){ //插入某个值 if(nElem == size){ System.out.println("数组已满"); @@ -43,7 +43,7 @@ public class GeneralArray { nElem++; return true; } - + public boolean delete(int value){ //删除某个值 int j; for(j = 0; j < nElem; j++){ @@ -66,7 +66,7 @@ public class GeneralArray { nElem--; return true; } - + public void display(){ //打印整个数组 for(int i = 0; i < nElem; i++){ System.out.println(a[i] + " "); @@ -77,7 +77,7 @@ public class GeneralArray { ``` -``` +```java /** * 有序数组的Java代码 * @author dream @@ -99,17 +99,17 @@ public class OrderedArray { private long[] a; private int size; //数组的大小 private int nElem; //数组中有多少项 - + public OrderedArray(int max){ //初始化数组 this.a = new long[max]; this.size = max; this.nElem = 0; } - + public int size(){ //返回数组实际有多少值 return this.nElem; } - + /** * 二分查找 * @param searchNum @@ -134,8 +134,8 @@ public class OrderedArray { } } } - - + + public boolean insert(long value){ //插入某个值 if(nElem == size){ System.out.println("数组已满!"); @@ -147,7 +147,7 @@ public class OrderedArray { break; } } - + for(int k = nElem; k> j; k++){ a[k] = a[k-1]; } @@ -155,16 +155,16 @@ public class OrderedArray { nElem++; return true; } - - - + + + public boolean delete(long value){ //删除某个值 int j = find(value); if(j == -1){ System.out.println("没有该元素!"); return false; } - + if(nElem == size){ for(int k = j; k < nElem - 1; k++){ a[k] = a[k+1]; @@ -178,8 +178,8 @@ public class OrderedArray { nElem--; return true; } - - + + public void display(){ //打印整个数组 for(int i = 0; i < nElem; i++){ System.out.println(a[i] + " "); @@ -188,4 +188,4 @@ public class OrderedArray { } } -``` \ No newline at end of file +``` diff --git "a/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円240円210円345円222円214円351円230円237円345円210円227円.md" "b/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円240円210円345円222円214円351円230円237円345円210円227円.md" index 2847248d..f541bd7b 100644 --- "a/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円240円210円345円222円214円351円230円237円345円210円227円.md" +++ "b/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/346円240円210円345円222円214円351円230円237円345円210円227円.md" @@ -7,7 +7,7 @@ 栈最基本的操作是出栈(Pop)、入栈(Push),还有其他扩展操作,如查看栈顶元素,判断栈是否为空、是否已满,读取栈的大小等。 -``` +```java /** * 栈是先进后出 * 只能访问栈顶的数据 @@ -26,13 +26,13 @@ public class ArrayStack { private long[] a; private int size; //栈数组的大小 private int top; //栈顶 - + public ArrayStack(int maxSize){ this.size = maxSize; this.a = new long[size]; this.top = -1; //表示空栈 } - + public void push(long value){ //入栈 if(isFull()){ System.out.println("栈已满!"); @@ -40,7 +40,7 @@ public class ArrayStack { } a[++top] = value; } - + public long peek(){ //返回栈顶内容,但不删除 if(isEmpty()){ System.out.println("栈中没有数据"); @@ -48,8 +48,8 @@ public class ArrayStack { } return a[top]; } - - + + public long pop(){ //弹出栈顶内容 if(isEmpty()){ System.out.println("栈中没有数据!"); @@ -57,11 +57,11 @@ public class ArrayStack { } return a[top--]; } - + public int size(){ return top + 1; } - + /** * 判断是否满了 * @return @@ -69,7 +69,7 @@ public class ArrayStack { public boolean isFull(){ return (top == size - 1); } - + /** * 是否为空 * @return @@ -77,15 +77,15 @@ public class ArrayStack { public boolean isEmpty(){ return (top == -1); } - - + + public void display(){ for (int i = top; i>= 0; i--) { System.out.println(a[i] + " "); } System.out.println(""); } - + } ``` @@ -95,7 +95,7 @@ public class ArrayStack { 依然使用数组作为底层容器来实现一个队列的封装 -``` +```java /** * 队列也可以用数组来实现,不过这里有个问题,当数组下标满了后就不能再添加了, * 但是数组前面由于已经删除队列头的数据了,导致空。所以队列我们可以用循环数组来实现, @@ -109,7 +109,7 @@ public class RoundQueue { private int nItems; //实际存储数量 private int front; //头 private int rear; //尾 - + public RoundQueue(int maxSize){ this.size = maxSize; a = new long[size]; @@ -117,7 +117,7 @@ public class RoundQueue { rear = -1; nItems = 0; } - + public void insert(long value){ if(isFull()){ System.out.println("队列已满"); @@ -127,7 +127,7 @@ public class RoundQueue { a[rear] = value; //尾指针满了就循环到0处,这句相当于下面注释内容 nItems++; } - + public long remove(){ if(isEmpty()){ System.out.println("队列为空!"); @@ -137,7 +137,7 @@ public class RoundQueue { front = front % size; return a[front++]; } - + public void display(){ if(isEmpty()){ System.out.println("队列为空!"); @@ -149,7 +149,7 @@ public class RoundQueue { } System.out.println(""); } - + public long peek(){ if(isEmpty()){ System.out.println("队列为空!"); @@ -157,20 +157,20 @@ public class RoundQueue { } return a[front]; } - + public boolean isFull(){ return (nItems == size); } - + public boolean isEmpty(){ return (nItems == 0); } - + public int size(){ return nItems; } - - + + } ``` @@ -178,21 +178,21 @@ public class RoundQueue { 和栈一样,队列中插入数据项和删除数据项的时间复杂度均为O(1) 还有个优先级队列,优先级队列是比栈和队列更专用的数据结构。优先级队列与上面普通的队列相比,主要区别在于队列中的元素是有序的,关键字最小(或者最大)的数据项总在队头。数据项插入的时候会按照顺序插入到合适的位置以确保队列的顺序。优先级队列的内部实现可以用数组或者一种特别的树——堆来实现。这里用数组实现优先级队列。 - - ``` - + + ```java + public class PriorityQueue { private long[] a; private int size; private int nItems; //元素个数 - + public PriorityQueue(int maxSize){ size = maxSize; nItems = 0; a = new long[size]; } - + public void insert(long value){ if(isFull()){ System.out.println("队列已满!"); @@ -209,13 +209,13 @@ public class PriorityQueue { } else { break; - } + } } a[j+1] = value; nItems++; } } - + public long remove(){ if(isFull()){ System.out.println("队列为空!"); @@ -223,23 +223,23 @@ public class PriorityQueue { } return a[--nItems]; } - + public long peekMin(){ return a[nItems - 1]; } - + public boolean isFull(){ return (nItems == size); } - + public boolean isEmpty(){ return (nItems == 0); } - + public int size(){ return nItems; } - + public void display(){ for(int i = nItems - 1;i>= 0; i--){ System.out.println(a[i] + " "); @@ -249,9 +249,5 @@ public class PriorityQueue { } ``` - - 优先级队列中,插入操作需要O(N)的时间,而删除操作则需要O(1)的时间。 - - - + 优先级队列中,插入操作需要O(N)的时间,而删除操作则需要O(1)的时间。 diff --git "a/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/351円200円222円345円275円222円345円222円214円351円235円236円351円200円222円345円275円222円346円226円271円345円274円217円345円256円236円347円216円260円344円272円214円345円217円211円346円240円221円345円205円210円343円200円201円344円270円255円343円200円201円345円220円216円345円272円217円351円201円215円345円216円206円.md" "b/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/351円200円222円345円275円222円345円222円214円351円235円236円351円200円222円345円275円222円346円226円271円345円274円217円345円256円236円347円216円260円344円272円214円345円217円211円346円240円221円345円205円210円343円200円201円344円270円255円343円200円201円345円220円216円345円272円217円351円201円215円345円216円206円.md" index 20ea8852..e657934e 100644 --- "a/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/351円200円222円345円275円222円345円222円214円351円235円236円351円200円222円345円275円222円346円226円271円345円274円217円345円256円236円347円216円260円344円272円214円345円217円211円346円240円221円345円205円210円343円200円201円344円270円255円343円200円201円345円220円216円345円272円217円351円201円215円345円216円206円.md" +++ "b/000 - 2 Data & Algorithm 346円225円260円346円215円256円347円273円223円346円236円204円&347円256円227円346円263円225円/DataStructure/351円200円222円345円275円222円345円222円214円351円235円236円351円200円222円345円275円222円346円226円271円345円274円217円345円256円236円347円216円260円344円272円214円345円217円211円346円240円221円345円205円210円343円200円201円344円270円255円343円200円201円345円220円216円345円272円217円351円201円215円345円216円206円.md" @@ -5,20 +5,20 @@ 递归实现: -``` +```java public class Node { public int value; public Node left; public Node right; - + public Node(int data){ this.value = data; } } ``` -``` +```java /** * 前序遍历 * @param head @@ -31,7 +31,7 @@ public class Node { preOrderRecur(head.left); preOrderRecur(head.right); } - + /** * 中序遍历 * @param head @@ -44,7 +44,7 @@ public class Node { System.out.println(head.value + " "); inOderRecur(head.right); } - + /** * 后序遍历 * @param head @@ -62,4 +62,3 @@ public class Node { 非递归遍历 - diff --git "a/03 - Framework 346円241円206円346円236円266円/spring/spring.md" "b/03 - Framework 346円241円206円346円236円266円/spring/spring.md" index af9646e6..9b89c24c 100644 --- "a/03 - Framework 346円241円206円346円236円266円/spring/spring.md" +++ "b/03 - Framework 346円241円206円346円236円266円/spring/spring.md" @@ -1,4 +1,4 @@ -## 什么是Spring +jdbc## 什么是Spring Spring是一个开源的Java EE开发框架。Spring框架的核心功能可以应用在任何Java应用程序中,但对Java EE平台上的Web应用程序有更好的扩展性。Spring框架的目标是使得Java EE应用程序的开发更加简捷,通过使用POJO为基础的编程模型促进良好的编程风格。 ## Spring有哪些优点 @@ -12,7 +12,7 @@ Spring是一个开源的Java EE开发框架。Spring框架的核心功能可以 ## Spring框架有哪些模块 Spring框架至今已集成了20多个模块。这些模块主要被分如下图所示的核心容器、数据访问/集成、Web、AOP(面向切面编程)、工具、消息和测试模块。 -**核心容器模块**:是spring中最核心的模块。负责Bean的创建,配置和管理。主要包括:beans,core,context,expression等模块。 +**核心jdbc容器模块**:是spring中最核心的模块。负责Bean的创建,配置和管理。主要包括:beans,core,context,expression等模块。 **Spring的AOP模块**:主要负责对面向切面编程的支持,帮助应用对象解耦。 **数据访问和集成模块**:包括JDBC,ORM,OXM,JMS和事务处理模块,其细节如下: JDBC模块提供了不再需要冗长的JDBC编码相关了JDBC的抽象层。 diff --git "a/03 - Framework 346円241円206円346円236円266円/springboot/Spring Boot Loader.md" "b/03 - Framework 346円241円206円346円236円266円/springboot/Spring Boot Loader.md" new file mode 100644 index 00000000..58c671f9 --- /dev/null +++ "b/03 - Framework 346円241円206円346円236円266円/springboot/Spring Boot Loader.md" @@ -0,0 +1 @@ +https://www.jianshu.com/p/63a6e43e4147 diff --git "a/05 - OS (linux) 346円223円215円344円275円234円347円263円273円347円273円237円/345円210円251円347円224円250円vim346円237円245円350円257円242円346円227円245円345円277円227円.md" "b/05 - OS (linux) 346円223円215円344円275円234円347円263円273円347円273円237円/345円210円251円347円224円250円vim346円237円245円350円257円242円346円227円245円345円277円227円.md" index 8a34cbf9..3a057565 100644 --- "a/05 - OS (linux) 346円223円215円344円275円234円347円263円273円347円273円237円/345円210円251円347円224円250円vim346円237円245円350円257円242円346円227円245円345円277円227円.md" +++ "b/05 - OS (linux) 346円223円215円344円275円234円347円263円273円347円273円237円/345円210円251円347円224円250円vim346円237円245円350円257円242円346円227円245円345円277円227円.md" @@ -4,11 +4,30 @@ vim 操作到 [readme.md](https://github.com/loveincode/notes/blob/master/05%20- n 下一个搜到的值 - +# cat cat xxx.log |grep '查询值' -A 1 -A 后边 -B 前边 -C 前后 +# tail tail 命令 + + +# less +less -N catalina.out + +/keyword 向下查找 +n 向下匹配下一处匹配文本 +N 向上匹配下一处匹配文本 + +?keyword 向上查找 +n 向上匹配下一处匹配文本 +N 向下匹配下一处匹配文本 + +F 实时滚动文档 +Ctrl + c 退出实时滚动模式 + +类似效果: +tail -f catalina.out diff --git "a/06 - DB 346円225円260円346円215円256円345円272円223円/347円264円242円345円274円225円Index/Mysql347円264円242円345円274円225円350円277円233円351円230円266円345円205円245円351円227円250円.md" "b/06 - DB 346円225円260円346円215円256円345円272円223円/347円264円242円345円274円225円Index/Mysql347円264円242円345円274円225円350円277円233円351円230円266円345円205円245円351円227円250円.md" new file mode 100644 index 00000000..69d53f34 --- /dev/null +++ "b/06 - DB 346円225円260円346円215円256円345円272円223円/347円264円242円345円274円225円Index/Mysql347円264円242円345円274円225円350円277円233円351円230円266円345円205円245円351円227円250円.md" @@ -0,0 +1,110 @@ +Mysql索引进阶入门 +### 1. 索引操作 +[MySQL 索引 菜鸟](https://www.runoob.com/mysql/mysql-index.html) + +### 2. 索引类型 + +* **PRIMARY** + 唯一且不能为空;一张表只能有一个主键索引 +* **INDEX** + 普通索引 +* **UNIQUE** + 唯一性索引 +* **FULLTEXT** + 全文索引:用于搜索很长一篇文章的时候,效果最好。用在比较短的文本,如果就一两行字的,普通的 INDEX 也可以 + +### 3. 聚集索引 VS 非聚集索引 + +#### 3.1 区别 + * 聚集索引:主键索引,索引中键值的逻辑顺序决定了表中相应行的物理顺序 + * 非聚集索引(非主键索引,也称二级索引):除主键索引(普通索引、唯一索引、全文索引),索引的逻辑顺序与磁盘上行的物理存储顺序不同 + + 查询过程: + * 查询聚集索引能直接得到所有数据, + * 查非聚集索引需要先得到聚集索引地址,**回表** 再得到数据。 + +#### 3.1 聚集索引规则 + 1. 如果一个主键被定义了,那么这个主键就是作为聚集索引 + 2. 如果没有主键被定义,那么该表的第一个唯一非空索引被作为聚集索引 + 3. 如果没有主键也没有合适的唯一索引,那么innodb内部会生成一个隐藏的主键作为聚集索引,这个隐藏的主键是一个6个字节的列,改列的值会随着数据的插入自增。 + +### 4 索引结构 + 默认 ```B+Tree```, ```Hash```(key-value的插入以及查询,哈希表的时间复杂度都是O(1),如果不需要有序的遍历数据,哈希表性能最好。) + + B+树 由二叉树演变的m阶树 + + 为什么是B+树(配合磁盘的读写特性,减少单次查询的磁盘访问次数。) + +#### 4.1 B+树特点 + ———— [极客时间 数据结构与算法之美](https://time.geekbang.org/column/article/77830) + * 每个节点中子节点的个数不能超过 m,也不能小于 m/2; + * 根节点的子节点个数可以不超过 m/2,这是一个例外; + * m 叉树只存储索引,并不真正存储数据,这个有点儿类似跳表; + * 通过链表将叶子节点串联在一起,这样可以方便按区间查找; + * 一般情况,根节点会被存储在内存中,其他节点存储在磁盘中。 + + **复杂度** + * 所有操作(查、插、删) 时间复杂度 O(logm(N)), + * 空间复杂度 最差 O(n) + +#### 4.2 **m阶怎么计算来?** + + 操作系统按页读取(默认是4k或者8k),为了提高I/O效率,所以一个索引页和操作系统读取空间保持一致。 + + ``` + m = 数据页大小/索引项大小 + ``` + 所以索引项字段占空空间越小(int 4byte,比bigint 8byte少一半),一页存的索引数据越多,在优化的时候也要考虑索引字段的长度。 + + 子节点是 **双向链表** 结构,方便范围查询及排序。 + + 考虑: + 1000万数据,树有多高? + +### 5. 覆盖索引 + ```sql + select 主键 from table where 普通索引字段 = ** ; + ``` + 覆盖索引```概念```:通过索引直接插到结果,不需要回表操作。 + + 例子:身份证号 和 姓名 + + 如果要根据身份证号查询信息,只要在身份证上建立索引,需要建[身份证、姓名] 组合索引吗? + + 如果有身份证号查询姓名的高频查询,则建立上边的组合索引,则可达到覆盖索引,不需要回表查到整行数据,减少执行时间。 + + +### 6. 最左前缀原则 + 两个概念: + * 这个最左前缀可以是 **组合索引的最左N个字段** + * 也可以是 **字符串索引的最左M个字符**。 + + 建立组合索引(a,b,c)相当于建立了 (a,b,c) (a,b) (a,c) (a) 四个索引 + + 只要能匹配到最左N个字段,则能使用索引。 如 [a,b,c] [a,c] [a,b] [a] 都能触发索引,内部顺序可变,mysql自动调整。 + + 字符串索引 + 最左M个字符:如like x% ok, %x,%x% 不行。 + +### 7. 索引下推 + MySQL 5.6 引入的索引下推优化(index condition pushdown) + + 可以在索引遍历过程中,对索引中包含的字段先做判断,直接过滤掉不满足条件的记录,减少回表次数。 + +### 8. 索引是否生效,优化 + 可以使用 EXPLAIN 来分析索引是否起效,慢sql做一些索引优化 [Explain优化查询检测](https://www.runoob.com/w3cnote/mysql-index.html) + + + * 索引字段为int类型时,条件可用' '包起来 也可以直接是数值比较 + * 索引字段为varchar类型时,条件要使用' '包起来 + + * 能触发range范围索引>,<, not in , in , != ,BETWEEN AND (5.5后版本 ) + +### 9. 常用索引命名规范 + ``` + 唯一 uk_[字段名]_[字段名]... + 普通 idx_[字段名]_[字段名]... + ``` + + [github]([https://github.com/loveincode](https://github.com/loveincode/notes)) + [blog](https://loveincode.cnblogs.com/) diff --git "a/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/idea class346円211円276円344円270円215円345円210円260円.md" "b/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/idea class346円211円276円344円270円215円345円210円260円.md" new file mode 100644 index 00000000..175831df --- /dev/null +++ "b/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/idea class346円211円276円344円270円215円345円210円260円.md" @@ -0,0 +1,6 @@ +问题 +使用Intellij IDEA 的class搜索工具搜索不到项目中的类,但是类就在构建的项目中。关闭Intellij IDEA再打开也不起作用。 + +解决 + +File -> Invalidate Caches / Restart -> Invalidate and Restart diff --git "a/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/mybatis345円214円271円351円205円215円344円270円215円344円272円206円xml.md" "b/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/mybatis345円214円271円351円205円215円344円270円215円344円272円206円xml.md" new file mode 100644 index 00000000..580d91a1 --- /dev/null +++ "b/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/mybatis345円214円271円351円205円215円344円270円215円344円272円206円xml.md" @@ -0,0 +1,8 @@ +resource 里的 xml +和mapper 不在同一个目录下, +或者com 无法找到 + +有@MapperScan 可以不要 mapperLocations xml路径 + +https://www.pianshen.com/article/676448229/ +// 基于注解扫描Mapper,不需配置xml路径,传统mybatis的使用需要XML diff --git "a/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/mysql+redis double347円262円276円345円272円246円344円270円242円345円244円261円.md" "b/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/mysql+redis double347円262円276円345円272円246円344円270円242円345円244円261円.md" new file mode 100644 index 00000000..9df709cc --- /dev/null +++ "b/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/mysql+redis double347円262円276円345円272円246円344円270円242円345円244円261円.md" @@ -0,0 +1,10 @@ +redis存大整数会丢失精度,解决办法是将值转为String,再取出来转为数字类型 + +mysql +BIGINT(20)的取值范围为-9223372036854775808~92233 72036 85477 5807 +-263 ~ 263-1 + 与Java Long匹配 +BIGINT(20) UNSIGNED的取值范围是0 ~ 18446744073709551615, +0 ~ 264-1 + +Double BigDecimal 精度问题 diff --git "a/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/mysql+redis347円262円276円345円272円246円344円270円242円345円244円261円.md" "b/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/mysql+redis347円262円276円345円272円246円344円270円242円345円244円261円.md" deleted file mode 100644 index 467f62e1..00000000 --- "a/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/mysql+redis347円262円276円345円272円246円344円270円242円345円244円261円.md" +++ /dev/null @@ -1,5 +0,0 @@ -redis存大整数会丢失精度,解决办法是将值转为String,再取出来转为数字类型 - -mysql -BIGINT(20)的取值范围为-9223372036854775808~9223372036854775807 与Java Long匹配 -BIGINT(20) UNSIGNED的取值范围是0 ~ 18446744073709551615, diff --git "a/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/spring @Async345円257円274円350円207円264円345円276円252円347円216円257円344円276円235円350円265円226円346円212円245円351円224円231円.md" "b/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/spring @Async345円257円274円350円207円264円345円276円252円347円216円257円344円276円235円350円265円226円346円212円245円351円224円231円.md" new file mode 100644 index 00000000..9b02cc53 --- /dev/null +++ "b/12 - Practice (problems encountered during development) 345円256円236円350円267円265円351円227円256円351円242円230円/spring @Async345円257円274円350円207円264円345円276円252円347円216円257円344円276円235円350円265円226円346円212円245円351円224円231円.md" @@ -0,0 +1,9 @@ +https://segmentfault.com/a/1190000021217176 + +https://my.oschina.net/tridays/blog/805111 + +当在出现循环依赖的 Spring Bean 中使用 @Async 时,会报以下错误: + +Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException: Error creating bean with name 'a': Bean with name 'a' has been injected into other beans [b] in its raw version as part of a circular reference, but has eventually been wrapped. This means that said other beans do not use the final version of the bean. This is often the result of over-eager type matching - consider using 'getBeanNamesOfType' with the 'allowEagerInit' flag turned off, for example. + +该问题出现的原因是:在正常加载完循环依赖后,因为 @Async 注解的出现,又需将该 Bean 代理一次,然后 Spring 发现该 Bean 已经被其他对象注入,且注入的是没被代理过的版本,于是报错。这个问题也会出现在使用 AOP 等需要代理原类的场景下。 diff --git "a/19 - Standard 346円240円207円345円207円206円/351円230円277円351円207円214円345円267円264円345円267円264円Java345円274円200円345円217円221円346円211円213円345円206円214円 346円263円260円345円261円261円347円211円210円.pdf" "b/19 - Standard 346円240円207円345円207円206円/351円230円277円351円207円214円345円267円264円345円267円264円Java345円274円200円345円217円221円346円211円213円345円206円214円 346円263円260円345円261円261円347円211円210円.pdf" new file mode 100644 index 00000000..d15ea7e7 Binary files /dev/null and "b/19 - Standard 346円240円207円345円207円206円/351円230円277円351円207円214円345円267円264円345円267円264円Java345円274円200円345円217円221円346円211円213円345円206円214円 346円263円260円345円261円261円347円211円210円.pdf" differ diff --git a/999 - blog/README.md b/999 - blog/README.md new file mode 100644 index 00000000..17629d2e --- /dev/null +++ b/999 - blog/README.md @@ -0,0 +1 @@ +### 999 - blog diff --git "a/999 - blog/mac 345円215円207円347円272円247円catalina.md" "b/999 - blog/mac 345円215円207円347円272円247円catalina.md" new file mode 100644 index 00000000..fb1b666f --- /dev/null +++ "b/999 - blog/mac 345円215円207円347円272円247円catalina.md" @@ -0,0 +1,7 @@ +1、重启mac,按住`Command+R`,等到系统进入安全模式。 +2、选择一个账户,然后点击屏幕上方的工具栏找到命令行工具。 +3、执行,命令`csrutil disable` +4、重启电脑后,不要进入安全模式,执行命令`sudo mount -uw /` +5、执行命令 `sudo mkdir /data` +6、执行命令 `sudo chmod 777 /data` +7、重启电脑,进入安全模式,执行命令 `csrutil enable` (开启SIP) diff --git "a/999 - blog/mybatis 344円272円213円345円212円241円 347円274円223円345円255円230円351円227円256円351円242円230円.md" "b/999 - blog/mybatis 344円272円213円345円212円241円 347円274円223円345円255円230円351円227円256円351円242円230円.md" new file mode 100644 index 00000000..420a4b05 --- /dev/null +++ "b/999 - blog/mybatis 344円272円213円345円212円241円 347円274円223円345円255円230円351円227円256円351円242円230円.md" @@ -0,0 +1 @@ +在 **同一个事务** 里,mybatis 查询出来的 同一个val 是同一个对象,缓存。 mybatis的一级缓存 diff --git "a/999 - blog/spring - 345円274円204円346円207円202円345円276円252円347円216円257円344円276円235円350円265円226円351円207円214円347円232円204円344円270円211円347円272円247円347円274円223円345円255円230円.md" "b/999 - blog/spring - 345円274円204円346円207円202円345円276円252円347円216円257円344円276円235円350円265円226円351円207円214円347円232円204円344円270円211円347円272円247円347円274円223円345円255円230円.md" new file mode 100644 index 00000000..0122198b --- /dev/null +++ "b/999 - blog/spring - 345円274円204円346円207円202円345円276円252円347円216円257円344円276円235円350円265円226円351円207円214円347円232円204円344円270円211円347円272円247円347円274円223円345円255円230円.md" @@ -0,0 +1,22 @@ +循环依赖 + * 构造器循环依赖 + Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException + * setter循环依赖 默认单例 + * setter循环依赖 prototype + Caused by: org.springframework.beans.factory.BeanCurrentlyInCreationException + +一级缓存 singletonObjects 单例bean缓存 +二级缓存 singletonFactories 工厂对象缓存 +三级缓存 earlySingletonObjects 早期单例bean缓存 +```java +/** Cache of singleton objects: bean name --> bean instance */ +private final Map singletonObjects = new ConcurrentHashMap(256); + +/** Cache of singleton factories: bean name --> ObjectFactory */ +private final Map> singletonFactories = new HashMap>(16); + +/** Cache of early singleton objects: bean name --> bean instance */ +private final Map earlySingletonObjects = new HashMap(16); +``` + +创建Bean的过程 diff --git "a/346円224円266円350円227円217円/345円245円275円351円223円276円346円216円245円.md" "b/346円224円266円350円227円217円/345円245円275円351円223円276円346円216円245円.md" index 1c9a4a53..26a665e5 100644 --- "a/346円224円266円350円227円217円/345円245円275円351円223円276円346円216円245円.md" +++ "b/346円224円266円350円227円217円/345円245円275円351円223円276円346円216円245円.md" @@ -19,6 +19,9 @@ * [spring-boot](https://github.com/spring-projects/spring-boot) * [Java设计模式](https://github.com/iluwatar/java-design-patterns) * [小马哥 - Segment Fault 在线讲堂](https://github.com/mercyblitz/segmentfault-lessons) + * [springboot-analysis](https://github.com/fangjian0423/springboot-analysis) + * [SoftwareEngineering-Series](https://github.com/wx-chevalier/SoftwareEngineering-Series) + * [Micro-Service-Skeleton](https://github.com/babylikebird/Micro-Service-Skeleton) ### 1. 常用 @@ -122,7 +125,7 @@ * [Baidu EFE](https://github.com/ecomfe) * [Baidu FEX](https://github.com/fex-team/) * [网易](https://github.com/netease) - * [美团点评](https://github.com/Meituan-Dianping) + * [美团点评](https://github.com/meituan-dianping) * [饿了么](https://github.com/eleme) * [豆瓣](https://github.com/douban) * [Bilibili](https://github.com/Bilibili)

AltStyle によって変換されたページ (->オリジナル) /