自定义博客皮肤VIP专享

*博客头图:

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

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

博客底图:

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

栏目图:

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

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(100)
  • 资源 (2)
  • 收藏
  • 关注

原创 log4j-1.x 日志脱敏 扩展PatternLayout类+修改log4j.properties

log4j-1.2.16 日志手机号码脱敏背景项目做完,公司安全测试,说系统有安全漏洞,日志中未对用户信息进行脱敏处理,需要我对手机号进行脱敏处理,至少隐藏四位。锅从天上来,一期的项目的安全漏洞,之前没有安全测试,二期项目结束,测出来了,一脸懵的我~好学和负责任的我(没办法,后来就算不算是二期项目的锅,我是系统Owner,最后还是算是系统问题),开始找资料怎么修复,网上一堆资料,怕个啥。过...

2019-03-21 19:48:49 1925

原创 1、CSDN markdown 字体、字号、颜色设置(自己用的)

居中的代码是<div align=center> CSDN markdown 字体、字号、颜色设置

2017-02-23 16:56:50 954

原创 Spring 验证(Validation)、数据绑定(Data Binding)和类型转换(Type Conversion)

在Web层,应用程序还可以根据DataBinder为每个控制器注册控制器本地的Spring Validator实例,如在配置DataBinder中所述,这对于插入自定义验证逻辑非常有用。Spring的类型转换机制可以帮助开发者处理请求参数的解析和转换,以适应目标方法或模型对象的需求。通过在模型对象的属性上添加合适的验证注解(如@NotNull、@Size等),可以在处理请求参数或表单数据时进行验证。考虑到这些问题,Spring提供了一个验证器接口(Validator),基本且易于在应用程序的每个层中使用。

2023-07-10 12:37:53 425

原创 mysql锁的问题

而如果使用的是 InnoDB 存储引擎,插入操作会锁定新插入的行,这属于行级锁。当插入一行数据时,会对此行加锁,直到插入完成后才释放锁,这可以避免多个用户同时插入同一行数据的问题。如果使用的是 MyISAM 存储引擎,插入操作会锁定整个表,这是表级锁。总之,在插入操作时,应该选择正确的存储引擎,并考虑事务的隔离级别,以避免潜在的性能问题和数据一致性问题。在 MySQL 中,插入操作会涉及到行级锁和表级锁,具体涉及到哪种锁取决于存储引擎和事务的隔离级别。

2023-06-02 09:47:41 787 3

原创 jstat和jmap查看JVM堆内存使用情况

查看java进程$jps -l结果69492 sun.tools.jps.Jps69268 66776 69469 org.jetbrains.jps.cmdline.Launcher57501 /Users/ma-l00000701/Downloads/apache-jmeter-5.2.1/bin/ApacheJMeter.jar69470 org.apache.catalina.startup.Bootstrap查看org.apache.catalina.startup.Boot

2020-06-27 23:35:19 747

原创 MAC端口号被占用问题

idea 异常退出,再次启动本地项目时,1099端口被占用1、使用 lsof -i:1099 命令查看所占用的进程号 PID=692002、使用 kill -9 69200 命令杀掉占用1099端口号的进程TN-MA-L00000701deMacBook-Pro:~ tn-ma-l00000701$ lsof -i:1099COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAMEjava 69

2020-06-27 22:30:55 279

原创 对Runnable 和 Thread的思考

