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/env gosh | |
(use srfi-1) | |
(use srfi-13) | |
(define (even-odd-map f-even f-odd lis) | |
(if (null? lis) | |
'() | |
(cons (f-odd (car lis)) | |
(cons (f-even (cadr lis)) |
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
#!/bin/bash | |
## Settings | |
# locations (use to be used Location name here) | |
ATHOME="home" | |
ATWORK="titech" | |
# detect HOME | |
ATHOME_SSID="home_router_ssid" | |
ATWORK_SSID="titech-pubnet" |
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
(define (gcd n m) | |
(cond ((= n 0) m) | |
((= m 0) n) | |
((> n m) (print (remainder n m)) (gcd (remainder n m) m)) | |
((< n m) (print (remainder m n)) (gcd (remainder m n) n)))) | |
; {{{ | |
(define (poly-remove0 l) | |
(if (null? (cdr l)) l |
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
find /opt/local/share/texmf-* $HOME/.texmf-var -name ls-R -depth 1 -exec cat {} \; | grep .sty | sort |
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
#!/opt/local/bin/gosh | |
; 切符の足して10になるアレを解く | |
(use srfi-1) | |
(define Op '(Add Sub Mul Div)) | |
(define (make-expr l r) | |
(map (lambda (x) (list x l r)) Op)) | |
(define (evaluate expr) | |
(cond ((number? expr) expr) |
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/env gosh | |
(use srfi-1) | |
(use srfi-13) | |
;; {{{ utility functions | |
(define (unique-list eq l) | |
(if (null? l) l (lset-adjoin eq (unique-list eq (cdr l)) (car l) ))) | |
(define (make-pair l) | |
(if (= (length l) 2) (list l) |
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
#include <stdlib.h> | |
#include <stdio.h> | |
struct list { | |
int val; | |
struct list *next; | |
}; | |
struct list *newlist() | |
{ |
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
fun {Flatten Xs} | |
case Xs | |
of nil then nil | |
[] X|Xr andthen {IsList X} then | |
{Append {Flatten X} {Flatten Xr}} | |
[] X|Xr then | |
X|{Flatten Xr} | |
end | |
end |
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/env ruby | |
require 'rake' | |
module FileWatchHandler | |
def execute | |
EM.stop_event_loop | |
end | |
alias :file_modified :execute | |
alias :file_moved :execute |
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
(define-syntax b | |
(syntax-rules () | |
((b) 1))) | |
(define-syntax a | |
(syntax-rules () | |
((a) (b)))) | |
(define-syntax b | |
(syntax-rules () |
OlderNewer