Skip to content

Instantly share code, notes, and snippets.

@alphazero
alphazero / gist:dd0e432683ed2410998e
Created May 18, 2015 12:54
Xorshift* 1024 (essential fragment)
var s0 = [16]uint64{
0xEA221D1E5C8DB483,
0xF89369282348A220,
0x7022326276090608,
0x1618FCC12E583E30,
0xF7E7C005F85EFC69,
0x132B746F9C2FF047,
0x338324A69CBDC6B5,
0x2B91B21FAAB58FE0,
0x85CB192105B8B12B,
@alphazero
alphazero / eclispe:user.name OS X
Created September 25, 2011 03:38
set user.name (e.g. for @author tag) in eclipse | Mac OS X
# read $EHOME as the path to where eclipse is installed
# edit eclipse.ini
cd $EHOME/eclipse/Eclipse.app/Contents/MacOS/
vim eclipse.ini
# add the following key/value to end of the ini file
# value can be anything including embedded spaces.
-Duser.name=Your Name <your@email.tld>
@alphazero
alphazero / Resume Fix
Created August 18, 2018 19:34
B2b-resume-perf-fix-diff.java
alphazeroAO ~/Code/java/Blake2b ± diff src/main/java/ove/crypto/digest/Blake2b.java ../githubbers/tim/Blake2b/src/main/java/ove/crypto/digest/Blake2b.java master
22a23
> import java.io.Serializable;
108a110,165
> /**
> * A serializable / JSON-izable object usable for pausing a hash-in-process
> * which can then be resumed with the same Parameter the original digest
> * was constructed with, and fed additional bytes to conclude the hash.
> */
> public static final class ResumeHandle implements Serializable {
@alphazero
alphazero / module-generic-init-multi.go
Last active August 31, 2017 12:24
A refinement of the half-baked idea
/* define generic package */
// file p.go
package p
typevar K generic.ComparableType // poor man catagory
typevar V generic.AnyType // ^^
import (...)
type X struct {
@alphazero
alphazero / module-generic-init.go
Last active August 31, 2017 12:15
half-baked idea sketch - module level genericity for Go
/* define generic package */
// file p.go
package p
typevar K generic.ComparableType // poor man catagory
typevar V generic.AnyType // ^^
import (...)
type X struct {
@alphazero
alphazero / bflx.spec
Last active March 16, 2017 15:06
Specfication for BFLX
language specification for level extended brainfuck
rev alpha.0
-- what
Yet another riff on the brainfuck language.
-- program structure
A bflx program is a sequence of byte codes (with ASCII semantics) of minimum length of 1.
@alphazero
alphazero / bg.go
Last active March 16, 2017 11:48
BF in go
package main
import (
"fmt"
"os"
)
func main() {
if len(os.Args) < 1 {
fmt.Fprintf(os.Stderr, "usage: bf <program>")
Verifying that "alphazero.id" is my Blockstack ID. https://onename.com/alphazero
/*
* Copyright 2010 Joubin Houshyar
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
@alphazero
alphazero / gist:3881643
Created October 12, 2012 21:32
explicit selection semantics - priority selector
package main
import (
"fmt"
"math/rand"
"time"
)
const clen = 3 // knob - needs to match parr below