摘要: ## 启动时 1.配置DataSource配置文件 2.DataSourceBuilder指定连接池,返回由连接池实现的DataSource,每个数据源都有一个连接池,连接池初始化几个连接 3.如果需要多数据源,这个时候需要DynamicDataSource,添加多有数据源,再返回一个由Dynami 阅读全文
posted @ 2023-08-10 16:48 猥琐熊花子酱 阅读(29) 评论(0) 推荐(0) 编辑
摘要: 里面涉及到了两个姿势点: 1.jdk动态代理,java运行只有接口,没有实现类,生成一个可执行的对象 2.spring FactoryBean ,通过spring提供的bean工厂,可是轻松的根据参数实例化需要的bean 以上两者结合,就可以实现只有接口也能注入并使用 ## 只有接口生成一个可执行的 阅读全文
posted @ 2023-06-07 15:13 猥琐熊花子酱 阅读(889) 评论(0) 推荐(0) 编辑
摘要: ## 固定窗口 缺陷:最简单,但是不能精确限制,由于是计算的时间差,比如每10秒只能10个请求,8-10秒请求了10个,那么10-18秒就也无法请求了 ``` import java.util.concurrent.atomic.AtomicInteger; import java.util.con 阅读全文
posted @ 2023-05-31 17:43 猥琐熊花子酱 阅读(36) 评论(0) 推荐(0) 编辑
摘要: ## java代码实现 为了方便理解布隆过滤器,java简单实现了下, 特点:仅用做一次运算就可以判断存在不存在,但是只能精确的判断值不存在,不能精确的判断值存在 ,实际使用中可以用redis或者guava的实现 ``` public class BlTest { private final int 阅读全文
posted @ 2023-05-31 11:30 猥琐熊花子酱 阅读(181) 评论(0) 推荐(0) 编辑
摘要: ==版本3.11== ## MQTT报文结构 ``` 1.Fixed header 固定报头,所有报文都包含 2.Variable header 可变报头,部分报文包含 3.Payload 有效载荷,部分报文包含 ``` ### 固定报头 固定报头 固定占2个字节 第一个节前4位表示报文类型后四位表 阅读全文
posted @ 2020-05-15 14:53 猥琐熊花子酱 阅读(1111) 评论(0) 推荐(0) 编辑
摘要: ## Dart连接socket(netty) ![](https://img2018.cnblogs.com/blog/1201668/201905/1201668-20190506163317039-482275790.png) ### Client: ```dart import 'dart:i 阅读全文
posted @ 2019-05-06 16:34 猥琐熊花子酱 阅读(2189) 评论(0) 推荐(0) 编辑
摘要: 微信维护access_token 阅读全文
posted @ 2019-01-07 16:21 猥琐熊花子酱 阅读(625) 评论(0) 推荐(0) 编辑
摘要: ``` @GetMapping({"/getOpenId"}) public void getOpenId(HttpServletResponse response) { try { StringBuffer sb = new StringBuffer(); try { ... 阅读全文
posted @ 2019-01-07 16:16 猥琐熊花子酱 阅读(166) 评论(0) 推荐(0) 编辑
摘要: ## spring boot 跨域 ``` import org.springframework.stereotype.Component; import javax.servlet.*; import javax.servlet.http.HttpServletResponse; import j 阅读全文
posted @ 2019-01-07 16:10 猥琐熊花子酱 阅读(133) 评论(0) 推荐(0) 编辑
摘要: ## java调用dll ## 首选写dll ``` # include _declspec(dllexport) char* go(char *ch) { MessageBox(NULL, TEXT(ch), TEXT("你好"), MB_OK); return "来自dll的问候"; } ``` 阅读全文
posted @ 2018-08-09 15:44 猥琐熊花子酱 阅读(1473) 评论(0) 推荐(0) 编辑