Skip to content

Instantly share code, notes, and snippets.

View johnbender's full-sized avatar

John Bender johnbender

View GitHub Profile
<div class="delicious-user-top-links" id="johndoe|erlang">
</div>
<script type='text/javascript'>
//FIRST
//script added before the remote resource call to delicious
//added dynamically with the right id
DeliciousTop.DisplayjohndoeLinks = function(data){
DeliciousTop.DisplayLinks(data, 'johndoe|erlang');
}
</script>
<script type='text/javascript' src='http://feeds.delicious.com/v2/json/nousplacidus/erlang?callback=DeliciousUserTop.DisplayjohndoeLinks'>
mnesia:create_schema([somenode]),
mnesia:add_table_copy(Tab, somenode, Type)
in function list_to_atom/1
called as list_to_atom(["obj"])
in call from erl_scan:scan/6
in call from smerl:parse_func_string/1
in call from smerl:add_func/3
in call from grove_appmod:get_query/3
ERROR erlang code crashed:
File: appmod:0
Reason: {undef,[{grove_mnesia,action2,["object",[]]},
{grove_appmod,get_query,3},
{yaws_server,deliver_dyn_part,8},
{yaws_server,aloop,3},
{yaws_server,acceptor0,2},
{proc_lib,init_p_do_apply,3}]}
try
{ok, Final} = smerl:add_func(Init, Fun),
smerl:compile(Final),
content(add_fun:run_fun(Object, Params))
catch
{error, _Something} -> ?ERROR_STATUS;
{undef, _Something} -> ?ERROR_STATUS;
_Other -> ?ERROR_STATUS
end.
deal_with_strings() ->
Result = string:format("~s ~s", ["very" , "simple"]),
%% is much cleaner than
Result2 = lists:flatten(io_lib:format(("~s ~s", ["very" , "simple"])).
{parts,
{table, "item"},
{columns, all},
{operations, [eq(column("item", name), "apple")]},
{order, []}}
[Item || Item <- mnesia:table(item) ,Item#item.name =:= apple]
format_query({parts, {table, Name}, {columns, Columns}, Op, Ord}) ->
ColStr = format_columns(Name, Columns),
format_query({parts, {table, Name}, ColStr, Op, Ord});
format_query({parts, {table, Name}, Col, {operations, Ops}, Ord}) ->
OpStr = format_ops(Name, Ops),
format_query({parts, {table, Name}, Col, OpStr, Ord});
format_query({parts, {table, Name}, Col, Op, Ord}) ->
TableGen = format_generator(Name),