View gist:b4ea1adf37194fbea4f1
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
defmodule DotExp do | |
@doc """ | |
RegExp like syntax validator, "." is any symbol, | |
"*" repeats last symbol 0..n times. | |
""" | |
def match?(expr, str), do: match(expr, str) | |
defp match("", ""), do: true | |
defp match(".*", _), do: true | |
View gist:05784610ebb80ac27989
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
defmodule MobCas3.Poker1 do | |
@cards([{99, :joker},{98, :joker}] ++ | |
for m <- 2..14, v <- [:spades, :clubs, :diamonds, :hearts] do {m,v} end) | |
def match(comb) when is_list(comb), do: apply(MobCas3.Poker, :match, Enum.sort(comb)) | |
def match(comb) when is_tuple(comb), do: match(Tuple.to_list(comb)) | |
def match({10,m}, {11,m}, {12,m}, {13,m}, {14,m}), do: {:royal_flush, {m}} | |
def match({a,m}, {b,m}, {c,m}, {d,m}, {e,m}) | |
when b==a+1 and c==b+1 and d==c+1 and e==d+1, do: {:straight_flush, {e,m}} |
View gist:4954257
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
function hackcrypt(last, message) { | |
var len = message.length; | |
for(var ret = "", i = 0; i < len; i++) | |
ret += chars[last = (i + last + message.charCodeAt(i)) % 64]; | |
return ret; | |
} | |
function uncrypt(endata){ | |
var chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""), | |
total = 0; |
View # opencv - 2016-10-13_12-01-37.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
Homebrew build logs for homebrew/science/opencv on macOS 10.12 | |
Build date: 2016-10-13 12:01:37 |