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 | |
(require plot) | |
(define (ct p) | |
(match-define (vector x y) p) | |
(/ y x)) | |
(define (f g) | |
(λ (p) | |
(zero? (modulo (inexact->exact (g (ct p))) 2)))) |
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 | |
;; http://www2.bakersfieldcollege.edu/resperic/ca/cellular_automata_dynamics.pdf | |
(require graph racket/system 2htdp/image) | |
(struct memf [f h domain]) | |
(define (new-memf f [dom #f]) | |
(memf f (make-hash) dom)) |
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 | |
(require gf/pgf gf/expr) | |
(define app | |
(get-concrete "exp/App.pgf" "AppEng")) | |
(define ps | |
(map unpack | |
(parse/sort app "A , B and C are equal" 'Cl))) | |
(define (distribute p exp) |
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 | |
(struct die [name faces]) | |
(define R (die "red" '(4 4 9 4 4 4))) | |
(define B (die "blue" '(7 7 7 2 2 2))) | |
(define O (die "olive" '(5 5 0 5 5 5))) | |
(define Y (die "yellow" '(8 8 3 3 3 3))) | |
(define M (die "magenta" '(1 1 6 6 6 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
import sys, locale | |
locale.setlocale(locale.LC_ALL, 'es_ES.UTF-8') | |
if __name__ == '__main__': | |
inPath, outPath = sys.argv[1:3] | |
with open(outPath, 'w') as outf: | |
with open(sys.argv[1]) as inf: | |
for row in inf.readlines(): | |
studentId,sgrade,extra = row.split(' ') | |
assert extra == '\n' |
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
FROM saludes/docker-gf | |
WORKDIR /GF | |
RUN darcs pull -a | |
RUN cabal install | |
CMD gf |
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 | |
(require rackunit racket/generator) | |
(define (poly->pairs p) | |
(let ([cs (poly-coefs p)]) | |
(foldl | |
(λ (k c xs) | |
(if (zero? c) | |
xs | |
(cons (cons c k) xs))) |
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
(ns my-gf-java.core) | |
(def WS_DOC_ROOT | |
(let [pwd (System/getenv "PWD")] | |
(str pwd "/resources/"))) | |
(def WS_PORT 41297) | |
(def WS_URL_LOCALHOST (str "http://localhost:" WS_PORT)) | |
(let [server (str " -server=" WS_PORT) |