This file contains 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
@bramcohen writes: "What's the maximum ratio between the volume of a | |
convex shape and the volume of the smallest right angle box it can fit | |
in?" | |
Considering the 2D case. | |
Limit attention without loss of generality to convex polygons. | |
When discussing rectangles, we use the following terminology: |
This file contains 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 | |
;; Erlang-style monitors for Racket threads. | |
(provide monitor-thread! | |
demonitor-thread!) | |
(define (monitor-thread! thd [kill-monitoring-thread #f]) | |
(let ((monitoring-thread (current-thread))) | |
(define monitor-handle | |
(thread |
This file contains 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 | |
;; Standard Thread | |
(provide exit-status? | |
exit-status-exception? | |
exit-status-value | |
current-thread-exit-status | |
exit-status-evt |
This file contains 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 subscription) | |
(struct-out message-handler) | |
(struct-out kernel-mode-transition) | |
make-vm | |
vm? | |
run-vm | |
nested-vm) |
This file contains 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/pretty) | |
(require racket/class) | |
(require racket/gui/base) | |
(require racket/draw) | |
(require racket/match) | |
(require (only-in web-server/private/gzip gunzip/bytes)) | |
(require rnrs/bytevectors-6) |
This file contains 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 | |
(provide current-struct-mappers | |
install-struct-mapper! | |
struct-map | |
struct-map/accumulator) | |
;; Parameter<Hash<StructType,Mapper>> | |
(define current-struct-mappers (make-parameter (hash))) |
This file contains 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
diff --git a/tuareg.el b/tuareg.el | |
index 9a25d59..ed83063 100644 | |
--- a/tuareg.el | |
+++ b/tuareg.el | |
@@ -1046,7 +1046,7 @@ Regexp match data 0 points to the chars." | |
'("module" "class" "functor" "object" "type" "val" "inherit" | |
"include" "virtual" "constraint" "exception" "external" "open" | |
"method" "and" "initializer" "to" "downto" "do" "done" "else" | |
- "begin" "end" "let" "in" "then" "with")) | |
+ "begin" "end" "let" "lwt" "in" "then" "with")) |
This file contains 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 "vm-pictures.rkt") | |
(render | |
(vm (vm-label "Ground VM") | |
(network-label "TCP + Timers") | |
(process "TCP driver") | |
(process "Timer driver") | |
(process "Session factory") | |
(process-space) | |
(vm (vm-label "Session VM") |
This file contains 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 tasklist (list (list 'root (box 'no-continuation)))) | |
(define currtask tasklist) | |
(define call/cc call-with-current-continuation) | |
(define fork | |
(lambda (name) | |
(call/cc |
This file contains 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
{-# LANGUAGE ExistentialQuantification #-} | |
module Exqu where | |
type Callback state = (state -> (state, [String])) | |
data Process = forall state. Process state (Callback state) | |
proc1 x = (2, ["proc1"]) | |
proc2 x = ("bye", ["proc2"]) | |
drive (Process s d) = let (_, ms) = d s in ms |