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 racket/gui) | |
; | |
; !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! | |
; I wrote this code five years ago while learning functional programming. | |
; It is an example of what you should NOT do in a functional language (or in software writing in general). | |
; | |
; THIS IS NOT A GOOD EXAMPLE OF RACKET CODE. | |
; |
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
!function(){function n(n,t){return t>n?-1:n>t?1:n>=t?0:0/0}function t(n){return null!=n&&!isNaN(n)}function r(n){return{left:function(t,r,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=t.length);u>e;){var i=e+u>>>1;n(t[i],r)<0?e=i+1:u=i}return e},right:function(t,r,e,u){for(arguments.length<3&&(e=0),arguments.length<4&&(u=t.length);u>e;){var i=e+u>>>1;n(t[i],r)>0?u=i:e=i+1}return e}}}function e(n){return n.length}function u(n){for(var t=1;n*t%1;)t*=10;return t}function i(n,t){try{for(var r in t)Object.defineProperty(n.prototype,r,{value:t[r],enumerable:!1})}catch(e){n.prototype=t}}function o(){}function a(n){return sa+n in this}function c(n){return n=sa+n,n in this&&delete this[n]}function s(){var n=[];return this.forEach(function(t){n.push(t)}),n}function l(){var n=0;for(var t in this)t.charCodeAt(0)===la&&++n;return n}function f(){for(var n in this)if(n.charCodeAt(0)===la)return!1;return!0}function h(){}function g(n,t,r){return function(){var e=r.apply(t,arguments);return e===t?n:e}}function p(n, |
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/gui | |
(require framework) ; for keymap:get-editor | |
(define keymap (keymap:get-editor)) | |
#| ; Or define them yourself: | |
(define keymap (new keymap%)) | |
(add-text-keymap-functions keymap) |
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/gui | |
(require sgl/gl) | |
(require sgl/gl-vectors) | |
(require pict) | |
(define texture% | |
(class object% | |
(init [(initial-bitmap bitmap)]) | |
(field [width 0] |
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/gui | |
; DrRacket, version 5.2.1 | |
; 情報科学類ソフトウェアサイエンス主専攻実験 | |
; M.NAKAJIMA | |
; 2012/06/29 | |
; Create a window and show message. | |
(define frame (new frame% [label "Timer"])) | |
(define msg (new message% [parent frame] |
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 unstable/dict) | |
(provide main) | |
;; Set[String] | |
(define stopwords (list->set (file->lines "./stopwords.txt"))) | |
;; String -> List[String] | |
(define (tokenize raw-text) ;; Lowercases and splits on non-letters, non-numbers. | |
(filter-not (λ (e) (set-member? stopwords e)) |