自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(18)
  • 资源 (3)
  • 收藏
  • 关注

原创 IdWorker

package com.cmim.iov.cmiot.commonvo.util;import org.apache.commons.lang3.StringUtils;import org.slf4j.Logger;import org.slf4j.LoggerFactory;import java.lang.management.ManagementFactory;import java.net.InetAddress;import java.net.NetworkInterface;

2021-04-07 17:04:40 506

转载 Apache Cassandra 从入门到精通

Apache Cassandra 从入门到精通https://developer.aliyun.com/article/699492

2021-02-06 11:16:31 184

原创 JPA 动态条件查询

if(1? != ‘’) @Query(value = "select id from tbl where if(?1!='', cust_code = ?1, 1=1) " + "and if(?2!='', name LIKE CONCAT('%',?2,'%'), 1=1) and if(?3 is not null, is_delete = ?3, 1=1) ", nativeQuery = true) List<Entity> findEntit

2021-02-03 16:13:08 648

原创 JPA findAll分页查询连表查询

实体类TaskWorkEntity@Entity@Data@Accessors(chain = true)@Table(name = "task_work")public class TaskWorkEntity extends BaseEntity { private Long id; // EcTaskEntity 关联关系 唯一字段 private String ecTaskSerial; private String taskWorkName;

2021-02-02 11:22:54 5108 4

原创 SpringBoot2.x JPA findAll 分页查询

import org.springframework.data.domain.Page; import org.springframework.data.domain.PageRequest; import org.springframework.data.domain.Pageable; import org.springframework.data.domain.Sort; Page<Entity> page; // 倒序排序 Sort sort =..

2021-02-02 09:41:45 2903

原创 Java实现归并排序

归并排序 private static void MergeSort(int[] arr, int begin, int end) { if (begin < end) {// int min = (end + begin) / 2; 此写法存在溢出可能 int mid = (end - begin) / 2 + begin; MergeSort(arr, begin, mid);

2020-12-25 17:21:26 77

原创 Java实现希尔排序

希尔排序private static void ShellSort(int[] arr) { int length = arr.length; int aug = length / 2; while (aug > 0) { for (int i = aug; i < length; i++) { int temp = arr[i]; int j = i - a

2020-12-25 17:20:16 55

原创 插入排序

插入排序 public static void InsertSort(int[] arr) { for (int i = 1; i < arr.length; i++) { for (int j = i - 1; j >= 0; j--) { if (arr[j] > arr[j + 1]) { int tmp = arr[j];

2020-12-25 17:19:35 58

原创 选择排序

选择排序 private static void SelectSort(int[] arr) { for (int i = 0; i < arr.length - 1; i++) { int temp = arr[i]; for (int j = i + 1; j < arr.length; j++) { if (temp > arr[j]) {

2020-12-25 17:18:24 59

原创 冒泡排序

冒泡排序 private static void BubbleSort(int[] arr) { for (int i = 0; i < arr.length - 1; i++) { for (int j = 0; j < arr.length - 1 - i; j++) { if (arr[j] > arr[j + 1]) { int temp = arr[j];

2020-12-25 17:15:11 73

原创 Layui表格全局排序

Layui表格全局排序首先来看官方文档官方文档链接//监听排序事件 table.on('sort(order)', function(obj) { //注:sort 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值" //尽管我们的 table 自带排序功能,但并没有请求服务端。 //有些时候,你可能需要根据当前排序的字段,重新向服务端发送请求,从而实现服务端排序,如: table.reload('user', { initSort : obj,

2020-06-12 16:31:51 3401 5

原创 Java多线程,两个线程交替打印

Java多线程,两个线程交替打印(jdk 1.8)public class AlternatePrint { public static int i = 0; public static boolean falg = false; public static Object lock = new Object(); public static void main(String[] args) { Thread thread1 = new T

2020-06-03 19:07:46 1870

原创 Java高效求范围内素数

简单粗暴直接上代码public static void main(String[] args) { Long b1 = System.currentTimeMillis(); System.out.println(primeNumber(1000000).toString()); Long e1 = System.currentTimeMillis(); System.out.println("while耗时:" + (e1 - b1)); // 260ms Long b2 = S

2020-06-02 16:32:28 365 1

原创 批量删除Java代码中的‘//’注解

将路劲换成你的项目路径运行即可public class clear {private static int count = 0;public static void main(String[] args) { File folder = new File("E:\\xxxx\\xxxx"); Collection<File> fs = FileUtils.listFiles(folder, new String[] { "java" }, true); for (File file

2020-05-21 15:38:45 568

原创 不使用第三变量,使用异或交换两个变量的值

Java位运算符 异或 ^ 相同为0,不同为1。a 011b 100a = a ^ b = 011 ^ 100 = 111;b = b ^ a = 100 ^ 111 = 011;a = a ^ b = 111 ^ 011 = 100;

2020-05-07 17:51:38 180

原创 CGLib缺少java.lang.ClassNotFoundException: org.objectweb.asm.Type

CGLib缺少java.lang.ClassNotFoundException: org.objectweb.asm.Type<dependency> <groupId>asm</groupId> <artifactId>asm</artifactId> <version>3.3.1</ver...

2020-04-24 16:07:53 165

原创 为什么重写equals()要重写hashCode()

Object类equals()和hashCode()属于Object类,Object类有且仅有这两个方法,hashCode()返回int,equals()返回boolean值。在调用equals()方法之前默认调用hashCode()进行先前比较,若两个hashCode()不相等,则即使对象是相等的那么也返回false。因为系统默认hashCode()是根据对象ID来获取的。...

2020-04-10 23:52:16 83

原创 RTTI和反射的区别

RTTI和反射的区别RTTIRTTI:运行时类型信息使得你可以在程序运行时发现和使用类型信息。如果你不知道某个对象的确切类型,RTTI可以告诉你。但是有一个限制,这个类型在编译时必须已知,这样才能使用RTTI识别它,并利用这些信息做一些事情。反射反射:运行时类型信息。一般不要认为Java的反射就是指java.lang.reflect这个包提供的工具类和接口。Class类与java.l...

2020-04-09 16:30:03 169

nacos-1.2.1.zip

从 Github 上下载nacos-server-1.2.1.zip源码,适用于windows系统,解压即可。

2020-05-29

nacos-1.2.1.tar.gz

从 Github 上下载nacos-server -1.2.1.tar.gz源码,适用于Linux/Unix/Mac

2020-05-29

cglib缺少asm-X.jar

cglib代理,若代理过程中报java.lang.ClassNotFoundException: org.objectweb.asm.Type错说明缺少该jar包

2020-05-21

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除