自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+

少年时。

于浩然狂热之际中寒,于天上看见深渊,于一切眼中看见无所有,于无所希望中得救

  • 博客(73)
  • 资源 (1)
  • 收藏
  • 关注

原创 ApplicationEvent

ApplicationEvent

2022-09-15 13:09:01 224 1

原创 Springboot循环依赖问题

循环依赖顾名思义多个类中的依赖形成了环路,形成了类似于死锁的情况,导致springboot在启动时无法为我们创建Bean。1.循环依赖形成条件使用构造方法的方式来注入依赖,并且类A中依赖类B,类B也同时依赖类A,这样两个类都无法正常进行Bean的创建,就会抛出异常:BeanCurrentlyInCreationException@Componentpublic class A { private B b; @Autowired public A(B b) {

2022-03-15 14:34:07 3523

原创 class javax.xml.parsers.FactoryFinder cannot access class jdk.xml.internal.SecuritySupport

powermock测试

2022-01-25 16:50:05 2481 1

原创 Freemarker实现Hibernate动态sql

主ftl文件:${***}为全局变量,即在获取free marker时传入的数据通过import导入其他的ftl文件<#import "cors-join-table.ftl" as joinSpace><#import "cors-where-condition.ftl" as conditionSpace><#import "cors-main-where-condition.ftl" as mainConditionSpace>sele...

2021-10-20 17:25:14 776

转载 [转载]一次踩坑排查,@Valid注解不生效

<div id="cnblogs_post_body" class="blogpost-body cnblogs-markdown"><p>环境:JDK11 + Spring Boot2 + Maven<br>问题原因:导入包有问题或依赖包版本不对<br>解决方案:<br><strong>1、同时引入以下两个依赖</strong></p><pre><code class="hljs x

2021-08-11 20:55:40 1810 2

原创 github errno 10054

Push failedunable to access 'https://github.com/*/*.git/': OpenSSL SSL_read: Connection was reset, errno 10054打开git bash执行git config --global http.sslVerify "false"

2021-07-04 21:54:10 2412

转载 git配置全局ignore

git配置全局ignore的步骤如下: 1、在用户目录文件夹下(我的是在C:\Users\jinweilu)创建gitignore文件,文件内容如下: .DS_Store*/.DS_Store*.class*.iws*.iml*.ipr.idea.idea/**.baktargettarget/*.gradle/.DS_Store.project.settings/*.pyc*.log*.stats*.apk*.ap_*....

2021-04-13 16:45:41 2300 5

原创 git ignore

setting -> file types -> ignore files and folders*.hprof;*.pyc;*.pyo;*.rbc;*.yarb;*~;.DS_Store;.git;.hg;.idea;.svn;CVS;__pycache__;_svn;vssver.scc;vssver2.scc;*.iml;*.mvn;*.md;mvnw;*.cmd;*.gitignore;

2021-04-13 16:37:42 84

原创 UT Mock对象后手动注入

public class ObjectFieldInjectUtil { /** * instance:目标类实例对象 * fieldName:属性名称 * fieldObject:自己mock的当前字段的对象 */ public static void inject(Object instance,String fieldName,Object fieldObject) throws NoSuchFieldException, IllegalAccessException {

2021-04-08 14:14:52 383

转载 git冲突解决和放弃本地操作

Git使用出现Automatic merge failed; fix conflicts and then commit the result.解决方法 产生原因首先这个问题产生的原因是因为你git pull 的时候会分为两步,第一步先从远程服务器上拉下代码,第二步进行merge,但是merge时候失败了就会产生上述问题。解决方法:丢弃本地提交,强制回到线上最新版本git fetch --allgit reset --hard origin/你需要下拉的分支(默认ma...

2021-02-22 15:28:13 4248 1

原创 多线程学习整笔记

1.并行与并发并行:并行性是指同一时刻内发生两个或多个事件并行是在不同实体上的多个事件并发:并发性是指同一时间间隔内发生两个或多个事件并发是在同一实体上的多个事件并行是针对进程的,并发是针对线程的。2.实现线程的方式继承Thread类重写run方法实现Runnable接口重写run方法3.run()和start()的区别run():仅仅是封装被线程执行的代码,直接调用是普通方法start():首先启动了线程,然后再由jvm去调用该线程的run方法4.线程的方法sl

2021-02-19 11:26:41 68

原创 idea中的各种操作

快捷键描述ctrl+shift+F/R全局查找/替换ctrl+shift+AFind Actionctrl+shift+F全局查找ctrl+w选中单词ctrl+alt+shift+J列操作ctrl+shift+enter自动补全当前行shift+f6重命名变量名ctrl+shift+1~9设置页签ctrl+1~9快速访问页签...

2021-02-18 15:49:06 111 1

原创 Java中的包装类

Java包装类的产生是为了解决基本数据类型没有属性、方法、无法对象化交互的问题。基本数据类型对应的包装类基本数据类型包装类byteByteshortShortintIntegerlongLongfloatFloatdoubleDoublecharCharacterbooleanBoolean8个包装类中除了Boolean和Character两个个包装类继承自Object外,其他包装类都继承自Number类装箱&

2021-01-26 16:37:35 100

原创 java异常

关键字try: 抛出异常catch: 捕获异常finally: 无论如何都会执行的代码,如果代码中有System.exit(int status);则程序终止不会执行,status为0则表示程序正常终止,非0表示程序异常终止;如果finally中有终端方法的return语句,则最终都会return finally中的值必须组合使用,try可以跟多个catch,也可以不跟catch,跟一个finally。常见的运行时异常: java.lang包下ArithmeticException: 数学运算

2021-01-26 15:21:45 88 2

原创 抽象类和接口

抽象类应用场景:某个父类只是限定其子类应该包含怎样的方法,但不需要准确知道这些子类如何实现这些方法抽象类存在的意义:为其子类提供一个公共类型(父类引用指向子类对象)封装子类中的重复内容(成员变量和方法)限制子类的设计随意性,在一定程度上避免了无意义父类的实例化声明语法:abstract class <类名>{ 成员变量; 方法(){方法体}; abstract 方法();}特点:抽象类不允许被实例化,只能作为其他类的父类当类中存在抽象方法,则必须声明为抽象类

2021-01-25 17:51:51 81

原创 Java中的this关键字

Java中的this表示指向当前对象的一个引用,它有以下用途:this.属性 = 属性值 表示赋值给当前对象属性值this.方法() 表示调用当前对象的方法this() 调用构造方法,在其他构造方法中调用时需要放在第一行this作为方法参数,将当前对象作为方法参数传递this作为返回值,将当前对象作为返回值返回...

2021-01-18 17:06:25 87

原创 linux基本操作

文件管cat (-n|-b)chmod 修改文件权限chown 修改属find -name “filename”mv curpath tarpathrm -r 循环 -f 即使是只读也不询问,强制删除touch修改读取时间which (vi)cp -r 递归复制head/tail -n num filenamegrep 查找内容匹配的文件...

2021-01-05 16:45:46 105 1

原创 leetcode - Next Greater Element I-III - Java

遇到了一道Easy题,这个Easy在于解起来很好解,但最优解实在不好想(现在的我是真想不太出来,看题看少了,读书读少了):You are given two arrays (without duplicates) nums1 and nums2 where nums1’s elements are subset of nums2. Find all the next greater numbers for nums1’s elements in the corresponding places of nu

2020-12-24 14:28:32 130 1

原创 leetcode - Decoded String at Index - java

An encoded string S is given. To find and write the decoded string to a tape, the encoded string is read one character at a time and the following steps are taken:If the character read is a letter, that letter is written onto the tape.If the character r

2020-12-21 14:20:11 127

原创 Fixing the Scala error: java.lang.NoSuchMethodError: scala.Product.$init$

运行spark程序报错:Fixing the Scala error: java.lang.NoSuchMethodError: scala.Product.$init$原因是导spark-core包时scala的版本号写错了。改版本号重新导,解决。

2020-12-17 17:10:56 182

原创 CountableThreadPool不可使用

CountableThreadPool不可使用?在pom依赖中加入: <dependency> <groupId>com.github.datastax-oss</groupId> <artifactId>commons-io</artifactId> <version>2.2.2</version> </dependency&

2020-12-14 16:34:33 181

原创 org.apache.commons.lang3.StringUtils要导入哪个包

org.apache.commons commons-lang3-3.1 <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <version>3.1</version> </dependency>版本要对

2020-12-10 10:02:47 10356 2

原创 leetcode - Unique Binary Search Trees II - Java

题目描述:输入一个数字,输出所有可能的BST,1…n。Example:Input: 3Output:[[1,null,3,2],[3,2,null,1],[3,1,null,null,2],[2,1,3],[1,null,2,null,3]]Explanation:The above output corresponds to the 5 unique BST’s shown below: 1 3 3 2 1 \

2020-12-09 16:51:01 88

原创 爬虫代码

package com.hxd.spring.service;import org.apache.http.HttpEntity;import org.apache.http.client.ClientProtocolException;import org.apache.http.client.methods.CloseableHttpResponse;import org.apache.http.client.methods.HttpGet;import org.apache.http.cl

2020-12-07 17:48:37 582 1

原创 leetcode - Jump Game - java

题目描述:给定一个数组,从index为0开始,每次最大可以跳nums[index]步,能跳到index为length-1为true,不能则为false。Input: nums = [2,3,1,1,4]Output: trueExplanation: Jump 1 step from index 0 to 1, then 3 steps to the last index.方法一:贪心算法,不断更新lastPos,判断当前点能否跳到lastPos,能跳到则将当前点设置为lastPos,直到las

2020-11-30 17:06:43 110

原创 leetcode -Jump Game III - Java

Given an array of non-negative integers arr, you are initially positioned at start index of the array. When you are at index i, you can jump to i + arr[i] or i - arr[i], check if you can reach to any index with value 0.Notice that you can not jump outside

2020-11-30 11:28:15 105

原创 leetcode - 394. Decode String -Java

Given an encoded string, return its decoded string.The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.You may assume that the

2020-11-20 14:10:10 119

原创 leetcode-450.删除二叉搜索树中的节点-Java

给定一个二叉树和一个key,删除二叉树中值为key的节点。删除节点还要保持BST的特性,那么有三种情况:1、该节点只有左子树2、该节点只有右子树3、该节点既有左子树也有右子树前两种情况比较简单,就直接拿左子树的根或者右子树的根替换就可以了第三种情况,我们有两种选择,一是我们可以选取左子树的最大值来替换,二是我们可以选取右子树的最小值来替换class Solution { public TreeNode deleteNode(TreeNode root, int key) {

2020-11-19 16:07:49 103

原创 求两个数的最大公因数

public int gcd(int a, int b) { if (a == 0) return b; return gcd(b % a, a); }

2020-11-18 10:47:18 322

原创 leetcode-593. Valid Square-java

Given the coordinates of four points in 2D space, return whether the four points could construct a square.The coordinate (x,y) of a point is represented by an integer array with two integers.Example:Input: p1 = [0,0], p2 = [1,1], p3 = [1,0], p4 = [0,1]

2020-11-12 13:27:22 152

原创 装机如何选择配件

显卡:比较参数CUDA Core 核心数加速频率 (GHz) 越低越好显存容量(GB)显存类型A卡:AMDN卡:英伟达N卡适合玩游戏用RTX系列高端显卡,高端游戏/有钱人用GTX偏低端,对一些耗性能的游戏也足够用CPU:...

2020-11-11 17:40:48 120

原创 leetcode - 652. Find Duplicate Subtrees - Java

Given the root of a binary tree, return all duplicate subtrees.For each kind of duplicate subtrees, you only need to return the root node of any one of them.Two trees are duplicate if they have the same structure with the same node values.Example 1:I

2020-11-11 15:09:00 152

原创 leetcode - 832.Flipping an Image -Java

Given a binary matrix A, we want to flip the image horizontally, then invert it, and return the resulting image.To flip an image horizontally means that each row of the image is reversed. For example, flipping [1, 1, 0] horizontally results in [0, 1, 1].

2020-11-11 11:24:23 85

原创 leetcode - Add tow numbers - Java

题目描述:给两个非空的List,将两个list的值相加,返回结果list。思路:该链表的前面部分就是数值的低位,所以依次读取链表中的数值就OK了,要考虑到相加大于10的情况。我自己写的solution有点复杂:public ListNode addTwoNumbers(ListNode l1, ListNode l2) { ListNode ans = new ListNode(-1); ListNode index = ans; int jump =

2020-11-02 14:32:08 87

原创 leetcode - Convert Binary Number in a Linked List to Integer - Java

Given head which is a reference node to a singly-linked list. The value of each node in the linked list is either 0 or 1. The linked list holds the binary representation of a number.Return the decimal value of the number in the linked list.题目描述:将存放二进制数的

2020-11-02 10:51:49 107

原创 leetcode - 849.Maximize Distance to Closest Person - Java

You are given an array representing a row of seats where seats[i] = 1 represents a person sitting in the ith seat, and seats[i] = 0 represents that the ith seat is empty (0-indexed).There is at least one empty seat, and at least one person sitting.Alex w

2020-10-30 10:58:39 128

原创 leetcode-228. Summary Ranges-Java

You are given a sorted unique integer array nums.Return the smallest sorted list of ranges that cover all the numbers in the array exactly. That is, each element of nums is covered by exactly one of the ranges, and there is no integer x such that x is in

2020-10-29 16:20:45 133

原创 Java泛型

原文章地址:https://www.jianshu.com/p/986f732ed2f1泛型1. 泛型存在的意义?2. 泛型类,泛型接口,泛型方法如何定义?1. 泛型存在的意义?泛型:即“参数化类型”,将类型由原来的具体类型参数化,然后再使用/调用时传入具体的类型。意义:1.适用于多种数据类型执行相同的代码2. 泛型中的类型在使用时指定,不需要强制类型转换2. 泛型类,泛型接口,泛型方法如何定义?泛型类定义:public class GenericClass<T> {

2020-10-22 17:54:31 570 3

原创 No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.6.1:compile (default-compile) on project sproject: Compilation failure[ERROR] No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK?

2020-10-22 17:10:56 799 2

转载 醉酒阿里P7分享并发编程套装,再说学不会就不是我的问题了

[并发编程]是每个架构师的筑基必备技能,没点余地,上去就是一个字:干! 几个月前靠着超级无敌的运气,得到阿里大牛赠送最全[高并发套餐],回去死磕100天(原谅我这个渣渣,耗的时间比较久,几天前才出关升级)。恰好,也挺久没唠嗑过高并发,今天必须来死磕一下这份最全[高并发套餐]   别急,咱先来检测一下自身的知识深度 先来问你20道高并发编程必备的知识点,试个水如何? 问...

2020-09-25 11:21:52 143

Git学习de.pdf

Git学习de.pdf

2020-11-30

空空如也

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

TA关注的人

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