Skip to content

Instantly share code, notes, and snippets.

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 affinity matrix"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"metadata": {
"name": "Triplet Cluster-assisted triplet convergence"
},
"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 Which triplets are most useful"
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
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 / test.htm
Last active August 29, 2015 13:57
<!doctype:html>
<style>
#target {
background-color: #800;
display: inline-block;
position: absolute;
padding: 0.5em;
border-radius: 0.3em;
color: #fff;
}
#lang at-exp racket
(require racket/draw
slideshow
unstable/gui/pict
(planet gcr/pdf-render))
(define-syntax-rule (inches: n) (* n 72))
(define-syntax-rule (feet: n) (* n 12 72))
(define-syntax-rule (einches: n) (inexact->exact (round (inches: n))))
(define-syntax-rule (efeet: n) (inexact->exact (round (feet: n))))
@gcr
gcr / test.ipynb
Last active August 29, 2015 13:57
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
javascript:(function(){var probeUrl=$(".probe.picker .image").css("background-image").replace(/^url\((.*)\)$/,"$1");var num_cells=$(".grid-strip .picker").length;var num_close=$("#data").data()["templateMinSelected"];var num_far=num_cells-num_close;function unpicked_things(){return $(".grid-strip .picker").filter(function(){return!$(this).data("picked-id")})}function random_unpicked_thing(){var picks=unpicked_things();return picks.eq(Math.floor(Math.random()*picks.length))}function select_image(imgurl){var which_one_to_fill=random_unpicked_thing();which_one_to_fill.trigger(jQuery.Event("click",{shiftKey:true}));var correct_image=$(".image-grid .image-wrapper .image").filter(function(){return $(this).css("background-image")=="url("+imgurl+")"});if(correct_image.length==0){throw Error("Image not found. Try scrolling down?")}correct_image.trigger("click");return pickedField}var EMBEDDING=[{url:"https://s3.amazonaws.com/vibe-content/photos/38aab5a720aa4b8780146c541ac84bb6.jpg",loc:[-17.422579142432237,-11.9447860