上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
摘要: ![image](https://img2023.cnblogs.com/blog/680792/202301/680792-20230115215914136-1768677870.png) 阅读全文
posted @ 2023-01-15 21:54 SpecialSpeculator 阅读(26) 评论(0) 推荐(0)
摘要: 1.服务器暴露远程调试端口 java -Xdebug -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8089 -jardemo-1.0.0-SNAPSHORT.jar 2.暴露服务端口 http://127.0.0.1:8 阅读全文
posted @ 2023-01-15 15:27 SpecialSpeculator 阅读(195) 评论(0) 推荐(0)
摘要: 1.java entity定义 @Data @EqualsAndHashCode(callSuper = true) @Accessors(chain = true) @TableName(value = "delta24_alarmrule",autoResultMap = true) publi 阅读全文
posted @ 2023-01-15 11:18 SpecialSpeculator 阅读(1695) 评论(0) 推荐(0)
摘要: 只修改部分字段 直接使用UpdateWrapper方法,通过eq指定where的限制条件,通过set方法制定要写的字段的值 @Autowired ResGroupDaoService resGroupDaoService; void update(){ resGroupDaoService.upda 阅读全文
posted @ 2023-01-13 16:06 SpecialSpeculator 阅读(1591) 评论(0) 推荐(0)
摘要: 创建map的同时赋值 Map<Boolean, Consumer<ProcessContext<NotificationModel>>> actionMap = new ImmutableMap.Builder<Boolean, Consumer<ProcessContext<Notificatio 阅读全文
posted @ 2023-01-11 14:18 SpecialSpeculator 阅读(45) 评论(0) 推荐(0)
摘要: 装饰器模式 本质是继承了父类的新的装饰类,重写了父类的方法,前后各扩展功能,中间调用super父类方法 1.设计抽象类实现接口 public abstract class ShapeDecorator implements Shape { protected Shape decoratedShape 阅读全文
posted @ 2023-01-06 17:30 SpecialSpeculator 阅读(22) 评论(0) 推荐(0)
摘要: # 1.函数式接口 只能含有1个方法的接口,入参可以有多个,出参可有可无 定义接口 ```java @FunctionalInterface public interface ReceiverGetter { List apply(ResGroup resGroup); } ``` 使用策略模式使用 阅读全文
posted @ 2023-01-05 18:40 SpecialSpeculator 阅读(55) 评论(0) 推荐(0)
摘要: 区间建仓352法 又称菱形建仓法 提前做好规划 以东财为例,个股占总仓位数不能超10% 总仓位25万的话,东财应该最多2.5万,对应到19.27的股价,接近于1300股=10% 3是起手,5是中手,2是末手 1.352建仓法购买东方财富,刚买完就大跌 假设352方式买东方财富,遇到跌的情况 先买3% 阅读全文
posted @ 2023-01-03 17:42 SpecialSpeculator 阅读(452) 评论(0) 推荐(0)
摘要: 责任链模式 一条链路,按照顺序执行,中间出现问题,可以退出return 常用与参数校验,接入层的相关处理逻辑 固定套路 1.定义数据处理模型基类 public interface ProcessModel { } 2.抽象Context里包含数据处理模型,处理器之间传递context 使用到了泛型上 阅读全文
posted @ 2022-12-30 11:06 SpecialSpeculator 阅读(59) 评论(0) 推荐(0)
摘要: Controller的单元测试 大体代码 import org.junit.Before; import org.junit.Test; import org.junit.runner.RunWith; import org.springframework.beans.factory.annotat 阅读全文
posted @ 2022-12-08 11:07 SpecialSpeculator 阅读(666) 评论(0) 推荐(0)
摘要: 1.引用guava中的重试类 <dependency> <groupId>com.google.guava</groupId> <artifactId>guava</artifactId> <version>30.1.1-jre</version> </dependency> 2.定义Boolean 阅读全文
posted @ 2022-12-08 10:48 SpecialSpeculator 阅读(183) 评论(0) 推荐(0)
摘要: ![image](https://img2023.cnblogs.com/blog/680792/202211/680792-20221129171632388-855829973.png) ![image](https://img2023.cnblogs.com/blog/680792/202211/680792-20221129171559107-500931399.png) 阅读全文
posted @ 2022-11-29 17:17 SpecialSpeculator 阅读(30) 评论(0) 推荐(0)
摘要: 使用draw.io 软件 开源,永久免费 3要素 图形,文本,连接 快速开始 图形:简单拖拽,画布上添加图形 文本:画布上任何位置双击都可以添加文本框,输入蚊子 连接:图形上鼠标悬停,出现连接点.蓝色大箭头和小的x点. 操作 复制command +c 复制并粘贴command +d 删除delete 阅读全文
posted @ 2022-11-16 10:19 SpecialSpeculator 阅读(219) 评论(0) 推荐(0)
摘要: 命令模式 使用场景 我反复强调,设个非常重要!因为纵使你有十八般武器,不知道什么时候用也是白搭。从定义上我们就可以看出其可以解决的问题。 当需要将各种执行的动作抽象出来,使用时通过不同的参数来决定执行哪个对象 当某个或者某些操作需要支持撤销的场景 当要对操作过程记录日志,以便后期通过日志将操作过程重 阅读全文
posted @ 2022-11-11 19:48 SpecialSpeculator 阅读(108) 评论(0) 推荐(0)
摘要: 滑动窗口采用的是guava中提供的Range数据结构 里面存取的是一段时间范围 public static Range<Long> buildRange(int minInterval, Integer windowRange, Integer windowSize, LocalDateTime t 阅读全文
posted @ 2022-11-11 17:49 SpecialSpeculator 阅读(123) 评论(0) 推荐(0)
摘要: 工厂模式 定义工厂类,及工厂方法,获取工厂里面的数据 @Service @Order public class RuleFactory { private static final Logger logger = LoggerFactory.getLogger(RuleFactory.class); 阅读全文
posted @ 2022-11-11 17:43 SpecialSpeculator 阅读(20) 评论(0) 推荐(0)
摘要: 依赖guava中的table数据结构 使用 Table<Long, String, Set<Metric>> table = Tables.synchronizedTable(HashBasedTable.create()); # table的三段结构rowKey,columnKey,value # 阅读全文
posted @ 2022-11-11 17:34 SpecialSpeculator 阅读(133) 评论(0) 推荐(0)
摘要: 1.定义数据转换接口,通过泛型实现 Converter.java public interface Converter<IN, OUT> { OUT convert(IN in); } 2.定义实现类,对指定类型转换为另一种指定类型 将ConsumerRecord<String, String>类型 阅读全文
posted @ 2022-11-11 17:08 SpecialSpeculator 阅读(92) 评论(0) 推荐(0)
摘要: 1.指定Stop接口 public interface IStop { void close(); } 2.指定Consumer接口 public interface IConsumer extends IStop{ void init(); void start() throws Exceptio 阅读全文
posted @ 2022-11-11 17:02 SpecialSpeculator 阅读(42) 评论(0) 推荐(0)
摘要: 内存可用率 计算公式内存使用率=(1-free_rate)%100 公式说明: free_rate=MEMFREE + BUFFERS + CACHED / MEMTOTAL MEMFREE + BUFFERS + CACHED / MEMTOTAL 的值来自 /proc/meminfo 具体/pr 阅读全文
posted @ 2022-11-09 13:57 SpecialSpeculator 阅读(673) 评论(0) 推荐(0)
摘要: # 观察者模式 对象间存在一对多关系时,使用观察者模式. 当一个对象被修改时,会自动通知依赖它的对象,观察者模式属于行为模式 # 如何解决 抽象类里有一个ArrayList存放观察者们 观察者和被观察者是抽象耦合的, # 代码样例 ## 1.抽象Listener接口 ```java interfac 阅读全文
posted @ 2022-11-04 14:33 SpecialSpeculator 阅读(22) 评论(0) 推荐(0)
摘要: 本地延迟队列 DelayQueue是无界的 特殊注意: 放入DelayQueue队列中的数据必须实现Delay接口,可以通过指定方法获取到是否到执行时间及比较运算逻辑 1.定义本地延迟队列 @Slf4j @Component public class NotificationHisRetryQueu 阅读全文
posted @ 2022-11-02 13:49 SpecialSpeculator 阅读(76) 评论(0) 推荐(0)
摘要: 1.异步发送API接口 public void send(final Message message, final AsyncSendCallback callback) 2.实现类分析 public void send(final Message message, final AsyncSendC 阅读全文
posted @ 2022-10-28 18:22 SpecialSpeculator 阅读(96) 评论(0) 推荐(0)
摘要: 函数式接口,Functional Interface 是一个有且仅有一个的抽象方法,可以有多个非抽象方法的接口 函数式接口可以被隐式的转换为lambda表达式 1.定义 @FunctionalInterface interface GreetingService { void sayMessage( 阅读全文
posted @ 2022-10-28 14:43 SpecialSpeculator 阅读(34) 评论(0) 推荐(0)
摘要: 构建大前提配置,build参数中把resources相关的构建带上 <build> <resources> <resource> <directory>${project.basedir}/src/main/resources</directory> <filtering>true</filteri 阅读全文
posted @ 2022-10-27 15:29 SpecialSpeculator 阅读(80) 评论(0) 推荐(0)
摘要: 使用了org.apache.commons.lang包下的工具类 RandomStringUtils 引入依赖 <dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-lang3</artifactId> <ver 阅读全文
posted @ 2022-09-27 15:24 SpecialSpeculator 阅读(124) 评论(0) 推荐(0)
摘要: 共享库文件缺失 报错 Stopping keepalived: [FAILED] Starting keepalived: /export/servers/keepalived-1.2.13/sbin/keepalived: error while loading shared libraries: 阅读全文
posted @ 2022-09-08 09:09 SpecialSpeculator 阅读(486) 评论(0) 推荐(0)
摘要: 定时器调用 func main(){ t := time.NewTicker(time.Hour * 5).C for { <-t fmt.Println(1) } } 分析说明 time.NewTicker生成了一个每5个小时生成一条数据的管道t 管道<-t,从管道里取数据阻塞 阅读全文
posted @ 2022-07-04 15:56 SpecialSpeculator 阅读(35) 评论(0) 推荐(0)
摘要: 协和医院医生说话记录 外院查的结果阴性能排除结核吗,不能排除 穿刺液,渗出液的话还是要高度怀疑结核 B超引导下穿刺不是手术,用细针穿,把液体引出来,送各种检查 腹腔镜全麻,手术,微创更合适一些 开了一些检查 免疫指标 肝肾 血尿常规 再查一下腹水是不是比以前多 超声介入的会诊,超声来穿 穿刺液的生化 阅读全文
posted @ 2022-06-07 21:27 SpecialSpeculator 阅读(24) 评论(0) 推荐(0)
摘要: tcp重传排查 执行命令 tcpdump -i eth0 tcp and port 22 -C 20 -W 50 -w /tmp/cap.pcap 说明: 抓取eth0的tcp报文,且端口为22的,最大抓取50个包,每个包20M,共占用1G的空间, 抓取的文件保存到/tmp/cap.pcap下。 对 阅读全文
posted @ 2022-06-06 00:13 SpecialSpeculator 阅读(157) 评论(0) 推荐(0)
摘要: 1.展示机器上所有线程的cpu利用率 ps H -eo user,pid,ppid,tid,time,%cpu,cmd --sort=%cpu 按照cpu从小到大排序 admin 24931 20874 24931 00:00:00 0.0 ps H -eo user,pid,ppid,tid,ti 阅读全文
posted @ 2022-06-01 10:45 SpecialSpeculator 阅读(282) 评论(0) 推荐(0)
摘要: 使用第三方模块 "github.com/hpcloud/tail" 初始化Tail指针 package logtail import ( "fmt" "github.com/hpcloud/tail" ) var ( tailObj *tail.Tail ) func Init(path strin 阅读全文
posted @ 2022-05-25 22:18 SpecialSpeculator 阅读(89) 评论(0) 推荐(0)
摘要: 依赖第三方包 "github.com/Shopify/sarama" 1.初始化异步生产者对象 package kafka import ( "fmt" "github.com/Shopify/sarama" ) var ( producer sarama.AsyncProducer ) func 阅读全文
posted @ 2022-05-25 22:14 SpecialSpeculator 阅读(174) 评论(0) 推荐(0)
摘要: 1.解析ini配置文件 config.ini [kafka] address=127.0.0.1:9092 topic=web_log [logtail] path=./my.log 对应的结构体 package conf type KafkaConfig struct { Address []st 阅读全文
posted @ 2022-05-25 22:11 SpecialSpeculator 阅读(218) 评论(0) 推荐(0)
摘要: Kafka原理 1.架构 broker-0 broker-1 一个kafka集群由多个broker组成,才能实现负载均衡,容错 broker无状态,通过zookeeper来维护集群状态 一个kafka的broker可以处理10万/秒读写,每个broker都可以处理TB消息而不影响性能 2.zooke 阅读全文
posted @ 2022-05-16 20:44 SpecialSpeculator 阅读(362) 评论(0) 推荐(0)
摘要: 1.Elk stack filebeat要先于业务容器启动完成,要不丢日志 扩展知识: 边车模式,共享网络名称空间,可以业务容器的脚本里今判断,filebeat起来后,我再把自己的程序拉起来 2.云计算的模型 Iaas是云服务的最底层,主要提供基础资源(只提供了一个厨房,自己要做的细节还是很多的) 阅读全文
posted @ 2022-05-02 14:33 SpecialSpeculator 阅读(107) 评论(0) 推荐(0)
摘要: 1.说明 KEYS[1] 用来表示在redis 中用作键值的参数占位,主要用來传递在redis 中用作keyz值的参数。 ARGV[1] 用来表示在redis 中用作参数的占位,主要用来传递在redis中用做 value值的参数。 2.代码范例 2.1 释放redis锁 public boolean 阅读全文
posted @ 2022-04-22 18:24 SpecialSpeculator 阅读(162) 评论(0) 推荐(0)
摘要: Filter性能更高 filter不进行评分操作,所以性能更好 Must 好计算分值的,类似于sql中的and 阅读全文
posted @ 2022-04-22 18:10 SpecialSpeculator 阅读(859) 评论(0) 推荐(1)
摘要: 1.RSetMultimapCache 是redisson基于redis设计的数据结构 主要用于存取数据结构为Map<String,Set> map 这种数据结构 2.putAll方法的坑 RSetMultimapCache<String, String> list = getRGroup(redi 阅读全文
posted @ 2022-04-22 16:45 SpecialSpeculator 阅读(639) 评论(0) 推荐(0)
摘要: 1.查询json学习 { "bool": { "must": [ { "term": { "yn": { "value": 1, "boost": 1 # 权重是1 } } }, { "terms": { "ware_info_id": [ "lw_770_421", "lw_770_979", " 阅读全文
posted @ 2022-04-22 13:35 SpecialSpeculator 阅读(36) 评论(0) 推荐(0)
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 13 下一页
点击右上角即可分享
微信分享提示