« Back to channel list

#elixir-lang - 21 August 2019

« Back 1 day
[00:00:21] Foxfir3_: I see It now. iex inspects by default, while a compiled program doesnt. Dammit. What a noob mistake.
[00:06:36] Foxfir3_: benwilson512: one more silly question. when using IO.inspect, I get a double output in iex, but not when running a compiled program. How come?
[00:07:02] benwilson512: Foxfir3_: IO.inspect tells the terminal to print a value, and then it also _returns_ the same value
[00:07:22] benwilson512: so you get the first print from IO.inspect itself, and the second from the repl inspecting the returned value of the expression
[00:07:44] benwilson512: IO.inspect returning the value you pass to it rocks for pipes cause you can
[00:07:50] benwilson512: foo |> bar |> IO.inspect |> baz
[00:07:57] benwilson512: and sort of "peak" at intermediate values thhat way
[00:08:36] Foxfir3_: benwilson512: okay. I see. That really neat :)
[00:09:20] ariedler: how is everyone doing ?
[00:28:04] Disorganized: has joined #elixir-lang
[00:34:14] Sentreen: has joined #elixir-lang
[00:40:01] Disorganized: has joined #elixir-lang
[01:02:58] ur5us: has joined #elixir-lang
[01:13:01] ur5us: has joined #elixir-lang
[01:19:37] tomterl: has joined #elixir-lang
[01:25:48] ephemera_: has joined #elixir-lang
[02:09:03] adonis: has joined #elixir-lang
[02:09:25] adonis: I have an Ecto query like this: from ct in Schema.ChatTopic, where: fragment("\'{?}\' <@ participant_ids", ^id)
[02:09:35] adonis: which gives me an error: ERROR 22P02 (invalid_text_representation) invalid input syntax for integer: "$1"
[02:09:51] adonis: Seems the match ^id part is triggering the issue but not sure how to resolve it.
[02:10:45] adonis: the actual db call is Repo.all/2
[02:15:24] ariedler: participant_ids is a range?
[02:15:48] ariedler: sorry, I am unfamiliar with <@ operator
[02:16:07] ariedler: or it is the jsonb thing
[02:25:23] Saukk: has joined #elixir-lang
[02:30:09] adonis: ariedler: participant_ids is a column which has an array of integers
[02:30:13] adonis: in the postgresql db
[02:31:55] adonis: so doing '{id1, id2, id3}' <@ participant_ids basically says where id1, id2, id3 (any of those) are in the participant_ids array in the db.
[02:37:05] Exuma: has joined #elixir-lang
[02:47:14] notzmv: has joined #elixir-lang
[03:46:07] jmcgnh: has joined #elixir-lang
[04:21:03] Sgeo_: has joined #elixir-lang
[04:24:01] jmcgnh_: has joined #elixir-lang
[04:27:03] ariedler: has joined #elixir-lang
[04:39:40] gvaughn: has joined #elixir-lang
[04:54:24] jmcgnh: has joined #elixir-lang
[05:18:31] ur5us: has joined #elixir-lang
[05:28:28] jmcgnh_: has joined #elixir-lang
[05:30:00] Exuma: has joined #elixir-lang
[05:32:57] Exuma: has joined #elixir-lang
[05:49:05] gvaughn: has joined #elixir-lang
[06:14:56] sangoma: has joined #elixir-lang
[06:17:27] lauromoura_: has joined #elixir-lang
[06:28:06] ariedler: has joined #elixir-lang
[06:40:42] xco: has joined #elixir-lang
[06:49:49] ndee: has joined #elixir-lang
[07:12:52] mdbm: has joined #elixir-lang
[07:37:38] gvaughn: has joined #elixir-lang
[07:45:58] mdbm: dysfun, little struggle with FP paradigm again:D How should I make this code work again? var = 1 Enum.each([1..5], fn number -> var = var + number end)
[07:46:17] mdbm: dysfun, the var variable doesn't change
[07:47:35] dysfun: well no, that's pretty typical for an immutable language :p
[07:47:45] dysfun: you want Enum.reduce
[07:48:13] mdbm: ok thank you:)
[07:48:34] serafeim: mdbm: you almost never need to use Enum.each
[07:48:55] dysfun: Enum.each is purely for side effects
[07:49:06] serafeim: keep that in mind. Enum.map Enum.reduce and Enum.filter are your best friends
[07:49:34] dysfun: but in erlang, side effects do not include 'mutating an existing variable'
[07:49:39] dysfun: that is, our variables are not variable
[07:49:46] jmcgnh: has joined #elixir-lang
[07:50:00] serafeim: dysfun: mutating things should be avoided in general
[07:50:23] serafeim: when you need to mutate something then probably you're doing something wrong
[07:50:24] dysfun: thank you grandma, i had no idea how to suck eggs before
[08:07:53] lexmag: has joined #elixir-lang
[08:10:16] none__: has joined #elixir-lang
[08:25:36] Phylock: has joined #elixir-lang
[08:29:50] lexmag: has joined #elixir-lang
[08:34:15] gvaughn: has joined #elixir-lang
[08:34:58] jmcgnh: has joined #elixir-lang
[08:39:29] mdbm_: has joined #elixir-lang
[08:42:13] craigp: has joined #elixir-lang
[08:43:14] jmcgnh: has joined #elixir-lang
[08:55:15] isHavvy: has joined #elixir-lang
[09:26:44] jmcgnh_: has joined #elixir-lang
[09:31:37] jmcgnh: has joined #elixir-lang
[09:31:59] mdbm: has joined #elixir-lang
[09:42:59] jmcgnh: has joined #elixir-lang
[09:47:16] jmcgnh: has joined #elixir-lang
[09:50:49] jmcgnh: has joined #elixir-lang
[09:59:06] jmcgnh: has joined #elixir-lang
[09:59:15] craigp: has joined #elixir-lang
[10:07:41] craigp: has joined #elixir-lang
[10:08:02] nox: dysfun: lol
[10:10:26] jmcgnh: has joined #elixir-lang
[10:20:43] gvaughn: has joined #elixir-lang
[10:27:05] jmcgnh: has joined #elixir-lang
[10:29:09] ariedler: has joined #elixir-lang
[10:30:23] lexmag: has joined #elixir-lang
[10:32:31] oetjenj: has joined #elixir-lang
[10:33:28] ndee: has joined #elixir-lang
[10:52:52] tomterl: has joined #elixir-lang
[10:55:08] ariedler: has joined #elixir-lang
[11:09:43] craigp: has joined #elixir-lang
[11:24:09] mahmudov: has joined #elixir-lang
[11:29:05] DanielI: has joined #elixir-lang
[11:33:12] mdbm_: has joined #elixir-lang
[11:52:14] DanielI: has joined #elixir-lang
[12:09:12] gvaughn: has joined #elixir-lang
[12:30:36] duane: has joined #elixir-lang
[12:50:12] Foxfir3_: has joined #elixir-lang
[12:50:22] Foxfir3_: how do I call a function from another file?
[12:53:13] Foxfir3_: has joined #elixir-lang
[12:53:42] Foxfir3_: is freenode tad unstable today?
[12:54:19] Foxfir3_: hi guys. using functions from other exs files. How do I do that?
[12:55:54] Foxfir3_: anyone here playing with Elixir and GIS?
[13:04:11] Foxfir3: has joined #elixir-lang
[13:07:20] Foxfir3: how to use a function from another exs file in an exs file?
[13:07:31] Foxfir3: Sorry. It sounds so basic.
[13:11:14] adkron_: has joined #elixir-lang
[13:23:51] josevalim: Foxfir3: you have to require the other .exs file before
[13:23:57] josevalim: but that's unusual
[13:24:12] josevalim: we usually call `mix new my_project` and put all of the code inside lib under .ex files
[13:24:13] mdbm_: has joined #elixir-lang
[13:24:18] josevalim: then you don't need to require aything
[13:37:13] Foxfir3: josevalim: thanks. I see now that the end goal is the reason for that, and to avoid learning bad habits.
[13:38:07] Foxfir3: while obiwan is here. any Elixir/GIS projekcts I can take a look at?
[13:45:15] gvaughn: has joined #elixir-lang
[13:53:06] duane: has joined #elixir-lang
[14:09:07] mdbm_: is it possible to pattern match on a struct and on a map, I mean have two different functions who will be called whether a map is given or a struct?
[14:09:40] gamache: mdbm_: look for %{__struct__: YourStructName} in the latter case
[14:10:03] gamache: you can also match on %YourStructName{} if you want to do it that way
[14:10:40] mdbm_: gamache, it can be any Ecto Schema struct, so I'll just try %{__struct__: StructName} then
[14:10:59] gamache: works for me :)
[14:13:31] infowolfe: has joined #elixir-lang
[14:14:02] Adkron: has joined #elixir-lang
[14:15:55] Ninja3047_: has joined #elixir-lang
[14:15:55] bkhl_: has joined #elixir-lang
[14:17:19] kaniini: has joined #elixir-lang
[14:17:34] rpip: has joined #elixir-lang
[14:17:47] esainane: has joined #elixir-lang
[14:17:51] lackac: has joined #elixir-lang
[14:17:53] OvermindDL1: has joined #elixir-lang
[14:18:01] euphidime: has joined #elixir-lang
[14:18:08] null__: has joined #elixir-lang
[14:18:12] bgmarx: has joined #elixir-lang
[14:18:14] Paradox: has joined #elixir-lang
[14:18:16] HalcyonicStorm: has joined #elixir-lang
[14:18:16] danmcclain_: has joined #elixir-lang
[14:18:16] dignifiedquire: has joined #elixir-lang
[14:18:16] masteinhauser: has joined #elixir-lang
[14:18:17] ericentin: has joined #elixir-lang
[14:18:20] enilsen16_: has joined #elixir-lang
[14:18:22] teadrop_____: has joined #elixir-lang
[14:18:40] davic: has joined #elixir-lang
[14:18:43] wizonesolutions: has joined #elixir-lang
[14:18:45] bbielsa___: has joined #elixir-lang
[14:18:54] akraut: has joined #elixir-lang
[14:19:00] whatyouhide: has joined #elixir-lang
[14:19:05] mikl: has joined #elixir-lang
[14:19:05] benwilson512: has joined #elixir-lang
[14:19:18] FMJz___: has joined #elixir-lang
[14:19:23] manveru: has joined #elixir-lang
[14:19:24] gjnoonan: has joined #elixir-lang
[14:19:25] nocsi: has joined #elixir-lang
[14:19:32] antranigv: has joined #elixir-lang
[14:19:36] v: has joined #elixir-lang
[14:19:38] alunduil: has joined #elixir-lang
[14:19:39] Brend: has joined #elixir-lang
[14:19:42] rfv: has joined #elixir-lang
[14:19:50] jeregrine: has joined #elixir-lang
[14:19:52] ahills: has joined #elixir-lang
[14:20:02] bytesighs: has joined #elixir-lang
[14:20:19] CornishPasty: has joined #elixir-lang
[14:20:52] ilkka: has joined #elixir-lang
[14:22:03] mdbm_: gamache, if I assign something into conn, typically I'll have conn.assign.some_var in my controller action? just seems long (I assign the locale in the conn and must often do conn.assign.locale I think)
[14:23:31] gamache: I don't know a better way
[14:23:48] gamache: and c'mon, conn.assigns.locale isn't _that_ long :)
[14:25:44] benwilson512: you can also pass simply the `assigns` into a function
[14:25:58] benwilson512: which also decouples it from depending on the conn itself
[14:26:13] benwilson512: in general I try to only pass the `conn` to functions that return `conn`s
[14:26:14] boeg: has joined #elixir-lang
[14:26:16] tvon: has joined #elixir-lang
[14:26:47] sasajuric: has joined #elixir-lang
[14:26:54] micmus: has joined #elixir-lang
[14:33:22] sasajuric: has joined #elixir-lang
[14:34:55] tvon: has joined #elixir-lang
[14:35:25] wsieroci: has joined #elixir-lang
[14:36:45] felideon: has joined #elixir-lang
[14:36:57] esainane: has joined #elixir-lang
[14:37:15] wsieroci: has joined #elixir-lang
[14:46:12] sangoma: has joined #elixir-lang
[14:48:48] proteusdude: has joined #elixir-lang
[14:50:15] vieira: has joined #elixir-lang
[14:51:50] xco: has joined #elixir-lang
[14:56:22] duane: has joined #elixir-lang
[14:56:23] namosca: has joined #elixir-lang
[14:58:28] namosca: Ankehrs: Hi
[14:58:32] namosca: I installed an old version by accident of phoenix and now I want to update it in a clean way. I did "mix archive uninstall phx_new", but when I triz now to do "mix archive.install hex phx_new 1.4.9", I get a question about having found an existing entry, which is "Are you sure you want to replace it with "phx_new-1.4.9.ez"?". I have a feeling this will not get a clean install on the end. Wha tis the proper way of doing it?
[14:59:18] benwilson512: namosca: replacing archives is a clean operation, it should be fine
[14:59:31] benwilson512: all that you install is the project generator
[14:59:44] benwilson512: when you're actually in a project it doesn't use the archive at all, it uses whatever is in your mix file
[15:01:06] namosca: benwilson512: How would I do this?
[15:02:06] namosca: benwilson512: I accepted the replace... now I got curious about the project generator
[15:22:38] adkron_: has joined #elixir-lang
[15:36:33] benwilson512: namosca: how would you do what?
[15:39:38] KeyJoo: has joined #elixir-lang
[15:51:08] Adkron: has joined #elixir-lang
[15:54:45] silviurosu: has joined #elixir-lang
[16:03:40] wsieroci: has joined #elixir-lang
[16:14:21] silviurosu: has joined #elixir-lang
[16:14:45] silviurosu: has joined #elixir-lang
[16:15:28] silviurosu: has joined #elixir-lang
[16:16:15] silviurosu: has joined #elixir-lang
[16:17:02] silviurosu: has joined #elixir-lang
[16:17:50] silviurosu: has joined #elixir-lang
[16:18:37] silviurosu: has joined #elixir-lang
[16:19:24] silviurosu: has joined #elixir-lang
[16:20:11] wsieroci: has joined #elixir-lang
[16:20:11] silviurosu: has joined #elixir-lang
[16:20:59] silviurosu: has joined #elixir-lang
[16:21:25] pera: has joined #elixir-lang
[16:21:50] silviurosu: has joined #elixir-lang
[16:22:08] lexmag: has joined #elixir-lang
[16:22:33] silviurosu: has joined #elixir-lang
[16:23:21] silviurosu: has joined #elixir-lang
[16:24:08] silviurosu: has joined #elixir-lang
[16:24:56] silviurosu: has joined #elixir-lang
[16:25:46] silviurosu: has joined #elixir-lang
[16:26:30] silviurosu: has joined #elixir-lang
[16:27:17] silviurosu: has joined #elixir-lang
[16:28:05] silviurosu: has joined #elixir-lang
[16:28:31] orbyt_: has joined #elixir-lang
[16:28:52] silviurosu: has joined #elixir-lang
[16:29:40] silviurosu: has joined #elixir-lang
[16:30:27] silviurosu: has joined #elixir-lang
[16:31:14] silviurosu: has joined #elixir-lang
[16:32:01] silviurosu: has joined #elixir-lang
[16:32:49] silviurosu: has joined #elixir-lang
[16:33:36] silviurosu: has joined #elixir-lang
[16:34:24] silviurosu: has joined #elixir-lang
[16:35:11] silviurosu: has joined #elixir-lang
[16:35:58] silviurosu: has joined #elixir-lang
[16:36:45] silviurosu: has joined #elixir-lang
[16:37:33] silviurosu: has joined #elixir-lang
[16:38:20] silviurosu: has joined #elixir-lang
[16:39:08] silviurosu: has joined #elixir-lang
[16:39:54] silviurosu: has joined #elixir-lang
[16:40:46] silviurosu: has joined #elixir-lang
[16:41:30] silviurosu: has joined #elixir-lang
[16:42:17] silviurosu: has joined #elixir-lang
[16:43:04] silviurosu: has joined #elixir-lang
[16:43:51] silviurosu: has joined #elixir-lang
[16:44:39] silviurosu: has joined #elixir-lang
[16:45:26] silviurosu: has joined #elixir-lang
[16:46:14] silviurosu: has joined #elixir-lang
[16:47:01] silviurosu: has joined #elixir-lang
[16:47:48] silviurosu: has joined #elixir-lang
[16:48:36] silviurosu: has joined #elixir-lang
[16:49:23] silviurosu: has joined #elixir-lang
[16:50:10] silviurosu: has joined #elixir-lang
[16:56:43] Saukk: has joined #elixir-lang
[17:12:09] jdrab: has joined #elixir-lang
[17:14:39] Disorganized: has joined #elixir-lang
[17:16:38] adkron_: has joined #elixir-lang
[17:19:10] jdrab: has joined #elixir-lang
[17:20:36] lexmag: has joined #elixir-lang
[17:32:08] Bounga: has joined #elixir-lang
[17:32:27] theWhisper_: has joined #elixir-lang
[17:41:05] silviurosu: has joined #elixir-lang
[17:56:32] xco: has joined #elixir-lang
[18:25:49] dsr760250781: has joined #elixir-lang
[18:31:41] averell: has joined #elixir-lang
[18:51:01] mahmudov: has joined #elixir-lang
[18:52:03] adkron_: has joined #elixir-lang
[18:54:27] duane: has joined #elixir-lang
[19:05:41] ryjm: has joined #elixir-lang
[19:07:39] elixir1298: has joined #elixir-lang
[19:07:45] elixir1298: When I run `mix hex.outdated --all`, I'm getting a dependency (poison) that seemingly doesn't exist anywhere in my mix.exs or in child deps. `mix deps.tree` doesn't show it anywhere. Any idea what I'm messing up?
[19:15:21] ndee: has joined #elixir-lang
[19:15:58] adkron_: has joined #elixir-lang
[19:19:19] xco: has joined #elixir-lang
[19:23:34] sangoma: has joined #elixir-lang
[19:30:00] pera: has joined #elixir-lang
[19:35:23] pera: has joined #elixir-lang
[19:38:52] fyber: has joined #elixir-lang
[19:42:55] fyber: has joined #elixir-lang
[19:47:24] pera: has joined #elixir-lang
[19:52:37] gamache: Is there a way to specify that a dependency in your Elixir project (or "assembly" if you're pragdave) is started first?
[19:53:32] gamache: My particular use case is very much like the config provider in a release, except I would like it to act in a similar way for `mix phx.server` on the cmdline
[19:53:57] gamache: Load configs from a network store before anything else tries to read configs
[19:55:29] nineczar: has joined #elixir-lang
[19:59:46] jdrab: has joined #elixir-lang
[20:09:38] Sgeo_: has joined #elixir-lang
[20:12:43] sangoma: has joined #elixir-lang
[20:18:18] squallster: has joined #elixir-lang
[20:22:16] aalmazan: has joined #elixir-lang
[20:27:29] mdbm_: has joined #elixir-lang
[20:30:47] ndee: has joined #elixir-lang
[20:46:36] ur5us: has joined #elixir-lang
[20:56:34] pera: has joined #elixir-lang
[21:01:09] squalloster: has joined #elixir-lang
[21:01:43] gamache: This is unrelated to my question above, and I'm not in the habit of announcing software releases here, but: Mojito HTTP client 0.5.0 is out, and it fixes a very yucky bug you don't want to run into. All users should upgrade. No code changes are necessary if you're using 0.3.x or above, though this can't be deployed as a hot upgrade. More details are in the changelog: https://github.com/gamache/freedom_formatter/
[21:02:04] gamache: dammit wrong repo
[21:02:16] gamache: https://github.com/appcues/mojito
[21:13:55] gvaughn: has joined #elixir-lang
[21:35:03] oetjenj: has joined #elixir-lang
[21:35:48] oetjenj: has joined #elixir-lang
[21:36:35] oetjenj: has joined #elixir-lang
[21:40:25] Bounga: has joined #elixir-lang
[21:42:11] jdrab_: has joined #elixir-lang
[21:49:01] Bounga`: has joined #elixir-lang
[21:55:26] Bounga`: has joined #elixir-lang
[21:59:06] sangoma: has joined #elixir-lang
[22:01:50] CapNemo: has joined #elixir-lang
[22:30:59] Disorganized: has joined #elixir-lang