Skip to content

Instantly share code, notes, and snippets.

View jcorbin's full-sized avatar

Joshua T Corbin jcorbin

View GitHub Profile
import color
import texture
import imgui
import std
import vec
fatal(gl_window("Fail To Scale", 512, 512))
im_init(true)
check(im_add_font("data/fonts/Inconsolata/Inconsolata-Bold.ttf", 32), "cannot load imgui font")
package unzip
import (
"archive/zip"
"context"
"fmt"
"io"
"os"
"path/filepath"
"runtime"
Title: "Madam Crowl'S Ghost Mystery Of Lonely Trails"
Supporting Docs:
- "The Rest Hollow Mystery"
- "The Yazoo Mystery"
- "Madam Crowl's Ghost and The Dead Sexton"
- "The Mystery of a Hansom Cab"
- "The Professor's Mystery"
- "Tales of Terror and Mystery"
- "The La Chance Mine Mystery"
2017/11/06 08:59:13 Kaksi
['\x00' '\x00'] => "c"
['\x00' 'c'] => "r"
['c' 'r'] => "e"
['r' 'e'] => "i"
['e' 'i'] => "l"
['i' 'l'] => "u"
['l' 'u'] => "e"
['u' 'e'] => "s"
['e' 's'] => "a"
panic: net: inconsistent fdMutex
goroutine 1145194 [running]:
panic(0x126cc0, 0xc94cf02860)
/usr/local/Cellar/go/1.6/libexec/src/runtime/panic.go:464 +0x3e6
net.(*fdMutex).RWLock(0xc8200620e0, 0x0, 0xc94d37f61e)
/usr/local/Cellar/go/1.6/libexec/src/net/fd_mutex.go:136 +0x20c
net.(*netFD).writeLock(0xc8200620e0, 0x0, 0x0)
/usr/local/Cellar/go/1.6/libexec/src/net/fd_unix.go:194 +0x39
net.(*netFD).Write(0xc8200620e0, 0xc94cf02848, 0x7, 0x8, 0x0, 0x0, 0x0)
$ go test -c ./internal/marshaled
$ { sleep 5; pkill -QUIT marshaled.test }& # because timeout -s QUIT 5s ... doesn't correctly trigger a goroutine dump
$ ./marshaled.test -debug -numWatchers 1 -test.v -test.bench .
=== RUN TestDataSource_Watch_activation
--- PASS: TestDataSource_Watch_activation (0.00s)
PASS
BenchmarkDataSource_Watch_json-8 watcher[0] wants 1
put 0
wait for items
got "{\"i\":0,\"word\":\"the\"}"
@jcorbin
jcorbin / scalar_zip.diff
Created March 14, 2016 18:29
Dask Scalar Zip
diff --git a/dask/bag/core.py b/dask/bag/core.py
index dc8a04d..47535c1 100644
--- a/dask/bag/core.py
+++ b/dask/bag/core.py
@@ -6,6 +6,7 @@ import math
import bz2
import os
import uuid
+from collections import Iterable
from fnmatch import fnmatchcase
// Inspired by http://blog.plover.com/prog/monad-search-2.html
// S E N D
// + M O R E
// -----------
// M O N E Y
function toNumber(digits) {
var r = 0;
for (var i = 0; i < digits.length; i++) {
Markov.prototype.merge = withReady(function merge(other, callback) {
var self = this;
if (!other.ready) {
return other.init(function(err) {
if (err) return callback(err);
self.merge(other, callback);
});
}
if (this.stateSize !== other.stateSize) {
return callback(new Error('cannot merge markovs with differing state size'));
var isFunction = require('lodash.isFunction');
function oneAtATime(func) {
var running = false;
var queue = [];
function done() {
for (var i=0, n=queue.length; i<n; i++)
queue[i].apply(this, arguments);
running = true;