Questions tagged [elixir]

Elixir is an open-source, dynamic, compiled, general purpose functional programming language. It was designed to be fully compatible with the Erlang platform and is well suited to writing fault-tolerant, distributed applications with soft real-time guarantees and the ability for hot-code-swapping.

enter image description here

Elixir is an open-source, dynamic, compiled, general purpose functional programming language. It was designed to be fully compatible with the Erlang platform and is well suited to writing fault-tolerant, distributed applications with soft real-time guarantees and the ability for hot-code-swapping.

Elixir was designed with programmer productivity as a core concept and features:

  • Concise friendly syntax
  • Simple meta-programming with Macros
  • Scale facility and process orientation
  • Awesome documentation and testing built-in
  • Polymorphism with Protocols

Learning

Packages

Popular Elixir Projects

Books

Screencasts

Community

9482 questions
5
votes
3 answers

Compilation error on file lib/phoenix_ecto/html.ex

While compiling a project which use elixir with phoenix web framework, the following compilation error occurs: ==> phoenix_ecto Compiled lib/phoenix_ecto.ex Compiled lib/phoenix_ecto/plug.ex Compiled lib/phoenix_ecto/ison.ex ==> Compilation…
Thant Shwe Aung
  • 656
  • 7
  • 13
5
votes
2 answers

Elixir : Writing Parameterized Function using & Notation

Is it possible to write parameterized function using & notation? Here is an example of parameterized function from Programming Elixir book of Dave Thomas title = fn (title) -> ( fn (name) -> title <> " " <> name end ) end mrs =…
Wand Maker
  • 18,476
  • 8
  • 53
  • 87
5
votes
2 answers

What is the best way to assert the contents of a zip archive in Elixir?

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…
Muhammad Lukman Low
  • 8,177
  • 11
  • 44
  • 54
5
votes
2 answers

Generating initials avatar with Elixir

I am working on Elixir and looking to make an avatar service. If the user doesn't have an avatar, want to make one with their initials on it, like so: I really haven't the slightest idea where to start or how to do this.
brandonhilkert
  • 4,205
  • 5
  • 25
  • 38
5
votes
2 answers

Why is this Elixir code so slow?

I'm currently very interested in learning Elixir and my typical approach of learning a new language is to build simple programs with it. So I decided to write a (very simple) grep-like program (or module) which is shown here: defmodule LineMatch do …
koehr
  • 769
  • 1
  • 8
  • 20
5
votes
2 answers

Elixir :invalid_child_spec for supervised process. Can't figure out why

I'm working on implementing a supervisor for the first time and I'm running into issues that I can't figure out from the documentation. Specifically, when I try to start my process using SlowRamp.flood I get {:error, {:invalid_child_spec, []}}. This…
kkirsche
  • 1,217
  • 2
  • 15
  • 38
5
votes
1 answer

httpc get request fails with 404 when auth headers are included

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…
Dania_es
  • 1,026
  • 1
  • 10
  • 20
5
votes
1 answer

Process.register Not Applying to Atom

I am currently trying to make an atom for a database connection to Redis. Usually I would use the name option in start of GenServer, but that is not available. In the Getting Started (Elixir 1.0.5), the example seems to show Process.register(pid,…
rockerBOO
  • 2,920
  • 2
  • 16
  • 22
5
votes
1 answer

Is it assumed that you run mix deps.compile after updating config.exs?

I've started using Elixir + Phoenix Framework and started incorporating the addict library for user registration/authentication. The docs for addict tell me to update the config.exs for the :addict app. config :addict, not_logged_in_url: "/error", …
Daisuke Shimamoto
  • 5,206
  • 6
  • 32
  • 37
5
votes
1 answer

Connect to multiple IRC servers with ExIrc (Elixir)?

I would like to connect to two servers in ExIrc with elixir, and I cannot find an easy solution to do so. I am fairly new to elixir, and all that I can see that I can do is use 'umbrellas' to run two apps and have them interface with each other? (I…
desu
  • 113
  • 7
5
votes
1 answer

Is Elixir's System.cmd blocking

I'd like to make a system that pulls github repositories automaticly using System.cmd("git",["pull", link]) Is this command blocking? If I start it concurrently in many actors will I be always able to get as many pulls as actors (or at least socket…
Krzysztof Wende
  • 3,208
  • 25
  • 38
5
votes
2 answers

Getting a sibling process in Elixir

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…
Brian Hicks
  • 6,213
  • 8
  • 51
  • 77
5
votes
2 answers

Horribly redundant Phoenix controller

I'm doing my first Phoenix application, and trying to do new/2 controller. The code I wrote is def new(conn, %{"fbid" => fbid, "latitude" => lat, "longitude" => lng, "content" => content}) do {fbid, _} = Integer.parse(fbid); {lat, _} =…
Krzysztof Wende
  • 3,208
  • 25
  • 38
5
votes
1 answer

Join two tables belong to two database in Elixir Ecto

In Elixir, with Ecto, is it possible to join two different tables (in the same host) belonging to different two databases. There are two databases called cloud and cloud_usage in this query When I execute the query, which Repo should I…
王志軍
  • 1,021
  • 1
  • 11
  • 21
5
votes
2 answers

How can I use httpotion behind the proxy?

(Edit: I cleared this issue by using HTTPoison's get! function. HTTPoison.start HTTPoison.get!("httpbin.org/get", [], [{:proxy, {"proxy.mydomain.com", 8080}}]) I'm a newbie for using elixir. I tried the sample app on httpotion as the first…
HirofumiTamori
  • 1,125
  • 2
  • 13
  • 27