net/http包源码解读
使用net/http包编写一个最简单的Web服务器: package main import ( "fmt" "log" "net/http" ) func main() { http.HandleFunc("/", index) log.Fatal(http.ListenAndServe("localhost:8000", nil)) } func index(w htt...
使用net/http包编写一个最简单的Web服务器: package main import ( "fmt" "log" "net/http" ) func main() { http.HandleFunc("/", index) log.Fatal(http.ListenAndServe("localhost:8000", nil)) } func index(w htt...
gomock是Go官方提供的模拟(mock)框架,提供了打桩和验证调用的功能 mockgen工具用于针对接口生成mock对象代码(不能mock单独的函数或方法) GitHub仓库:https://github.com/golang/mock 安装 go get github.com/golang/mock/gomock go get github.com/golang/mock/moc...
Combining Label Propagation and Simple Models out-Performs Graph Neural Networks 2021 ICLR 论文链接:https://arxiv.org/pdf/2010.13993 官方代码:https://github.com/CUAI/CorrectAndSmooth DGL实现:https://gith...
time.Time类型的Format()方法将时间格式化为字符串,但该方法的参数必须用一个固定的参考时间"2006-01-02 15:04:05" 用其他时间会得到奇怪的结果 package main import ( "fmt" "time" ) func main() { t := time.Date(2021, 5, 25, 18, 12, 34, 0, time.Loc...
Heterogeneous Graph Representation Learning with Relation Awareness 2021 论文链接:https://arxiv.org/pdf/2105.11122 官方代码:https://github.com/yule-BUAA/R-HGNN/ 个人实现:https://github.com/ZZy979/pytorch-t...
dgl.subgraph和dgl.sampling模块定义了一些用于提取子图操作 官方文档: https://docs.dgl.ai/en/latest/api/python/dgl.html#subgraph-extraction-ops https://docs.dgl.ai/en/latest/api/python/dgl.sampling.html 示例图: >...
一面 2021年3月23日 1小时 自我介绍 线程有哪些状态 什么是死锁,如何恢复和避免 算法题 1.长度为n+1的数组,元素为1~n,有一个数字出现了两次,找出出现两次的数字 要求:时间复杂度O(n),空间复杂度O(1) 方法1:sum(a) - sum(range(1, n + 1)) 问题:可能溢出 方法2:xor(a) ^ xor(range(1, n + 1)) 其中xor表示...
一面 2021年3月30日 50分钟 大数据部,BI领域 (面试官人超好!) 简历项目 Java 1.HashMap的实现原理 2.线程安全的类:ConcurrentHashMap 3.volatile关键字 4.乐观锁、悲观锁 5.Java String的长度限制(不知道,字符串常量最大长度为65534) 数据库 1.ACID 2.隔离级别 编程 1.扑克牌顺子(力扣 剑指Offe...
2021年3月29日 1小时 自我介绍 简历项目 1.反爬机制(IP代理池,Selenium,其他不知道) 2.Scrapy如何去重,布隆过滤器(不知道) 3.Scrapy如何发请求,为什么比其他框架快(不知道) 4.Scrapy中间队列(不知道) 5.逆向工程,charles抓包工具(不知道) Java 1.集合框架有哪些 Collection List - ArrayList, L...
Python的除法分为普通除法(/)和整数除法(//),普通除法返回浮点数,整数除法只保留整数部分(向下取整) 取整函数:int()是向零取整,math.floor()是向下取整 余数的符号与除数相同 以下等式恒成立: x // y == floor(x / y) x == (x // y) * y + x % y x / y ...