« Back to channel list

#elixir-lang - 04 July 2019

« Back 1 day Forward 1 day »
[00:14:25] Rufus: has joined #elixir-lang
[00:18:48] lauromoura_: has joined #elixir-lang
[00:36:11] dsr: has joined #elixir-lang
[00:43:33] assemblyman: has joined #elixir-lang
[01:00:17] orbyt_: has joined #elixir-lang
[01:04:45] sparogy: has joined #elixir-lang
[01:16:14] tomterl: has joined #elixir-lang
[01:21:29] ariedler: has joined #elixir-lang
[01:22:51] jeffro_: has joined #elixir-lang
[01:36:12] gde33: has joined #elixir-lang
[01:54:56] DTZUZO: has joined #elixir-lang
[01:57:44] mozzarella: has joined #elixir-lang
[01:59:33] ur5us: has joined #elixir-lang
[02:04:40] dsr9: has joined #elixir-lang
[02:10:09] ur5us: has joined #elixir-lang
[02:16:02] foggyboi: has joined #elixir-lang
[02:36:48] deesar: has joined #elixir-lang
[03:02:32] introom: is it common to run elixir in a distributed setting where different nodes are on different machiens?
[03:22:50] mozzarella: has joined #elixir-lang
[03:30:27] mozzarella: has joined #elixir-lang
[03:39:10] Rufus: has joined #elixir-lang
[03:39:28] mozzarella: has joined #elixir-lang
[03:46:54] ur5us: has joined #elixir-lang
[03:50:01] kriwil: has joined #elixir-lang
[03:53:01] voltone: has joined #elixir-lang
[04:06:24] kriwil: has joined #elixir-lang
[04:07:38] kriwil: has joined #elixir-lang
[04:09:49] fboyer[m]: has joined #elixir-lang
[04:42:54] jmcgnh_: has joined #elixir-lang
[05:08:39] ur5us: has joined #elixir-lang
[05:15:22] proteusguy: has joined #elixir-lang
[05:23:24] Rufus: has joined #elixir-lang
[05:29:41] gvaughn: has joined #elixir-lang
[05:30:20] voltone: has joined #elixir-lang
[05:42:59] serafeim: good morning
[05:52:43] BeerLover: has joined #elixir-lang
[05:53:05] absolutejam3: has joined #elixir-lang
[05:57:45] BitBot: has joined #elixir-lang
[05:58:18] voltone: has joined #elixir-lang
[06:01:01] BeerLover: has joined #elixir-lang
[06:11:10] Sgeo_: has joined #elixir-lang
[06:11:51] oetjenj: has joined #elixir-lang
[06:20:46] tomaz_b: has joined #elixir-lang
[06:23:26] voltone: has joined #elixir-lang
[06:23:58] oetjenj: has joined #elixir-lang
[06:24:46] oetjenj: has joined #elixir-lang
[06:26:59] BeerBuddy: has joined #elixir-lang
[06:27:18] tyurok: has joined #elixir-lang
[06:32:34] BeerLover: has joined #elixir-lang
[06:36:41] gvaughn: has joined #elixir-lang
[06:38:04] voltone: has joined #elixir-lang
[06:45:14] BeerLover: has joined #elixir-lang
[06:51:04] sangoma: has joined #elixir-lang
[06:54:00] tuacker: has joined #elixir-lang
[06:57:25] flaviodesousa: has joined #elixir-lang
[06:58:09] flaviodesousa: has joined #elixir-lang
[06:58:55] flaviodesousa: has joined #elixir-lang
[06:59:35] flaviodesousa: has joined #elixir-lang
[07:00:27] flaviodesousa: has joined #elixir-lang
[07:01:27] flaviodesousa: has joined #elixir-lang
[07:07:41] voltone: has joined #elixir-lang
[07:11:50] purebadger: has joined #elixir-lang
[07:11:59] BeerLover: has joined #elixir-lang
[07:15:38] voltone: has joined #elixir-lang
[07:32:24] SukinoSenze[m]: ACTION sent a long message: < https://matrix.org/_matrix/media/v1/download/matrix.org/tJQBUUAIYPCDHxBBhMHCoDUm >
[07:32:38] SukinoSenze[m]: So, I don't find any clue where did `nil` came from T___T
[07:35:31] PragTob: has joined #elixir-lang
[07:39:54] BeerLover: has joined #elixir-lang
[07:40:27] Nicd-: what is `@user_service_address`?
[07:40:43] Nicd-: you need to share the whole code
[07:44:14] SukinoSenze[m]: <Nicd- "you need to share the whole code"> Sure, just a sec.
[07:44:50] rawtaz: what silly irc client does that quoting anyway :o
[07:45:39] wsieroci: has joined #elixir-lang
[07:46:43] SukinoSenze[m]: <rawtaz "what silly irc client does that "> Haha, sorry I'm using Riot.im to connect with IRC. I forgot that IRC doesn't support it.
[07:46:49] SukinoSenze[m]: <Nicd- "what is `@user_service_address`?"> Here it is. https://glot.io/snippets/fdrgv2phrr
[07:47:56] rawtaz: cant you write messages without having the quotes there? just curious
[07:48:23] Nicd-: and have you configured `Application.get_env(:carbuncle, :user_service_address)`?
[07:48:36] rawtaz: SukinoSenze[m]: carbuncle is that really properly spelled?
[07:48:38] Nicd-: notice that it will be set at compile time
[07:48:58] Nicd-: so in a release that will have the value that the config had at compile time, not runtime
[07:49:52] lexmag: has joined #elixir-lang
[07:56:51] Jellopy: has joined #elixir-lang
[07:57:39] SukinoSenze[m]: Yes, it was set correctly on dev.exs.
[07:57:40] SukinoSenze[m]: config :carbuncle,
[07:57:40] SukinoSenze[m]: user_service_address: "localhost:9001"
[08:00:51] SukinoSenze[m]: I think I've got it. I add "" as a default value on Application.get_env and the warning is gone.
[08:00:56] SukinoSenze[m]: Thanks for helping :)
[08:09:33] rawtaz: does that mean that your code never got a value for that parameter?
[08:12:41] Nicd-: It means Dialyzer deduces that if there is no value, nil is returned and that will break the code
[08:13:11] rawtaz: so the code didnt get a non-nil value then
[08:13:24] SukinoSenze[m]: rawtaz: It've got that value and it working correctly. I think it's about what Nicd- said.
[08:13:32] rawtaz: im surprised because SukinoSenze[m] said that he verified there was a value for this parameter
[08:13:37] SukinoSenze[m]: Yes, the code didn't get non-nil value.
[08:15:08] Nicd-: rawtaz: it's not about what happened
[08:15:16] Nicd-: It's about what could happen
[08:15:31] rawtaz: well put Nicd-
[08:16:05] rawtaz: to a newcomer the message ('nil') will never return since it differs in the 1st argument from the success typing arguments:
[08:16:16] rawtaz: (binary()) is just weird
[08:16:20] rawtaz: very hard to understand what's meant :p
[08:17:10] SukinoSenze[m]: Yes, I totallly confused with that message haha.
[08:17:24] rawtaz: and elixir is known for having good error message ;)
[08:17:47] Nicd-: This is from Dialyzer, not Elixir
[08:18:16] Nicd-: I can humanize it later
[08:18:19] Nicd-: Now I have to run
[08:19:41] gde33: has joined #elixir-lang
[08:22:31] Gika: has joined #elixir-lang
[08:25:03] gvaughn: has joined #elixir-lang
[08:31:10] keden: has joined #elixir-lang
[08:33:44] ur5us: has joined #elixir-lang
[08:45:59] wsieroci: has joined #elixir-lang
[08:47:28] siwatpru: has joined #elixir-lang
[08:58:52] voltone: has joined #elixir-lang
[08:59:47] absolutejam3: has joined #elixir-lang
[09:00:03] squalloster: has joined #elixir-lang
[09:10:33] DTZUZO: has joined #elixir-lang
[09:45:16] cmk_zzz: I have a utc in the database as a timestamp. I want to read it back in and convert it to local time. What is the best option?
[09:45:25] cmk_zzz: this is with ecto and phoenix
[09:46:30] absolutejam3: has joined #elixir-lang
[09:46:42] serafeim: cmk_zzz: use timex
[09:47:50] serafeim: i'm already doing itin my templatet project: https://github.com/spapas/phxcrd ... here's a helper function that does this: https://github.com/spapas/phxcrd/blob/master/lib/phxcrd_web/views/view_helpers.ex#L11
[09:47:53] cmk_zzz: in erlang I would use calendar:universal_time_to_local_time but then there will be a few conversions between elixir times and erlang times
[09:50:22] cmk_zzz: serafeim: thanks. I will start with the view_helpers module. Then decide what to do. I'm not sure on timex at this stage.
[09:52:39] nickjj: cmk_zzz, in theory you should be able to replace that Timex.now() call with DateTime.utc_now()
[09:53:08] cmk_zzz: d |> NaiveDateTime.to_erl |> :calendar.universal_time_to_local_time |> NaiveDateTime.from_erl!
[09:54:23] cmk_zzz: nickjj: DateTime.utc_now() is sort of what I read back from the database as a NaiveDateTime type. I think they are stored in UTC in database. I just want to present them in local time. At this stage there is no need for other time zones
[09:54:35] cmk_zzz: I just need to convert UTC to local time
[09:55:03] serafeim: cmk_zzz: well i've configured the local time zone in a setting in config
[09:55:04] nickjj: yeah i mean in that helper function , Timex.now() was being used in to_local_time/1 , i think you can drop in replace that with DateTime.utc.now() and potentially avoid the Timex dependency if that's all you want
[09:55:53] cmk_zzz: nickjj: ah. I see
[09:56:11] serafeim: i also use timex for formatting
[09:56:17] serafeim: but i guess you can probably drop it
[09:57:50] serafeim: also notice that even if you don't want timex you'll need the tzdata
[09:58:22] cmk_zzz: well, that is what I want to avoid :D, hence my hacky erlang calendar way
[10:01:40] cmk_zzz: anyway, thanks for the input. Long term I will go with timex though
[10:02:15] nickjj: i use timex too, it's very welcome for formatting dates or timestamps
[10:03:23] nickjj: although if i can, i try to do all date formatting on the client side , this way i can keep things rendered server side in UTC and not worry about it
[10:03:51] serafeim: nickjj: so you do the time rendering with js ?
[10:03:54] nickjj: also helps with caching if you can render a utc timestamp and then use javascript to convert that to things like "5 minutes ago"
[10:05:52] nickjj: serafeim, just for the formatting of the server provided utc time
[10:06:41] nickjj: i usually just drop times into a <time> tag with a specific class and then JS takes over and formats the time how i want it based on the class i used
[10:07:28] nickjj: relative time, 2019-07-04, Jul 4th 2019, etc.
[10:10:00] nickjj: and with data attributes you can still store things like the user's local time in your database in the cases where you don't want to use whatever value the browser provides
[10:10:18] nickjj: *local timezone
[10:18:36] serafeim: nickjj: so you have a js library like moment.js ?
[10:20:40] nickjj: serafeim, yeah, although on this new project i'm working on, i'm going to check around and see if there's something more light weight but still compatible with most browsers since moment.js is kind of heavy and i use such a tiny fraction of what it offers
[10:22:14] serafeim: nickjj: yes but i think that moment.js is the gold standard in js time manipulation
[10:22:53] nickjj: yep you really can't go too wrong with it
[10:23:28] nickjj: although a quick googling seems promising https://github.com/iamkun/dayjs
[10:24:12] nickjj: i haven't gotten around to researching that yet since i'm so focused on the server side , but i'd probably start with at least evaluating that
[10:25:14] serafeim: seems popular enough !
[10:25:56] nickjj: seems to have good browser compatibility too and it's ~50kb less than momentjs
[10:26:44] serafeim: i'll keep it in mind if i need a JS library (however i try to avoid all client side things unless absolutely necessary)
[10:26:52] nickjj: i have to say, the used by state on github is really useful for this too
[10:27:10] nickjj: you can really see how crazy popular momentjs is , it's used by almost a million projects vs 16k for dayjs
[10:27:24] serafeim: yes used by is a great addition to gh
[10:27:44] voltone: has joined #elixir-lang
[10:28:04] serafeim: of course it would need some better UX when searching for repos: https://github.com/phoenixframework/phoenix_live_view/network/dependents
[10:28:14] serafeim: i want to see if my repo is there :P
[10:28:55] absolutejam3: has joined #elixir-lang
[10:29:02] nickjj: you mean you don't want to click next through hundreds of repos? haha
[10:29:26] serafeim: meh i'd rather avoid it :p
[10:29:36] ur5us: has joined #elixir-lang
[10:29:54] keden: has joined #elixir-lang
[10:30:29] nickjj: i try to keep js to the minimum too btw
[10:40:47] purebadger: has joined #elixir-lang
[10:41:32] Nicd-: rawtaz: the warning was "The call 'Elixir.Fastwork':connect_grpc('nil') will never return since it differs in the 1st argument from the success typing arguments: (binary())" -- first is the call (in Erlang format), "will never return" = it crashes, "differs in the 1st argument" = you might be giving it this wrong argument, "success typing arguments" = the arguments it will work (not crash) with
[10:53:00] micmus: has joined #elixir-lang
[10:54:24] serafeim: Nicd-: do you have any idea why the "used by" thing is not visible to all packages? for instance this library: https://github.com/ZennerIoT/ex_audit doesn't have it
[10:56:39] ericmj: it only looks at the javascript deps
[10:57:04] serafeim: ericmj: no it works with python deps also
[10:57:20] ericmj: in phoenix_live_view's case it's only javascript
[10:57:27] ericmj: they support other languages as well, but not elixir
[10:57:28] serafeim: for example: https://github.com/spapas/django-generic-scaffold
[10:57:38] serafeim: ericmj: oooh ok
[10:57:55] serafeim: guess elixir isnt that popular :(
[10:59:08] ericmj: the other problem is that mix.exs is code, making it hard to analyze
[10:59:22] voltone: has joined #elixir-lang
[10:59:58] ericmj: I guess it could look at mix.lock though
[11:00:16] ericmj: but that's only strict versions...
[11:00:34] rawtaz: Nicd-: i think it's the "success typing arguments" thats confusing. is "success typing" a special type of arguments? or is that a different wording of "the proper arguments"?
[11:00:48] Nicd-: basically the latter
[11:00:53] rawtaz: i never heard "success typing arguments" before, and ive been through a bunch of languages :)
[11:01:14] rawtaz: ok, so there's no special thing called "success" in erlang, some type of thing or similar
[11:01:24] rawtaz: or well, Distillery :)
[11:01:45] ericmj: success typing is a way of doing type analysis on code
[11:02:30] ericmj: the "success typing" is the set of types that dialyzer infers will lead to successful execution (not crashing)
[11:02:31] Nicd-: apparently it's not used much outside Erlang
[11:03:54] ericmj: the term was defined for dialyzer afaik
[11:09:59] rawtaz: hm, wouldnt a better naming be "success types"?
[11:12:19] oetjenj: has joined #elixir-lang
[11:17:57] absolutejam3: has joined #elixir-lang
[11:19:25] BeerBuddy: has joined #elixir-lang
[11:28:14] DTZUZO: has joined #elixir-lang
[11:47:50] blassin27: has joined #elixir-lang
[11:52:21] flaviodesousa: has joined #elixir-lang
[11:53:08] BeerLover: has joined #elixir-lang
[12:01:09] felipevolpone: has joined #elixir-lang
[12:02:36] sangoma: has joined #elixir-lang
[12:04:01] l0cutus_: has joined #elixir-lang
[12:08:29] absolutejam3: has joined #elixir-lang
[12:09:08] proteusdude: has joined #elixir-lang
[12:09:25] l0cu7us: has joined #elixir-lang
[12:10:04] felipevolpone: has joined #elixir-lang
[12:15:31] L0cutus: has left #elixir-lang: ("Leaving")
[12:16:55] l0cu7us: has joined #elixir-lang
[12:17:55] BeerLover: has joined #elixir-lang
[12:21:36] L0cutus: has joined #elixir-lang
[12:22:54] BeerLover: has joined #elixir-lang
[12:23:15] l0cu7us: has joined #elixir-lang
[12:25:34] l0cu7us: has joined #elixir-lang
[12:30:11] ur5us: has joined #elixir-lang
[12:37:30] absolutejam3: has joined #elixir-lang
[12:42:35] josevalim: rawtaz: it is a typing discipline, like we say "static typing"
[12:49:18] OliverMT: I'm doing success typing at home, testing out various potty types to vean my eldest from diapers. Pretty similar to what dialyzer does to some of my code I'm sure!
[12:50:23] OliverMT: ACTION always likes to help out with some real world analogues!
[12:56:51] gvaughn: has joined #elixir-lang
[12:57:19] BeerLover: has joined #elixir-lang
[12:58:47] absolutejam3: has joined #elixir-lang
[13:02:17] l0cu7us: hello, what's wrong with: iex(1)> d1 = Date.new(2018,12,25)
[13:02:30] Saukk: has joined #elixir-lang
[13:03:37] ephemera_: has joined #elixir-lang
[13:07:15] micmus: has joined #elixir-lang
[13:08:48] benwilson512: L0cu7us: nothing, why?
[13:08:55] benwilson512: what goes wrong for you?
[13:10:19] Havvy: has joined #elixir-lang
[13:11:59] l0cu7us: benwilson512: https://pastebin.com/WGgFWhVt
[13:12:17] benwilson512: L0cu7us: how did you install erlang?
[13:13:08] l0cu7us: yes i'm from iex: pi@qui:~/Documents/Elixir/intro $ iex
[13:13:08] l0cu7us: Erlang/OTP 22 [erts-10.4] [source] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
[13:13:41] benwilson512: right, but how did you _install_ erlang / elixir
[13:13:55] l0cu7us: (i'm reading some samples from programming elixir 1.6 book)
[13:14:18] l0cu7us: https://elixir-lang.org/install.html#raspberry-pi
[13:14:33] benwilson512: ah you're on the raspberry pi, interesting
[13:15:52] benwilson512: hm, basically, something is borked with your install, although I'm not entirely sure what, I haven't used the erlang solutions packages before or done so on a pi
[13:17:18] josevalim: L0cu7us: interesting. justin schnek was runinng into this as well, but he can't reproduce it
[13:17:38] josevalim: L0cu7us: the issue is that elixir was compiled with one otp version and you are using another
[13:17:48] l0cu7us: now i'm trying from standard pc
[13:17:53] josevalim: L0cu7us: what does `elixir --version` return?
[13:18:09] absolutejam: has joined #elixir-lang
[13:18:14] l0cu7us: pi@qui:~/Documents/Elixir/intro $ elixir --version
[13:18:14] l0cu7us: Erlang/OTP 22 [erts-10.4] [source] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
[13:18:14] l0cu7us: Elixir 1.9.0 (compiled with Erlang/OTP 21)
[13:18:48] josevalim: yes. in theory it is supposed to work but there is a bug in otp
[13:18:55] l0cu7us: mmm i think it is better that i download all from erlang-solutions....
[13:19:07] josevalim: L0cu7us: can you put the Calendar.ISO.beam file somewhere?
[13:19:08] absolutejam: Is there a way to validate a function's param against multiple struct types?
[13:19:23] josevalim: L0cu7us: i want to download it and inspect it
[13:19:34] absolutejam: instead of %Foo = {}, I wondered if there was an equivalent to a union? Or do I just overload the function with each struct?
[13:19:43] josevalim: absolutejam:
[13:19:52] benwilson512: absolutejam: you can do `%struct{} = arg) when struct in [Foo, Bar]`
[13:19:59] josevalim: case struct do
[13:19:59] josevalim: %x{} when x in [Foo, Bar, Baz] -> ...
[13:20:02] l0cu7us: josevalim: i'm totally noob , where can i find that file ?
[13:20:34] josevalim: L0cu7us: `elixir -e "IO.puts :code.which Calendar.ISO"`
[13:20:37] josevalim: and welcome :)
[13:21:24] l0cu7us: the same tools version on the standard pc doesn't give that error
[13:21:26] l0cu7us: l0cutus@pcfisso:~$ iex
[13:21:26] l0cu7us: Erlang/OTP 22 [erts-10.4.3] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
[13:21:26] l0cu7us: Interactive Elixir (1.9.0) - press Ctrl+C to exit (type h() ENTER for help)
[13:21:26] l0cu7us: iex(1)> d1 = Date.new(2018,12,25)
[13:21:26] l0cu7us: {:ok, ~D[2018-12-25]}
[13:21:59] l0cu7us: (elixir compiled with OTP 21)
[13:22:03] benwilson512: L0cu7us: this may have to do with the fact that it's arm
[13:22:35] josevalim: L0cu7us: you are also using a more recent otp version in yourr machine
[13:22:46] josevalim: see the `[erts-10.4.x]` part
[13:22:52] josevalim: so they may have fixed it
[13:25:07] l0cu7us: josevalim: https://drive.google.com/open?id=1C_dCL_uoKg6xr_9LIqbj-LlWbkzPW9ug
[13:25:40] l0cu7us: hope it is ok, i must go to work now ! cul8r
[13:26:38] nickjj: josevalim, just wanted to say thanks for our discussion the other week, it really helped me think about things and overcome organizational problems
[13:27:06] josevalim: nickjj: glad to have helped and thanks for being active in forums and helping people
[13:27:29] josevalim: benwilson512, L0cu7us: i can't reproduce it locally and i have the first otp 22 version, so you may be on the money it is an arm issue too
[13:27:42] nickjj: sure no problem, a billion blog posts will be the next step
[13:29:25] benwilson512: josevalim: on 1.9 is it possible to use the distillery release command still?
[13:29:40] benwilson512: josevalim: ignore me
[13:31:43] wsieroci: has joined #elixir-lang
[13:32:37] griffinbyatt: has joined #elixir-lang
[13:33:55] Gazler: benwilson512: That's a legit question if you're not on distillery 2.0
[13:34:01] Gazler: Or 2.x even
[13:34:12] benwilson512: gazler: yeah, although I am, so I mostly was just bad at reading docs
[13:34:27] Gazler: I think I have one project still on 1.x
[13:34:32] benwilson512: although it seems moot at the moment since rustler doesn't seem to support OTP 22 yet
[13:41:30] OliverMT: you're actually using rust?
[13:41:38] OliverMT: to decode some of your hardware stuff or what?
[13:42:00] benwilson512: OliverMT: we're using meeseeks to parse HTML which uses html5ever
[13:42:10] OliverMT: aha, and that is a rust parser?
[13:42:18] OliverMT: makes sense
[13:42:32] benwilson512: yea, from mozilla, figure they know what they're doing in that department ;)
[13:42:35] OliverMT: ah, this is for servo I recon
[13:47:14] OliverMT: I loved that blog from discord with their custom data type in rustler
[13:47:15] OliverMT: so powerful
[13:50:23] dysfun: OliverMT: you know the author of meeseeks too https://hex.pm/packages/meeseeks
[13:52:13] OliverMT: I only hire the best people you know!!
[13:54:29] OliverMT: me and trump have that in common
[13:58:18] absolutejam3: has joined #elixir-lang
[13:58:27] felipevolpone_: has joined #elixir-lang
[14:00:53] siwatpru_: has joined #elixir-lang
[14:16:58] renansl: has joined #elixir-lang
[14:31:13] ur5us: has joined #elixir-lang
[14:51:02] kansi: has joined #elixir-lang
[14:52:05] dysfun: can anyone recommend a book to teach someone who hasn't done much programming before (but has an excellent mentor) elixir+phoenix?
[14:53:09] ankhers: I enjoyed https://pragprog.com/book/elixir/programming-elixir and https://pragprog.com/book/phoenix/programming-phoenix
[14:53:17] dysfun: two books though :)
[14:53:29] dysfun: i suppose they are two things heh
[14:53:57] absolutejam3: has joined #elixir-lang
[14:54:29] benwilson512: if they're new to programming do programmign elixir
[14:54:32] ankhers: Yeah, I'm not sure how effecting the Phoenix book would be without at least understanding the basics of Elixir.
[14:54:34] benwilson512: it's critical to get the fundamentals down
[14:54:36] kansi: hi all! I have small question regarding releases (build using distillery). I have built a release of my application with erts. Is it possible to start elixir cli from this release. I can start an erlang shell using `./erts-x.x.x/bin/erl -boot releases/0.1.0/start_clean`
[14:54:57] dysfun: so these two books, in that order?
[14:55:22] ankhers: At least the Elixir one. Maybe their mentor can help with the Phoenix stuff.
[14:55:35] ankhers: But the project in the Phoenix book is really cool.
[14:55:54] dysfun: heh, i assume it will be equally cool in the new version of that book
[14:56:39] wonko7: has joined #elixir-lang
[14:57:38] absolutejam1: has joined #elixir-lang
[14:58:28] absolutejam1: has joined #elixir-lang
[14:59:37] jer: honestly, it's counterintuitive, but what's important for people who don't know how to write code nearly at all, the most important thing is quick feedback cycles and fucking around with a small goal in mind
[15:00:01] jer: people learn the best when they learn something just at the time they need it; makes practicing easier too
[15:00:19] dysfun: yeah, can be a bit difficult to not have stuff to fall back on though
[15:00:28] jer: so when i hear things like "it's critical to get the fundamentals down" -- well yes, but it's not required to do stuff =]
[15:01:19] dysfun: yes, but at the same time, the student has already had difficulties really understanding the syntax
[15:01:33] jer: dysfun, i mean, the key when you're totally new is, enthusiasm. if you lose it, no amount of fundamentals will help. key to maintaining high enthusiawsm, setting a goal and achieving it. how do you do that? ignore the rest of the stuff you need to learn later, for the stuff you need to learn now
[15:02:40] jer: we totally underestimate, as experienced developers sometimes, just how universally important a short feedback cycle is to motivation; motivation helps you learn. that's all i'm trying to get across
[15:03:01] dysfun: my style is very much focused on the get things done, i just want to make sure that he has something to fall back on for the rest
[15:04:30] jer: ACTION nods
[15:06:24] DTZUZO: has joined #elixir-lang
[15:06:59] dysfun: sasajuric: would you say elixir in action is approachable by someone with little programming experience?
[15:08:28] serafeim: dysfun: maybe you can try the Learn Functional programming with Elixir book firsT: https://pragprog.com/book/cdc-elixir/learn-functional-programming-with-elixir which is geared towards new programmers (and especially new programmers that don't know anything about functional). i found it way too e-z when I read it
[15:09:24] dysfun: i saw that, but i was concerned that it might more be aimed at starting from non-functional experience
[15:09:46] serafeim: dysfun: hm no i don't think it needs any experience at all
[15:10:19] dysfun: hrm, interesting
[15:10:45] dysfun: i mean he's played around with javascript building simple react components and writing fizzbuzz and stuff
[15:11:03] dysfun: so we're not talking like "doesn't know what a variable is"
[15:15:49] serafeim: well the good thing about elixir is that its a very ez language (if you dont use macros). after somebody understands the basic concepts then he should be good to go (with a little mentoring on idiomatic usage)
[15:16:29] serafeim: at least that was my main problem when learning elixir (and still is): not how to write something that works in elixir but write it idiomatically
[15:16:31] dysfun: yeah, i think so too. but syntax is a concern, given how he's fared with syntax so far. we did one lesson with elixir and syntax was a real sticking point
[15:18:08] serafeim: dysfun: yes i think it has some quirks but they are more or less consistent
[15:18:19] dysfun: unlike javascript lol
[15:18:44] dysfun: wait, is it that time of the month where i whine that elixir should be a lisp again?
[15:19:52] serafeim: i always had a problem on how to write a single line if. is it if true do: 1 or if true, do 1 or something else. of course now that I understand that if is a function (actually a macro) and calling it should be like calling a function with keywords it makes more sense
[15:20:30] dysfun: but gosh, it took me ages to get used to elixir syntax, coming from erlang
[15:21:20] jer: i came to elixir oddly enough not through erlang (i wrote erlang before) -- but rather, from ruby. for a while, its relationship to erlang was just "ok yeah i know it's there, don't care right now" =]
[15:22:24] serafeim: jer: i think that's true for many people (ruby -> elixir). i on the other hand don't know ruby nor erlang but am experienced with c, java, python and various lisps
[15:22:28] dysfun: i program quite a few things, so it's not 'just' coming from erlang, but i program somewhat modally, so i only really think about erlang when i'm writing erlang
[15:22:42] dysfun: and it really annoyed the hell out of me my first steps in elixir getting the syntax wrong all the time
[15:22:56] jer: serafeim, the lisps and python would probably help you the most in that case then
[15:23:08] serafeim: yes that's true
[15:23:52] dysfun: significant whitespace is terrible and awful and gosh i love it
[15:23:54] Phylock: has joined #elixir-lang
[15:23:58] jer: dysfun, yeah has happened to me with every new language i've learned too =D such a dumb little thing
[15:24:34] serafeim: dysfun: concerning the initial question the introdution (and is this book for you section) are available online on the almeida book: https://media.pragprog.com/titles/cdc-elixir/intro.pdf
[15:24:35] dysfun: heh, i think i learn a new language frequently enough now that i'm kinda immune to it
[15:25:26] jeffweiss: has joined #elixir-lang
[15:25:40] dysfun: i do remember how amazingly painful it was moving from old school c++ to more modern languages though
[15:26:07] dysfun: and haskell lol. it took me an embarrasingly long time to become useful in it
[15:26:36] jer: i pretty much don't learn new languages at the same rate i used to anymore -- maybe one or two a year, but they're heavily tied to experimentation for real use cases so maybe that's why. i used to learn languages by implementing a language (i.e., learn scala by building an io language implementation, since an io is pretty damned simple; it's a tree based language effectively, and its evaluator is super
[15:26:45] jer: oh damn that was longer than i thought lol
[15:27:13] serafeim: dysfun: are you sure it was painful moving from c++ to more modern languages ? try to think of a guy that moves from python / ruby to C ... i wouldn't like to be in his shoes :|
[15:27:23] dysfun: well i thought that and then remembered i've updated myself to modern javascript and learned purescript recently
[15:27:38] jer: but yeah i'd try and write an io as close as i could imagine given what i knew previous, then refactor, and during refactoring, learn more about what's idiomatic, etc., and try and end up with something that could be mistaken for ebing written by someone who knew what they were doing =D
[15:28:22] dysfun: serafeim: yes, it was crazy painful. i felt like i had no idea what was going on under the hood and i had little confidence that things would work the way they should
[15:28:41] dysfun: and i really didn't have so many languages under my belt at that time
[15:30:08] serafeim: dysfun: ha ha ha ha ok it was different in my case. when i moved from C to Java i felt more free since i had 1 less problem (no mallocs). i didn't care that much that i didn't know what happened under the hood; it seemed to be working so it was enough for me
[15:31:02] gvaughn: has joined #elixir-lang
[15:31:10] dysfun: yeah, i struggled a lot with black boxes back then
[15:31:33] dysfun: but i moved from basic to c++, so...
[15:32:00] tallysmartins_: has joined #elixir-lang
[15:34:21] dysfun: learning structured programming in the form of c++ was painful
[15:35:28] proteusdude: has joined #elixir-lang
[15:37:57] jer: i wrote C++ for nearly 15 years, but don't assume that means I fully understand C++ =D
[15:38:16] jer: Tons of crap you just don't need to know unless you work on a team with C++ people
[15:38:37] dysfun: i think nobody really understands c++. iso committees disagreeing about how things currently work rather demonstrates it
[15:38:41] tuacker: has joined #elixir-lang
[15:39:06] jer: heh fair =]
[15:39:19] dysfun: but nowadays i happily use rust (which i also don't understand really, but it's less mad) for systems stuff
[15:39:53] jer: yeah rust is a nicer C++, and suitable for most of the things Go is most useful for
[15:40:06] jer: Erlang/Elixir good for the rest of what Go is most useful for =D
[15:40:19] dysfun: ugh i don't like go
[15:40:57] jer: i don't either, but it's so stupidly simple it's not hard to learn, and there's a certain value in that
[15:41:31] dysfun: well yes, learning rust is quite an undertaking
[15:41:49] dysfun: but you can totally learn it as you need to to understand a library you want to use
[16:01:37] dysfun: lol, the manning books website has a 2-click buy option
[16:03:57] Jetimon: has joined #elixir-lang
[16:04:54] yussenn: has joined #elixir-lang
[16:06:57] yussenn: How are you sent messages from a controller to a channel?
[16:08:09] dysfun: https://hexdocs.pm/phoenix/Phoenix.Channel.html#broadcast/3 ?
[16:09:35] yussenn: but in the controller I do not have the socket
[16:10:56] dysfun: https://hexdocs.pm/phoenix_pubsub/Phoenix.PubSub.html#broadcast/3
[16:13:15] yussenn: i will try ... thanks (y) (y)
[16:13:32] uranoss: has joined #elixir-lang
[16:17:02] lessless: has joined #elixir-lang
[16:17:45] rawtaz: Nicd-: thanks for explaining earlier
[16:17:49] rawtaz: josevalim: same to you for commenting
[16:26:01] wsieroci: has joined #elixir-lang
[16:26:53] flaviodesousa: has joined #elixir-lang
[16:32:10] ur5us: has joined #elixir-lang
[16:33:27] ur5us_: has joined #elixir-lang
[16:34:12] lexmag: has joined #elixir-lang
[16:34:45] orbyt_: has joined #elixir-lang
[16:39:27] lexmag: has joined #elixir-lang
[16:45:32] codewaffle: has joined #elixir-lang
[16:51:01] juba: has joined #elixir-lang
[16:59:55] Gika: has joined #elixir-lang
[17:12:02] purebadger: has joined #elixir-lang
[17:14:47] griffinbyatt: has joined #elixir-lang
[17:20:42] nineczar: has joined #elixir-lang
[17:45:56] jeffweiss: has joined #elixir-lang
[18:16:22] bkarh: has joined #elixir-lang
[18:19:57] Zarathu: benwilson512: are you sticking with distillery instead of migrating over?
[18:22:02] josevalim: benwilson512: can you change your assets pipeline to have to different outputs? app-1.css and app-2.css?
[18:29:40] foggyboi: has joined #elixir-lang
[18:31:04] squalloster: has joined #elixir-lang
[18:34:06] ur5us: has joined #elixir-lang
[18:41:03] absolutejam1: has joined #elixir-lang
[18:58:05] Zarathu: josevalim: do you ever anticipate a scenario where ecto would raise an error or a warning if it receives a db row to load into a schema with extra keys not specified in the schema definition?
[18:58:17] Zarathu: or is that "100% guaranteed" to never be an issue
[18:58:37] josevalim: we can't ever now because we don't do a foo.* on purpose
[18:58:55] Zarathu: (e.g., SELECT * returns id, name, description but the schema only defines id, name)
[18:58:59] josevalim: some people expliccitly map on subsets
[18:59:23] Zarathu: that k changes a lot :x
[19:00:15] Zarathu: i was thinking of having duplicate schema files that only contain the fields/changeset functions that are within the domain of the particular schema
[19:00:31] Zarathu: so instead of having a single Accounts.User that gets referred to all over the place
[19:00:44] Zarathu: you could have Accounts.User (for auth only), Blog.User (for authorship), and so on
[19:01:16] Zarathu: as opposed to having a new "authors" table in the db, or a "credentials" table, or whatever the docs currently describe
[19:03:17] Zarathu: you end up having multiple schemas loading from the same table, but in return you get completely independent contexts with solid boundaries
[19:03:59] Zarathu: (i'm sure someone else has thought of this before)
[19:07:32] absolutejam1: has joined #elixir-lang
[19:08:24] josevalim: Zarathu: yes, exactly
[19:08:33] josevalim: it was meant to be used like that
[19:08:35] josevalim: sos it won 't change
[19:08:54] dsr: has left #elixir-lang: ("Kicked by @appservice-irc:matrix.org : issued !quit command")
[19:13:00] dsr: has joined #elixir-lang
[19:25:53] fboyer: has joined #elixir-lang
[19:27:59] notzmv: has joined #elixir-lang
[19:35:53] nineczar: has joined #elixir-lang
[19:38:11] deesar: has joined #elixir-lang
[19:40:00] netrino: has joined #elixir-lang
[19:43:39] sparogy: has joined #elixir-lang
[19:44:47] deesar: has left #elixir-lang: ()
[19:51:12] wsieroci: has joined #elixir-lang
[19:52:16] rzmt: has joined #elixir-lang
[20:18:37] wsieroci: has joined #elixir-lang
[20:22:50] gde33: has joined #elixir-lang
[20:31:47] josephb: has joined #elixir-lang
[20:34:45] josephb: has joined #elixir-lang
[20:50:09] gvaughn: has joined #elixir-lang
[21:12:30] l0cu7us: josevalim: seems with this erlang/otp - elixir version i do not get the previous error with calendar
[21:12:34] l0cu7us: pi@qui:~ $ elixir --version
[21:12:34] l0cu7us: Erlang/OTP 22 [erts-10.4.4] [source] [smp:4:4] [ds:4:4:10] [async-threads:1] [hipe]
[21:12:34] l0cu7us: Elixir 1.9.0 (compiled with Erlang/OTP 22)
[21:12:55] josevalim: L0cu7us: back on the pi? or on your computer?
[21:13:09] l0cu7us: installed and compiled on my raspberry pi3 using asdf
[21:13:28] josevalim: good news, then, thanks!
[21:14:03] l0cu7us: back to learn elixir now :-)
[21:14:21] rawtaz: L0cu7us: kudos for persisting
[21:14:42] rawtaz: any day now you'll be a divine Elixirian
[21:14:48] gvaughn: has joined #elixir-lang
[21:22:59] ur5us: has joined #elixir-lang
[21:25:34] mahmudov: has joined #elixir-lang
[21:27:44] absolutejam1: has joined #elixir-lang
[21:29:45] absolutejam2: has joined #elixir-lang
[21:44:09] sparogy: has joined #elixir-lang
[21:56:00] micmus: has joined #elixir-lang
[23:00:57] josephb_: has joined #elixir-lang
[23:03:26] josephb_: has joined #elixir-lang
[23:10:10] josephb: has joined #elixir-lang
[23:25:03] lessless_: has joined #elixir-lang
[23:42:51] DTZUZO: has joined #elixir-lang
[23:52:46] josephb_: has joined #elixir-lang