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
(use gauche.process) | |
(use file.util) | |
(define *conf* `((gauche-repo . "https://github.com/shirok/Gauche.git") | |
(tmp-dir . "./tmp") | |
(gauche-dir . "/Gauche"))) | |
(define (main args) | |
(let* ((repo (assq-ref *conf* 'gauche-repo)) | |
(tmp (assq-ref *conf* 'tmp-dir)) | |
(proj-dir (string-append tmp |
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
public class Problem19 { | |
public static void main(String[] args) { | |
int count = 0; | |
for(int y=1901; y<=2000; y++){ | |
for(int m=1; m<=12; m++){ | |
if(dayOfWeek(y, m, 1) == 0){ | |
count++; | |
} | |
} | |
} |
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
(let ((f (lambda (x) (fold * 1 (iota x 1))))) | |
(/ (f 40) (* (f 20) (f 20)))) |
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/local/bin/gosh | |
(use sxml.ssax) | |
(use sxml.sxpath) | |
(use rfc.http) | |
(use rfc.uri) | |
(use gauche.parseopt) | |
(use gauche.charconv) | |
(define api-key "SET YOUR API-KEY INTO THIS!") |
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 | |
(define (main args) | |
(let ((li (string->list (cadr args)))) | |
(fold (lambda (a b) | |
(cond ((eq? #\+ a) (+ b 1)) | |
((eq? #\- a) (- b 1)) | |
(else (display (integer->char b)) | |
b))) | |
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
(define Y | |
(lambda (f) | |
((lambda (x) (x x)) | |
(lambda (x) | |
(f (lambda (y) ((x x) y))))))) | |
((Y (lambda (fact) | |
(lambda (x) | |
(cond | |
((zero? x) 1) |
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 Y | |
(lambda (f) | |
((lambda (x) (x x)) | |
(lambda (x) | |
(f (lambda (y) ((x x) y))))))) | |
(define add | |
(Y (lambda (add) | |
(lambda (tup) | |
(cond |
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 Y | |
(lambda (le) | |
((lambda (f) (f f)) | |
(lambda (f) | |
(le (lambda (x) ((f f) x))))))) | |
((Y (lambda (length) | |
(lambda (l) | |
(cond | |
((null? l) 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
public class Logger { | |
public static void log(HashMap<String, Object> map) { | |
for (Map.Entry<String, Object> e : map.entrySet()) { | |
System.out.println(e.getKey() + ":" + e.getValue()); | |
} | |
} | |
} |
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 atom? | |
(lambda (x) | |
(and (not (pair? x))(not (null? x))))) | |
(define (lat? ls) | |
(cond | |
((null? ls) #t) | |
((atom? (car ls)) (lat? (cdr ls))) | |
(else #f))) |