见到一个问题:java中下面哪个能创建并启动线程()public class MyRunnable implements Runnable{ public void run(){ //some code here } }A、new Runnable(MyRunnable).start()B、new Thread(MyRunnable).ru...

2020-04-29 09:13:58 180

原创 SQLException: Value '0000-00-00 00:00:00' can not be represented as java.sql.Timestamp

Error querying database. Cause: java.sql.SQLException: Value ‘0000-00-00 00:00:00’ can not be represented as java.sql.Timestamp解决方案 <property name="url"> <value>jdbc:...

2020-04-02 16:59:07 169

原创 SpringMVC中List长度超过256抛出IndexOutOfBoundsException异常

org.springframework.beans.InvalidPropertyException : Invalid property 'visaRes[256]' of bean class [com.xxx.xxx.GenerateResVo]: Index of out of bounds in property path 'visaRes[256]'; nested exception...

2019-12-19 22:36:32 449

原创 java多线程共享成员变量的安全问题

1、问题描述批量变更产品专员时,为产品专员开通对应产品权限时,是用多线程任务去执行的,出现的问题时,批量开通100个产品权限时,可能只真正开通几个产品的权限,其他产品的权限并未开通。通过分析日志,发现调用开通权限的接口,入参是最后一个产品ID的记录有61个,剩余39个请求,也有重复的产品ID,怀疑多线程并发问题导致2、问题分析创建线程的类实现Runnable 类接口,重写run方法,通过构造...

2019-12-14 13:02:20 890

原创 不可见字符和字符串前后空格处理

背景场景一:有技术支持过来,说用户登录不上,报错原因是不存在该用户,但是明明已经注册过了。过程:登陆的请求参数确实有收到,用户名是手机号。用户id也是存在的,根据用户id查出来的手机号,确实和登陆名是一样的,但是为啥会报用户不存在的错误呀?开始根本没有想过用手机号进行查询,后来实在是没有排查到别的原因,突然想到之前遇到的手机号前后有空格的问题。length了一下,果然,长度为17。告知业务...

2019-10-18 13:41:12 1429

原创 日志打印mybatis中SQL

log4j.rootLogger = DEBUG,stdout,Dlog4j.appender.stdout=org.apache.log4j.ConsoleAppenderlog4j.appender.stdout.Threshold = DEBUGlog4j.appender.stdout.layout=com.tuniu.gt.common.ExPatternLayoutlog4j...

2019-04-02 16:35:57 233

原创 记一次应用接口日志访问量和访问时长统计

2019-03-141、下载运维每天归档的日志2、找运维要到 tomcat acess log 配置格式为 pattern="%{X-Forwarded-For}i %l %u %t “%r” %m %s %b %D"3、日志数据量不是很大,一共两个文件,每个文件60W数据量。先导入到excel中,预处理了一下,几个不需要的字段删除掉,本来想在excel中统计,速度太慢,统计了两个接口就受...

2019-03-14 11:25:09 1879

原创 cvc-complex-type.2.4.c错误解决

报错信息: cvc-complex-type.2.4.c:The matching wildcard is strict,but no declaration can be found for element’tx:advice’ 解决办法: 在 xsi:schemaLocation 加上: http://www.springframework.org/schema/tx http://w...

2018-08-05 21:43:38 1168

原创 MySQL+Maven+Spring+Mybatis

一. 数据库准备MySQL安装包是 mysql-5.5.19-win32.msi,图形化管理MySQL界面 sqlyog_mysql.zip 查看数据库show databases;建表语句use test;DROP TABLE IF EXISTS `t_user`; CREATE TABLE `t_user` ( `user_id` int(11) NOT NU...

2018-05-24 14:41:30 298

原创 Linux当月第一天日期,某日期前一天日期,某日期前一年日期

#当月的第一天日期dt_date=`date +%Y%m01`# dt_date日期往前推1年R1_date_start=`date --date="${dt_date}-1 year" +%Y-%m-%d`# R1_date_start日期往前推1年R2_date_start=`date --date="${R1_date_start}-1 year" +%Y-%m-%d`#...

2018-04-11 15:13:18 1412

原创 Linux 下用 crontab配置定时任务

1、crontab - l //查看定时任务列表 2、crontab -e //编辑定时任务 3、crontab 配置定时任务格式 : Minute Hour Day Month Dayofweek command举例说明: Minute Hour Day Month Day of week 描述 5 * * * * 每...

2018-04-11 10:43:53 210

原创 LeetCode107. Binary Tree Level Order Traversal II

Given a binary tree, return the bottom-up level order traversal of its nodes’ values. (ie, from left to right, level by level from leaf to root).For example: Given binary tree [3,9,20,null,null,15,7],

2017-05-07 21:33:07 317

原创 LeetCode104. Maximum Depth of Binary Tree

Given a binary tree, find its maximum depth.The maximum depth is the number of nodes along the longest path from the root node down to the farthest leaf node.递归/** * Definition for a binary tree node.

2017-05-07 17:01:45 325

原创 LeetCode101. Symmetric Tree

Given a binary tree, check whether it is a mirror of itself (ie, symmetric around its center).For example, this binary tree [1,2,2,3,4,4,3] is symmetric: 1 / \ 2 2 / \ / \3 4 4 3But the f

2017-05-07 15:58:43 255

原创 LeetCode567. Permutation in String

Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string’s permutations is the substring of the second string.Example 1

2017-05-07 15:04:59 331

原创 LeetCode575. Distribute Candies

Given an integer array with even length, where different numbers in this array represent different kinds of candies. Each number means one candy of the corresponding kind. You need to distribute these

2017-05-07 15:02:53 375

原创 LeetCode42. Trapping Rain Water

Given n non-negative integers representing an elevation map where the width of each bar is 1, compute how much water it is able to trap after raining.For example, Given [0,1,0,2,1,0,1,3,2,1,2,1], ret

2017-04-22 13:33:58 336

原创 LeetCode34. Search for a Range

Given an array of integers sorted in ascending order, find the starting and ending position of a given target value.Your algorithm’s runtime complexity must be in the order of O(log n).If the target is

2017-04-22 11:18:46 247

原创 LeetCOde33. Search in Rotated Sorted Array

Suppose an array sorted in ascending order is rotated at some pivot unknown to you beforehand.(i.e., 0 1 2 4 5 6 7 might become 4 5 6 7 0 1 2).You are given a target value to search. If found in the ar

2017-04-22 10:43:34 269

原创 LeetCode31. Next Permutation

Implement next permutation, which rearranges numbers into the lexicographically next greater permutation of numbers.If such arrangement is not possible, it must rearrange it as the lowest possible orde

2017-04-21 21:04:01 290

原创 LeetCode25. Reverse Nodes in k-Group

Given a linked list, reverse the nodes of a linked list k at a time and return its modified list.k is a positive integer and is less than or equal to the length of the linked list. If the number of nod

2017-04-21 11:27:36 258

原创 LeetCode24. Swap Nodes in Pairs

Given a linked list, swap every two adjacent nodes and return its head.For example, Given 1->2->3->4, you should return the list as 2->1->4->3.Your algorithm should use only constant space. You may no

2017-04-21 09:28:12 327

原创 LeetCOde19. Remove Nth Node From End of List

Given a linked list, remove the nth node from the end of list and return its head.For example,Given linked list: 1->2->3->4->5, and n = 2.After removing the second node from the end, the linked list be

2017-04-20 20:39:33 235

原创 LeetCode18. 4Sum

Given an array S of n integers, are there elements a, b, c, and d in S such that a + b + c + d = target? Find all unique quadruplets in the array which gives the sum of target.Note: The solution set mu

2017-04-20 19:54:14 368

原创 LeetCode17. Letter Combinations of a Phone Number

Given a digit string, return all possible letter combinations that the number could represent.A mapping of digit to letters (just like on the telephone buttons) is given below. Input:Digit string “23”

2017-04-17 20:45:46 399

原创 LeetCode16. 3Sum Closest

Given an array S of n integers, find three integers in S such that the sum is closest to a given number, target. Return the sum of the three integers. You may assume that each input would have exactly

2017-04-17 10:50:56 304

原创 LeetCode15. 3Sum

Given an array S of n integers, are there elements a, b, c in S such that a + b + c = 0? Find all unique triplets in the array which gives the sum of zero.Note: The solution set must not contain duplic

2017-04-17 09:16:17 350

原创 LeetCode88. Merge Sorted Array

Given two sorted integer arrays nums1 and nums2, merge nums2 into nums1 as one sorted array.Note: You may assume that nums1 has enough space (size that is greater or equal to m + n) to hold additional

2017-04-10 14:24:26 230

原创 LeetCode83. Remove Duplicates from Sorted List

Given a sorted linked list, delete all duplicates such that each element appear only once.For example, Given 1->1->2, return 1->2. Given 1->1->2->3->3, return 1->2->3./** * Definition for singly-lin

2017-04-09 10:27:55 210

原创 LeetCode70. Climbing Stairs

You are climbing a stair case. It takes n steps to reach to the top.Each time you can either climb 1 or 2 steps. In how many distinct ways can you climb to the top?Note: Given n will be a positive inte

2017-04-09 09:44:07 215

原创 LeetCode67. Add Binary

Given two binary strings, return their sum (also a binary string).For example, a = “11” b = “1” Return “100”.#include<string>#include<cstdlib>#include<iostream>using namespace std;class Solution

2017-04-06 21:19:33 313

原创 LeetCode66. Plus One

Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself.The digits are st

2017-04-06 21:12:34 269

原创 LeetCode66. Plus One

Given a non-negative integer represented as a non-empty array of digits, plus one to the integer.You may assume the integer do not contain any leading zero, except the number 0 itself.The digits are st

2017-04-06 19:50:45 218

原创 LeetCode58. Length of Last Word

Given a string s consists of upper/lower-case alphabets and empty space characters ’ ‘, return the length of last word in the string.If the last word does not exist, return 0.Note: A word is defined as

2017-04-06 18:49:12 238

Wireshark 4.2.0

Wireshark是一款网络协议分析器,可以捕获网络数据包并进行分析,是网络故障排查、分析、软件和通信协议开发以及教育领域非常强大的工具

2023-12-23

Numerical Analysis英文书籍

英文数值分析教材,内容非常丰富,算法很多,很经典。

2018-01-25

MATLAB 从入门到精通教程

MTALAB从入门到精通pdf教程,里面内容很简单,适合新手入门。

2018-01-25

空空如也

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

TA关注的人

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