« Back to channel list

#elixir-lang - 04 June 2019

« Back 1 day Forward 1 day »
[00:06:57] Sgeo_: has joined #elixir-lang
[00:35:27] Sgeo__: has joined #elixir-lang
[00:46:58] infowolfe: has joined #elixir-lang
[00:46:58] infowolfe: has joined #elixir-lang
[01:06:52] gvaughn_: has joined #elixir-lang
[01:09:34] __charly__: has joined #elixir-lang
[01:20:34] griffinbyatt: has joined #elixir-lang
[01:21:16] jegaxd26: has joined #elixir-lang
[01:30:43] duaneb: has joined #elixir-lang
[01:32:26] Sgeo__: has joined #elixir-lang
[01:35:13] greengriminal: has joined #elixir-lang
[01:47:41] w09x: has joined #elixir-lang
[01:50:33] tomterl: has joined #elixir-lang
[01:59:24] w09x: anyone know why I would be getting a cast error here? https://www.pastiebin.com/5cf5d02b5b1e7
[02:03:27] warmwaffles: w09x, have you tried on the repl to do it with atoms instead of symbols `%{name: "thing"}`
[02:04:03] warmwaffles: you need to use `""`
[02:04:12] theWhisper__: has joined #elixir-lang
[02:04:19] warmwaffles: one is a string, the other is a character array
[02:04:53] warmwaffles: %{"name" => "Example User", "role" => "acceptor"}
[02:10:19] w09x: warmwaffles: legend! I would have never figured that out..
[02:12:34] sevenseacat: has joined #elixir-lang
[02:25:00] jegaxd26: has joined #elixir-lang
[02:59:27] orbyt_: has joined #elixir-lang
[03:13:56] Sgeo__: has joined #elixir-lang
[03:27:23] ariedler: has joined #elixir-lang
[03:35:07] blassin: has joined #elixir-lang
[04:07:50] gvaughn: has joined #elixir-lang
[04:28:56] harfangk: has joined #elixir-lang
[04:30:47] mbuf: has joined #elixir-lang
[05:14:18] gvaughn: has joined #elixir-lang
[05:24:26] isHavvyGhosting: has joined #elixir-lang
[05:32:46] Sgeo: has joined #elixir-lang
[05:33:39] serafeim: has joined #elixir-lang
[05:34:26] serafeim: good morning
[05:36:48] ur5us: has joined #elixir-lang
[05:39:15] proteusguy: has joined #elixir-lang
[05:47:01] infowolfe: has joined #elixir-lang
[05:58:12] serafeim: hello, i want to use phoenix presence to track the users of my application but i want updates to be submitted *only* to superusers. i.e i don't want to allow everybody to see who's online. I tried implementing this using a check on the `handle_info(:after_join)` of my channel like this: https://github.com/spapas/phxcrd/blob/master/lib/phxcrd_web/channels/room_channel.ex#L15
[05:58:51] serafeim: i.e i.ve added this check: `if socket.assigns[:perms] |> Enum.member?("superuser"), do: push(socket, "presence_state", Presence.list(socket))`
[05:59:56] serafeim: is this the correct way to do it ? it seems to be working (i.e non superusers don't receive any updates) but is this enough? could f.e somebody query the channel for updates ? i'm not very familiar with channels :(
[06:01:59] serafeim: should i add that on SO ? I don't like posting there anymore :|
[06:26:00] gvaughn: has joined #elixir-lang
[06:41:03] serafeim: i've got a form with an optional dropdown that sets a foreign key. this works fine when i set a value to the dropdown however when i leave it empty, the changeset does *not* contain anything thus it won't update the database and will leave the previous option t o the foreign key (while i want to set it to null). how can i resolve that ?
[06:43:41] netrino: has joined #elixir-lang
[06:48:54] serafeim: I've fixed that by checking if my form parameters map contains the foreign key attr name and if not explicitly setting it to nil. is this the correct way to do it ?
[06:49:33] serafeim: i.e i'm doing something like this: `user_params = Map.merge(%{"authority_id" => nil}, user_params)`
[06:51:34] DTZUZO: has joined #elixir-lang
[06:52:16] ur5us: has joined #elixir-lang
[06:53:10] ur5us: has joined #elixir-lang
[06:56:45] netrino: has joined #elixir-lang
[07:05:47] netrino: has joined #elixir-lang
[07:07:32] ndee: has joined #elixir-lang
[07:07:38] tuacker: has joined #elixir-lang
[07:10:23] tuacker: has joined #elixir-lang
[07:14:52] netrino: has joined #elixir-lang
[07:23:57] netrino: has joined #elixir-lang
[07:28:54] jegaxd26: has joined #elixir-lang
[07:28:58] ariedler: has joined #elixir-lang
[07:33:40] gvaughn: has joined #elixir-lang
[07:38:52] iamvery: has joined #elixir-lang
[07:46:19] jegaxd26: has joined #elixir-lang
[08:02:57] netrino: has joined #elixir-lang
[08:06:32] lexmag: has joined #elixir-lang
[08:18:38] universa1: has joined #elixir-lang
[08:19:37] Guest61118: has joined #elixir-lang
[08:25:29] sms: What's the quickest way to test a module
[08:25:45] sms: Right now I just have a script with a script_test.exs
[08:26:04] sms: I guess I sort of need to package those together though
[08:26:29] sms: Because currently I get (CompileError) arr_test.exs:6: module Arr is not loaded and could not be found
[08:33:18] oui: has joined #elixir-lang
[08:42:00] netrino: has joined #elixir-lang
[08:49:42] gvaughn: has joined #elixir-lang
[08:51:23] proteusguy: has joined #elixir-lang
[08:59:30] ur5us: has joined #elixir-lang
[09:02:04] gremly: has joined #elixir-lang
[09:03:23] mrarm: has joined #elixir-lang
[09:09:33] odogono: has joined #elixir-lang
[09:12:17] jegaxd26: has joined #elixir-lang
[09:21:01] netrino: has joined #elixir-lang
[09:22:20] serafeim: i've written a post about phoenix for anybody interested: https://spapas.github.io/2019/06/04/phoenix-form-select2-ajax/
[09:30:18] ariedler: has joined #elixir-lang
[09:58:10] Uniaika_: has left #elixir-lang: ()
[10:00:05] netrino: has joined #elixir-lang
[10:01:20] gvaughn: has joined #elixir-lang
[10:08:52] PragTob: has joined #elixir-lang
[10:12:23] griffinbyatt: has joined #elixir-lang
[10:21:09] jegaxd26: has joined #elixir-lang
[10:26:27] serafeim: Nicd-: one recommendation is to give less XPs for plain text; I wrote an article for my blog and in a couple of hours I reached lvl 2
[10:28:43] Nicd-: Don't worry, the levels scale exponentially
[10:31:45] OliverMT: when will you index stack overflow
[10:31:53] OliverMT: and give -xp if there is code equivalency with answers
[10:39:02] netrino: has joined #elixir-lang
[10:41:52] serafeim: Nicd-: yes i understand however when I write elixir I write like 100 characters / hour. when writing text I write like 1000 characters / hour
[10:42:24] Nicd-: that is true for different languages too
[10:42:27] serafeim: RPGs also don't give the same level of experience when you kill a rat and when you kill a beholder :)
[10:42:31] Nicd-: you write more Java than Haskell, probably
[10:42:55] serafeim: but that's not easy to measure ; for text it is easier
[10:43:07] Nicd-: is it? not everyone writes prose
[10:43:10] ryotsu: has joined #elixir-lang
[10:44:06] Nicd-: I'm not opposed to the idea, it would apply to all the Markdown flavours though for example. and what if you write e.g. API documentation in your code? you get a lot of XP that way
[10:44:42] Nicd-: so I'd rather solve it with some new way to visualize the data that doesn't let one language dominate and make other data unusable
[10:46:08] serafeim: Nicd-: no problem you know better. i just noticed it and wanted to share it with you
[10:46:58] Nicd-: maybe we could have something that de-emphasizes the user's biggest languages and emphasizes new ones or something
[10:49:30] OliverMT: stop being lazy Nicd-
[10:49:38] OliverMT: implement a lexer for all the languages to separate code from documentation
[10:50:42] ryotsu: has joined #elixir-lang
[10:51:49] Nicd-: but my fingers hurt
[10:55:06] ariedler: has joined #elixir-lang
[10:58:04] ur5us: has joined #elixir-lang
[11:01:15] iamvery: has joined #elixir-lang
[11:05:56] serafeim: Nicd-: well you'd get many exp points if you implemented that
[11:11:32] gvaughn: has joined #elixir-lang
[11:18:04] netrino: has joined #elixir-lang
[11:29:34] tehpeh: has joined #elixir-lang
[11:33:55] duaneb: has joined #elixir-lang
[11:36:29] drincruz_: has joined #elixir-lang
[11:39:34] jegaxd26: has joined #elixir-lang
[11:42:16] nickjj_: has joined #elixir-lang
[11:43:15] NickZA: has joined #elixir-lang
[11:45:23] greengriminal: has joined #elixir-lang
[11:54:52] gde33: has joined #elixir-lang
[11:57:07] netrino: has joined #elixir-lang
[12:20:04] drincruz_: has joined #elixir-lang
[12:25:02] praveenperera: has joined #elixir-lang
[12:36:07] netrino: has joined #elixir-lang
[12:43:12] jegaxd26: has joined #elixir-lang
[12:52:26] tallysmartins_: has joined #elixir-lang
[12:56:15] gvaughn: has joined #elixir-lang
[12:56:31] drincruz_: has joined #elixir-lang
[12:59:10] jkva: has joined #elixir-lang
[12:59:59] jkva: We're having some distillery problems, has anyone ever seen an error like this one? `{"could not start kernel pid",application_controller,"invalid config data: application: connector; invalid parameter name: <<\"client-94239ebb-9551-41fa-8b91-fde037b15d4f\">>"}`
[13:00:11] jkva: My google-fu doesn't seem much help :-/
[13:00:35] Nicd-: do you have an app called connector?
[13:01:02] Nicd-: and it's configured with some kind of UUID?
[13:01:08] Nicd-: can you show the config?
[13:01:11] jkva: (This is particularly an umbrella app)
[13:02:10] jkva: the UUID is pretty arbitrary, in this case `"client-" <> some_random_uuid()`
[13:02:20] jkva: It works fine via `mix`, that's the thing
[13:02:29] Nicd-: can you show the config?
[13:02:34] benwilson512: jkva: where does that config show up?
[13:02:49] jkva: In one of the umbrella apps
[13:03:07] jkva: (First time we're using distillery as well, to boot)
[13:03:14] benwilson512: jkva: ok well, as Nicd-, let's see it
[13:03:53] jkva: Does this channel have a preferred pasting system?
[13:04:08] benwilson512: pastebin/gist/ whatever
[13:04:12] benwilson512: as long as you don't splat it in channel
[13:04:22] Nicd-: gist > pastebin
[13:06:03] jkva: https://pastebin.com/raw/WQiS07nB
[13:06:35] micmus: jkva: in general config keys should only be atoms
[13:06:53] micmus: some places where config is used don't enforce this and that's why it sometimes works
[13:06:59] jkva: Well then, that's a good approach to switch to
[13:08:18] tnez: has joined #elixir-lang
[13:09:15] jkva: Thanks folks, I'll give that a shot
[13:09:18] Sgeo_: has joined #elixir-lang
[13:10:09] micmus: josevalim: ^ should mix config (or at least the new Config module) enforce only atoms as keys?
[13:15:10] netrino: has joined #elixir-lang
[13:45:20] drincruz_: has joined #elixir-lang
[13:47:57] hypercore: has joined #elixir-lang
[13:48:28] either|or: has joined #elixir-lang
[13:52:20] proteusguy: has joined #elixir-lang
[13:54:10] netrino: has joined #elixir-lang
[13:55:12] gvaughn: has joined #elixir-lang
[13:59:33] greengriminal: has joined #elixir-lang
[14:10:30] drrty: has joined #elixir-lang
[14:12:48] dimitarvp: has joined #elixir-lang
[14:24:39] wsieroci: has joined #elixir-lang
[14:30:22] hypercore: has joined #elixir-lang
[14:30:49] duaneb: has joined #elixir-lang
[14:33:09] netrino: has joined #elixir-lang
[14:43:08] orbyt_: has joined #elixir-lang
[15:03:59] notzmv: has joined #elixir-lang
[15:06:21] Sgeo__: has joined #elixir-lang
[15:12:09] netrino: has joined #elixir-lang
[15:17:58] Saukk: has joined #elixir-lang
[15:18:16] orbyt_: has joined #elixir-lang
[15:22:06] pera: has joined #elixir-lang
[15:27:21] averell: has joined #elixir-lang
[15:31:47] tuacker: has joined #elixir-lang
[15:37:01] averell: has joined #elixir-lang
[15:44:12] Phylock: has joined #elixir-lang
[15:46:13] drincruz_: has joined #elixir-lang
[15:48:54] mariotomo: has joined #elixir-lang
[15:50:17] mariotomo: good day everyone here. question, remark, request for help understanding: in (https://elixir-lang.org/getting-started/alias-require-and-import.html) there's this sentence: >> Elixir, `Integer.is_odd/1` is defined as a macro so that it can be used as a guard
[15:50:29] mariotomo: and I'm quite sure I don't understand it.
[15:51:02] mariotomo: only macros can be used as guards?
[15:51:12] netrino: has joined #elixir-lang
[15:51:44] micmus: mariotomo: only some built-in functions and macros that expand to those built-in functions
[15:52:01] micmus: https://hexdocs.pm/elixir/guards.html#list-of-allowed-expressions
[15:55:07] mariotomo: I'll be reading the docs, maybe no need to ask further. thank you.
[15:55:54] aalmazan: has joined #elixir-lang
[15:59:20] gvaughn: has joined #elixir-lang
[16:10:39] Havvy: has joined #elixir-lang
[16:12:21] serafeim: has joined #elixir-lang
[16:12:45] serafeim: hello, i want to use phoenix presence to track the users of my application but i want updates to be submitted *only* to superusers. i.e i don't want to allow everybody to see who's online. I tried implementing this using a check on the `handle_info(:after_join)` of my channel like this: https://github.com/spapas/phxcrd/blob/master/lib/phxcrd_web/channels/room_channel.ex#L15
[16:12:54] serafeim: i.e i.ve added this check: `if socket.assigns[:perms] |> Enum.member?("superuser"), do: push(socket, "presence_state", Presence.list(socket))
[16:13:01] serafeim: is this the correct way to do it ? it seems to be working (i.e non superusers don't receive any updates) but is this enough? could f.e somebody query the channel for updates ? i'm not very familiar with channels :(
[16:16:13] hypercore: has joined #elixir-lang
[16:16:15] d10n-work: has joined #elixir-lang
[16:30:14] netrino: has joined #elixir-lang
[16:30:14] vaer-k: has joined #elixir-lang
[16:45:41] icecreamcohen: has joined #elixir-lang
[16:46:30] jsehop98: has joined #elixir-lang
[16:50:42] orbyt_: has joined #elixir-lang
[16:51:09] benwilson512: serafeim: clients have no power to force a channel to give up information
[16:51:25] benwilson512: they can send a channel messages, but you always control what gets pushed on response
[16:54:31] gvaughn_: has joined #elixir-lang
[16:56:45] jnoon2: has joined #elixir-lang
[17:02:04] siwatpru: has joined #elixir-lang
[17:04:34] nickjj: has joined #elixir-lang
[17:09:15] netrino: has joined #elixir-lang
[17:20:34] AnimalClatter: has joined #elixir-lang
[17:21:29] icecreamcohen: has joined #elixir-lang
[17:23:01] toothfairy__: has joined #elixir-lang
[17:32:29] griffinbyatt: has joined #elixir-lang
[17:33:21] toothfairy__: has joined #elixir-lang
[17:40:58] greengriminal: has joined #elixir-lang
[17:41:07] kapilp: phoenix log: `iex(sce_umbrella@127.0.0.1)1> 17:37:45.094 request_id=FaUPepPAElkQazgAAADx [info] Sent 302 in 1ms`
[17:41:35] kapilp: when i open `http://52.91.167.248:8888`
[17:41:53] kapilp: why its redirecting to `http://0.0.0.91:8888/` ?
[17:47:05] drincruz_: has joined #elixir-lang
[17:48:15] netrino: has joined #elixir-lang
[17:50:10] griffinbyatt: has joined #elixir-lang
[17:54:55] icecreamcohen: has joined #elixir-lang
[18:00:11] praveenperera: has joined #elixir-lang
[18:00:58] netrino_: has joined #elixir-lang
[18:06:12] tuacker: has joined #elixir-lang
[18:11:52] icecreamcohen: has joined #elixir-lang
[18:12:28] hypercore: has joined #elixir-lang
[18:14:44] squall: has joined #elixir-lang
[18:15:52] whathappens: has joined #elixir-lang
[18:20:17] nickjj_: has joined #elixir-lang
[18:22:41] orbyt_: has joined #elixir-lang
[18:30:19] NickZA: has joined #elixir-lang
[18:31:54] AnimalClatter: has left #elixir-lang: ("ERC (IRC client for Emacs 26.1)")
[18:35:36] pera: has joined #elixir-lang
[18:40:45] icecreamcohen: has joined #elixir-lang
[18:41:10] eudocimus_r: has joined #elixir-lang
[18:42:05] sacredfrog: has joined #elixir-lang
[18:48:05] orbyt_: has joined #elixir-lang
[18:48:18] PragTob: has joined #elixir-lang
[18:50:42] serafeim: benwilson512: so is my implementation ok ? could you take a look at it ?
[18:51:25] benwilson512: serafeim: sorry, I haven't used presence myself, so I can't speak with confidence about it
[18:52:38] serafeim: oh well the documentation about presence leaves a lot to be desired :|
[18:53:02] benwilson512: serafeim: sounds like a good forum post question
[18:53:07] serafeim: in any case since it seems to be working i'll leave it like that
[18:53:42] serafeim: benwilson512: yes i've stumbled upon the forum a couple of times. can i ask why SO is not used instead ?
[18:54:19] benwilson512: serafeim: There's no official preference for one vs the other, but SO has very strict rules around how questions can be asked and answered.
[18:54:30] serafeim: the forum seems a little 00's :/
[18:54:46] lexmag: has joined #elixir-lang
[18:56:00] serafeim: seems retro
[18:56:45] benwilson512: visually? from a forum feature perspective it's quite modern.
[18:56:52] benwilson512: when I think 00's I think phpbb
[18:57:21] benwilson512: that'll probably be the best place to ask
[19:06:52] serafeim: no no the whole forum experience for asking programming questions is retro
[19:08:12] serafeim: i think there was an old post by joel spolsky comparing SO with forums. it was funny
[19:18:41] serafeim: in any case i'll consider asking in the forum (or so) ; i just have decided that I really prefer IRC's more direct Q+A
[19:28:42] lexmag: has joined #elixir-lang
[19:45:24] orbyt_: has joined #elixir-lang
[19:47:50] drincruz_: has joined #elixir-lang
[19:55:32] styles__: has joined #elixir-lang
[19:57:44] serafeim: well duh. i posted somehing on elixir forum but it needs moderation :|
[19:57:58] serafeim: this *really* is 00's...
[19:59:08] greengriminal: has joined #elixir-lang
[20:01:06] styles__: I have to build a Phoenix dynamic form system (Google Forms). I have no idea how I'd store the data in PG schema and actually perform ecto validations on it. Does anyone have any nudges in the right direction? I've posted on the Elixir Phoenix forum and just received conflicting answers. Some say it's not even possible.
[20:02:58] serafeim: styles__: this smells like a jsonb field
[20:02:59] toothfairy__: has joined #elixir-lang
[20:03:46] icecreamcohen: has joined #elixir-lang
[20:14:17] styles__: Ah entity attribute
[20:14:34] styles__: That's how I've been designing it up until now. But the problem is, how do I feed in the attributes so that ecto will perform validation too
[20:15:07] styles__: And then you have funky fields that require edge cases like select fields vs input (number) types and rendering this is just a switch statement, but the validation on the frontend becomes a nightmare
[20:17:33] vaer-k: has joined #elixir-lang
[20:20:18] serafeim: unfortunatly i'm not that experienced in elixir / phoenix to tell you how you could do it. i could propose a solution for django :)
[20:22:47] serafeim: styles__: have you read this post: http://code.krister.ee/dynamic-fields-from-conf-to-ui-in-elixir-and-phoenix/ ?
[20:24:06] duaneb: has joined #elixir-lang
[20:37:50] greengriminal: has joined #elixir-lang
[20:39:28] orbyt_: has joined #elixir-lang
[20:41:30] ankhers: Is there a suggested way to use inputs_for within a liveview template?
[21:08:33] tomku: has joined #elixir-lang
[21:09:15] orbyt_: has joined #elixir-lang
[21:12:24] ur5us: has joined #elixir-lang
[21:13:32] sleepiejohn: has joined #elixir-lang
[21:13:47] tomku: has joined #elixir-lang
[21:17:20] netrino_: has joined #elixir-lang
[21:26:25] netrino_: has joined #elixir-lang
[21:32:17] MarioFlach: has joined #elixir-lang
[21:35:29] netrino_: has joined #elixir-lang
[21:42:17] icecreamcohen: has joined #elixir-lang
[21:44:33] netrino_: has joined #elixir-lang
[21:45:52] __charly__: has joined #elixir-lang
[21:48:39] drincruz_: has joined #elixir-lang
[21:49:22] obfusk: has joined #elixir-lang
[21:51:28] lexmag: has joined #elixir-lang
[21:53:38] obfusk: has joined #elixir-lang
[22:01:01] helmut_1: has joined #elixir-lang
[22:02:01] orbyt_: has joined #elixir-lang
[22:03:02] helmut_1: has left #elixir-lang: ()
[22:03:42] whathappens: has joined #elixir-lang
[22:13:31] duaneb: has joined #elixir-lang
[22:16:16] orbyt_: has joined #elixir-lang
[22:19:03] tehpeh: has joined #elixir-lang
[22:19:43] heimann: I'm having a problem with Ecto where an existing jsonb field from a postgresql database doesn't work when I set the type as :map in the schema. It looks like ecto sees it as a string and then can't match the string against a map?
[22:22:18] lexmag_: has joined #elixir-lang
[22:23:35] netrino_: has joined #elixir-lang
[22:24:46] ankhers: heimann: I'm going to ask a really dumb question, and I'm sorry for that. But, are you 100% sure postgres things it is a jsonb field and not a string field that is holding JSON data?
[22:25:18] heimann: this is from psql: "data | jsonb"
[22:25:52] ankhers: Okay. Is it storing a JSON string?
[22:26:38] heimann: And the error I get from Ecto is cannot load '"{\Key\": \"Value\"}"' as type :map for field :data
[22:26:51] heimann: So it looks like it's coming in to Ecto as a string?
[22:29:44] ankhers: In psql, what happens if you `select data->'Key' from table;'?
[22:30:42] heimann: I get ?column? | value for all records
[22:32:28] heimann: hmm ok this might just be a case where I have some old value in that database that is actually stored as json... :o
[22:32:38] heimann: stored as a string*
[22:37:59] greengriminal: has joined #elixir-lang
[22:40:36] DeX77: has joined #elixir-lang
[22:51:40] praveenperera: has joined #elixir-lang
[23:00:22] orbyt_: has joined #elixir-lang
[23:02:41] netrino_: has joined #elixir-lang
[23:15:57] ankhers: heimann: Sorry, had to go for a minute. I think that is the case as well.
[23:22:38] ariedler: I miss Elixir lol
[23:41:40] netrino_: has joined #elixir-lang
[23:47:15] lexmag: has joined #elixir-lang
[23:49:48] drincruz_: has joined #elixir-lang
[23:57:57] gde33: has joined #elixir-lang