erlang

FreeBSD equivalent to unixodbc-dev

丶灬走出姿态 提交于 2019-12-12 05:48:45
问题 I'm trying to compile Erlang on FreeBSD, and I want to include the odbc licenses. On Ubuntu, if you add the unixodbc-dev package, that ensures that odbc gets compiled with Erlang, however, I can't find a package that works equivalently with FreeBSD. I've tried installing the unixODBC package, and the libodbc++ with libiodbc packages. Neither of these work. I've also tried download unixodbc from unixodbc.org and installing that, to no avail. So if there's a package I can use, or if there's

adding ec2 instance to wombat oam monitoring tool

旧时模样 提交于 2019-12-12 05:47:28
问题 I am trying to add erlang nodes running in amazon EC2 to wombat oam which is again running in EC2. When i am trying to add local nodes and other nodes not running in EC2 i am able to add it to wombat. but when i am trying to add any EC2 node it gives following errors ***node is not discoverable and some tNode riak@1**.**.**.**1 should be reachable. Hints: The Erlang node may have a different cookie from the one specified. The Erlang node may have been registered addressing the host in a

Open a Python port from Erlang: no reply messages

杀马特。学长 韩版系。学妹 提交于 2019-12-12 05:16:27
问题 Based on Chapter 12 of the OTP in Action book and Cesarini's book I wrote this Erlang code: Erlang: p(Param) -> ?DBG("Starting~n", []), Cmd = "python test.py", Port = open_port({spawn,Cmd}, [stream,{line, 1024}, exit_status]), ?DBG("Opened the port: ~w~n", [Port]), Payload = term_to_binary(list_to_binary(integer_to_list(Param))), erlang:port_command(Port, Payload), ?DBG("Sent command to port: ~w~n", [Payload]), ?DBG("Ready to receive results for command: ~w~n", [Payload]), receive {Port,

Does ejabberd support DB Level clustering on NOSQL RIak?

对着背影说爱祢 提交于 2019-12-12 04:59:20
问题 I am working on chat app. I have two ejabberd nodes node1@domain.com and node2@domain.com if i will do master-master clustering between nodes and each nodes have their own riak server if node1 riak server goes down then how node1 transfer request to node2? Please suggest me solution. 回答1: This is not how it is supposed to work. If you deploy with Riak, you are supposed to have a dedicated Riak infrastructure. Moreover, having only two Riak nodes does not make sense: You need at least 5 Riak

How to record sound in Erlang

﹥>﹥吖頭↗ 提交于 2019-12-12 04:34:25
问题 I would like to build a very simple streaming application in Erlang, it will work something like team speak. Person A, B and C are all having a client application which connects to a server application. The server application makes sure it can distribute the audio message from Person A to Person B and C. So the concept is simple and many things can already be found on the internet (like how streaming works in Erlang). What I can't seem to find is how to record audio in Erlang. There are

Erlang receive is not receiving

别说谁变了你拦得住时间么 提交于 2019-12-12 04:33:30
问题 I Have a storage actor that should get new data from collector actor every second. But for some reason the loop is not collecting. Its like the loop is not working at all. start(Server)-> spawn(storage,init,[Server]). init(Server)-> Pid = getWeather:start(self()), loop(#hourlyHistory{measurements=[]},#cityHistory{measurements = []},Server, Pid). loop(Hourly = #hourlyHistory{measurements = Hh}, City = #cityHistory{measurements = Ch}, Server, Collector)-> receive {hourly, {Time, Data}} ->

Erlang shell stopped loading my modules

坚强是说给别人听的谎言 提交于 2019-12-12 03:46:38
问题 This was working fine last week. I would open cd myprojectdir erl (erlang shell). c(room). {ok, R} = room:go(). then I could use gen_server to send messages to R, interacting with my room module. I started in a cowboy routing branch. I was seeing things work fine, when I looked at it today I was getting compile errors. So I rolled back to my master branch. Still got errors in the shell, even rolling back a few commits, hm. When I try to call room:go(), the other modules are printed as undef .

Combining an Erlang OTP application with other dependencies into a single unit application

北城以北 提交于 2019-12-12 03:32:35
问题 How to integrate an already created erlang OTP application with its dependencies into a single unit so that when the unit is started everything(processes) get started behind the scene? 回答1: You specify in the .app file which other applications your application depends on, like in this example. Then you build a release using reltool:create_target/2 like in this example. That function takes the definition of a release as a parameter which looks something like in this file. When Erlang VM boots

Erlang trying to evaluate a string

坚强是说给别人听的谎言 提交于 2019-12-12 02:48:37
问题 I'm trying to dynamically evalutate Erlang terms Start up Erlang basho-catah% erl Erlang R16B03 (erts-5.10.4) [source] [64-bit] [smp:4:4] [async-threads:10] [hipe] [kernel-poll:false] Eshell V5.10.4 (abort with ^G) Create a term 1> {a,[b,c,d]}. {a,[b,c,d]} Try to scan in the same term 2> {ok, Tokens, _ } = erl_scan:string("{a,[b,c,d]}"). {ok,[{'{',1}, {atom,1,a}, {',',1}, {'[',1}, {atom,1,b}, {',',1}, {atom,1,c}, {',',1}, {atom,1,d}, {']',1}, {'}',1}], 1} 3> Tokens. [{'{',1}, {atom,1,a}, {','