<    March 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 _2_4 25  
26 27 28 29 30 31
00:14 r00tl3ss joined
00:27 rschmukler joined
00:34 mauricio joined
00:36 guacamole joined
00:38 duane joined
00:39 rschmukler joined
00:40 Ven joined
00:48 milad joined
00:51 ariedler joined
00:51 fxrs joined
00:53 montanonic joined
00:53 trevoke joined
00:56 shadowjack joined
01:04 mitchellhenke joined
01:08 dimitarvp joined
01:10 aedigix joined
01:11 <r00tl3ss> Hallo! Does anyone know of an ERD generating thing for Phoenix, like Rails-ERD?
01:11 <r00tl3ss> Or more in general, are there any good examples of a Process Flow Diagram for a Phoenix/Elixir app?
01:12 <r00tl3ss> Or, in other words, how do you guys design/architecture a Phoenix App?
01:13 jhack joined
01:13 jhack joined
01:15 aedigix joined
01:17 rkazak_ joined
01:23 MotherFlojo joined
01:28 PaReeOhNos joined
01:31 duane joined
01:35 jbranchaud joined
01:41 jbranchaud joined
01:44 <jbranchaud> hey
01:45 <Ankhers> r00tl3ss: That is a very overloaded question. Though, you should take a look at the new phoenix 1.3 generators. They nudge you in a good direction.
01:45 <Ankhers> jbranchaud: Howdy
01:45 <r00tl3ss> Ankhers: cool!
01:46 <r00tl3ss> Ankhers: But I'm actually thinking about how to document an App that is built using Phoenix
01:46 <r00tl3ss> Like OOP stuff you have UMLs
01:46 <r00tl3ss> but what are the Functional Programming equivalent?
01:46 <r00tl3ss> DFD maybe? Since it's all about transforming data?
01:47 <r00tl3ss> That's the reading I get from a bit of basic googling
01:49 <r00tl3ss> A DFD ,separating the Router,Model,View,Controller parts of Phoenix, and arrows representing the data flow between these from user input, to display output? Does that sound reasonable?
01:50 duane_ joined
01:50 <Ankhers> I can't comment on that as I don't think I have been involved in a project that used UML or anything else to plan the application. I have used UML to understand that structure of an application though.
01:52 <r00tl3ss> Ah, then a good question would be how would you document a Phoenix app? I'm working with a bunch of Engineers (like Construction/Civil type guys) who like having diagrams and things
01:56 <Ankhers> I'm not entirely sure. I haven't needed to create any diagrams from my Elixir code yet. What exactly are you wanting to show these people you are working with?
01:59 <r00tl3ss> Hmm...It's more to show a sort of road map of what MVC components we have, how they interact with each other
02:00 <r00tl3ss> And also so we can plan for expansions based on what we already have. I a way, it's meant to be somewhat of a blueprint of the App
02:01 <r00tl3ss> For instance, when a user creates a JobRequest, then the Admin assigns that Job to a Technician, I want to be able to diagram the flow of what's happening inside Phoenix
02:01 <r00tl3ss> 1. So the engineers get an idea of roughly what's happening with the app
02:01 <r00tl3ss> 2. So WE the devs have an overall view of what's going on
02:03 <Ankhers> I don't really know how to solve 1 right now. But 2, the new Phoenix generators push you to build your application in a way that you can see a little better how your data interacts with eachother from just looking at the directory structure.
02:04 <Ankhers> It obviously isn't as detailed as a UML diagram or something. But it helps.
02:06 rschmukler joined
02:06 <r00tl3ss> Which is how I've always used it, in the sense that I know if you ask for a "/resource", I just have to check the router to know which Controller it goes to, and if it hasn't been customised, I already know the corresponding Views/Models/Templates for it
02:07 <r00tl3ss> Hmm...maybe that's EXACTLY what I'll diagram
02:07 <Ankhers> Yeah, but in rails, you have a /models directory. And it is used as a dumping ground for various classes. Phoenix 1.3 is going to be pushing for something a little different.
02:08 <r00tl3ss> oh?
02:08 <r00tl3ss> I think I'm on Phoenix 1.2 where there's a web/models directory
02:08 <r00tl3ss> Are you saying there won't be that directory anymore?
02:09 <Ankhers> https://www.youtube.com/watch?v=tMO28ar0lW8
02:09 <Ankhers> Yeah. There is no /models directory going forward.
02:09 <r00tl3ss> Thank you!
02:10 <r00tl3ss> I'll be checking this out
02:10 <Ankhers> Also, /web is no longer a top level directory.
02:11 <r00tl3ss> !
02:11 <r00tl3ss> oOoo
02:11 <Ankhers> It will make you think a little bit more up front about how your application(s) is going to be structured. But I think it is a good thing.
02:12 <Ankhers> Also, I moved my 1.2 Phoenix app to the new 1.3 structure in 10-20 minutes. Though, it is also backwards compatible if you do not want to switch to the new structure immediately.
02:13 <r00tl3ss> Excellent
02:13 <r00tl3ss> I'll try moving mine up to 1.3 tonight
02:15 <Ankhers> r00tl3ss: You are going to want to look at https://gist.github.com/chrismccord/71ab10d433c98b714b75c886eff17357 if you are going to migrate.
02:15 <r00tl3ss> Thanks very much
02:18 <ivan> is there some kind of idiomatic way to return exception values from tasks without mapping each exception to an :atom?
02:18 <ivan> s/idiomatic/good/
02:20 <r00tl3ss> oh ho!
02:20 <r00tl3ss> Ankhers: just having a brief look at this. Question: does this mean you can technically have TWO web namespaces?
02:21 <r00tl3ss> As in one app, but with two web endpoints?
02:22 <Ankhers> ivan: When you say "return exception values", what exactly are you doing ? Are you calling raise?
02:22 <Ankhers> r00tl3ss: Technically speaking, I think you could have done that previously too. With that said, you probably want an umbrella project with multiple web apps inside if you wanted to do something like that.
02:23 <r00tl3ss> Ah, right
02:24 <ivan> Ankhers: yeah, my functions call raise and I write wrapper functions to turn those exceptions into atoms so that one failing task doesn't crash the parent process
02:24 <r00tl3ss> Possibly a single Repo app just to handle the database, and two Web apps under the umbrella
02:25 Ven joined
02:25 <ivan> what I'm doing seems to work fine but I'm a little bothered by having an atom for each exception
02:25 maxbeizer joined
02:25 <Ankhers> ivan: Are you using the Task module?
02:25 <ivan> yep
02:26 <Ankhers> Do you control the thing that is calling raise?
02:27 maxbeizer joined
02:27 <ivan> Ankhers: I do
02:28 <ivan> I kind of like raising from those functions because they can be called outside the "do lots of things at once with tasks" context
02:28 marcdel joined
02:28 rschmukler joined
02:28 <Ankhers> Why not just return {:error, reason}?
02:29 maxbeizer joined
02:30 tomterl joined
02:31 <ivan> well, one reason to use exceptions instead of error return values in general is that people forget to check return values (try github code search on various elixir functions)
02:33 <ivan> maybe I can use other means to make sure return values are checked?
02:33 <iFire> How do you enumerate a list of maps. I want to go throught element and take the element's .blah (map syntax)
02:34 montanonic joined
02:34 <Ankhers> That sounds like their problem. I just think that you should only raise an exception on things that are truly exceptional. Like network errors and such.
02:34 <Ankhers> iFire: So you want a list of the :blah element in all the maps?
02:34 <iFire> yeah
02:34 <ivan> "truly exceptional" is in the eye of the beholder, no? a system that works fine one day can go into a state where it's exceptioning all the time
02:35 <ivan> someone with really bad Internet might not think network errors are so exceptional
02:35 <iFire> sometimes the entire list can be nil
02:35 <iFire> but that's about it
02:35 <iFire> ivan: what happened to the let it fail philosphy?
02:36 <iFire> raising the error will just complicate the call_stack
02:36 <ivan> iFire: well, the problem is not with that but with things continuing to do things because they forgot to check for errors and then making a mess
02:36 milad joined
02:37 <iFire> well I guess you can use a function that checks and it'll fail when none of them match
02:37 <christhekeele> iFire: list_of_maps |> Enum.reduce([], fn map -> map[:key] end) |> Enum.reject(&:is_nil)
02:38 <christhekeele> (&is_nil/1) I mena
02:38 <Ankhers> iFire: Enum.reduce(list_of_maps, [], fn map, acc -> if is_map(map), Map.has_key?(map, :blah), do: map.blah, else: acc end)
02:38 <Ankhers> Something like that should work.
02:38 rschmukler joined
02:38 <christhekeele> Oh, I see, the map is nil, not the value under the key
02:39 <christhekeele> My example was all off actually :D
02:40 luke_nukem joined
02:40 <iFire> abort: if is a function?
02:40 <iFire> Ankhers: I mean
02:41 modran joined
02:42 <ivan> is there any shorthand for maps |> Enum.reduce(%{}, fn(m, acc) -> Map.merge(acc, m) end)
02:43 kanishka joined
02:44 <Ankhers> iFire: if/2 is a macro.
02:44 <Ankhers> But yes.
02:44 systemfault joined
02:44 <Ankhers> ivan: You just want to merge a bunch of maps together?
02:45 <ivan> yep
02:45 <Ankhers> Not that I know of.
02:45 <ivan> thanks
02:45 <Ankhers> Though, just a style point, you should only use pipes if you are piping multiple things.
02:46 <Ankhers> You may be doing that in your actual code those.
02:46 <Ankhers> s/those/though
02:46 <Ankhers> ivan: ^^
02:47 <ivan> yeah in that case I was but I totally disagree with that style rule
02:47 <ivan> it ruins my alignment-fu :-)
02:47 sahrizv joined
02:47 <Ankhers> How does that ruins alignment?
02:48 <ivan> I often have lines with term |> something |> else and nearby lines that might lack the |> else
02:49 <ivan> in another case I have this ecto code
02:49 <ivan> from("machines")
02:49 <ivan> |> where([hostname: ^hostname])
02:51 <Ankhers> Any particular reason you don't just use from("machines", where: [hostname: ^hostname]) and just break up the line?
02:53 trevoke joined
02:55 <dimitarvp> rvirding: apologies for slightly off-tangent question, but do you have a quick step-by-step for using Erlog inside an IEx session? Is it possible at all?
02:56 <iFire> Ankhers: How do add that map to the acc so that it becomes [[a,b] [c,d] [e,f]]
02:56 <iFire> where each inner list is a thing to be added
02:56 <iFire> uh the results of the map
02:56 <iFire> using [x.name, type] ++ acc gave
02:57 <iFire> weird results
02:58 <iFire> got it
02:59 PaReeOhNos joined
02:59 <iFire> [[x.name, type] | acc ]
03:03 <Ankhers> iFire: I think you should consider using a tuple instead of a two element list.
03:05 chrismccord joined
03:08 rschmukler joined
03:10 <ivan> Ankhers: just for symmetry with other functions nearby
03:10 <Ankhers> Fair enough.
03:16 raycoll joined
03:18 rschmukler joined
03:21 raycoll joined
03:24 hotpancakes joined
03:24 MotherFlojo joined
03:26 marcdel joined
03:29 raycoll joined
03:31 refriedchicken joined
03:33 hotpancakes joined
03:35 marcdel joined
03:36 hotpancakes joined
03:47 refriedchicken joined
03:51 <carterparks> what's a good open source phoenix app that might be good for referencing as a beginner?
03:53 <christhekeele> Ven: https://github.com/dailydrip/firestorm is under active development
03:54 hotpancakes joined
03:55 hotpancakes joined
03:57 Ven joined
04:02 maxbeizer joined
04:06 <carterparks> also is there something like guard for elixir?
04:06 <carterparks> something that autoruns tests when files change?
04:06 <carterparks> christhekeele thanks that looks like a good example
04:11 hakunin joined
04:12 <iFire> fishcakez: How do you solve the problem of getting the prepared statement's tuple type to the execute function so you know what type it is? I'm always getting it after I need it.
04:14 asabil joined
04:23 fertel joined
04:24 wtetzner joined
04:25 rschmukler joined
04:29 PaReeOhNos joined
04:34 <iFire> ooh
04:35 <iFire> you start another ets table
04:35 <iFire> that inserts a ref and paramter
04:36 rschmukler joined
04:41 Ven joined
04:41 raycoll joined
04:53 BeerLover joined
04:55 freester joined
05:02 w-t-h_ joined
05:03 rschmukler joined
05:11 asabil joined
05:12 <ryanwinchester> i'm trying to work on a section of my app that i'd like to make a separate library out of later
05:13 <ryanwinchester> so when i set some config for it, not in my app's name, i'm getting nil
05:13 <ryanwinchester> i think i'm missing something
05:25 rschmukler joined
05:25 Ven joined
05:30 aniketd joined
05:34 jerel joined
05:35 rschmukler joined
05:40 MotherFlojo joined
05:43 craigp_ joined
05:43 gvaughn joined
05:44 <freester> whats crackin guys
05:45 Ninja3047 joined
05:46 rschmukler joined
05:47 <freester> greetings friends
05:48 <Ninja3047> my greetings freester
05:49 Freester1 joined
05:49 cemilowski joined
05:51 <freester> did anyone here get a nintendo switch
05:52 dstrunk joined
05:55 <iFire> a few of my friends played with it
05:57 z1mvader joined
06:01 PaReeOhNos joined
06:04 rschmukler joined
06:08 raycoll joined
06:15 rschmukler joined
06:20 z1mvader joined
06:26 rschmukler joined
06:29 myronmarston joined
06:39 trevoke joined
06:40 nanohest joined
06:51 peirama joined
06:51 willyk joined
06:59 myronmarston joined
06:59 refriedchicken joined
07:07 icanhazbroccoli joined
07:09 duane joined
07:18 alex88 joined
07:24 fantomik joined
07:29 nanohest joined
07:30 PaReeOhNos joined
07:32 gvaughn joined
07:37 w-t-h_ joined
07:41 MotherFlojo joined
07:59 markh joined
08:02 tuacker joined
08:06 squallstter joined
08:21 milad joined
08:23 kau joined
08:24 ZippoWeb joined
08:26 Ven joined
08:29 milad joined
08:29 josevalim joined
08:31 wsieroci joined
08:32 hotpancakes joined
08:33 wsieroci_ joined
08:36 MotherFlojo joined
08:40 trevoke joined
08:41 hotpancakes joined
08:42 Ven joined
08:44 cemilowski joined
08:48 ctp joined
08:55 milad joined
08:55 milad joined
09:00 PaReeOhNos joined
09:01 TarVanim_ joined
09:05 hotpancakes joined
09:09 <asabil> asking again: Regarding phoenix, are there any plans to support raw websockets officially?
09:20 gvaughn joined
09:20 gokr joined
09:23 <Nicd-> asabil: not that I've heard of. the system is based on channels and that needs the custom protocol
09:24 <asabil> well, too bad the channels protocol is text based, makes it unusable for binary data
09:27 Ven joined
09:28 hotpancakes joined
09:31 <josevalim> asabil: you can provide custom serializers in Phoenix
09:31 <josevalim> so you acn use binary data if you want
09:31 <josevalim> you can also encode the binary data with base64 but that is likely inneficient
09:33 <asabil> josevalim, yes I have seen that, but still, the whole Socket/Channel concept in phoenix is way too high level to be useful for me
09:33 <josevalim> asabil: then you can use cowboy websockets directly :)
09:33 <asabil> as if it was designed for "chatrooms" only
09:33 <asabil> yeah, and it is ugly
09:33 <josevalim> make it pretty :)
09:34 <asabil> that's what I am doing today, I am using cowboy directly, because I don't know how to integrate cowboy with plug
09:34 <asabil> would you be open to that then? proper support for websockets in Phoenix
09:34 <josevalim> it is already there
09:34 <josevalim> Phoenix allows you to pass extra dispatchers when it is starting cowboy
09:34 <josevalim> and that's when you can pass your own websocket handlers
09:35 <asabil> that's what I already do
09:35 <josevalim> and i have seen channels being used waaaaay beyond "chatrooms"
09:35 <josevalim> so I am not sure what else you are asking for?
09:35 <asabil> websockets :)
09:35 <asabil> I would like to see plain websocket support in phoenix itself
09:36 <josevalim> it honestly has very little benefit
09:36 <asabil> why?
09:36 <josevalim> because those who dont want socket/channel want to go low-level
09:36 <josevalim> so whatever abstraction we come up with will be considered "not low-level enough"
09:36 <Nicd-> I use phoenix channels for live updates to my website, nothing to do with chatrooms
09:37 <Nicd-> it works really well for that
09:37 <josevalim> Nicd-: i see people using it for finances, controling fleets of embedded devices, etc
09:37 <josevalim> asabil: use channels or use cowboy
09:37 <asabil> I am not talking about an abstraction, I am talking about having websockets the same way you handle http request routing
09:38 <josevalim> asabil: maybe we are being pedantic on what is an abstraction but that's exactly what i meant
09:38 <josevalim> do it yourself on top of cowboy
09:38 <asabil> basically in router.ex would be simply nice to be able to say `websocket "/path", MyWebsocketHandler`
09:38 <josevalim> it has very little benefit for Phoenix to add that
09:38 <josevalim> because those who ditch channels very likely will even that too high level
09:39 <josevalim> and it doesn't make sense to ask the Phoenix team to mantain a feature that like a handful of people are interested in using
09:39 <asabil> ok, thanks for the input
09:39 <josevalim> if that is something you find important, then you should tackle it :)
09:40 <asabil> it's more about knowing if the phoenix team would be interested in such contribution in the 1st place
09:40 <josevalim> I find it unlikely
09:40 <josevalim> but I do not represent the Phoenix team
09:40 <asabil> no point in working on adding this feature if it doesn't align with phoenix's philosophy
09:41 <josevalim> asabil: that's why i am saying you should work on it for you and not for them :)
09:41 hotpancakes joined
09:41 <asabil> I will probably just drop down to cowboy all the way actually
09:42 <josevalim> if it suits you better, then you should :)
09:42 Ven joined
09:42 <josevalim> if you are feeling adventurous you can even try cowboy 2 that is in beta i believe
09:42 MaSven joined
09:42 <Nicd-> btw my intro to Elixir presentation went really well, so now I'm planning on setting up an Elixir meetup in my city (Tampere, Finland) :) should get the initial website up today
09:43 <josevalim> nice :D
09:43 <Nicd-> trying to get the language more known here
09:44 acscherp joined
09:44 duane joined
09:45 <asabil> well, thanks for the input :)
09:48 wsieroci joined
09:49 quaristice joined
09:52 cemilowski left
10:05 hotpancakes joined
10:12 quaristice joined
10:24 lexmag joined
10:30 PaReeOhNos joined
10:31 Bounga joined
10:31 inoas joined
10:35 fabian_ joined
10:36 fabjan left
10:36 fabjan joined
10:40 wsieroci joined
10:41 trevoke joined
10:43 oetjenj joined
10:44 fxn joined
10:44 TarVanim_ joined
10:47 hotpancakes joined
10:57 gmcabrita joined
11:01 acscherp joined
11:01 milad joined
11:01 milad joined
11:02 Ven joined
11:03 hotpancakes joined
11:03 Guest67_ joined
11:05 arathunku joined
11:09 gvaughn joined
11:12 oetjenj joined
11:13 oetjenj joined
11:20 sid_fules joined
11:22 Ven joined
11:30 laut joined
11:34 hotpancakes joined
11:35 oetjenj joined
11:42 Ven joined
11:44 josevalim joined
11:45 MotherFlojo joined
11:47 hotpancakes joined
12:00 PaReeOhNos joined
12:01 Ven joined
12:05 hotpancakes joined
12:09 asabil joined
12:21 Ven joined
12:22 sid_fules joined
12:27 bambanx joined
12:31 mauricio joined
12:31 <smeevil> I notice lots of improvements on the error messages in phoenix 1.3, nice work !
12:32 Guest67_ joined
12:42 Ven joined
12:42 hotpancakes joined
12:42 trevoke joined
12:49 asabil joined
12:57 gvaughn joined
13:01 Ven joined
13:13 imack joined
13:14 robinsjdotcom joined
13:18 <targaf> is there a "goto" guide for creating elixir libraries? I made a small one for internal use but when specifying it as a git dep I get an error saying unless the dep is specified as `app: false` which I know isn't normal
13:21 Ven joined
13:32 sfbw joined
13:32 PaReeOhNos joined
13:34 sid_fules joined
13:39 <aniketd> You can print a string using the IO.puts/1 function from the IO module:
13:39 <aniketd> iex> IO.puts "hello\nworld"
13:39 <aniketd> hello
13:39 <aniketd> world
13:39 <aniketd> :ok
13:40 <aniketd> This section in the elixir guides "basic types" part is no longer correct
13:40 <aniketd> currently in iex I get an SyntaxError if there is ` single `\` in the string argument to IO.puts
13:40 <smeevil> https://cl.ly/1O1P2O1m3W3v/Image%202017-03-11%20at%202.40.39%20PM.public.png
13:40 <smeevil> aniketd ^ ?
13:41 <aniketd> I need to `IO.puts "hello\\nworld"
13:41 <smeevil> aniketd that does not sound right
13:41 Ven joined
13:42 <aniketd> ...(22)>
13:42 <aniketd> ...(22)> IO.puts "hello\nworld"
13:42 <aniketd> ** (SyntaxError) iex:25: unexpected token: "\" (column 15, codepoint U+005C)
13:42 <aniketd> iex(22)> IO.puts "hello\\nworld"
13:42 <aniketd> hello\nworld
13:42 <aniketd> :ok
13:42 <aniketd> iex(23)>
13:42 <aniketd> on 1.4.2
13:43 MaSven joined
13:43 <smeevil> https://cl.ly/0k1Y3V3C3y0d/Image%202017-03-11%20at%202.43.37%20PM.public.png
13:44 <smeevil> aniketd still cannot reproduce that , (also thank you for reminding me to update :))
13:44 <aniketd> smeevil: how in the world? :)
13:44 <aniketd> I can send you a screen shot if you don't believe my pastes :)
13:44 <smeevil> hahaha i do !
13:44 <smeevil> question is, why !
13:45 <aniketd> and now it works!
13:45 <smeevil> o.O
13:45 <aniketd> let me send it anyway
13:45 <smeevil> what did you do differently now then ?
13:46 boddhisattva joined
13:46 MotherFlojo joined
13:48 <aniketd> https://usercontent.irccloud-cdn.com/file/JrWp6Qg4/aniketd_screenshot.png
13:48 sfbw joined
13:48 <aniketd> smeevil: I wonder if the `Crtl-C` then `v` had something to do with it?
13:49 <aniketd> Anyway. Thanks a lot smeevil. :)
13:50 duane joined
13:50 <aniketd> I may have done something wrong. But its really interesting.
13:50 <smeevil> it's still strange, but yes maybe something was wrong with the break indeed. have fun though :)
13:51 <fxn> isn't line 22 incomplete?
13:51 <aniketd> Yep just reproduced it
13:52 <smeevil> fxn you are right
13:52 <aniketd> If I ... IO.puts "hello\<enter><ctrl-c><v> ...and then try IO.puts "hello\nworld"
13:52 <aniketd> It gives me an error for column 15 '\'
13:52 <smeevil> aniketd the number in iex(N) is an internal representation of how many commands it executed. you can see it repeats 22 multiple times, meaning the command was not terminated yet
13:53 <aniketd> smevil: Nice observation!
13:53 <aniketd> Cool
13:53 <smeevil> it was fxn who spotted it :)
13:53 <aniketd> So the exception is actually from the previous incomplete statement !
13:54 <smeevil> indeed
13:54 <aniketd> Too cool! Thanks! :kudos:
13:54 <smeevil> enjoy :)
13:55 <aniketd> Sorry for making that blatant opening statement
13:55 <aniketd> My bad.
13:55 <smeevil> haha no worries
13:55 <aniketd> :D
13:59 potatosalad joined
14:00 MaSven joined
14:00 MaSven joined
14:01 Ven joined
14:04 fertel joined
14:06 jhack joined
14:20 gokr joined
14:21 Ven joined
14:23 r00tl3ss joined
14:24 sid_fules joined
14:29 milad joined
14:38 cdg joined
14:39 Uniaika joined
14:41 Ven joined
14:44 trevoke joined
14:46 gvaughn joined
14:48 hotpancakes joined
14:49 mitchellhenke joined
14:52 teddysmoker joined
14:53 greengriminal joined
14:54 dimitarvp joined
14:55 Uniaika joined
15:01 Ven joined
15:01 PaReeOhNos joined
15:01 quaristice joined
15:05 iFire joined
15:06 wtetzner joined
15:07 embik joined
15:09 mitchellhenke joined
15:10 tuacker joined
15:11 fhoffmann joined
15:15 sid_fules joined
15:15 hotpancakes joined
15:15 Or1on joined
15:21 Ven joined
15:23 mauricio_ joined
15:25 milad joined
15:30 jerel joined
15:40 <rvirding> I answered dimitarvp through his question in the forum.
15:40 <dimitarvp> rvirding: Thank you, I have only 1-2 smaller questions after ;) you have a follow-up.
15:40 Bounga joined
15:40 <rvirding> no worries
15:40 johnstorey joined
15:41 Ven joined
15:42 hotpancakes joined
15:44 <dimitarvp> rvirding: Apologies if it's slightly annoying. As I openly admitted, I am looking for a shortcut since I am way too overloaded with a lot of info lately.
15:45 mauricio1 joined
15:45 <rvirding> again, no worries, I will help you as much as I can in the forum.
15:46 <rvirding> Are you going to use it for something specific or "just" to learn logic programmin?
15:46 quaristice joined
15:47 MotherFlojo joined
15:47 <dimitarvp> rvirding: I am thinking a very small game for which I wanna write a bot.
15:48 <dimitarvp> I wanna use it as an opportunity to learn logic programming because the game rules are the facts
15:48 <dimitarvp> and I want to use the log engine to do basic checks like if certain moves look correct / beneficial etc.
15:48 <dimitarvp> I realize Prolog isn't the best way -- so yes, it's mostly for learning purposes. But I figure it's best if I learn using it through Erlang since I already am very fond of Elixir.
15:49 meh` joined
15:49 <dimitarvp> I am thinking in terms of a very small game** / logic engine**
15:49 duane joined
15:50 <micmus> dimitarvp: I was learning prolog recently, and doing solvers for some classic logic games/puzzles was a good exercise for me: things like sudoku or bulls and cows
15:51 <dimitarvp> micmus: exactly!
15:51 smt joined
15:52 <dimitarvp> as I mentioned to rvirding, I'd like to use `erlog` because for me it's a double win: I am getting deeper and deeper into Elixir (and collaterally into Erlang as well) so if I am gonna "play" with technologies, I'd first check if they have Erlang/Elixir bridges or implementations.
15:56 TarVanim_ joined
15:57 hotpancakes joined
15:58 quaristice joined
15:58 <rvirding> So erlog is a prolog interpreter which implements a subset of standard prolog. It has a database which works as it should but it is not really suitable if you want a large database. If you need that or have a big program with efficiency requirements then it is probably better to connect erlang/elixir to a "real" prolog like SWI-prolog . This is not
15:58 <rvirding> difficult.
15:59 <dimitarvp> rvirding: I realize that and I am thankful for pointing it out. Since I am gonna be doing pretty minor exercises (basically to wrap my head around it all at first), Erlog will do great for a while. ;)
16:00 <dimitarvp> for you pointing it out** RIP English today from me, sorry :(
16:00 fold4 joined
16:02 Ven joined
16:03 <dimitarvp> rvirding: expect next questions (after I figure `erlog` out in the next days) to be about ASN.1 as a replacement for JSON for highly-compressed data transfer!
16:03 <dimitarvp> and obviously, how good Erlang is with ASN.1
16:04 <rvirding> There is an ASN.1 compiler in the standard libraries, which I have never used. (ASN.1 was/is used in the telecom world for sending data)
16:04 <dimitarvp> Yep, started from mobile. Also used in the SSL tech here and there.
16:05 <dimitarvp> Was always very curious about it since it seemed like a very efficient data transfer format, but looked loaded with several (or tens) of different subtle differences between implementations.
16:05 oetjenj joined
16:05 sid_fules joined
16:06 hotpancakes joined
16:07 josevalim joined
16:09 Bounga joined
16:14 milad joined
16:16 hotpancakes joined
16:22 travis-ci joined
16:22 <travis-ci> elixir-lang/elixir#13803 (master - 24cd69c : Mohnish G J): The build passed.
16:22 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/8b0b15e329cb...24cd69cf8730
16:22 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/210076061
16:22 travis-ci left
16:26 Bounga joined
16:27 hotpancakes joined
16:28 travis-ci joined
16:28 <travis-ci> elixir-lang/elixir#13804 (emj/expose-seed - 1f53d24 : Eric Meadows-Jönsson): The build passed.
16:28 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/0233d492d583^...1f53d24c32e9
16:28 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/210076752
16:28 travis-ci left
16:28 myronmarston joined
16:31 blahdodo joined
16:32 PaReeOhNos joined
16:34 gvaughn joined
16:39 racycle joined
16:40 hotpancakes joined
16:44 Bounga joined
16:45 trevoke joined
16:46 travis-ci joined
16:46 <travis-ci> elixir-lang/elixir#13806 (master - 5a2fca2 : José Valim): The build passed.
16:46 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/24cd69cf8730...5a2fca2c64a0
16:46 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/210080138
16:46 travis-ci left
16:47 systemfault joined
16:54 myronmarston joined
16:54 mauricio joined
16:55 hotpancakes joined
16:56 wsieroci joined
16:57 johnstorey joined
17:01 smt_ joined
17:04 hotpancakes joined
17:09 milad joined
17:11 hotpancakes joined
17:12 gvaughn joined
17:16 gvaughn_ joined
17:17 milad joined
17:17 milad joined
17:17 johnstorey joined
17:19 cemilowski joined
17:24 refriedchicken joined
17:24 sid_fules joined
17:26 Bounga joined
17:27 alex88 joined
17:33 montanonic joined
17:41 rkazak_ joined
17:42 myronmarston joined
17:43 mauricio_ joined
17:44 rkazak_ joined
17:46 klltkr joined
17:48 MotherFlojo joined
17:48 wsieroci joined
17:48 icanhazbroccoli joined
17:50 lexmag joined
17:53 travis-ci joined
17:53 <travis-ci> elixir-lang/elixir#13807 (master - 934e873 : Milton Mazzarri): The build passed.
17:53 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/5a2fca2c64a0...934e8731464b
17:53 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/210092284
17:53 travis-ci left
17:54 arathunku joined
17:55 gk- joined
17:56 nomicflux joined
17:56 apotry joined
17:59 johnstorey joined
18:00 gk- joined
18:00 tuacker joined
18:01 trevoke joined
18:02 PaReeOhNos joined
18:02 rschmukler joined
18:03 oborot joined
18:05 acscherp joined
18:06 gk- joined
18:11 sid_fules joined
18:13 duane joined
18:13 rschmukler joined
18:17 milad joined
18:17 rschmukler joined
18:19 myronmarston joined
18:22 jhack joined
18:23 Or1on joined
18:24 sid_fules joined
18:25 raycoll joined
18:27 Bounga joined
18:28 rschmukler joined
18:31 sid_fules joined
18:34 johnstorey joined
18:37 hotpancakes joined
18:38 icanhazbroccoli joined
18:42 pHcF joined
18:44 DLSteve joined
18:49 mauricio joined
18:57 squallstter joined
18:59 jhack_ joined
19:00 jhack joined
19:01 mbwe joined
19:01 johnstorey joined
19:02 icanhazbroccoli joined
19:04 alex88 joined
19:08 travis-ci joined
19:08 <travis-ci> elixir-lang/elixir#13808 (master - e673637 : David Lucia): The build passed.
19:08 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/934e8731464b...e67363726841
19:08 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/210107314
19:08 travis-ci left
19:08 jbranchaud joined
19:11 myronmarston joined
19:13 rschmukler joined
19:19 sid_fules joined
19:25 edward__ joined
19:26 chrismccord joined
19:27 myronmarston joined
19:28 Bounga joined
19:29 <edward__> http://pastebin.com/Ae9KEcH1 why I am getting error: ** (CompileError) Physics.exs:5: def distance_traveled/1 conflicts with defaults from def distance_traveled/2
19:31 <fishcakez> edward__: on line 2 you define defaults for distance_travelled 2, which defines distance_traveled/1. This will conflict with line 5.
19:31 <fishcakez> rather you should have
19:31 <fishcakez> def distance_traveled(time, g \\ 9.8)
19:31 <fishcakez> without a body (no do code block)
19:32 <fishcakez> and then define the non negative, and negative clauses with arity 2
19:32 PaReeOhNos joined
19:38 hotpancakes joined
19:39 zabirauf joined
19:40 duane joined
19:42 johnstorey joined
19:43 <edward__> fishcakez: like this? https://paste.gnome.org/paww1uc5o which is not working either
19:43 <fishcakez> edward__: you dont define the defaults in the clauses with pattern matching, only the bodyless head
19:43 <fishcakez> there can only be one default value
19:43 <fishcakez> and shoulsnt pattern match/guard the clause with defaults
19:44 <fishcakez> otherwise its ambigiuous
19:44 nomicflux joined
19:48 <iFire> fishcakez: morning
19:48 travis-ci joined
19:48 <travis-ci> elixir-lang/elixir#13810 (master - 5740e80 : Michał Muskała): The build passed.
19:48 <travis-ci> Change view : https://github.com/elixir-lang/elixir/compare/e67363726841...5740e802e896
19:48 <travis-ci> Build details : https://travis-ci.org/elixir-lang/elixir/builds/210113865
19:48 travis-ci left
19:48 <fishcakez> iFire: hey, just heading off for a bit, back in hour and bit or so
19:48 <iFire> ah, have some questions. it's not urgent. Have fun!
19:49 <fishcakez> if you pop me a dm ill get back to you when im back
19:49 MotherFlojo joined
19:53 oborot joined
19:55 MotherFlojo joined
19:59 <hakunin> it's that time again, and i'm trying to maximize phoenix handling of a ton of connections
19:59 kyrix joined
19:59 <hakunin> i'm currently testing at 3000 clients per second, pointing them at static /robots.txt served by cowboy, log level is set to :error
20:00 trevoke joined
20:00 <hakunin> i see that SYN_RECV is starting to rise from zero to 30s-40s and loader starts showing timeouts and 500s
20:01 <hakunin> it works flawlessly at 2500 clients per second
20:01 <hakunin> the response times are always at 1-2ms
20:01 <Nicd-> 3000 isn't that much, what are your system specs?
20:02 <hakunin> c3.2xlarge behind ELB, and i'm watching the spillover (i configured longer backlogs to avoid elb problems)
20:02 <hakunin> i have 2 of those behind ELB to be precise
20:02 <hakunin> 8 cores, 15GB ram
20:03 <Nicd-> that sounds like it should handle waaaay more
20:03 <Nicd-> I have an 8-core Intel Atom server that can do 3000-4000 req/s
20:03 <hakunin> yeah i know, last year i got 6k i believe
20:03 zabirauf joined
20:04 <hakunin> and those were eex template, not .txt
20:04 zabirauf joined
20:05 <hakunin> Nicd-: here's how i set up sysctl https://gist.github.com/maxim/f01d2647b22f16413fc67e58889ced17
20:05 <Nicd-> are you serving it with Plug.Static?
20:05 <hakunin> yes
20:05 <Nicd-> I don't know anything about sysctl
20:06 <hakunin> tried bumping those bottom numbers (somaxconn and friends) much higher
20:06 <hakunin> and all it does is prevent spillover at ELB, but app is getting SYN-flooded
20:06 <hakunin> which leads me to believe the problem might be in beam/elixir…
20:07 <tristan__> Nicd-: req/s or connections? hakunin is having an issue with # connections not reqs, right?
20:08 <hakunin> tristan__: i'm load-testing with loader.io that sends 3000 http reqs per second to /robots.txt
20:08 Ven joined
20:09 <hakunin> i'm not trying to keep persistent connections open
20:10 <hakunin> but i was expecting elixir to serve these a lot easier/faster
20:10 <hakunin> trying to find a bottleneck
20:11 <Nicd-> can you share your code?
20:12 <tristan__> right, I'm saying it sounded like you were having issues with connection handling. which keeping them open and seeing if connecting them sequentially and then sending concurrent requests on open connections fixed the issue you'd know if that was the case
20:13 sid_fules joined
20:15 <hakunin> Nicd-: here's endpoint.ex https://gist.github.com/maxim/f01d2647b22f16413fc67e58889ced17
20:15 potatosalad joined
20:15 <tristan__> how's cowboy/ranch configured, how is beam configured
20:16 <hakunin> tristan__: not at all
20:16 <tristan__> oh
20:17 <tristan__> how are you starting the sesrver
20:18 <hakunin> tristan__: i build it with distillery in a docker image that has vanilla erlang-solutions packages, include erlang and friends into the package, then deploy it onto instances by unpacking tar, and running systemd unit via bin/app foreground
20:22 <hakunin> the instances have sysctl -w commands in their user-data, they launch with correct values written, but to experiment i've been making changes manually and restarting the systemd unit
20:23 johnstorey joined
20:23 <hakunin> i'm not 100% certain that my sysctl changes are picked up when i stop and start app service
20:24 <hakunin> i hope they are since they're written with sysctl -w
20:26 quaristice joined
20:29 <hakunin> what's kind of annoying
20:29 Bounga joined
20:29 r00tl3ss joined
20:30 <hakunin> is that for the first 10-15secs i see 3000 clients per sec being served flawlessly at a steady 1-2ms response time, but then i observe SYN_RECV going up and it starts responding with 500s and timeouts
20:31 <hakunin> i see beam eating 200-300% cpu during these tests and not much memory, i'm sure it can handle a lot more
20:31 trevoke joined
20:31 <Nicd-> 300 % would mean the CPU is used less than half
20:32 <hakunin> yeah
20:32 <hakunin> netstat -an | grep -c SYN_RECV <- when this becomes non-zero, everything breaks
20:33 <hakunin> but why does it ever have to queue anything? shouldn't cowboy accept a ton more before it backlogs things?
20:34 <hakunin> it's as though maybe there's a limit on processes still being hit somewhere…
20:37 jschneck joined
20:38 <hakunin> just ran another test and it held fine for a whole 25 seconds before it started messing up
20:38 sid_fules joined
20:38 <hakunin> cpu never exceeding 170%
20:40 klltkr joined
20:41 <tristan__> how many acceptors do you have
20:41 <jschneck> There is something about Registry that I don't understand. From what I can tell, the only way to wild card match is against values and not keys. For example, if I were to make my keys meaningful like {:net, "eth0", :ipv4_address}, I could later get that exact value. However, if I wanted all ip addresses for al interfaces {:net, :_, :ipv4_address} I would be unable to do that unless the original key was the value.
20:42 <hakunin> tristan__: acceptors? sorry could you clarify?
20:43 coatezy joined
20:43 <tristan__> hakunin: cowboy starts a certain number of acceptor processes that are responsible for acceptin gthe new connections
20:43 <hakunin> tristan__: is that configurable somewhere at elixir/phoenix level?
20:43 <jschneck> So I am left thinking that I would always want to perform a match, which leaves the keys meaning less to me, but then it makes register less meaningful
20:43 <tristan__> hakunin: I'm sure, but I don't know where in phoenix
20:43 potatosalad joined
20:43 <hakunin> googling hard
20:44 cemilowski joined
20:44 cemilowski left
20:44 potatosalad joined
20:45 <hakunin> tristan__: default is 100
20:45 <tristan__> oh
20:46 <tristan__> shouldn't need more than that
20:46 <hakunin> tristan__: and max_connections is set to 16_384 by default
20:49 <hakunin> if i understand correctly, this could have an effect
20:50 <hakunin> although, if that's pretty mcuh 16_384 * 100 concurrent connections accepted, then maybe it shouldn't
20:52 <hakunin> just read a bit more about SYN_RECV and i think i'm starting to get an idea what might be going on
20:53 apotry joined
20:54 willyk joined
20:55 willyk left
20:55 <hakunin> client tries 3000 tcp handshakes per sec, server responds with SYN+ACK, and expects client to respond with ACK to complete the handshake, and client fails to do that, so SYN_RECV is growing, but the question is, why does client fail to respond with ACK
20:56 <hakunin> maybe the problem is on the load-testing service side
20:56 <tristan__> so you are doing a SYN flood attack on yourself
20:56 <tristan__> hehe
20:56 milad joined
20:56 milad joined
20:56 <hakunin> tristan__: yeah
20:56 <hakunin> but why does loader.io do that
20:56 <hakunin> maybe the ACKs can't get through
20:57 <hakunin> although, if i understand correctly, this handshake is not separate requests
21:00 duane joined
21:00 <hakunin> what's also interesting is that i have syncookies enabled apparently
21:00 josevalim_ joined
21:03 MotherFlojo joined
21:03 PaReeOhNos joined
21:06 jschneck joined
21:07 TarVanim_ joined
21:07 Ven joined
21:09 potatosalad joined
21:09 Ven joined
21:09 mkh_ joined
21:09 <mkh_> hello
21:10 <mkh_> jhvjhbjbkj
21:10 mkh_ left
21:10 johnstorey joined
21:12 markh joined
21:12 tomaz_b joined
21:12 <benwilson512> \o
21:13 duane joined
21:16 MotherFlojo joined
21:17 zabirauf joined
21:22 wsieroci joined
21:27 <benwilson512> fishcakez: what kind of API would you expect for setting the extensions key?
21:28 smt__ joined
21:28 sid_fules joined
21:29 <benwilson512> refactoring the result phase to permit it is easy enough, but I'm not entirely clear on how values get there
21:31 zabirauf_ joined
21:31 Bounga joined
21:33 nanohest joined
21:37 <fishcakez> benwilson512: I want be able to set using middlewares, and return an introspection style free under an extension key
21:37 <benwilson512> right
21:37 <fishcakez> s/free/tree
21:37 <fishcakez> Except it has explaination and timings
21:39 <benwilson512> right so the 3 different result objects
21:39 <benwilson512> list, object, leaf
21:39 <benwilson512> could have an extensions key that was populated by the Absinthe.Resolution struct that built it's extensions key
21:39 <benwilson512> middleware can place stuff on the extensions key
21:40 <benwilson512> and then populating the root extensions key is just a matter of walking the result tree
21:40 <benwilson512> and plucking off extension info
21:41 <fishcakez> Yeah sounds ideal
21:41 <benwilson512> it'll require two passes on the result tree but I don't think that's a huge deal
21:41 <fishcakez> How does that namespace?
21:41 <benwilson512> good question
21:42 <benwilson512> my general model so far is that the middleware placing the values has the responsibility of namespacing
21:42 <fishcakez> Let's say I want extensions: absinthe: explain_snalyze: tree here
21:42 <benwilson512> ah good question
21:42 <benwilson512> it depends on how automatic the extensions tree building phase is
21:42 <benwilson512> the issue is that unlike the result tree
21:43 <benwilson512> the values of the extensions key can be anything
21:43 <fishcakez> I wonder what existing examples are in wild
21:43 <benwilson512> I'm tempted to say each extension would have to provide a phase to build its portion of the extensions key
21:43 <fishcakez> That seems fair
21:44 <benwilson512> it does mean that N extensions is N passes on the result tree but frankly my sense is that in practice these things wouldn't be run on high load production situations
21:44 icanhazbroccoli joined
21:44 <fishcakez> That's likely better for me as can have explain, explaon_analyze and analyze
21:44 <benwilson512> precisely
21:45 icanhazbroccoli joined
21:45 jhack_ joined
21:45 <benwilson512> total side note: I've been having crazy ideas about taking the idea of compiling documents even further and trying to emit bytecode of some kind
21:45 <fishcakez> Could even collect the complexity into those extensions in a phase
21:45 <benwilson512> yup
21:46 icanhazbroccoli joined
21:46 Or1on joined
21:46 <fishcakez> Emit bytecode?
21:46 sid_fules joined
21:46 <benwilson512> this is more of a musing than a concrete plan, but the more I work on this stuff the more it feels like I'm writing an interpreter
21:46 icanhazbroccoli joined
21:46 <benwilson512> for a very declarative language
21:47 <benwilson512> that includes escape hatches into "native" code (middleware)
21:48 <benwilson512> we have basic document provider support now which can do some basic ahead of time work on known documents
21:48 <benwilson512> and I'm just musing about how far that could be taken
21:48 <benwilson512> could we get to a point where instead of interpreting documents, fully known ones could be compiled to some ever lower level
21:52 milad joined
21:53 <benwilson512> maybe it would be enough to see if I could take a blueprint tree and transform it into an elixir AST tree
22:06 <fishcakez> How would that play in with custom phases?
22:06 <fishcakez> I'm not sure how persistent queries work now though
22:06 <benwilson512> prepared documents are in general a combination of document + schema + pipeline
22:06 jschneck joined
22:06 <fishcakez> So it jumps phases?
22:07 <benwilson512> it runs the document through a pipeline as far as it can
22:07 <benwilson512> which at the moment is mostly just parsing
22:07 <benwilson512> because of how we handle variables
22:07 <fishcakez> Ah
22:07 <benwilson512> with a few changes you could do nearly all the way up till resolution
22:07 <benwilson512> at compile time
22:07 <benwilson512> and then add a brief phase to check variables, and then resolve
22:07 <benwilson512> at runtime
22:08 sid_fules joined
22:08 <fishcakez> So it would go up to just before validation finishes
22:08 <benwilson512> yup
22:08 arathunku joined
22:09 tomaz_b joined
22:10 <benwilson512> the idea is that the result would be an elixir function like SomeDoc.run that takes variable value input
22:10 <iFire> fishcakez: you free?
22:10 <fishcakez> Ye
22:10 <fishcakez> Ben sidetracked me
22:10 <iFire> So https://github.com/fire/snappyex/blob/master/lib/snappyex/protocol.ex#L154 has a hard coded test case.
22:10 zabirauf joined
22:11 <iFire> the idea is I fetch query.columns use query_columns_list(map) and decode it
22:11 <iFire> and then turn it to the specific encoding needed
22:11 <iFire> {x.name, type}
22:12 <iFire> where I combine it with the parameters and turn it into something like that test case
22:13 willyk joined
22:13 racycle joined
22:13 zabirauf_ joined
22:14 <iFire> Having problems where I can't get the type before I use the parameter.
22:16 <iFire> prepare statement -> get type -> decode type -> ??? (store type) -> caching -> execute param type encoded
22:17 <fishcakez> store the param types in the query struct
22:18 uiyo joined
22:18 <fishcakez> this should happen before you reach that point
22:18 <fishcakez> inside the DBConnection.Query.encode callback
22:18 luke_nukem joined
22:19 <iFire> I only know the types after the prepare statement is done.
22:19 <fishcakez> when do you know the types?
22:20 <iFire> https://github.com/fire/snappyex/blob/master/lib/snappyex/protocol.ex#L232
22:20 <iFire> here
22:20 <iFire> the specific types to list mapping
22:21 <fishcakez> ok
22:21 <iFire> So once I know what type the parameter is I can run a static type to thrift struct command
22:22 <fishcakez> the order of execution is: parse -> prepare -> describe -> encode -> execute -> decode
22:22 <fishcakez> therefore you should know the types at encode time, because they were collected during prepare
22:23 <iFire> is this at the elixir level or a round trip to the server level
22:23 <fishcakez> the order of execution is at elixir level
22:23 <fishcakez> only prepare and execute have access to the socket
22:23 <fishcakez> it is expected that each one does a roundtrip
22:24 <iFire> so I need to get the data from the prepare into the describe stage
22:24 <fishcakez> right
22:24 <fishcakez> the result of handle_prepare is passed to describe
22:24 <iFire> ah, I don't think I implemented that
22:24 <iFire> https://hexdocs.pm/db_connection/DBConnection.Query.html#describe/2
22:25 <fishcakez> you may not need to do anything in describe
22:25 wsieroci joined
22:25 <fishcakez> AFAIK no one is using describe anymore, legacy :(
22:26 <iFire> I want to put a function that turns the raw metadata to a {"name", :varchar} (for example) somewhere
22:27 <fishcakez> ah then describe likely make sense
22:27 <iFire> then encode takes the {"name", :varchar} and turns it into a thrift struct
22:27 wsieroci_ joined
22:27 <iFire> {"name", :varchar} and [["name"]]
22:28 <fishcakez> ah
22:28 <iFire> hmm for clarity let's say that's [["fortytwo"]]
22:28 <fishcakez> so rather, you will have a list of [:varchar, :integer_32] which are the param types
22:28 <iFire> Is this a good idea?
22:28 <fishcakez> and param values ["name", 42]
22:28 <iFire> yeah
22:28 <fishcakez> this is what postgrex does
22:29 <fishcakez> except it has module names for types instead of descriptive atoms
22:31 <fishcakez> iFire: https://github.com/fire/snappyex/blob/master/lib/snappyex/protocol.ex#L232 is confusing, would except columns + params types? or just param types maybe since its thrift
22:32 Bounga joined
22:32 <iFire> 4: optional list<ColumnDescriptor> resultSetMetaData
22:32 <iFire> that's what the columns is
22:32 <iFire> a list of ColumnDescriptors
22:32 <iFire> https://github.com/fire/snappyex/blob/master/thrift/snappydata.thrift#L547
22:32 <iFire> I decode 1: required SnappyType type
22:33 <iFire> from that integer into a atom using a lookup table
22:33 <iFire> https://github.com/fire/snappyex/blob/master/thrift/snappydata.thrift#L86
22:34 <iFire> so this is the result of the prepared statement
22:34 PaReeOhNos joined
22:34 <iFire> when I prepareExecute
22:34 <iFire> I give it a statement id
22:34 <iFire> and the params
22:34 <fishcakez> right
22:35 <fishcakez> so in describe you need to work out what you want to do with the params, i.e. what types they are
22:35 <fishcakez> and in encode you read that info to encode the parameters
22:36 willyk joined
22:37 ariedler joined
22:40 sid_fules joined
22:42 raycoll joined
22:47 oborot joined
22:54 jschneck joined
22:56 <carterparks> ugh i hate the state of javascript
22:57 <carterparks> why is it so frickin hard for me to config webpack 2 to show me some react components?
22:57 <carterparks> you guys remember back in the day
22:57 <carterparks> youd go <script src="scripts/jquery.js">
22:57 <carterparks> and then <script src="scripts/application.js">
22:58 <carterparks> and it just worked?
23:00 sid_fules joined
23:01 <ivan> carterparks: you can still write JavaScript like that if you want
23:02 <carterparks> ivan: kinda sorta not really
23:02 <carterparks> i mean ya i can
23:02 <carterparks> but i dont think i can go back to the pre-es6 world
23:04 <ivan> you could use babel just to compile ES6 for ES5 clients after you're "done" developing
23:04 <ivan> I think the vast majority should have ES6 at this point anyway
23:07 <carterparks> ivan: i know i COULD
23:07 <carterparks> but you know what i mean
23:14 duane joined
23:18 <ivan> I guess http://jspm.io/ may be of interest
23:19 sid_fules joined
23:19 <ivan> pages are slower to load, though
23:20 rschmukler joined
23:20 jschneck joined
23:23 markh joined
23:26 rschmukler joined
23:27 w-t-h_ joined
23:33 Bounga joined
23:36 felix__ joined
23:41 <felix__> Hi there! Is there a way to represent objects in arrays with html input name notation? An input with attributes `name=“test[0][foo]” value=“bar”` will send %{“test” => %{“0” => %{“foo” => ”bar”}}} but I’d like to receive %{“test” => [%{ “foo” => “bar” }]}
23:42 <felix__> I'm talking about Phoenix by the way
23:45 <dimitarvp> felix__: There's a more generic way to do this, but for your specific case:
23:45 <dimitarvp> map = %{"test" => %{"0" => %{"foo" => "bar"}, "1" => %{"x" => 1}}}
23:45 <dimitarvp> Map.values map["test"]
23:46 <dimitarvp> returns this:
23:46 <ciawal> I think inputs_for does this?
23:46 <dimitarvp> [%{"foo" => "bar"}, %{"x" => 1}]
23:46 <ciawal> so it should work I thought
23:49 sid_fules joined
23:49 meh` joined
23:50 <felix__> dimitarvp: thanks, I guess this is what I'm going to do
23:50 <dimitarvp> felix__: that's awfully bad though, you should make sure to sort by the keys ("0", "1" etc.)
23:50 <dimitarvp> better make a function for yourself which can go recursively + sort by the keys
23:51 <dimitarvp> my "solution" is like... off the top of my head
23:51 sid_fules joined
23:51 <felix__> I don't really need to have the elements sorted in that case
23:51 <felix__> I think Rails would create arrays automagically from integers in square brackets
23:51 zabirauf joined
23:52 <felix__> so I was wondering if there was a way to achieve this with Phoenix currently
23:52 <felix__> but it makes sense to just send objects
23:52 <felix__> because what if you want to have integers as keys
23:52 <felix__> haha
23:52 <carterparks> finally webpack 2 configured to my liking
23:55 <ciawal> felix__: maybe youc an use inputs_for
23:55 <felix__> ciawal: I'm creating the inputs dynamically client side
23:56 <felix__> using VueJS
23:56 sid_fules joined
23:57 mcspud joined
23:58 sillyotter joined
23:58 johnstorey joined