erl

Is there a way to print configuration parameters?

ぐ巨炮叔叔 提交于 2021-02-10 18:33:24
问题 I have configured two parameters. inet_dist_listen_min = X inet_dist_listen_max = Y in the config file and I copied it the config file in the place it should be. Is there a way to know that either RabbitMQ or ERL receive the right parameter? Thanks. Note: Eventually I did it using a sniffer (saw the TCP port in the packet) and knew it received it, but is there a quicker way? 回答1: for rabbitmq rabbitmqctl environment for erlang env params rabbitmqctl eval 'application:get_all_env(kernel).' and

Is there a way to print configuration parameters?

冷暖自知 提交于 2021-02-10 18:28:10
问题 I have configured two parameters. inet_dist_listen_min = X inet_dist_listen_max = Y in the config file and I copied it the config file in the place it should be. Is there a way to know that either RabbitMQ or ERL receive the right parameter? Thanks. Note: Eventually I did it using a sniffer (saw the TCP port in the packet) and knew it received it, but is there a quicker way? 回答1: for rabbitmq rabbitmqctl environment for erlang env params rabbitmqctl eval 'application:get_all_env(kernel).' and

Why do I get syntax error before: '{'?

故事扮演 提交于 2020-01-14 13:55:43
问题 While playing with Erlang getting started section I have met bizarre syntax error on trivial use case (simple map initialization). Are there any suggestion why does that happen? 1> #{ "key" => 42}. 1: syntax error before: '{' Details: Erlang R16B03 (erts-5.10.4), Eshell V5.10.4. 回答1: Because maps were introduced in Erlang 17. You have to upgrade your installation or do not use maps. 来源: https://stackoverflow.com/questions/31589190/why-do-i-get-syntax-error-before

How to use Stacktrace to return Error Line Number in vb.net

扶醉桌前 提交于 2019-12-31 22:21:12
问题 I am trying to create some sort of error catching method that will return the error line number. We have an abort email that is sent out when a process aborts that gives us the err.number and err.description but I would like to know where is actually errors out. I know you can do the following: 1: code here 2: code here 3: code here etc. and use ERL to get the number but it would be tedious to type each line out like that. Is there either a way to automatically do this or would it be easier

Adding to an existing value in Erlang

末鹿安然 提交于 2019-12-31 04:07:23
问题 I am attempting to create a function that stores a number into a record and then adds value X to that number every time the function runs. Value: 5 Run Function (Add One): 1 Value should be: 6 Run Function (Add One): 1 value should be 7 I tried to use a record: -record(adder,{value :: integer()}). ---function Number = random:uniform(6), L=#added{value = Number + #added.value}. This does not work as it resets the value every time. Any suggestions? 回答1: Take a look at this code: -module(test).

getting {badarith,[{erlang,'+',[error,0],[]}, while performing arithmetic operation in TSUNG using Erlang snippet

三世轮回 提交于 2019-12-25 10:00:27
问题 I have wriiten a arithmetic snippet using TSUNG-Erlang function but unable to get through it successfully ; getting following error in my TSUNG controller's log , TSUNG-Erlang Snippet, <setdynvars sourcetype="file" fileid="NBILM_testUsers" delimiter=";" order="iter"> <var name="minnum"/> <var name="maxnum"/> </setdynvars> <setdynvars sourcetype="eval" code='fun({Pid,DynVars})-> {ok,Maxfound}=ts_dynvars:lookup(maxnum,DynVars), Maxstr = lists:flatten(io_lib:format("~p",[Maxfound])), {MAX, _} =

getting {badarith,[{erlang,'+',[error,0],[]}, while performing arithmetic operation in TSUNG using Erlang snippet

别说谁变了你拦得住时间么 提交于 2019-12-25 10:00:21
问题 I have wriiten a arithmetic snippet using TSUNG-Erlang function but unable to get through it successfully ; getting following error in my TSUNG controller's log , TSUNG-Erlang Snippet, <setdynvars sourcetype="file" fileid="NBILM_testUsers" delimiter=";" order="iter"> <var name="minnum"/> <var name="maxnum"/> </setdynvars> <setdynvars sourcetype="eval" code='fun({Pid,DynVars})-> {ok,Maxfound}=ts_dynvars:lookup(maxnum,DynVars), Maxstr = lists:flatten(io_lib:format("~p",[Maxfound])), {MAX, _} =

erl with centos “Failed to create main carrier for ll_alloc”

喜夏-厌秋 提交于 2019-12-25 03:36:15
问题 i am having a centos vps. i have installed erlang by the command rpm -Uvh erlang-17.4-1.el6.x86_64.rpm Now whenever i try to run my rabbitmq-server. or i just issue erl command then i get this error. Failed to create main carrier for ll_alloc Aborted is it some memory issue erlang is unable to get free memory or what? here are memory stats of the machine sudo cat /proc/meminfo MemTotal: 4194304 kB MemFree: 104520 kB Cached: 2718800 kB Buffers: 0 kB Active: 1729508 kB Inactive: 2170684 kB

Erlang: invoking erl -eval from command line never exits

旧巷老猫 提交于 2019-12-25 01:56:02
问题 I have a simple Erlang command that I want to invoke via erl -eval (to compile erlydtl template, as described on erlydtl page). When I do it interactively from shell everything works fine and the command exits immediately: erl -pa ebin deps\erlydtl\ebin Eshell V5.9.3.1 (abort with ^G) 1> erlydtl:compile('templates/tictactoe.dtl',tictactoe_dtl,[{out_dir,'ebin'}]). ok But when I try to do it via erl -eval (I want to run this from .bat file): erl -pa ebin deps\erlydtl\ebin -noshell -eval erlydtl

Erlang case statement

只谈情不闲聊 提交于 2019-12-24 04:22:28
问题 I have the following Erlang code and it is giving the warning as follows, when i try to compile it, but that make sense. function need two arguments, but i need to patten match "everything else" rather x, y or z. -module(crop). -export([fall_velocity/2]). fall_velocity(P, D) when D >= 0 -> case P of x -> math:sqrt(2 * 9.8 * D); y -> math:sqrt(2 * 1.6 * D); z -> math:sqrt(2 * 3.71 * D); (_)-> io:format("no match:~p~n") end. crop.erl:9: Warning: wrong number of arguments in format call. I was