-
Go 时间加减、计算方法耗、毫秒转 Time
时间日期 Now():当前Time对象。 Date():当前年月日。年和日为int类型,月为Month类型。 YearDay():当天是一年中的第几天。 We
2020-10-25, Views: 25511 , Topics: Go
-
GoLand defer 提示 Unhandled error 解决方法
代码处理 defer func() { err := db.Close() if err != nil { fmt.Printl
-
Go 中的 GOROOT 和 GOPATH
GOROOT GOROOT为Go的根目录,包含了bin、pkg、src等目录。 注意:不是Go的bin目录。 GOPATH GOPATH为Go第三方依赖存储的路
2020-10-23, Views: 5098 , Topics: Go
-
Redis删除数据后内存不释放解决方法
查看内存占用 info memory 输出 127.0.0.1:6379> info memory # Memory used_memory:322089
2020-10-22, Views: 5215 , Topics: Redis
-
Jedis OOM command not allowed when used memory > 'maxmemory'
原因 Redis内存满了(配置的最大内存为3G) 127.0.0.1:6379> info memory # Memory used_memory:322
-
RabbitMQ 用户相关命令
相关命令 列表所有用户 sudo rabbitmqctl list_users 新增用户(用户名、密码) sudo rabbitmqctl add_user t
2020-10-20, Views: 1666 , Topics: RabbitMQ
-
RabbitMQ 更换日志和数据存储目录
步骤 创建mnesia和log两个文件夹 mkdir /home/rabbitmq/{mnesia,log} 目录授权 chmod -R rabbitmq:ra
2020-10-19, Views: 4532 , Topics: RabbitMQ
-
RabbitMQ 重启命令
第一步 关闭应用程序和Erlang节点 sudo rabbitmqctl stop 第二步 启动RabbitMQ节点 sudo service rabbitm
2020-10-16, Views: 11718 , Topics: RabbitMQ
-
网页文字不能复制解决方法
案例 如360doc图书馆文章详情页无法复制问题。 方法一 仅在Chrome中有效,Firefox / IE / Edge 无效。 网页加载完毕后,在地址栏输入
2020-10-10, Views: 4193 , Topics: JavaScript Chrome
-
Spring Boot JdbcTemplate in 语句注意事项
描述 在多条件查询情况下,拼接SQL语句时使用到了in关键词不管参数传入List集合还是Array数组,等到的结果集都是空。 // MySQL List<
2020-10-09, Views: 5005 , Topics: Spring Boot JdbcTemplate Java
-
OpenResty 清除 Sever 头信息
需求 HTTP返回的Header中不带Server字段。 方式 使用OpenResty自带并默认开启的headers-more-nginx-module模块清除
-
Windows 平台 lua-resty-upload 上传的文件无法打开
现象 使用lua-resty-upload示例代码上传的图片,在Windows平台无法打开,提示似乎不支持此文件格式。 对比发现上传后的文件比原始文件大了几KB
-
MongoDB 搭建分片集群
下载社区版 查看系统版本,判断是32位还是64位 uname -a 查看RedHat版本 cat /etc/redhat-release 可在package选择
2020-09-30, Views: 4590 , Topics: MongoDB
-
MongoDB 清理历史数据释放磁盘空间
清理数据 MongoDB删除了无用数据后,并不会释放磁盘空间。需使用compact或repairDatabase命令。 repairDatabase 4.2版本
2020-09-29, Views: 10171 , Topics: MongoDB
-
MongoDB 提示 None of the hosts for replica set could be contacted
错误信息 发生错误是在MongoDB的3.2.8版本分片部署模式下。查询时得到错误码71,可能当时正在做大批量删除历史数据操作,出现了以下错误。(笔者的分片副本
2020-09-28, Views: 4275 , Topics: MongoDB
-
Java7 文件变动监听
使用场景 应用配置热更新。 代码 可用于监听单个文件变更。 public static void main(String[] args) { try {
2020-09-27, Views: 2422 , Topics: Java
-
Java 中识别字符串编码
添加依赖 <dependency> <groupId>com.googlecode.juniversalchardet</
2020-09-25, Views: 2824 , Topics: Java
-
Java synchronized 锁字符串注意点
描述 使用synchronized关键字,根据不同字符串进行上锁。 public static void main(String[] args) { f
-
Gradle 编译时跳过测试
命令行 gradle build -x test 或者 gradle build --exclude-task test IDEA 目前没有找到修改Run Co
-
监测广告位是否被 AdBlock 拦截
判断样式 当页面加载完成后,判断广告位元素样式display是否为none,即可。 代码 <!DOCTYPE html> <html lang
2020-09-22, Views: 2555 , Topics: AdBlock JavaScript