I hereby claim:
- I am shawnsmithdev on github.
- I am shawnsmithdev (https://keybase.io/shawnsmithdev) on keybase.
- I have a public key ASAcfXEnovS0YyBoAZGfsXsWBX5IV2V6M6Flv6kL2ejiHwo
To claim this, I am signing this object:
| package main | |
| import "fmt" | |
| import "runtime" | |
| func main() { | |
| fmt.Printf("OS: %s\n", runtime.GOOS) | |
| fmt.Printf("Architecture: %s\n", runtime.GOARCH) | |
| fmt.Printf("Go: %s\n", runtime.Version()) | |
| } |
I hereby claim:
To claim this, I am signing this object:
| // This is the Quake III Q_rsqrt Fast Approx Inverse Square Root algorithm | |
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| const threehalfs float32 = 1.5 |
| package main | |
| import ( | |
| "encoding/binary" | |
| "fmt" | |
| ) | |
| var ( | |
| bases = []uint32{1, 85, 85 * 85, 85 * 85 * 85, 85 * 85 * 85 * 85} | |
| ) |
| package main | |
| import ( | |
| "encoding/binary" | |
| "encoding/hex" | |
| "log" | |
| "os" | |
| ) | |
| const ( |
| // https://stackoverflow.com/questions/28219231/how-to-idiomatically-copy-a-slice | |
| fn copy_slice<T: Copy>(src: &[T], dst: &mut [T]) -> usize { | |
| let mut c = 0; | |
| for (d, s) in dst.iter_mut().zip(src.iter()) { | |
| *d = *s; | |
| c += 1; | |
| } | |
| c | |
| } |
| package main | |
| import ( | |
| "crypto/sha256" | |
| "fmt" | |
| "hash" | |
| "io/ioutil" | |
| "os" | |
| ) |
| package main | |
| import ( | |
| "fmt" | |
| "net/http" | |
| "net/http/httputil" | |
| "os" | |
| ) | |
| const defaultUrl = "https://example.com" |
| package main | |
| import ( | |
| "fmt" | |
| ) | |
| // A Y Combinator (Only for func(int) int, so not *the* y combinator) | |
| func Y(f func(func(int) int) func(int) int) func(int) int { | |
| return f(func(x int) int { | |
| return Y(f)(x) |
| package main | |
| import ( | |
| "fmt" | |
| "math" | |
| ) | |
| // Simpson's Rule for numerical integration of f from a to b using n steps | |
| // Port of python code: http://stackoverflow.com/questions/16001157/simpsons-rule-in-python | |
| func simpsons(f func(float64) float64, a, b float64, n int) float64 { |