Is there a site where Erlang/OTP binaries for ARM-Linux can be downloaded? www.erlang.org only has source release (and I haven't managed to cross-compile it on the initial attempts), while http://cean.process-one.net/downloads/ only has R12B.
...
I’ve begun studying Erlang and find the BEAM runtime environment fascinating. It’s commonly stated that in Erlang, processes belong to the language rather than the OS (meaning the runtime, meaning BEAM in this case). These are the lightweight, “green processes” that Erlang is getting famous for. It’s further stated (on page 5 of this pap...
I was searching through the possible work arounds for doing Binary search in Erlang and I found http://ruslanspivak.com/2007/08/15/my-erlang-binary-search/ But I was wondering if the solution in blog runs in O(lg n). Now since the recurrence for Binary search is:T(n) = T(n/2) + c which gives me an execution time of O(lg n).
Since in a ...
Is there any easy way to convert from erlang datetime notation to the now/0 notation?
Basically I need the inverse of this function:
{Date, Time} = calendar:now_to_datetime(now()).
So something like
{Megaseconds, Seconds, Microsecods} = datetime_to_now({Date, Time})
...
I am trying to have a function that ensures the table I need is already created and if not to create it. Here's the sample:
ensure_table_exists(Table, MnesiaTables, Nodes) ->
case lists:member(Table, MnesiaTables) of
true ->
throw({error, db_might_have_already_been_created});
false ->
mnesia:create_table(Table, [...
i found example of mutex in erlang
Can somebody modify it to use it with count like semaphore?
-module(mutex).
-export([start/0, stop/0]).
-export([wait/0, signal/0]).
-export([init/0]).
start() ->
register(mutex, spawn(?MODULE, init, [])).
stop() ->
mutex ! stop.
wait() ->
mutex ! {wait, self()},
receive ok ...
How does one return e.g. the first element of a tuple?
I would like to take a list of 2 element tuples and return the second element of each tuple as a new list.
...
Hello everyone,
Struggling with connecting 2 nodes running on separate boxes. Tried to
make sure that there is no usual problems with cookie synchronization,
DNS or firewall.
First, I run epmd in debug mode as recommended by Erlang docs:
epmd -d -d
Then on box #1:
erl -name [email protected] -kernel inet_dist_listen_min 6000 inet_di...
I am trying to cross-compile Erlang and running into a weird bug. The commands used are
make clean
./otp_build configure --host=arm-none-linux-gnueabi --build=i686-pc-linux-gnu
--prefix=/opt/erlang erl_xcomp_sysroot=~/sbctools/arm-2007q3 --disable-hipe
--disable-threads --disable-smp --disable-megaco-flex-scanner-lineno
--disable-m...
I want to print integer values to a file. I am able to write string values to the file, but I try to write integer value it gives an error
%this works fine
{ok, F}=file:open("bff.txt", [read,write]),
Val="howdy",
file:write(F,Val).
%this gets compiled, but results in error {error, badarg} while executing
{ok, F}=file:open("bff.txt", [r...
i have bad node (it is already not exists) in mnesia cluster data when i get
> mnesia:system_info(db_nodes)
[bad@node, ...]
how to remove it from cluster?
i do
> mnesia:del_table_copy(scheme, bad@node).
{aborted,{not_active,"All replicas on diskfull nodes are not active yet"...
what is mean? what can i do to fix it?
...
I have some big tables with disc_only_copies type.
Now I need change short node name to long but cannot do it with RAM limitation...
Can I use backup/restore database partly (table by table)?
...
Hi,
I want to spawn Erlang processes that will communicate with a C program through a Port Driver.
As spawning many of these processes can be inefficient, can I spawn one Erlang process that receives messages and queue these messages for processing with the C Program?
As this C program starts to wait for incoming jobs, will it block?
...
For logging activity of an Erlang/OTP application, do you simply use a wrapper over disk_log or some other libraries?
...
Hi,
I have a record in erlang:
-record(myrec,
{
id = 0,
price = 0,
quantity = 0
}).
I then have a list of records that I want to sort by id and price, both in descending and ascending order, where price is the first key and if two records have the same price I want to sort those by id.
How can I define a f...
I'm reading Programming Erlang by Joe Armstrong(Pragmatic Bookshelf). In name_server.erl source code on Chapter 16, Where's Dict variable from? Calling dict:new() generates Dict automatically? And, reference says that dict:new() creates dictionary. Don't I need to store it as a variable like Dict = dict:new()?
-module(name_server).
-exp...
I need to use AES encryption in my embedded Erlang application, but OpenSSL is unavailable for my target system and so the crypto library from OTP can't be built. I probably could cross-compile OpenSSL as well, but I would prefer a pure Erlang solution to remove another dependency. Does one exist?
...
Hi,
The following shell sessions shows some behavior I would like to understand:
1> A = "Some text".
"Some text"
2> "Some " ++ R = A.
"Some text"
3> R.
"text"
4> B = "Some ".
"Some "
5> B ++ L = A.
* 1: illegal pattern
Surely statements 2 and 5 are syntacticially identical? I would like to use this idiom to extract some text from a s...
I am trying to use RabbitMQ for a distributed system that would work something like:
a producer puts in a queue a JSON-formatted list of order ids
several consumers pull out of that queue, do the business logic with that order ids and the result (JSON formatted) as well is put back into another queue
from the second queue, another cons...
The include directive is usually used for a .hrl file at the top of an .erl file.
But, I would like to use include from the Erlang console directly.
I am trying to use some functions in a module. I have compiled the erl file from the console. But, the functions I want to use do not work without access to the hrl file.
Any suggestion...