<     May 2017     >
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 20  
21 22 23 24 _2_5 26 27  
28 29 30 31
00:00 Cohedrin joined
00:13 WhiskyRyan joined
00:16 ssswitch joined
00:17 Ilyes512 joined
00:18 jmill joined
00:18 <bitmod> asonge, what's the difference between User and %User in a controller? (where user is also a model)
00:19 <Ankhers> bitmod: User will refer to the module. %User{} refers to schema defined in the User module.
00:20 <Ankhers> %User{} is the struct.
00:20 <bitmod> Ankhers: ah ok, thanks!
00:20 <asonge> so, User is an alias that refers to some atom based on what you alias earlier, usually :Elixir.User, there is a module that has the name User, and %User{} is a struct
00:20 <asonge> Ankhers: i'd say the schema is actually the module
00:20 <asonge> though i'd have to go rtfm to see what the actual nomenclature is
00:21 <Ankhers> asonge: Yeah, that is why I changed it to be struct.
00:24 <asonge> bitmod: just to be clear, you use `defstruct` to make a struct, and the ecto schema autogenerates a struct based on how you define the schema part. also, model is no longer really the right name for it, because people have bad expectations about models.
00:25 jkreeftmeijer joined
00:26 <bitmod> asonge: can you give me a brief overview of how data is stored and interacted with using ecto?
00:26 <bitmod> i don't think i really grok it yet
00:27 nhooyr joined
00:27 <asonge> bitmod: so, changesets allow you to define declaratively how to transform a map of raw data into the appropriate struct. when you send the changeset to the repository (which represents the database connection), it can expand into inserts and updates and such.
00:28 nhooyr joined
00:30 <bitmod> asonge: oh ok, so changeset are basically a medium of exchange between the database and phoenix?
00:30 <asonge> not database and phoenix, per se.
00:31 <bitmod> s/medium of exchange/medium
00:31 <asonge> but between arbitrary input generally, and possibly combined with an existing struct (that represents the data in the database, like in the update case), and the database repo knows how to turn that into storage
00:33 <asonge> bitmod: go ahead and try to inspect a changeset, for instance
00:35 <bitmod> asonge: done
00:35 <asonge> the nice thing about changesets is that they're just normal data, and they are made to "compose", so if your restrictions on creating and updating a piece of data are different, you have different changesets
00:35 <asonge> you can also have a different changeset for changing the password, and the default changeset doesn't include password in the changeset at all, so it's impossible to change the password with a default update
00:37 jmill joined
00:38 <bitmod> asonge: ok tell me if this is right: a changeset is a way of storing (and updating) data (that is defined in the database, e.g. a "user" table) which add conditions to any actions it makes (e.g. inserting, updating, etc)
00:38 alex88 joined
00:38 <bitmod> or is there an analogy that might make the concept easier?
00:39 <asonge> bitmod: that's close
00:39 <asonge> but everything is more about "transformation"
00:39 enilsen16 joined
00:39 <asonge> the changeset doesn't actually do any input or output or side effects
00:40 <asonge> (there are a couple kinda exceptions to this*)
00:48 Reshi joined
00:52 <alisdair> speaking of changesets, is there an idiomatic way to go from params like `{ "name" : "joe armstrong" }` to a schema with `first_name` and `last_name` fields? right now i just munge the params before handing them to the changeset, but it seems like there should be a `cast_to` function
01:03 justelex joined
01:06 jmill joined
01:23 jushur joined
01:26 jkreeftmeijer joined
01:27 greengriminal joined
01:36 zv joined
01:39 tomterl joined
01:43 ssswitch joined
01:44 WhiskyRyan joined
01:44 LastWhisper____ joined
01:58 WhiskyRyan joined
02:05 gaeta_ joined
02:06 <gaeta_> Does the elixr doc system use readthedocs stuff?
02:13 <asonge> no
02:14 WhiskyRyan joined
02:15 kronicdeth joined
02:30 inoas joined
02:32 enilsen16 joined
02:32 scrmpy joined
02:40 <scrmpy> Is there anyway to have two projects specify eachother as dependencies but on for testing? Otherwise if not would it make more sense to just restrict the tests to testing the individual projects (without the external functionality) and then my third project that brings everything together should then handle those types of tests (making everything is working correctly with each other)?
02:40 myronmarston joined
02:41 <asonge> your app dependencies should probably be acyclic.
02:41 <asonge> you can have a third app bring the two together to test them together.
02:41 <scrmpy> ok
02:41 <asonge> or just declare the dependency 1 way.
02:42 <scrmpy> neither of the projects depend on each other in the project itself, it's just in the tests. but yeh I'll just do it with the third project
02:42 mika__ joined
02:44 LastWhisper____ joined
02:45 kronicdeth joined
02:48 jeramyRR joined
02:50 WhiskyRyan joined
03:00 gaeta_ left
03:02 kronicdeth joined
03:07 kronicdeth joined
03:24 zv joined
03:27 jkreeftmeijer joined
03:30 cschneid_ joined
03:49 refriedchicken joined
03:55 myronmarston joined
03:57 srxa joined
04:03 NeverDie joined
04:25 gvaughn joined
04:34 WhiskyRyan joined
04:34 zodiak_ joined
04:35 karmajunkie joined
04:35 cschneid_ joined
04:36 mika__ joined
04:36 enilsen16 joined
04:41 dongcarl joined
04:46 refriedchicken joined
04:47 craigp_ joined
04:51 treaki__ joined
04:52 notdaniel joined
04:54 gvaughn joined
04:58 fishythefish joined
05:02 srxa_ joined
05:03 <fishythefish> I'm trying to get started with Elixir and mix new keeps complaining that I have invalid characters in my application name. Can anyone help?
05:05 justelex joined
05:05 <fishythefish> e.g. if I run `mix new hello_world`, I get "** (Mix) Application name must start with a letter and have only lowercase letters, numbers and underscore, got: "hello_world"."
05:06 <fishythefish> I looked at the elixir source, and it appears to be doing a simple regex match, so I don't know why it's failing.
05:07 wsieroci joined
05:10 srxa joined
05:11 myronmarston joined
05:14 <Nicd-> what elixir version?
05:14 <Nicd-> it seems to work fine for me
05:16 <fishythefish> Erlang/OTP 20 [erts-9.0] [source] [64-bit] [smp:4:4] [ds:4:4:10] [async-threads:10] [hipe] [kernel-poll:false]
05:17 <fishythefish> Although then it gives me a crash dump due to "init terminating in do_boot" (I'm only running elixir -v)
05:17 <micmus> fishythefish: OTP 20 release candidate is not yet officially supported
05:17 <micmus> you'll need a stable version of OTP
05:17 <fishythefish> Ah, okay. I'm using whatever pacman provides on Arch, so figures
05:17 <micmus> or compile elixir master manually
05:17 WhiskyRyan joined
05:17 <fishythefish> Okay, thanks for the help!
05:29 jkreeftmeijer joined
05:30 icanhazbroccoli joined
05:44 elgenie joined
05:47 griffinbyatt joined
05:51 srxa_ joined
05:54 wsieroci joined
05:57 ariejan joined
05:58 refriedchicken joined
06:22 WhiskyRyan joined
06:25 elgenie joined
06:42 gvaughn joined
06:48 griffinbyatt joined
06:55 tuacker joined
06:58 blahdodo joined
07:13 blahdodo joined
07:18 Cohedrin joined
07:31 jkreeftmeijer joined
07:37 ejpcmac joined
07:40 nd___ joined
07:44 justelex joined
07:48 griffinbyatt joined
08:02 justelex joined
08:08 justelex joined
08:15 cschneid_ joined
08:17 myronmarston joined
08:19 stephen_m joined
08:31 gvaughn joined
08:37 pratch joined
08:49 griffinbyatt joined
09:00 nd____ joined
09:01 srxa joined
09:11 cemilowski joined
09:16 marr joined
09:26 gvaughn joined
09:28 PaReeOhNos joined
09:32 josevalim joined
09:32 jkreeftmeijer joined
09:47 PaReeOhNos joined
09:47 justelex joined
09:50 griffinbyatt joined
09:50 lexmag joined
09:55 squallstter joined
09:56 Notimik joined
10:03 nd___ joined
10:07 gmcabrita joined
10:14 justelex joined
10:25 fhoffmann joined
10:26 embik joined
10:26 embik joined
10:27 justelex_ joined
10:39 dignifiedquire joined
10:46 wsieroci joined
11:04 cemilowski joined
11:07 todder joined
11:11 modlin joined
11:11 zealsham_ joined
11:11 justelex_ joined
11:13 dimitarvp joined
11:14 cemilowski joined
11:14 gvaughn joined
11:18 <Siyo> http://stackoverflow.com/questions/7869592/how-to-do-an-update-join-in-postgresql
11:18 <Siyo> is this possible with Ecto update_all?
11:19 <Siyo> I don't see a way to specify a different table in UPDATE and FROM, so I'm thinking no. But maybe I'm not seeing something
11:19 Guest67 joined
11:21 <zealsham_> its gonna take me time before i become productive with elixir
11:27 zealsham_ joined
11:28 <zealsham_> how do you work with database in elixir
11:29 <Siyo> nevermind, I can use joins in ecto
11:31 fhdhsni joined
11:33 mika__ joined
11:46 PaReeOhNos joined
11:49 jkreeftmeijer joined
11:50 fhdhsni joined
11:52 griffinbyatt joined
11:58 squallstter joined
11:59 embik joined
12:00 peterpp joined
12:00 jkreeftmeijer joined
12:07 haste joined
12:10 cemilowski joined
12:10 PaReeOhNos joined
12:11 <Nicd-> zealsham_: Ecto is the usual DB library
12:11 vendethiel joined
12:16 asabil joined
12:20 mika__ joined
12:22 kronicdeth joined
12:28 asabil joined
12:43 wsieroci joined
12:44 Guest67 joined
12:46 Reshi joined
12:46 PaReeOhNos joined
12:53 griffinbyatt joined
12:57 cschneid_ joined
13:00 PaReeOhNos joined
13:00 jschneck joined
13:08 __charly__ joined
13:09 DeadTrickster joined
13:12 michaelwla joined
13:16 PaReeOhNos joined
13:24 juan_ joined
13:25 <juan_> hey guys I'm thinking of starting a new project and want to use phoenix instead of rails for it
13:25 <juan_> which version should I use 1.3 or 1.2?
13:26 <juan_> will it be a pain to upgrade to 1.3 if I just use 1.2 now?
13:30 inoas joined
13:36 justelex joined
13:42 jschneck joined
13:51 <iFire> juan_: I personally used 1.3 rc becaus it was a prototype project
13:51 <iFire> but in other projects I had to revert back
13:51 <iFire> because I had problems with exadmin at that point
13:51 cemilowski joined
13:52 <asonge> juan_: the pain is mostly up to you. upgrading to 1.3 in a project won't require changing from 1.2 to 1.3 project structure *but* the generators will be different, and you'll probably want to move it over to 1.3 structure
13:53 <juan_> asonge: ok I guess I'll just go with 1.3 then
13:53 <juan_> thanks guys
13:53 griffinbyatt joined
13:54 <asonge> juan_: there is probably still some 1.3-rc internal changes, but i think most of these are around how umbrellas work in the new generators
13:57 meh` joined
13:59 tuacker1 joined
14:03 PaReeOhNos joined
14:03 icanhazbroccoli joined
14:09 nd___ joined
14:10 rodolfojcj joined
14:13 jmill joined
14:17 pratch joined
14:18 embik joined
14:21 guest093842 joined
14:23 <guest093842> Hello. I'm trying to use the link function within a template to generate a form that uses the delete method. However, I need the form to be inside a pair of <p> tags. Normally, the link function handles this fine, but when I use the method option to turn it into a form, it won't generate HTML within the tags. Any ideas?
14:23 <guest093842> Hope that makes sense.
14:28 <guest093842> To clarify - I need to generate html like: <p> <form> stuff </form </p>, but when I use an HTTP method other than GET, the html output looks like: <p></p> <form> stuff </form> <p></p>
14:37 justelex joined
14:39 Ven joined
14:42 embik joined
14:43 <embik> quick question, how do I print an Ecto.DateTime more beautiful in a (Phoenix) template?
14:45 wsieroci joined
14:54 griffinbyatt joined
14:54 hashpuppy joined
14:56 craigp_ joined
14:57 Guest67 joined
14:59 Ven_ joined
15:06 <benwilson512> guest093842: http://stackoverflow.com/questions/1022041/why-doesnt-form-nested-in-p-validate-as-xhtml
15:06 <benwilson512> if you're looking at your inspector, it's likely your browser that is rewriting the dom not phoenix
15:07 <benwilson512> if you do view source you'll see how it comes raw from phoenix
15:09 griffinbyatt joined
15:09 <guest093842> Thank you benwilson512, I'll take a look now
15:10 squallstter joined
15:10 Ven_ joined
15:10 <benwilson512> guest093842: basically, it's invalid HTML, so don't do that ;)
15:11 kronicdeth joined
15:14 lexmag joined
15:16 stephen_m joined
15:22 sfbw joined
15:25 meandi joined
15:28 <nox> What is?
15:28 meh`_ joined
15:29 zodiak__ joined
15:32 <nox> benwilson512: The invalid part is the </p>. :)
15:32 <benwilson512> form is a block element and from the link at least p doesn't permit block element children
15:33 <nox> That's just author requirements, and has no influence on what the hell is happening in the page.
15:33 <nox> When parsing <form> in <p><form>..., <form> closes the <p> element.
15:33 <nox> That's legal syntax.
15:34 <benwilson512> fair, I suppose then my point is that the closing p tag is expected given the location of form?
15:35 <nox> See 'A start tag whose tag name is "form"' in https://html.spec.whatwg.org/multipage/syntax.html#parsing-main-inbody
15:35 <nox> benwilson512: The </p> in the source in SO is a parse error, because the current element isn't a <p> anymore at this point.
15:37 <nox> https://irccloud.mozilla.com/pastebin/mUwKxtNa/
15:37 <nox> ^ This is valid.
15:37 <nox> But <form> follows <p>, it's not its child.
15:38 <benwilson512> I'm very glad I'm not in the business of parsing html
15:39 <iFire> if I Was using riak would be recommended to integrate the server in the app
15:39 <iFire> or run it seperate
15:39 <iFire> That forces my app to be ran in 3+ (odd number) mode though
15:39 <nox> benwilson512: Ah ah.
15:40 <nox> benwilson512: It's quite boring, just transcribe the spec into code and you are done.
15:41 kronicdeth joined
15:46 gvaughn joined
15:48 kronicdeth joined
15:49 ssswitch joined
15:50 icanhazbroccoli joined
15:53 elixir1298 joined
15:54 tuacker joined
15:54 <elixir1298> Hi everyone, is there a particular way one is supposed to learn what behaviors/protocols are implemented for a particular module?
15:56 myronmarston joined
15:56 myronmarston joined
15:59 nhooyr joined
15:59 myronmarston joined
16:03 jmill joined
16:05 kronicdeth joined
16:05 <iFire> elixir1298: do you have a specific use?
16:06 <zodiak__> is compile time settings still the "best way" to do testing of external api calls inside a function ? I am so used to mock it's not even funny (python has probably warped my mind for good :)
16:06 <zodiak__> when switching between dev/test and prod obv
16:06 jschneck joined
16:07 <elixir1298> iFire: I was just reading the elixir "Getting Started" guide and it mentioned the Size protocol, but I can't seem to find the protocol defined anywhere.
16:08 <elixir1298> iFire: the api docs only list 5 total protocols.
16:09 <iFire> elixir1298: https://github.com/elixir-lang/elixir/blob/v1.0.5/lib/elixir/lib/dict.ex#L328
16:09 <iFire> reading through it
16:11 meh` joined
16:11 <iFire> https://github.com/elixir-lang/elixir/blob/531975610fce41be29f8d177baf3034fe8064c2b/lib/elixir/lib/kernel.ex#L3897
16:12 <iFire> found some documentation
16:13 <iFire> https://hexdocs.pm/elixir/Kernel.html#defprotocol/2 same version of that page
16:13 <iFire> elixir1298: directly mentions size protocol example
16:14 myronmarston joined
16:15 <elixir1298> iFire: Ah, okay. I didn't read the guide closely enough: "The protocol definition would look like this"...
16:16 <elixir1298> elixir1298: it's just a hypothetical implementation.
16:16 <elixir1298> iFire: ack. replied to myself.
16:16 <elixir1298> iFire: Thanks for your help.
16:19 myronmarston joined
16:25 returntrip joined
16:26 returntrip joined
16:27 <returntrip> anyone available for some help with installing erlang/elixir via asdf on arch linux?
16:38 mirela666 joined
16:38 refriedchicken joined
16:46 greengriminal joined
16:47 asabil joined
16:51 nhooyr joined
16:56 refriedchicken joined
16:56 nhooyr joined
16:56 asabil joined
16:57 kronicdeth joined
16:58 cschneid_ joined
16:58 mirela666 joined
17:00 nhooyr joined
17:00 wsieroci joined
17:03 jschneck joined
17:07 meh` joined
17:11 peterpp joined
17:12 icanhazbroccoli joined
17:15 elgenie joined
17:15 michaelwla joined
17:15 sunaku joined
17:16 sunaku joined
17:17 jschneck joined
17:21 <Nicd-> returntrip: if you have a problem, you should state it so people can help if they are around
17:22 klltkr joined
17:23 Ven joined
17:23 mirela666 joined
17:24 <michaelwla> hi everybody! I have trouble testing my applications logic in phoenix 1.2.3. If my logic lives in /lib/myapplication, where should i put the test modules? In /test/myapplication or in /lib/test? how do I load them in then?
17:25 <returntrip> sure, sorry: I have the following problem: On Arch Linuxm. When I try to install erlang 19.3 using asdf, while erlang is compiled, I get this error: " CC ../priv/obj/x86_64-unknown-linux-gnu/crypto.o
17:25 <returntrip> crypto.c:131:28: fatal error: openssl/chacha.h: No such file or directory
17:25 <returntrip> #include <openssl/chacha.h>". I have openssl installed (AFAIK the dev files are contained in the openssl package). I am wondering if someone else has had a similar issue and managed to fix it.
17:26 asabil joined
17:31 myronmarston joined
17:33 <Nicd-> michaelwla: mix new creates the standard project structure and tests, that should show you where stuff is
17:34 wsieroci joined
17:35 <michaelwla> Nicd: but it didn't create any test directory for my application modules, only for the things under /web
17:36 mika__ joined
17:36 <Nicd-> mix new does not create a /web :)
17:36 <Nicd-> that's phoenix
17:37 <michaelwla> o.0 I see your point now.
17:37 <Nicd-> anyway you should be able to reference your files in lib in tests just like normal
17:37 nhooyr joined
17:37 NeverDie joined
17:38 <Nicd-> like in any other code
17:39 egis joined
17:39 cemilowski joined
17:39 codestorm joined
17:47 mirela666 joined
17:47 mika__ joined
17:47 __charly__ joined
17:48 sillyotter joined
17:52 dnorris joined
17:58 jschneck joined
17:59 jerel joined
18:01 kronicdeth joined
18:04 justelex joined
18:05 Ven_ joined
18:07 Cohedrin joined
18:17 srxa joined
18:25 justelex joined
18:28 jschneck joined
18:31 cemilowski joined
18:41 hashpuppy joined
18:43 dnorris joined
18:43 myronmarston joined
18:44 refriedchicken joined
18:56 codestorm joined
19:05 wsieroci_ joined
19:15 <Ankhers> Does anyone have experience in Phoenix with sending the locale as part of the route? I need example.com/en/foo and example.com/foo to go to the same page. Basically, the locale is optional and it will default if one is not provided.
19:31 returntrip joined
19:37 dimitarvp` joined
19:39 filozof left
19:45 zealsham_ joined
19:46 ssswitch joined
19:54 myronmarston joined
19:55 Ven joined
19:56 nroi joined
20:02 justelex joined
20:06 <Ioyrie> Ankhers: can't you just have them all defined and have the same controller method to govern both routes?
20:07 myronmarston joined
20:14 marr joined
20:18 refriedchicken joined
20:20 myronmarston joined
20:26 srxa joined
20:31 zealsham_ joined
20:36 srxa joined
20:39 codestorm joined
20:41 Cohedrin joined
20:44 cschneid_ joined
20:46 cschneid_ joined
20:48 cschneid_ joined
20:49 elgenie joined
20:51 cschneid_ joined
20:52 NeverDie joined
21:01 jerel joined
21:18 jimmyrcom joined
21:26 nd___ joined
21:54 ur5us joined
21:55 __charly__ joined
22:07 codestorm joined
22:13 myronmarston joined
22:25 Lyubo1 joined
22:30 InternetFriend joined
22:38 dimitarvp` joined
22:39 mika__ joined
22:42 <iFire> reem: install openssl
22:42 <iFire> returnthis:
22:42 <iFire> hmm
22:45 myronmarston joined
22:45 refriedchicken joined
22:52 kronicdeth joined
22:54 reshi joined
22:55 Cohedrin joined
22:56 zealsham_ joined
22:57 <zealsham_> how do you recomend going about learning elixir
22:59 proteus-guy joined
22:59 <iFire> zealsham_: I have a very hard time reading manuals without a goal. I would recommend either starting a small bit on a project or using exerism's examples
22:59 <iFire> like either toy problems or an actual usecase
23:00 <zealsham_> do you mind giving a small project to tackle cuz i find it hard defining what is small in elixir land
23:01 <iFire> zealsham_: what's your usecase?
23:01 <iFire> why write whatever you are doing in elixir rather ruby
23:01 cschneid_ joined
23:02 <zealsham_> iFire: was asked to learn elixir in my job
23:02 <zealsham_> ave never dabled with functional languages before
23:03 <iFire> zealsham_: can you talk about work's reason for wanting to use elixir
23:03 <zealsham_> to build concurrent web apps
23:04 <iFire> that's not a reason
23:04 <iFire> web apps that perform over large loads is a reason
23:04 <iFire> web apps that handle latency over blah blah range is a reason
23:04 <iFire> web apps that have high reliability is a reason
23:05 <zealsham_> iFire: like i said am quite new to elixir , but i think the reason you gave above is the same thing my boss says
23:06 <iFire> zealsham_: what's the closest thing to your work problem I would try to make a really small version of it. You don't have to tell me.
23:08 <zealsham_> i get it
23:08 srxa joined
23:12 <gausby> zealsham_: You can start out by getting comfortable with pattern matching and recursion. I made this task for my local user group a while back, perhaps it can help you https://github.com/cphex/enum_workshop
23:18 srxa_ joined
23:28 <iFire> scrogson: do you know what the orginal usecase for jabba is? I'm looking for webinterfaces with elixir on xmpp.
23:31 __charly__ joined
23:35 mika__ joined
23:40 myronmarston joined
23:47 ssswitch joined
23:50 cschneid_ joined
23:52 kronicdeth joined
23:56 cemilowski joined