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
module type CELL = sig | |
type 'a cell | |
type 'a exp | |
val return : 'a -> 'a exp | |
val (>>=) : 'a exp -> ('a -> 'b exp) -> 'b exp | |
val cell : 'a exp -> 'a cell exp | |
val get : 'a cell -> 'a exp |
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 parser-tools/lex | |
(prefix-in re- parser-tools/lex-sre) | |
parser-tools/yacc) | |
(provide (all-defined-out)) | |
(define-tokens a (NUM VAR)) | |
(define-empty-tokens b (+ - EOF LET IN)) | |
(define-lex-trans number | |
(syntax-rules () |
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 send-exp racket | |
(require racket/draw) | |
(define-syntax-rule (build-path (p) body ...) | |
(let ((p (new dc-path%))) | |
body ... | |
p)) | |
(define (quarter-circle p cx cy quarter radius) |
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 | |
(provide ) | |
(require ffi/unsafe) | |
(require ffi/unsafe/define) | |
(require ffi/unsafe/cvector) | |
(require ffi/vector) | |
(define highgui-lib (ffi-lib "libopencv_highgui" '("2.4" #f))) |
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
;; the gaussian filter used in the racket blur. | |
;; boosted center value by 1/1000 to make sure that whites stay white. | |
(define filter '[[0.011 0.084 0.011] | |
[0.084 0.620 0.084] | |
[0.011 0.084 0.011]]) | |
;; racket-blur: blur the image using the gaussian filter | |
;; number number list-of-bytes -> vector-of-bytes | |
(define (racket-blur width height data) | |
(define data-vec (list->vector data)) |
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/class json net/url racket/port net/base64 racket/match | |
racket/format racket/trait net/head framework/preferences) | |
(provide client%) | |
(define-local-member-name login) | |
(define-local-member-name password) | |
(preferences:set-default 'github:oauth-token #f (λ _ #t)) |
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 tweet!) | |
(require (only-in racket/random crypto-random-bytes) | |
json | |
net/url | |
(only-in net/uri-codec [uri-unreserved-encode %]) | |
web-server/stuffers/hmac-sha1 | |
(only-in net/base64 base64-encode)) | |
;; For description, see: |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta http-equiv="Content-type" content="text/html; charset=utf-8"> | |
<title>Testing Pie Chart</title> | |
<!--<script type="text/javascript" src="d3/d3.v2.js"></script>--> | |
<script src="http://d3js.org/d3.v2.js"></script> | |
<!-- Note: I made good use of the sample code provided by the D3JS community and extended it to fit my needs to create this simple dashboard --> | |
<style type="text/css"> |
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 s-exp syntax/module-reader | |
(submod "daylang.rkt" semantics) | |
#:read my-read | |
#:read-syntax my-read-syntax | |
(define (my-read in) (syntax->datum (my-read-syntax #f in))) | |
(define (my-read-syntax src in) | |
(define line (read-line in)) | |
(if (eof-object? line) |
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 | |
; https://gist.github.com/joskoot/797a9e7d2276cf59d747 | |
; TODO: Put the documentation in a scrbl file. | |
#|==================================================================================================== | |
EMBEDDING INFIX NOTATION IN RACKET | |
------------------------------------------------------------------------------------------------------ | |
syntax (infix infix-expr) => prefix-expr -> value of the prefix-expr = value of the infix-expr. | |
syntax ($ infix-expr) => prefix-expr -> value of the prefix-expr = value of the infix-expr. |