<     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 25 26 27  
28 29 30 31
00:00 isubasti joined
00:01 kronicdeth joined
00:02 WhiskyRyan joined
00:04 zealsham_ joined
00:04 LastWhisper____ joined
00:05 <zealsham_> how do i convert a tuple to list , i dont wanna use in built function i need to implement my own. currently reading "programming elixir"
00:05 WhiskyRyan joined
00:06 <ciawal> you need to implement your own?
00:07 <zealsham_> ciawal: yes, i need to do that
00:07 <ciawal> why?
00:08 <zealsham_> ciawal: it is an excercise, am reading programming elixir book
00:09 <benwilson512> ahhh
00:09 <ciawal> I guess you'd have to loop 0..tuple_size(tuple)
00:09 <ciawal> and use elem/2
00:09 <zealsham_> the author said , dont use anything we havent covered yet
00:09 <ciawal> to create the list
00:09 <ciawal> or is the tuple in the exercise of a fixed length?
00:11 fantasticsid joined
00:15 brian_penguin joined
00:17 codestorm joined
00:18 wpcarro joined
00:19 fantasticsid joined
00:23 nighty-- joined
00:23 <benwilson512> he's gone
00:25 cschneid_ joined
00:25 kronicdeth joined
00:29 rohitpaulk joined
00:33 wpcarro joined
00:34 <ciawal> seems like an odd exercise
00:34 <* asonge> submits talk proposal
00:34 <benwilson512> me too!
00:35 <ciawal> not sure how long you can really talk about converting a tuple to a list tbh but go ahead :P
00:35 <asonge> hey, sometimes exercises are just about fun
00:36 <asonge> i made a sieve of eratosthenes in elixir using the stream api
00:36 <ciawal> sounds like it was for learning purposes since it said to only use what was covered
00:36 <asonge> it was fun trying to make it perform.
00:37 <asonge> i managed to get it competitive with the clojure version
00:38 brian_penguin joined
00:39 jkreeftmeijer joined
00:41 Reshi joined
00:43 jcspencer joined
00:49 jcspencer joined
00:51 <asonge> anyone know off-hand if there are any major weaknesses in the SSL/TLS erlang distribution?
00:51 sevenseacat joined
00:53 elgenie joined
00:54 rohitpaulk joined
00:59 kronicdeth joined
01:00 rohitpaulk joined
01:07 wpcarro_ joined
01:23 dj_goku joined
01:33 icanhazbroccoli1 joined
01:33 icanhazbroccoli joined
01:36 WhiskyRyan joined
01:39 tomterl joined
01:48 jleon joined
01:51 elgenie joined
01:52 brian_penguin joined
02:03 WhiskyRyan joined
02:05 WhiskyRyan joined
02:06 junsuijin joined
02:07 jcspencer joined
02:09 WhiskyRyan joined
02:14 WhiskyRyan joined
02:15 jcspencer joined
02:19 jcspencer joined
02:19 cschneid_ joined
02:34 redhorse joined
02:35 WhiskyRyan joined
02:36 owickstrom joined
02:40 johnstorey joined
02:40 jkreeftmeijer joined
02:41 jcspencer joined
02:44 WhiskyRyan joined
02:44 cschnei__ joined
02:46 jcspencer joined
02:51 elgenie joined
02:51 cemilowski joined
02:51 jcspencer joined
03:00 jcspencer joined
03:01 potatosalad joined
03:04 jleon joined
03:05 jcspencer joined
03:07 __charly__ joined
03:09 kronicdeth joined
03:11 dj_goku joined
03:11 dj_goku joined
03:12 Reshi joined
03:16 cschneid_ joined
03:16 ssswitch joined
03:21 wpcarro_ joined
03:41 jkreeftmeijer joined
03:53 wpcarro_ joined
03:54 codestorm joined
03:55 milad joined
04:15 refriedchicken joined
04:28 griffinbyatt joined
04:29 jcspencer joined
04:30 yoK0 joined
04:30 <yoK0> are there any dramatic/breaking changes between 1.3 and 1.4 ?
04:31 <yoK0> wanted to buy a book but there are only books covering 1.3
04:32 yoK0 joined
04:37 LastWhisper____ joined
04:39 <isHavvy> yoK0: https://elixir-lang.org/blog/2017/01/05/elixir-v1-4-0-released/ https://github.com/elixir-lang/elixir/releases/tag/v1.4.0
04:39 jcspencer joined
04:39 <Nicd-> nooooo I just had those links copied
04:46 refriedchicken joined
04:49 elgenie joined
04:49 yoK0 joined
04:50 jcspencer joined
04:56 srxa_ joined
04:58 jcspencer joined
04:59 dj_goku joined
04:59 dj_goku joined
05:04 jcspencer joined
05:10 dec0n joined
05:11 meandi_2 joined
05:12 jcspencer joined
05:18 jcspencer joined
05:24 jcspencer joined
05:28 elgenie joined
05:28 jcspencer joined
05:29 griffinbyatt joined
05:33 jcspencer joined
05:43 jkreeftmeijer joined
05:43 jcspencer joined
05:45 Tica2 joined
05:49 jcspencer joined
05:50 jushur joined
05:54 jcspencer joined
05:55 cemilowski joined
05:59 jcspencer joined
06:04 jcspencer joined
06:07 jushur joined
06:09 jcspencer joined
06:14 icanhazbroccoli joined
06:16 codestorm joined
06:19 jcspencer joined
06:25 jushur joined
06:30 jcspencer joined
06:39 jcspencer joined
06:39 icanhazbroccoli joined
06:44 jkreeftmeijer joined
06:45 ur5us joined
06:47 milad joined
06:48 dj_goku joined
06:48 dj_goku joined
06:49 milad joined
06:52 jcspencer joined
06:56 gregman_ joined
06:57 l14n joined
06:59 tuacker joined
07:03 jcspencer joined
07:04 mark_66 joined
07:04 josevalim joined
07:09 jcspencer joined
07:12 m00dy joined
07:14 tuacker1 joined
07:15 jcspencer joined
07:15 l14n_ joined
07:19 jeznet2 joined
07:21 jcspencer joined
07:22 flaviodesousa joined
07:25 m00dy_ joined
07:27 Guest67 joined
07:30 griffinbyatt joined
07:32 akeating joined
07:36 cemilowski joined
07:41 heman_ joined
07:41 <heman_> Hello
07:41 jcspencer joined
07:41 <heman_> i need to know how to use csrf authentication using phoenix and angular
07:42 <heman_> can anyone help?
07:45 <Nicd-> csrf authentication? do you mean protection?
07:45 <heman_> yes csrf protection
07:46 <heman_> i know we need to send _csrf_token as header .
07:46 <heman_> but i can't find an example where angular servers login page and phoenix protects it from csrf attacks
07:47 <heman_> serves*
07:55 wpcarro joined
08:01 cschneid_ joined
08:04 mpsag joined
08:10 Guest95 joined
08:14 apotry joined
08:18 cemilowski joined
08:25 adgtl left
08:25 akeating joined
08:25 adgtl joined
08:31 travis-ci joined
08:31 <travis-ci> elixir-lang/elixir#14800 (master - 1136a75 : José Valim): The build passed.
08:31 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/60c891bb8053...1136a75b4632
08:31 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/237079640
08:31 travis-ci left
08:36 dj_goku joined
08:36 dj_goku joined
08:37 heman_ left
08:45 jkreeftmeijer joined
08:49 ur5us joined
08:51 travis-ci joined
08:51 <travis-ci> elixir-lang/elixir#14801 (master - 70722d2 : José Valim): The build passed.
08:51 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/1136a75b4632...70722d210562
08:51 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/237084135
08:51 travis-ci left
08:55 marr joined
09:06 <bitmod> anyone around?
09:07 <Nicd-> don't ask to ask
09:08 <sevenseacat> nope, no-one.
09:18 m00dy joined
09:20 mpsag joined
09:20 <bitmod> i'm having some issues with routes, i used the html generator but for some reason the routes aren't working
09:21 <bitmod> here's my routes.ex (http://sprunge.us/EiYK)
09:23 m00dy joined
09:25 <bitmod> Nicd-, sevenseacat: i did change my route, moving the "videos" resource to a different scope, could that be the issue?
09:25 <sevenseacat> define 'routes arent working'
09:27 <bitmod> "function VideoController.init/1 is undefined (module VideoController is not available)"
09:28 <sevenseacat> ok, not related to routes
09:28 <ericmj> bitmod: you forget the namespace for the scope
09:28 <sevenseacat> do you have a VideoController ?
09:28 <ericmj> scope “/manage”, Rumbl do
09:28 <sevenseacat> ah hah
09:29 <bitmod> ah there we go, thanks
09:31 griffinbyatt joined
09:31 elgenie joined
09:41 icanhazbroccoli1 joined
09:41 icanhazbroccoli2 joined
09:41 icanhazbroccoli3 joined
09:46 travis-ci joined
09:46 <travis-ci> elixir-lang/elixir#14802 (master - 82b655a : José Valim): The build passed.
09:46 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/70722d210562...82b655a1a01a
09:46 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/237099620
09:46 travis-ci left
09:46 jkreeftmeijer joined
09:52 gvaughn joined
09:53 travis-ci joined
09:53 <travis-ci> elixir-lang/elixir#14803 (master - de70030 : Christian Wesselhoeft): The build passed.
09:53 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/82b655a1a01a...de70030d90e6
09:53 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/237100438
09:53 travis-ci left
09:55 dec0n joined
10:11 isubasti joined
10:12 arquebus joined
10:13 <OliverMT> Klarna might become a bank
10:13 <OliverMT> first erlang driven bank? :D
10:17 <benoitc> ericmj: it default to a pool for now. you do a request without it or specify your own pool
10:18 m00dy joined
10:24 dec0n joined
10:24 dj_goku joined
10:24 m00dy joined
10:29 m00dy joined
10:30 qqwy joined
10:30 <qqwy> Good morning!
10:31 <qqwy> I want to build a library that allows people to reorder siblings in an Ecto-managed database. (Think the order of posts in a thread, of images in an album, of songs in a playlist).
10:31 <qqwy> I want to build this library in a way that is useful/re-usable, but I am not entirely sure how to use Ecto.Multi for this properly
10:32 isubasti joined
10:33 <qqwy> What I think is that when given a new changeset to add, I need:
10:33 <qqwy> 1. The changeset.
10:33 <qqwy> 2. Information ('scope') to find all siblings of the changeset. (i.e. an Ecto.Query finding all existing posts for a given thread?)
10:33 <qqwy> And then I could create an Ecto.Multi that does:
10:33 <qqwy> 1. increment all 'order' columns of all existing columns in this scope.
10:33 <qqwy> 2. Add the changeset with 'order' 0.
10:34 <qqwy> Is this a good approach?
10:36 nighty-- joined
10:40 <josevalim> Can it be done with changesets?
10:40 <josevalim> I am afraid you will need to use update_all and similar to ensure consistency within the table
10:40 <josevalim> it depends on how you model it though
10:42 <qqwy> Yes, I think I'll need to use update_all
10:42 <qqwy> The model I have in mind is to use an integer 'order' column. Moving something to a new order position means incrementing/decrementing the 'order' of the items in-between the two positions.
10:43 <qqwy> Adding something is the easiest at the front, as you can then increment everything that already existed in the given scope by one.
10:44 <qqwy> A 'scope' would be something like `from(p in Post, where: p.thread_id = ^thread_id)' but this is probably something the user of the library will have to provide
10:44 <qqwy> ( without the syntax error: `from(p in Post, where: p.thread_id == ^thread_id)`
10:44 <OliverMT> update_all and use a transaction so its consistent. The order 0 in the first transaction would be incremented when transaction two runs
10:44 <josevalim> qqwy: I would first be double sure if that's the proper model for it
10:45 <josevalim> because all I can think of is race conditions :P
10:45 <OliverMT> postgres transactions solve the race josevalim
10:45 <asonge> OliverMT: no it doesn't
10:45 <OliverMT> yes it would?
10:45 <qqwy> Yes, this would of course happen inside a transaction :-)
10:45 <josevalim> on concurrent inserts, how do you guarantee you are adding it to the last position?
10:45 <asonge> depends on the isolation level...transactions don't lock the table, they lock rows.
10:45 <josevalim> transactions won't automatically solve it
10:45 <josevalim> exactly
10:45 <asonge> if you are in serializable (ie, slowest mode ever), it's solved
10:46 <asonge> but no one turns on serializable mode on postgres. because why?
10:46 <qqwy> I do know that there are Rails gems that function in a similar way. But that does not guarantee anything exactly now, does it? :p
10:46 <OliverMT> so you'd end up with an orphan order?
10:46 <josevalim> ensuring some entry is getting the last position is not actually straight-forward
10:46 <OliverMT> I wouldnt use some sort of integer sort at all for that, why not time stamp?
10:46 <asonge> josevalim: you could lock the parent for updates, that should force an order, no?
10:46 <OliverMT> you'd ensure monotonic increase, and have your order counter be row relative instead
10:47 <* asonge> would have to think more
10:47 <josevalim> https://pragprog.com/book/bksqla/sql-antipatterns
10:47 wpcarro joined
10:47 <josevalim> i am not sure if this book covers trees or ordering
10:47 gvaughn joined
10:47 <josevalim> I have it around but i cannot check it right now
10:48 <josevalim> there is a chapter on trees and maybe you can design it using a parent_id (a list is a degenerate tree with only one branch after all)
10:48 jkreeftmeijer joined
10:48 <josevalim> maybe the best mechanism is to have a separate table that keeps the order for every comment in a post in an array
10:49 <josevalim> because you can atomically push to the array
10:49 <qqwy> I know about the Rails gem `ancestry`, which stores the path to the root of the tree in a string-column, allowing you to query on part of it to get subtrees etc. in one query
10:49 <qqwy> Hmm, that is also an interesting idea
10:49 <josevalim> but then you lock when you re-order
10:49 <josevalim> qqwy: that may be a better way to do it
10:49 <josevalim> ok, the book has a chapter on trees, it is one of the sample chapters: https://media.pragprog.com/titles/bksqla/trees.pdf
10:49 <josevalim> it may help cover some options
10:49 <OliverMT> if you lock on on the thread, wont transaction #2 wait for it all to complete before it runs its increment?
10:50 <josevalim> on a row, yes
10:51 <OliverMT> so it would run on the single row #1 produces
10:51 <asonge> not true
10:51 <OliverMT> or that row wouldnt exist
10:51 <OliverMT> rather
10:51 <OliverMT> so you'd end up with two 0 orders
10:51 awea joined
10:52 <asonge> one way to think about it: transactions run on independent snapshots, if the invariant is violated for one of the updates or inserts the best you can hope for is an error
10:52 travis-ci joined
10:52 <qqwy> How would you order by an array field, by the way?
10:52 <travis-ci> elixir-lang/elixir#14804 (master - b7e852c : José Valim): The build passed.
10:52 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/de70030d90e6...b7e852cf9832
10:52 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/237121604
10:52 travis-ci left
10:52 isubasti joined
10:52 <josevalim> asonge: on pg
10:52 <qqwy> If you have `SELECT * FROM Posts where thread_id = 10 ORDER BY ????`
10:52 <asonge> oh right, on postgresql or any other db based on mvcc
10:52 <qqwy> (followed by e.g. LIMIT 10)
10:53 <josevalim> another option is to just assume that order is not sequential and give all new rows an order of -1
10:53 <josevalim> and then you order by both "order DESC, id ASC"
10:54 <josevalim> and then if you re-order, you need to make the order higher than the entry you are putting on top
10:54 <awea> Hi there, I have to attach some entities to unauthantified users in a phoenix app wich act as an API. To do so I intend to store session in my database, there is a ready to use Plug for that or I have to write my own ? ^^
10:54 <josevalim> i am pretty sure you will have bugs when two people are ordering at the same time
10:54 <josevalim> but then they can just reorder again
10:54 <josevalim> awea: I think hex does that
10:54 <josevalim> you can copy their implementation
10:55 <josevalim> ericmj: do you have a custom session store in hex?
10:55 <qqwy> Yes, I think you are right. The humanly-made order is not something which is life-and-death type of important to get 100% right all the time.
10:56 <ericmj> josevalim: yes, but it’s not ready https://github.com/hexpm/hexpm/commit/dd84abb4ad25b0c9e43caef2cf25039f5878db4c
10:56 <josevalim> awea: ^
10:56 <qqwy> But I'll do some research into the race conditions that might happen
10:56 <ericmj> josevalim: you commented on some flaws which I had fixed on my laptop that was stolen
10:56 <micmus> qqwy: unless it's order of steps in a safety procedure :D
10:56 <ericmj> and now i dont even remember what you commented on -.-
10:56 <josevalim> the problem is this. imagine you have this: [a: -1, b: -1, c: -1]. then you move :c to the top, you will get this: [c: 0, a: -1, b: -1]
10:57 <josevalim> and then if you move b above a, you will have this:
10:57 <josevalim> [c: 0, b: 0, a: -1]
10:57 <josevalim> but due to the IDs, you will end-up with:
10:57 <josevalim> [b: 0, c: 0, a: -1]
10:57 <josevalim> even without concurrent accesses. so it is not that straight-forward and requires some thought
10:57 <josevalim> i would definitely investigate prior art
10:58 <qqwy> It's very hard to search for it because I have not come across some standard kind of name that this set of invariants has.
10:58 <josevalim> ericmj: was it a timing attack?
10:58 <asonge> josevalim: serialize the model through a genserver, problem solved.
10:58 <qqwy> other than 'reorderable'
10:58 inoas joined
10:58 <josevalim> asonge: and deploy max to a single server :P
10:59 <* asonge> handwaves.
10:59 <josevalim> hahahaha
11:00 <josevalim> ericmj: I think I said to not lookup by id because of timing issues and rather have a token that you also check?
11:00 <josevalim> and the advantage of the token is that you can expire previous sessions by erasing the token?
11:02 <asonge> ugh, timing attacks are the worst.
11:02 <ericmj> josevalim: ah yes, that was it
11:02 <josevalim> i don't think though you should use uuid
11:03 akeating joined
11:03 <josevalim> i would have an integer id and a token generated by crypto secure random
11:03 <asonge> is the issue with id that it's a unique index, so it doesn't have to scan the whole index?
11:03 <josevalim> the sid is id++token
11:03 <josevalim> is the index a btree? i think btree has timing attacks
11:03 <josevalim> anyway, the you don't have to worry mechanism is: lookup by id, use secure_compare on a token
11:04 <josevalim> "you don't have to worry mechanism"
11:04 <ericmj> my changes had sid as id <> token. the advantage with id being uuid is that i can match it with binary pattern matching
11:05 <ericmj> if i have integer id i have to parse it out
11:05 <ericmj> can sid be any binary or does it have to be utf8?
11:06 <ericmj> i guess i can pattern match on a large enough integer
11:07 <josevalim> ericmj: nah, :binary.split(sid, "++")
11:07 <josevalim> and use ++ to separate the id from the token
11:07 <josevalim> i wrote a comment there
11:08 <josevalim> the token can be binary in the database. but you will need to encode/decode it then
11:08 <josevalim> it is all in the comment i dropped there
11:10 <ericmj> thanks!
11:13 isubasti joined
11:16 marr joined
11:29 milad joined
11:29 milad joined
11:31 qqwy joined
11:32 griffinbyatt joined
11:34 <awea> josevalim: Unfortunately most storages for sessions use Redis
11:35 <OliverMT> I'm implemnting session storage as we speak
11:35 <OliverMT> simply a genserver caching the DB with some invalidation stuff
11:35 <OliverMT> this is to support JWT sessions though, not just "plain" session
11:36 <OliverMT> what is the timing attack?
11:36 <OliverMT> out of curiosity
11:36 m00dy joined
11:40 bvcosta joined
11:47 rohitpaulk joined
11:47 gazler joined
11:48 rohitpaulk joined
11:50 m00dy joined
11:52 cemilowski joined
11:52 <ericmj> OliverMT: when you guess a secret by measuring who long it takes for your response to come back
11:53 <asonge> it relies on a non-secure compare, like if "abcdefg" == "abcd123" on the hash, it can try to guess how much of the hash it has right. if you use a secure compare (comeonin does), you can fight timing attacks that way
11:54 <asonge> there's also timing attacks on seeing if a user exists in the database
11:54 <asonge> so if you try to log in and you get a really fast error because it didn't attempt to try a password, that's a timing attack you can use to not try to log in as that user
11:55 cdg joined
11:58 karreiro joined
12:00 <OliverMT> I dont understand how that relates to the discussion above
12:00 <OliverMT> cant you wrap the db lookup in some sort of constant time?
12:01 <OliverMT> you're talking about tokens, your timing explanation is about attempting hashes
12:01 <OliverMT> I know about that part, I was curios to what the angle on the session is
12:01 <OliverMT> isnt guessing a session token waaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaay out of probability regardless?
12:02 cschneid_ joined
12:07 milad joined
12:07 milad joined
12:08 <asonge> the timing attack depends on prefix matching
12:08 <asonge> so no
12:09 <asonge> basically, the more bytes you get right at the front, the more confident you are to guess further bytes
12:10 <asonge> you only need 255 guesses on the first byte, after all.
12:10 <bitmod> can someone recommend a good resource for learning ecto? It's not clicking at the moment
12:11 <OliverMT> ah so thats why you separate the PK into the front of the hash?
12:11 <asonge> i think that's just for an easy lookup.
12:11 <OliverMT> I run it the opposite way, I keep the key inside the token
12:11 <OliverMT> and lookup from there
12:11 <asonge> i'm not clear on which exact timing attack is being guarded against
12:11 <OliverMT> isnt a jwt decode constant time?
12:12 <asonge> it's probably close, but i'm not sure. jwt is kinda too-big, so it's entirely possible that the spec says it should be and a ton of implementations are broken.
12:12 <OliverMT> I'm using phoenix'
12:12 dj_goku joined
12:13 <asonge> phoenix's tokens aren't jwt
12:13 <OliverMT> wut, not?
12:14 <asonge> they're term_to_binary and then signed. practically opaque
12:14 <OliverMT> oh
12:15 <OliverMT> well the user id isnt secret anyways
12:15 kronicdeth joined
12:15 <OliverMT> (if you manage to get the token)
12:29 Havvy joined
12:31 dimitarvp joined
12:32 wpcarro joined
12:35 gvaughn joined
12:38 rynswrt joined
12:38 cristianR_ joined
12:42 akeating joined
12:49 jkreeftmeijer joined
12:50 m00dy joined
12:50 srxa joined
12:50 m00dy joined
13:01 <OliverMT> that sql antipattern book is really good
13:01 akeating joined
13:03 ramortegui joined
13:03 the_voice_ joined
13:16 josevalim joined
13:16 rodolfojcj joined
13:33 Cohedrin joined
13:35 qqwy joined
13:36 griffinbyatt joined
13:40 m00dy joined
13:54 <hmans> bitmod: "Programming Phoenix" should do the trick
13:57 <bcardarella> I am trying to use a custom Transport in Phoenix but running into an error right out of the gate
13:58 <bcardarella> I've copied the Phoenix v1.2 `Phoenix.Transports.WebSocket` module exactly into a module for my project: `MyApp.Transports.WebSocket` under `lib/my_app/transports/websocket.ex`
13:58 cdg joined
13:58 <bcardarella> I updated the line in `UserSocket` to: `transport :websocket, MyApp.Transports.WebSocket`
13:59 <bcardarella> but now I get this error: `(Phoenix.Router.NoRouteError) no route found for GET /socket/websocket (MyApp.Router)`
13:59 <bcardarella> when trying to connect with `phoenix.js`
14:00 <bcardarella> but if I switch back to `Phoenix.Transports.WebSocket` everything connects OK
14:01 dj_goku joined
14:01 dj_goku joined
14:01 travis-ci joined
14:01 <travis-ci> elixir-lang/elixir#14805 (master - 3c9b191 : José Valim): The build passed.
14:01 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/b7e852cf9832...3c9b191ec193
14:01 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/237177605
14:01 travis-ci left
14:04 ur5us joined
14:06 m00dy joined
14:08 <bitmod> hmans: reading that now, but it's not clicking too well
14:08 m00dy joined
14:08 <bitmod> to be fair i'm on 4.5 hours of sleep, maybe that's the issue
14:09 marr123 joined
14:11 m00dy_ joined
14:17 <hmans> bitmod: in case you're coming from a Rails/AR background, give it some time.
14:22 rodolfojcj_ joined
14:24 gvaughn joined
14:25 JustAnotherNickn joined
14:32 wpcarro joined
14:32 gvaughn joined
14:41 wpcarro joined
14:43 rodolfojcj_ joined
14:44 wsieroci joined
14:50 wpcarro_ joined
14:50 jkreeftmeijer joined
14:51 willingc joined
14:52 potatosalad joined
14:54 fredsir joined
14:55 willingc left
14:59 fredsir joined
15:01 cschneid_ joined
15:04 jerel joined
15:06 marr joined
15:18 rodolfojcj_ joined
15:23 rodolfojcj_ joined
15:26 Or1on joined
15:29 gvaughn joined
15:30 tuacker joined
15:32 isubasti joined
15:32 elgenie joined
15:33 akeating joined
15:36 griffinbyatt joined
15:43 ssswitch joined
15:47 sourpus5 joined
15:47 jjanzic joined
15:49 dj_goku joined
15:49 dj_goku joined
15:52 jkreeftmeijer joined
15:58 cdg joined
16:01 gvaughn_ joined
16:04 Cohedrin joined
16:05 ur5us joined
16:07 jleon_ joined
16:10 cdg joined
16:20 wsieroci joined
16:23 <jer> ok this was a surprise the user kinda thing: have an array of tuples like: [{:foo, "bar"},{:foo, "baz"}] correspond to a schema/value sorta thing. passing that around gives me a keyword list. definitely not what i had in mind
16:24 <benwilson512> a keyword list IS just a list of 2 tuples
16:24 <benwilson512> where the first item in each tuple is an atom
16:25 <benwilson512> [{:foo, "bar"},{:foo, "baz"}] == [foo: "bar", foo: "baz"] #=> true
16:25 rohitpaulk joined
16:25 <gazler> bcardarella: I have an unfinished (buy working) transport you can look at here https://github.com/VoiceLayer/phoenix_cowboy2/commit/604f6e853716d6227b6945898442998349d6d981
16:25 <gazler> s/buy/but
16:26 <jer> benwilson512, yeah just in my own head i was expecting something else =p
16:26 milad joined
16:26 milad joined
16:27 <benwilson512> fair enough
16:28 <bitmod> benwilson512, with html_response in tests, how does that work exactly? i'm going through programming phoenix, and in the example it says it should work (specifically: assert html_response(conn, 200) =~ "Welcome to Rumbl.io!"), however the content on the page is more than just that text (quite a bit of html, mostly for the header)
16:28 rohitpaulk joined
16:28 <bitmod> i'm guessing the only output on the page should be "Welcome to Rumbl.io!" for the test to pass, but this wasn't stated in the book (unless i missed it)
16:28 jkreeftmeijer joined
16:28 <gazler> bcardarella: You may also have to do something like this though, since you can't override the defaults_for without setting up a custom handler https://github.com/Gazler/phoenix_chat_example/blob/3fcc2e1ad6d0bff66f4cffd1cdf5a55e872b5917/config/dev.exs#L28L40
16:28 <benwilson512> bitmod: https://hexdocs.pm/elixir/Kernel.html#=~/2
16:29 wpcarro joined
16:30 <bitmod> benwilson512: perfect, thanks
16:31 Talltree joined
16:34 Speed joined
16:43 meh` joined
16:44 kronicdeth joined
16:57 LastWhisper____ joined
16:57 MarioBranco joined
17:03 MarioBranco joined
17:05 wpcarro joined
17:06 dante joined
17:06 rodolfojcj_ joined
17:12 roger_padactor joined
17:12 <roger_padactor> are the elixer con videos up yet?
17:12 <roger_padactor> elixir*
17:13 griffinbyatt joined
17:17 wpcarro_ joined
17:19 karmajunkie joined
17:30 lexmag joined
17:31 wsieroci joined
17:32 icanhazbroccoli joined
17:34 elgenie joined
17:37 dj_goku joined
17:37 dj_goku joined
17:40 cdg joined
17:44 kronicdeth joined
17:45 wpcarro_ joined
17:46 wsieroci joined
17:47 redhorse joined
17:48 <redhorse> hi all
17:48 isubasti joined
17:49 <redhorse> i've got a problem with some ecto tests. using phoenix 1.3 rc2, i generated a schema that originally had timestamps. i removed the call to timestamps() from the schema and the migration, but when I run the test suite, i get a bunch of not_null_violation for inserted_at.
17:50 <redhorse> but AFAICT, the check for that column is somewhere in Ecto - there's no mention of inserted_at in my actual tests.
17:50 <redhorse> so i'm not sure how to fix this. i *could* just put timestamps() back onto my schema, but i'd prefer not to
17:51 <redhorse> is there an option in the test suite that i could disable for only this one schema? my other schemas use timestamps
17:54 jimmyrcom joined
17:54 Scramblejams joined
17:55 <micmus> redhorse: you probably need to reset your test database, if you edit a migration, it's not automatically reflected on the database
17:56 <redhorse> micmus: thanks - that did the trick.
18:04 wpcarro_ joined
18:05 ur5us joined
18:06 Ioyrie joined
18:06 milad joined
18:07 LastWhisper____ joined
18:13 <benwilson512> roger_padactor: some, not all
18:13 <roger_padactor> benwilson512, where abouts?
18:13 <benwilson512> elixirconf.eu, scroll down to the photos of speakers
18:14 <benwilson512> click the video icon on the photoso w/ videon icons
18:14 <roger_padactor> thx
18:14 greenail joined
18:14 Ioyrie joined
18:14 <greenail> hello all
18:15 <greenail> a few questions if someone has a second: what happens if you put a config into a MIx.Config when the key is not an application
18:15 <greenail> this seems to generate compiler warnings
18:15 <greenail> wondering why this is bad
18:16 <benwilson512> mix config ultimately places the values under the Application config
18:16 <benwilson512> application config is about configuring applications
18:16 <greenail> it makes for convenient access to the values via Application.get_env
18:16 <greenail> hello benwilson512
18:16 <greenail> btw thanks again for ex_aws
18:16 <benwilson512> placing the values under the application that uses the value is an important part of making sure that values are not overridden, and are loaded all appropriately prior to the application running
18:17 <greenail> benwilson512: agreed, but what is the downside for using them to store something for a "non-application"
18:17 <greenail> for instance i have a lib that I would like to configure via Mix.Config
18:17 <greenail> but it is not an application
18:17 <benwilson512> every library is an application
18:18 <greenail> ahh, ok
18:18 <greenail> i thought "applicaiton" was in the OTP sense
18:18 <benwilson512> it is
18:18 <benwilson512> you don't need processes to be an application
18:18 <benwilson512> application refers to a bundle of code that may or may not have a process tree associated with it
18:19 <benwilson512> that code / config / procesess should all be loaded / started together
18:19 <greenail> ok, so my next question: if my stuff from config/#{env}.exs makes it to my sys.config in distillery, why wouldnt' I be able to access it via Applicaiton.get_env/2?
18:19 <benwilson512> well, I don't offhand know whether that will work or not
18:20 <benwilson512> my point is that everyone benefits when everyone follows that convention. if everyone stopped following that convention you'd end up with config conflicts easily
18:20 <greenail> hmmm
18:20 <benwilson512> because a half dozen libraries would all be trying to write to a top level `:secrets` key or something
18:21 <greenail> ya, that makes sense
18:22 <greenail> but what is this error `You have configured application :dyn in your configuration
18:22 <greenail> file, but the application is not available.`
18:22 <greenail> my lib is called dyn
18:22 <greenail> it is a transitive dep
18:22 <benwilson512> it's called `:dyn` in the mix.exs file?
18:22 <greenail> er, well, it is a module in a dep
18:22 <greenail> in a different namespace
18:22 <benwilson512> not sure I understand
18:23 <benwilson512> the only things that belong at top level are things after the `app: ` key in a mix.exs def project callback
18:23 <greenail> ok, i think i get it
18:24 redhorse joined
18:30 cdg joined
18:31 griffinbyatt joined
18:32 cemilowski joined
18:33 <greenail> ok, so it looks like you can add adhoc values in config but distillery somehow filters them out
18:34 <benwilson512> distillery builds config for applications
18:34 <greenail> i'm using the single namespace from deps() and it is now working ok in my release
18:34 <benwilson512> if you're putting config on stuff that isn't an application then there's no where to put it
18:34 <benwilson512> so it gets discarded
18:34 <greenail> benwilson512: ya, odd thing was that it was setup right in the generated output
18:34 <benwilson512> right I mean either way, just stick with the conventions
18:34 elgenie joined
18:35 <greenail> i am "doing it right" now and it works so i don't feel the need to figure out why it didn't work before ;)
18:36 wpcarro_ joined
18:40 ejpcmac joined
18:40 jkreeftmeijer joined
18:42 akeating joined
18:47 DeadTrickster joined
18:58 gvaughn joined
18:59 sumi joined
18:59 <sumi> hello
19:00 <sumi> what would you recommend if i were to implement an ecommerce with an elixir back-end (api driven?) and a one-page (reactjs) front-end?
19:01 andre1 joined
19:01 <jer> sumi, the "if i were" is confusing in your question
19:02 <jer> are you asking a question about using elixir in that role or using reactjs in the other role?
19:02 andre1 joined
19:02 <sumi> well I want to create a webapp with a shop. the phrasing was maybe off.
19:03 wpcarro_ joined
19:03 rkazak joined
19:03 <sumi> i read about nectarcommerce ; but i have no idea about where the community is going with regards to an e-commerce solution.
19:03 <sumi> so i wanted to sense it.
19:03 <jer> ah; so in that case, elixir's as good choice. gets a lot of web attention, meaning the tools are maturing nicely, there's decent library support for things related to ecommerce sites
19:04 <sumi> my approach would be to have an elixir back-end with phoenix as delivery with a rest api, a ReactJS front-end.
19:04 <jer> sounds perfectly sane
19:04 <sumi> so i was wondering if a library was preferred by the community.
19:05 kronicdeth joined
19:05 <OliverMT> there is an ecommerce project
19:05 <OliverMT> but its.... not very mature
19:05 <OliverMT> to put it bluntly :D
19:05 <jer> for that one, i'm not the best person to ask i'm afraid so i'll defer to others
19:05 <sumi> :D
19:05 <sumi> jer thanks
19:06 <andre1> Hello! When working with boundaries like suggested by Phoenix 1.3 what is a goodway to map models in GraphQL? Having a "model" with n relations, trying to namespace or limiting the implementation to the public api of each context?
19:06 <andre1> #newbiequestion
19:06 <OliverMT> #benwilson512 question
19:06 <OliverMT> :D
19:06 <OliverMT> hmm, that should maybe be #benwilson521 answer
19:09 Tallys__ joined
19:10 Cohedrin joined
19:11 josevalim joined
19:12 kronicdeth joined
19:12 wpcarro joined
19:13 icanhazbroccoli joined
19:17 Cohedrin joined
19:20 milad joined
19:20 milad joined
19:22 <benwilson512> andre1: i'll answer out here for anyone else who is curious
19:22 <benwilson512> andre1: you may want to start by reading https://elixirforum.com/t/phoenix-1-3-and-absinthe/5454
19:25 dj_goku joined
19:25 dj_goku joined
19:26 milad joined
19:26 milad joined
19:28 squallstter joined
19:31 <andre1> benwilson512 thanks! In this "option 2" that you suggested can the same type have resolvers from 2 different contexts?
19:32 <benwilson512> not quite sure what you mean
19:32 <benwilson512> the idea there is that your boundary module itself has resolver functions in it
19:32 griffinbyatt joined
19:33 <andre1> Yeah but can a same GraphQL have fields from 2 different bondaries?
19:33 <benwilson512> sure
19:33 <benwilson512> if you thinka bout it
19:33 <benwilson512> at the top level that's basically mandatory
19:34 <benwilson512> your root query object is absolutely gonna have some fields that use one context and some fields that use another
19:34 <cryptomata> when I try to use ... |> Ecto.Multi.delete_all(:text, Repo.all(from text in Text, where: text.code == ^code)) ... I get a protocol Ecto.Queryable not implemented for [%Project.text{....}] ... Am I doing this wrong or do anyone have an ideas on what I need to do to get it to work?
19:35 <andre1> same GraphQL TYPE* have fields from 2 different bondaries
19:35 <andre1> thanks! seems pretty solid that way
19:35 sourpus5 joined
19:35 elgenie joined
19:37 <cryptomata> I get the same result/error when using Repo.delete_all ...
19:38 <benwilson512> cryptomata: delete_all expects a queryable
19:38 <benwilson512> you're passing it actual results
19:38 <benwilson512> because you're calling Repo.all on the queryable first
19:40 <cryptomata> benwilson512: ahh, I see
19:41 <cryptomata> think I tried Repo.all, because 'select' clause is not supported in 'delete_all'
19:41 <benwilson512> you don't have a select clause
19:41 <benwilson512> i'm not sure what you'd be selecting with a delete anyway
19:41 <cryptomata> actually I did, I had some joins etc... I'll try to produce anther query
19:42 <benwilson512> well I just mean in the example you posted
19:43 <cryptomata> ok, I used select to select the correct table
19:44 <cryptomata> how can I delete_all when need joins in the query to select the correct rows?
19:45 <benwilson512> delete_all only applies to the root table
19:45 <benwilson512> the actual SQL is DELETE FROM table_name where / joins / etc
19:45 <benwilson512> you don't use select to make deletes work
19:46 <cryptomata> ahh, cool. many thanks
19:49 iamvery joined
19:53 PaReeOhNos joined
19:56 <cryptomata> benwilson512: worked like magic
19:59 MarioBranco joined
20:04 isubasti joined
20:04 ur5us joined
20:06 rohitpaulk joined
20:07 MarioBranco joined
20:14 dj_goku joined
20:18 icanhazbroccoli joined
20:23 wpcarro_ joined
20:28 andre1 joined
20:30 andre1 joined
20:30 wpcarro_ joined
20:31 sumi joined
20:32 dustinfarris joined
20:32 andre1 joined
20:33 griffinbyatt joined
20:36 elgenie joined
20:41 elgenie joined
20:46 matteo__ joined
20:46 ejpcmac left
20:48 nhooyr joined
20:52 wpcarro_ joined
20:58 akeating joined
21:00 Cohedrin joined
21:01 jkreeftmeijer joined
21:11 wpcarro_ joined
21:11 <redhorse> What's considered the idiomatic way to start a loop in a GenServer? For example, I've got a process that once it's started, I want it to enter into a loop where it pauses for X seconds then runs a calculation. Where should I call the loop function? In the GenServer itself? Or maybe its supervisor?
21:11 bvcosta joined
21:14 Ioyrie joined
21:15 <benwilson512> redhorse: use Process.send_after, don't loop
21:15 <asonge> redhorse: well, "looping" here would be the wrong thing to do, as in a loop you'd "block" anything from happening. you want to have a timer send you messages
21:15 <benwilson512> genservers are already a loop
21:17 <redhorse> benwilson512: would I call Process.send_after in my GenServer's start_link or init funcs?
21:17 <benwilson512> init
21:18 griffinbyatt joined
21:18 andre1 joined
21:21 LastWhisper____ joined
21:22 <redhorse> does this require my GenServer to have a receive block in it?
21:22 <OliverMT> doesnt migrations start the full ap?
21:22 <OliverMT> I have a migration that uses a service, and it complains my task supervisor is not started
21:27 <redhorse> ah, looks like i need to use handle_info()
21:28 <redhorse> thanks for the help benwilson512 and asonge
21:35 ur5us joined
21:37 gvaughn joined
21:39 inoas joined
21:43 Tidur joined
21:44 rodolfojcj_ joined
21:44 <jer> redhorse, any non-call and non-cast message a genserver receives is handled through handle_info
21:44 <jer> i.e., a send() or send_after()
21:44 <redhorse> yep, makes much more sense than my recursive func call I was using before :)
21:44 <jer> :)
21:48 Ioyrie joined
21:55 jerel joined
21:56 jerel joined
21:58 kronicdeth joined
22:02 jkreeftmeijer joined
22:02 jerel joined
22:04 wpcarro_ joined
22:09 marr123 joined
22:15 akeating joined
22:19 inoas left
22:20 wpcarro_ joined
22:22 edmz joined
22:26 kronicdeth joined
22:27 johnstorey joined
22:33 kylethebaker joined
22:35 keltronix joined
22:40 travis-ci joined
22:40 <travis-ci> elixir-lang/elixir#14806 (jv-multiple-sources - 5214441 : José Valim): The build passed.
22:40 <travis-ci> Change view : https://github.com/elixir-lang/elixir/commit/52144418b52b
22:40 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/237324468
22:40 travis-ci left
22:42 kronicdeth joined
22:44 MarcusF joined
22:57 kronicdeth joined
22:57 wpcarro_ joined
23:06 MarioBranco joined
23:08 wpcarro_ joined
23:11 kronicdeth joined
23:21 srxa_ joined
23:21 elgenie joined
23:24 wpcarro_ joined
23:32 wpcarro_ joined
23:35 isubasti joined
23:36 johnstorey joined
23:41 wpcarro_ joined
23:43 __charly__ joined
23:45 potatosalad joined
23:45 jcspencer joined
23:50 jcspencer joined
23:53 milad joined
23:59 jorendorff left