Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am jbclements on github.
  • I am jbclements (https://keybase.io/jbclements) on keybase.
  • I have a public key whose fingerprint is B3A9 99DD 8C82 67AE 9104 368E 8FAB 60E7 084E 8E5F

To claim this, I am signing this object:

device:~/tryrust/build (git)-[master]- clements> /usr/local/bin/rustc /tmp/foo.rs
dyld: lazy symbol binding failed: Symbol not found: __ZN10lang_start20haf38a73a4ecfd9abKoeE
Referenced from: /usr/local/bin/rustc
Expected in: x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libnative-4e7c5e5c.dylib
dyld: Symbol not found: __ZN10lang_start20haf38a73a4ecfd9abKoeE
Referenced from: /usr/local/bin/rustc
Expected in: x86_64-apple-darwin/stage1/lib/rustlib/x86_64-apple-darwin/lib/libnative-4e7c5e5c.dylib
zsh: trace trap /usr/local/bin/rustc /tmp/foo.rs
@jbclements
jbclements / .gitignore
Last active January 4, 2016 03:29 — forked from adamgit/.gitignore
#########################
# .gitignore file for Xcode4 / OS X Source projects
#
# Version 2.0
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects
#
# 2013 updates:
# - fixed the broken "save personal Schemes"
#
# NB: if you are storing "built" products, this WILL NOT WORK,
#lang racket/base
(require test-engine/racket-tests)
(require racket/list)
;; YIKES! you clearly wrote the function before the tests, because what you have below
;; is just nuts. Specifically, you have a table that maps strings to ... tables!
;; Let's rewrite those test cases first:
(check-expect (add-stat (add-stat (hash) '("a" "b" "c")) '("a" "b" "d"))
(hash "a" 2 "b" 2 "c" 1 "d" 1))
@jbclements
jbclements / spaceman-v6a.rkt
Created December 6, 2013 22:04
fixed performance problems with spaceman spiff
#|
_
_____ _____ _ ___ ___ | |
| __| ___ ___ ___ ___ _____ ___ ___ | __| ___ |_|| _|| _||_| ___
|__ || . || .'|| _|| -_|| || .'|| | |__ || . || || _|| _| |_ -|
|_____|| _||__,||___||___||_|_|_||__,||_|_| |_____|| _||_||_| |_| |___|
|_| |_|
_____ _ _ _____ _
| __||_| ___ ___ | | | __| _ _ _____ ___ | |_ ___ ___ _ _
| __|| || || .'|| | |__ || | || || . || || . || || | |
@jbclements
jbclements / list-of-bools.rkt
Created December 4, 2013 21:04
code rewritten to use a list rather than a structure.
(require 2htdp/universe)
(require 2htdp/image)
;; a 16-bools is a list of booleans of length 16
;world -> world
;; a world is (make-world 16-bools)
;a world is (make-world boolean boolean boolean boolean)
(define-struct world (bools))
@jbclements
jbclements / foldl-example.rkt
Created December 4, 2013 19:34
example of using 'foldl' to eliminate nested calls
;; a state is a number
;; add the two numbers to the state
(define (state-update state a b)
(+ state a b))
(define my-state 234)
;; either:
@jbclements
jbclements / foo.rkt
Last active December 29, 2015 09:29 — forked from MattS8/gist:7650837
;; TEAM BYTE ME
;; int list -> list
;; takes a list and a number and returns a list with the length of the number
(define (create_list l n)
(cond
[(= n 0) empty ]
[else (cons (first l) (create_list (rest l) (sub1 n)))
]))
@jbclements
jbclements / struct->list-example.rkt
Created November 22, 2013 18:55
turning structures into lists
(require racket/list)
;; a world is (make-world component component component component
;; component component component component
;; component component component component
;; component component component component)
(define-struct world (c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16))
;; change the c1 field of a world to the new value
;; world any -> world
@jbclements
jbclements / class-code-2013-11-20.rkt
Created November 20, 2013 19:11
code from class, 2013-11-20
(require rsound)
(require 2htdp/image)
(require 2htdp/universe)
(define (s sec) (* sec 44100))
(define samp (rs-read "/tmp/waaoow-chorus.wav"))
;; a world is (make-world nat frames)