上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 55 下一页

2021年12月17日

Go语言对字符串进行SHA1 哈希运算的方法

摘要: Go语言对字符串进行SHA1 哈希运算的方法 package main import ( "crypto/md5" "crypto/sha1" "fmt" "io" ) //对字符串进行MD5哈希 func a(data string) string { t := md5.New() io.Writ 阅读全文

posted @ 2021-12-17 15:39 星河赵 阅读(1163) 评论(0) 推荐(0) 编辑

Go - 获取当前时间 时间格式的转换 秒、毫秒、纳秒时间戳输出

摘要: 1. Go时间格式的转换 package main import ( "fmt" "time" ) func main() { t := time.Now() //2019-07-31 13:55:21.3410012 +0800 CST m=+0.006015601 fmt.Println(t.F 阅读全文

posted @ 2021-12-17 15:04 星河赵 阅读(4649) 评论(0) 推荐(0) 编辑

golang go 中字符串和各种int类型之间的相互转换方式

摘要: go 字符串和int互转 1.string转成int: int, err := strconv.Atoi(string) 2.string转成int64: int64, err := strconv.ParseInt(string, 10, 64) 3.int转成string: string := 阅读全文

posted @ 2021-12-17 14:26 星河赵 阅读(1566) 评论(0) 推荐(0) 编辑

2021年12月13日

Go语言中调用C语言----类型转换篇

摘要: 1.Cgo 数组转切片 go数组转C数组 (*[3]int32)(unsafe.Pointer(backgroundColor)) // 切片转数组 c := [6]C.double{ 1, 2, 3, 4, 5, 6 } cfa := (*[6]float64)(unsafe.Pointer(&c 阅读全文

posted @ 2021-12-13 14:54 星河赵 阅读(1081) 评论(0) 推荐(0) 编辑

2021年12月6日

Go 操作mongodb

摘要: 前言 参考地址:https://juejin.cn/post/6908063164726771719 最近学习在go中操作mongodb,了解到主要有第三方mgo和官方mongo-driver两个库使用最多。mgo已经停止维护了,因此选择了mongo-driver。本文记录一些常用的代码操作笔记,以 阅读全文

posted @ 2021-12-06 11:36 星河赵 阅读(1055) 评论(0) 推荐(0) 编辑

Golang 操作redis

摘要: 我使用的是 https://github.com/go-redis/redis 这个 golang 客户端, 因此安装方式如下: go get github.com/go-redis/redis/v8 接着在代码中导入此包即可: "github.com/go-redis/redis/v8" 创建客户 阅读全文

posted @ 2021-12-06 10:59 星河赵 阅读(106) 评论(0) 推荐(0) 编辑

2021年11月12日

python 封装脚本为pip 包上传pypi

摘要: 1、注册一个PyPi帐号 PyPi注册网站 注册帐号就是最一般的流程了,填写帐号和密码之后,在邮箱验证一下就可以了. 2、安装发布包 在发布自己包之前,需要安装一下pypi发布所依赖的包twine,以及setuptools pip install twine 3.编写自己代码 1)首先需要创建__i 阅读全文

posted @ 2021-11-12 14:11 星河赵 阅读(202) 评论(0) 推荐(0) 编辑

2021年11月10日

pillow 读写保存图片

摘要: 1.安装pillow pip install pillow 2.读写以及等比例缩放保存图片 img = Image.open("/tmp/123/000000165.jpg") img_w, img_h = img.size # 宽度、高度最大值 > 2500等比例缩放 if max(img_h, 阅读全文

posted @ 2021-11-10 14:59 星河赵 阅读(508) 评论(0) 推荐(0) 编辑

2021年11月8日

Cygwin安装教程 Windows上仿真linux操作系统

摘要: 简介cygwin是一个在windows平台上运行的unix模拟环境,是cygnus solutions公司开发的自由软件 Cygwin就是一个windows软件,该软件就是在windows上仿真linux操作系统简言之,cygwin是一个在windows平台上运行的 linux模拟环境,使用一个Dl 阅读全文

posted @ 2021-11-08 17:15 星河赵 阅读(373) 评论(0) 推荐(0) 编辑

2021年11月4日

python 图像去重(imagededup) 比较图片相似度

摘要: 开源地址: https://github.com/idealo/imagededup 安装库 pip install imagededup 示例代码 from imagededup.methods import PHash phasher = PHash() # 生成图像目录中所有图像的二值hash 阅读全文

posted @ 2021-11-04 09:32 星河赵 阅读(570) 评论(0) 推荐(0) 编辑

上一页 1 ··· 6 7 8 9 10 11 12 13 14 ··· 55 下一页

导航