« Back to channel list

#elixir-lang - 16 April 2019

« Back 1 day Forward 1 day »
[00:01:10] Cthalupa: has joined #elixir-lang
[00:02:44] gvaughn_: has joined #elixir-lang
[00:25:41] orbyt_: has joined #elixir-lang
[00:35:48] jeffro_: has joined #elixir-lang
[01:06:28] carldd: has joined #elixir-lang
[01:11:15] drincruz: has joined #elixir-lang
[01:17:03] gvaughn: has joined #elixir-lang
[01:17:05] lauromoura: has joined #elixir-lang
[01:23:21] jeffro_: has joined #elixir-lang
[01:33:27] jimmyrcom: has joined #elixir-lang
[01:34:15] Saukk: has joined #elixir-lang
[01:40:42] ariedler: has joined #elixir-lang
[01:41:36] iamvery: has joined #elixir-lang
[01:57:18] jeffro_: has joined #elixir-lang
[01:58:02] mim7: has joined #elixir-lang
[02:00:36] tomterl: has joined #elixir-lang
[03:17:30] sevenseacat: has joined #elixir-lang
[03:20:52] carldd: has joined #elixir-lang
[03:43:15] drincruz: has joined #elixir-lang
[03:49:24] mim7: has joined #elixir-lang
[03:59:46] pera: has joined #elixir-lang
[04:02:23] tnez: has joined #elixir-lang
[04:05:30] mbuf: has joined #elixir-lang
[04:10:22] voltone: has joined #elixir-lang
[04:58:11] cjk101010: has joined #elixir-lang
[04:59:28] voltone: has joined #elixir-lang
[05:12:38] ur5us: has joined #elixir-lang
[05:29:26] zakora: has joined #elixir-lang
[05:40:52] mim7: has joined #elixir-lang
[05:43:11] DTZUZO: has joined #elixir-lang
[05:57:10] kapil____: has joined #elixir-lang
[06:03:00] proteusguy: has joined #elixir-lang
[06:14:11] serafeim: has joined #elixir-lang
[06:14:18] serafeim: good morning
[06:15:26] Nicd-: good night
[06:16:44] Nicd-: just kidding it's morning here too
[06:27:59] serafeim: concerning the phoenix framework: what is the most popular solution for authorization and authentication ? i.e user management and permissions ?
[06:31:24] serafeim: also is there a #phoenix channel I could ask ?
[06:31:32] Nicd-: not on IRC
[06:32:32] Nicd-: I don't know what is the most popular auth library but I've heard the names Guardian and Pow being discussed oftne
[06:34:04] serafeim: hm ok Nicd- I'll check 'em out
[06:36:16] danmcclain_: has joined #elixir-lang
[06:36:58] serafeim: hm Guardian is a token based authentication library for use with Elixir applications. I don't think I need token based auth... i was thinking more of good-old session auth
[06:39:03] DarkSeid: has joined #elixir-lang
[06:40:02] serafeim: ok pow has Session based authorization; but I don't think that it supports a permission system
[06:40:18] manveru: has joined #elixir-lang
[06:40:26] serafeim: also it is funny that guardian has 10x more stars in github than pow
[06:41:06] sevenseacat: session auth is just token auth, with the token stored in the session, no?
[06:41:10] profit_: has joined #elixir-lang
[06:41:33] serafeim: sevenseacat: probably
[06:44:55] whatyouhide: has joined #elixir-lang
[06:45:21] bcavileer: has joined #elixir-lang
[06:45:56] talklittle: has joined #elixir-lang
[06:46:15] BBHoss: has joined #elixir-lang
[06:52:16] BBHoss: has joined #elixir-lang
[06:52:18] whatyouhide: has joined #elixir-lang
[06:52:20] profit_: has joined #elixir-lang
[06:53:26] rfv: has joined #elixir-lang
[06:53:49] manveru: has joined #elixir-lang
[06:54:32] jameshaydon: has joined #elixir-lang
[06:54:38] CARAM_______: has joined #elixir-lang
[06:54:46] edw: has joined #elixir-lang
[06:55:00] joedevivo: has joined #elixir-lang
[06:55:09] danmcclain_: has joined #elixir-lang
[06:55:22] OvermindDL1: has joined #elixir-lang
[06:55:30] ahills: has joined #elixir-lang
[06:56:38] pmbauer: has joined #elixir-lang
[06:56:38] peel: has joined #elixir-lang
[06:56:41] avdi: has joined #elixir-lang
[06:56:54] alxndr: has joined #elixir-lang
[06:57:27] hansihe_: has joined #elixir-lang
[06:57:36] adamkittelson_: has joined #elixir-lang
[06:58:23] billstclair: has joined #elixir-lang
[06:58:50] voltone: has joined #elixir-lang
[06:58:55] metalrain: has joined #elixir-lang
[06:59:27] chazlever: has joined #elixir-lang
[07:01:29] OliverMT: has joined #elixir-lang
[07:02:47] ericmj: has joined #elixir-lang
[07:02:49] msch: has joined #elixir-lang
[07:04:23] Phylock: has joined #elixir-lang
[07:09:34] CornishPasty: serafeim: because pow is an authentication lib?
[07:09:44] CornishPasty: Why would it have authorisation
[07:25:15] lexmag: has joined #elixir-lang
[07:27:33] serafeim: agreed; is there a recommended lib for authorization ?
[07:27:46] serafeim: or it should be implemented by hand
[07:31:11] mim7: has joined #elixir-lang
[07:32:41] mdbm: has joined #elixir-lang
[07:33:00] serafeim: i have to confess i am a long-time django developer so am i a little spoiled ...
[07:36:18] OliverMT: serafeim: look at uberauth or guardian
[07:36:23] OliverMT: Its mote turnkey
[07:37:12] serafeim: thanks OliverMT i've checked guardian but it seems to be SPA oriented. I care only about vanilla html apps
[07:37:25] mdbm: structs look like objects man
[07:44:17] Nicd-: mdbm: they don't have methods
[07:46:40] mdbm: Nicd-, look like static methods inside the struct, so you are right, no instance methods as in oop. as to my understanbding right now
[07:47:00] Nicd-: structs don't have any kind of methods
[07:47:14] Nicd-: the same module can have functions
[07:47:46] mdbm: Nicd-, sorry, but isn't this a struct with methods? https://pastebin.com/raw/Ub8e9YSN
[07:47:50] mdbm: sorry for indentation
[07:48:07] Nicd-: those are just functions that happen to be in the same module
[07:48:30] mdbm: Nicd-, and that module is called a struct, right?
[07:48:53] Nicd-: usually you don't call them methods in Elixir as that is an OO term
[07:51:46] drincruz: has joined #elixir-lang
[07:59:44] PragTob: has joined #elixir-lang
[08:05:01] OvermindDL1_: has joined #elixir-lang
[08:05:06] jameshaydon: has joined #elixir-lang
[08:05:11] edw: has joined #elixir-lang
[08:05:30] ahills: has joined #elixir-lang
[08:08:05] nox: mdbm: There is no notion of a "receiver" in Elixir function calls, AFAIR, so how could there be methods?
[08:08:36] mdbm: nox, that's why I compared them to static methods in oop and not instance methods
[08:10:00] nox: Static methods, in general, don't have an argument of the type they are on.
[08:23:29] mdbm: nox, do you know why get_in/2 is in the Kernel and not in Map?
[08:28:09] Nicd-: because it can be used on things other than maps
[08:28:26] mdbm: Nicd-, other than Map and structs ?
[08:30:48] Nicd-: for example keyword lists
[08:30:55] Nicd-: but specifically anything that implements https://hexdocs.pm/elixir/Access.html
[08:31:27] kyrylo: has joined #elixir-lang
[08:31:29] mdbm: Nicd-, I was just looking at Access:) these functions get_in, put_in, ... could not have been in Access module?
[08:31:47] Nicd-: don't know why they are not there
[08:41:30] wonko7: has joined #elixir-lang
[08:57:54] lomex: has joined #elixir-lang
[09:04:11] mdbm: ok I'm stuck here: all = fn :get, data, next -> Enum.map(data, next) end get_in(users, [all, :age])
[09:04:25] mdbm: I really can't understand this: Enum.map(data, next)
[09:04:34] mdbm: even though I know how Enum.map works
[09:04:53] mdbm: apply the function "next" (what does it do exactly??) to each element of my list
[09:09:25] blahdodo: has joined #elixir-lang
[09:16:33] talklittle: has joined #elixir-lang
[09:17:42] talklittle: has joined #elixir-lang
[09:26:45] lexmag: has joined #elixir-lang
[09:54:46] lexmag: has joined #elixir-lang
[09:56:51] mim7: has joined #elixir-lang
[10:04:29] kyrylo_: has joined #elixir-lang
[10:06:31] sevenseacat: you pass the function in, so it does whatever you define it to do
[10:06:57] sevenseacat: eg. Enum.map([1, 2, 3], fn x -> x + 1 end)
[10:07:22] mdbm: sevenseacat, yeah I know how the Enum.map works, but next is not my function, it is provided by get_in
[10:07:41] mdbm: and I don't understand what it does to each element
[10:08:02] sevenseacat: sorry, what? what code are you looking at?
[10:08:53] Nicd-: Kernel.get_in/2
[10:09:01] Nicd-: when anon function is used as key
[10:09:06] mdbm: https://pastebin.com/raw/ZkRG6WQS
[10:11:20] sevenseacat: well lets look at the source https://github.com/elixir-lang/elixir/blob/v1.8.1/lib/elixir/lib/kernel.ex#L2177
[10:13:58] mdbm: sevenseacat, next is a function which would just return it's argument? like fn a -> a
[10:14:58] mdbm: oops sorry, not correct
[10:15:33] netrino: has joined #elixir-lang
[10:15:43] mdbm: &get_in(&1, t)
[10:19:26] mdbm: I think I get it now by looking at the source
[10:25:55] lomex: has joined #elixir-lang
[10:28:41] voltone: has joined #elixir-lang
[10:35:51] tomterl: has joined #elixir-lang
[10:40:35] griffinbyatt: has joined #elixir-lang
[10:46:59] neena: has joined #elixir-lang
[10:52:16] voltone: has joined #elixir-lang
[10:54:25] zigpaw: has joined #elixir-lang
[10:59:00] blahdodo: has joined #elixir-lang
[11:05:10] serafeim: has joined #elixir-lang
[11:08:25] mdbm_: has joined #elixir-lang
[11:10:20] serafeim: has joined #elixir-lang
[11:10:26] mdbm__: has joined #elixir-lang
[11:11:48] lexmag: has joined #elixir-lang
[11:30:45] mdbm__: has joined #elixir-lang
[11:31:03] zigpaw: has joined #elixir-lang
[11:42:37] mdbm__: in "Programming Elixir" book I can see the following line: hands = deck |> shuffle |> chunk(13)
[11:42:49] mdbm__: but can't find a "chunk" function in Enum
[11:43:39] mdbm_: has joined #elixir-lang
[11:45:22] serafeim: mdbm__: would you recommend that book? is it better than the learn functional programming with elixir ?
[11:45:28] serafeim: i remember that you were reading that also
[11:45:53] mdbm_: serafeim, no it's my first book sorry. but it seems *the* reference when suggesting books
[11:46:18] mdbm_: serafeim, I keep disconnecting:( did anyone answer my question and I would have missed it?
[11:47:25] beatpanic: has joined #elixir-lang
[11:47:46] thecatwasnot: has joined #elixir-lang
[11:47:47] lexmag: has joined #elixir-lang
[11:47:48] Nicd-: mdbm_: it was removed in Elixir 1.5
[11:47:54] mdbm_: Nicd-, thank you
[11:47:57] Nicd-: https://github.com/elixir-lang/elixir/releases/tag/v1.5.0
[11:48:08] Nicd-: > [Enum] Add Enum.chunk_every/2 and Enum.chunk_every/4 with a more explicit API than Enum.chunk/2 and Enum.chunk/4
[11:48:30] mdbm_: Nicd-, the book is Programming Elixir >= 1.6, so yeah, little mistake there
[11:48:49] Nicd-: you should contact the book authors
[11:48:57] Nicd-: and check if it's listed in errata first
[11:49:25] benwilson512: mdbm_: the function still exists btw, it's just deprecated
[11:49:53] benwilson512: mdbm_: in favor of chunk_every
[11:50:24] Nicd-: why is it not in the documentation?
[11:50:32] mdbm_: in the book there is the following: Enum.sort ["there", "was", "a", "crooked", "man"], &(String.length(&1) <= String.length(&2))
[11:50:35] mdbm_: and it says:
[11:50:39] mdbm_: "It’s important to use <= and not just < if you want the sort to be stable."
[11:50:45] mdbm_: without further explanation
[11:50:53] benwilson512: Nicd-: deprecated functions are removed from the docs
[11:50:58] mdbm_: would anyone understand why it's important to use <= to have a "stable" sort?
[11:51:45] Nicd-: benwilson512: but didn't we just get a "deprecated" tag to deal with this? https://hexdocs.pm/elixir/master/writing-documentation.html#documentation-metadata
[11:52:35] Nicd-: I find it confusing that deprecated functions are deleted entirely from docs
[11:52:47] benwilson512: Nicd-: it was deprecated 4 versions ago
[11:54:20] benwilson512: perhaps they should retroactively add those tags to previously deprecated elixir functions, but that stuff didn't exist during the original deprecation
[11:54:29] benwilson512: mdbm_: to your later question
[11:54:35] Nicd-[m]: has joined #elixir-lang
[11:54:36] Anders[m]: has joined #elixir-lang
[11:54:36] MatrixTravelerb4: has joined #elixir-lang
[11:54:36] Ablu: has joined #elixir-lang
[11:54:36] dyce[m]: has joined #elixir-lang
[11:54:36] Hawkheart[m]: has joined #elixir-lang
[11:54:37] wilo[m]: has joined #elixir-lang
[11:54:37] tcit: has joined #elixir-lang
[11:54:37] Guest50536: has joined #elixir-lang
[11:54:43] MartinFrost[m]: has joined #elixir-lang
[11:54:43] kamidev[m]: has joined #elixir-lang
[11:54:44] ejpcmac: has joined #elixir-lang
[11:54:44] Bla[m]: has joined #elixir-lang
[11:54:45] mindflayer[m]: has joined #elixir-lang
[11:54:45] chronostamp: has joined #elixir-lang
[11:54:47] hindenbug[m]: has joined #elixir-lang
[11:54:47] borislehashoir[m: has joined #elixir-lang
[11:54:48] Phillipp[m]: has joined #elixir-lang
[11:55:00] mdbm_: benwilson512, I think I got it, it's about preserving order
[11:55:01] benwilson512: mdbm_: an explanation of stable sorting would probably have been helpful, although somewhat beyond the scope of the book.
[11:55:08] minibikini1: has joined #elixir-lang
[11:55:18] krigare[m]: has joined #elixir-lang
[11:55:19] nolan_d: has joined #elixir-lang
[11:55:20] uhoreg: has joined #elixir-lang
[11:55:20] mdbm_: benwilson512, they mention it in the docs for sort()
[11:55:40] rassilon[m]: has joined #elixir-lang
[11:55:46] benwilson512: mdbm_: sure, I mean some doc functions mention O() notation too
[11:56:59] benwilson512: I'm sure a PR would be welcome to add something like "stable (order preserving)" or similar
[11:57:56] mdbm_: benwilson512, for the book?
[11:58:01] mdbm_: in the docs it says:
[11:58:02] mdbm_: If the function does not return true for equal values, the sorting is not stable and the order of equal terms may be shuffled.
[11:58:08] mdbm_: so it mentions really about the order
[11:58:25] benwilson512: mdbm_: ah, I missunderstood what you mean by "they mention it in the docs for sort"
[11:58:43] mdbm_: misunderstood*
[11:59:51] benwilson512: ACTION is out
[12:01:26] lexmag: has joined #elixir-lang
[12:04:36] mdbm_: gtg for food
[12:04:39] mdbm_: thanks for help:)
[12:17:13] tnez: has joined #elixir-lang
[12:21:41] zakora: has joined #elixir-lang
[12:33:03] lexmag: has joined #elixir-lang
[12:33:08] drincruz: has joined #elixir-lang
[12:40:57] krbtgt: has left #elixir-lang: ()
[12:50:29] fmcgeough: has joined #elixir-lang
[13:02:08] either|or: has joined #elixir-lang
[13:04:48] is0x3F: has joined #elixir-lang
[13:05:20] tkarstens[m]: has joined #elixir-lang
[13:07:53] LordPtolemy[m]: has joined #elixir-lang
[13:12:15] samrose: has joined #elixir-lang
[13:13:15] lexmag: has joined #elixir-lang
[13:20:22] __charly__: has joined #elixir-lang
[13:25:04] hypercore: has joined #elixir-lang
[13:28:12] jeffro_: has joined #elixir-lang
[13:28:24] PragTob: has joined #elixir-lang
[13:31:15] duaneb: has joined #elixir-lang
[13:31:21] hypercore: is it advised to use Map.get/3 to get values from assigns?
[13:33:40] hypercore: or better question, is there a way i can create a function i can use in my controllers which takes a conn, and if current_user is defined in assigns it returns current_user.id, if current_user is not defined it returns null?
[13:34:17] Nicd-: try Map.get :)
[13:35:16] benwilson512: hypercore: you can also do
[13:35:51] hypercore: Nicd-: problem is i need to test if assigns.current_user exists and return current_user.id, so i can't use Map.get can i?
[13:35:54] benwilson512: https://www.irccloud.com/pastebin/BqoZU1rU/
[13:36:15] benwilson512: hypercore: you can use Map.get but you need to use it twice
[13:36:24] hypercore: benwilson512: would i put that in a helper function?
[13:36:30] benwilson512: hypercore: it is a helper function
[13:36:32] __charly__: has joined #elixir-lang
[13:36:57] hypercore: benwilson512: sorry, meant in a helper function module, e.g. /lib/helpers.ex
[13:37:09] benwilson512: hypercore: sure
[13:37:26] Nicd-: just make sure it doesn't grow too big
[13:37:39] benwilson512: yeah that one is definitely web related
[13:37:44] benwilson512: so I'd at least have it in a web oriented helper module
[13:37:55] benwilson512: finally, you can also implement the access behavior in your modules
[13:38:04] benwilson512: and then you can just do `id = conn.assigns[:current_user][:id]`
[13:38:08] benwilson512: lots of options!
[13:38:44] hypercore: ok cool, think ill go with the helper module option, as i want to use the least amount of code to return user.id/nil. unless there's another option which requires even less code in my controllers
[13:39:28] hypercore: (i have a lot of functions in my context modules that require a user_id)
[13:44:27] benwilson512: hypercore: just as long as you aren't passing the conn into your context modules
[13:46:13] hypercore: benwilson512: yeah im just doing conn |> get_user_id |> Context.some_query
[13:58:42] edw: Is there an idiomatic way to `for x <- 0..n-1, do: etc(x)` where n=1 produces an empty enumerable?
[13:59:27] edw: Er, where n=0 produces an empty enumerable. Sorry about that.
[14:01:18] edw: The best I've come up with so far is `for x <- (Stream.iterate(0, &(&1 + 1)) |> Enum.take(n)), do: etc(x)`
[14:05:32] benwilson512: edw: you can also do a Stream.drop(0..n-1, 1)
[14:06:56] edw: benwilson512: Thanks. Yes, that's less bad.
[14:11:08] Vircung: has joined #elixir-lang
[14:12:48] edw: Kind of mind blowing that most of my projects will eventually need this one-liner: `defmodule Util, do: def span(base \\ 0, count), do: Stream.drop(base..base+count-1, 1)`.
[14:15:36] nox: Might be a code smell.
[14:16:06] benwilson512: edw: how often are you iterating spans?
[14:16:15] benwilson512: edw: or rather, for what purpose?
[14:16:37] edw: A good one.
[14:16:49] edw: Less cheekily…
[14:17:08] nox: I don't understand the function name, tbh.
[14:17:41] edw: nox: Because range is taken. The return value is a span.
[14:17:52] nox: Isn't the return value a stream?
[14:18:09] edw: But aren't those just bits?
[14:19:02] gvaughn: has joined #elixir-lang
[14:19:03] edw: benwilson512: I am working with tabular data with named columns, and I allow callers to retrieve columns by name. I maintain a list of column names and I need to map them to array indices.
[14:19:58] nox: I would store my column names in a tuple.
[14:20:43] edw: nox, I am.
[14:21:30] nox: Ah. You said list, which confused me.
[14:22:11] edw: I was speaking loosely. A sequence.
[14:22:14] nox: I now understand what a span is supposed to be, the name confused me because spans are also a thing in Rust land and they are not inclusive, just like ranges.
[14:22:57] nox: josevalim: Did you ever consider having inclusive ranges in the language, with a different operator than ..?
[14:22:58] edw: Another issue: if no labels are given, they are synthesized. If there happen to be zero columns, 0..n-1 goes boom.
[14:23:27] edw: nox, there is a ton of bikeshedding on Github from 2013.
[14:23:46] edw: https://github.com/elixir-lang/elixir/issues/1038
[14:24:01] edw: https://github.com/elixir-lang/elixir/issues/1039
[14:24:02] nox: Ah never mind, the issue is that the ranges in Elixir *are* inclusive. Disregard me.
[14:24:19] edw: I was praying that 0..<n would work, but no.
[14:24:30] nox: Fun, I almost never need inclusive ranges, I'm surprised that's the default here.
[14:24:59] hypercore: how can i add a "virtual column" to a query, e.g. adding "num_articles" key to all "author" rows
[14:30:47] beatpanic: has joined #elixir-lang
[14:31:13] lomex: has joined #elixir-lang
[14:37:19] Anders[m]: has joined #elixir-lang
[14:37:19] Nicd-[m]: has joined #elixir-lang
[14:37:19] dyce[m]: has joined #elixir-lang
[14:37:19] Ablu: has joined #elixir-lang
[14:37:20] MatrixTravelerb4: has joined #elixir-lang
[14:37:20] Guest81219: has joined #elixir-lang
[14:37:21] tcit: has joined #elixir-lang
[14:37:21] Hawkheart[m]: has joined #elixir-lang
[14:37:21] ejpcmac: has joined #elixir-lang
[14:37:21] wilo[m]: has joined #elixir-lang
[14:37:21] uhoreg: has joined #elixir-lang
[14:37:26] is0x3F: has joined #elixir-lang
[14:37:26] borislehashoir[m: has joined #elixir-lang
[14:37:26] mindflayer[m]: has joined #elixir-lang
[14:37:26] Phillipp[m]: has joined #elixir-lang
[14:37:27] nolan_d: has joined #elixir-lang
[14:37:27] chronostamp: has joined #elixir-lang
[14:37:27] minibikini1: has joined #elixir-lang
[14:37:27] krigare[m]: has joined #elixir-lang
[14:37:28] hindenbug[m]: has joined #elixir-lang
[14:37:28] MartinFrost[m]: has joined #elixir-lang
[14:37:28] kamidev[m]: has joined #elixir-lang
[14:37:28] tkarstens[m]: has joined #elixir-lang
[14:37:28] rassilon[m]: has joined #elixir-lang
[14:37:28] Bla[m]: has joined #elixir-lang
[14:37:29] LordPtolemy[m]: has joined #elixir-lang
[14:38:00] edw: benwilson512: For your solution to work, it's more complicated: one needs to do something like this: def exc_range(base \\ 0, count), do: Stream.drop(base-1..base+count-1, 1) |> Enum.to_list()
[14:38:28] edw: Again, crazy.
[14:41:40] jesopo: god i hate matrix
[14:42:37] lauromoura: has joined #elixir-lang
[14:43:14] hypercore: figured it out, added a virtual field and did a select_merge on a left join. Only problem now is i can't order by this value, is it says the column does not exist
[14:47:51] hypercore: i have query |> ... |> select_merge: %{authors: count(article.id)} |> group_by: [asc: :articles]
[14:48:23] hypercore: (where :articles is also a virtual field in my Author schema)
[14:55:50] OliverMT: has joined #elixir-lang
[14:56:11] OvermindDL1_: has joined #elixir-lang
[14:56:40] alxndr: has joined #elixir-lang
[14:57:01] hypercore: figured it out
[15:01:38] nineczar: has joined #elixir-lang
[15:02:19] benwilson512: https://www.irccloud.com/pastebin/uOSZqyRn/
[15:02:28] lexmag: has joined #elixir-lang
[15:02:45] benwilson512: if you need to add an offset
[15:02:48] benwilson512: just do `, do: i + offset`
[15:03:43] benwilson512: edw: I'm not sure why you wouldn't have your columns as values in a map where the keys are the column names though
[15:03:46] benwilson512: and ditch indices entirely
[15:06:25] CARAM_______: has joined #elixir-lang
[15:06:43] rfv: has joined #elixir-lang
[15:12:48] profit_: has joined #elixir-lang
[15:13:10] edw: benwilson512: It blows my mind that the preferred way to store large tabular data is a list of maps and not a list of tuples. But apparently it is indeed the Elixir Way.
[15:13:56] benwilson512: edw: I mean you're already holding a map of column names to indices
[15:14:11] billstclair: has joined #elixir-lang
[15:14:57] mdbm: has joined #elixir-lang
[15:15:02] ahills: has joined #elixir-lang
[15:21:47] peel: has joined #elixir-lang
[15:22:47] kyrylo: has joined #elixir-lang
[15:25:48] neena: has joined #elixir-lang
[15:39:37] jeffro: has joined #elixir-lang
[15:41:55] aalmazan: has joined #elixir-lang
[15:48:26] mdbm_: has joined #elixir-lang
[15:52:17] greengriminal: has joined #elixir-lang
[15:54:42] dtzuzu: has joined #elixir-lang
[15:58:30] tpl: has joined #elixir-lang
[16:06:49] Saukk: has joined #elixir-lang
[16:12:40] Nicd-: edw: don't optimise prematurely ;)
[16:13:32] edw: Nicd-: Exactly. That’s why I always start with bubble sort.
[16:14:33] Nicd-: good joke but not really comparable
[16:16:00] edw: The natural way to model this data is a list of tuples. I am not prematurely optimizing.
[16:16:02] ariedler: edw: I prefer the Quantum Bogo Sort :P
[16:16:21] neena: has joined #elixir-lang
[16:18:29] Nicd-: I'd say the natural way to model most tables is not a list of tuples
[16:19:03] drincruz: has joined #elixir-lang
[16:19:13] Nicd-: structs and maps are more convenient most of the time IMO
[16:20:42] edw: Well for the tabular data with reasonable column counts that I want to repeatedly process sequentially, it is. But maybe I should substitute your judgement for my own.
[16:21:07] benwilson512: edw: if you're repeatedly processing each row 1 column at a time in order then the more natural option is a list
[16:22:51] edw: If indeed but not the case.
[16:24:55] edw: I’d like y’all to entertain the possibility that a programmer with 35 years of experience, fifteen of which are with lisps of various flavors, has made a reasonable choice given the shape of the data and the way it will be accessed.
[16:25:57] Nicd-: I'm not assuming your usage is bad. I'm reacting to something very reasonable "blowing your mind" :P
[16:26:40] netrino: has joined #elixir-lang
[16:29:06] edw: Nicd-: for most cases, it is indeed crazy to use a map with a million entries using integers [0,1e6) as keys to model an array of a million items.
[16:32:53] gvaughn: has joined #elixir-lang
[16:34:12] wonko7: has joined #elixir-lang
[16:50:17] Sgeo_: has joined #elixir-lang
[17:04:50] neena: has joined #elixir-lang
[17:58:10] wsieroci: has joined #elixir-lang
[17:59:59] blahdodo: has joined #elixir-lang
[18:08:46] squall: has joined #elixir-lang
[18:10:44] neena: has joined #elixir-lang
[18:11:58] duaneb: has joined #elixir-lang
[18:23:12] pera: has joined #elixir-lang
[18:27:51] gamache: do Application.get_env/2 et al talk to a genserver? I.e., are calls to Application.get_env a potential bottleneck in a busy system?
[18:29:55] gamache: asking for a friend with 75 prod servers
[18:32:19] duaneb: has joined #elixir-lang
[18:32:34] rambocoder: has joined #elixir-lang
[18:42:28] josevalim: it is a ets lookup
[18:43:07] gamache: Great, so that answers my followup question: is it worth reimplementing in ETS :)
[18:43:57] kyrylo: has joined #elixir-lang
[18:46:17] lexmag: has joined #elixir-lang
[18:58:01] lomex: has joined #elixir-lang
[19:11:15] felipevolpone: has joined #elixir-lang
[19:28:59] shiro[cloud]: has joined #elixir-lang
[19:31:59] d10n-work: has joined #elixir-lang
[19:36:32] DarkSeid: has joined #elixir-lang
[19:38:32] blahdodo: has joined #elixir-lang
[19:42:47] samrose: has joined #elixir-lang
[20:21:20] neena: has joined #elixir-lang
[20:28:03] kiltzman: has joined #elixir-lang
[20:30:30] orbyt_: has joined #elixir-lang
[21:02:48] ur5us: has joined #elixir-lang
[21:15:43] fmcgeough: has joined #elixir-lang
[21:16:13] fmcgeough: has joined #elixir-lang
[21:17:22] fmcgeough_: has joined #elixir-lang
[21:21:39] lauromoura_: has joined #elixir-lang
[21:53:02] __charly__: has joined #elixir-lang
[22:13:11] warmwaffles: has joined #elixir-lang
[22:30:02] orbyt_: has joined #elixir-lang
[22:31:57] neena: has joined #elixir-lang
[22:36:55] gvaughn: has joined #elixir-lang
[22:55:48] whatyouhide: gamache: depends on what you need that storage for. ets has more flexibility but you have to keep the ets alive through a proc and you dont have a common interface for configuration
[22:59:34] gamache: whatyouhide: So far I haven't started abusing config store as generic global state *yet*. I think I will ultimately use ConCache (ETS with lipstick) for that. :)
[22:59:39] gamache: but thanks for the detail
[23:00:33] gamache: long story short, I doubled the number of cores I was using in prod, and started to encounter new and exciting concurrency-related bottlenecks
[23:01:07] gamache: so we are in the process of auditing all use of processes and genservers
[23:01:21] gamache: because we had some clear bottlenecks in the works
[23:05:06] mahmudov: has joined #elixir-lang
[23:41:24] orbyt_: has joined #elixir-lang
[23:42:15] tomterl: has joined #elixir-lang
[23:42:31] starbelly: ConCache no doubt works, but you have to think about what's going on, also realize if you want something close to atomic transactions, it involves locks 😬
[23:42:42] starbelly: IMO you're better off sticking to plain ole ets
[23:44:20] starbelly: I would say, if you can help it, keep your nodes dumb as possible IMO
[23:44:55] starbelly: gamache: Also, something I find people encounter often (at least in first app)... logging... if you're doing a lot of logging, and not mindful about it... slowville, so I'd look into that
[23:46:35] starbelly: ^ esp if you're logging to files
[23:59:45] duaneb: has joined #elixir-lang