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 | |
; A non-random Racket implementation of the algorithm given in: | |
; Small-Dimension Linear Programming and Convex Hulls Made Easy by R. Seidel | |
; There are a number of other documents floating around describing it, | |
; including another Seidel paper. I think all of them have at least typos, | |
; if not conceptual errors. The pseudo code at the end of the above paper | |
; is, I think, the least buggy. All the λ stuff is a bit odd; they seem | |
; to be mixing some numerical tolerance stuff with the variable bounds? |
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 scheme/gui | |
; $1 gesture recognizer | |
; Based on | |
; WOBBROCK J. O., WILSON A. D., LI Y.: Gestures without libraries, toolkits or training: a $1 recognizer for user interface prototypes. In UIST ’07: Proceedings of the 20th annual ACM symposium on User interface software and technology (New York, NY, USA, 2007), ACM, pp. 159–168. | |
; There's another paper that improves on recognition time: | |
; Reaver, Stahovich, Herold: How to make a Quick$: Using Hierarchical Clustering to Improve the Efficiency of the Dollar Recognizer. Eurographics Symposium on Sketch-Based Interfaces and Modeling (2011), pp. 103-108. | |
; Currently when it's run, it pops open a little window that will do the recognition. The mixin could certainly use more features. |
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 | |
; Racket implementation of "Pegasos: Primal Estimated sub-GrAdient SOlver for SVM" | |
; http://www.cs.huji.ac.il/~shais/papers/ShalevSiSrCo10.pdf | |
; This is placed in the public domain, all rights are relinquished. Have at it. | |
; - Jay Kominek, 2011-10-10 | |
(require racket/flonum) | |
(require (planet neil/levenshtein:1:3/levenshtein)) |
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 web-server | |
; Three things happened in somewhat rapid succession: | |
; 1. I was playing with stateless servlets | |
; 2. I came across a copy of Essentials of Metaheuristics on my drive | |
; 3. I remembered seeing some web pages which generated abstract art | |
; for the user by having them choose which of a population they found | |
; most asthetically pleasing. | |
; | |
; At that point, this seemed like a great idea. |
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
;; Extremely simply OpenGL demo. | |
;; Draw a "planet" (OK, a textured sphere). | |
#lang racket/gui | |
(require ffi/unsafe) | |
(require (planet "rgl.rkt" ("stephanh" "RacketGL.plt" 1 4))) | |
(require ffi/vector) | |
(require "viewer.rkt") |
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 ffi/unsafe) | |
(require ffi/unsafe/cvector) | |
(require ffi/vector) | |
(require (planet jaymccarthy/opencl:3:=4/c)) | |
(define count 1024000) | |
(define kernel_source | |
#" |
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 nasm racket/base | |
(require racket/system | |
racket/file | |
racket/dict | |
ffi/unsafe | |
ffi/unsafe/alloc) | |
(define posix_memalign | |
; ((allocator free) ; can't auto free these pointers until we ensure that everything using |
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/python | |
# inspired by | |
# http://www.reddit.com/r/mathpics/comments/ookpa/i_decided_to_play_with_the_chaos_game_after_that/ | |
# also, not actually a cube | |
from OpenGL.GL import * | |
from OpenGL.arrays import vbo | |
from OpenGL.GL.shaders import * |
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 openssl) | |
(define (make-sctx pem) | |
(define sctx (ssl-make-server-context 'tls)) | |
(ssl-load-default-verify-sources! sctx) | |
(ssl-set-ciphers! sctx "DEFAULT:!aNULL:!eNULL:!LOW:!EXPORT:!SSLv2") | |
(ssl-load-certificate-chain! sctx pem) | |
(ssl-load-private-key! sctx pem) |
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/python | |
# resistor colors | |
colors = [ 'black', '#964b00', 'red', '#ffa500', 'yellow', | |
'#9acd32', '#6495ed', '#ee82ee', 'gray', 'white' ] | |
# borders around some of the lighter colors | |
border = [ 0, 0, 0, 0, 1, 0, 0, 0, 1, 1 ] | |
out = open("labels.html","wb") |
OlderNewer