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
| Program yoba; | |
| uses crt; | |
| var | |
| a1: integer; | |
| a2: integer; | |
| a3: integer; | |
| a4: integer; | |
| a5: integer; | |
| a6: integer; | |
| a7: integer; |
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
| group_by2(F, [H|T]) -> | |
| group_by2(F, T, [H], []). | |
| group_by2(_, [], [], Acc) -> | |
| lists:reverse(Acc); | |
| group_by2(F, [], Buf, Acc) -> | |
| group_by2(F, [], [], [Buf|Acc]); | |
| group_by2(F, [H|T], [HBuf|_TBuf] = Buf, Acc) -> |
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
| #include <stdio.h> | |
| #include <stdlib.h> | |
| #include <conio.h> | |
| struct list{ | |
| int num; | |
| struct list * next; | |
| }; | |
| struct list * begin = NULL, * end = NULL, * p, * tmp; |
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
| -record(params_ping, {host :: nonempty_string()}). | |
| -record(params_tcp, {host :: list(atom()), | |
| port = 80 :: pos_integer(), | |
| timeout :: pos_integer()}). | |
| ...SOME MAGIC... | |
| { | |
| "params_ping": { | |
| "host": { |
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
| Erlang R14B03 (erts-5.8.4) [source] [64-bit] [smp:4:4] [rq:4] [async-threads:0] [kernel-poll:true] | |
| (circa_dev@si14-laptop)8> timer:tc(fun() -> [ecirca:push(T, X) || X <- lists:seq(1, 1000)], ok end). | |
| {16863,ok} | |
| (circa_dev@si14-laptop)9> timer:tc(fun() -> [ecirca:push(T, X) || X <- lists:seq(1, 1000)], ok end). | |
| {17000,ok} | |
| (circa_dev@si14-laptop)10> timer:tc(fun() -> [ecirca:push(T, X) || X <- lists:seq(1, 1000)], ok end). | |
| {4093,ok} <---- WHY? | |
| (circa_dev@si14-laptop)11> timer:tc(fun() -> [ecirca:push(T, X) || X <- lists:seq(1, 1000)], ok end). | |
| {15959,ok} |
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
| (circa_dev@si14-laptop)1> ecirca_bench:start(). | |
| {1052,ok} | |
| (circa_dev@si14-laptop)2> ecirca_bench:start(). | |
| {770,ok} | |
| (circa_dev@si14-laptop)3> ecirca_bench:start(). | |
| {726,ok} | |
| (circa_dev@si14-laptop)4> ecirca_bench:start(). | |
| {737,ok} | |
| (circa_dev@si14-laptop)5> ecirca_bench:start(). | |
| {740,ok} |
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
| unsigned char* bin_data; | |
| bin_data = enif_make_new_binary(env, buflen, ret); | |
| i = 0; | |
| bin_data[i] = ctx->size; | |
| i += sizeof(length_t); | |
| bin_data[i] = ctx->begin; | |
| i += sizeof(length_t); | |
| bin_data[i] = ctx->filled; | |
| i += sizeof(unsigned short int); |
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
| case foobar() of | |
| {A, B} -> ... | |
| {A} -> ... | |
| end | |
| barbaz(A) <- WUT? | |
| let's try to extend our foobar(): | |
| case foobar() of | |
| {A, B} -> ... |
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
| Result = try | |
| ... | |
| catch | |
| throw:{error, _}=Err -> Err | |
| end, | |
| Result2 = case Result of | |
| {error, _}=Err -> Err; | |
| Proplist when is_list(Proplist) -> | |
| [[A, B] || {A, B} <- Result] | |
| end, |
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
| s =: ({. , }. /: 12"_ o. }. - {.) @ /:~ | |
| l =: 11"_ o. [: (* +)/ }. - {. | |
| rr =: (1"_ , (0"_ > 3: l\ ]) , 1"_) # ] | |
| hull =: [: rr^:_ s |
OlderNewer