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
loop(Request) -> | |
try | |
process(Request) | |
catch | |
Class:Exception -> | |
Req:respond({500, [{"Content-Type", "text/plain"}], | |
io_lib:format("Couldn't process request ~p~n" | |
"Exception: ~p:~p~n" | |
"StackTrace:~p~n", [Request:dump(), Class, Exception, | |
erlang:get_stacktrace()])}) |
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
%%% ==================================================================== | |
%%% This software is copyright (c) 2006-2007, Process-one. | |
%%% | |
%%% $Id$ | |
%%% | |
%%% @copyright 2006-2007 Process-one | |
%%% @author Christophe Romain <[email protected]> | |
%%% [http://www.process-one.net/] | |
%%% @author Bengt Kleberg <[email protected]> | |
%%% @version {@vsn}, {@date} {@time} |
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(orbited_app). | |
-behaviour(application). | |
-export([start/0, start/2, stop/1]). | |
start() -> | |
application:load(orbited), | |
{ok, Deps} = application:get_key(orbited, applications), | |
lists:map(fun application:start/1, | |
Deps), | |
application:start(orbited). |
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(mochiweb_signup_form_controller). | |
-export([serve_form/2]). | |
serve_form('GET', Req) -> | |
{ok, Form} = form:render(signup_form()), | |
Req:ok("text/html", Form); | |
serve_form('POST', Req) -> | |
Post = Req:parse_post(), | |
case form:valid_post(signup_form(), Post) of |
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
%%%------------------------------------------------------------------- | |
%% @copyright Geoff Cant | |
%% @author Geoff Cant <[email protected]> | |
%% @version {@vsn}, {@date} {@time} | |
%% @doc Experimental replacement for inet_dns | |
%% @end | |
%%%------------------------------------------------------------------- | |
-module(ginet_dns2). | |
%% API |
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
resolve(Path) -> | |
filename:join(resolve(filename:split(Path), [])). | |
resolve([], Acc) -> | |
lists:reverse(Acc); | |
resolve([".." | Rest], [_ | Acc]) -> | |
resolve(Rest, Acc); | |
resolve([".." | Rest], []) -> | |
resolve(Rest, []); | |
resolve([This | Rest], Acc) -> |
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
%%%------------------------------------------------------------------- | |
%% @copyright Process One inc. | |
%% @author Geoff Cant <[email protected]> | |
%% @version 1.0, {@date} {@time} | |
%% @doc Tsung protocol module behaviour and edoc. | |
%% @end | |
%%%------------------------------------------------------------------- | |
-module(ts_protocol). | |
-export([init_dynparams/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
info(Field, Rec) -> | |
Fields = fields(Rec), | |
FieldIdx = lists:zip(Fields, lists:seq(2,length(Fields)+1)), | |
element(proplists:get_value(Field,FieldIdx), Rec). | |
fields(#your_record{}) -> fields(your_record); | |
fields(your_record) -> record_info(fields, your_record). | |
to_proplist(R) -> | |
Keys = fields(R), |
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
%%%------------------------------------------------------------------- | |
%% @copyright Geoff Cant | |
%% @author Geoff Cant <[email protected]> | |
%% @version {@vsn}, {@date} {@time} | |
%% @doc Test process group server | |
%% @end | |
%%%------------------------------------------------------------------- | |
-module(groupsrv). | |
-behaviour(gen_server). |
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
FindProcs = fun (Pid, Ign) -> | |
A = fun (F, Pid, Ignore) -> | |
Links = [P || P <- element(2, process_info(Pid, links)), is_pid(P), node(P) =:= node()], | |
Monitors = [P || {_, P} <- element(2,process_info(Pid, monitors)), is_pid(P), node(P) =:= node()], | |
New = lists:filter(fun (I) -> not lists:member(I, Ignore) end, Links++Monitors), | |
[Pid | lists:flatmap(fun (P) -> F(F, P, New ++ Ignore) end, New)] | |
end, | |
A(A, Pid, Ign) | |
end. |
OlderNewer