阿里云 云效问题
他的编译机器,似乎公用的,导致用 s 写入配置,会被别人看到
golang
json 必须传入一个指针类型,但是声明的指针类型不行 1234567// 错误var res *Resultjson.Unmarshal(b,res)// 正确var res *Resultjson.Unmarshal(b,&res) slice slice传递时候,实际上都是值传递,只不过创建新的slice时候,系统没有全部复制一份,而是把原来的数据给了一个新的引用,这才导致了,只要容量不变化,新slice的操作都会转移到老slice上,slice结构如下 12345type slice struct { array unsafe.Pointer // 指向数组内存地址的指针 len int // 已有元素长度 cap int // 切片总容量} 如果彻底不想改变老slice,可以逐个值放进去 1
腾讯 gpu 服务器
自带的python去掉镜像1pip config set global.index-url "" 安装cuda直接安装cuda使用runfile
软件安装
golang 下载源码包到某个目录 环境变量 123456`/etc/profile`export GOROOT=~/res/go # golang源码位置export GOPATH=~/res/golang # golang将来安装第三方包位置export GOBIN=$GOPATH/binexport PATH=$PATH:$GOROOT/bin:$GOBIN 配置代理 12go env -w GO111MODULE=ongo env -w GOPROXY=https://goproxy.cn,direct podman 配置文件 1/etc/containers/registries.conf sjtu镜像 123456789unqualified-search-registries = ["docker.io"][[registry]]prefix = "docker.io"insecure = falseblocked = falselocation = "docker.io"[[registry...
opensuse使用记录 2023
2023-07-20开始使用开始使用opensuse15.5,希望用的久2023-07-20 默认安装后没有wifi,通过手机usb共享网络,更新后有了wifi 无法使用ntfs移动硬盘https://zhuanlan.zhihu.com/p/348778863 12sudo zypper in ntfsprogssudo ntfsfix /dev/sda1 安装kde connect后无法连接 1sudo zypper in kdeconnect-kde 需要在yast中设置防火墙,public中找到kdeconnect两个服务都添加到允许 展示安装过的软件1zypper se -i 卸载一个软件,结果整个界面没了
debian 使用记录
2023-07-20无法挂载ntfs移动硬盘apt安装似乎也不稳,经常出现 1W: Possible missing firmware /lib/firmware/amdgpu/sienna_cichlid_mes1.bin for module amdgpu 体验失败
yii2 使用
核心验证器,字符串限制1[['phone'], 'string', 'length' => [11, 11], 'tooShort' => '请输入11位手机号码', 'tooLong' => '请输入11位手机号码'], 响应json数据 在web.php中配置components 123456789'response' => [ 'formatters' => [ \yii\web\Response::FORMAT_JSON => [ 'class' => \yii\web\JsonResponseFormatter::class, 'prettyPrint' => YII_DEBUG, 'encodeOption...
gorm gen 使用问题
gen在生成关联时候,必须先有model,但是这时候model还没有生成,所以就必须要有一个先后调整的过程,没法一气呵成解决办法:生成模型和生成关联分为两步去做 gorm关联经常提升要使用外键定义时候给出关联定义 123tag = field.NewGormTag()tag.Set("references", "ID")tag.Set("foreignKey", "UserID") 其中foreignKey指的是当前表中和外部关联的字段,references指的是外部的表中的字段 添加关联 如果子模型本来不存在,用Append或者Replace加上去,则无法建立关联关系,必须手动把字段都写好,仅仅是少写了一点代码 关联写入时候,如果关联模型是空的,就写不进去
go-zero使用问题
goctl-swagger 在post请求时候,总是把参数转为json,导致swagger失去意义 当返回错误时候,框架总是给出400错误
python3 报错解决方法
No module named ‘Crypto’ 1pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pycryptodome No module named ‘PIL’ 1pip install -i https://pypi.tuna.tsinghua.edu.cn/simple pillow No module named ‘numpy’ 1pip install -i https://pypi.tuna.tsinghua.edu.cn/simple numpy 使用上海交大源1pip install -r requirements.txt -i https://mirror.sjtu.edu.cn/pypi/web/simple --trusted-host mirror.sjtu.edu.cn 安装后没有piphttps://blog.csdn.net/weixin_44331765/article/details/121017727 123python -m ensurepip --up...