- 博客(26)
- 收藏
- 关注
转载 linux 发送qq邮箱问题
1.配置/etc/mail.rcset from=xxx@host.cn #发送方邮件地址set smtp=smtps://smtp.exmail.qq.com:465 #邮件服务器set smtp-auth=login #验证方式/登录验证set smtp-...
2019-01-23 14:19:10
1384
原创 mysql 修改column操作
1.增加唯一键 alter table table_name add unique key `uniq_column` (`column`);2.添加字段alter table table_name add column column_name datatype3.删除字段ALTER TABLE table_name DROP COLUMN column_name4.修改字段...
2019-01-14 14:19:09
12277
转载 linux 字符的字符串操作命令
awk 求和,平均数,最大最小值1.求和 cat data|awk '{sum+=$1} END {print "SUM=" ,sum}'2.求平均cat data|awk '{sum+=$1} END {print "Average=",sum/NR}'3.求最大值cat data|awk 'BEGIN{max = 0} {if ($1>max) max=$1 f...
2018-11-27 18:01:51
464
转载 nginx代理配置
nginx.conf是nginx的配置文件1,默认配置:#user nobody;worker_processes 1;#error_log logs/error.log;#error_log logs/error.log notice;#error_log logs/error.log info;#pid logs/nginx.pid;e...
2018-11-06 14:52:03
145
原创 spring定时任务表达式
一个cron表达式有6个或者7个时间元素组成秒(0~59)分钟(0-59)小时(0-23)天(月) (0~31)月(0~11)天(星期)(1~7 )年份(1970-2099)0 0 10,14,16 * * ? 每天上午10点,下午2点,4点0 0/30 9-17 * * ? 朝九晚五工作时间内每半小时0 0 12 ? * WED 表示每个星期三中午12点 ...
2018-11-05 16:25:11
250
原创 正则表达式语法
^:匹配输入字符串开始的位置$:匹配输入字符串结尾的位置*:零次或多次匹配前面的字符+:匹配一次或多次前面的字符?:匹配0次或一次的字符{n} n为非负数,正好匹配n次{n,}n是非负数,至少匹配n次{n,m} m,n为非负数,至少匹配n次,之多匹配m次.任何单个字符x|f: 匹配x或y[xyz]:匹配制定范围内的任何字符串\d:数字字符 ,相当于[0-...
2018-11-05 16:12:29
106
原创 git常用命令总结
1. git init 在本地新建一个repo,进入一个目录,执行git init,会初始化一个repo,并在当地文件创建一个.git文件夹2.git clone 获取一个url对应的远程git repo ,创建一个local copy 一般格式git clone url3.git status 查询repo状态 git status -...
2018-10-17 21:28:52
110
原创 CURL命令
1. 设置请求方法. -Xcurl -X GET -d "hello=world" https://www.sina.com.cn 2.添加请求头 -Hcurl -X GET -d "hello=world" -H "Content-Type:application/json" -H "token:123445" https://www.sina.com.cn3.下载请求 -o ...
2018-10-17 21:10:14
526
原创 mysql 时间函数
1.获取当前时间日期 now(),sysdate(),current_timestamp,current_timestamp()2.日期转换函数,时间转换函数 date_format('2008-08-08','%Y%m%d%H%i%s') mysql日期.时间转换函数:date_format(date,format), time_format(time,format) ...
2018-10-16 12:07:48
94
原创 linux的基本命令
1. find 查找 -amin -n :在最近的n分钟内被读取过 -amin +n :在n分钟之前被读取过的 -atime -n:最近n天内读取过的档案 -atime +n:在n天之前读取过的档案 -cmin -n:在最近n分钟被修改过 -cmin +n:在n分钟之前被修改过 -ctime -n:最近n天内修改过的档案 -c...
2018-08-15 13:18:47
239
原创 java lambda 自定义
1.概念lambda表达式是JAVA8中提供的一种新的特性,它支持Java也能进行简单的“函数式编程”。 它是一个匿名函数,Lambda表达式基于数学中的λ演算得名,直接对应于其中的lambda抽象(lambda abstraction),是一个匿名函数,即没有函数名的函数。2.使用 2.1首先新建函数式接口,eg Runnable。这里需要注意:函数式接口智能有一个方法 ...
2018-08-13 16:29:52
2358
转载 httpclient4
http://www.baeldung.com/httpclient4?utm_source=email-newsletter&utm_medium=email&utm_campaign=auto_14_httpclient&tl_inbound=1&tl_target_all=1&tl_period_type=3
2018-07-30 11:07:52
127
原创 hashmap源码分析
1.hashmap类结构 public class HashMap<K,V> extends AbstractMap<K,V> implements Map<K,V>, Cloneable, Serializable {2.几个重要的值 /** * The default initial capacity - MUST be a...
2018-07-24 15:55:53
118
原创 The Best APIs are Built with Swagger Tools
1.导入依赖<!-- swagger --><dependency> <groupId>io.springfox</groupId> <artifactId>springfox-swagger2</artifactId> <version>2.5.0</version&
2018-07-16 15:14:28
200
原创 LinkedList源码分析
transient int size = 0;//元素个数/** * Pointer to first node. * Invariant: (first == null && last == null) || * (first.prev == null && first.item != null) */transient Nod...
2018-07-13 17:48:52
170
原创 ArrayList源码分析
/** * Constructs an empty list with an initial capacity of ten.无参构造方法 */public ArrayList() { this.elementData = DEFAULTCAPACITY_EMPTY_ELEMENTDATA;//默认元素为空}/** * Shared empty array instance ...
2018-07-13 17:02:36
177
原创 lambda表达式
//lambda新建线程Thread t1 = new Thread(() -> System.out.print("heeh"));t1.start();//lambda便利String[] strs = {"bb","aa", "cc"};List<String> list = Arrays.asList(strs);list.forEach(System.out::...
2018-07-12 19:58:20
120
原创 redisTemplate自增操作
RedisAtomicLong entityIdCounter = new RedisAtomicLong(key, redisTemplate.getConnectionFactory());Long increment = entityIdCounter.getAndIncrement();return increment;
2018-07-02 21:53:04
27034
原创 redis 发布与订阅 :java,以及键过期时间监控
package com.example.demo.RedisPubSubAndListener;import redis.clients.jedis.JedisPubSub;public class PubSubScriber extends JedisPubSub {//订阅消息的处理类 @Override public void onMessage(Strin...
2018-07-02 21:37:09
1152
原创 添加打印MyBatis 日志 springboot 启动执行函数
实现 CommandLineRunner 或 ApplicationRunner 实现其中的run方法springboot 项目打印sql日志logging.level.com.xxx.apais.dao=debug//com.xxx.apais 为dao的包路径
2018-06-28 15:07:15
214
原创 big decimal 和jdk8 时间类的基本用法
BigDecimal decimal = new BigDecimal("6.544355");decimal = decimal.setScale(1,BigDecimal.ROUND_HALF_UP);//四舍五入//jdk8 时间类 Localtime LocalDate LocalDateTime DateTimeFormatter LocalDate now = LocalDa...
2018-06-26 14:23:13
574
转载 java的垃圾回收器详解
堆内存: permanent:持久代 存放java类定义信息,与垃圾收集器收集的java对象关系不大 Heap:{old+new} old:老年代 new:年轻代 年轻代和老年代对垃圾收集影响大新生代: 所有新生成的对象首先放在年轻代。 年轻代的目标就是尽可能快速的收集那些生命周期短的对象 年轻代一般有3个区:1个Eden区 , 2个Surv
2018-02-06 16:12:47
232
原创 java 如何创建一个有返回值的线程
//使用Future 和 Callable public class MyFuture {public static void main(String[] args) throws InterruptedException, ExecutionException {ExecutorService singleThreadExecutor = Executors.newSing
2017-11-10 14:19:17
1326
原创 java 自定义类如何实现foreach循环
//实现Iterable接口,并实现接口中的方法//iterator() 方法需要返回Iterator对象,所以要创建Iterator对象,实现hasNext 和next方法public class IterTest implements Iterable{private Integer[] elementData ={1,2,3,4,5};public static void
2017-11-10 12:40:19
3541
原创 spring aop 的概念配置
通知(Advice):在spring中切面的工作被称为通知,spring可分为5种类型的通知:1.前置通知 2.后置通知 3.返回通知 4.异常通知 5.环绕通知切点:决定哪些需要切连接点:是在应用执行过程中能够插入切面的一个点切面:通知和切点的结合spring实现aop的方法 AspectJ和xml配置
2017-02-04 15:16:19
135
原创 java 获取当前年月日,uuid获取
java中获取当前年月日使用Calendar类//获取Calendar类Calendar calendar = Calendar.getInstance();//获取年calendar.get(Calendar.YEAR);//获取月 注:获取的月比真实月少1calendar.get(Calendar.MONTH)+1;获取UUID字符串方法:uui
2016-11-08 17:59:22
632
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人