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.Environment | |
| fizzbuzz n | |
| | 0 >= n = error "n must be >0." | |
| | otherwise = | |
| let fb x | |
| | 0 == mod x 15 = "FizzBuzz" | |
| | 0 == mod x 5 = "Buzz" | |
| | 0 == mod x 3 = "Fizz" | |
| | otherwise = show x |
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 Control.Applicative | |
| goodRoute :: (Real a) => [[a]] -> [a] | |
| goodRoute = n . goodRoute_ | |
| where | |
| goodRoute_ :: (Real a) => [[a]] -> Maybe [a] | |
| goodRoute_ ([]:_) = Nothing | |
| goodRoute_ [] = Nothing | |
| goodRoute_ ((x:[]):[]) = Just (x:[]) | |
| goodRoute_ matrix = |
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
| (function() { | |
| var curry = function(f) { | |
| var c = function(l, args) { | |
| return function(a) { | |
| switch(l) { | |
| case 1: | |
| args.push(a) | |
| case 0: | |
| return f.apply(this, args) |
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
| /** | |
| * CSS Reset | |
| * From Blueprint reset.css | |
| * http://blueprintcss.googlecode.com | |
| */ | |
| html, body, div, span, object, iframe, h1, h2, h3, h4, h5, h6, p, blockquote, pre, a, abbr, acronym, address, code, del, dfn, em, img, q, dl, dt, dd, fieldset, form, label, legend, table, caption, tbody, tfoot, thead, tr, th, td {margin:0;padding:0;border:0;font-weight:inherit;font-style:inherit;font-size:100%;font-family:inherit;vertical-align:baseline;} | |
| body {line-height:1.5;} | |
| table {border-collapse:separate;border-spacing:0;} | |
| caption, th, td {text-align:left;font-weight:normal;} | |
| table, td, th {vertical-align:middle;} |
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
| $.extend({ | |
| deepEquals: function(obj1, obj2) { | |
| var q = [] | |
| var r = function(o1, o2) { | |
| var k1 = Object.keys(o1).sort() | |
| var k2 = Object.keys(o2).sort() | |
| if (k1.length != k2.length) return false; | |
| var result = true | |
| $.each(k1, function(_, key) { |
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
| $.extend({ | |
| foldl: function(array, acc, callback) { | |
| $.each(array, function(_, value) { | |
| acc = callback(value, acc) | |
| }) | |
| return acc | |
| }, | |
| foldr: function(array, acc, callback) { |
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 java.util.ArrayList; | |
| import java.util.Arrays; | |
| import java.util.List; | |
| import org.junit.Test; | |
| /** | |
| * 子どもとして持てるノードタイプを型として定義可能なツリー構造が作りたかった | |
| */ | |
| public class Test1 { |
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
| var hoge_ScopeTest = 1001, fuga_ScopeTest = 1002, piyo_ScopeTest = 1003, foo_ScopeTest = 1004; | |
| TestCase("Scope Test", { | |
| "test scope": function () { | |
| var sum = function() { | |
| //関数内部で宣言されたローカル変数は先頭で宣言されたのと同義になる(=ホイスト) | |
| //var i, total; |
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
| PYTHON_VERSION=2.7 | |
| CCFLAG=-std=gnu99 -Wall -fPIC -I/usr/include/python${PYTHON_VERSION} | |
| LDFLAG=-lpython${PYTHON_VERSION} | |
| run: build | |
| python -m unittest pythonc_test | |
| build: spam.so | |
| spam.so: spam.o | |
| gcc -shared -o $@ $^ ${LDFLAG} |
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 | |
| NAME=JsTestDriver | |
| USER=ikeda | |
| DESC="JsTestDriber daemon" | |
| JAVA=/usr/bin/java | |
| PORT=4224 | |
| PATH=/usr/local/share/${NAME} | |
| PIDFILE=${PATH}/${NAME}.pid |