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
;;; ゼルダの伝説 (SFC) で、鍵と扉がそれぞれ n 個のとき、 | |
;;; ダンジョンのとりうる状態数を返す zelda 関数 (仮) | |
(use srfi-1) | |
(define (zelda n) | |
(define (combination n m) | |
(/ (apply * (iota m (+ (- n m) 1) 1)) | |
(apply * (iota m 1 1)))) | |
(define (sum list) (apply + 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
;; 第1回 Scheme コードバトン | |
;; | |
;; ■ これは何か? | |
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。 | |
;; 次回 Shibuya.lisp で成果を発表します。 | |
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。 | |
;; | |
;; ■ 2 つのルール | |
;; | |
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。 |
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
;; なんかうまくいかない版 | |
(defn myflatten [lst] | |
(lazy-seq | |
(if (empty? lst) lst | |
(let [[x & xs] lst] | |
(if (seq? x) | |
(myconcat (myflatten x) (myflatten xs)) | |
(cons x (myflatten xs))))))) | |
;; うまくいく版 |
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
;; 最後のデータが保存されちゃう問題についての再現コード | |
;; | |
;; ★やりたいこと | |
;; | |
;; サーバから次のようなデータ(¥n区切りの文字列)が送られてくる | |
;; aaa | |
;; bbb | |
;; ccc | |
;; end | |
;; ddd |
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
--- lein 2010-05-09 22:48:51.000000000 +0900 | |
+++ bin/lein 2010-05-09 23:01:27.000000000 +0900 | |
@@ -2,7 +2,8 @@ | |
VERSION="1.1.0" | |
-CLASSPATH="$(find lib/ -follow -mindepth 1 -maxdepth 1 -print0 2> /dev/null | tr \\0 \:)" | |
+CLASSPATH_LOCAL="$(find lib/ -follow -mindepth 1 -maxdepth 1 -print0 2> /dev/null | tr \\0 \:)" | |
+CLASSPATH=$CLASSPATH_LOCAL | |
LEIN_JAR="$HOME/.m2/repository/leiningen/leiningen/$VERSION/leiningen-$VERSION-standalone.jar" |
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
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el | |
index 157b2dd..f3807b7 100644 | |
--- a/lisp/term/ns-win.el | |
+++ b/lisp/term/ns-win.el | |
@@ -1263,6 +1263,11 @@ the operating system.") | |
(add-to-list 'window-system-initialization-alist '(ns . ns-initialize-window-system)) | |
+(declare-function ns-toggle-fullscreen-internal "nsfns.m" ()) | |
+(defun ns-toggle-fullscreen () |
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
#include <stdio.h> | |
int main(int ac, char** av) | |
{ | |
printf("Hello, gist!\n"); | |
return 0; | |
} |
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
puts "Hello, gist!" |
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
(display "Hello, gist!") | |
(newline) |
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
(let ((buffer (url-retrieve-synchronously | |
"http://tromey.com/elpa/package-install.el"))) | |
(save-excursion | |
(set-buffer buffer) | |
(goto-char (point-min)) | |
(re-search-forward "^$" nil 'move) | |
(eval-region (point) (point-max)) | |
(kill-buffer (current-buffer)))) |
OlderNewer