LeetCode-3Sum

Given an integer array nums, return all the triplets numsi, numsj, numsk such that i != j, i != k, and j != k, and numsi + numsj + numsk == 0

2021-05-10 · 1 分钟

LeetCode-Two Sum

Given an array of integers nums and an integer target, return _indices of the two numbers such that they add up to target

2021-05-10 · 1 分钟

Vagrant 创建Centos8 环境

使用Vagrant重新搭建一个测试环境,只需要简单几步就可以启动一个测试环境。

2021-05-07 · 1 分钟

Effective Go-5

Do not communication by sharing memory; instead,share memory by communicating

2021-04-27 · 7 分钟

Effective Go-4

Sequence这个例子,调用sort package中的方法,对于集合要实现sort的接口:Len(), Less(i,j int) bool 和 Swap(i,j int)。Sequence同时通过String()对集合内容进行格式化。 String()接口通过 “for i, elem := range”方式实现…

2021-04-19 · 4 分钟

Effective Go-3

分配 通过new和make分配空间: - new分配空间,返回指针 - make可以进行生成slices,maps,channels,返回类型 go中更推荐使用切片而不是数组。 - 数组长度固定 - 切片可以动态调整容量(cap) 下面是二位数组和二位切片的示例。 key,value形式的数据结构,key可以是整数,浮…

2021-04-15 · 3 分钟

Effective Go-2

若在一行最后一个标识符为以下类型 - 数字 - 字符串常量 - 特殊标识符号;break continue fallthrough return ++ -- ) } 词法分析器会在标识符后添加分号, 与C不同GO很多地方都省略分号。 另在在if for switch select控制结构后要接 “{”, 例如: 而不要…

2021-04-07 · 2 分钟

LeetCode-Palindrome Pairs Solution

Given a list of unique words, return all the pairs of the _distinct_ indices (i, j) in the given list, so that the concatenation of the two words words[i] +…

2021-04-01 · 2 分钟

查询和清除文件系统缓存

为了减少磁盘I/O,加快读写速度,Linux内核使用文件系统的Cache,Page Cache。

2021-03-30 · 2 分钟

视频的版权识别与管理

昨天正在听一位老师的英语的直播课, 当时她正在用影片的片段讲解英文听力课,讲到一半的时候,直播中断了。 显示“​stream suspended for policy violations” 后来查了下资料才知道, 平台通过Connent ID系统的运作方式来识别和管理上传的视频和音频版权。 千亿美金的YouTube:…

2021-03-24 · 6 分钟