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
// -*- mode: js2; coding: utf-8; -*- | |
/** | |
* colorspace.js | |
* Color Space Utility Functions for HTML Canvas Element | |
* | |
* Author: VoQn | |
*/ | |
/** Utility Functions */ |
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
<?xml version="1.0" encosing="UTF-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml/DTD/xhtml1-transitinal.dtd"> | |
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8;" /> | |
<meta http-equiv="Content-Language" content="en" /> | |
<meta http-equiv="Content-Style-Type" content="text/css" /> | |
<meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
<title>Hoge</title> |
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
<?xml version="1.0" encosing="UTF-8"?> | |
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" | |
"http://www.w3.org/TR/xhtml/DTD/xhtml1-transitinal.dtd"> | |
<html xmlnx="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> | |
<head> | |
<meta http-equiv="Content-Type" content="text/html; charset=utf-8;" /> | |
<meta http-equiv="Content-Language" content="en" /> | |
<meta http-equiv="Content-Style-Type" content="text/css" /> | |
<meta http-equiv="Content-Script-Type" content="text/javascript" /> | |
<title>Hoge</title> |
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
;; -*- mode:scheme; coding:utf-8 -*- | |
;; 2.3.2 Derivation | |
(define (deriv exp var) | |
(cond ((number? exp) 0) | |
((variable? exp) | |
(if (same-variable? exp var) 1 0)) | |
((sum? exp) | |
(make-sum (deriv (addend exp) var) | |
(deriv (augend exp) var))) | |
((product? 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
## お好み焼き | |
+ 小麦粉をだし汁で溶く | |
+ 刻んだキャベツを入れる | |
+ 卵を入れる | |
+ 混ぜる | |
+ フライパンで焼く | |
+ ソースかける | |
+ かつおぶしをふりかける | |
+ 青海苔をちらす | |
+ 好みで紅生姜をのせる |
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
#!/opt/local/bin/gosh | |
;;; | |
;;; Source Code | |
;;; | |
;; Sequential T transform O(log(n)) | |
(define (fib-t n) | |
(let iter [(a 1) (b 0) (p 0) (q 1) (count 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
;; Shortest? FizzBuzz | |
(use srfi-1) | |
(let1 ? (.$ zero? (pa$ mod)) | |
(for-each | |
(.$ print (^i (cond [(? i 15) 'FizzBuzz] | |
[(? i 5) 'Buzz] | |
[(? i 3) 'Fizz] | |
[else i]))) | |
(cdr (iota 101)))) |
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
for i in range(1,101):print(i%3<1)*'Fizz'+(i%5<1)*'Buzz'or i |
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
#! /usr/bin/env gosh | |
(use gl) | |
(use gl.glut) | |
;; Util Procedure | |
(define (assq-ref entry alist) | |
(cdr (assq entry alist))) | |
(define (slot-list obj getter-list) |
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
leap :: Integral a => a -> Bool | |
leap y = let m = (== 0) . (mod y) in if m 100 then m 400 else m 4 | |
{- | |
leap 3 -- False | |
leap 4 -- True | |
leap 5 -- False | |
leap 96 -- True | |
leap 100 -- False | |
leap 104 -- True |