<    June 2018     >
Su Mo Tu We Th Fr Sa  
                1  2  
 3  4  5  6  7  8  9  
10 11 12 13 14 15 16  
17 18 19 _2_0 21 22 23  
24 25 26 27 28 29 30
00:02 _arkgil joined
00:03 aeliton joined
00:03 jerel joined
00:07 aeliton joined
00:07 mertonium joined
00:12 aeliton joined
00:12 elixir-lang-repo joined
00:12 <elixir-lang-repo> [elixir] sneako opened pull request #7751: Fix typo in Library Guidelines: paralleiize -> parallelize (master...lib-guide-typo) https://git.io/vh6gR
00:12 elixir-lang-repo left
00:15 Disavowed left
00:15 codestorm joined
00:16 cagomez joined
00:20 sneako joined
00:26 codestorm joined
00:30 _arkgil joined
00:32 jeregrine joined
00:33 jeregrin_ joined
00:35 jeregri__ joined
00:36 jeregrine_ joined
00:38 jeregrine joined
00:44 _arkgil joined
00:47 pranz3 joined
00:57 _arkgil joined
01:00 alexband joined
01:01 pranz4 joined
01:05 praveen_ joined
01:05 smugfinger joined
01:05 _arkgil joined
01:07 <iFire> Ankhers: pingo
01:08 <Ankhers> iFire: pong
01:08 <Ankhers> Good timing actually.
01:09 <Ankhers> How familiar are you with the codebase?
01:09 <iFire> Ankhers: What I did was compile a mongodb 4.0rc but I realized I had no idea what to do so I looked for exampled. The best example is from their c lib.
01:09 <iFire> Ankhers: not really, but I wrote a ecto adapter and database driver once
01:09 <iFire> looked for examples*
01:10 <iFire> so I have working knowledge of db_connection and ecto apis
01:11 <Ankhers> Thats great!
01:11 pranz4 joined
01:11 _arkgil joined
01:11 <Ankhers> The ecto adapter has sorta fallen to the wayside at the moment. There is a lot of catchup that will need to be done to get it ready for the upcoming Ecto 3 release.
01:12 pranz joined
01:12 <iFire> Ankhers: Do you think it's possible to emulate many to many / one to many joins with transactions in mongodb 4.0 4.2?
01:13 <Ankhers> I haven't actually fully taken a look at what is possible. But I would assume so.
01:13 nighty- joined
01:18 <iFire> sounds interesting though
01:18 mcspud joined
01:19 <Ankhers> actually, it depends on what you mean by emulate a join.
01:19 <Ankhers> I think it would still be multiple queries like it would be now.
01:19 alexband joined
01:19 <Ankhers> The transaction would just allow me to insert, update, etc multiple pieces of information in a single query.
01:20 cagomez joined
01:20 <iFire> yes. reading documentation the "join" emulation in the mongodb would be limited to replicas.
01:20 <iFire> So the transaction will allow doing the steps in the same transaction and being correct
01:21 <iFire> for replicas in 4.0 and shards in 4.2
01:21 <Ankhers> That is the plan.
01:23 codestorm joined
01:24 _arkgil joined
01:24 nineczar joined
01:24 <iFire> Ankhers: does the ecto driver currently do joins?
01:25 <iFire> via statement by statement queries
01:26 <Ankhers> No. There is currently no join support.
01:27 bionj joined
01:31 <iFire> Ankhers: if you can describe the problem with the ecto drive in the issue I might be able to look at them
01:31 <iFire> ecto driver*
01:32 <iFire> in an ecto 3 upgrade issue
01:33 _arkgil joined
01:34 bionj_ joined
01:37 codestorm joined
01:42 <Ankhers> iFire: Essentially the adapter isn't even 2.1 compliant. I think the only major feature missing from 2.1 is the on_conflict support. We are also missing or_where though too. Then no work has gone into 2.2 at all.
01:42 jeffro joined
01:44 tomterl joined
01:49 bionj_ left
01:50 praveen_ joined
01:50 <Ankhers> Is there a way to skip an ExUnit test at runtime?
01:51 Flyynn joined
01:53 _arkgil joined
01:53 dogweather joined
01:56 sihui_io joined
01:56 <iFire> there's a way to pick 1 test
01:57 <iFire> and a seed
01:59 lessless joined
02:00 codestorm joined
02:03 _arkgil joined
02:07 dogweather joined
02:11 <Ankhers> Yeah, but I want to disable tests based on the version of mongodb that is running.
02:12 <Ankhers> And I don't know that until it is running.
02:13 akeating joined
02:15 _arkgil joined
02:16 sevenseacat joined
02:17 <iFire> Ankhers: you can try doing different test suites
02:18 <iFire> like MIX_ENV=mongodb36
02:18 <iFire> MIX_ENV=mongodb40
02:21 mitchellhenke joined
02:22 <iFire> not very helpful :/
02:25 dogweather joined
02:25 _arkgil joined
02:27 sevenseacat joined
02:34 _arkgil joined
02:36 jaydoane joined
02:37 dogweather joined
02:38 caw________ joined
02:49 dogweather joined
02:52 _arkgil joined
03:02 _arkgil joined
03:06 philShaughnes joined
03:07 <sms> Huh, how do I persist changes to a list? I'm going through a map and I want to append some data to a list each run through
03:09 _arkgil joined
03:10 Hanonim joined
03:11 <sms> Oh, nevermind lol
03:15 harfangk joined
03:27 _arkgil joined
03:33 _arkgil joined
03:34 lessless joined
03:37 Hanonim joined
03:37 dogweather joined
03:43 jeffro joined
03:46 _arkgil joined
04:01 codestorm joined
04:01 _arkgil joined
04:07 Siwat joined
04:09 pranz1 joined
04:10 siwatp joined
04:19 _arkgil joined
04:23 lauromoura_ joined
04:27 _arkgil joined
04:36 _arkgil joined
04:48 _arkgil joined
04:58 markmarkmark joined
05:00 _arkgil joined
05:03 Havvy joined
05:04 sihui_io joined
05:06 codestorm joined
05:06 _arkgil joined
05:07 BitGonzo joined
05:08 philShaughnes joined
05:10 mbuf joined
05:15 dogweather joined
05:17 sihui_io joined
05:19 _arkgil joined
05:25 drewolson joined
05:29 Flyynn joined
05:43 <sms> How does cast_assoc work anyways?
05:44 jeffro joined
05:45 <sms> Let's say I cast_assoc(:categories), does that mean my post would expect categories: [cat1, cat2...] inside the post changeset or what
05:54 dogweather joined
05:57 akeating joined
06:07 jegaxd26 joined
06:08 dogweather joined
06:13 l14n joined
06:18 lexmag joined
06:31 tuacker joined
06:36 jegaxd26 joined
06:45 jegaxd26 joined
07:06 PragTob joined
07:13 codestorm joined
07:16 laut joined
07:24 netrino joined
07:38 akeating joined
07:39 mostly-harmless joined
07:46 jeffro joined
07:48 Electrux joined
07:55 mahmudov joined
08:03 elixir-lang-repo joined
08:03 <elixir-lang-repo> [elixir] josevalim closed pull request #7751: Fix typo in Library Guidelines: paralleiize -> parallelize (master...lib-guide-typo) https://git.io/vh6gR
08:03 elixir-lang-repo left
08:04 <sms> Why when I case Repo.update!() do I get no case clause matching even if I have a {_, _} case?
08:05 vovs03 joined
08:09 <sms> Or even {:ok, _}
08:09 <sms> The docs say it should return {:ok, struct}
08:09 <sevenseacat> no, update! returns the struct or raises
08:09 <sevenseacat> you're thinking of update
08:10 <sms> Ahhhh, god damn it
08:10 <sms> So basically you'd always want update if you're using it in a case
08:11 <sms> Well, I guess unless you want to match a very specific struct
08:12 stephen_m joined
08:15 dogweather joined
08:15 l14n_ joined
08:16 djelic_ joined
08:17 pbodev1 joined
08:22 DeadTrickster joined
08:33 Electrux joined
08:36 dogweather joined
08:53 dogweather joined
08:57 l14n joined
09:06 mahmudov joined
09:09 philShaughnes joined
09:11 fxer joined
09:15 dogweather joined
09:17 akeating joined
09:19 lexmag joined
09:26 akeating joined
09:26 stephen_m|androi joined
09:26 kuzyn joined
09:36 hauleth joined
09:40 dogweather joined
09:42 ub joined
09:45 ksingh_11 joined
09:47 jeffro joined
09:48 miwa_ joined
09:52 hypercore joined
09:52 <hypercore> is graphql superior to REST?
09:53 dogweather joined
09:56 toothfairy_ joined
09:56 <nyaray> you'll need to provide more context for a meaningful answer
09:57 PragTob joined
09:57 dogweath_ joined
10:02 <hypercore> nyaray: basically wondering if i should start using graphql by default in all my new elixir projects
10:04 Flyynn joined
10:11 lexmag joined
10:15 dogweath_ joined
10:18 fschuindt joined
10:18 <fschuindt> Does HexDoc provides a way to tag a certain file.md as a custom page?
10:20 <fschuindt> ExDoc*
10:20 <Nicd-> fschuindt: yes
10:20 codestorm joined
10:21 <fschuindt> Nicd- already found, I was searching for HexDoc instead of ExDoc. thanks
10:23 dogweather joined
10:25 lexmag joined
10:30 hypercore joined
10:31 proteus-guy joined
10:32 <dysfun> anyone using bigflake for ecto ids? I'm not sure what to pass to make ecto happy that my id is compatible
10:33 <dysfun> i get a validation change when i try to insert one as a foreign key (belongs_to)
10:36 <hypercore> is graphql superior to REST?
10:36 <Nicd-> no
10:36 <dysfun> that's a very loaded adjective
10:36 <Nicd-> it's different
10:36 <Nicd-> not to mention GraphQL is a spec while REST is usually just a philosophy
10:42 <hauleth> hypercore: is plane better than boat?
10:43 <fschuindt> GraphQL comes with built-in "typespecs" for your resources. They are really different stuff. It all depends on your goal. There are even things like gRPC.
10:44 _arkgil joined
10:46 <Nicd-> I use both REST style APIs and GraphQL in my service, for different purposes
10:53 dogweath_ joined
10:54 <fschuindt> Absinthe is great btw. I was able to set up a whole API really quick with no prior knowledge of GraphQL server-side implementations.
10:57 miwa joined
11:01 akeating joined
11:01 lexmag joined
11:06 JimmyRcom_ joined
11:08 hypercore joined
11:08 PragTob joined
11:10 Electrux joined
11:10 philShaughnes joined
11:11 ub joined
11:13 aeliton joined
11:14 mertonium joined
11:15 codestorm joined
11:19 Flyynn joined
11:22 mertonium joined
11:33 fxer joined
11:33 fxer joined
11:37 dogweather joined
11:38 aeliton_ joined
11:45 stephen_m|androi joined
11:45 elixir-lang-repo joined
11:45 <elixir-lang-repo> [elixir] michalmuskala opened pull request #7753: Refactor __info__ so it generates smaller assembly (master...mm/info-optim) https://git.io/vhi3C
11:45 elixir-lang-repo left
11:48 jeffro joined
11:50 hypercore joined
11:54 dogweather joined
11:56 mertonium joined
11:58 mertonium joined
11:59 kuzyn joined
12:00 karreiro joined
12:03 <mahmudov> https://paste.ee/p/iAnEl
12:04 <mahmudov> ** (Mix) The database for Todoapp.Repo couldn't be created: ERROR 22023 (invalid_parameter_value): new encoding (UTF8) is incompatible with the encoding of the template database (SQL_ASCII)
12:04 <mahmudov> any idea?
12:05 hypercore joined
12:05 <Nicd-> it's a postgresql problem
12:06 <Nicd-> https://stackoverflow.com/questions/16736891/pgerror-error-new-encoding-utf8-is-incompatible
12:06 lexmag joined
12:07 <mahmudov> +1
12:09 jerel joined
12:09 codestorm joined
12:12 dogweather joined
12:18 cagomez joined
12:20 tallysmartins joined
12:21 __charly__ joined
12:25 dogweather joined
12:28 lexmag joined
12:30 jeffro joined
12:33 za1b1tsu joined
12:33 akeating joined
12:35 sindan joined
12:39 stephen_m joined
12:41 stephen_m|androi joined
12:41 PragTob joined
12:42 dogweather joined
12:49 fmcgeough joined
12:50 _arkgil joined
12:52 <stiang> what does it mean when iex puts three dots at the end of a map that it prints out? %{"foo" => "bar", (lots more keys), "moo" => "boo", ...}
12:52 <stiang> is it truncating the output?
12:52 <OliverMT> si
12:53 <stiang> hmm. is there any way to see the full map?
12:54 <OliverMT> yes
12:54 <OliverMT> add limit: :inifinity
12:54 <OliverMT> to your inspect
12:54 <OliverMT> probably useful with a pretty: true too
12:56 philShaughnes joined
12:57 za1b1tsu joined
12:58 mcspud joined
12:59 dogweather joined
12:59 <stiang> I can’t get that to work in iex. `inspect(my_map, limit: :infinity, pretty: true)` prints a long string with lots of escapes that ends with `" <> ...`
13:00 <stiang> and `i` doesn’t accept a second argument
13:00 zakora joined
13:02 <stiang> figured it out: `IO.inspect(my_map, limit: :infinity, pretty: true)`
13:03 codestorm joined
13:07 und0ck3d joined
13:09 <OliverMT> it didnt work without IO. ?
13:09 <OliverMT> josevalim or someone else, why is that?
13:09 <josevalim> because the one without the io will return a string that still needs to be printed by iex
13:10 stephen_m joined
13:10 milisarge joined
13:10 <josevalim> which will then be limited too
13:10 <josevalim> inspectception
13:10 <OliverMT> ah ofc
13:10 <OliverMT> you can also use printable_limit: <integer> I think
13:21 lexmag joined
13:27 akeating joined
13:27 mahmudov joined
13:29 karreiro joined
13:30 karreiro joined
13:30 hypercore joined
13:33 tgould joined
13:33 dogweather joined
13:33 iAmerikan joined
13:38 und0ck3d joined
13:47 PragTob joined
13:47 und0ck3d joined
13:51 lessless joined
13:55 dogweather joined
13:55 Flyynn joined
13:56 duane joined
13:57 codestorm joined
13:58 elixir-lang-repo joined
13:58 <elixir-lang-repo> [elixir] michalmuskala closed pull request #7753: Refactor __info__ so it generates smaller assembly (master...mm/info-optim) https://git.io/vhi3C
13:58 elixir-lang-repo left
13:58 mitchellhenke joined
13:59 hypercore joined
14:03 stephen_m joined
14:05 mertonium joined
14:09 za1b1tsu joined
14:10 praveen joined
14:12 dogweather joined
14:13 jeffro joined
14:17 nineczar joined
14:22 Avinash joined
14:26 maxbeizer joined
14:29 dogweather joined
14:33 stephen_m joined
14:40 tgould joined
14:41 PragTob joined
14:42 dogweather joined
14:51 codestorm joined
14:54 dogweather joined
14:54 jegaxd26 joined
14:55 mahmudov joined
14:55 tgould_ joined
15:02 karreiro joined
15:02 jerel joined
15:05 wsieroci joined
15:07 und0ck3d joined
15:07 dogweather joined
15:11 dimitarvp joined
15:11 DSM joined
15:13 njichev joined
15:17 aeliton__ joined
15:17 TheNet joined
15:21 sihui_io joined
15:22 tuacker joined
15:25 dogweather joined
15:28 gvaughn joined
15:30 beefjoe joined
15:33 DSM joined
15:33 akeating joined
15:34 netrino joined
15:34 weird_error joined
15:39 lessless joined
15:42 dogweather joined
15:42 akeating joined
15:44 codestorm joined
15:52 __charly__ joined
15:53 cagomez joined
15:54 hypercore joined
15:57 cagomez joined
15:57 iamvery joined
15:57 cagomez joined
15:59 icecreamcohen joined
16:01 dogweather joined
16:06 iamvery joined
16:06 KeyJoo joined
16:15 iamvery joined
16:18 cagomez joined
16:20 iamvery joined
16:25 iamvery joined
16:35 za1b1tsu joined
16:38 lexmag joined
16:39 iamvery joined
16:39 codestorm joined
16:42 Uniaika_ joined
16:43 <fmcgeough> with a Phoenix release bulit with Distillery… what does the “ping” command actually use to determine whether VM is up ?
16:44 karreiro joined
16:44 <asonge> fmcgeough: distributed erlang
16:44 <asonge> it launches a copy of the VM and then tries to talk to it
16:44 <fmcgeough> I’m getting: Protocol 'inet_tcp': the name <myname> seems to be in use by another Erlang node when I run ping
16:45 <DavidAntaramian> I believe it specifically uses :net_adm.ping/1 (http://erlang.org/doc/man/net_adm.html)
16:45 <fmcgeough> looking...
16:46 jamenmarz joined
16:47 iamvery joined
16:49 <fmcgeough> no idea. it happened but I just tried again and it didn’t. Could there be an issue if it was run simulatenously?
16:49 sihui_io joined
16:51 Zaab1t joined
16:52 <asonge> yes
16:52 <fmcgeough> its the only thing I can think of. one of my team members might have run it at the exact same time as I did.
16:52 <fmcgeough> in another console
16:55 dogweather joined
16:55 lessless joined
16:56 iamvery joined
17:00 philShaughnes joined
17:04 sihui_io joined
17:04 iamvery joined
17:04 akeating joined
17:07 kapil___ joined
17:07 dogweather joined
17:09 stephen_m joined
17:11 akeating joined
17:13 iamvery joined
17:14 JimmyRcom_ joined
17:17 za1b1tsu joined
17:18 <tristan__> weird, thought it got a unique nodename each time nodetool was run
17:20 aalmazan joined
17:20 codestorm joined
17:20 dogweather joined
17:21 iamvery joined
17:25 weird_error joined
17:26 iamvery joined
17:28 stephen_m joined
17:30 maxbeizer joined
17:32 mahsav joined
17:32 icecreamcohen joined
17:42 dogweather joined
17:56 Phylock joined
17:58 <stiang> when using dynamic/2 with Ecto, isn’t the letter(s) inside the binding brackets supposed to match the letters used later in the query? for example with `dynamic([p], p.is_public or ^dynamic)`, shouldn’t "p" match whatever uses "p" in the query, for example a join binding like `left_join: p in Post` ? I’m getting an error that suggests otherwise (all dynamic clauses are expanded to match the outer "from" binding )
17:59 philShaughnes joined
18:03 dogweather joined
18:04 squall joined
18:05 <micmus> stiang: Ecto bindings are positional, names are not considered
18:05 <stiang> micmus: hah, I *just* figured that out from reading the docs a little closer, but thanks for confirming
18:06 mertonium joined
18:07 iamvery joined
18:09 <hypercore> when is 1.4 coming out?
18:09 <bind> hypercore: fwiw .. I am currently switching from a (django rest framework) REST api to mostly graphql with some rest endpoints and I must say I really like it; mostly because of the clean mapping from business logic to "mutations" and that your graphql type specification is a clear way to state what can be done within your api (while in rest land we had a bit of a hard time figuring out what rest api
18:09 <bind> standard to follow and how to fit all business logic in there; and for some cases one still would have to rely on rpc-like endpoints anyway)
18:09 <hypercore> ?
18:09 <hypercore> ???
18:11 <bind> I have no idea when 1.4 is coming .. june/july? :)
18:11 <bind> looking at the release dates so far..
18:11 <bind> it could seem likely
18:16 _arkgil joined
18:16 iamvery joined
18:17 cagomez joined
18:17 cagomez joined
18:19 <DavidAntaramian> hypercore: 1.4 of what?
18:21 iamvery joined
18:21 <bind> I would guess phoenix but indeed ... hypercore ? :D
18:28 Labu joined
18:32 melter joined
18:33 work_ joined
18:35 jamenmarz joined
18:41 <jeregrine> if its phoenix the official word is "soon"
18:43 iamvery joined
18:53 Electrux joined
18:54 dogweather joined
18:55 iAmerikan joined
18:56 iamvery joined
19:00 stephen_m joined
19:01 iamvery joined
19:01 DeadTrickster joined
19:04 jerel joined
19:06 jeffro joined
19:09 JimmyRcom_ joined
19:10 iamvery joined
19:14 cagomez joined
19:20 dogweather joined
19:22 DSM joined
19:26 DeadTrickster joined
19:29 iamvery joined
19:34 iamvery joined
19:34 <bind> :D
19:35 iAmerikan joined
19:37 dogweather joined
19:46 cagomez joined
19:47 philShaughnes joined
19:48 fxer joined
19:48 fxer joined
19:49 iamvery joined
19:54 iamvery joined
19:57 elixir-lang-repo joined
19:57 <elixir-lang-repo> [elixir] meddle0x53 opened pull request #7755: Fix the LFE example in Mix.Compilers.Erlang (master...master) https://git.io/vhPqc
19:57 elixir-lang-repo left
19:57 DTZUZU joined
19:57 icecreamcohen joined
19:59 dogweather joined
20:01 DSM_ joined
20:01 <adamkittelson> finally getting around to using the formatter and setting up my config file, is there a good way to automatically add your dependencies to the import_deps list or do people generally just add the major ones with known DSLs? (ecto / phoenix etc)
20:03 iamvery joined
20:03 jmiven joined
20:03 miwa_ joined
20:09 iamvery joined
20:09 <josevalim> Major ones yeah
20:11 elixir-lang-repo joined
20:11 <elixir-lang-repo> [elixir] ericmj closed pull request #7750: Add instructions for fixing deadlock errors (master...emj/improve-deadlock-message) https://git.io/vh6YR
20:11 elixir-lang-repo left
20:11 dogweather joined
20:13 <adamkittelson> cool, thanks josevalim
20:17 cagomez joined
20:18 iamvery joined
20:22 <stiang> josevalim: just curious - did you consider having the string be the first argument for the functions in the Regex module? I quite often find myself transforming a string by piping it to a sequence of function calls, but that falls apart whenever I need to use a Regex function. not a big thing, of course, but the other way around seems more natural to me.
20:24 milisarge joined
20:29 internetfriend joined
20:29 <internetfriend> hola
20:31 <asonge> stiang: a lot of the String module functions take regex as arguments, and there's some duplication between some string and regex functions
20:31 <asonge> the thought is that the regex module takes expressions first and string module takes subject first (since you're operating on the string, not the regex)
20:31 <asonge> stiang: for the most part, whatever module you're using, that "type" is what tends to be in the first argument's position
20:32 <internetfriend> I'm currently trying to add a resource that's responsible for tracking uploads to an image hosting service. I've created a `Media.Asset` resource that should belong to `User`, `Trip`, and `Contact`. All three of these schemas include `has_many :assets, BeaconServer.Media.Asset` and `BeaconServer.Media.Asset` belongs to all three
20:33 <internetfriend> For some reason, when I try to assoc an Asset with one of these, it tries to validate that all three ids are present
20:33 <internetfriend> its changeset is as follows:
20:33 <internetfriend> def changeset(asset, attrs) do
20:33 <internetfriend> asset
20:33 <internetfriend> |> cast(attrs, [:format, :secure_url, :url, :public_id, :bytes])
20:33 <internetfriend> |> validate_required([:format, :secure_url, :url, :public_id, :bytes])
20:33 <internetfriend> |> cast_assoc(:user, BeaconServer.Accounts.get_user!(attrs.user_id))
20:33 <internetfriend> |> cast_assoc(:trip, BeaconServer.Accounts.get_trip!(attrs.trip_id))
20:33 <internetfriend> |> cast_assoc(:contact, BeaconServer.Accounts.get_contact!(attrs.contact_id))
20:33 <Zarathu> oh boy.
20:34 <jeregrine> if you cast_assoc it expects it to exist
20:34 <internetfriend> Ah that was a recent change. I was trying `put_assoc` aswell
20:35 <jeregrine> I would call cast or put only when you know you have the user/trip/contact
20:35 <jeregrine> separate changeset functions for different scenarios is common
20:35 <Zarathu> internetfriend: |> put_assoc(:user, get_user!(attrs.user_id)) is pretty pointless logic imo. just pass in the id itself and be done with it
20:36 <Zarathu> |> cast(attrs, ...fields ++ [:user_id])
20:36 <internetfriend> Ah ok. This is my first ~large~ project in elixir / phoenix, so I'm hitting a lot of walls :P
20:36 elixir-lang-repo joined
20:36 <elixir-lang-repo> [elixir] ericmj opened pull request #7756: Document DateTime.diff/2 leaps (master...emj/datetime-leaps) https://git.io/vhPsd
20:36 elixir-lang-repo left
20:36 <jeregrine> that too
20:36 <Zarathu> internetfriend: are you coming from a rails background?
20:36 <internetfriend> I am
20:37 <Zarathu> ok, so you're probably used to things like before_save callbacks where, in your Media.Asset model you could call user directly and make changes
20:37 <Zarathu> that's not how Ecto works at all
20:37 <internetfriend> I'm really enjoying elixir+phoenix. It'sjust a lot of new lol
20:37 iamvery joined
20:37 <stiang> asonge: I guess I hadn’t looked close enough at the String functions, that mostly solves my issues.
20:37 <internetfriend> Yeah I know callbacks aren't favored at all
20:38 <Zarathu> for something simple like this, your Asset schema should never be concerned with manipulating your User schema
20:38 <Zarathu> only with its own field validations, that's it
20:38 <jeregrine> internetfriend: one tip, the ecto docs are really good, the modules all have good examples and explanations.
20:39 <Zarathu> if User and Trip need to be changed when an Asset is uploaded, you should look into Ecto.Multi: https://hexdocs.pm/ecto/Ecto.Multi.html
20:39 <internetfriend> jeregrine: awesome. thanks mate. I've been really impressed with the docs thus far. Just hard to figure out what I don't know
20:39 <jeregrine> internetfriend: right on, irc is a good place to figure that out
20:39 <Zarathu> it's the preferred structure for making multiple changes in a transaction
20:39 <internetfriend> Zarathu: It's more that I want something like polymorphism. An asset could belong to a user, trip, or contact
20:40 <internetfriend> Speaking in actual terms, an asset is essentially the representation of an image
20:40 <internetfriend> If owned by a user, it could be an avatar or profile pic. If it belongs to a trip, it could be a photo taken on a trip, etc
20:40 <jeregrine> I've had good success using arc and arc_ecto in the past if you're looking for something pre-built
20:41 <internetfriend> If contact, perhaps it's someoen's headshot
20:42 <internetfriend> Ah interesting. I was planning on using Cloudinary to host images, whose API returns all sorts of information on an upload, which was what I'm planning on storing in an `Asset`
20:42 <Zarathu> internetfriend: you could do it the rails way and have "owner_id" and "owner_type" columns. but the safer way would be to have "trips_assets", "contacts_assets", "users_assets" etc tables
20:43 <internetfriend> Ahh ok. You think distinct tables for each type is the sane route?
20:43 <Zarathu> when querying for the trip assets you do: from(a in {"trips_assets", Asset}) ...
20:43 m1dnight_ joined
20:43 <Zarathu> i think so, yes. i haven't tried it the rails way with ecto, so i'm not sure if you'd hit a wall doing that
20:44 <internetfriend> I'm fairly confident I'm up against that wall right now :P
20:44 <Zarathu> well then. :P
20:44 <internetfriend> I saw some mention in a blog post of splitting it up into multiple tables. I guess I can try that route. Different, but it seems sane enough
20:44 <internetfriend> Thanks folks <3
20:45 <Zarathu> the benefit you get from that is foreign key constraints, too
20:45 <internetfriend> true
20:45 <Zarathu> probably better.
20:46 <jeregrine> also https://hexdocs.pm/ecto/Ecto.Schema.html#belongs_to/3-polymorphic-associations
20:47 <internetfriend> Hmmmm... :assoc_id seems funky
20:47 <internetfriend> Is there something special going on there, or is that arbitrarily named?
20:47 <asonge> why funky?
20:48 <internetfriend> I guess I just don't follow how that associates it with something else
20:48 <internetfriend> I've also been writing code for like 20 hrs, so that may have something to do with it
20:49 <asonge> you have to define each direction with ecto, it's just that it's impossible to define it the "other" way with polymorphic assoc's
20:49 duane joined
20:49 <asonge> you can also embed the schema if you never need to really select out just the assets (in your example)
20:50 <internetfriend> Ah I get you
20:50 <internetfriend> I'll actually need to select them out :/
20:51 <DeadTrickster> trying to run iex under 19.3 Elixir is 1.4 freshly built - error_info: {exit,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"}, any idea
20:51 <DeadTrickster> ?
20:51 <jeregrine> embedded schemas are a ton of fun
20:52 <micmus> DeadTrickster: is that the whole output? Any errors about module loading? Did you build the elixir with 19.3?
20:52 <asonge> internetfriend: you can also use multiple tables and 1 schema by using multiple sources. then you can also create a "view" that's a union of the 3 tables. that's always a fun way of doing things.
21:06 <DeadTrickster> asonge, yes, on 19.3
21:06 <DeadTrickster> error_info: {exit,{undef,[{'Elixir.IEx.CLI',start,[],[]},{user_sup,start_user,3,[{file,"user_sup.erl"},{line,100}]},{user_sup,init,1,[{file,"user_sup.erl"},{line,49}]},{supervisor_bridge,init,1,[{file,"supervisor_bridge.erl"},{line,80}]},{gen_server,init_it,6,[{file,"gen_server.erl"},{line,328}]},{proc_lib,init_p_do_apply,3,[{file,"proc_lib.erl"},{line,247}]}]},[{gen_server,init_it,6,[{file,"gen_server.erl"},{line,352}]},{proc_lib,init_p_do_a
21:06 <DeadTrickster> pply,3,[{file,"proc_lib.erl"},{line,247}]}]}
21:06 <DeadTrickster> and before that 2018-06-14 23:49:45 ~s~n
21:06 <DeadTrickster> "beam/beam_load.c(1287): Error loading module 'Elixir.IEx.CLI':\n mandatory chunk of type 'Atom' not found\n\n"
21:06 <DeadTrickster> which isn't right either
21:08 <micmus> DeadTrickster: chunk Atom was replaced with AtU8 for unicode atoms on OTP 20, so this looks like the module IEx.CLI was compiled with OTP 20
21:09 fmcgeough joined
21:12 stephen_m joined
21:16 <DeadTrickster> yes I have a feeling I need to delete all beams
21:16 <DeadTrickster> damn rabbitmq
21:17 <DeadTrickster> though why make clean didn't do that
21:19 <DeadTrickster> yes find . -name "*.beam" | xargs rm helped lol
21:19 <DeadTrickster> not good
21:20 mitchellhenke joined
21:23 akeating joined
21:28 iamvery joined
21:29 karreiro joined
21:29 elixir-lang-repo joined
21:29 <elixir-lang-repo> [elixir] josevalim closed pull request #7755: Fix the LFE example in Mix.Compilers.Erlang (master...master) https://git.io/vhPqc
21:29 elixir-lang-repo left
21:31 rschmukler joined
21:31 <syndikate> I was reading the tutorial here https://hexdocs.pm/phoenix/heroku.html#making-our-project-ready-for-heroku, it tells to find the user_socket.ex file here lib/hello_world/channels/user_socket.ex whereas I found it at web/channels. Is it something that I configure wrong while app generation?
21:32 _arkgil joined
21:32 <syndikate> Mine is a fresh scaffold app btw
21:32 <syndikate> Oh, wait. Should I be asking in phoenix IRC
21:32 <benwilson512> syndikate: the user socket is created by phx.new
21:32 <benwilson512> syndikate: no just ask here
21:32 <josevalim> syndikate: i think you are using phoenix v1.2
21:33 elixir-lang-repo joined
21:33 <elixir-lang-repo> [elixir] ericmj pushed 1 new commit to master: https://git.io/vhPlo
21:33 <elixir-lang-repo> elixir/master 6eff1c4 Eric Meadows-Jönsson: Document DateTime.diff/2 leaps (#7756)
21:33 elixir-lang-repo left
21:34 <syndikate> josevalim, I am using Phoenix v1.3.2
21:34 <syndikate> Used this command -> mix phoenix.new --version
21:34 <OvermindDL1> `phoenix.new` is ancient, you should be using `phx.new`
21:34 <syndikate> benwilson512, am I looking at two different sockets here? I am not sure if I missed some steps
21:34 schainks_ joined
21:35 <syndikate> OvermindDL1, yes my bad. I am just picking up the framework and language. I read some old stuff to begin with
21:35 <josevalim> syndikate: no worries
21:35 <josevalim> we introduced phx.new but we kept phoenix.new so we didn't break all of the material on the internet
21:35 <josevalim> but now it has the side-effect you may run the wrong one
21:35 <josevalim> sorry for the confusion
21:36 <syndikate> Oh, no worries. I understand the decision to keep the old one. Although what exactly is the issue of running 'wrong one' ?
21:36 <benwilson512> it creates the app in an older directory structure with now-out dated dependency versions
21:38 <syndikate> Oh damn, I used phoenix.new to scaffold - could that be the reason for this user_socket.ex be at a different location than expected?
21:39 JimmyRcom_ joined
21:40 <josevalim> syndikate: precisely yes
21:40 <josevalim> you are using the old structure
21:40 <sms> I currently have a list of checkboxes in my template based on a many-to-many category, I returned it with list_categories. So I'm looping through it and putting a checkbox for each item. But how would I check if an association exists in the update page so I can set checked to true or false?
21:40 <syndikate> josevalim, :facepalm: sorry for the trouble guys. Well, learned something meanwhile
21:40 <benwilson512> syndikate: not a problem!
21:42 <syndikate> So, it's entirely okay if I skip to learn the diff of old and new directory structure and start with the current one?
21:42 <sms> I wonder if I'd also have to return the post id into the template at the very least and check if it exists in category.posts
21:43 weaksauce joined
21:43 <OvermindDL1> sms: To check if the association exists then you need to load that association from the controller time and pass the information (either the association or just a boolean or so for each) to the view
21:43 <benwilson512> syndikate: yes
21:43 <OvermindDL1> Any and all data the view needs should be gathered by the controller and passed over
21:44 <syndikate> benwilson512, alright
21:44 <sms> I have it in the view, but I'm thinking that'd get pretty unperformant when the categories grow OvermindDL1
21:44 <OvermindDL1> Well you have to get it sometime, never perform DB stuff in the view, ever ever
21:44 <OvermindDL1> Thus the controller
21:44 <syndikate> This is just to clarify my understanding - I think that's not a view concern but a controller concern to find the association, am I right?
21:45 <OvermindDL1> Just have the controller acquire whatever is needed
21:45 <OvermindDL1> syndikate: +1
21:45 <syndikate> Cool
21:45 <OvermindDL1> Controllers = Acquire data
21:45 <OvermindDL1> Views = Display pre-acquired data
21:45 <sms> Oh, to find the association?
21:45 <sms> Alright, wonder how I'd do that then
21:46 <syndikate> Rails I would eager load not sure about phoenix
21:46 rcdilorenzo joined
21:46 <OvermindDL1> sms: Ignore elixir right now, your question is "How would I do that with SQL"
21:46 <OvermindDL1> Since I'm guessing you are pulling it from a sql server like postgresql or so
21:46 <sms> Basically it's just a post page. I have checkboxes for each category, now I want to set them to checked if the post has that category
21:46 <OvermindDL1> Once you know how to do it in sql, then just translate that into ecto
21:46 <sms> Ahh
21:47 <OvermindDL1> I'd just add that to the post acquiring query, add another selection key which could just be a boolean that the database returns
21:47 <OvermindDL1> Minimizes data transfer, 'if exists' are super fast unlike full association lookups, etc... etc...
21:47 <OvermindDL1> And it's all in-SQL(Ecto)
21:48 <OvermindDL1> Any time you are touching or really operating on data from the database at all, see if SQL has a faster and more efficient way of already doing it, if it does then do that
21:48 <OvermindDL1> Only then drop back down to elixir
21:48 <OvermindDL1> That holds true regardless of your language
21:48 Electrux joined
21:49 <sms> Oh alright, sounds like a solid rule of thumb
21:49 <benwilson512> been very happy with insert_all and on_conflict: :nothing lately
21:49 <benwilson512> for similar situations
21:59 akeating joined
21:59 Electrux joined
22:00 icanhazbroccoli1 joined
22:01 <syndikate> What advice would you guys give to somebody starting with phoenix/elixir coming from rails/ruby background?
22:02 <syndikate> I mean, lot of stuff are out there on this topic, but just wanted to know what people here think
22:03 dogweather joined
22:03 hauleth joined
22:04 <benwilson512> syndikate: I think the main piece of advice I'd give is to make sure to get comfortable with basic functional Elixir
22:05 <syndikate> Okay benwilson512
22:05 <syndikate> Thanks
22:07 Notimik joined
22:07 iamvery joined
22:09 akeating joined
22:09 Electrux joined
22:13 <nickjj> syndikate, find a project to work and hack away on it while googling when you get stuck every step of the way
22:17 iamvery joined
22:19 Electrux joined
22:20 dogweather joined
22:25 iamvery joined
22:29 Electrux joined
22:31 tgrk joined
22:37 dogweather joined
22:39 Electrux joined
22:49 mertonium joined
22:49 Electrux joined
22:59 Electrux joined
23:04 DSM joined
23:06 bobthenameless joined
23:09 stephen_m joined
23:09 Electrux joined
23:16 kuzyn joined
23:19 Electrux joined
23:30 dogweather joined
23:30 DTZUZO joined
23:31 alexband joined
23:35 Electrux joined
23:41 gem joined
23:41 <gem> Hi, I'm having some trouble with the alcove and prx libs found under https://github.com/msantos. Specifically sudo privileges -- whenever running sudo -n, I get an error
23:42 alexband joined
23:43 jeffro joined
23:48 Electrux joined
23:48 codestorm joined
23:51 <gem> Hey
23:51 <gem> Does anyone here have experiance with containers in linux
23:53 erlehmann joined
23:54 erlehmann_ joined
23:55 erlehmann_ joined
23:56 weird_error joined
23:56 erlehmann joined
23:58 Electrux joined