摘要: 1.docker run –net=none busybox top,请问这个容器会有自己的netns(网络namespace 文件)吗? 有,none也是一种网络模式,所以有 四种网络模式 host模式,使用 net=host指定。 container模式,使用 net=container:NAM 阅读全文
posted @ 2020-01-06 11:12 飞天小烤猪 阅读(187) 评论(0) 推荐(0) 编辑
摘要: sort.Slice声明 实际使用 和C++的sort模板类似,只需要实现less函数,Go特别的是传入的函数不是直接传入less,而是一个匿名函数,匿名函数的参数是两个下标,表示两个比较元素在切片中的下标 阅读全文
posted @ 2019-12-31 11:22 飞天小烤猪 阅读(5580) 评论(0) 推荐(0) 编辑
摘要: 1. You are not allowed to write any production code unless it is to make a failing unit test pass. 除非为了使一个失败的unit test通过,否则不允许编写任何产品代码 2. You are not 阅读全文
posted @ 2019-12-22 10:44 飞天小烤猪 阅读(218) 评论(0) 推荐(0) 编辑
摘要: Ubuntu16 GTX750安装CUDA9.0,Pytorch,Anaconda教程 安装前警告 不要使用Ubuntu18! 不要使用Ubuntu18! 不要使用Ubuntu18! 务必重装成Ubuntu16 安装NVDIA驱动 只用这一个办法,一劳永逸 https://www.linuxidc. 阅读全文
posted @ 2019-12-20 20:29 飞天小烤猪 阅读(1268) 评论(0) 推荐(0) 编辑
摘要: 随机算法的两大类 Las Vegas 总是给出正确的解,或者无解 Mente Carlo 总是给出解。偶尔也给出非正确解,但随着次数增大,非正确解概率减到任意小 实例 随机化快速排序 为了保证平均运行时间,随机选取快速排序的主元pivot 随机化选择第k小元素 与上同 测试二进制串的相等性 选择一个 阅读全文
posted @ 2019-12-19 09:29 飞天小烤猪 阅读(224) 评论(0) 推荐(0) 编辑
摘要: 问题1:Unable to import maven project: See logs for details 网上说,原因是IDEA2019和Maven3.6.2不兼容导致的,需要把Maven降级到3.6.1版本 记得把环境变量改好,避免以后出错 找到一个能用的stting.xml是这样的 部分 阅读全文
posted @ 2019-12-18 09:24 飞天小烤猪 阅读(5347) 评论(0) 推荐(0) 编辑
摘要: 准备依赖 测试HelloWorld 打开server $env:GOPATH\src\github.com\grpc\grpc go\examples\helloworld\greeter_server go run main.go 打开client $env:GOPATH\src\github.c 阅读全文
posted @ 2019-12-15 17:27 飞天小烤猪 阅读(1280) 评论(0) 推荐(0) 编辑
摘要: 使用git # 吧$GOPATH替换成自己的GOPATH git clone https://github.com/golang/net.git $GOPATH/src/golang.org/x/net git clone https://github.com/golang/text.git $GO 阅读全文
posted @ 2019-12-15 17:20 飞天小烤猪 阅读(335) 评论(0) 推荐(0) 编辑
摘要: 简单粗暴法 删除锁 $ sudo rm /var/cache/apt/archives/lock $ sudo rm /var/lib/dpkg/lock 如果还不行,重启虚拟机 $ reboot 阅读全文
posted @ 2019-12-12 09:58 飞天小烤猪 阅读(1200) 评论(0) 推荐(0) 编辑
摘要: Go module的两个代理源 阿里云 https://mirrors.aliyun.com/goproxy/ 使用帮助 1.使用go1.11以上版本并开启go module机制 2.导出GOPROXY环境变量 export GOPROXY=https://mirrors.aliyun.com/go 阅读全文
posted @ 2019-12-09 18:15 飞天小烤猪 阅读(2074) 评论(0) 推荐(0) 编辑