Skip to content

Instantly share code, notes, and snippets.

-module(bulletin_board_webapp).
-behaviour(merl_webapp).
-include_lib("merl/include/merl.hrl").
-export([get_mode/1, build_app_definition/0]).
get_mode(_) ->
development.
-module(test).
-export([add/2]).
-compile([native]).
add(X, Y) when is_number(X), is_number(Y) ->
X + Y.
-module(example1).
-export([init/0, find_by_field/2, undefined_function/2]).
-author("kevin@hypotheticalabs.com").
init() ->
code:ensure_loaded(function_missing),
process_flag(error_handler, function_missing),
ok.
This template:
%html
%body[{class, "normal"}]
#message
Hello, world!
renders this output:
<html>
<body class="normal">
<div id="message">
#main
%span#message
%table
%tr
%td
Hello, world
%td
This is a test.
-module(node_mgr).
-behaviour(gen_server).
%% API
-export([start_link/0, register/1, next_worker/0]).
-define(SERVER, ?MODULE).
%% gen_server callbacks
handle_call({insert, Value}, _From, State) ->
NextNodePid = node_manager:next_node(?METHOD),
NextDbPid = db_node:next_db(NextNodePid, ?METHOD),
db:insert(Value).
@kevsmith
kevsmith / gist:61221
Created February 10, 2009 03:43 — forked from boorad/gist:61216
handle_call({insert, Value}, _From, State) ->
NextNode = node_manager:next_node(?METHOD),
NextDb = db_manager:next_db_node(NextNode),
db_node:insert_value(Value),
------
On the db_manager module:
next_db_node(DbManagerPid) ->
gen_server:call(DbManagerPid, {next_db, ?METHOD}).
=ERROR REPORT==== 24-Mar-2009::13:55:19 ===
** Generic server kw2000_agent terminating
** Last message in was {space,write,
{vci_channel,
sessionCD2C8AD4FAB6BBCF90FD8CF6BA031986D5DC36DD,
0,6}}
** When Server state == {state,1,undefined,[]}
** Reason for termination ==
** {{aborted,{no_exists,[ecu_to_bus,{ecu_to_bus,4,'_','_','_','_'}]}},
{gen_server,call,
-module(iconv_t_001).
-export([start/0]).
start() ->
etap:plan(1),
etap:ok(application:start(baberl), "Start baberl app"),
etap:ok(application:stop(baberl), "Stop baberl app"),
etap:end_tests().