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
javascript:(function(){var es=document.getElementsByClassName("gD");if(es.length==0)return;var e=es[0].getAttribute("email");window.location.href='/mail/u/0/#search/in%3Ainbox+from%3A'+e;})(); |
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
javascript:(function(){var%20s=window.prompt("%E3%82%BF%E3%82%A4%E3%83%88%E3%83%AB%E3%81%AE%E4%B8%80%E9%83%A8%E3%82%92%E5%85%A5%E5%8A%9B%E3%81%97%E3%81%A6%E3%81%8F%E3%81%A0%E3%81%95%E3%81%84%E3%80%82");if(!s)return;document.getElementById("gbqfq").value="in:inbox%20subject:"+s;document.getElementById("gbqfb").click();})(); |
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
// Maybe monad. | |
var Maybe = { | |
Just: function(a) { | |
this.value = a; | |
this.bind = function(f) { return f(this.value); }; | |
}, | |
None: function() { | |
this.bind = function() { return this; }; | |
}, |
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
// Test monad laws. | |
// Monad laws are described in http://www.haskell.org/haskellwiki/Monad_Laws | |
test("return a >>= f should be equivalent to f a", function() { | |
var f = function(a) { return Maybe.return(a * 3); }; | |
var lhs = Maybe.return(5).bind(f); | |
var rhs = f(5); | |
deepEqual(lhs, rhs, "equivalent"); | |
}); |
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
#!/bin/sh | |
echo "Input first file, then Ctrl-D" | |
echo -n "> " | |
cat >old.txt | |
echo "Input second file, then Ctrl-D" | |
echo -n "> " | |
cat >new.txt |
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
package controllers | |
import play.api._ | |
import play.api.mvc._ | |
import play.api.db._ | |
import play.api.Play.current | |
import anorm._ | |
import java.sql._ | |
object Application extends Controller { |
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
%% -*- coding: utf-8 -*- | |
-module(yy). | |
-export([start/0]). | |
monsters() -> ["焼きたてパン", "強いシャチホコ", "もんじゃ焼き一年生", | |
"怪人ホタテ男", "ニセ勇者", "逃げ足の早いアレ", "睡魔", "煩悩", | |
"愛らしい子犬の中の人", "恋するスズメバチ", "勇敢なクマンバチ", | |
"信じられない物", "勇者の師匠", "浮遊する鎧", "怪盗ドボン", "闇の招き猫", | |
"誘惑のカスタードクリーム", "しょっぱすぎる籠手", "カレー味の兜", |
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
-module(ifb). | |
-export([sample/0, find/1]). | |
sample() -> | |
write_ifb([fizz]), | |
write_ifb([buzz]), | |
write_ifb([fizz, buzz]), | |
write_ifb([buzz, fizz]), | |
write_ifb([fizz, buzz, fizz]), | |
write_ifb([fizz, fizz]), |
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
-module(ba). | |
-export([tests/0, test/2, amida/1]). | |
tests() -> | |
test("d6-7b-e1-9e", "740631825"), % #0 | |
test("6f-dd-ff-ff", "230685147"). % #41 | |
test(Data, Expected) -> | |
io:fwrite("~s -> ~s, ~w~n", [Data, Expected, amida(Data) =:= Expected]). |
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
% solve 8-queens problem. | |
-module(eq). | |
-compile(export_all). | |
solve() -> | |
register(counter, spawn(fun() -> counter(0) end)), | |
solve(cols(), []), | |
counter ! show. |
OlderNewer