« Back to channel list

#elixir-lang - 17 July 2019

« Back 1 day Forward 1 day »
[00:35:14] craigp: has joined #elixir-lang
[00:47:00] icecreamcohen: has joined #elixir-lang
[00:47:14] foggyboi: has joined #elixir-lang
[01:15:02] orbyt_: has joined #elixir-lang
[01:59:50] toor_: has joined #elixir-lang
[02:00:34] toor_: has left #elixir-lang: ()
[02:01:40] tomterl: has joined #elixir-lang
[02:02:17] kstatz12: has joined #elixir-lang
[02:10:29] tux3do: has joined #elixir-lang
[02:13:43] greengriminal: has joined #elixir-lang
[02:32:45] griffinbyatt: has joined #elixir-lang
[02:36:25] Saukk: has joined #elixir-lang
[02:40:02] Exuma: has joined #elixir-lang
[02:49:42] foggyboi: has joined #elixir-lang
[03:07:42] griffinbyatt: has joined #elixir-lang
[03:10:50] ariedler: has joined #elixir-lang
[04:01:33] greengriminal: has joined #elixir-lang
[04:03:48] jeffweiss: has joined #elixir-lang
[04:05:58] DTZUZO: has joined #elixir-lang
[04:07:16] greengriminal: has joined #elixir-lang
[04:13:23] Supitto: has joined #elixir-lang
[04:19:22] kiltzman: has joined #elixir-lang
[04:38:12] kiltzman: has joined #elixir-lang
[04:48:35] ur5us: has joined #elixir-lang
[04:51:49] jeffweiss: has joined #elixir-lang
[04:58:50] jeffweiss: has joined #elixir-lang
[05:01:50] absolutejam: has joined #elixir-lang
[05:05:19] jeffweiss: has joined #elixir-lang
[05:11:30] gvaughn: has joined #elixir-lang
[05:12:12] ariedler: has joined #elixir-lang
[05:14:52] absolutejam: has joined #elixir-lang
[05:43:46] gvaughn: has joined #elixir-lang
[05:46:48] voltone: has joined #elixir-lang
[06:01:26] sangoma: has joined #elixir-lang
[06:01:37] griffinbyatt: has joined #elixir-lang
[06:03:54] Jetimon: has joined #elixir-lang
[06:12:48] Jetimon_: has joined #elixir-lang
[06:17:41] Jetimon: has joined #elixir-lang
[06:21:32] Jetimon_: has joined #elixir-lang
[06:25:23] Jetimon__: has joined #elixir-lang
[06:33:36] Jetimon__: has joined #elixir-lang
[06:39:58] foggyboi: has joined #elixir-lang
[06:41:04] proteusguy: has joined #elixir-lang
[06:47:12] jeffweiss: has joined #elixir-lang
[06:47:47] tuacker: has joined #elixir-lang
[06:49:25] ur5us: has joined #elixir-lang
[06:57:28] jegaxd26: has joined #elixir-lang
[07:03:05] ur5us: has joined #elixir-lang
[07:04:52] voltone: has joined #elixir-lang
[07:07:06] absolutejam: has joined #elixir-lang
[07:07:32] absolutejam1: has joined #elixir-lang
[07:13:06] ariedler: has joined #elixir-lang
[07:16:15] jegaxd26: has joined #elixir-lang
[07:26:45] gremly: has joined #elixir-lang
[07:28:10] serafeim: good morning
[07:34:13] Gazler: has joined #elixir-lang
[07:45:35] Sgeo_: has joined #elixir-lang
[07:45:48] lexmag: has joined #elixir-lang
[07:46:13] craigp: (・_・)ノ
[07:51:59] shmink: has joined #elixir-lang
[08:18:09] jeffweiss: has joined #elixir-lang
[08:25:35] lexmag: has joined #elixir-lang
[08:26:29] gvaughn: has joined #elixir-lang
[08:30:42] absolutejam: has joined #elixir-lang
[09:05:02] absolutejam: has joined #elixir-lang
[09:07:38] ur5us: has joined #elixir-lang
[09:09:53] DTZUZO: has joined #elixir-lang
[09:11:58] ubert: has joined #elixir-lang
[09:13:25] jegaxd26: has joined #elixir-lang
[09:13:50] ariedler: has joined #elixir-lang
[09:32:54] jkva: has joined #elixir-lang
[09:40:20] lexmag: has joined #elixir-lang
[09:53:15] shmink: has joined #elixir-lang
[10:02:39] lexmag: has joined #elixir-lang
[10:04:27] absolutejam: has joined #elixir-lang
[10:05:31] jegaxd26: has joined #elixir-lang
[10:13:30] za1b1tsu: has joined #elixir-lang
[10:14:52] za1b1tsu: if anyone has any experience with yeex, can you help me with this: https://pastebin.com/raw/NmCwV40n ?
[10:15:02] za1b1tsu: I really don't understand what's the problem
[10:20:16] shmink: has joined #elixir-lang
[10:25:15] jegaxd26: has joined #elixir-lang
[10:26:51] josevalim: za1b1tsu: you ahve to use single quotes
[10:26:56] josevalim: `',asdfs,'`
[10:27:05] josevalim: double quotes in erlang are single quotes in elixir
[10:28:50] za1b1tsu: ok, thank you for that, should I learn erlang to use yeex?
[10:29:25] dysfun: you basically know it apart from the syntax
[10:35:18] voltone: has joined #elixir-lang
[10:40:23] absolutejam: has joined #elixir-lang
[10:45:26] lexmag: has joined #elixir-lang
[10:51:41] absolutejam: has joined #elixir-lang
[10:55:08] ariedler: has joined #elixir-lang
[10:59:35] mdbm: has joined #elixir-lang
[11:11:32] craigp: has joined #elixir-lang
[11:23:26] kiltzman: has joined #elixir-lang
[11:32:09] voltone: has joined #elixir-lang
[11:47:51] absolutejam1: ugh, if I move my `FooWeb.Endpoint.subscribe(...)` call from `mount/2` (LiveView) to my GenServer, the GenServer then receives any `handle_info` calls...
[11:48:08] absolutejam1: or could it be because I'm not instantiating the GenServer in the `mount/2` call but in a supervisor...
[12:07:30] lexmag: has joined #elixir-lang
[12:10:37] benwilson512: absolutejam1: what's the scenario?
[12:12:07] za1b1tsu: has joined #elixir-lang
[12:14:27] za1b1tsu_: has joined #elixir-lang
[12:17:45] shmink: has joined #elixir-lang
[12:20:52] ephemera_: has joined #elixir-lang
[12:21:24] absolutejam1: I need to reason about it a bit more. Just kinda lopped and chopped some code from one location to another
[12:21:34] absolutejam1: I'll come back to it shortly
[12:24:52] Phylock: has joined #elixir-lang
[12:26:11] warmwaffles: has joined #elixir-lang
[12:40:56] duane: has joined #elixir-lang
[12:56:29] tomterl: has joined #elixir-lang
[13:03:17] jeffweiss: has joined #elixir-lang
[13:05:05] mdbm_: has joined #elixir-lang
[13:20:36] mdbm__: has joined #elixir-lang
[13:21:48] lexmag: has joined #elixir-lang
[13:29:08] drincruz_: has joined #elixir-lang
[13:43:32] mdbm_: has joined #elixir-lang
[13:47:38] gvaughn: has joined #elixir-lang
[13:47:42] greengriminal: has joined #elixir-lang
[13:49:16] lexmag: has joined #elixir-lang
[13:58:14] davic: I have been trying to get mix releases to work with 1.9.0
[13:58:34] davic: the applications are loaded etc, but they arent started and no logging is returned as of why they arent starting
[13:58:46] jeffweiss: has joined #elixir-lang
[13:59:36] jeffweiss: has joined #elixir-lang
[14:10:36] lexmag: has joined #elixir-lang
[14:27:33] mdbm__: has joined #elixir-lang
[14:37:15] jeffweiss: has joined #elixir-lang
[14:39:38] Sgeo__: has joined #elixir-lang
[14:40:09] kstatz12: has joined #elixir-lang
[14:44:24] wsieroci: has joined #elixir-lang
[14:54:05] jeffweiss: has joined #elixir-lang
[14:55:20] greengriminal: has joined #elixir-lang
[14:56:07] dch: davic: try setting mmmm ERL_FLAGS="-init_debug" and re-starting the release, maybe you see some information.
[15:01:32] davic: dch: I found out I did a stupid and forgot server: true in the configs.
[15:01:49] dch: davic: I like it when its a simple fix \o/ excellent find!
[15:01:59] davic: I'm more amazed that it took 4 days to found that out though
[15:02:17] davic: and that I always find the solution after I post it here
[15:02:24] dch: computers are terrible. sometimes having a human beside to help pair is the best
[15:02:32] davic: True that
[15:13:03] Moondhum: has joined #elixir-lang
[15:21:06] tuacker: has joined #elixir-lang
[15:28:58] icecreamcohen: has joined #elixir-lang
[15:32:35] icecreamcohen: has joined #elixir-lang
[15:34:17] jeffweiss: has joined #elixir-lang
[15:35:15] sentreen_: has joined #elixir-lang
[15:36:42] jeffweiss: has joined #elixir-lang
[15:37:12] jeffweiss: has joined #elixir-lang
[15:39:28] Sentreen: has joined #elixir-lang
[15:54:28] orbyt_: has joined #elixir-lang
[15:55:34] Sgeo__: has joined #elixir-lang
[15:55:37] za1b1tsu_: has joined #elixir-lang
[16:05:04] Sgeo_: has joined #elixir-lang
[16:12:35] ilmu: has joined #elixir-lang
[16:26:51] orbyt_: has joined #elixir-lang
[16:27:01] wsieroci: has joined #elixir-lang
[16:34:00] Exuma: has joined #elixir-lang
[16:42:16] foggyboi: has joined #elixir-lang
[16:59:24] Disorganized: has joined #elixir-lang
[17:00:22] Disorganized: has joined #elixir-lang
[17:03:11] foggyboi: has joined #elixir-lang
[17:11:42] Moondhum: has joined #elixir-lang
[17:11:44] Moondhum: has joined #elixir-lang
[17:11:44] Moondhum: has joined #elixir-lang
[17:16:38] absolutejam: has joined #elixir-lang
[17:18:34] Sgeo__: has joined #elixir-lang
[17:21:50] jmcgnh: has joined #elixir-lang
[17:24:14] Moondhum: has joined #elixir-lang
[17:24:32] icecreamcohen: has joined #elixir-lang
[17:35:57] Jetimon__: has joined #elixir-lang
[17:40:20] Mo0ndhum: has joined #elixir-lang
[17:43:43] lexmag: has joined #elixir-lang
[17:47:44] jeffweiss: has joined #elixir-lang
[17:52:19] duane: has joined #elixir-lang
[18:15:23] absolutejam: has joined #elixir-lang
[18:26:03] ankhers: I had this issue previously, but I do not remember the solution. When running mix hex.publish, I am getting an undefined function error for ExDoc.Config.default_formatter/0. I am currently using Elixir 1.8 and ex_doc version 0.18.1.
[18:33:00] wsieroci: has joined #elixir-lang
[18:41:52] sangoma: has joined #elixir-lang
[18:44:00] sangoma: has joined #elixir-lang
[18:44:13] bingobingolotto: has joined #elixir-lang
[18:45:59] bingobingolotto: has joined #elixir-lang
[18:47:12] griffinbyatt: has joined #elixir-lang
[19:02:27] craigp: has joined #elixir-lang
[19:13:33] drincruz_: has joined #elixir-lang
[19:15:56] absolutejam: has joined #elixir-lang
[19:23:08] mahmudov: has joined #elixir-lang
[19:32:09] infowolfe: has joined #elixir-lang
[19:37:14] icecreamcohen: has joined #elixir-lang
[19:44:48] serafeim: let's say i have a string in DDMMYY format (i.e 220682 = 22 may 1982). how can i check if this date is valid ?
[19:45:26] serafeim: i mean i want `is_date_valid("220484")` to return true and `is_date_valid("441231")` to return false
[19:48:03] JuanMiguel: has joined #elixir-lang
[19:48:37] greengriminal: has joined #elixir-lang
[19:49:58] Exuma: has joined #elixir-lang
[19:50:56] rawtaz: serafeim: i found this: https://hexdocs.pm/elixir/Calendar.html#c:valid_date?/3
[19:51:20] serafeim: rawtaz: yes i've also seen this
[19:51:46] serafeim: my problem is how to convert the "220482" string to a format compatible with this... i mean in an idiomatic way
[19:52:27] rawtaz: i dont know but i would presume thats pretty simple, just grab the pair of chars?
[19:54:08] rawtaz: im not sure if this is old, i recall that calendar and stuff was rewritten or added recently, so this might be outdated, but in case it helps: https://stackoverflow.com/questions/40962261/how-to-parse-datetime-in-elixir#40963922
[19:54:48] rawtaz: or this, might be more up to date: https://stackoverflow.com/questions/54852034/parse-javascript-date-to-elixir-format
[19:55:07] serafeim: rawtaz: i'd like it to be idiomatic. for example, I don't like this: https://dpaste.de/Bu1h
[19:55:37] rawtaz: yeah. check out the answerS in the last link there
[19:55:40] rawtaz: Timex for example
[19:56:09] serafeim: hmmm i'd rather avoid dependencies :|
[19:56:38] serafeim: yes with timex and strptime it should be ez
[19:57:12] serafeim: but i want to do it in idiomatic elixir
[19:57:47] rawtaz: im very curious about what the right answer is
[19:57:49] rawtaz: ACTION waits :-)
[19:58:07] serafeim: i don't know it it is difficult
[19:59:04] rawtaz: me neither
[20:00:53] serafeim: the string is in the form "DDMMYY". one solution would be to convert it to "YYMMDD" (how ?) then stick "19" in front like "19YYMMDD" then put two dashes in positions 4 and 6 like "19YY-MM-DD" and finally just pass this to `Date.from_iso8601`
[20:02:33] rawtaz: if you throw it through a regex that replaces to rearrange thats easy. something like dadate |> regex_replace('(\d\d)(\d\d)(\d\d)', '19\3-\2-\1') |> Date.from_iso..
[20:03:01] craigp: has joined #elixir-lang
[20:06:20] aalmazan: has joined #elixir-lang
[20:08:13] drincruz: has joined #elixir-lang
[20:08:14] serafeim: rawtaz: interesting
[20:08:37] serafeim: rawtaz: this `Regex.replace(~r/(\d\d)(\d\d)(\d\d)/, "250611", "19\\3-\\2-\\1")` actually works, ie it returns `"1911-06-25"`
[20:08:49] serafeim: however i must confess that it doesn't seem very idiomatic to me :(
[20:09:02] rawtaz: doesnt elixir have something so you dont have to \\ , like single quotes or similar?
[20:09:22] rawtaz: why not? looks perfectly fine to me, you are sending the data through something that changes the format of it before you use it
[20:09:58] rawtaz: better would of course be if there was a parser function to Date or Calendar where you could provide the format it should read the data in. but i cant find one
[20:10:22] serafeim: rawtaz: me neither
[20:10:51] serafeim: rawtaz: i don't think so about the `\\` all examples here are with `\\`: https://hexdocs.pm/elixir/Regex.html#replace/4
[20:11:16] serafeim: i guess i'll use this solution thank you
[20:11:26] serafeim: unless somebody else thinks of something more idiomatic :)
[20:12:46] serafeim: a more idiomatic thing (for me) would be to group "DDMMMYY" in pairs, reverse that list, insert the dashes and re-join everything to a string
[20:14:10] serafeim: so "DDMMYY" -a> ["DD", "MM", "YY"] -b> ["YY", "MM", "DD"] -c> ["YY", "-", "MM", "-", "DD"] -d> "YY-MM-DD" -e> "19YY-MM-DD"
[20:14:20] serafeim: i know ho wto do all steps *except* step a :(
[20:15:52] SingingBoyo: has joined #elixir-lang
[20:19:00] rawtaz: sucks. elixir should have something so we dont have to \\ everything
[20:23:52] serafeim: actually here's how to do step a
[20:24:01] serafeim: *warning horror follows*
[20:24:04] serafeim: `"250615" |> String.graphemes |> Enum.chunk_every(2) |> Enum.reverse |> Enum.flat_map(& &1) |> Enum.join`
[20:24:16] serafeim: this will return "150625"
[20:24:22] ankhers: If you are okay with bringing in a library, timex accepts a parsing format. So you can parse any date format you want.
[20:24:38] serafeim: Ankhers: yes i know but i'd rather avoid deps
[20:26:58] serafeim: so here's the final solution: `"150615" |> String.graphemes |> Enum.chunk_every(2) |> Enum.reverse |> Enum.flat_map(& &1) |> List.insert_at(2,"-") |> List.insert_at(5,"-") |> List.insert_at(0, "19") |> Enum.join |> Date.from_iso8601`
[20:27:12] serafeim: i guess the regex one is better :)
[20:27:20] serafeim: but its nice to know that its possible
[20:30:00] ankhers: <<day :: binary-size(2), month :: binary-size(2), year :: binary-size(4)>> = "DDMMYYYY"
[20:31:27] ankhers: Oh, you wanted DDMMYY, just change the last binary-size to 2.
[20:31:31] ankhers: serafeim: ^^
[20:32:09] rawtaz: but he needs it in a format that can be fed to Date.from_iso8601
[20:32:50] ankhers: Then you can just use Date.from_erl({"20" <> year, month, day}).
[20:33:44] rawtaz: is there a bot in here that you can ask for function/x or Date.from_erl or whatever to get basic info and links to docs?
[20:34:17] ankhers: That would be nice. josevalim, would you be okay with that kind of bot in here?
[20:35:08] craigp: has joined #elixir-lang
[20:37:06] josevalim: we had a bot that did eval and stuff
[20:37:16] josevalim: i think the consensus was that it was spammy
[20:37:22] ankhers: Fair enough.
[20:37:42] josevalim: serafeim: the most efficient solution would be to pattern match on the binary
[20:38:16] rawtaz: one could make the bot just refer users to private messages with it, problem solved.
[20:38:46] ankhers: Then there would just be random people doing ,doc DateTime.to_erl/2 or something.
[20:38:57] rawtaz: i made one for yii 1.1 many years back, it has a pretty nice feature set in terms of how you can ask it for docs about classes and functions (including properties and parameters/arguments): https://www.yiiframework.com/wiki/369/the-mrfisk-irc-bot#the-doc-ltquerygt-and-api-ltquerygt-commands
[20:39:36] rawtaz: Ankhers: yeah but the bot would refer them (in a single line) to ask him/her in private, and do that only once per X minutes or so. so for every spammer there would at most be one message in the channel per X minutes
[20:39:45] josevalim: rawtaz: so why not use your terminal? :P
[20:39:58] rawtaz: josevalim: you mean iex? :)
[20:40:29] josevalim: serafeim: if you want to juggle the parts around, you can try this:
[20:40:33] josevalim: https://www.irccloud.com/pastebin/MRZUZnT8/
[20:40:44] ankhers: `h Date.to_erl' in iex.
[20:40:54] ur5us: has joined #elixir-lang
[20:40:59] rawtaz: josevalim: well you kinda got me :) i probably should, it's just that when youre in a channel on the irc chatting away and you want a quick reference to something, it's lovely to just be able to say func/2 and get a clickable link to the entire online docs for that function
[20:41:00] josevalim: i would not opposite a bot though that does automatic linking
[20:41:13] josevalim: `h Date.to_erl` and it would send the link back :D
[20:41:22] rawtaz: yeah, somethinkg like that. let me show you an example
[20:42:23] foggyboi: has joined #elixir-lang
[20:48:03] rawtaz: check this out: https://pastebin.com/raw/iZz05Hun
[20:49:17] rawtaz: the multiple matches selection correctly addresses the targeted user as well, e.g. Gilette if there were to be multiple matches to my !doc to that user, the bot would ask Gilette to select.
[20:50:03] rawtaz: correction, that's wrong: it would first ask *me* to select, then once i do that give the selected option to Gilette.
[20:50:12] rawtaz: so the end user only gets what they should
[20:51:45] ankhers: josevalim: What was the solution to the undefined function ExDoc.Config.default_formatter/0 issue again? I can't seem to remember what I did to fix it.
[20:55:49] ankhers: Nevermind. I think I got it.
[20:57:32] josevalim: Ankhers: you are running the task in an environment that does not have ExDoc
[20:57:46] ankhers: rawtaz: I think if we just did the same thing as iex would be easiest. Simply `h Date.to_erl'
[20:58:25] ankhers: Which would spit back https://hexdocs.pm/elixir/Date.html#to_erl/1
[20:59:15] rawtaz: yeah. thats a start. but there's way more to the bot that could be done. but it's a start, indeed!
[20:59:17] ankhers: Maybe we could `h app Module.function' to search that module.
[20:59:28] ankhers: Rather, search that app.
[20:59:38] rawtaz: but youre right, one could just feed the entire query to iex, as long as it begins with h
[21:00:09] ankhers: Up to José though.
[21:01:19] rawtaz: one could just fix an alias in the irc client that pulls up a window with the info from iex :)
[21:03:13] Salek: has joined #elixir-lang
[21:15:15] jeffweiss: has joined #elixir-lang
[21:15:43] Disorganized: has joined #elixir-lang
[21:22:48] jeffweiss: has joined #elixir-lang
[21:24:10] averell: has joined #elixir-lang
[21:25:09] PragTob: has joined #elixir-lang
[21:28:22] absolutejam: has joined #elixir-lang
[21:37:54] foggyboi: has joined #elixir-lang
[21:46:24] foggyboi1: has joined #elixir-lang
[21:54:45] jeffweiss: has joined #elixir-lang
[22:06:54] drrty: has joined #elixir-lang
[22:14:22] palra: has joined #elixir-lang
[22:31:32] foggyboi: has joined #elixir-lang
[22:55:12] jmcgnh: has joined #elixir-lang
[23:26:10] orbyt_: has joined #elixir-lang
[23:27:33] Sgeo_: has joined #elixir-lang
[23:37:52] craigp: has joined #elixir-lang
[23:51:13] greengriminal: has joined #elixir-lang