Skip to content

Instantly share code, notes, and snippets.

@StandoffVenus
StandoffVenus / BitReader.go
Last active October 9, 2017 22:06
Add comment about error catching.
package main
import (
"io"
"bytes"
"fmt"
)
type PlainBitReader struct {
reader io.ByteReader
@StandoffVenus
StandoffVenus / Acceptor.go
Last active January 15, 2019 00:41
Gale-Shapley Algorithm in Golang
package Village
type Acceptor struct {
Name string
preferences map[*Proposer]int
Free bool
partner *Proposer
proposalPool []*Proposer
}
@StandoffVenus
StandoffVenus / FzzBuzz.py
Last active March 16, 2017 22:42
Given the Fizz Buzz challenge, create code to handle large integer input (= no recursion) that avoids the use of "i" and dynamic code functions (e.g. eval, exec, etc.)
# gets our global methods (such as reduce or eval - though, eval's not used here)
gb = vars(globals()['__bu' + chr(105) + 'lt' + chr(105) + 'ns__'])
nput = gb[chr(105) + 'nput']
prnt = gb['pr' + chr(105) + 'nt']
nt = gb[chr(105) + 'nt']
# _mport functools -> make to d_ct -> get reduce() from module
reduce = vars(gb['__' + chr(105) + 'mport__']('functools'))['reduce']