« Back to channel list

#elixir-lang - 17 May 2019

« Back 1 day Forward 1 day »
[00:03:57] icecreamcohen: has joined #elixir-lang
[00:17:16] sacredfrog: has joined #elixir-lang
[00:25:02] scaredfrog: has joined #elixir-lang
[00:27:37] scaredfrog: has joined #elixir-lang
[00:28:05] scaredfrog: has joined #elixir-lang
[00:31:38] scaredfrog: has joined #elixir-lang
[00:44:35] chrismccord: benwilson512 : ah yeah if you can simply run thru at the parent and update based on @now, that would be nice
[00:44:56] chrismccord: since the children join and different moments, you are right they will tick slightly out of sync
[00:45:14] Sgeo: has joined #elixir-lang
[00:45:22] chrismccord: benwilson512 : it's still not clar to be what the Timex/now issue us
[00:49:11] jeffro_: has joined #elixir-lang
[01:00:39] jeffro_: has joined #elixir-lang
[01:02:55] ur5us_: has joined #elixir-lang
[01:11:29] benwilson512: chrismccord: there isn't an issue, figured it out
[01:15:53] jeffro_: has joined #elixir-lang
[01:19:44] sacredfrog: has joined #elixir-lang
[01:40:35] harfangk: has joined #elixir-lang
[01:44:52] tomterl: has joined #elixir-lang
[01:45:44] warmwaffles: has joined #elixir-lang
[01:46:50] ur5us: has joined #elixir-lang
[01:47:13] Adkron: has joined #elixir-lang
[01:52:55] sacredfrog: has joined #elixir-lang
[01:56:10] sacredfrog: has joined #elixir-lang
[02:05:15] Sgeo_: has joined #elixir-lang
[02:19:26] sevenseacat: has joined #elixir-lang
[02:44:16] griffinbyatt: has joined #elixir-lang
[02:58:32] craigp: has joined #elixir-lang
[03:16:38] jeffro_: has joined #elixir-lang
[03:24:13] Adkron: has joined #elixir-lang
[03:37:57] inoas: has joined #elixir-lang
[03:59:51] mbuf: has joined #elixir-lang
[04:06:27] Adkron: has joined #elixir-lang
[04:10:38] proteusguy: has joined #elixir-lang
[04:23:26] Phylock: has joined #elixir-lang
[04:32:38] Saukk: has joined #elixir-lang
[04:57:29] gvaughn: has joined #elixir-lang
[05:17:28] jeffro_: has joined #elixir-lang
[05:32:38] ur5us_: has joined #elixir-lang
[05:38:21] Adkron: has joined #elixir-lang
[05:45:15] voltone: has joined #elixir-lang
[05:56:30] Mieserkadser: has joined #elixir-lang
[06:00:55] kyrylo: has joined #elixir-lang
[06:07:52] voltone: has joined #elixir-lang
[06:08:40] gvaughn: has joined #elixir-lang
[06:24:06] voltone: has joined #elixir-lang
[06:34:07] tomaz_b: has joined #elixir-lang
[06:44:00] voltone: has joined #elixir-lang
[06:53:11] netrino: has joined #elixir-lang
[07:00:50] voltone: has joined #elixir-lang
[07:18:20] jeffro_: has joined #elixir-lang
[07:39:48] neena: has joined #elixir-lang
[07:40:24] voltone: has joined #elixir-lang
[07:40:30] Adkron: has joined #elixir-lang
[07:41:06] neena: It looks like any crashing dependency can take down my application. Is there a way to protect my application from this?
[07:41:46] neena: This is not for a real problem I'm solving, but, just to figure out if it's possible.
[07:43:40] gvaughn: has joined #elixir-lang
[07:50:24] voltone: has joined #elixir-lang
[08:03:26] voltone: has joined #elixir-lang
[08:05:25] netrino: has joined #elixir-lang
[08:07:21] netrino_: has joined #elixir-lang
[08:09:12] __charly__: has joined #elixir-lang
[08:12:17] Adkron: has joined #elixir-lang
[08:14:12] kapilp: has joined #elixir-lang
[08:16:39] Gika: has joined #elixir-lang
[08:19:56] michael_mbp: has joined #elixir-lang
[08:24:15] Avinash: has joined #elixir-lang
[08:33:30] voltone: has joined #elixir-lang
[08:36:02] CapNemo: has joined #elixir-lang
[08:39:17] josevalim: any native speakers can review this one? https://github.com/elixir-lang/elixir/pull/9048
[08:39:29] josevalim: I think the current phrasing in the PR is clear, so feedback is welcome
[08:39:53] gvaughn: has joined #elixir-lang
[08:49:55] ur5us: has joined #elixir-lang
[08:51:30] michael_mbp: has joined #elixir-lang
[08:53:10] celyr: has joined #elixir-lang
[08:58:01] voltone: has joined #elixir-lang
[08:58:03] lotte_guest: has joined #elixir-lang
[09:01:04] wonko7: has joined #elixir-lang
[09:03:17] voltone: has joined #elixir-lang
[09:05:42] ur5us: has joined #elixir-lang
[09:06:57] Gika: has joined #elixir-lang
[09:07:37] sevenseacat: I don't think the change reads well - must be followed by optional whitespace? must there be whitespace or is it optional?
[09:09:17] micmus: How about something like "only whitespace is allowed after heredoc start" or something along those lines
[09:12:00] lexmag: has joined #elixir-lang
[09:15:31] gvaughn: has joined #elixir-lang
[09:19:07] jeffro_: has joined #elixir-lang
[09:19:35] voltone: has joined #elixir-lang
[09:20:00] ur5us: has joined #elixir-lang
[09:26:02] ur5us: has joined #elixir-lang
[09:28:54] voltone: has joined #elixir-lang
[09:41:02] Gika: has joined #elixir-lang
[09:41:50] nickjj: has joined #elixir-lang
[09:57:18] fastfresh: has joined #elixir-lang
[10:05:05] blahdodo: has joined #elixir-lang
[10:06:08] DTZUZO: has joined #elixir-lang
[10:07:58] fastfresh: How do I embed Ranch into my app? I'm trying to follow official docs here https://ninenines.eu/docs/en/ranch/1.7/guide/embedded/ but there are things I don't understand. When I add `{:ranch, "~> 1.7"}` to project deps, I see in observer that `ranch_sup` starts as a separate application, so I'm unable to start it under my app sup tree (I get `(EXIT) already started: #PID<0.171.0>` error). I can override that behaviour
[10:07:58] fastfresh: by `app: false` option in deps, but I'm not sure what approach is the proper one. Should it start as separate app or not?
[10:13:45] gvaughn: has joined #elixir-lang
[10:14:03] fastfresh: I mean, official docs say that I need to embed ranch directly in my supervision tree, but Elixir+Ranch guides on the internet never mention anything about this.
[10:17:22] dysfun: fastfresh: first sentence on that page is "Embedded mode allows you to insert Ranch listeners directly in your supervision tree"
[10:17:25] dysfun: i.e. it is optional
[10:17:59] dysfun: it does go on to tell you why you might consider it though
[10:18:41] blahdodo: has joined #elixir-lang
[10:18:58] Adkron: has joined #elixir-lang
[10:20:24] Sgeo_: has joined #elixir-lang
[10:25:32] jeffro_: has joined #elixir-lang
[10:29:58] tutti: has joined #elixir-lang
[10:40:51] kawen: has joined #elixir-lang
[10:46:41] gvaughn: has joined #elixir-lang
[10:52:15] fastfresh: Ok, thanks.
[10:54:31] Gika: has joined #elixir-lang
[10:55:14] micmus: fastfresh: you don't start ranch itself in your supervision tree, you can start listeners in your tree instead of ranch's tree. Ranch is still an application that is started on its own in the "embedded" mode
[11:00:39] hypercore: has joined #elixir-lang
[11:04:18] kdisneur: has joined #elixir-lang
[11:39:23] Hypn0z: has joined #elixir-lang
[11:41:23] tankf33der: has joined #elixir-lang
[11:43:01] serafeim: has joined #elixir-lang
[11:43:24] serafeim: hello! please help me before i get crazy
[11:43:36] serafeim: i've go the following alias in my module
[11:43:43] serafeim: import Ecto.Query, only: [from: 2]
[11:43:59] serafeim: and then doys = from(d in Doy) |> Repo.all()
[11:44:15] serafeim: now, when i try to compile that I get warning: variable "d" does not exist and is being expanded to "d()", please use parentheses to remove the ambiguity or change the variable name
[11:44:24] serafeim: can somebody help me ?
[11:44:28] Hypn0z: has joined #elixir-lang
[11:46:49] serafeim: if I change it to doys = Doy |> Repo.all() it seems to be working
[11:47:01] Hypn0z: has joined #elixir-lang
[11:47:19] blahdodo: has joined #elixir-lang
[11:48:04] Gazler: Serafeim: You are imnporting from/2 but using from/1
[11:48:10] kdisneur: a guess: if you don't use a second parameter, shouldn't you use `from: 1`
[11:49:27] josevalim: Serafeim: you don’t even need the from in your case
[11:49:29] serafeim: yes that's it! if i use from: 1 it works
[11:49:38] josevalim: You can do Repo.all(Doy)
[11:49:48] serafeim: josevalim yes i ended up using directly Doy |> Repo.all()
[11:50:13] serafeim: I just wanted to understand why from(Doy) didn't work ...
[11:50:15] Gazler: What exactly is a Doy?
[11:50:33] serafeim: gazler a Tax Authority (in Greece)
[11:51:12] Gazler: Ah, thanks. I was thinking Duke of York, which would be oddly specific.
[11:51:32] serafeim: ha ha ha no i think it means something like Public Economic Authority
[11:51:38] edwinbalani: Or that noise you make when you want to imitate a "stupid person"
[11:52:50] Gazler: Both good guesses.
[11:56:21] Gazler: The keyboard shortcuts and new search on ex_doc are so good
[11:58:00] micmus: I found one issue with it that the full search does not consider module/function names, because that's already in the autocomplete - but somehow there are more results in the autocomplete that the thing you want is not there
[11:58:57] benwilson512: that's snagged me a few times
[11:59:16] benwilson512: it makes it hard to send people a search link that includes module / functions
[12:00:32] tnez: has joined #elixir-lang
[12:01:32] benwilson512: tangent: a few years back Chris or Jose mentioned in passing the idea of extending the ecto sandbox style tests such that if you were doing browser tests each browser test could pass in a reference that could be used to use a specific test connection
[12:01:38] benwilson512: did anything ever come of that?
[12:01:48] codewaffle: has joined #elixir-lang
[12:10:59] Gazler: benwilson512: Was it this? https://dockyard.com/blog/2017/11/15/how-to-add-concurrent-transactional-end-to-end-tests-in-a-phoenix-powered-ember-app
[12:11:44] benwilson512: YES this is awesome
[12:20:59] gvaughn: has joined #elixir-lang
[12:21:47] Adkron: has joined #elixir-lang
[12:26:22] jeffro_: has joined #elixir-lang
[12:27:25] micmus: benwilson512: AFAIK the elixir browser-testing libraries support that out of the box
[12:27:59] benwilson512: micmus: in my case I have an elixir application that will need to hit a different elixir application over HTTP, looking to recreate the isolated tests
[12:28:04] benwilson512: not actually using a browser
[12:28:21] micmus: Ah, that sounds wild to do :P
[12:29:36] knack: has joined #elixir-lang
[12:29:56] nickjj: what would this function signature look like to support an optional new param called "next" that doesn't belong to the auth map? def new(conn, %{"auth" => %{"email" => email}}) do
[12:30:24] paxis: has joined #elixir-lang
[12:30:44] nickjj: basically i don't want to duplicate the function to have both a next and non-next variant with pattern matching because i want the function to do 99% of the same thing in both cases so i wanted to handle that condition internal to the 1 function
[12:31:55] paxis: has joined #elixir-lang
[12:32:30] benwilson512: micmus: we have a very large platform application, and we are building a phoenix live view UI that shows a bunch of information sourced from that platform app
[12:32:33] Gazler: nickjj: match it out inside the function.
[12:33:10] nickjj: gazler, the problem i have is i don't know the syntax to set up the function to support matching on "there might be a param option called 'next' in this map"
[12:33:17] Gazler: def new(conn, %{"auth" => %{"email" => email}} = params); case params["next"]...
[12:33:38] Gazler: nickjj: Matching on maps isn't exhaustive.
[12:34:06] Gazler: So `%{"foo" => a} = %{"foo" => 123, "bar" => 456}` is a valid match
[12:35:39] nickjj: so changing %{"auth" => %{"email" => email}} to %{"auth" => %{"email" => email}} = params , still satisfies the original match but also says "i'm giving you access to the entire param map which may contain other things, do as you wish"?
[12:36:12] Gazler: It binds the original map to the value params.
[12:36:30] wonko7: has joined #elixir-lang
[12:36:31] Gazler: *original map value to params
[12:36:51] nickjj: if that's the case, should i just match on params without the auth email bits?
[12:36:57] Gazler: Well, that depends.
[12:37:23] Gazler: If you want to do something else in the absence of `%{"auth" => %{"email" => ...}}` then you'd likely have a different function head.
[12:37:27] nickjj: in this case all i care about is the email address (it's a sign in page with magic links) , but i want to support an optional ?next param to handle custom redirects
[12:37:42] Gazler: nickjj: Is the email address missing a valid case?
[12:37:42] nickjj: but that next param is optional
[12:38:15] nickjj: technically that shouldn't happen due to the changeset validating that
[12:40:37] griffinbyatt: has joined #elixir-lang
[12:40:54] Gazler: nickjj: You can do something like this https://gist.github.com/Gazler/9b78e24d5df284ee95c75096846c4918
[12:43:33] benwilson512: gazler: case params
[12:44:09] nickjj: btw when i IO.inspect(params) in this case , the querystring next isn't included when i post the form , but i guess that's standard -- i'd have to set up a hidden form field since this is a POST?
[12:44:27] Gazler: query string should definitely be included.
[12:44:43] Gazler: params = body params, path params and query string params.
[12:45:10] nickjj: oh i think i see what's happening
[12:45:11] Gazler: There are separate fields on conn for the individual ones, but most of the time you can use params.
[12:45:26] nickjj: i put ?next=/foo in the URL , but that only takes care of serving the get request to render the form
[12:45:49] Gazler: Yeah, I'd put that in a hidden field.
[12:45:59] nickjj: the form action is still set to action="/signin"
[12:46:45] Gazler: Although if you want it to work for page reloads, you can put it in the query string of the action.
[12:48:38] nickjj: right, this worked in the form's template , auth_path(@conn, :new, next: @conn.params["next"])
[12:48:57] nickjj: probably need to clean it to make it more robust (i didn't test if it doesn't exist, etc.)
[12:57:19] Adkron: has joined #elixir-lang
[12:58:14] _barcode_: has joined #elixir-lang
[12:59:57] greengriminal: has joined #elixir-lang
[13:46:12] Guest42: has joined #elixir-lang
[13:46:53] bkhl: has joined #elixir-lang
[13:48:41] Guest42: has joined #elixir-lang
[13:55:28] kyrylo: has joined #elixir-lang
[14:00:27] jeffro_: has joined #elixir-lang
[14:00:29] Adkron: has joined #elixir-lang
[14:01:48] gvaughn: has joined #elixir-lang
[14:02:57] gvaughn: has joined #elixir-lang
[14:06:28] wonko7: has joined #elixir-lang
[14:15:49] work_: has joined #elixir-lang
[14:27:46] jer: has joined #elixir-lang
[14:40:37] revere: has joined #elixir-lang
[15:00:31] tutti: has joined #elixir-lang
[15:01:06] jer: has joined #elixir-lang
[15:08:37] __charly__: has joined #elixir-lang
[15:16:53] drigo: has joined #elixir-lang
[15:39:33] Gika: has joined #elixir-lang
[15:39:33] inoas: has joined #elixir-lang
[15:41:28] aalmazan: has joined #elixir-lang
[15:41:32] wsieroci: has joined #elixir-lang
[15:51:46] wonko7: has joined #elixir-lang
[15:56:14] icecreamcohen: has joined #elixir-lang
[15:57:13] greengriminal: has joined #elixir-lang
[16:02:33] orbyt_: has joined #elixir-lang
[16:07:48] Adkron: has joined #elixir-lang
[16:24:56] sacredfrog: has joined #elixir-lang
[16:26:10] pera: has joined #elixir-lang
[16:27:09] DTZUZO: has joined #elixir-lang
[16:27:45] tankf33der: has left #elixir-lang: ()
[16:35:46] wonko7: has joined #elixir-lang
[16:35:49] Nicd-: anyone know if BEAM works well in big.LITTLE environments?
[16:36:11] orbyt_: has joined #elixir-lang
[16:36:25] Nicd-: guess you can't at least start as many threads as there are cores since some cores are slower
[16:42:35] micmus: Nicd-: I know there's some code during BEAM startup where it tries to discover processor and memory topology, but I have no idea how it is later used
[16:58:06] orbyt_: has joined #elixir-lang
[17:11:05] Gika: has joined #elixir-lang
[17:13:02] jimmyrcom: has joined #elixir-lang
[17:50:59] wsieroci: has joined #elixir-lang
[17:52:27] Gika: has joined #elixir-lang
[17:53:09] jeffro: has joined #elixir-lang
[18:03:32] mahmudov: has joined #elixir-lang
[18:11:44] voltone: has joined #elixir-lang
[18:12:02] lexmag: has joined #elixir-lang
[18:14:25] Adkron: has joined #elixir-lang
[18:19:09] pera_: has joined #elixir-lang
[18:26:45] squall: has joined #elixir-lang
[18:34:04] pera: has joined #elixir-lang
[18:39:50] mahmudov: has joined #elixir-lang
[18:42:36] orbyt_: has joined #elixir-lang
[19:07:13] nageV: question regarding GenStage/Flow: if I have a more-than-2-stages partition with key: {:elem, 0} that takes in {true/false, ...} tuples, I would expect only 2 of the stages to receive traffic (the rest should be idle). Is this correct?
[19:07:26] jeffro: has joined #elixir-lang
[19:08:33] nageV: i.e. what happens when you partition two categories of data over more than 2 stages?
[19:09:22] nageV: currently i'm seeing weird behavior where the true/false values are sometimes going to the same stage/reducer... it's probably a bug in my code though :/
[19:18:33] kdisneur: has joined #elixir-lang
[19:20:35] jsehop9: has joined #elixir-lang
[19:42:41] Gika: has joined #elixir-lang
[20:02:36] jeffro: has joined #elixir-lang
[20:08:25] nickjj: i just watched a pretty neat intro talk on telemetry/prom/grafana with elixir , when telemetry officially ships with phoenix will this be the general approach of how things will work? an approach where you would track your events and very likely collect/view them outside of your main database?
[20:13:04] kyrylo: has joined #elixir-lang
[20:20:58] Adkron: has joined #elixir-lang
[20:28:33] cbw[m]: Yeah that will be really cool. As for tracking in your own db, i've always sent them to another db specific for logging
[20:31:24] nickjj: cbw[m], i love the idea of just being able to drop in a telemetry call into a function and have that be all of the application level changes that need to track something new
[20:32:14] nickjj: compare that to writing a migration to save it into a db, creating a new admin controller/view/templates/tests and then rigged up some half baked charting solution
[20:33:52] cbw[m]: nickjj: yeah seriously
[20:36:18] Guest42: has joined #elixir-lang
[20:39:19] ur5us: has joined #elixir-lang
[21:07:57] Sgeo_: has joined #elixir-lang
[21:09:35] jeffro_: has joined #elixir-lang
[21:19:36] tutti: has joined #elixir-lang
[21:20:37] pera: has joined #elixir-lang
[21:44:17] __charly__: has joined #elixir-lang
[21:44:48] ur5us: has joined #elixir-lang
[21:49:04] orbyt_: has joined #elixir-lang
[21:54:31] helmut_1: has joined #elixir-lang
[21:55:23] helmut_1: has left #elixir-lang: ()
[22:03:58] blahdodo: has joined #elixir-lang
[22:06:15] Gika: has joined #elixir-lang
[22:26:26] uplime: Is there any way to use phoenix without npm?
[22:27:14] Adkron: has joined #elixir-lang
[22:35:01] cbw[m]: uplime: npm the registry, or just without any js assets at all?
[22:35:44] ur5us: has joined #elixir-lang
[22:36:04] tutti: has joined #elixir-lang
[22:36:15] uplime: cbw[m]: i haven't used phoenix before, but that implied to me that it would be using node for server side stuff
[22:36:27] uplime: if im mistaken then that works for me
[22:37:20] cbw[m]: uplime: no node, server side stuff is all elixir. The front end assets are bundled with webpack and you can utilize the npm ecosystem on that front, but it doesn't affect the backend
[22:37:39] uplime: oh cool, thats perfect then
[22:38:24] ur5us: has joined #elixir-lang
[22:45:54] micmus: It's nice you can implement NIFs in Rust, but it's even nicer to use ETS that is faster than the rust nif... https://twitter.com/michalmuskala/status/1129518114176155648
[22:47:08] tristanm_: was about to say similar because of the 22 improvements for ordered_set
[22:47:21] tristanm_: curious to see what the comparison is on 22
[22:54:58] ur5us: has joined #elixir-lang
[23:00:11] Exuma: has joined #elixir-lang
[23:01:12] work_: has joined #elixir-lang
[23:01:14] micmus: tristan__: I didn't bench on 22 because the NIF refused to compile on 22 saying it's too new :P
[23:07:09] uplime: is it possible to serve phoenix apps from nginx, like you can with with rails/passenger? or would a reverse proxy have to be used?
[23:26:50] Guest42: has joined #elixir-lang
[23:32:58] Exuma: has joined #elixir-lang