« Back to channel list

#elixir-lang - 04 May 2019

« Back 1 day Forward 1 day »
[00:16:14] benwilson512: also_uplime: if what you're saying is treating the task like a mutable variable then you probably don't want to do that
[00:16:34] benwilson512: embrace the functional programming, particularly for parsers
[00:17:16] also_uplime: how would you tokenize a string functional style? I'm coming from ruby so this is a bit new to me
[00:17:37] also_uplime: (i don't need specific code, but a general method/article would be great)
[00:18:35] benwilson512: also_uplime: tail recursive function with an accumulator argument that's a list, when you emit a new token you just shove it on the front of the list. when you're done you reverse the list
[00:19:14] benwilson512: also_uplime: also, welcome!
[00:20:57] also_uplime: thanks! I'll do some more research on that. is there an elixir-ish way to iterate through the bytes of a bitstring other than just recursing with something like .at or .slice?
[00:22:20] benwilson512: also_uplime: absolutely! binary pattern matching, it's awesome
[00:22:29] benwilson512: one sec let me find you an example
[00:22:42] also_uplime: oh, i read about that, but totally forgot about it. that would be great, thank you
[00:24:59] benwilson512: also_uplime: I'll first note that you can do `String.codepoints(input)` on your string and get a list of utf8 codepoints
[00:25:07] benwilson512: and then you can do normal list recursion
[00:25:08] benwilson512: at that point
[00:25:50] benwilson512: also_uplime: https://medium.com/@harry_dev/elixir-for-rubyists-charlists-binarys-strings-iolists-eeacf38db999 is a bit long winded but it covers some binary pattern matching examples
[00:25:58] Guest42: has joined #elixir-lang
[00:26:33] benwilson512: also_uplime: search for "Below is an example"
[00:26:47] also_uplime: thanks! I'll look into all of that. much appreciated!
[00:37:08] ur5us: has joined #elixir-lang
[00:38:37] pera: has joined #elixir-lang
[00:44:02] craigp: has joined #elixir-lang
[01:01:33] pmbauer: has joined #elixir-lang
[01:05:48] jmcgnh: has joined #elixir-lang
[01:06:25] carldd: has joined #elixir-lang
[01:11:58] jmcgnh: has joined #elixir-lang
[01:18:52] jmcgnh: has joined #elixir-lang
[01:33:14] FMJz_: has joined #elixir-lang
[01:53:49] greengriminal: has joined #elixir-lang
[01:56:55] skagerak: has joined #elixir-lang
[01:59:53] tomterl: has joined #elixir-lang
[02:13:41] conceivably: has joined #elixir-lang
[02:34:53] tomterl: has joined #elixir-lang
[02:39:46] griffinbyatt: has joined #elixir-lang
[02:48:14] t7ioto: has joined #elixir-lang
[02:57:03] Boby: has joined #elixir-lang
[03:00:54] tomterl: has joined #elixir-lang
[03:05:38] blahdodo: has joined #elixir-lang
[03:22:14] carldd: has joined #elixir-lang
[03:44:45] ur5us: has joined #elixir-lang
[03:49:55] tomterl: has joined #elixir-lang
[03:53:42] contextCue: has joined #elixir-lang
[03:54:36] contextCue: is IO a library?
[03:54:44] skagerak: has joined #elixir-lang
[03:54:44] skagerak: has joined #elixir-lang
[03:54:58] contextCue: or does it represent the input output space of your machine?
[03:55:12] Guest42: has joined #elixir-lang
[03:58:41] contextCue: is IO a library built into the language?
[03:58:47] also_uplime: is there a way to use put_in for non-keyword lists?
[03:59:18] also_uplime: like if I have [[abcd, efgh], [ijkl, mnop]] and I wanted to change ijkl to qrst
[03:59:20] contextCue: nvrmind I looked it up
[04:04:24] ur5us: has joined #elixir-lang
[04:06:52] jeffro: has joined #elixir-lang
[04:09:09] ur5us: has joined #elixir-lang
[04:09:58] jameshaydon: has joined #elixir-lang
[04:10:50] whatyouhide: has joined #elixir-lang
[04:11:16] marten: has joined #elixir-lang
[04:11:43] timwis: has joined #elixir-lang
[04:11:56] tomterl: has joined #elixir-lang
[04:31:29] wsieroci: has joined #elixir-lang
[04:33:30] Saukk: has joined #elixir-lang
[04:37:57] jeffro: has joined #elixir-lang
[05:14:31] gde33: has joined #elixir-lang
[05:17:11] Moondhum: has left #elixir-lang: ("Leaving")
[05:17:40] proteusguy: has joined #elixir-lang
[05:25:48] jnoon2: has joined #elixir-lang
[05:51:02] gvaughn: has joined #elixir-lang
[05:51:17] oijoij: has joined #elixir-lang
[06:04:39] mdbm: has joined #elixir-lang
[06:04:58] mdbm: I got the error: ** (FunctionClauseError) no function clause matching in GenServer.whereis/1
[06:05:04] mdbm: but I don't understand what's wrong
[06:06:03] mdbm: https://pastebin.com/tR8fgSXT
[07:04:07] Nicd-: mdbm: start_link returns a tuple
[07:04:21] Nicd-: The pid is the second element
[07:05:08] mdbm: ffs... thanks Nicd-
[07:05:33] Nicd-: The error tells you that
[07:05:53] Nicd-: It tells you what arguments were given to the function
[07:07:01] mdbm: Nicd-, yeah I didn't understand it
[07:07:25] Nicd-: Now you know :)
[07:12:24] lexmag: has joined #elixir-lang
[07:40:16] PragTob: has joined #elixir-lang
[07:50:44] gvaughn: has joined #elixir-lang
[07:55:00] shiro[cloud]: has joined #elixir-lang
[08:18:36] squall: has joined #elixir-lang
[08:21:06] DukeDave: has joined #elixir-lang
[08:21:42] asonge: has joined #elixir-lang
[08:28:48] kyrylo: has joined #elixir-lang
[08:35:33] tomterl: has joined #elixir-lang
[08:50:01] lexmag: has joined #elixir-lang
[08:54:00] mdbm: has joined #elixir-lang
[08:55:10] gvaughn: has joined #elixir-lang
[09:02:15] uplime: has joined #elixir-lang
[09:03:38] uplime: benwilson512: you're probably asleep, but thanks for the suggestions. it lead to https://github.com/ntchambers/whiskey/blob/master/lib/sexpr.ex which works surprisingly well
[09:29:08] wsieroci: has joined #elixir-lang
[09:30:16] Sigma-: has joined #elixir-lang
[09:54:39] Sgeo_: has joined #elixir-lang
[09:57:59] CornishPasty: has joined #elixir-lang
[09:58:05] marten: has joined #elixir-lang
[10:00:25] jhill: has joined #elixir-lang
[10:00:27] dch: has joined #elixir-lang
[10:01:27] benoitc: has joined #elixir-lang
[10:01:32] ckrailo: has joined #elixir-lang
[10:02:04] strmpnk: has joined #elixir-lang
[10:07:27] blahdodo: has joined #elixir-lang
[10:15:56] micmus: has joined #elixir-lang
[10:23:12] wsieroci: has joined #elixir-lang
[10:33:10] gvaughn: has joined #elixir-lang
[10:41:06] tnez: has joined #elixir-lang
[10:44:18] dch: has joined #elixir-lang
[10:50:35] kapil____: has joined #elixir-lang
[11:02:38] tomterl: has joined #elixir-lang
[11:06:24] craigp_: has joined #elixir-lang
[11:09:08] wsieroci: has joined #elixir-lang
[11:34:57] Moondhum: has joined #elixir-lang
[11:35:13] Moondhum: has left #elixir-lang: ("ERC (IRC client for Emacs 26.2)")
[11:38:13] __charly__: has joined #elixir-lang
[11:43:52] wsieroci: has joined #elixir-lang
[11:45:34] gvaughn: has joined #elixir-lang
[11:58:12] netrino: has joined #elixir-lang
[12:03:14] mdbm: has joined #elixir-lang
[12:09:17] ur5us: has joined #elixir-lang
[12:23:39] markmm: has joined #elixir-lang
[12:34:48] bars0: has joined #elixir-lang
[12:37:18] bars0: has joined #elixir-lang
[12:41:48] bars0: has joined #elixir-lang
[12:47:51] __charly__: has joined #elixir-lang
[12:55:06] hypercore: how can i force a value of either Integer or String to always return Integer?
[12:55:29] hypercore: i.e. if x = "1" or x = 1, x |> some_func.() returns 1
[12:57:05] kyrylo: has joined #elixir-lang
[13:05:39] lpil: You could parse it if it's a string but it's possible that the string may not be an int
[13:06:45] benwilson512: hypercore: what happens if you can't parse the string?
[13:21:00] PragTob: has joined #elixir-lang
[13:23:06] hypercore: benwilson512: then it throws an error
[13:23:25] lexmag: has joined #elixir-lang
[13:23:39] hypercore: basically i want a way of calling a context method by parsing in id that's either an integer or a string (from a param)
[13:24:05] hypercore: e.g. Users.get_user(id), which works for both id = 1 and id = "1"
[13:26:31] benwilson512: hypercore: ecto already translates that for you
[13:28:00] hypercore: benwilson512: oh i think it's because i use the value in a query
[13:29:42] benwilson512: hypercore: ah. in any case, what have you tried so far for your `some_func`
[13:29:53] benwilson512: we're happy to help but it's simple enough that you should definitely take a crack at it yourself first
[13:30:18] benwilson512: `User |> where(id: ^"1") |> Repo.one` works totally fine for me btw
[13:34:11] hypercore: benwilson512: i'm doing Repo.get!(User, id)
[13:34:16] hypercore: where id = "1"
[13:34:22] greengriminal: has joined #elixir-lang
[13:34:40] lexmag: has joined #elixir-lang
[13:34:44] hypercore: hmm apparently the query was called in another function...
[13:35:19] hypercore: benwilson512: which apparently works in iex...
[13:35:57] mdbm: what does this line do (just below defmodule) : @server Sequence.Server
[13:36:06] mdbm: what is @server ?
[13:36:10] hypercore: benwilson512: probably doing something stupid, i'll figure it out ;)
[13:37:45] gvaughn: has joined #elixir-lang
[13:40:56] lexmag: has joined #elixir-lang
[13:51:41] lexmag: has joined #elixir-lang
[13:51:50] gabrielpoca: has joined #elixir-lang
[14:12:40] Sgeo: has joined #elixir-lang
[14:14:43] wsieroci: has joined #elixir-lang
[14:20:51] tnez: has joined #elixir-lang
[14:20:54] mahmudov: has joined #elixir-lang
[14:40:30] mdbm: has joined #elixir-lang
[14:42:21] serafeim: has joined #elixir-lang
[14:42:43] serafeim: hello, can i use channels from my phoenix app *without* webpack ?
[14:43:24] serafeim: has joined #elixir-lang
[14:44:00] serafeim: sorry got isconnected
[14:44:16] serafeim: i.e is there a way to use Socket from vanilla js ? i really hate the node.js ecosystem
[14:48:55] gvaughn: has joined #elixir-lang
[14:51:37] serafeim: hmm it seems that I can just use Phoenix.socket :)
[15:10:00] gvaughn: has joined #elixir-lang
[15:17:44] kyrylo: has joined #elixir-lang
[15:49:40] lexmag: has joined #elixir-lang
[15:55:39] lexmag: has joined #elixir-lang
[16:01:14] lexmag: has joined #elixir-lang
[16:05:47] markmm: has joined #elixir-lang
[16:11:18] wsieroci_: has joined #elixir-lang
[16:14:51] lexmag: has joined #elixir-lang
[16:21:28] lexmag: has joined #elixir-lang
[16:34:01] lexmag: has joined #elixir-lang
[16:48:16] griffinbyatt: has joined #elixir-lang
[16:53:10] lexmag: has joined #elixir-lang
[17:01:47] OvermindDL1: has joined #elixir-lang
[17:07:43] Sgeo_: has joined #elixir-lang
[17:16:23] gde33: has joined #elixir-lang
[17:26:59] markmm: has joined #elixir-lang
[17:41:30] lexmag: has joined #elixir-lang
[17:46:55] lexmag: has joined #elixir-lang
[17:53:05] _barcode_: has joined #elixir-lang
[17:55:22] Randyr: has joined #elixir-lang
[17:55:41] lexmag: has joined #elixir-lang
[18:00:01] hypercore: has joined #elixir-lang
[18:09:06] squall: has joined #elixir-lang
[18:16:57] jnoon2: has joined #elixir-lang
[18:18:04] blahdodo: has joined #elixir-lang
[18:18:29] jnoon2: has joined #elixir-lang
[18:54:32] drewolson: ericmj: i'm seeing some strange behavior with `mix hex.outdated`
[18:54:34] drewolson: https://gist.github.com/drewolson/c6268137067f6a8627ab395f0ae6825d
[18:55:03] drewolson: note my version constraints on ecto and ecto_sql, but `mix hex.outdated` is telling me that ecto cannot update automatically
[18:56:35] drewolson: ericmj: mix deps.update --all still updated it :)
[18:57:50] notzmv: has joined #elixir-lang
[19:01:59] ariedler: has joined #elixir-lang
[19:23:54] greengriminal: has joined #elixir-lang
[19:30:49] jmcgnh: has joined #elixir-lang
[19:31:22] lexmag: has joined #elixir-lang
[19:39:16] lexmag: has joined #elixir-lang
[19:40:57] jmcgnh: has joined #elixir-lang
[19:45:34] jmcgnh: has joined #elixir-lang
[19:46:51] gvaughn: has joined #elixir-lang
[19:53:32] orbyt_: has joined #elixir-lang
[20:03:18] jmcgnh: has joined #elixir-lang
[20:03:48] kyrylo: has joined #elixir-lang
[20:08:05] jmcgnh: has joined #elixir-lang
[20:09:52] tutti1: has joined #elixir-lang
[20:13:04] jmcgnh: has joined #elixir-lang
[20:13:56] jnoon2: i have an umbrella app with a phx app, so apps/myapp_web, apps/my_app, apps/myapp_other, etc. one thing i get confused about is the proper place to run the generators. does anyone know if they are always supposed to be run from within myapp_web?
[20:14:23] benwilson512: drewolson: it could be that a different dependency limited ecto
[20:14:35] benwilson512: drewolson: but when you did update --all that other dep updated, allowing ecto to update
[20:18:41] jmcgnh: has joined #elixir-lang
[20:40:38] BitBot: has joined #elixir-lang
[20:57:22] orbyt_: has joined #elixir-lang
[21:10:22] mahmudov: has joined #elixir-lang
[21:20:38] craigp_: has joined #elixir-lang
[21:21:48] wsieroci: has joined #elixir-lang
[22:07:13] greengriminal: has joined #elixir-lang
[22:10:39] orbyt_: has joined #elixir-lang
[22:20:19] also_uplime: has joined #elixir-lang
[22:28:55] OliverMT: benwilson512: hey! is there a way to see if you have a specific ancestor in a query? like if chain is A B C D and I in the resolver for D want to know if A was an ancestor in the query or not
[22:29:17] OliverMT: benwilson512: erm, that was worded poorly, point is that D can also be loaded from a query that goes like X B C D
[22:30:24] OliverMT: nvm I already solved this incidentally by augmenting the chain passed auth lol
[22:33:22] OliverMT: benwilson512: new question, whats the idiomatic way to alter context in the middle of resolver chain?
[22:34:25] OliverMT: benwilson512: if that is even possible that is, that all children of a node has an updated context
[22:35:47] ariedler: has joined #elixir-lang
[22:36:00] theWhisper__: has joined #elixir-lang
[22:51:11] okeuday_bak: has joined #elixir-lang
[23:16:35] benwilson512: OliverMT: totally possible, you just have to do it from middleware, you can't do so from the resolver directly
[23:16:55] benwilson512: notably however it affects not just all children but _all_ subsequent siblings generally
[23:18:10] BitBot: has joined #elixir-lang
[23:42:24] laut: has joined #elixir-lang