Dgraph
解决key value lookup问题
跟n4oj 图sql类似
主要是针对复杂查询,有关联性的实体,但每个实体的字段又很少
Unlike Netflix, Spotify doesn’t have a star-based system with which users rate their music. Instead, Spotify’s data is implicit feedback — specifically, the stream counts of the tracks and additional streaming data, such as whether a user saved the track to their own playlist, or visited the artist’s page after listening to a song.
根据喜欢的音乐,来归类于相似用户。
In actuality, this matrix you see here is gigantic. Each row represents one of Spotify’s 140 million users — if you use Spotify, you yourself are a row in this matrix — and each column represents one of the 30 million songs in Spotify’s database.
The exact mechanisms behind NLP are beyond the scope of this article, but here’s what happens on a very high level: Spotify crawls the web constantly looking for blog posts and other written text about music to figure out what people are saying about specific artists and songs — which adjectives and what particular language is frequently used in reference to those artists and songs, and which other artists and songs are also being discussed alongside them.
with cnn处理audio部分
My personal favorite is that Go does not offer a reentrant lock, i.e. a lock that can be recursively acquired from the same thread or Goroutine (the Go variant of Coroutines or Green Threads). However, without hacks there is no way to build such an implementation by yourself, since threads are not available in Go and Goroutines do not offer an identifier, which would allow you to recognize the same Goroutine you’ve seen before.
1 | type task struct { |
At this point, Go is no longer able to see the distinction between the type and the variable
1 | type handle = int // after go 1.9 |
1 | func main() { |
1 | func test(v bool) error { |
When e
is returned, the *MyError
pointer becomes an instance of the interface type error
and it’s not nil!
菩萨畏因,众生畏果
缘起缘灭,终究逃不过自己做的一切。。
本周工作:
本周未完成:
下周工作:
如期所至的同居生活开始了。。。有过争吵,有过所谓的甜蜜。。。哎,感觉达不到要求,给不了,感觉已经不是那种一人吃饱,全家不愁的状态,不管是心理上,还是物质上,还是配不上人家吧,有时候,也在怀疑,当初自己是怎么做了这个选择。。。窝起来,做一个肥宅多幸福。。。但不管怎么说,现在已经这个状态,先慢慢撑起来吧。。。毕竟最坏的结果,不是已经打算了,窝起来。。。
还是生活和工作之间,怎么来平衡吧,个人还是有点强迫症,定一个计划出来,拖延症什么的。。要努力克服。。
简历已经开始着手准备了,那么找工作部分,也要提上日程了。。关于简历上内容的回顾,leetcode的刷题部分,全都要慢慢捡起来。。
尽量不要给他人困扰,也不要给他人带来麻烦,从根源上,斩断一些缘。。
fix用于单次对堆进行调整
1 | func Fix(h Interface, i int) |
关于大顶堆以及小顶堆
基本的双向链表
1 | package main |
循环表结构
Do, Ring包提供一个额外的方法Do,会依次将每个节点的Value当做参数调用这个函数
1 | package main |
求和的写法:
1 | package main |
1 | type Interface interface { |
只要实现这三个函数,即可使用sort的相关函数
Slice
Slice函数用于对一个Slice进行排序,这是实际使用中更为常用的一个函数,函数接收两个参数。第一个是需要排序的Slice;第二个是Slice元素比较函数,它类似于前面sort.Interface里的Less方法。函数声明如下:
1 | func Slice(slice interface{}, less func(i, j int) bool) |
信号量,sync.Cond是信号量的实现
Signal和Broadcast用于唤醒一个信号量,区别在于Signal只会随机的唤醒一个线程,而Broadcast会唤醒所有在等待的线程。
1 | func (c *Cond) Signal() |
wait
阻塞等待,当Signal或Broadcast被调用时唤醒,声明如下:
1 | func (c *Cond) Wait() |
sync.Once保证某个函数有且仅有一次执行,只有一个方法Do,接受一个无参函数作为参数,当你调用Do时会执行这个函数,其方法声明如下:
1 | func (o *Once) Do(f func()) |
context也是并发环境的一个常用标准库,它用于在并发环境下在协程之间安全的传递某些上下文信息。
一个经典的应用场景是服务器模型,当服务器处理接收到的请求时,通常需要并发的运行多个子任务,例如访问服务器,请求授权等。而这些任务都会以子协程的方式运行,也就是说一个请求绑定了多个协程,这些协程需要共享或传递某些请求相关的数据;此外当请求被撤销时,也需要有一种机制保证每个子协程能够安全的退出。而context包就给提供了上面说到的这些功能。
Context是一个上下文对象,其声明如下:
1 | type Context interface { |