- What can be traced?
- How can trace events be specified?
- "match specifications": twisty passages, all alike
- WTF, can I just use DTrace and drink my coffee/beer/whisky in peace?
- Trace delivery mechanisms: pick one of two
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
8> Z = fun(F) -> Core = fun(X) -> fun(M) -> (F(X(X)))(M) end end, Core(Core) end. | |
#Fun<erl_eval.6.50752066> | |
9> Z(fun(F) -> fun(0) -> 1;(N) -> N*F(N-1) end end). | |
#Fun<erl_eval.6.50752066> | |
10> ZZ = Z(fun(F) -> fun(0) -> 1;(N) -> N*F(N-1) end end). | |
#Fun<erl_eval.6.50752066> | |
11> ZZ(5). | |
120 | |
12> |
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
48> {ok, Tokens, _} = erl_scan:string("A+1."). | |
{ok,[{var,1,'A'},{'+',1},{integer,1,1},{dot,1}],1} | |
49> {ok, Tree} = erl_parse:parse_exprs(Tokens). | |
{ok,[{op,1,'+',{var,1,'A'},{integer,1,1}}]} | |
50> erl_eval:exprs(Tree, [{'A',3}]). | |
{value,4,[{'A',3}]} |
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
localhost [/home/yoshi_vagrant/egit%] erlc tlist_to_case.erl | |
localhost [/home/yoshi_vagrant/egit%] erlc -pa . +"{parse_transform,tlist_to_case}" tl_parset.erl | |
localhost [/home/yoshi_vagrant/egit%] cat case_statement.txt | |
do(Name) -> | |
case Name of | |
"US" -> | |
"001"; | |
"GBP" -> | |
"002" | |
end. |
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
1 -module(makecent). | |
2 -export([do/0,parse0/1,parse1/1]). | |
3 | |
4 do() -> | |
5 lists:filter( | |
6 fun(E) -> | |
7 parse1(parse0(E)) == 100 | |
8 end, genall(lists:seq(1,9))). | |
9 | |
10 parse1([]) -> 0; |
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
$ [/Users/yoshihiro.tanaka/gith/sunaba%] tree [feature/gen_server_pool] | |
. | |
├── Makefile | |
├── README.md | |
├── deps | |
├── doc | |
│ ├── edoc-info | |
│ ├── erlang.png | |
│ ├── index.html | |
│ ├── modules-frame.html |
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(topo). | |
-compile(export_all). | |
% topological sort | |
add({A, B}, [], New) -> [{A, 0, [B]}] ++ New; | |
add({A, B}, [{A, Cnt, L}|T], New) -> [{A, Cnt+1, [B|L]}] ++ T ++ New; | |
add({A, B}, [{C, Cnt, L}|T], New) -> add({A, B}, T, [{C, Cnt, L}|New]). | |
add(E, L) -> add(E, L, []). |
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
#!/usr/bin/perl | |
use strict; | |
# This program applies Floyd-Warshall | |
# All-Pairs Shortest Pairs Algorithm | |
# to aquire the shortest weiths for all pairs. | |
# | |
# Input: the graph below. | |
# | |
# | 1| 2| 3| 4| 5 |
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
#!/usr/bin/perl | |
use strict; | |
# | |
# This program calculates MST(minimum spanning tree) using | |
# Prim's Algorithm | |
# | |
# | |
# Input: the graph below. | |
# Output: minimum spanning tree |
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
% eightqueen.pro | |
% | |
nocheck(_,[]). | |
nocheck(X/Y, [X1/Y1 | Rest]) :- X=\=X1,Y=\=Y1, | |
abs(Y1-Y) =\= abs(X1-X), | |
nocheck(X/Y,Rest). | |
legal([]). | |
legal([X/Y | Rest]) :- |
NewerOlder