erlware / erlang-and-otp-in-action-source Goto Github PK
View Code? Open in Web Editor NEWThe official "Erlang and OTP in Action" source code - see the README below for more details
Home Page: manning.com/logan
License: MIT License
The official "Erlang and OTP in Action" source code - see the README below for more details
Home Page: manning.com/logan
License: MIT License
I got this when i run the command "application:start(simple_cache)."
{error,
{bad_return,
{{sc_app,start,[normal,[]]},
{'EXIT',
{undef,
[{sc_app,start,[normal,[]],[]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},{line,272}]}]}}}}}
=INFO REPORT==== 2-Apr-2015::11:37:28 ===
application: simple_cache
exited: {bad_return,
{{sc_app,start,[normal,[]]},
{'EXIT',
{undef,
[{sc_app,start,[normal,[]],[]},
{application_master,start_it_old,4,
[{file,"application_master.erl"},
{line,272}]}]}}}}
type: temporary
Would you be open to having your code ported over to the Elixir equivalent? It would be a great teaching tool. Thank you! @ericbmerritt @martinjlogan @richcarl
Hi,
do you plan to update the book to reflect trends in the community and language?
Thanks,
Chris
when using
gen_server:start_link({local, ?SERVER}, ?MODULE, [Port], []).
...................
{ok, LSock} = gen_tcp:listen(lists:nth(1, Port), [{active, true}),
get a problem
** exception exit: function_clause
in function inet_tcp:getserv/1
called as inet_tcp:getserv([1055])
so I tried that
{ok, LSock} = gen_tcp:listen(lists:nth(1, Port), [{active, true}]),
now it goes well.
why does it have this problem?
=SUPERVISOR REPORT==== 5-Oct-2011::11:40:20 ===
Supervisor: {<0.134.0>,gws_connection_sup}
Context: child_terminated
Reason: {function_clause,
[{gws_server,handle_info,
[{http,#Port<0.2726>,
{http_header,24,'User-Agent',undefined,
<<"curl/7.21.0 (i486-pc-linux-gnu) libcurl/7.21.0 OpenSSL/0.9.8o zlib/1.2.3.4 libidn/1.15 libssh2/1.2.6">>}},
{state,#Port<0.2725>,#Port<0.2726>,
{http_request,'GET',
{abs_path,<<"/foo">>},
{1,1}},
[],<<>>,0,hi_server,[],<0.134.0>}]},
{gen_server,handle_msg,5},
{proc_lib,init_p_do_apply,3}]}
Offender: [{pid,<0.135.0>},
{name,gws_server},
{mfargs,{gws_server,start_link,
[hi_server,#Port<0.2725>,[]]}},
{restart_type,temporary},
{shutdown,brutal_kill},
{child_type,worker}]
Will get "illegal bit size" error message.
System info: Erlang/OTP 20 [erts-9.3.2]
Hi,
I'm following this book chapter by chapter, and so far I have enjoyed it a lot!. However, now I'm struggling with the get_count
function. It seems that is not possible to call tr_server:get_count().
from telnet because this will cause a deadlock on the server side:
telnet localhost 1055
Trying ::1...
telnet: connect to address ::1: Connection refused
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
tr_server:get_count().
{timeout,{gen_server,call,[tr_server,get_count]}}
Connection closed by foreign host.
This makes sense to me, because handle_info
is performing a call to tr_server:get_count()
that performs a sync call to the server.
The thing that I don't understand is why when I'm calling get_count
from the erlang console I get the same error:
13> tr_server:start_link(1055).
{ok,<0.76.0>}
14> tr_server:get_count().
** exception exit: {timeout,{gen_server,call,[tr_server,get_count]}}
in function gen_server:call/2 (gen_server.erl, line 180)
The thing that makes more sad is the fact of why we define a get_count
function if we cannot use it at all.
It would be great if you could help to understand this issue. I'm using the exact file from the repo, so I'm not introducing any noise.
Thanks,
let {code, type} = await navigator.credentials.get({otp: {transport: ["sms"]}});
// code == "123ABC78"
// type == "otp"
run after ok, how to used the api?
I tried and failed :
3> simple_cache:insert(lee, "leeyi").
...
4> simple_cache:insert(lee, leeyi).
...
5> simple_cache:insert(lee, 33).
...
6> simple_cache:insert(lee, [leeyi,dd]).
...
9> simple_cache:insert('lee', 'dd').
** exception error: bad argument
in function ets:lookup/2
called as ets:lookup(sc_store,lee)
in call from sc_store:lookup/1 (src/sc_store.erl, line 17)
in call from simple_cache:insert/2 (src/simple_cache.erl, line 8)
The Manning book page doesn't have any visible links to an Errata page; however, that's where the two errata list links I found mentioned in the book forum redirect to.
(quote):
"The current errata list can always be found at http://www.manning.com/logan/excerpt_errata.html (or go to http://www.manning.com/logan/ and follow the link named "Errata", under Resources/Look inside)."
...from the current Book forum thread here:
https://forums.manning.com/forums/erlang-and-otp-in-action
thread:
"errata update 12/06/2010"
https://forums.manning.com/posts/list/24035.page
Manning book page
https://www.manning.com/books/erlang-and-otp-in-action
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.