摘要: package main import ( "fmt" ) func quickSort(a []int, left int, right int) { if left >= right { //一定是left >= right return } temp := a[left] start := left stop := right for right != left... 阅读全文
posted @ 2019-08-08 20:45 幸运使者 阅读(1685) 评论(0) 推荐(0) 编辑
摘要: 解析log:下载需要解析的log wget https://gist.githubusercontent.com/clanchun/2b5e07cda53718ccbf64f62fb31900c8/raw/64be7f018973717dd5faa7be2bfb817f50ed05bb/access 阅读全文
posted @ 2019-08-07 14:09 幸运使者 阅读(722) 评论(0) 推荐(0) 编辑
摘要: 堆的概念:堆是一种图的树状结构,被用于实现“优先队列”。 1.首先创建堆: 堆的特性: (1).完全二叉树; (2).每一个节点都大于其左右子节点; (3).根节点最大(大堆); (4).左子节点2i+1,由子节点2i+2,父节点(i-1)/2; 2.堆排序 阅读全文
posted @ 2019-08-06 20:49 幸运使者 阅读(1176) 评论(1) 推荐(0) 编辑
摘要: 1.需要的websocket的包: "github.com/gorilla/websocket" package main import ( "github.com/gorilla/websocket" "learngo/websocket/impl" "net/http" "time" ) var 阅读全文
posted @ 2019-07-22 12:22 幸运使者 阅读(9902) 评论(1) 推荐(0) 编辑
摘要: golang接口:实现多态 1.接口的定义(使用者) package main import ( "fmt" "learngo/myinterface/mooc" "learngo/myinterface/real" ) //實現者 type Retriever interface { Get(ur 阅读全文
posted @ 2019-04-26 18:14 幸运使者 阅读(316) 评论(0) 推荐(0) 编辑
摘要: erlang 时间函数操作1.本地时间 local_time() -> calendar:local_time(). 2.UTC世界时间 world_time() -> calendar:universal_time(). 3.日期转换成秒数 calendar:datetime_to_gregori 阅读全文
posted @ 2019-04-03 17:20 幸运使者 阅读(838) 评论(0) 推荐(0) 编辑
摘要: golang 函数 可变参数列表 阅读全文
posted @ 2019-03-28 20:08 幸运使者 阅读(480) 评论(0) 推荐(0) 编辑
摘要: golang的for循环和while差不多,for循环省略初始条件就是while 死循环: 阅读全文
posted @ 2019-03-22 13:35 幸运使者 阅读(1796) 评论(0) 推荐(0) 编辑
摘要: 1.if的条件里是可以赋值 2.if条件里赋值的变量作用域就在这个if语句里 switch语句: 不需要break,也可以直接switch多个条件 阅读全文
posted @ 2019-03-22 09:57 幸运使者 阅读(301) 评论(0) 推荐(0) 编辑
摘要: 1. bool,string 2.(u)int, (u)int8, (u)int16, (uint)32, (u)int64, uintptr (1)uintptr 是指针类型 3. byte(8位), rune(go语言的字符型,32位) 一个字节的char 都是整数类型的别名 4. float3 阅读全文
posted @ 2019-03-21 21:10 幸运使者 阅读(232) 评论(0) 推荐(0) 编辑