- 博客(35)
- 收藏
- 关注

原创 常用123
j8新特性:https://www.jb51.net/article/48304.htmredis学习:http://redisdoc.com/geo/geoadd.htmljs插件:https://www.bootschool.net/?catDir=datetimepaypal:https://cloud.tencent.com/developer/news/333558htt...
2019-04-28 17:30:54
260
原创 配置git忽略文件
*.iws*.iml*.iprtarget/.gitignore.settings.project.classpath.externalToolBuilders*.class*svn/.idea/*.jar~*
2021-03-08 19:59:21
194
原创 hashmap.tableSizeFor 方法
static final int MAXIMUM_CAPACITY = 1 << 30; static final int tableSizeFor(int cap) { // 0000 1000 0000 0000 0000 0000 0000 0000 n // 0000 0100 0000 0000 0000 0000 0000 0000 n>>>1 //->0000 1100 0000 0000...
2020-09-08 16:11:44
118
原创 hashmap.getNode() 方法
/** * Implements Map.get and related methods * * @param hash hash for key * @param key the key * @return the node, or null if none */ final Node<K,V> getNode(int hash, Object key) { Node<K,V>[] tab...
2020-09-04 17:05:37
573
原创 hashmap.putVal()方法
/** * Implements Map.put and related methods * * @param hash hash for key * @param key the key * @param value the value to put * @param onlyIfAbsent if true, don't change existing value * @param evict if false, the t...
2020-09-04 16:22:50
273
原创 hashmap.resize() 方法
/** * Initializes or doubles table size. If null, allocates in * accord with initial capacity target held in field threshold. * Otherwise, because we are using power-of-two expansion, the * elements from each bin must either stay ...
2020-09-04 15:42:45
212
转载 一图弄懂ASCII、GB2312、GBK、GB18030编码
见:https://blog.youkuaiyun.com/u010828343/article/details/103762678https://cloud.tencent.com/developer/article/1343240
2020-08-27 09:51:39
195
原创 JAVA 四种引用及应用场景
强引用:类型是在代码中普遍存在,不解释弱引用:如果一个对象只有弱引用指向它,垃圾回收器会立即回收该对象,这是一种急切回收方式。实际用途示例:而弱引用非常适合存储元数据,例如:存储ClassLoader引用。如果没有类被加载,那么也没有指向ClassLoader的引用。一旦上一次的强引用被去除,只有弱引用的ClassLoader就会被回收。这篇文章中我们将讲述不同类型的Java引用,软引用:相对的,如果有软引用指向这些对象,则只有在JVM需要内存时才回收这些对象。实际用途示例:软引用可
2020-08-25 18:02:40
449
原创 ORACLE 按逗号分割字符串
--定义TYPECREATE OR REPLACE TYPE "RESOLVE_STR" IS TABLE OF VARCHAR2 (4000);--定义函数CREATE OR REPLACE FUNCTION F_SPLIT ( P_STR IN VARCHAR2, P_DELIMITER IN varchar2 := ',' ...
2020-02-26 14:38:21
2226
转载 java8 四大核心函数式接口Function、Consumer、Supplier、Predicate
Function<T, R>T:入参类型,R:出参类型调用方法:Rapply(Tt);定义函数示例:Function<Integer, Integer> func = p -> p * 10;// 输出入参的10倍调用函数示例:func.apply(10);// 结果100Consumer<T>T:入参类型;...
2020-02-22 14:00:58
241
原创 备忘代码段
/*** * Deque 测试 */ @Test public void test1() { Deque<Integer> candidates = new LinkedList<>(); for(int i=0;i<5;i++) { candidates.add(i...
2019-11-18 11:55:32
113
原创 java 问题排查
查看高cpu线程1.top命令对cpu进行排序shift+p2.top -Hp pid查看相关负载线程pid3.printf "0x%x\n" 线程pid // 将线程 PID转换为 16进制,为后面查找 jstack 日志做准备// 例如:jstack 1040|vim +/0x431 -4.jstack 进程 PID | vim +/十六进制线程PID ------...
2019-10-29 11:21:16
120
原创 Visual Studio Code 的 Link With Editor 功能
原文:https://blog.youkuaiyun.com/qq_20594019/article/details/97631129
2019-09-26 10:15:08
618
原创 oracle 根据日期查找不到数据的问题
出现的问题:当日期(标红的地方,yyyy-mm-dd格式)是从接口获取的字符串时,想查询某一天的数据时发现查不到数据,而查两天就可以查到数据.检查后,发现是使用to_date函数不仔细引起的.to_date( '2019-07-21' ,'yyyy-mm-dd') 默认转换成 2019-07-21 00:00:00例如想查询2019-07-21的数据:当开始时间 和 结...
2019-07-24 14:19:49
2035
原创 HttpServletRequest.getParameter获取不到值
今天在调试接口时,使用postman提交表单,发现使用request.getParameter获取到的值总是为null,后经检查发现原因是:在header中设置了Content-Type=application/json(之前调试接口时设置的)去掉这条设置后,再次提交表单,使用request.getParameter获取就到请求值了...
2019-07-18 14:57:52
4043
原创 spring cache + redis 学习
spring cache 哈喽沃德:https://www.cnblogs.com/wangzhongqiu/p/6958655.htmlspring cache注解详解:https://www.cnblogs.com/fashflying/p/6908028.htmlRedisCache:(spring版本5.0.7.RELEASE,注意设置timeout)packa...
2019-06-25 10:28:48
106
转载 oracle 查看锁表进程和清除锁表进程
查看锁表进程SQL语句:select * from v$session t1, v$locked_object t2 where t1.sid = t2.SESSION_ID;杀掉锁表进程:记录下SID和serial# ,分别替换掉下面的1155,39095,即可解除锁表alter system kill session '1155,39095';原文:https://...
2019-06-17 17:33:12
447
原创 windows把zookeeper注册成服务
1.下载zookeeper服务插件(zip包)http://archive.apache.org/dist/commons/daemon/binaries/windows/2.把prunsrv.exe、prunmgr.exe复制到zookeeper的bin路径下3.新建一个install.bat文件,用于注册服务prunsrv.exe "//IS//%ZOOKEEPER_S...
2019-05-07 14:10:46
494
原创 maven设置jdk版本
<build> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactI...
2019-04-26 15:37:21
115
原创 rabbit mq学习
基础:https://blog.youkuaiyun.com/hellozpc/article/details/81436980RabbitMQ学习之Headers交换类型(java):https://blog.youkuaiyun.com/zhu_tianwei/article/details/40923131RabbitMQ Exchange类型详解:https://www.cnblogs.com/july...
2019-04-26 14:26:28
139
转载 在windows中将jar注册成服务
打包项目 mvn clean package下载winsw,放到E:\project下并重命名为MyApp.exe。在E:\project下创建一个project.xml文件,内容如下:<service> <id>MyApp</id> <name>MyApp</name> <descriptio...
2019-01-23 09:41:24
982
原创 linux端口访问
查看端口是否可以访问Chain INPUT (policy ACCEPT)target prot opt source destination ACCEPT tcp -- localhost anywhere tcp dpt:{端口号} #可以访问REJECT ...
2018-10-25 14:59:23
986
原创 超时检查js
//登录后 //每2min发送 请求(设置个变量 表示还在登录)//每10min 发送登出请求 期间若有检查到操作 则取消这个定时任务//服务器设置 session 超时时间为 3minvar isAlive = true;var heartBeatInterval = 2 * 60 * 1000; // 2 minvar expiredInterval = 10 * 60...
2018-10-23 14:34:35
231
转载 Tomcat 内存调整
如果是Tomcat服务,优化内存则需要到注册表进行修改(Windows Server 2008为例子): 打开注册表并找到对应目录:(cmd命令:regedit)HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Apache Software Foundation\T7062_22230_App_Apptrack(服务名)\Parameters\Java\...
2018-10-08 10:17:49
135
原创 redis 增加密码访问的host
http://password:${yourpassword}@${host}:${post} 其中 ${yourpassword} 的特殊字符要进行URL encode 例: '@' -> '%40'
2018-09-30 10:55:40
1642
转载 java发送https请求
详见 https://blog.youkuaiyun.com/shumeng_xiaoyan/article/details/76503601
2018-08-31 15:04:07
162
原创 linux安装mysql
我的linux版本为 centos7 没有mysql的yum源,于是先下载好安装包:wget http://dev.mysql.com/get/mysql57-community-release-el7-8.noarch.rpm安装yum源:yum localinstall mysql57-community-release-el7-8.noarch.rpm查看yum源是否安装成功:yum rep...
2018-05-08 23:34:08
121
原创 mysql 远程连接问题
安装好mysql后,可以成功地在Xshell中登陆mysql,但是用windows中的navicat登陆时出现了一下异常:上网一顿查询,终于找到了解决办法:MariaDB [(none)]> grant all privileges on *.* to 'root'@'175.7.*.*' identified by 'root' with grant option;再次尝试,发现错误信息有...
2018-05-08 21:27:34
149
原创 java web项目中使用log4j
1.需要使用到spring2.web.xml中增加配置<!-- 配置日志 --> <context-param> <param-name>webAppRootKey</param-name> <!-- 项目运行的路径 --> <param-value>webApp.root&...
2018-05-08 14:28:32
295
原创 struts2拦截器的使用
1.拦截器类 package com.xxxxxx.interceptors; class TestInteceptor implements Interceptor @Override public String intercept(ActionInvocation invocation) throws Exception { Sys...
2018-05-08 14:27:50
110
原创 struts2返回json
1.需要jar包:struts2-json-plugin-2.5.5.jar2.重写继承的package:<package name="default" namespace="/" extends="json-default">, json-default包已继承defaultPackage.3.action配置:<action name="testJson" class="h
2018-05-08 14:27:12
120
原创 修改struts2拦截器默认值
<interceptors> <interceptor-stack name="modifiedStack"> <interceptor-ref name="defaultStack"> <param name="prepare.alwaysInvokePrepare"&
2018-05-08 14:26:02
155
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人