Skip to content

Instantly share code, notes, and snippets.

def find_elements(K, N):
t = len(K)
n = len(N)
if empty: return, the base case
# Split K into two pieces:
left_K = K[ 0:int(t/2) ] # O(1)
right_K = K[ int(t/2):t ] # O(1)
# Split N into two pieces:
@gcr
gcr / keybase.md
Last active April 11, 2018 15:01

Keybase proof

I hereby claim:

  • I am gcr on github.
  • I am mwilber (https://keybase.io/mwilber) on keybase.
  • I have a public key whose fingerprint is 055A CA10 69B6 41A3 4AE1 C216 603D FE46 AFD3 DABD

To claim this, I am signing this object:

{
"metadata": {
"name": "Triplet Which triplets are most useful"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"metadata": {
"name": "Triplet Cluster-assisted triplet convergence"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": "Triplet affinity matrix"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
(define (pin-over2 base f1 p1 f2 p2)
(define-values (x1 y1) (f1 base p1))
(define-values (x2 y2) (f2 p2 p2))
(panorama (pin-over base (- x1 x2) (- y1 y2) p2)))
type
Tx=object
foo: string
proc destruct*(x: var Tx) {.destructor.}=
echo "Destructing "&x.foo
proc main_broken() =
var y = Tx(foo:"y")
var z = Tx(foo:"z")
type GLBuffer = distinct int
proc foo(): GLBuffer =
var
a = GLBuffer(6)
b = GLBuffer(7)
c = GLBuffer(8)
return a
proc destruct(o: var GLBuffer) {.destructor.} =
echo "GOODBYE "& $int(o)