Data dodania Pytanie
2018-01-30 15:01 Elixir anonymous function application in list tail returns arithmetic error »
I'm pretty new to elixir and functional programming in general and I am having a map of the form: key => [int, int] for example: 14 => [1,0]...
(3) odpowiedzi
2018-01-10 21:01 Arity issue in Elixir when passing a list to a function »
I'm new to Elixir (and functional). I'm building a toy poker game to get more familiar with the language. When I compile this code, I get the followin...
(2) odpowiedzi
2018-01-06 18:01 elixir how to map and reduce at the same time without going through the map twice »
I have list of map of orders that contain %{price, order_details} I wanted to get the total_price in that orders and I also want to return and arr...
(2) odpowiedzi
2018-01-04 18:01 Binding vs Assignment »
I've read a number of articles on the difference between assignment and binding, but it hasn't clicked yet (specifically in the context of an imperati...
(5) odpowiedzi
2017-12-28 02:12 What is the idiomatic way that functional languages like Elixir handle large chains of processes? »
Thinking of an example like a service/function that handles a customer checking out, there are many steps involved: server should (for example) check ...
(1) odpowiedzi
2017-12-19 18:12 How to setup session and CSRF protection in Plug? »
I'm currently learning Elixir by trying to make a small Plug project. Most of it goes fine except for sessions and CSRF protection. When I make GET re...
(1) odpowiedzi
2017-11-23 10:11 Writing the function "once" in Elixir »
I'm coming to Elixir from primarily a Javascript background. in JS, it's possible to write a higher order function "once" which returns a function th...
(3) odpowiedzi
2017-11-21 15:11 Elixir/Erlang: How to find the source of high CPU usage? »
My Elixir app is using about 50% of the CPU, but it really should only be using <1%. I'm trying to figure out what is causing the high CPU usage an...
(1) odpowiedzi
2017-11-13 18:11 Elixir Get Map containing maximum values of specific field »
I'm a beginner in Elixir programming language. I have an object something like this: { id: uuid, created_at: DateTime.t, updated_at: DateTime....
(2) odpowiedzi
2017-10-23 14:10 Query in Ecto embeds_many association »
Trying to experiment with Ecto embeds_many, and work great, until I need to query on some data in the embedded field. So I have something like a prod...
(1) odpowiedzi
2017-10-23 02:10 Phoenix is ignoring csrf_token for an ajax request »
I have this ajax request: //.............. var xhr = new XMLHttpRequest(); xhr.open("POST", url, true); xhr.setRequestHeader("Content-type", "applica...
(0) odpowiedzi
2017-09-26 10:09 Updating named-function variable inside anonymous function Elixir »
I'm new to Elixir and trying to solve guitar tab problem. My code: def sumTabs([head|tail], result) do nextLine = hd(tail) tail = Li...
(1) odpowiedzi
2017-09-14 14:09 PostGIS - Route matching solution »
We are building an application where I am a driver and i travel from point A to point B.On my way i can find passengers who travel in the same route. ...
(0) odpowiedzi
2017-09-13 03:09 Elixir - Handling binaries, strings, and charlists (project euler 8) »
I was trying to solve some project Euler problems with Elixir but I stumbled upon a hard one I can't solve, and I think it's largely due to the fact t...
(2) odpowiedzi
2017-07-09 09:07 How to group records in Ecto and return them as a map? »
I have "influencer_platforms" table in my DB which consists of: id | influencer_handle | name I want to query them and group by name like: %{ na...
(1) odpowiedzi
2017-06-28 10:06 Elixir: pipe more then one variable into a function »
Elixir has the possibility to pipe input into a function, which makes code more readable very often. For example something like this sentence |>...
(1) odpowiedzi
2017-06-23 11:06 Ecto Changeset add functionality for warnings »
I created a fork of ecto repository to extend Ecto.Changeset module with the ability to add warnings to the changeset. I wanted to have an add_warnin...
(0) odpowiedzi
2017-06-14 20:06 Composing data structures during reduce/fold »
I'm working on a Natural Language Processing project (and learning Elixir), and can't figure out the idiomatic way to transform my data. In order not...
(1) odpowiedzi
2017-06-07 11:06 Extending Ecto.Changeset functionality »
Ecto.Changeset module has a function add_error/4 which adds an error to the changeset. I want to achieve a functionality to have add_warnings/4 functi...
(0) odpowiedzi
2017-05-25 12:05 What frameworks / technologies to use in web applications for Real Time features? »
What do you recommend (or not) to use for Real Time features (like chats or auctions) in web applications? The most important for me is your opinion ...
(1) odpowiedzi
2017-04-28 16:04 confusing error message on constraint error »
Ecto is throwing me the following error: ** (exit) an exception was raised: ** (Ecto.ConstraintError) constraint error when attempting to insert ...
(1) odpowiedzi
2017-04-17 16:04 Binary tree maze generation in Elixir »
I have an implementation of a binary tree maze generation in Ruby, in a purely OO way. I'm trying to rewrite this in Elixir as a learning exercise but...
(1) odpowiedzi
2017-03-31 11:03 Unit testing elixir functions properly »
I'm fairly new to elixir and functional programming in general and I'm struggling to properly unit test functions that are composed of other functions...
(1) odpowiedzi
2017-03-27 22:03 How to use point column type in Ecto using PostgreSQL »
I can see that Postgrex lib supports postgreSQL's point type but I can't figure out how I can use it in model. I can specify point type for column in ...
(1) odpowiedzi
2017-03-26 21:03 Understand Function capturing through map and reduce »
I 'am beginner in Elixir language , so In the blow example iex> Enum.reduce([1, 2, 3], 0, &+/2) 6 iex> Enum.map([1, 2, 3], &(&a...
(3) odpowiedzi
2017-03-20 10:03 Elixir/ExUnit: how to test functions with system calls most elegantly? »
Situation Normally, unit tests like ExUnit should be self-contained with input, function call and desired output, so that the test can run on any sys...
(1) odpowiedzi
2017-03-13 02:03 Ecto build multiple assoc »
Currently working on Phoenix project using Ecto + Postgres. When creating a comment, as comment belongs_to both User and Article, is there a way to bu...
(2) odpowiedzi
2016-12-26 17:12 Why tuples are not enumerable in Elixir? »
I need an efficient structure for array of thousands of elements of the same type with ability to do random access. While list is most efficient on i...
(2) odpowiedzi
2016-12-25 17:12 ALL query in Ecto »
I need to translate the following SQL to Ecto Query DSL. SELECT otc.* FROM users u INNER JOIN one_time_codes otc ON u.id = otc.user_id LEFT OUTER JOI...
(1) odpowiedzi
2016-12-16 02:12 Why Enum.map is more efficient than Enum.count in Elixir? »
I've found that counting with Enum.map |> Enum.sum works much faster than Enum.count. But why is not the built-in count function efficient? Compar...
(1) odpowiedzi
2016-12-07 03:12 How can I calculate a file checksum in Elixir? »
I need to calculate the md5 sum of a file in Elixir, how can this be achieved? I would expect that something like: iex(15)> {:ok, f} = File.open "...
(3) odpowiedzi
2016-11-27 21:11 ** (CaseClauseError) no case clause matching: :eacces - Building release with MIX_ENV=prod »
I am not sure where to put that error, elixir, phoenixframework, or nodejs. I am trying to create my first release build with elxir and phoenix. Duri...
(0) odpowiedzi
2016-11-26 21:11 Performance gain on call chaining? »
Do you gain any performance, even if it's minor, by chaining function calls as shown below or is it just coding style preference? execute() -> ...
(1) odpowiedzi
2016-11-20 20:11 How to update Boolean variable inside function in elixir »
I am new to elixir, having hard time with updating the variables. Need some help. I have two Maps firstMsg = %{msg: "Hello", vt: %{"p1" => 1, "p2"...
(2) odpowiedzi
2016-10-05 01:10 Phoenix CSRF token not matching »
Trying to get ajax working the Phoenix. I get the csrf token by doing the following so i have it: <input type="hidden" id="_csrf_token" name="_cs...
(1) odpowiedzi