View gist:485429
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
case Spam of | |
<<1:32, B:32>> | <<2:32, B:32>> -> | |
... ; | |
<<1:16, 2:16, C/binary>> -> | |
... | |
end. |
View sample.erl
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(sample). | |
-compile(export_all). | |
-record(store, {key, value}). | |
main() -> | |
crypto:start(), | |
mnesia:start(), | |
mnesia:create_table(store, |
View 実行結果
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
% erl | |
Erlang R13B04 (erts-5.7.5) [source] [64-bit] [smp:2:2] [rq:2] [async-threads:0] [hipe] [kernel-poll:false] | |
Eshell V5.7.5 (abort with ^G) | |
1> c(sample). | |
{ok,sample} | |
2> sample:main(). | |
---> Processes holding locks <--- | |
---> Processes waiting for locks <--- | |
---> Participant transactions <--- |
View あなたはどっち.erl
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
%% A | |
F = fun() -> | |
mnesia:table_info(store, size) | |
end, | |
Result = mnesia:activity(async_dirty, F, [], mnesia_frag). | |
%% B | |
Result = mnesia:activity(async_dirty, | |
fun() -> | |
mnesia:table_info(store, size) |
View gist:737963
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
* Bluetail/Alteon/Nortel (distributed, fault tolerant email system, SSL accelerator) | |
* Cellpoint (Location-based Mobile Services) | |
* Corelatus (SS7 monitoring). | |
* dqdp.net (in Latvian) (Web Services). | |
* Facebook (Facebook chat backend) | |
* Finnish Meteorological Institute (Data acquisition and real-time monitoring) | |
* IDT corp. (Real-time least-cost routing expert systems) | |
* Kreditor (Electronic payment systems) | |
* Mobilearts (GSM and UMTS services) |
View ipv6mcast.erl
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(ipv6mcast). | |
-compile([export_all]). | |
-include_lib("eunit/include/eunit.hrl"). | |
%% struct ipv6_mreq { | |
%% struct in6_addr ipv6mr_multiaddr; /* IPv6 multicast addr */ | |
%% unsigned int ipv6mr_interface; /* interface index */ | |
%% }; |
View cover.erl
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
%% Removes a module from the list of imported modules and writes a warning | |
%% This is done when a module is compiled. | |
remove_imported(Module,Imported) -> | |
case lists:keysearch(Module,1,Imported) of | |
{value,{Module,_,ImportFiles}} -> | |
io:fwrite("WARNING: Deleting data for module ~w imported from~n" | |
"~p~n",[Module,ImportFiles]), | |
lists:keydelete(Module,1,Imported); | |
false -> | |
Imported |
View gist:796242
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
Eshell V5.8.2 (abort with ^G) | |
1> code:unstick_mod(ets). | |
true | |
2> meck:new(ets). | |
ok | |
3> meck:expect(ets, insert, 2, ok). | |
=ERROR REPORT==== 26-Jan-2011::13:45:19 === | |
Loading of failed: badfile |
View rebar.config
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
{erl_opts, [fail_on_warning, debug_info]}. | |
{xref_checks, [undefined_function_calls]}. | |
%% {eunit_opts, [verbose, {report,{eunit_surefire,[{dir,"."}]}}]}. | |
{cover_enabled, true}. | |
{clean_files, [".eunit", "ebin/*.beam"]}. | |
{dialyzer_opts, | |
[{warnings, | |
[no_return, | |
no_unused, | |
no_improper_lists, |
View rebar.config
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
{require_otp_vsn, "R14"}. | |
{erl_opts, [fail_on_warning, | |
warn_export_all, warn_unused_import, | |
warn_missing_spec, warn_untyped_record]}. | |
{xref_checks, [undefined_function_calls]}. | |
{clean_files, [".qc/*", ".eunit/*", "ebin/*.beam"]}. | |
%% Jenkins 向け | |
%% {eunit_opts, [{report,{eunit_surefire,[{dir,"."}]}}]}. | |
{cover_enabled, true}. | |
{edoc_opts, [{dialyzer_specs, all}, {report_missing_type, true}, |
OlderNewer