e_e
- 浏览: 84431 次
- 性别:
- 来自: 上海
社区版块
- ( 0)
- ( 0)
- ( 0)
最新评论
文章列表
mysql 读写分离
1. 引入包
com.baomidou
dynamic-datasource-spring-boot-starter
3.5.1
mysql
...
创建文件 系统清理.bat,内容如下:
@echo off
echo 正在清除系统垃圾文件,请稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
import numpy as np
from matplotlib import pyplot as plt
import math
x1,y1 = 2,3
x2,y2 = 7,10
# p1,q1 = 4,8
# p2,q2 = 6,3
plt.plot(x1,y1,'ob')
plt.plot(x2,y2,'ob')
# plt.plot(p1,q1, 'or')
# plt.plot(p2,q2, 'or')
def get_k(x1,y1,x2,y2):
k = (y1-y2)/(x1-x2)
return k
...
登录:https://colab.research.google.com
import matplotlib.pyplot as plt
import numpy as np
x = np.linspace(0,2*np.pi, 100)
y = np.sin(x)
plt.plot(x,y)
plt.xlabel('x')
plt.ylabel('y')
plt.title('sin function')
plt.show()
错误信息:
org.springframework.dao.cannotacquirelockexception: ### error updating database. cause: com.mysql.cj.jdbc.exceptions.mysqltransactionrollbackexception: lockwaittimeoutexceeded; try restarting transaction
原因:表的某条记录更增操作可能在另外一个大的事务里被锁,锁的时间超过了数据库指定时间(如下图:innodb_lock_wait_timeout=10秒),导致此处 ...
第一步:添加包
yarn add vue-json-viewer
第二步:加入components
components: {
jsonviewer,
},
第三步:添加div
global site tag (gtag.js) - google analytics
unsupported conversion from date to java.lang.long
正解:date类型换成localdatetime
误解:去掉@builder标签
import lombok.extern.slf4j.slf4j;
import org.junit.test;
import org.junit.runner.runwith;
import org.springframework.boot.test.context.springboottest;
import org.springframework.test.context.junit4.springrunner;
import java.io.bufferedreader;
import java.io.file;
import java.io.filereader; ...
# 配置sql打印日志
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.stdoutimpl
logging:
level:
root: info
com.***.telemarket.mapper: trace
引入jar包并配置resources下的logback-spring.xml文件如下
# 配置sql打印日志
mybatis-plus:
configuration:
log-impl: org.apache.ibatis.logging.stdout.stdoutimpl
logging:
level:
root: info
com.***.telemarket.mapper: trace
引入jar包并配置resources下的logback-spring.xml文件如下
求a列和b列的交集
=if(isnumber(match(a5,$b$1:$b$2000,0)),a5,"")
求a列和b列的差集
=if(iserror(match(a1,$b$1:$b$200,0)),a1,"")
@springboottest(classes = telemarketcoreapplication.class)
@runwith(springrunner.class)
@activeprofiles("test")
public class couponsinfoservicetest {
@mockbean
resttemplate resttemplate;
@autowired
private couponsinfoservice couponsinfoservice;
@before
public void setup() { ...
读excel文件生成sql
- 博客分类:
- java
import java.io.*;
import java.util.arraylist;
import java.util.list;
public class stringtoolsqlformatter {
private static final string sql_1 = "update t_call_data set decision_complete_type='batch_decision_compilte' where register_id=%s and date_format(import_time,'%y-%m-%e')=" ...
spring cloud 配置中心
- 博客分类:
- spring
@enableconfigserver
@enablediscoveryclient
@springbootapplication
public class configcenterapplication {
public static void main(string[] args) {
springapplication.run(configcenterapplication.class, args);
}
}
pom.xml
org.springframewor ...
api模块接收请求,推送到消息队列
router模块消费消息,分发到各个模块
每个模块消费消息,在推回api模块,因为api模块需要知道最终执行结果
api模块配置:
spring:
cloud:
stream:
bindings:
outbound-agent-state-list.destination: outbound.agent-state-list #生产
agent-state-list-reply-channel: # ...