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/match) | |
(define-logger ytdl) | |
(struct ytdl (thread req-ch rsp-ch)) | |
(define (make-ytdl vid dir) | |
(define args (list "--no-color" "-f" "bestaudio" "-w" "-o" (format "~a/vid.%(ext)s" dir) vid)) |
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 syncvar/mvar) | |
(provide make-barrier | |
barrier-wait-evt | |
barrier-wait | |
log-barrier-info) | |
(define-logger barrier) |
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 | |
(require racket/draw) | |
(define (mandelbrot1 z c) | |
(+ (* z z) c)) | |
(define (escaped? z) | |
(<= 2 (magnitude z))) |
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/place) | |
(define-logger guess) | |
(define num-workers (processor-count)) | |
(define secret-number (random 10)) | |
(define-values (manager-work-ch worker-work-ch) (place-channel)) |
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 racket | |
#lang racket | |
(require lens | |
net/http-easy | |
qi | |
racket/date | |
syntax/parse/define) | |
(current-print |
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/contract | |
racket/undefined) | |
(provide ivar? | |
exn:fail:ivar? | |
make-ivar | |
(contract-out | |
[ivar-put! (-> ivar? any/c any)] |
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/async-channel | |
racket/function) | |
(struct waiter (thd req-ch notify-ch)) | |
(define (make-waiter) | |
(define req-ch (make-channel)) | |
(define notify-ch (make-channel)) |
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 (for-syntax racket/base | |
racket/format | |
syntax/parse/lib/function-header) | |
(rename-in racket/base [raise base:raise]) | |
racket/stxparam | |
syntax/parse/define) | |
(begin-for-syntax |
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 (apples a-string) | |
(define string-size (string-length a-string)) | |
(define (once current count i) | |
(cond | |
[(= i string-size) | |
(if current | |
(list (cons current count)) | |
null)] |
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/match) | |
(struct holder (thd req-ch)) | |
(define (make-holder initial-value) | |
(define req-ch (make-channel)) | |
(define thd | |
(thread |