Skip to content

Instantly share code, notes, and snippets.

(lldb) bt all
thread #1, queue = 'com.apple.main-thread'
frame #0: 0x00000001001fbdb5 blep`core::sync::atomic::atomic_load::h6aee38d0824dc7a5(dst=0x0000000100a05d80, order=Relaxed) at atomic.rs:2276:51
frame #1: 0x00000001000095ed blep`core::sync::atomic::AtomicUsize::load::hb7a33ef6938f2383(self=0x0000000100a05d80, order=Relaxed) at atomic.rs:1364:29
frame #2: 0x000000010000cd3a blep`blep::main::h521b6e1d650d0853 at main.rs:55:10
frame #3: 0x0000000100018bc2 blep`std::rt::lang_start::_$u7b$$u7b$closure$u7d$$u7d$::hbeabee956eb51f15 at rt.rs:67:33
frame #4: 0x0000000100216118 blep`std::panicking::try::do_call::hf2b35caddf59127c [inlined] std::rt::lang_start_internal::_$u7b$$u7b$closure$u7d$$u7d$::hd38dd0e12f275c20 at rt.rs:52:12 [opt]
frame #5: 0x000000010021610c blep`std::panicking::try::do_call::hf2b35caddf59127c at panicking.rs:305 [opt]
frame #6: 0x000000010021925b blep`__rust_maybe_catch_panic at lib.rs:86:7 [opt]
(lldb) run
Process 15007 launched: '/Users/benl/src/blep/target/debug/blep' (x86_64)
starting thread ThreadId(2)
starting thread ThreadId(4)
starting thread ThreadId(3)
starting thread ThreadId(5)
200 202ms
200 205ms
200 201ms
200 207ms
use rand::{thread_rng, Rng};
use std::convert::TryFrom;
fn main() {
loop {
print!("{}", char::try_from(0x2571 + (thread_rng().gen_bool(0.5) as u32)).unwrap());
}
}

Keybase proof

I hereby claim:

  • I am blinsay on github.
  • I am blinsay (https://keybase.io/blinsay) on keybase.
  • I have a public key ASCPBfc6tPzCAevPF7s5Egc_kP4ftzzbIfrrmiaVnZRMNAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am blinsay on github.
  • I am blinsay (https://keybase.io/blinsay) on keybase.
  • I have a public key whose fingerprint is 6066 FDC0 57CC 4EE8 1E17 65B3 5996 68DD 8B3D 4830

To claim this, I am signing this object:

@blinsay
blinsay / README.md
Last active June 14, 2020 13:30
Randomized Contour Lines

Randomly placed actors explore a 2d function by walking along contour lines. Perlin noise courtesy of d2fn.

@blinsay
blinsay / README.md
Last active August 29, 2015 14:04
Contour Lines

Pixel-by-pixel contour lines over perlin noise.

@blinsay
blinsay / README.md
Last active August 29, 2015 14:04 — forked from d2fn/README.md
Gradient Descent

Gradient descent on 2d Perlin noise. Inspired by and forked from d2fn

#!/usr/bin/env python
# -*- coding: utf-8 -*-
knuckles = u"""
|⌒|⌒|⌒|⌒|╲ /|⌒|⌒|⌒|⌒|
|%s|%s|%s|%s|ノ \|%s|%s|%s|%s)
\⠀⠀⠀⠀⠀⠀⠀/⠀⠀ \⠀⠀⠀⠀⠀⠀⠀/
⠀\⠀⠀⠀⠀╱⠀⠀⠀⠀ ╲⠀⠀⠀⠀/
⠀ |⠀⠀⠀|⠀⠀⠀⠀⠀⠀⠀ |⠀⠀|
"""
@blinsay
blinsay / euler5.clj
Last active December 22, 2015 19:39
(defmacro divides?
"Return true if y divides x. Expands to (= 0 (mod x y))"
[x y]
`(zero? (mod ~x ~y)))
(defn prime?
"Check to see if a number is prime. Naive"
[n]
(let [r (inc (Math/floor (Math/sqrt n)))]
(nil? (some #(divides? n %) (range 2 r)))))