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/sh | |
### BEGIN INIT INFO | |
# Provides: nginx | |
# Required-Start: $all | |
# Required-Stop: $all | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts the nginx web server | |
# Description: starts nginx using start-stop-daemon |
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
fizzbuzzList = [x | x <- map fizzbuzz [1..]] | |
where fizzbuzz x | x `mod` 15 == 0 = "FizzBuzz" | |
| x `mod` 5 == 0 = "Buzz" | |
| x `mod` 3 == 0 = "Fizz" | |
| otherwise = show x | |
main = do | |
mapM_ putStrLn $ take 100 $ fizzbuzzList |
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
my $t; | |
while (<>) { | |
my ($key, $value) = split; | |
push @{$t->{$key}}, $value; | |
} | |
foreach $key (keys %{$t}) { | |
my $s = join ", ", @{$t->{$key}}; | |
print "$key $s\n"; |
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
import System.Time | |
import System.Locale | |
main = getClockTime >>= | |
toCalendarTime >>= | |
putStrLn . formatCalendarTime defaultTimeLocale "%c" |
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日以内に次の人にまわしてください。 |
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
;;; ゼルダの伝説 (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)) |