This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket/base | |
| (require ffi/unsafe | |
| ffi/unsafe/define | |
| racket/stxparam | |
| racket/splicing | |
| (for-syntax racket/base | |
| syntax/parse | |
| racket/syntax | |
| racket/string)) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket/gui | |
| (require video/private/editor | |
| data/queue) | |
| (define q (make-queue)) | |
| (define vid-snip% | |
| (class editor-snip% | |
| (init-field editor) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket | |
| (module foo racket | |
| (provide A%) | |
| (define A% | |
| (class object% | |
| (super-new) | |
| (field [state 0]) | |
| (define/public (foo) | |
| "world")))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket | |
| (provide (struct-out foo) | |
| my-param) | |
| (require file/convertible) | |
| (define my-param (make-parameter "hello")) | |
| (struct foo () |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket | |
| (define-syntax (fuck me) | |
| (syntax-case me () | |
| [(_) | |
| (begin | |
| (define dr #'dict-ref) | |
| (define dr* (local-expand #'dict-ref 'expression '())) | |
| #`(list #,dr #,dr*))])) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket/base | |
| (define ill | |
| (let ((base (string-append "a"))) | |
| (λ () base))) | |
| (ill) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (define (grayscale-pict s) | |
| (define buf (pict->argb-pixels s)) | |
| (define gray-buf | |
| (apply bytes | |
| (append* | |
| (for/list ([i (in-range 0 (bytes-length buf) 4)]) | |
| (define a (bytes-ref buf i)) | |
| (define r (bytes-ref buf (+ i 1))) | |
| (define g (bytes-ref buf (+ i 2))) | |
| (define b (bytes-ref buf (+ i 3))) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| export RACKET_DIR=~/racket | |
| export RACKET_VERSION=HEAD | |
| sudo apt-get -qq update | |
| sudo apt-get install -y libmlt6 | |
| sudo apt-get install -y libav-tools | |
| sudo apt-get install -y ladspa-sdk | |
| sudo apt-get install -y libgdk-pixbuf2.0-* |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang scratch | |
| (module u racket | |
| (define (fact t-fact x acc lookup mk) | |
| (if (= x 0) | |
| (lookup acc) | |
| (t-fact fact (- x 1) (mk (* (lookup acc) x)) lookup mk))) | |
| (provide fact)) | |
| (module t typed/racket |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #lang racket/base | |
| (require racket/set | |
| racket/list) | |
| (define (P event space) | |
| (/ (for/fold ([acc 0]) | |
| ([x (in-list space)] | |
| #:when (event x)) | |
| (add1 acc)) |