DFS与BFS适用场景
背景 Depth-First-Search(DFS)深度优先搜索与Breadth-First Search(BFS)广度优先搜索是树与图中最常用的算法。 ...
背景 Depth-First-Search(DFS)深度优先搜索与Breadth-First Search(BFS)广度优先搜索是树与图中最常用的算法。 ...
说明 主要记录以太坊开发环境过程出现的问题 getCompilers返回失败 问题描述 在搭建以太坊开发环境过程中,出现下面的错误信息: 1 2 3 4 5 6 7 8 9 10 11 Welcome to the Geth JavaScript console! instance: Geth/v1.6.7-stable-ab5646c5/darwin-amd64/go1.8.3 modules: admin:1.0 debug:1.0 eth:1.0 miner:1.0 net:1.0 personal:1.0 rpc:1.0 shh:1.0 txpool:1.0 web3:1.0 > web3.eth.getCompilers() Error: The method eth_getCompilers does not exist/is not available at web3.js:3104:20 at web3.js:6191:15 at web3.js:5004:36 at <anonymous>:1:1 问题原因 geth版本编译不在gopath目录下编译 ...
前言 先下结论:slice复用得当心,引用不当深埋雷。如若复用请分叉,分叉之后再使用。 问题 先看一下代码吧 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 package main import ( "fmt" ) func a() { x := []int{} x = append(x, 0) x = append(x, 1) // commonTags := labelsToTags(app.Labels) y := append(x, 2) // Tags: append(commonTags, labelsToTags(d.Labels)...) z := append(x, 3) // Tags: append(commonTags, labelsToTags(d.Labels)...) fmt.Println(y, z) } func b() { x := []int{} x = append(x, 0) x = append(x, 1) x = append(x, 2) // commonTags := labelsToTags(app.Labels) y := append(x, 3) // Tags: append(commonTags, labelsToTags(d.Labels)...) z := append(x, 4) // Tags: append(commonTags, labelsToTags(d.Labels)...) fmt.Println(y, z) } func main() { a() b() } 上面的如此简单的代码,分析代码希望得到预期结果如下: ...
什么是拖延症 拖延症是一种结果。 拖延症是一种状态。 拖延症是一种情绪调节方式。 拖延症是一种延迟选择。 拖延症是现在的自我与未来的自我之间的矛盾。 拖延症是选择性的。 每个人都有拖延症。 ...
思考的质量 人一思考,上帝就开始发笑。所以人要学会思考,提高思考的质量。 下面从四个角度来看看有哪些因素决定思考的质量? 原则 怀疑一切,大胆假设,小心验证 实事求是 注重方法与策略 主动积极 Input 好问题 问题描述 能量 专注 Process 广度 深度 清晰 适度 创造 Output 清晰 准确 全面 深度 逻辑 创造 可操作性 持续性 总结 高质量思考= 高质量的原则+高质量的Input+高质量的Process+高质量的Output。
引言 记得小学语文课本上有一篇文章:《画杨桃》。作者根据自己看到的,把杨桃画成像个五角星的样子。文章想表达两个意思: 实事求是 同一个事物,角度不同,看见不同 多个角度 在现实生活中看事物的角度远比上面《画杨桃》复杂,因为事物可能不像杨桃那么具体,也不要杨桃静止在那里,更有可能还不知道从哪些角度看。 ...
目标的意义 目标是指导前进的方向 目标帮助思考:我们真正想要的是什么? 目标是动力的来源之一 目标有利于抗干扰,提高专注力 SMART原则 谈及目标原则,必会谈到SMART原则。 ...
从Git历史中彻底删除大文件 描述 1 2 3 4 5 remote: Resolving deltas: 100% (23/23), completed with 17 local objects. remote: error: Trace: 4836afb0ea0a96bb85e61a8ae818673e2f110a05c0da9e6813f8fa0c34ba2816 remote: error: See https://gh.io/lfs for more information. remote: error: File pdsv3.json is 184.08 MB; this exceeds GitHub's file size limit of 100.00 MB remote: error: GH001: Large files detected. You may want to try Git Large File Storage 方案 备份当前代码(防止操作失误) ...
日常工作中最常见问题是如何诊断一个进程运行过程中出现的问题,下面的总结从进程诊断的角度来展示,而是不从工具与命令角度来展示,进程诊断是工作的主体,工具与命令只是工具。 ...
依赖 依赖golang的开发环境 安装 present工具在golang.org/x/tools中,依赖golang.org/x/net包,安装过程如下: ...