摘要: [adlist.o] Error jemalloc/jemalloc.h: No such file or directory 此问题是在Linux中安装Redis出现的问题 安装过程 1. 解压从官网下载的Redis tar zxvf redis-5.0.10.tar.gz 2. 进入redis- 阅读全文
posted @ 2020-11-26 16:17 寄人间于朝暮 阅读(224) 评论(0) 推荐(0)
摘要: 需求 需要获取json的字符串参数中的某个属性的值,只用json转对象后再获取层级比较多,所以使用简单的正则表达式进行获取 具体实现 public static void main(String[] args) { String data = "{\"code\":1,\"msg\":\"操作成功! 阅读全文
posted @ 2020-11-17 14:27 寄人间于朝暮 阅读(2852) 评论(0) 推荐(0)
摘要: 加锁实现 实现逻辑 通过for循环自旋的方式,判断redis中是否存在锁的缓存,存在则放回true,否则判断获取锁的时间是否超时,超时则返回false。 自旋的判断时间是很快的,设置的超时时间如果太长会占用cpu的时间片处理。 加锁的实现方法 /** * 获取锁的超时时间 */ private st 阅读全文
posted @ 2020-10-30 11:59 寄人间于朝暮 阅读(2237) 评论(0) 推荐(0)
摘要: 程序员接私活国内外平台 国内篇 猪八戒 https://guangzhou.zbj.com/ 程序员客栈 https://www.proginn.com/ 快码众包 https://www.kuai.ma/crowdsourcing.html 码市 https://codemart.com/ 开源众 阅读全文
posted @ 2020-10-27 17:00 寄人间于朝暮 阅读(362) 评论(2) 推荐(0)
摘要: 枚举 switch case 标签必须为枚举常量的非限定名称 错误描述: Error:(63, 24) 错误: 枚举 switch case 标签必须为枚举常量的非限定名称。 解决思路: switch语句支持使用枚举类型作为条件 case标签支持: 1.类型为char、byte、short、int的 阅读全文
posted @ 2020-10-22 17:24 寄人间于朝暮 阅读(6503) 评论(0) 推荐(0)