Erlang is a general-purpose, garbage-collected programming language and runtime environment, with built-in support for concurrency, distribution and fault tolerance.
Erlang is a general-purpose functional programming language and runtime environment. It has built-in support for concurrency, distribution and fault tolerance. Erlang is used in several large telecommunication systems from Ericsson. Erlang is open source and available for download on GitHub.
Currently what I am doing:
Testing function by letting it zip a file/directory. Assert it exists.
Using :zip.t and :zip.tt let it list down the contents of the zip folder to see if it's what I am expecting.
Somehow I think I am missing…
I'm using Erlang's httpc to make a get request with parameters and with a basic auth header. When used without the header in httpc/1, like this:
url = String.to_char_list("https://endpoint.com/endpoint?param=foo")
:httpc.request(url)
I get the…
I'm trying to do something like this:
-module(count).
-export([main/0]).
sum(X, Sum) -> X + Sum.
main() ->
lists:foldl(sum, 0, [1,2,3,4,5]).
but see a warning and code fails:
function sum/2 is unused
How to fix the code?
NB: this is…
I tried to run a simple app in a distributed manner to test failover-takeover features but failed.
What I want to:
The application is myapp_api with a rest api, it has myapp application as a dependency. I want to start myapp_api on 3 nodes, I want…
I've been looking into how I could embed languages (let's use Lua as an example) in Erlang. This of course isn't a new idea and there are many libraries out there that can do this. However I was wondering if it was possible to start a Genserver with…
I have an Elixir/Erlang process tree:
parent (Supervisor)
├── child1 (GenServer)
└── child2 (GenServer)
child1 (a DB client) has information that child2 needs to use. What's a good way to pass a reference from the Supervisor process to child2 so…
I recently ran into a bug where an entire Erlang application died, yielding a log message that looked like this:
=INFO REPORT==== 11-Jun-2010::11:07:25 ===
application: myapp
exited: shutdown
type: temporary
I have no idea what…
What's the best way to convert a list such as [[1,2,3],[a,b,c],[4,5,6]] to a list of tuples like this:
[{1,a,4},{2,b,5},{3,c,6}]
where tuple N is composed of the Nth element from each of the three sublists? Should I use a tail recursive function, a…
Erlang Shen or Erlang is a Chinese deity who supposedly regulates floods, Erlang a computer language ideal for large volume applications. Is this just some kind of weird coincidence?
I have an Android client working in tandem with ejabberd XMPP server.
Observations:
Scenario 1: When I swipe-right the app (kill the app), the user goes offline on the server immediately. Its status is changed to offline at that very…
I'm new to erlang, and in erlang shell, i typed below expression:
A= <<"abc">>.
B="abc".
I want to know the differences between A and B, and their general usage,
Also why below expression is not correct:
C=<>.
I'm looking for ways to speed up the "tight-loop" in my elixir program.
Enum.reduce( list, 0, fn ({c,v},acc) -> v*elem(tuple_array,c) + acc end )
It's simply running through a list of tuples and for each it's doing:
a tuple lookup (c is an…
Is there a source, which I could use to learn some of the most used and popular practices regarding Actor-/Agent-oriented programming? My primary concern is about parallelism and distribution limited to the mentioned scheme - Actors, message…
Consider the code:
f(command1, UserId) ->
case is_registered(UserId) of
true ->
%% do command1
ok;
false ->
not_registered
end;
f(command2, UserId) ->
case is_registered(UserId) of
…