Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
github.com/rp-3/gheap
heap := gheap.NewHeap(-1) // unbounded size
// add anything you want to the heap
type itemToHeapify struct {
// any properties you want
}
// so long as it conforms to the orderable interface, which looks like this:
type Orderable interface {
// Order dictates the internal ordering of the items in the heap. Heap is
// min-ordered, so lowest-order items have the highest priority
Order() int
}
// make your itemToHeapify conform to the interface by adding a method named
// `Order`, like this:
func (i itemToHeapify) Order int {
// Returns the relative order of this item as an int
}
// 1. make sure you're conforming to the protocol
type itemToHeapify struct {
key int
val []byte // use whatever you want
}
func (i itemToHeapify) Order int {
return i.key
}
// 2. create a heap
heap := gheap.NewHeap(-1) // unbounded size
// 3. Push and Pop at will
a, ok := heap.Push(itemToHeapify{ key: 1, val: []byte{} })
b, ok := heap.Pop()
FAQs
Unknown package
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.