forked from rouge-ruby/rouge
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
902 additions
and
2 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#lang racket | ||
|
||
;; draw a graph of cos and deriv^3(cos) | ||
(require plot) | ||
(define ((deriv f) x) | ||
(/ (- (f x) (f (- x 0.001))) 0.001)) | ||
(define (thrice f) (lambda (x) (f (f (f x))))) | ||
(plot (list (function ((thrice deriv) sin) -5 5) | ||
(function cos -5 5 #:color 'blue))) | ||
|
||
;; Print the Greek alphabet | ||
(for ([i (in-range 25)]) | ||
(displayln | ||
(integer->char | ||
(+ i (char->integer #\u3B1))))) | ||
|
||
;; An echo server | ||
(define listener (tcp-listen 12345)) | ||
(let echo-server () | ||
(define-values (in out) (tcp-accept listener)) | ||
(thread (λ () | ||
(copy-port in out) | ||
(close-output-port out))) | ||
(echo-server)) |
Oops, something went wrong.