Skip to content

Instantly share code, notes, and snippets.

Avatar

Thomas Moll QuantumFractal

View GitHub Profile
@QuantumFractal
QuantumFractal / pokemon.go
Created Jul 20, 2021
bruteforce dispatch
View pokemon.go
package main
import (
"fmt"
"reflect"
)
const NORMALLY_EFFECTIVE = "it's normally effective"
const SUPER_EFFECTIVE = "it's SUPER effective!"
const NOT_VERY_EFFECTIVE = "it's not very effective..."
View also_impossible.go
package main
import (
"fmt"
"reflect"
)
const NORMALLY_EFFECTIVE = 1.0
const SUPER_EFFECTIVE = 2.0
const NOT_VERY_EFFECTIVE = 0.5
View idk.jl
using Cassette
Cassette.@context VCtx
mutable struct VMeta
module_name::String
f::IOStream
end
VMeta(module_name::String) = VMeta(module_name, open(module_name * ".v", "w"))
View attraction_mat.jl
function attraction_table(n)
table = zeros(n,n)
attr_norm = Normal(1.0, 0.25)
repl_norm = Normal(-1.0, 0.5)
for index in CartesianIndices(table)
if index[1] == index[2]
table[index] = rand(attr_norm, 1)[1]
else
table[index] = rand(repl_norm, 1)[1]
View aoc_1.jl
using IterTools
aoc_1_input = """1732
1972
1822
1920
1847
1718
1827
1973
View keybase.md

Keybase proof

I hereby claim:

  • I am QuantumFractal on github.
  • I am tmoll_ (https://keybase.io/tmoll_) on keybase.
  • I have a public key whose fingerprint is EB8B F9AD 3B82 237F FDFA FEAC 9BA1 C9B0 DB10 2926

To claim this, I am signing this object:

View stupid_simple_conv_kernel.jl
function gauss(A, i, j, ui, uj)
nw, n, ne = 1.0f0/9.0f0, 1.0f0/9.0f0, 1.0f0/9.0f0
w, c, e = 1.0f0/9.0f0, 1.0f0/9.0f0, 1.0f0/9.0f0
sw, s, se = 1.0f0/9.0f0, 1.0f0/9.0f0, 1.0f0/9.0f0
top , bottom = j - 1, uj - j
left, right = i - 1, ui - i
nw *= clamp(top * left, 0, 1)
n *= clamp(top, 0, 1)
@QuantumFractal
QuantumFractal / scott.ipynb
Created Feb 20, 2020
notebook-grey-scot.ipynb
View scott.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View svg_EBNF
svg_grammar = '''
start : prolog element
prolog: "<?xml" S? attr+ "?>" WS?
element: inline_tag | start_tag element end_tag
start_tag : S? "<" name S? attr+ ">" WS+
end_tag : S? "</" name S? ">" WS+
View main.jl
using GLFW
using ModernGL
# NO COPY AND PASTE!!!
# CLEAN CODE IS GOOD CODE
# Create Window with size and title
GLFW.Init()
window = GLFW.CreateWindow(400, 300, "Title")