摘要: public static String sumOfDivided(int[] s) { for (int i:s){ primeFactors(i); } String[] res = {""}; integers.forEach( x->{ int sum = 0; boolean flag = 阅读全文
posted @ 2021-08-17 15:00 _lemonV 阅读(54) 评论(0) 推荐(0) 编辑
摘要: shellSort 1.动图演示 2.代码实现 //测试工具类在这里 https://www.cnblogs.com/paidaxing7090/p/15080493.html import 测试工具类.SortTestHelper; public class ShellSort { // 我们的算 阅读全文
posted @ 2021-08-02 12:32 _lemonV 阅读(37) 评论(0) 推荐(0) 编辑
摘要: InsertionSort 1.动图演示 1. 动图1 双层循环,外部循环选择需要与数组中前面元素比较的元素。内层循环,从该选定元素开始 与 该元素左边的元素进行比较。 如果选定元素小于左边元素 则与之交换位置。直至找到正确的位置,此次内层循环后,左侧部分元素已经有序。 2.动图2 动图1的优化版本 阅读全文
posted @ 2021-08-02 10:15 _lemonV 阅读(61) 评论(0) 推荐(0) 编辑
摘要: SelectionSort 1.动图演示 2.代码实现 测试工具类 从这里复制 https://www.cnblogs.com/paidaxing7090/p/15080493.html import 测试工具类.SortTestHelper; public class SelectionSort3 阅读全文
posted @ 2021-07-31 12:42 _lemonV 阅读(37) 评论(0) 推荐(0) 编辑
摘要: BubbleSort 1.动图演示 2.代码实现 2.1 测试工具类 import java.lang.reflect.Method; /** * 测试排序的工具类 * 后续测试其他排序时也会用到 */ public class SortTestHelper { // private 修饰构造方法。 阅读全文
posted @ 2021-07-30 17:00 _lemonV 阅读(45) 评论(0) 推荐(0) 编辑
摘要: spring-boot-starter-validation 校验参数 一、前言 本章介绍使用spring-boot-starter-validation 校验 SpringMVC 的入参。 <parent> <groupId>org.springframework.boot</groupId> < 阅读全文
posted @ 2021-07-29 11:20 _lemonV 阅读(4781) 评论(1) 推荐(1) 编辑
摘要: 完整源码地址:https://github.com/crossyourheart/TestTransactionPropagation.git 1.事务传播特性 2.实测 教员说过,实践是检验真理的唯一标准。 2.1 建表 mysql数据库 CREATE TABLE `student` ( `id` 阅读全文
posted @ 2021-07-15 17:00 _lemonV 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 分布式事务解决方案 分布式事务有如下解决方案: XA分布式事务协议 1 二阶段提交方案:强一致性 阶段 1:准备阶段 准备阶段有如下三个步骤: 协调者向所有参与者发送事务内容,询问是否可以提交事务,并等待所有参与者答复。 各参与者执行事务操作,将 undo 和 redo 信息记入事务日志中(但不提交 阅读全文
posted @ 2021-07-08 09:52 _lemonV 阅读(227) 评论(0) 推荐(0) 编辑
摘要: 1.分布式事务的概念 数据库事务: 分布式事务: 一项业务操作可能会调用执行多个微服务。如何保证多个服务执行的多个数据库的操作整体成功或整体失败?这就是分布式事务要解决的问题。 2.CAP 、BASE原则 2.1 CAP CAP理论就是说在分布式存储系统中,最多只能实现上面的两点。而由于网络硬件肯定 阅读全文
posted @ 2021-07-08 09:44 _lemonV 阅读(125) 评论(0) 推荐(0) 编辑
摘要: 使用EsayExcel 实现 web上传excel文件(读取excel文件) 1.创建项目、添加依赖 <!-- 官方文档 https://www.yuque.com/easyexcel/doc/read#1bfaf593 --> <dependency> <groupId>com.alibaba</ 阅读全文
posted @ 2021-06-25 15:06 _lemonV 阅读(1514) 评论(0) 推荐(0) 编辑