Elixir ユーザーのための OTP 入門 (Shinjuku.ex #10)
話すこと
- OTP とは何か
- 「よくわからないけど使ったほうがいいっぽい」から「なぜ使うのかを意識して使う」になるための導入(になるといいな)
- 詳細な API とかには触れません
defmodule StringIO do | |
def new(string) when is_binary(string) do | |
spawn_link(fn -> string_io_process(string) end) | |
end | |
def string_io_process(string) do | |
loop(:infinity, String.to_char_list!(string)) | |
end | |
def loop(wait, buf) do |
-include_lib("public_key/include/public_key.hrl"). | |
extract_public_key(CertPath) | |
{ok, CertBinary} = file:read_file(CertPath), | |
CertPemEntries = public_key:pem_decode(CertBinary), | |
{'Certificate', Cert, _} = lists:keyfind('Certificate', 1, CertPemEntries), | |
#'OTPCertificate'{ | |
tbsCertificate = #'OTPTBSCertificate'{ | |
subjectPublicKeyInfo = #'OTPSubjectPublicKeyInfo'{ | |
subjectPublicKey = PublicKey |
diff --git ebin/rebar.app ebin/rebar.app | |
index 710f8b2..b683ffb 100644 | |
--- ebin/rebar.app | |
+++ ebin/rebar.app | |
@@ -46,7 +46,8 @@ | |
rebar_metacmds, | |
rebar_getopt, | |
rebar_mustache, | |
- rmemo ]}, | |
+ rmemo, |
in_debug_agent
in_dummy
in_exec
window.onload = function(){ | |
var ptr = 0; | |
var mem = []; | |
var count = 1; | |
var input_set = function(input) { | |
var splited = input.split(' '); | |
var ary = []; | |
for(var i = 0, len = splited.length; i < len; ){ | |
ary.push(splited[i++] + splited[i++]); | |
} |
var card_num = 0; | |
var card_array = new Array(); | |
var card_twin = new Array(); | |
//カードの要素を取得 | |
for (var ai = 0; true; ai++){ | |
if(document.getElementById('card' + ai) == null){ | |
card_num = ai; | |
break; | |
} |
=begin | |
入力形式 | |
T ケースの数(1<=T<=100) | |
N ケース1の数の個数(1<=N<=10) | |
a1 a2 ... aN 与えられる数(0<=an<=1,000,000) | |
M ケース2の数の個数 | |
b1 b2 ... bM 与えられる数 | |
... ... | |
=end |
# coding: utf-8 | |
class Billboards | |
def initialize(input) | |
lines = [] | |
open(input) do |f| | |
lines = f.readlines.map{|l|l.chomp!} | |
end | |
@num = lines.shift.to_i | |
@case = [] |
# coding: utf-8 | |
class Soup | |
def initialize(input) | |
lines = [] | |
open(input) do |f| | |
lines = f.readlines.map{|l|l.chomp!} | |
end | |
@num = lines.shift.to_i | |
@case = lines |