No. | タイトル | 担当 | レベル |
---|---|---|---|
1 | Java のクラスの作り方 | @tnoda\_ | 未経験者 |
2 | Docstring 逐条講義 | @tnoda\_ | ビギナー |
3 | gen-class の内部実装の話 | @athos0220 | 上級者 |
4 | アノテーションの使い方 | @tnoda\_ | 中級者 |
5 | gen-class クイズ | @tnoda\_ | 中級者 |
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
(ns repeating-decimal) | |
(defn repeating-decimal [n] | |
(loop [rem 1 rems #{} divs [] i 0] | |
(let [div (int (/ (* rem 10) n)) | |
rem (mod (* rem 10) n)] | |
(if (and (not= rem 0) (contains? rems rem)) | |
[n divs] | |
(when (not= rem 0) | |
(recur rem (conj rems rem) (conj divs div) (inc i))))))) |
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
(declare odd?) | |
(defn even? [x] | |
(if (== 0 x) | |
true | |
#(odd? (- x 1)))) | |
(defn odd? [x] | |
(if (== 1 x) | |
true |
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
(defmacro hash-map-by-names [names] | |
(zipmap (map keyword names) names)) | |
(def x 100) | |
(def y 200) | |
(let [y 2 | |
z 3] | |
(hash-map-by-names [x y])) ; {:y 2, :x 100} |
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
<html> | |
<head> | |
<style type="text/css"> | |
.log { | |
color: red; | |
} | |
</style> | |
<script> | |
ws = new WebSocket("ws://localhost:8080"); | |
ws.onopen = function (e) { |
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
;; 第1回 Scheme コードバトン | |
;; | |
;; ■ これは何か? | |
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。 | |
;; 次回 Shibuya.lisp で成果を発表します。 | |
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。 | |
;; | |
;; ■ 2 つのルール | |
;; | |
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。 |