<     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 __charly__ joined
00:00 elgenie joined
00:16 liuzhoou joined
00:23 nighty-- joined
00:27 kronicdeth joined
00:39 patientplatypus joined
00:39 <patientplatypus> hi
00:39 <havenwood> patientplatypus: hi
00:39 <patientplatypus> im trying to get a phoenix websocket connection off the ground and im running into some difficulties and hoped that someone could help
00:39 <patientplatypus> hi havenwood
00:40 <patientplatypus> whats happening
00:40 <patientplatypus> my error code is Error during WebSocket handshake: Unexpected response code: 403
00:40 <havenwood> patientplatypus: that's Forbidden
00:41 <patientplatypus> whats Forbidden?
00:41 <patientplatypus> error 403?
00:41 <havenwood> patientplatypus: the 403 status code means Forbidden
00:42 <patientplatypus> oh ok
00:42 <patientplatypus> well
00:42 srxa joined
00:42 <patientplatypus> i was trying to pass the following
00:42 <patientplatypus> var token = Date.now();
00:42 <patientplatypus> let socket = new Socket("/socket", {params: {token: token}})
00:42 <patientplatypus> and that's what im pretty sure is throwing the error
00:43 <havenwood> are you limiting the transport to certain origins?
00:43 <patientplatypus> i basically want to open a socket for any user to the app without a token, but i dont really know how to get around the necessity of one so i just threw that in there
00:43 <patientplatypus> im not sure how i would know where i would be limiting the trasport
00:44 <patientplatypus> *or where in what file
00:44 <havenwood> patientplatypus: for example: web/channels/user_socket.ex
00:45 <patientplatypus> oh right of course; so my user_socket file is pretty standard https://hastebin.com/owafefonad.rb
00:46 <patientplatypus> def connect(_params, socket) do
00:46 <patientplatypus> {:ok, socket}
00:46 <patientplatypus> end
00:46 <patientplatypus> ^ should seemingly ok all socket connection. I thought anyway
00:51 ssswitch joined
00:52 refriedchicken66 joined
00:55 jkreeftmeijer joined
00:58 __charly__ joined
00:58 PaReeOhNos joined
00:59 srxa_ joined
01:17 kronicdeth joined
01:21 der_graf_ joined
01:21 sevenseacat joined
01:22 beatpanic1 joined
01:23 cmn joined
01:32 dustinfarris joined
01:34 cschneid_ joined
01:39 tomterl joined
01:45 elgenie joined
01:48 chrismccord joined
01:56 elgenie joined
01:56 jkreeftmeijer joined
02:02 rkazak joined
02:12 proteusguy joined
02:12 al-maisan joined
02:16 PaReeOhNos joined
02:19 srxa joined
02:27 MotherFlojo joined
02:33 wong2 joined
02:36 <bitmod> anyone here?
02:39 <asonge> maybe.
02:41 ssswitch joined
02:44 <bitmod> asonge: all good, figured it out ;)
02:46 hahuang65 joined
02:53 griffinbyatt joined
03:16 icecreamcohen joined
03:17 __charly__ joined
03:18 PaReeOhNos joined
03:23 elgenie joined
03:24 cschneid_ joined
03:24 cschneid_ joined
03:30 Tica2 joined
03:39 notdaniel joined
03:40 Ioyrie joined
03:46 justelex joined
03:50 isubasti joined
03:51 codestorm joined
04:13 PaReeOhNos joined
04:18 liuzhoou joined
04:18 icecreamcohen joined
04:33 gvaughn joined
04:34 icecreamcohen joined
04:42 micmus joined
04:42 srxa joined
04:47 JoelMcCracken joined
04:52 cschneid_ joined
04:58 jkreeftmeijer joined
05:00 griffinbyatt joined
05:06 MotherFlojo joined
05:08 dec0n joined
05:09 manukall joined
05:12 srxa joined
05:17 PaReeOhNos joined
05:20 PSvils joined
05:23 dec0n joined
05:23 gvaughn joined
05:23 meandi_2 joined
05:24 PSvils joined
05:25 elgenie joined
05:30 nickjj_ joined
05:30 MotherFlojo joined
05:34 icecreamcohen joined
05:42 josevalim joined
05:43 gvaughn joined
05:45 liuzhoou joined
05:52 liuzhoou joined
05:52 l14n joined
05:53 chrismccord joined
05:55 icecreamcohen joined
05:59 jkreeftmeijer joined
06:03 griffinbyatt joined
06:17 <ivan> this is going to be a pretty dumb question. how do I `receive` in the context of another process?
06:17 refriedchicken66 joined
06:18 PaReeOhNos joined
06:18 <asonge> ivan: you mean how the receive statement works?
06:18 <ivan> I guess I need to send the process and a message and then wait for a reply?
06:18 jkreeftmeijer joined
06:18 <ivan> I mean, calling Module.method that has a `receive` is going to try to receive in the current process, not whatever process is running Module
06:19 <ivan> I guess I should look at how genserver works and stuff
06:19 <asonge> right, this isn't OOP
06:19 <asonge> when you call a function, you don't magically jump processes
06:19 <asonge> there's a send function to send a message
06:19 <ivan> ok
06:20 <asonge> that should be covered here: http://elixir-lang.org/getting-started/processes.html
06:24 <ivan> the thing I actually want is promises so I'm looking at whether https://github.com/codegram/pinky is useful
06:24 <ivan> I have a bunch of messages coming in over a websocket and sometimes need to wait for a particular message
06:31 <asonge> you don't *really* want promises
06:31 <asonge> they're not very elixir idiomatic, and there are much better control flow and error resolution concepts
06:31 <asonge> if you want to do things asynchronously, you can use the Task module
06:32 <ivan> I don't have a blocking function to put inside the Task, though
06:33 <asonge> but you want something to happen after the completion of a bunch of tasks, right?
06:33 <ivan> my task is to turn some asynchronous callback stuff back into synchronous waiting
06:33 <asonge> so, Elixir stuff is usually synchronous, and you spawn a process if you want asynchronicity.
06:34 <asonge> (under the hood, it's still asynchronous, but you have synchronous sematnics, which makes things look a lot nicer than asynchronous code does)
06:34 <asonge> synchronous semantics*
06:34 <asonge> what particular thing are you doing?
06:35 <ivan> inside a handle_frame callback called by websockex I want to fulfill a promise :-) that something else is waiting on
06:35 <asonge> you're speaking in an abstraction you want to use, not the thing you really want to do
06:36 liuzhoou joined
06:36 <ivan> <ivan> I have a bunch of messages coming in over a websocket and sometimes need to wait for a particular message
06:36 <asonge> so, wait how?
06:36 <asonge> you have a bunch of messages coming in, and you need to collect them until a message arrives?
06:36 <ivan> sure
06:37 liuzhoou joined
06:37 returntrip joined
06:38 <asonge> so, you launch a genserver (if you follow the tutorials or a book), and then call a function that "casts" the messages in. the genserver holds on to the state. when a certain message comes in to take action on, you do that at that time.
06:38 <asonge> there are things like state machines for more complicated kinds of things, like if you were implementing some kind of protocol that had to switch modes or something
06:38 <ivan> alright I'll give that a shot
06:38 <ivan> thanks
06:39 <asonge> ivan: just realize that you're in a world with different primitives...you can implement promises and such, but if you do it wrongly or badly, performance can be hurt or even worse, you might introduce a deadlock or something.
06:40 gvaughn joined
06:40 <asonge> if you use the patterns that the rest of the ecosystem uses, you won't really have to worry about that. if you start with some kind of lock and promise system to coordinate stuff, screwing up is going to be confusing and hard to debug.
06:42 proteusguy joined
06:42 <asonge> yeah, this promises library could pause forever on error.
06:46 samba6 joined
06:47 tuacker joined
06:48 <ivan> 'you should never call your own “receive” inside the GenServer callbacks as doing so will cause the GenServer to misbehave'
06:49 <ivan> this includes calling some other module's genserver method that does a receive, right?
06:50 <ivan> I am kind of sad genserver chops everything up into little callbacks instead of letting me write a big async/await-style event loop
06:50 <Nicd-> depends on if you are calling it with GenServer.call/cast or directly?
06:50 <ivan> ok
06:50 <Nicd-> you don't have to use GenServer, you can write your own process with receive loop. then you'll learn why people use abstractions :)
06:51 <asonge> if you're writing a bit async/await style event loop, you're using the wrong language.
06:51 <asonge> you can totally do that
06:51 <asonge> but why make your code more confusing in general?
06:52 samba6 left
06:53 kanmii joined
06:53 <asonge> but if you find yourself implementing a scheduler when the one in the VM works fine, you're probably trying to solve problems the VM solves in other ways.
06:58 srxa joined
07:01 Guest67 joined
07:03 <micmus> ivan: that is not true. pretty much everything has a receive inside
07:03 <micmus> GenServer.call has a receive
07:03 <micmus> IO.puts has a receive
07:03 <ivan> thanks
07:03 <micmus> Logger calls have a receive
07:04 <ivan> I think I made my thing work by just forwading messages from the websockex genserver to my own process
07:04 <micmus> What you need to be aware, though is that the GenServer can do only one thing at a time
07:04 griffinbyatt joined
07:04 <ivan> ok
07:07 <micmus> A common patter for high load gen servers is for each call to start a process to handle the request and reply from there using GenServer.reply
07:14 gmcabrita joined
07:14 cemilowski joined
07:21 PaReeOhNos joined
07:26 notdaniel joined
07:26 <OliverMT> micmus: with a task supervisor or simply a linked process?
07:27 craigp joined
07:29 <asonge> just a linked process if it's important enough to want to mirror crashing code in the new process vs in the genserver
07:30 mattyw joined
07:31 ur5us joined
07:34 codestorm joined
07:35 squallstter joined
07:36 <micmus> OliverMT: yeah, a simple linked process allows you to retain guarantee that if the code fails, the gen server will fail as well, so it's good in that way. Especially if you're only extracting code to apply this pattern to an otherwise functional gen server
07:36 gvaughn joined
07:45 <asonge> who was it that gave the talk on handling gen_servers with high load recently?
07:48 elgenie joined
07:51 stephen_m joined
08:01 akeating joined
08:05 griffinbyatt joined
08:07 PaReeOhNos joined
08:11 marr joined
08:12 srxa_ joined
08:13 srxa joined
08:22 srxa_ joined
08:28 voxxit joined
08:28 codestorm joined
08:30 fxn joined
08:32 <Nicd-> my service has its first spammer :(
08:32 <Nicd-> hammering the API with fake data for themselves
08:32 gvaughn joined
08:38 craigp joined
08:46 inoas joined
08:50 kstsai joined
08:50 kstsai left
09:05 s_kilk joined
09:05 griffinbyatt joined
09:07 srxa joined
09:09 PSvils joined
09:17 ejpcmac joined
09:17 srxa joined
09:24 codestorm joined
09:26 craigp joined
09:27 mattyw joined
09:28 dignifiedquire joined
09:28 gvaughn joined
09:31 bitmod joined
09:31 cemilowski joined
09:33 nd__ joined
09:39 <asonge> you gonna play with them any?
09:39 <asonge> or just do a rate-limit thing?
09:40 <Nicd-> sent them an email, deleted the fake data, regenerated their API key
09:41 <Nicd-> trying to avoid rate limits in my case since they can impact real users. hopefully in the future after some changes they can mess up their own account with the API if they want and I don't have to care about it
09:41 <Nicd-> (unless it leads to performance issues)
09:46 gregman_ joined
09:49 bitmod joined
09:51 <manukall> Nicd-: what's your service?
09:51 <Nicd-> manukall: https://codestats.net/
09:52 <manukall> that's a nice idea
09:53 <Nicd-> the problem with fake API calls is that it messes up the front page numbers
09:54 <Nicd-> in the future I will have a different front page and then they can mess up their own page if they want to
09:55 <asonge> Nicd-: something like a shadowban?
09:57 <manukall> how do you know the data is fake?
09:57 <manukall> just unrealistic?
09:59 <Nicd-> manukall: I don't, really. but in this case the user had accumulated 7 times the XP of our most prolific user but in one day. typing 15 million characters in one day is hardly realistic in my opinion :)
10:00 <Nicd-> asonge: just going to remove those kind of numbers from the front page and have different graphs
10:00 <manukall> hmm. would you be able to detect those unrealistic values and drop/ignore them automatically?
10:01 <Nicd-> possibly, but I want to avoid that as it's effort I can put somewhere else. my development speed has been too slow anyways
10:08 griffinbyatt joined
10:09 m00dy joined
10:09 <m00dy> Hi
10:10 <Nicd-> hello m00dy, hope you are doing well
10:10 <m00dy> hey Nicd- how's going ?
10:13 vifino joined
10:14 <Nicd-> very well, thanks! because it's friday :)
10:15 nighty-- joined
10:21 m00dy joined
10:25 gvaughn joined
10:25 m00dy joined
10:27 srxa joined
10:28 griffinbyatt joined
10:29 <m00dy> Nicd-: like friday bar ?
10:29 <m00dy> ;)
10:30 <Nicd-> heh, not today. but looking forward to the weekend and next week
10:30 <m00dy> Niceeee
10:31 m00dy joined
10:32 <Nicd-> m00dy: you seem to be having connection problems?
10:35 m00dy joined
10:37 bitmod joined
10:40 Lyubo1 joined
10:42 m00dy joined
10:43 jushur joined
10:45 hbraun joined
10:51 cemilowski joined
10:55 dch_ joined
10:57 bitmod joined
11:07 mattyw joined
11:08 smdev joined
11:09 <ciawal> anyone tried this out? https://pryin.io/
11:10 <ciawal> "PryIn is the first application performance monitoring service built completely in and for Elixir and Phoenix"
11:11 <gazler> The author appears to be manukall who is here.
11:12 <manukall> hello :-)
11:12 <manukall> i've tried it. it's quite good ;-)
11:12 <gazler> Haha, I thought you might give it a positive review.
11:12 <asonge> lol
11:13 <ciawal> I was going to try it, signed up, added a project
11:13 <ciawal> then it asked me to put in card info before I could see anything else and I closed the tab
11:14 freerobby joined
11:15 <manukall> i figured that might happen quite a lot. but to be honest i'm building that by myself without any funding, so it's hard to support a lot of free users. there's a trial period, though. so you wouldn't be charged if you didn't like it and cancelled.
11:15 <sevenseacat> looks shiny
11:15 <sevenseacat> be awesome if there was like a demo to see
11:15 <ciawal> manukall: I don't mind paying if I like it, and a free trial is fine
11:15 <ciawal> but it’s a barrier to entry to using the trial and looking around the app
11:16 <ciawal> yeah that would be an ok alternative
11:16 <manukall> demo as in screencast?
11:17 <ciawal> as in an example app with data that you can browse
11:17 <ciawal> to see what's actually on offer
11:17 <sevenseacat> demo as in like a demo project you could click around in and see what kind of stuff gets reported
11:17 <manukall> sevenseacat: thanks. i find it so incredibly hard to make things look ok :-)
11:17 <manukall> that's a pretty good idea
11:18 <manukall> i need to figure out how much work that would involve, though. i would need to lock down a few things. the page with the payment details is what comes to mind first :-)
11:18 <ciawal> that would be a great to have, but I'd really consider moving the card input to later as well
11:18 <ciawal> it’s more important to get people to try it and then hope they want to pay after I think
11:19 <sevenseacat> yeah fair enough. definitely going to keep my eye on it
11:20 <manukall> i'm using the production environment to monitor the staging env and the other way round, too. maybe i could make that public
11:21 gvaughn joined
11:22 <craigp> hmm, anyone know how to use mock to only mock one function, but passthough the others, or even if that's possible?
11:24 srxa joined
11:27 mattyw joined
11:30 akeating joined
11:31 cevado joined
11:33 akeating joined
11:33 m00dy joined
11:35 <manukall> craigp: there's a "passthrough" options. does it not do what you need?
11:36 cristianR_ joined
11:36 akeating joined
11:36 <craigp> manukall: the minute i specify :passthrough it ignores any mocks and passes everything through
11:36 cristianR_1 joined
11:36 <craigp> and all the docs show passthrough with an empty list of mocks
11:37 <craigp> which is why I'm not sure if you can selectively mock functions
11:37 bitmod joined
11:37 akeating joined
11:44 <m00dy> I believe Europe is sunny today :)
11:44 bitmod joined
11:48 <manukall> m00dy: berlin certainly is
11:49 <m00dy> so as Copenhagen
11:54 <nox> Won't last.
12:00 <josevalim> nox: half-empty glass? :P
12:00 <nox> josevalim: No,
12:00 <nox> josevalim: AFAIK it came from the West,
12:00 <nox> josevalim: and it had been sunny half the week here in Paris,
12:00 <Nicd-> it won't last, because next winter it will be cold and dark again.
12:01 <nox> josevalim: and both Berlin and Copenhagen are in the East of France,
12:01 <craigp> in the end I just moved the function in question into another module and mocked it there
12:01 <craigp> I needed it from multiple places anyway
12:01 <nox> so it will probably stop being sunny in a couple of days.
12:01 <nox> But Summer is coming, so shrug.
12:01 <josevalim> but it is May :P i can't do this anymore. like 2 weeks ago we still had snow :'(
12:01 <craigp> josevalim: that data purge with :replace_all happened in our staging environment as well, so I wasn't imagining things on my local machine
12:02 <nox> josevalim: 26°C here 2 days ago.
12:02 <craigp> I've moved away from using insert_all for the sake of safety, but I cannot reliably replicate it
12:02 <josevalim> anyone on windows can please check if the installer is working as expected? https://github.com/elixir-lang/elixir/issues/6122#issuecomment-302679489
12:05 <OliverMT> I am doing this in my plug: https://gist.github.com/olivermt/e4419b3f7d0a48fedcd366c4cdb9de18
12:06 <asonge> OliverMT: pipe to halt.
12:06 <sevenseacat> you're not storing the updated conn
12:06 <OliverMT> err, that was a copy paste error
12:06 <OliverMT> I am piping to the halt
12:06 <Nicd-> json is crashing? json() is from Phoenix I think
12:06 <OliverMT> or rather that was me just trying various things
12:06 <asonge> well, just fyi, you're passing it too
12:06 <OliverMT> the problem was in my plug itself
12:07 <OliverMT> I was thinking it was invoked agian later, but I was invoking it myself
12:07 <nicholasruunu> You were invoking the plug OliverMT?
12:07 <OliverMT> this part is a token consume stage
12:07 <OliverMT> which I was piping to a check roles
12:07 <OliverMT> I was going like "huh why is my action being invoked when I am hating"
12:08 <OliverMT> but I was doing it inside the plug itself
12:10 <Nicd-> but Elixir cannot know when you are hating. the human emotion interpreter has not been implemented yet
12:10 <OliverMT> I hate so hard
12:11 <OliverMT> I have a macro if code == String.uppercase(code) do hate(conn) end
12:12 bitmod joined
12:13 <Nicd-> conn |> halt(:hammerzeit)
12:14 papachan` joined
12:14 <OliverMT> soon we can do 🔨 in the code
12:14 <OliverMT> when josevalim is done with his utf8 shenanigans
12:14 kronicdeth joined
12:15 <nox> It's not done yet?
12:16 jkreeftmeijer joined
12:17 dustinfarris joined
12:17 gvaughn joined
12:22 srxa joined
12:24 <OliverMT> it is? even better
12:24 <OliverMT> I thought there was work to do to merge it with otp20
12:24 <OliverMT> or wherever the erlang utf8 stuf is happening
12:24 <asonge> utf8 atoms in beam files
12:24 <asonge> i think that's merged in
12:26 chrismccord joined
12:27 jkreeftmeijer joined
12:29 <micmus> Yeah, it's there in OTP 20
12:29 <micmus> https://www.dropbox.com/s/ni2ni5res20kasf/Screenshot%202017-05-19%2014.29.49.png?dl=0
12:30 <sevenseacat> nice
12:31 srxa_ joined
12:31 <micmus> And it can be used in function names (not modules or applications)
12:31 <micmus> https://www.dropbox.com/s/o6fs9e5uuo7i5cp/Screenshot%202017-05-19%2014.31.15.png?dl=0
12:33 <OliverMT> how do I use cast_assoc(:bar) from Foo if Foo has bar_id?
12:33 <OliverMT> I am getting bar_id not set
12:33 <OliverMT> is that maybe an embed?
12:33 <OliverMT> I guess cast_assoc(:bar) is for when Bar has a foo_id?
12:33 cemilowski joined
12:34 <OliverMT> at least it seems so from the samples of street addresses
12:34 dimitarvp joined
12:41 m00dy joined
12:44 ramortegui joined
12:47 jerel joined
12:48 m00dy joined
12:52 <m1dnight1> Helper functions for ecto, e.g., "insert a person", do you guys put those somewhere special? Or just ni the model module?
12:52 <m1dnight1> Seems like the appropriate place to put htem
12:58 <manukall> m1dnight1: i think with phoenix 1.3 you would put that into the context module. the model/schema is probably not the right place.
13:05 srxa joined
13:05 srxa joined
13:06 ktje joined
13:11 kronicdeth joined
13:13 gvaughn joined
13:15 srxa joined
13:16 jkreeftm_ joined
13:16 m00dy joined
13:17 josevalim_ joined
13:19 dustinfarris joined
13:22 m00dy joined
13:25 s_kilk joined
13:26 <m1dnight1> I'm not using Phoenix, just ecto. Also unaware what the context module is?
13:30 JEG2 joined
13:36 craigp joined
13:41 laut joined
13:46 <Nicd-> it's a Phoenix thing
13:52 maxbeizer joined
13:53 ssswitch joined
13:55 griffinbyatt joined
13:55 m00dy joined
13:56 patientplatypus joined
13:57 PaReeOhNos joined
13:58 tuacker joined
13:58 willyk joined
14:00 tuacker1 joined
14:00 m00dy joined
14:02 jesse__ joined
14:03 <jesse__> hello, I'm having trouble getting going with the Phoenix framework.
14:04 <jesse__> It uses PostgreSQL by default, so I'm trying that
14:04 <jesse__> But it says the password is wrong
14:04 <jesse__> I found the dev.exs file which seems to contain some kind of postgres username and password
14:05 <jesse__> But I don't really know how to configure PostgreSQL either
14:06 <Ankhers> jesse__: Do you have a database you would prefer to use?
14:07 <tonyc> adding users in postgres is pretty easy
14:07 <jesse__> I'm more used to MySQL, but I don't mind learning postgreSQL either
14:07 <jesse__> I figured that would be a safer bet since it is the default
14:07 <jesse__> more tested and fitting with the features offered by phoenix?
14:07 __charly__ joined
14:08 Guest67 joined
14:08 <jesse__> tonyc, are there any configured by default?
14:09 <tonyc> jesse__: it depends on the platform you're using, what OS are you on>
14:09 <jesse__> Debian 8
14:10 <jesse__> I installed PostgreSQL through the standard packages
14:10 <asonge> jesse__: pg_hba.conf is usually something you have to touch to connect to Postgres easily
14:10 <tonyc> ah
14:10 <jesse__> although now I'm wondering if I should switch to FreeBSD...
14:10 <tonyc> not locally
14:10 <asonge> ecto only connects over tcp, not unix domain sockets
14:11 <jesse__> eventually I might offer hosting services on it...
14:11 <tonyc> for postgres, you have a "createuser" and "dropuser" commands
14:11 <tonyc> likewise createdb and dropdb
14:11 <tonyc> their manpages are well written
14:12 <jesse__> is there any way to see which users might already exist?
14:13 papachan` joined
14:17 <tonyc> you might be able to do it with an existing account in sql
14:17 <tonyc> jesse__: chances are you now have a "postgres" unix user account, if you sudo to that user, then you should be able to run "psql" and connect
14:18 <jesse__> hm, well that seems to be the account the phoenix app is trying to use and failing
14:19 dustinfarris joined
14:19 <tonyc> jesse__: what's the full error message you're getting back?
14:20 returntrip joined
14:20 bitmod joined
14:20 <tonyc> what asonge said makes me wonder if postgres on debian doesn't allow TCP connections by default
14:21 <asonge> It allows them, but the auth level is paranoid by default. It is not specific to Debian.
14:22 <tonyc> ah
14:22 <jesse__> tonyc, [error] Postgrex.Protocol (#PID<0.3229.0>) failed to connect: ** (Postgrex.Error) FATAL 28P01 (invalid_password): password authentication failed for user "postgres"
14:22 <jesse__> so I guess I'm using the wrong password?
14:22 <asonge> I think the default is that you have to use a user with a password over tcp. Unix socket trusts the username for the process
14:23 cschneid_ joined
14:23 <tonyc> I'm not sure how postgres sets up the password for the default postgres user
14:24 wpcarro joined
14:24 <tonyc> jesse__: i think your best bet is to sudo to postgres, then use "createuser" and "createdb" to create a separate user and database for your app
14:24 <tonyc> something like: createuser -P yourUserName
14:24 <Nicd-> there's no password for the default postgresuser, it uses ident auth by default I think
14:25 <asonge> there is no password for Postgres user by default
14:25 <tonyc> right.. but the connections have to come from the postgres user account
14:25 <asonge> yeah what Nicd- said
14:25 <tonyc> yep
14:26 <jesse__> hm, if I run `su postgress` it asks for a password
14:27 <Nicd-> you need to `sudo su postgres`
14:27 <Ankhers> Why not just use mysql if you are more comfortable with it? http://www.phoenixframework.org/docs/using-mysql
14:28 <Ankhers> I beleive the mysql ecto adapter is first class. So there should not be (m)any problems.
14:28 bitmod joined
14:28 <tonyc> also that :)
14:29 <Ankhers> Then, if you are so inclined, you can learn about postgres another time.
14:29 nd__ joined
14:30 <jesse__> I would still have to figure out how to connect to it though. I'm used to using MySQL, but not setting it up and configuring users
14:31 cemilowski joined
14:32 <Ankhers> How have you setup your databases for development before if you have never done it?
14:33 akeating joined
14:33 <asonge> i'm so used to muscle memory to get my postgresql db up, lol.
14:33 squallstter joined
14:33 <tonyc> ansible provisions my dev vm and sets up a db user
14:33 <tonyc> heh
14:34 <asonge> jesse__: on your local dev machine, you can put in "host all all trust" in pg_hba.conf (modifying the line with, and you can just create a user and any other user can log in as them by just like...claiming to be them.
14:34 <asonge> no passwords needed.
14:34 <jesse__> well I did have to do a little configuration I guess, but I still would prefer to userstand the user config stuff on a deeper level
14:34 <asonge> the pg_hba.conf is how postgres likes to do some slightly automagic authentication stuff depending on how the connection comes in.
14:35 <tonyc> yeah
14:35 <tonyc> i hate fiddling with pg_hba heh
14:35 <Ankhers> Which is why I don't anymore.
14:35 <sevenseacat> neither do i
14:35 <tonyc> jesse__: if you want help getting a separate postgres user setup I can help you in a PM
14:36 m00dy joined
14:36 <Ankhers> You should probably ask postgres questions in #postgresql though. People there may know more than people here.
14:36 <tonyc> that would also be a good resource!
14:36 <jesse__> ok thanks
14:40 cristianR_ joined
14:44 m00dy joined
14:45 m00dy joined
14:47 __charly__ joined
14:49 <tonyc> I forgot I was on freenode, heh
14:49 m00dy joined
14:49 Ilyes512_ joined
14:55 griffinbyatt joined
14:55 ejpcmac left
14:55 Guest67 joined
14:56 <Ilyes512_> hey guys is it possible to limit phoenix responses to a certain type? ie if I make a post request and set a header Accept: application/xml , but I put json in the body then it will still be parsed
14:57 m00dy joined
14:57 <Ilyes512_> I havent made a Plug.Parser.XML yet but I will tackle that next. Just wondering if I could force it to never return any other type then xml
14:57 <benwilson512> Ilyes512_: who puts json in the body, the client?
14:57 <benwilson512> or the server
14:58 <Ilyes512_> client
14:58 <Ilyes512_> so I send a request to a endpoint that only should except xml
14:58 <benwilson512> accept header is about the response
14:58 <benwilson512> not the request
14:58 <Ilyes512_> ah
14:58 <benwilson512> content type is about the request
14:58 <benwilson512> if you set the content type as xml and you put json, it should have issues
15:00 <Ilyes512_> well I am not parsing the body yet (I will extend it so it will validate it with a xsd file using erlsom)
15:00 <benwilson512> sure but i guess my point is, the accept header has nothing to do with the request body
15:00 <Ilyes512_> is it true that if i set plug :accepts, ~w(xml) that i would only accept xml content type?
15:00 <benwilson512> that isn't what that means
15:00 <Ilyes512_> yes that was a mistake and I replaced it with the content-type header
15:01 <Ilyes512_> i am switching http headers for content negotiation
15:01 <Ilyes512_> need to read some more about them
15:01 <benwilson512> https://hexdocs.pm/phoenix/Phoenix.Controller.html#accepts/2
15:02 <benwilson512> the accept header is about the CLIENT specifying the RESPONSE format
15:02 <benwilson512> `accepts` plug says "hey, I can return this kind of data"
15:02 <benwilson512> if you want to say "hey, I can only parse X kind of data"
15:02 <Ilyes512_> yes i only want to return xml and nothing else
15:02 <Ilyes512_> yes thats what i want
15:02 <benwilson512> cool, do you also want to only receive xml?
15:03 <Ilyes512_> yes so i should only receive xml and i will only respond with xml.
15:03 <benwilson512> then move the plug parser out of the endpoint.ex file, and put it in particular pipelines in your router
15:03 <benwilson512> or remove everything but xml from the plug parser in the endpoint if you want your whole app to only do xml
15:04 nd__ joined
15:04 <Ilyes512_> no i just want certain endpoints (in this case it only one). I made new scope and new pipeline for that
15:04 <Ilyes512_> plug Plug.Parsers,
15:04 <Ilyes512_> parsers: [:urlencoded, :multipart, :json],
15:04 <Ilyes512_> pass: ["*/*"],
15:04 <Ilyes512_> json_decoder: Poison
15:05 <benwilson512> then yeah you'd want to remove those other parsers for pipelines that only can receive xml
15:05 <Ilyes512_> i think you mean that one? so it passes/allows every type at the moment i guess
15:05 <benwilson512> it will allow any type it doesn't know about, and if it's one of urlencoded, multipart, or json, it'll get parse
15:06 <Ilyes512_> so i can move that plug as is inside a pipeline group?
15:07 <Ilyes512_> in the end i want to serve html, json and xml. So html and json scopes should both have those parsers. Is there a nice (clean) way of applying those to both of them without duplicating code?
15:08 <benwilson512> put it in a pipeline that you pipe_through in both your html and json scopes
15:08 <Ilyes512_> ah like a common pipeline group
15:10 icecreamcohen joined
15:10 <benwilson512> yup
15:13 cschneid_ joined
15:18 <Ilyes512_> btw tnx benwilson512 :)
15:23 refriedchicken joined
15:23 cevado joined
15:24 psmmr joined
15:24 <psmmr> I was not trying to setup an phonix & coherence app
15:24 <psmmr> and coherence blows up with a undefined App.User.rememberable?/0 error
15:25 <psmmr> does anyone know how to go around this?
15:28 <Ilyes512_> psmmr never worked with coherence but if anyone wants to help you you should provide some more details. I would also suggest just going through the readme/doc of coherence
15:29 <psmmr> I just used the default settings and this error is appearing
15:32 NickJagged joined
15:34 codestorm joined
15:36 Tica2_ joined
15:44 nd__ joined
15:44 icecreamcohen joined
15:44 wsieroci joined
15:44 srxa joined
15:45 JEG2 joined
15:45 cemilowski joined
15:51 davidw joined
15:55 JEG2 joined
15:56 griffinbyatt joined
15:57 wpcarro joined
15:59 JEG2 joined
15:59 <Ilyes512_> it still doesn't respect requested type :/ I removed the plug Plug.Parsers from endpoint.ex and added it to a specific pipeline
16:01 nd__ joined
16:02 amclain joined
16:06 marr joined
16:12 JEG2 joined
16:19 <benwilson512> Ilyes512: what exactly happens?
16:20 wpcarro joined
16:23 cevado joined
16:27 jeffweiss joined
16:29 meh` joined
16:30 wsieroci joined
16:43 JEG2 joined
16:46 JEG2 joined
16:49 codestorm joined
16:55 papachan joined
16:57 griffinbyatt joined
16:57 papachan joined
16:59 dustinfarris joined
17:00 akeating joined
17:02 lexmag joined
17:03 leons joined
17:07 willyk joined
17:11 rkazak joined
17:13 OtherAllan joined
17:14 jkreeftmeijer joined
17:16 papachan joined
17:24 <meh`> how do I set a :map value with Ecto.Query.update?
17:25 <meh`> or access a map value
17:25 PaReeOhNos joined
17:25 <meh`> http://sprunge.us/WPgc?ex I'm trying to make this migration work
17:26 patientplatypus joined
17:27 PaReeOhN_ joined
17:30 <Ilyes512> i am back home (same user as Ilyes512_)
17:31 Ilyes512_ joined
17:35 <Ilyes512> benwilson512 still on ?
17:42 <Ankhers> meh`: You need to use the :json or :jsonb (assmuing postgres) in the migration. You use :map in the schema.
17:43 <meh`> Ankhers, where? I've used :map in the other migrations too
17:43 <meh`> and it works, the issue is with the access and updating
17:43 <meh`> the down is easily fixed with a fragment
17:43 <Ankhers> Are you getting an error?
17:43 <meh`> but I don't know how to fix the up
17:44 <meh`> Ankhers, yeah, %{} is not accepted for the update, but if I use ^%{} then I can't access e
17:46 wpcarro joined
17:47 <Ankhers> Oh, interesting. Using :map will default it to :jsonb for postgres.
17:47 <meh`> Ankhers, yeah, the issue is on line 13
17:47 <meh`> I don't know how to update it to a map
17:50 Tica2 joined
17:55 <Ilyes512> if I define plug Plug.Parsers, parsers: [], pass: [] I expect every request to raise like it says in the documentation https://hexdocs.pm/plug/1.3.5/Plug.Parsers.html but it wont raise anything if I dont provider a valid Content-Type header
17:56 maxbeizer joined
17:56 <Ilyes512> if I define Content-Type: blabla it will not raise but if I change that to Content-Type: application/json it does raise
17:56 <Ilyes512> why is this?
17:57 <Ankhers> meh`: I'm not sure you can do that. Someone else may know more, but I would suggest using 2 different queries. One to get the information, one to set it again. I know this is less than ideal, but it is only for a migration, so it should only need to run once.
17:58 griffinbyatt joined
17:59 maxbeizer_ joined
17:59 cdg joined
18:01 srxa joined
18:07 jushur joined
18:08 josevalim joined
18:14 <Ilyes512> is there a way to stop IEx.pry?
18:14 <Ilyes512> like a "continue" sort of thing
18:14 <josevalim> respawn
18:15 JEG2 joined
18:15 <Ilyes512> hey josevalim :)
18:16 <Ilyes512> could I ask you a quick plug Plug.Parsers related question?
18:17 NickJagged joined
18:18 <Ilyes512> I have set this in a pipeline plug Plug.Parsers, parsers: [], pass: [] and removed the one thats added by default in the endpoint.ex file. Problem is that it wont raise when I use Content-Type header values like: "", "foobar" or "xml"
18:20 <Ilyes512> My endgoal is to only allow xml so I plan on doing something like plug Plug.Parsers, parsers: [:xml], pass: ["xml"], xml_decoder: :Erlsom (i created Plug.Parsers.XML based on Plug.Parsers.JSON)
18:26 lexmag joined
18:34 wpcarro joined
18:37 Tidur joined
18:43 Tica2 joined
18:45 wpcarro joined
18:48 zodiak__ joined
18:58 griffinbyatt joined
18:59 m00dy joined
19:06 Ven joined
19:09 jushur joined
19:10 josevalim joined
19:13 jushur joined
19:15 willyk joined
19:17 jkreeftmeijer joined
19:17 jushur joined
19:19 Ven_ joined
19:20 jkreeftmeijer joined
19:24 cevado joined
19:27 fxn joined
19:28 ur5us joined
19:30 jushur joined
19:31 <barttenbrinke> I'm having a weird issue with my update to phoenix 1.3: tzdata is working fine, but in my test suite I get:
19:32 <barttenbrinke> https://www.irccloud.com/pastebin/fwfy2C3v/
19:32 <barttenbrinke> Which is super weird as running it in iex works fine..
19:32 <barttenbrinke> Any thoughts about the core issue are much appreciated :)
19:38 cristianR_ joined
19:39 cevado joined
19:40 wpcarro joined
19:46 <laut> barttenbrinke: upgrade to the newest version of tzdata
19:46 <laut> 0.5.12
19:46 <barttenbrinke> @laut I am on 0.5.12
19:47 <laut> OK, that's not it then.
19:47 <barttenbrinke> :)
19:50 <barttenbrinke> I'll try rolling back to 0.5.11
19:51 <zodiak__> question) how do I start an umbrella app but NOT run one of the apps on startup ? other an by editing the apps application.exs and removing the children spinning up I mean
19:54 <OliverMT> micmus: that should work without the qoutes is the one I was talking about
19:54 <OliverMT> just :æøå
19:55 <OliverMT> unless I misunderstood how it works
19:59 griffinbyatt joined
20:04 dimitarvp` joined
20:06 <laut> @barttenbrinke which version of hackney do you use?
20:06 fernandomm joined
20:09 ur5us joined
20:10 <Ilyes512> Anyone know why plug :accepts, ["xml"] still alows Content-Type: "" or Content-Type: "random". But it will return 415 Unsupported media type as soon as I use Content-Type: "foobar/asd"
20:12 elgenie joined
20:15 cemilowski joined
20:15 <Ilyes512> I am really stuck on this... :/
20:16 mspo left
20:19 Ven joined
20:20 E280A joined
20:21 notdaniel joined
20:26 kronicdeth joined
20:31 Ven_ joined
20:33 willyk joined
20:35 <Ilyes512> https://elixirforum.com/t/only-allowing-xml-requests/5153
20:43 Ven_ joined
20:52 PaReeOhNos joined
20:56 karmajunkie joined
20:59 Ove_ joined
21:00 griffinbyatt joined
21:00 <Ove_> Using hot upgrades exrm tells me the upgrade is done, however it takes a restart until new code comes into play.
21:01 <Ove_> Do I need to apply more stuff to have it restarted? (There's no states in this application)
21:01 <Ove_> s/exrm/distillery/
21:02 <Ankhers> Ove_: Can you explain the steps you took?
21:02 elgenie joined
21:04 cemilowski1 joined
21:07 <Ove_> MIX_ENV=prod mix do deps.get, compile ,release --env=production --upgrade (copy result release to production box, do hot upgrade with bin/project_name upgrade "0.1.4")
21:12 maxbeizer joined
21:13 willyk joined
21:13 MarioBranco joined
21:19 ur5us joined
21:20 tonyc joined
21:22 tonyc joined
21:22 centip3de joined
21:22 srxa joined
21:22 tonyc joined
21:24 <OliverMT> anyone see what I'm doing wrong?
21:24 <OliverMT> https://gist.github.com/olivermt/ab15392da313fed1723330f5d6945a2f
21:24 <OliverMT> I dont get why it isnt matching
21:24 <centip3de> Hey y'all, anybody know if it's possible to run a funciton after ExUnit tests have run? I'd like to test some methods for populatiing my DB, but I don't want those records to exist in my DB after the tests run.
21:26 tonyc joined
21:26 wsieroci joined
21:27 dustinfarris joined
21:28 <notriddle> OliverMT: I get a 404 when I try to open your link.
21:28 <OliverMT> I deleted it in shame
21:28 <OliverMT> too late at night
21:28 <OliverMT> I was doing {foo, acc} instead of foo, acc
21:28 <OliverMT> in the fn heads
21:28 <OliverMT> :<
21:28 <notriddle> I see.
21:33 <centip3de> Anyone?
21:35 jkreeftmeijer joined
21:36 jkreeftmeijer joined
21:36 <Ilyes512> centip3de there is an option to run the test within a transaction
21:37 <Ilyes512> at the end it will just be auto rollback
21:39 <centip3de> Hm, interesting
21:45 <centip3de> It looks like there's also an `on_exit` callback. That might work.
21:49 tonyc joined
21:54 codestorm777 joined
21:56 xsrsx joined
21:56 Ven joined
21:57 Ioyrie joined
21:58 <hahuang65> centip3de: https://hexdocs.pm/ecto/Ecto.Adapters.SQL.Sandbox.html
21:59 <xsrsx> Hi all, when I run a migration with a reference to another table, I get the undefined_table error. I check in psql and the table I try to reference does exist under the exact name
21:59 <xsrsx> Any idea where I can find the error?
22:00 <xsrsx> create table(:account_postingtypes) -> add :postingtypes_id, references(:account_postingtypes, on_delete: :nothing) -> create index(:account_postings, [:postingtypes_id])
22:01 griffinbyatt joined
22:01 <hahuang65> xsrsx: looks like you're referencing the table you're trying to create?
22:01 wpcarro joined
22:02 <xsrsx> The first comment is an earlier migration
22:09 wpcarro joined
22:10 <hahuang65> xsrsx: can you post the code and the error in a pastebin?
22:13 <xsrsx> Sure: https://bpaste.net/show/bddd779f1933
22:19 jerel joined
22:21 <hahuang65> xsrsx: notice that the table it's attempting to access is `accounts_postingtypes` and you have `account_postingtypes`... one with plural accounts and one with singular account
22:21 <hahuang65> not sure what is causing that, but that's the issue
22:22 <xsrsx> Can that be caused by a relation in the schema or are they not used in the migration?
22:25 <xsrsx> I see that I used accounts_postingtypes in the generator
22:28 <hahuang65> not sure, i haven't used ecto for a couple of releases so I couldn't give you any accurate information
22:30 m00dy joined
22:32 <xsrsx> Thanks for pointing out the error. I know where to look now
22:33 wpcarro joined
22:40 <hahuang65> xsrsx: good luck
22:41 byte512 joined
22:42 dstrunk joined
22:43 Ven joined
22:43 centip3de left
22:47 PaReeOhNos joined
22:48 PaReeOhNos joined
22:49 PaReeOhNos joined
22:49 PaReeOhNos joined
22:50 PaReeOhNos joined
22:57 <xsrsx> So I used a clean app and ran the same migrations and it work without any issue. Really strange
22:58 PaReeOhNos joined
23:03 griffinbyatt joined
23:04 memes joined
23:04 Ilyes512 joined
23:05 wpcarro joined
23:06 Ven_ joined
23:24 Ven_ joined
23:31 gvaughn_ joined
23:32 gvaughn joined
23:40 Ven joined
23:45 ur5us joined
23:55 dustinfarris joined
23:59 PaReeOhNos joined