#elixir-lang - 20 March 2019
« Back 1 day Forward 1 day »
[02:32:18] cmk_zzz: is it possible to run elixir from command line? Like erlang escript? I don't want to create a mix project or anything just conceptually do: elixir myfile.ex[s]
[11:04:45] zakora___: Any idea on how should I populate fake data into my test database when running "mix test" in a Phoenix application?
[11:42:06] ankhers: zakora___: Generally you would insert the data that each test needs at the start of each test.
[11:43:44] zakora___: Ankhers: I see. In case I need a common set of data for many tests, can I put them in "setup_all"?
[11:46:12] ankhers: zakora___: I'm not going to lie, I don't know how ecto's sandboxes would work in a scenario like that.
[12:05:58] dysfun: what's the easiest way of pushing onto the *end* of a list? and to hell with performance
[12:08:20] dysfun: if anyone else had said that, i'd take it as an answer but i'm never sure if you're just being funn
[12:10:17] nox: The pencil icon next to the function signature may be the most useless feature I've ever seen.
[12:11:59] nox: That makes a new cell where the head is foo and 1 is the tail, that's not appending in any way.
[12:12:08] nox: The only way to have O(1) append is to write body-recursive list-building functions in a VM with TCMCO, which BEAM doesn't have.
[12:14:37] ankhers: It's not technically appending, no. But It still provides a list where the last element is the new element. You are still able to traverse the improper list to go through every element in the previous list.
[12:15:22] dysfun: i do not want a new structure, i want to retain the previous structure, just with an extra item at the end
[12:26:34] manveru: anyone know why dialyzer runs the compilation for all deps every single time i modify a file in lib?
[13:45:29] Sionide21: sms: You probably want a GenServer. Task and Agent are both just special cases of GenServer. Task is for *only* behavior and Agent is for *only* state. Since you want state *and* behavior, you don't fall into either of those special cases
[14:26:44] hypercore: guys how should i store a Product price if it varies for different currencies? e.g. $200 in USD, 350 euro in euro, 300 GBP in GBP etc
[14:31:05] hypercore: e.g. if 1 USD = 1.5 GBP, then a product might have a price of $200 USD and 100 GBP
[14:32:25] dysfun: and are you aware that the taxes chargeable may vary based on territory, not just currency?
[14:37:14] hypercore: just wondering more about how you would implement the simplified version, i.e. storing a price of n_x for a currency of n_y for a product X
[14:38:56] dysfun: the simple version requires a nother table that links to both the product and the currency
[18:05:28] benwilson512: vs a canonical price in currency X and then the other prices are X * exhange rate
[18:06:16] thurloat: benwilson512 i know some people do this so they can reach different regions more effectively with pricing. i.e. if you're paying in certain currencies, and visiting from some less-developed country the product is actually cheaper
[18:09:50] Nicd-: also you take $1 from the US users and 1 € from the EU users, it seems the norm is :P
[18:20:21] dysfun: hypercore: well you won't get all the nice stuff like enforcing foreign keys and such
[19:54:22] sms: Sionide21: Alright that's sort of what I figured. I was thinking I'd just have a Task watch over the Agent and do all the timing related stuff