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
-module(eimgs). | |
-compile(export_all). | |
-define(M,16#FF). | |
-define(SOI,16#D8). | |
-define(EOI,16#D9). | |
-record(jpg, {buf = <<>>}). | |
go() -> |
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
-module(chat). | |
-compile(export_all). | |
start() -> | |
Pid = spawn(fun loop/0), | |
register(chatroom, Pid), | |
Pid. | |
loop() -> |
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
Archery | |
Athletics | |
Badminton | |
Basketball | |
Beach Volleyball | |
Boxing | |
Canoe Slalom | |
Canoe Sprint | |
Cycling BMX | |
Cycling Mountain Bike |
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 | |
ARTIST=`echo $@ | cut -d/ -f6` | |
ALBUM=`echo $@ | cut -d/ -f7` | |
ARTIST="$(echo $ARTIST | sed 's/+/ /g;s/%\(..\)/\\x\1/g;')" | |
ALBUM="$(echo $ALBUM | sed 's/+/ /g;s/%\(..\)/\\x\1/g;')" | |
ARTIST=`echo -n -e $ARTIST` | |
ALBUM=`echo -n -e $ALBUM` | |
(mkdir -p "$ARTIST" && \ |
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
%1 | |
Params = #amqp_params{ | |
username = iolist_to_binary(User), | |
password = iolist_to_binary(Password), | |
virtual_host = iolist_to_binary(Vhost), | |
host = Host, | |
port = Port | |
}, | |
%2 | |
Params = #amqp_params{ |
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
open_connection_link(Params) -> | |
process_flag(trap_exit, true), | |
{ok, Conn} = amqp_connection:start(network, Params), | |
link(Conn), | |
receive | |
{'EXIT', Conn, Reason} -> | |
exit(Reason); | |
{'EXIT', _Pid, Reason} -> | |
ok = amqp_connection:close(Conn), | |
exit(Reason) |
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
-spec login(binary(), binary()) -> iolist(). | |
login(Username, Password) -> | |
Msg = #seto_message{ | |
seq = 1, | |
payload = | |
{login, #seto_login{ | |
username = Username, | |
password = Password | |
}} | |
}, |
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
def login(username, password): | |
msg = seto_pb2.seq_message() | |
msg.seq = 1 | |
msg.payload.login.username = username | |
msg.payload.login.password = password | |
return msg.SerializeToString() |
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
order_executed_test_() -> | |
Qty = 100000, | |
Px = 2500, | |
{inparallel, [ | |
fun() -> | |
{ok, C} = login_with_user(1), | |
?assertLoginResponse(1), | |
Side = buy, | |
ok = smk_client:order(C, Qty, Px, Side, ?MARKET_ID, ?CONTRACT_ID), | |
?assertOrderAccepted(2, OrderId, 2), |
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
1> 11:56:38.152 [info] Application lager started on node nonode@nohost | |
11:56:38.154 [info] Application smk started on node nonode@nohost | |
1> smk_my_callbacks:start(<<"[email protected]">>, <<"******">>). | |
11:57:09.777 [info] LastIn 0 LastOut 0 | |
11:57:09.778 [info] connection backoff 0, cache smk_memory_message_cache | |
{ok,<0.52.0>} | |
2> 11:57:09.805 [info] sending: 1 {seto_payload,login,{eto_payload,1,login,undefined,undefined,undefined,undefined,undefined},{seto_login,<<"[email protected]">>,<<"abc123">>,undefined},undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined} | |
11:57:09.902 [info] awaiting_session: Received {seto_payload,eto,{eto_payload,1,login_response,false,undefined,undefined,{eto_login_response,<<"5d18861f-4a65-4084-b7ef-95d6e680aa9b">>,2},undefined},undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined,undefined |
OlderNewer